summaryrefslogtreecommitdiffstats
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/README18
-rw-r--r--mysql-test/README.stress25
-rw-r--r--mysql-test/collections/buildbot_suites.bat2
-rw-r--r--mysql-test/collections/smoke_test1
-rw-r--r--mysql-test/include/analyze-format.inc2
-rw-r--r--mysql-test/include/analyze-no-filtered.inc2
-rw-r--r--mysql-test/include/binlog_combinations.combinations11
-rw-r--r--mysql-test/include/binlog_combinations.inc8
-rw-r--r--mysql-test/include/binlog_format_combinations.combinations8
-rw-r--r--mysql-test/include/binlog_format_combinations.inc5
-rw-r--r--mysql-test/include/check-testcase.test4
-rw-r--r--mysql-test/include/check_digest.inc34
-rw-r--r--mysql-test/include/check_digest_end.inc9
-rw-r--r--mysql-test/include/common-tests.inc20
-rw-r--r--mysql-test/include/concurrent.inc4
-rw-r--r--mysql-test/include/ctype_numconv.inc1
-rw-r--r--mysql-test/include/default_client.cnf2
-rw-r--r--mysql-test/include/default_my.cnf3
-rw-r--r--mysql-test/include/default_optimizer_switch.inc2
-rw-r--r--mysql-test/include/delete_use_source.inc94
-rw-r--r--mysql-test/include/delete_use_source_cases.inc216
-rw-r--r--mysql-test/include/delete_use_source_cases_memory.inc296
-rw-r--r--mysql-test/include/delete_use_source_cases_non_innodb.inc81
-rw-r--r--mysql-test/include/delete_use_source_innodb.inc91
-rw-r--r--mysql-test/include/delete_use_source_memory.inc33
-rw-r--r--mysql-test/include/explain-no-costs-filtered.inc1
-rw-r--r--mysql-test/include/explain-no-costs.inc1
-rw-r--r--mysql-test/include/explain_non_select.inc16
-rw-r--r--mysql-test/include/galera_cluster.inc2
-rw-r--r--mysql-test/include/galera_variables_ok.inc2
-rw-r--r--mysql-test/include/have_wsrep_enabled.inc2
-rw-r--r--mysql-test/include/icp_tests.inc6
-rw-r--r--mysql-test/include/index_merge1.inc2
-rw-r--r--mysql-test/include/last_query_cost.inc5
-rw-r--r--mysql-test/include/load_dump_and_upgrade.inc2
-rw-r--r--mysql-test/include/mix1.inc8
-rw-r--r--mysql-test/include/mix2.inc2
-rw-r--r--mysql-test/include/mtr_warnings.sql1
-rw-r--r--mysql-test/include/percona_nonflushing_analyze_debug.inc2
-rw-r--r--mysql-test/include/rowid_filter_debug_kill.inc22
-rw-r--r--mysql-test/include/rpl_change_topology.inc4
-rw-r--r--mysql-test/include/rpl_clone_slave_using_mariadb-backup.inc23
-rw-r--r--mysql-test/include/sargable_casefold.inc44
-rw-r--r--mysql-test/include/update_use_source.inc292
-rw-r--r--mysql-test/include/update_use_source_cases.inc183
-rw-r--r--mysql-test/include/update_use_source_ext.inc59
-rw-r--r--mysql-test/include/world.inc2
-rw-r--r--mysql-test/lib/My/Debugger.pm2
-rwxr-xr-xmysql-test/lib/generate-ssl-certs.sh2
-rw-r--r--mysql-test/lib/mtr_cases.pm12
-rwxr-xr-xmysql-test/lib/ssl-mitm.pl95
-rwxr-xr-xmysql-test/lib/v1/mysql-test-run.pl24
-rw-r--r--mysql-test/main/alter_events.result1
-rw-r--r--mysql-test/main/alter_events.test1
-rw-r--r--mysql-test/main/alter_table.result44
-rw-r--r--mysql-test/main/alter_table.test34
-rw-r--r--mysql-test/main/alter_table_combinations,aria.rdiff4
-rw-r--r--mysql-test/main/alter_table_combinations,heap.rdiff4
-rw-r--r--mysql-test/main/alter_table_lock.result45
-rw-r--r--mysql-test/main/alter_table_lock.test52
-rw-r--r--mysql-test/main/alter_table_locknone.result251
-rw-r--r--mysql-test/main/alter_table_locknone.test311
-rw-r--r--mysql-test/main/alter_table_locknone_notembedded.result25
-rw-r--r--mysql-test/main/alter_table_locknone_notembedded.test22
-rw-r--r--mysql-test/main/alter_table_online.result520
-rw-r--r--mysql-test/main/alter_table_online.test546
-rw-r--r--mysql-test/main/alter_table_online_debug.result1837
-rw-r--r--mysql-test/main/alter_table_online_debug.test2107
-rw-r--r--mysql-test/main/analyze_engine_stats.result9
-rw-r--r--mysql-test/main/analyze_format_json.result94
-rw-r--r--mysql-test/main/analyze_format_json.test2
-rw-r--r--mysql-test/main/analyze_format_json_timings.result14
-rw-r--r--mysql-test/main/analyze_stmt.result4
-rw-r--r--mysql-test/main/analyze_stmt_orderby.result41
-rw-r--r--mysql-test/main/analyze_stmt_orderby.test6
-rw-r--r--mysql-test/main/analyze_stmt_privileges2.result95
-rw-r--r--mysql-test/main/analyze_stmt_privileges2.test15
-rw-r--r--mysql-test/main/backup_interaction.result18
-rw-r--r--mysql-test/main/backup_interaction.test18
-rw-r--r--mysql-test/main/backup_lock.result2
-rw-r--r--mysql-test/main/backup_lock.test2
-rw-r--r--mysql-test/main/backup_stages.result20
-rw-r--r--mysql-test/main/backup_stages.test20
-rw-r--r--mysql-test/main/brackets.result26
-rw-r--r--mysql-test/main/brackets.test5
-rw-r--r--mysql-test/main/bug12427262.result6
-rw-r--r--mysql-test/main/bug46760-master.opt1
-rw-r--r--mysql-test/main/change_user.result1
-rw-r--r--mysql-test/main/change_user.test4
-rw-r--r--mysql-test/main/check_constraint.result59
-rw-r--r--mysql-test/main/check_constraint.test32
-rw-r--r--mysql-test/main/column_compression_parts.test1
-rw-r--r--mysql-test/main/comments.result10
-rw-r--r--mysql-test/main/comments.test6
-rw-r--r--mysql-test/main/commit.result44
-rw-r--r--mysql-test/main/commit.test26
-rw-r--r--mysql-test/main/compress.result19
-rw-r--r--mysql-test/main/concurrent_innodb_safelog.result4
-rw-r--r--mysql-test/main/concurrent_innodb_unsafelog.result8
-rw-r--r--mysql-test/main/concurrent_innodb_unsafelog.test4
-rw-r--r--mysql-test/main/connect.result24
-rw-r--r--mysql-test/main/connect.test20
-rw-r--r--mysql-test/main/connect2.result2
-rw-r--r--mysql-test/main/connect2.test2
-rw-r--r--mysql-test/main/connect_debug.result20
-rw-r--r--mysql-test/main/connect_debug.test23
-rw-r--r--mysql-test/main/costs.result126
-rw-r--r--mysql-test/main/costs.test116
-rw-r--r--mysql-test/main/crash_commit_before-master.opt1
-rw-r--r--mysql-test/main/create.result22
-rw-r--r--mysql-test/main/create_or_replace2.result3
-rw-r--r--mysql-test/main/create_or_replace2.test2
-rw-r--r--mysql-test/main/cset_narrowing.result45
-rw-r--r--mysql-test/main/cset_narrowing.test10
-rw-r--r--mysql-test/main/cte_nonrecursive.result34
-rw-r--r--mysql-test/main/cte_recursive.result151
-rw-r--r--mysql-test/main/cte_recursive.test3
-rw-r--r--mysql-test/main/ctype_binary.result5
-rw-r--r--mysql-test/main/ctype_collate.result2
-rw-r--r--mysql-test/main/ctype_collate_implicit.result291
-rw-r--r--mysql-test/main/ctype_collate_implicit.test237
-rw-r--r--mysql-test/main/ctype_collate_implicit_def.opt1
-rw-r--r--mysql-test/main/ctype_collate_implicit_def.result85
-rw-r--r--mysql-test/main/ctype_collate_implicit_def.test73
-rw-r--r--mysql-test/main/ctype_collate_implicit_utf32.result19
-rw-r--r--mysql-test/main/ctype_collate_implicit_utf32.test16
-rw-r--r--mysql-test/main/ctype_cp1251.result5
-rw-r--r--mysql-test/main/ctype_gbk.result4
-rw-r--r--mysql-test/main/ctype_latin1.result5
-rw-r--r--mysql-test/main/ctype_ucs.result9
-rw-r--r--mysql-test/main/ctype_upgrade.result2
-rw-r--r--mysql-test/main/ctype_upgrade.test2
-rw-r--r--mysql-test/main/ctype_utf32.result7
-rw-r--r--mysql-test/main/ctype_utf32.test7
-rw-r--r--mysql-test/main/ctype_utf8.result6
-rw-r--r--mysql-test/main/ctype_utf8mb4.result1
-rw-r--r--mysql-test/main/ctype_utf8mb4_heap.result1
-rw-r--r--mysql-test/main/ctype_utf8mb4_innodb.result1
-rw-r--r--mysql-test/main/ctype_utf8mb4_myisam.result1
-rw-r--r--mysql-test/main/custom_aggregates_i_s.result2
-rw-r--r--mysql-test/main/date_formats-master.opt1
-rw-r--r--mysql-test/main/date_formats.result103
-rw-r--r--mysql-test/main/date_formats.test197
-rw-r--r--mysql-test/main/delayed.test2
-rw-r--r--mysql-test/main/delete.result56
-rw-r--r--mysql-test/main/delete.test49
-rw-r--r--mysql-test/main/delete_innodb.result562
-rw-r--r--mysql-test/main/delete_innodb.test201
-rw-r--r--mysql-test/main/delete_returning.result16
-rw-r--r--mysql-test/main/delete_returning.test13
-rw-r--r--mysql-test/main/delete_single_to_multi.result4252
-rw-r--r--mysql-test/main/delete_single_to_multi.test1069
-rw-r--r--mysql-test/main/delete_use_source.result184
-rw-r--r--mysql-test/main/delete_use_source.test120
-rw-r--r--mysql-test/main/delete_use_source_engines.result8870
-rw-r--r--mysql-test/main/delete_use_source_engines.test42
-rw-r--r--mysql-test/main/derived.result514
-rw-r--r--mysql-test/main/derived.test333
-rw-r--r--mysql-test/main/derived_cond_pushdown.result2669
-rw-r--r--mysql-test/main/derived_cond_pushdown.test208
-rw-r--r--mysql-test/main/derived_opt.result9
-rw-r--r--mysql-test/main/derived_split_innodb.result82
-rw-r--r--mysql-test/main/derived_split_innodb.test14
-rw-r--r--mysql-test/main/derived_view.result135
-rw-r--r--mysql-test/main/derived_view.test8
-rw-r--r--mysql-test/main/desc_index_min_max.result179
-rw-r--r--mysql-test/main/desc_index_min_max.test167
-rw-r--r--mysql-test/main/desc_index_range.result2
-rw-r--r--mysql-test/main/disabled.def1
-rw-r--r--mysql-test/main/distinct.result27
-rw-r--r--mysql-test/main/distinct.test5
-rw-r--r--mysql-test/main/except.result54
-rw-r--r--mysql-test/main/except.test2
-rw-r--r--mysql-test/main/except_all.result60
-rw-r--r--mysql-test/main/except_all.test4
-rw-r--r--mysql-test/main/explain.result17
-rw-r--r--mysql-test/main/explain.test3
-rw-r--r--mysql-test/main/explain_innodb.result2
-rw-r--r--mysql-test/main/explain_json.result314
-rw-r--r--mysql-test/main/explain_json.test64
-rw-r--r--mysql-test/main/explain_json_format_partitions.result6
-rw-r--r--mysql-test/main/explain_json_format_partitions.test1
-rw-r--r--mysql-test/main/explain_json_innodb.result11
-rw-r--r--mysql-test/main/explain_json_innodb.test1
-rw-r--r--mysql-test/main/explain_non_select.result12
-rw-r--r--mysql-test/main/features.result22
-rw-r--r--mysql-test/main/features.test18
-rw-r--r--mysql-test/main/fetch_first.result77
-rw-r--r--mysql-test/main/fetch_first.test19
-rw-r--r--mysql-test/main/filesort_debug.result3
-rw-r--r--mysql-test/main/filesort_debug.test4
-rw-r--r--mysql-test/main/flush-innodb.result5
-rw-r--r--mysql-test/main/flush-innodb.test7
-rw-r--r--mysql-test/main/flush_corruption.result (renamed from mysql-test/main/merge-big.result)0
-rw-r--r--mysql-test/main/flush_corruption.test (renamed from mysql-test/main/merge-big.test)2
-rw-r--r--mysql-test/main/fulltext.result7
-rw-r--r--mysql-test/main/fulltext.test2
-rw-r--r--mysql-test/main/func_des_encrypt.result45
-rw-r--r--mysql-test/main/func_des_encrypt.test11
-rw-r--r--mysql-test/main/func_encrypt.result166
-rw-r--r--mysql-test/main/func_encrypt_nossl.result64
-rw-r--r--mysql-test/main/func_encrypt_ucs2.result8
-rw-r--r--mysql-test/main/func_format.result213
-rw-r--r--mysql-test/main/func_format.test120
-rw-r--r--mysql-test/main/func_group.result7
-rw-r--r--mysql-test/main/func_group_innodb.result6
-rw-r--r--mysql-test/main/func_group_innodb.test2
-rw-r--r--mysql-test/main/func_hybrid_type.result4
-rw-r--r--mysql-test/main/func_json.result2576
-rw-r--r--mysql-test/main/func_json.test2210
-rw-r--r--mysql-test/main/func_kdf,old.rdiff64
-rw-r--r--mysql-test/main/func_kdf.combinations4
-rw-r--r--mysql-test/main/func_kdf.result163
-rw-r--r--mysql-test/main/func_kdf.test64
-rw-r--r--mysql-test/main/func_str.result152
-rw-r--r--mysql-test/main/func_str.test94
-rw-r--r--mysql-test/main/func_time.result8
-rw-r--r--mysql-test/main/gis-alter_table.result (renamed from mysql-test/main/gis-alter_table_online.result)0
-rw-r--r--mysql-test/main/gis-alter_table.test (renamed from mysql-test/main/gis-alter_table_online.test)0
-rw-r--r--mysql-test/main/grant.result17
-rw-r--r--mysql-test/main/grant2.result4
-rw-r--r--mysql-test/main/grant5.result5
-rw-r--r--mysql-test/main/grant5.test1
-rw-r--r--mysql-test/main/grant_binlog_replay.result21
-rw-r--r--mysql-test/main/grant_binlog_replay.test27
-rw-r--r--mysql-test/main/grant_kill.result24
-rw-r--r--mysql-test/main/grant_kill.test29
-rw-r--r--mysql-test/main/grant_server.result18
-rw-r--r--mysql-test/main/grant_server.test15
-rw-r--r--mysql-test/main/grant_slave_admin.result29
-rw-r--r--mysql-test/main/grant_slave_admin.test25
-rw-r--r--mysql-test/main/grant_slave_monitor.result30
-rw-r--r--mysql-test/main/grant_slave_monitor.test33
-rw-r--r--mysql-test/main/greedy_optimizer.result216
-rw-r--r--mysql-test/main/greedy_optimizer.test28
-rw-r--r--mysql-test/main/group_by.result68
-rw-r--r--mysql-test/main/group_by.test31
-rw-r--r--mysql-test/main/group_min_max.result74
-rw-r--r--mysql-test/main/group_min_max.test25
-rw-r--r--mysql-test/main/group_min_max_innodb.result23
-rw-r--r--mysql-test/main/group_min_max_innodb.test3
-rw-r--r--mysql-test/main/having_cond_pushdown.result466
-rw-r--r--mysql-test/main/having_cond_pushdown.test146
-rw-r--r--mysql-test/main/ignored_index.result14
-rw-r--r--mysql-test/main/ignored_index.test8
-rw-r--r--mysql-test/main/in_subq_cond_pushdown.result344
-rw-r--r--mysql-test/main/in_subq_cond_pushdown.test38
-rw-r--r--mysql-test/main/index_intersect.result25
-rw-r--r--mysql-test/main/index_intersect.test1
-rw-r--r--mysql-test/main/index_intersect_innodb.result31
-rw-r--r--mysql-test/main/index_merge_innodb.result8
-rw-r--r--mysql-test/main/index_merge_myisam.result20
-rw-r--r--mysql-test/main/information_schema-big.result6
-rw-r--r--mysql-test/main/information_schema.result44
-rw-r--r--mysql-test/main/information_schema_all_engines.result20
-rw-r--r--mysql-test/main/information_schema_db.result4
-rw-r--r--mysql-test/main/information_schema_parameters.result32
-rw-r--r--mysql-test/main/information_schema_routines.result62
-rw-r--r--mysql-test/main/information_schema_temp_table.result321
-rw-r--r--mysql-test/main/information_schema_temp_table.test280
-rw-r--r--mysql-test/main/innodb_ext_key,off.rdiff18
-rw-r--r--mysql-test/main/innodb_ext_key.result31
-rw-r--r--mysql-test/main/innodb_ext_key.test18
-rw-r--r--mysql-test/main/innodb_icp.result20
-rw-r--r--mysql-test/main/innodb_mysql_lock2.result18
-rw-r--r--mysql-test/main/innodb_mysql_lock2.test3
-rw-r--r--mysql-test/main/innodb_mysql_sync.result11
-rw-r--r--mysql-test/main/innodb_mysql_sync.test10
-rw-r--r--mysql-test/main/insert.result2
-rw-r--r--mysql-test/main/insert_returning.result20
-rw-r--r--mysql-test/main/insert_returning.test14
-rw-r--r--mysql-test/main/intersect.result57
-rw-r--r--mysql-test/main/intersect.test2
-rw-r--r--mysql-test/main/intersect_all.result57
-rw-r--r--mysql-test/main/intersect_all.test4
-rw-r--r--mysql-test/main/invisible_field.result4
-rw-r--r--mysql-test/main/invisible_field_debug.result6
-rw-r--r--mysql-test/main/join.result65
-rw-r--r--mysql-test/main/join.test33
-rw-r--r--mysql-test/main/join_cache.result161
-rw-r--r--mysql-test/main/join_cache.test66
-rw-r--r--mysql-test/main/join_cache_cardinality.result2
-rw-r--r--mysql-test/main/join_cache_debug.result8
-rw-r--r--mysql-test/main/join_nested.result50
-rw-r--r--mysql-test/main/join_nested.test1
-rw-r--r--mysql-test/main/join_nested_jcl6.result134
-rw-r--r--mysql-test/main/join_outer.result14
-rw-r--r--mysql-test/main/join_outer.test2
-rw-r--r--mysql-test/main/join_outer_innodb.result40
-rw-r--r--mysql-test/main/join_outer_jcl6.result36
-rw-r--r--mysql-test/main/json_debug_nonembedded.result7
-rw-r--r--mysql-test/main/json_debug_nonembedded.test9
-rw-r--r--mysql-test/main/key.result52
-rw-r--r--mysql-test/main/key.test23
-rw-r--r--mysql-test/main/key_cache.result42
-rw-r--r--mysql-test/main/key_cache.test12
-rw-r--r--mysql-test/main/key_diff.result2
-rw-r--r--mysql-test/main/limit_rows_examined.result50
-rw-r--r--mysql-test/main/limit_rows_examined.test6
-rw-r--r--mysql-test/main/locale.result15
-rw-r--r--mysql-test/main/locale.test19
-rw-r--r--mysql-test/main/lock_multi_bug38499.result2
-rw-r--r--mysql-test/main/lock_multi_bug38499.test34
-rw-r--r--mysql-test/main/lock_multi_bug38691.test16
-rw-r--r--mysql-test/main/lock_sync-master.opt1
-rw-r--r--mysql-test/main/lock_sync.result16
-rw-r--r--mysql-test/main/lock_sync.test2
-rw-r--r--mysql-test/main/locking_clause.result8
-rw-r--r--mysql-test/main/log_slow_debug.result16
-rw-r--r--mysql-test/main/log_state.result2
-rw-r--r--mysql-test/main/log_tables_upgrade.result1
-rw-r--r--mysql-test/main/log_tables_upgrade.test2
-rw-r--r--mysql-test/main/long_unique.result18
-rw-r--r--mysql-test/main/long_unique.test1
-rw-r--r--mysql-test/main/lowercase_fs_off.result24
-rw-r--r--mysql-test/main/lowercase_fs_off.test18
-rw-r--r--mysql-test/main/lowercase_table.result27
-rw-r--r--mysql-test/main/lowercase_table.test40
-rw-r--r--mysql-test/main/lowercase_table2.result78
-rw-r--r--mysql-test/main/lowercase_table2.test56
-rwxr-xr-x[-rw-r--r--]mysql-test/main/lowercase_table4.result8
-rw-r--r--mysql-test/main/lowercase_table_grant.result8
-rw-r--r--mysql-test/main/mariadb-dump-debug.result4
-rw-r--r--mysql-test/main/mariadb-dump-debug.test15
-rw-r--r--mysql-test/main/mdev-25830.result10
-rw-r--r--mysql-test/main/mdl_sync.result8
-rw-r--r--mysql-test/main/mdl_sync.test10
-rw-r--r--mysql-test/main/metadata.result8
-rw-r--r--mysql-test/main/mix2_myisam.result4
-rw-r--r--mysql-test/main/mrr_derived_crash_4610.result2
-rw-r--r--mysql-test/main/multi_update.result287
-rw-r--r--mysql-test/main/multi_update.test142
-rw-r--r--mysql-test/main/multi_update_big.test8
-rw-r--r--mysql-test/main/myisam.result57
-rw-r--r--mysql-test/main/myisam.test41
-rw-r--r--mysql-test/main/myisam_debug.result2
-rw-r--r--mysql-test/main/myisam_explain_non_select_all.result514
-rw-r--r--mysql-test/main/myisam_icp.result28
-rw-r--r--mysql-test/main/myisam_icp.test2
-rw-r--r--mysql-test/main/myisam_mrr,32bit.rdiff4
-rw-r--r--mysql-test/main/myisam_mrr.result5
-rw-r--r--mysql-test/main/myisam_mrr.test5
-rw-r--r--mysql-test/main/mysql.result29
-rw-r--r--mysql-test/main/mysql.test32
-rw-r--r--mysql-test/main/mysql57_virtual.result4
-rw-r--r--mysql-test/main/mysql57_virtual.test4
-rw-r--r--mysql-test/main/mysql_client_test.result2
-rw-r--r--mysql-test/main/mysql_upgrade-20228.result1
-rw-r--r--mysql-test/main/mysql_upgrade-20228.test4
-rw-r--r--mysql-test/main/mysql_upgrade-28915.result2
-rw-r--r--mysql-test/main/mysql_upgrade-28915.test4
-rw-r--r--mysql-test/main/mysql_upgrade-6984.result5
-rw-r--r--mysql-test/main/mysql_upgrade-6984.test12
-rw-r--r--mysql-test/main/mysql_upgrade.result62
-rw-r--r--mysql-test/main/mysql_upgrade.test107
-rw-r--r--mysql-test/main/mysql_upgrade_file_leak.test2
-rw-r--r--mysql-test/main/mysql_upgrade_mysql_json.result1
-rw-r--r--mysql-test/main/mysql_upgrade_mysql_json.test2
-rw-r--r--mysql-test/main/mysql_upgrade_mysql_json_datatype.result1
-rw-r--r--mysql-test/main/mysql_upgrade_mysql_json_datatype.test2
-rw-r--r--mysql-test/main/mysql_upgrade_mysql_json_system_tables.test2
-rw-r--r--mysql-test/main/mysql_upgrade_mysql_json_with_plugin_loaded.result1
-rw-r--r--mysql-test/main/mysql_upgrade_mysql_json_with_plugin_loaded.test2
-rw-r--r--mysql-test/main/mysql_upgrade_no_innodb.test2
-rw-r--r--mysql-test/main/mysql_upgrade_noengine.result4
-rw-r--r--mysql-test/main/mysql_upgrade_noengine.test12
-rw-r--r--mysql-test/main/mysql_upgrade_ssl.result1
-rw-r--r--mysql-test/main/mysql_upgrade_ssl.test2
-rw-r--r--mysql-test/main/mysql_upgrade_to_100502.result10
-rw-r--r--mysql-test/main/mysql_upgrade_to_100502.test2
-rw-r--r--mysql-test/main/mysql_upgrade_view.result3
-rw-r--r--mysql-test/main/mysql_upgrade_view.test2
-rw-r--r--mysql-test/main/mysqlbinlog.result38
-rw-r--r--mysql-test/main/mysqlbinlog.test10
-rw-r--r--mysql-test/main/mysqlbinlog_row_minimal.result48
-rw-r--r--mysql-test/main/mysqld--help.result181
-rw-r--r--mysql-test/main/mysqldump-compat-102.result4
-rw-r--r--mysql-test/main/mysqldump-max.result8
-rw-r--r--mysql-test/main/mysqldump-system,win.rdiff12
-rw-r--r--mysql-test/main/mysqldump-system.result95
-rw-r--r--mysql-test/main/mysqldump-timing.result6
-rw-r--r--mysql-test/main/mysqldump-utf8mb4.result4
-rw-r--r--mysql-test/main/mysqldump-win.opt1
-rw-r--r--mysql-test/main/mysqldump-win.result9
-rw-r--r--mysql-test/main/mysqldump-win.test14
-rw-r--r--mysql-test/main/mysqldump.result263
-rw-r--r--mysql-test/main/mysqldump.test28
-rw-r--r--mysql-test/main/mysqltest-break.result9
-rw-r--r--mysql-test/main/mysqltest-break.test87
-rw-r--r--mysql-test/main/mysqltest_tracking_info.result141
-rw-r--r--mysql-test/main/mysqltest_tracking_info.test58
-rw-r--r--mysql-test/main/mysqltest_tracking_info_debug.result2
-rw-r--r--mysql-test/main/mysqltest_tracking_info_debug.test2
-rw-r--r--mysql-test/main/named_pipe.result19
-rw-r--r--mysql-test/main/null.result2
-rw-r--r--mysql-test/main/null_key.result8
-rw-r--r--mysql-test/main/null_key.test7
-rw-r--r--mysql-test/main/old-mode.opt (renamed from mysql-test/main/old-mode-master.opt)0
-rw-r--r--mysql-test/main/old-mode.result11
-rw-r--r--mysql-test/main/old-mode.test5
-rw-r--r--mysql-test/main/openssl_1.result12
-rw-r--r--mysql-test/main/opt_trace.result6391
-rw-r--r--mysql-test/main/opt_trace.test167
-rw-r--r--mysql-test/main/opt_trace_index_merge.result169
-rw-r--r--mysql-test/main/opt_trace_index_merge_innodb.result53
-rw-r--r--mysql-test/main/opt_trace_security.result68
-rw-r--r--mysql-test/main/opt_trace_selectivity.result369
-rw-r--r--mysql-test/main/opt_trace_selectivity.test86
-rw-r--r--mysql-test/main/opt_trace_ucs2.result5
-rw-r--r--mysql-test/main/opt_trace_ucs2.test1
-rw-r--r--mysql-test/main/opt_tvc.result193
-rw-r--r--mysql-test/main/opt_tvc.test19
-rw-r--r--mysql-test/main/optimizer_costs.result347
-rw-r--r--mysql-test/main/optimizer_costs.test189
-rw-r--r--mysql-test/main/optimizer_costs2.opt1
-rw-r--r--mysql-test/main/optimizer_costs2.result8
-rw-r--r--mysql-test/main/optimizer_costs2.test6
-rw-r--r--mysql-test/main/optimizer_crash.result73
-rw-r--r--mysql-test/main/optimizer_crash.test82
-rw-r--r--mysql-test/main/order_by.result299
-rw-r--r--mysql-test/main/order_by.test18
-rw-r--r--mysql-test/main/order_by_innodb.result38
-rw-r--r--mysql-test/main/order_by_innodb.test17
-rw-r--r--mysql-test/main/order_by_pack_big.result12
-rw-r--r--mysql-test/main/order_by_sortkey.result35
-rw-r--r--mysql-test/main/order_by_sortkey.test21
-rw-r--r--mysql-test/main/parser.result5
-rw-r--r--mysql-test/main/partition.result42
-rw-r--r--mysql-test/main/partition.test37
-rw-r--r--mysql-test/main/partition_exchange.result2
-rw-r--r--mysql-test/main/partition_exchange.test2
-rw-r--r--mysql-test/main/partition_explicit_prune.result4
-rw-r--r--mysql-test/main/partition_geometries.result125
-rw-r--r--mysql-test/main/partition_geometries.test93
-rw-r--r--mysql-test/main/partition_innodb.result6
-rw-r--r--mysql-test/main/partition_innodb.test4
-rw-r--r--mysql-test/main/partition_innodb2.result24
-rw-r--r--mysql-test/main/partition_innodb2.test31
-rw-r--r--mysql-test/main/partition_innodb_plugin.result6
-rw-r--r--mysql-test/main/partition_mrr_aria.result4
-rw-r--r--mysql-test/main/partition_mrr_innodb.result4
-rw-r--r--mysql-test/main/partition_mrr_myisam.result6
-rw-r--r--mysql-test/main/partition_pruning.result32
-rw-r--r--mysql-test/main/partition_pruning.test6
-rw-r--r--mysql-test/main/partition_range.result76
-rw-r--r--mysql-test/main/partition_range.test35
-rw-r--r--mysql-test/main/percona_nonflushing_analyze_debug.result2
-rw-r--r--mysql-test/main/plugin_auth.test2
-rw-r--r--mysql-test/main/pool_of_threads.result19
-rw-r--r--mysql-test/main/ps.result20
-rw-r--r--mysql-test/main/ps.test4
-rw-r--r--mysql-test/main/ps_1general.result2
-rw-r--r--mysql-test/main/ps_1general.test4
-rw-r--r--mysql-test/main/ps_change_master.result2
-rw-r--r--mysql-test/main/ps_change_master.test2
-rw-r--r--mysql-test/main/ps_ddl.result26
-rw-r--r--mysql-test/main/ps_ddl.test16
-rw-r--r--mysql-test/main/ps_ddl1.result2
-rw-r--r--mysql-test/main/query_cache.result6
-rw-r--r--mysql-test/main/range.result293
-rw-r--r--mysql-test/main/range.test95
-rw-r--r--mysql-test/main/range_aria_dbt3.result10
-rw-r--r--mysql-test/main/range_aria_dbt3.test6
-rw-r--r--mysql-test/main/range_innodb.result27
-rw-r--r--mysql-test/main/range_innodb.test26
-rw-r--r--mysql-test/main/range_interrupted-13751.result14
-rw-r--r--mysql-test/main/range_interrupted-13751.test14
-rw-r--r--mysql-test/main/range_mrr_icp.result294
-rw-r--r--mysql-test/main/range_notembedded.result3
-rw-r--r--mysql-test/main/range_notembedded.test1
-rw-r--r--mysql-test/main/range_vs_index_merge.result61
-rw-r--r--mysql-test/main/range_vs_index_merge.test16
-rw-r--r--mysql-test/main/range_vs_index_merge_innodb.result59
-rw-r--r--mysql-test/main/rename.result2
-rw-r--r--mysql-test/main/require_secure_transport.result15
-rw-r--r--mysql-test/main/require_secure_transport.test20
-rw-r--r--mysql-test/main/require_secure_transport_on.opt1
-rw-r--r--mysql-test/main/require_secure_transport_on.result9
-rw-r--r--mysql-test/main/require_secure_transport_on.test15
-rw-r--r--mysql-test/main/rowid_filter.result1185
-rw-r--r--mysql-test/main/rowid_filter.test401
-rw-r--r--mysql-test/main/rowid_filter_aria.result2271
-rw-r--r--mysql-test/main/rowid_filter_aria.test9
-rw-r--r--mysql-test/main/rowid_filter_innodb.result1233
-rw-r--r--mysql-test/main/rowid_filter_innodb.test27
-rw-r--r--mysql-test/main/rowid_filter_innodb_debug.result19
-rw-r--r--mysql-test/main/rowid_filter_innodb_debug.test2
-rw-r--r--mysql-test/main/rowid_filter_myisam.result681
-rw-r--r--mysql-test/main/rowid_filter_myisam.test419
-rw-r--r--mysql-test/main/rowid_filter_myisam_debug.result19
-rw-r--r--mysql-test/main/rpl_mysql_upgrade_slave_repo_check.test4
-rw-r--r--mysql-test/main/rpl_mysqldump_slave.result8
-rw-r--r--mysql-test/main/sargable_casefold.result278
-rw-r--r--mysql-test/main/sargable_casefold.test141
-rw-r--r--mysql-test/main/sargable_casefold_notembedded.result61
-rw-r--r--mysql-test/main/sargable_casefold_notembedded.test51
-rw-r--r--mysql-test/main/sargable_casefold_part.result58
-rw-r--r--mysql-test/main/sargable_casefold_part.test22
-rw-r--r--mysql-test/main/sargable_date_cond.result2007
-rw-r--r--mysql-test/main/sargable_date_cond.test363
-rw-r--r--mysql-test/main/secondary_key_costs.result133
-rw-r--r--mysql-test/main/secondary_key_costs.test21
-rw-r--r--mysql-test/main/select.result80
-rw-r--r--mysql-test/main/select.test44
-rw-r--r--mysql-test/main/select_jcl6.result88
-rw-r--r--mysql-test/main/select_pkeycache.result80
-rw-r--r--mysql-test/main/select_safe.result1
-rw-r--r--mysql-test/main/select_safe.test1
-rw-r--r--mysql-test/main/selectivity.result203
-rw-r--r--mysql-test/main/selectivity.test125
-rw-r--r--mysql-test/main/selectivity_innodb.result288
-rw-r--r--mysql-test/main/selectivity_innodb.test58
-rw-r--r--mysql-test/main/selectivity_innodb_notembedded.result9
-rw-r--r--mysql-test/main/selectivity_no_engine.result19
-rw-r--r--mysql-test/main/selectivity_no_engine.test22
-rw-r--r--mysql-test/main/selectivity_notembedded.result9
-rw-r--r--mysql-test/main/set_operation.result48
-rw-r--r--mysql-test/main/set_operation.test1
-rw-r--r--mysql-test/main/set_password.result12
-rw-r--r--mysql-test/main/set_password.test12
-rw-r--r--mysql-test/main/set_statement.result2
-rw-r--r--mysql-test/main/set_statement.test2
-rw-r--r--mysql-test/main/show_analyze.result7
-rw-r--r--mysql-test/main/show_analyze.test4
-rw-r--r--mysql-test/main/show_analyze_json.result106
-rw-r--r--mysql-test/main/show_analyze_json.test4
-rw-r--r--mysql-test/main/show_explain.result8
-rw-r--r--mysql-test/main/show_explain.test4
-rw-r--r--mysql-test/main/show_explain_json.result121
-rw-r--r--mysql-test/main/show_explain_json.test32
-rw-r--r--mysql-test/main/show_explain_non_select.result2
-rw-r--r--mysql-test/main/show_explain_non_select.test2
-rw-r--r--mysql-test/main/signal_demo1.result7
-rw-r--r--mysql-test/main/single_delete_update.result50
-rw-r--r--mysql-test/main/single_delete_update.test2
-rw-r--r--mysql-test/main/skip_grants.result2
-rw-r--r--mysql-test/main/skip_grants.test5
-rw-r--r--mysql-test/main/sp-anchor-row-type-cursor.result6
-rw-r--r--mysql-test/main/sp-anchor-row-type-table.result6
-rw-r--r--mysql-test/main/sp-anchor-type.result2
-rw-r--r--mysql-test/main/sp-big.result2
-rw-r--r--mysql-test/main/sp-error.result15
-rw-r--r--mysql-test/main/sp-error.test18
-rw-r--r--mysql-test/main/sp-package-code.result260
-rw-r--r--mysql-test/main/sp-package-code.test200
-rw-r--r--mysql-test/main/sp-package-security.result322
-rw-r--r--mysql-test/main/sp-package-security.test340
-rw-r--r--mysql-test/main/sp-package.result123
-rw-r--r--mysql-test/main/sp-package.test140
-rw-r--r--mysql-test/main/sp-row.result6
-rw-r--r--mysql-test/main/sp-security-debug.result294
-rw-r--r--mysql-test/main/sp-security-debug.test368
-rw-r--r--mysql-test/main/sp-security.result893
-rw-r--r--mysql-test/main/sp-security.test554
-rw-r--r--mysql-test/main/sp.result17
-rw-r--r--mysql-test/main/sp.test7
-rw-r--r--mysql-test/main/sp_trans.result2
-rw-r--r--mysql-test/main/sp_trans_log.result2
-rw-r--r--mysql-test/main/sp_validation.result1996
-rw-r--r--mysql-test/main/sp_validation.test2799
-rw-r--r--mysql-test/main/sql_mode.result2
-rw-r--r--mysql-test/main/sql_safe_updates.result13
-rw-r--r--mysql-test/main/sql_safe_updates.test7
-rw-r--r--mysql-test/main/ssl.result19
-rw-r--r--mysql-test/main/ssl_7937.test14
-rw-r--r--mysql-test/main/ssl_and_innodb.result2
-rw-r--r--mysql-test/main/ssl_autoverify,win.rdiff31
-rw-r--r--mysql-test/main/ssl_autoverify.combinations8
-rw-r--r--mysql-test/main/ssl_autoverify.result64
-rw-r--r--mysql-test/main/ssl_autoverify.test129
-rw-r--r--mysql-test/main/ssl_compress.result19
-rw-r--r--mysql-test/main/ssl_fp.result12
-rw-r--r--mysql-test/main/ssl_fp.test33
-rw-r--r--mysql-test/main/stat_tables.result30
-rw-r--r--mysql-test/main/stat_tables.test2
-rw-r--r--mysql-test/main/stat_tables_flush.result12
-rw-r--r--mysql-test/main/stat_tables_innodb.result50
-rw-r--r--mysql-test/main/statistics_json.result3
-rw-r--r--mysql-test/main/statistics_json.test1
-rw-r--r--mysql-test/main/statistics_upgrade.test4
-rw-r--r--mysql-test/main/statistics_upgrade_not_done.test4
-rw-r--r--mysql-test/main/status.result37
-rw-r--r--mysql-test/main/status.test31
-rw-r--r--mysql-test/main/status2.result118
-rw-r--r--mysql-test/main/status2.test112
-rw-r--r--mysql-test/main/subselect.result216
-rw-r--r--mysql-test/main/subselect.test116
-rw-r--r--mysql-test/main/subselect2.result20
-rw-r--r--mysql-test/main/subselect2.test4
-rw-r--r--mysql-test/main/subselect3.inc42
-rw-r--r--mysql-test/main/subselect3.result57
-rw-r--r--mysql-test/main/subselect3_jcl6.result75
-rw-r--r--mysql-test/main/subselect4.result122
-rw-r--r--mysql-test/main/subselect4.test37
-rw-r--r--mysql-test/main/subselect_cache.result30
-rw-r--r--mysql-test/main/subselect_cache.test2
-rw-r--r--mysql-test/main/subselect_debug.result2
-rw-r--r--mysql-test/main/subselect_debug.test2
-rw-r--r--mysql-test/main/subselect_exists2in.result49
-rw-r--r--mysql-test/main/subselect_exists2in.test18
-rw-r--r--mysql-test/main/subselect_exists2in_costmat.result2
-rw-r--r--mysql-test/main/subselect_exists2in_costmat.test1
-rw-r--r--mysql-test/main/subselect_extra.result14
-rw-r--r--mysql-test/main/subselect_extra_no_semijoin.result6
-rw-r--r--mysql-test/main/subselect_firstmatch.result30
-rw-r--r--mysql-test/main/subselect_firstmatch.test28
-rw-r--r--mysql-test/main/subselect_innodb.result27
-rw-r--r--mysql-test/main/subselect_innodb.test14
-rw-r--r--mysql-test/main/subselect_mat.result83
-rw-r--r--mysql-test/main/subselect_mat.test3
-rw-r--r--mysql-test/main/subselect_mat_cost.opt (renamed from mysql-test/main/subselect_mat_cost-master.opt)0
-rw-r--r--mysql-test/main/subselect_mat_cost.result77
-rw-r--r--mysql-test/main/subselect_mat_cost.test37
-rw-r--r--mysql-test/main/subselect_mat_cost_bugs.result22
-rw-r--r--mysql-test/main/subselect_no_exists_to_in.result208
-rw-r--r--mysql-test/main/subselect_no_mat.result206
-rw-r--r--mysql-test/main/subselect_no_opts.result178
-rw-r--r--mysql-test/main/subselect_no_scache.result216
-rw-r--r--mysql-test/main/subselect_no_semijoin.result240
-rw-r--r--mysql-test/main/subselect_no_semijoin.test1
-rw-r--r--mysql-test/main/subselect_partial_match.result22
-rw-r--r--mysql-test/main/subselect_partial_match.test14
-rw-r--r--mysql-test/main/subselect_sj.result222
-rw-r--r--mysql-test/main/subselect_sj.test32
-rw-r--r--mysql-test/main/subselect_sj2.result92
-rw-r--r--mysql-test/main/subselect_sj2.test36
-rw-r--r--mysql-test/main/subselect_sj2_jcl6.result161
-rw-r--r--mysql-test/main/subselect_sj2_jcl6.test5
-rw-r--r--mysql-test/main/subselect_sj2_mat.result166
-rw-r--r--mysql-test/main/subselect_sj2_mat.test3
-rw-r--r--mysql-test/main/subselect_sj_jcl6.result268
-rw-r--r--mysql-test/main/subselect_sj_jcl6.test19
-rw-r--r--mysql-test/main/subselect_sj_mat.result229
-rw-r--r--mysql-test/main/subselect_sj_mat.test23
-rw-r--r--mysql-test/main/subselect_sj_nonmerged.result8
-rw-r--r--mysql-test/main/system_mysql_db.result3
-rw-r--r--mysql-test/main/system_mysql_db_error_log.result4
-rw-r--r--mysql-test/main/system_mysql_db_fix40123.result3
-rw-r--r--mysql-test/main/system_mysql_db_fix50030.result3
-rw-r--r--mysql-test/main/system_mysql_db_fix50117.result3
-rw-r--r--mysql-test/main/system_mysql_db_fix50568.result3
-rw-r--r--mysql-test/main/table_elim.result34
-rw-r--r--mysql-test/main/table_elim.test4
-rw-r--r--mysql-test/main/table_value_constr.result76
-rw-r--r--mysql-test/main/table_value_constr.test13
-rw-r--r--mysql-test/main/temp_table.result4
-rw-r--r--mysql-test/main/timezone.result11
-rw-r--r--mysql-test/main/timezone.test9
-rw-r--r--mysql-test/main/timezone2.result187
-rw-r--r--mysql-test/main/timezone2.test152
-rw-r--r--mysql-test/main/tls_version.result10
-rw-r--r--mysql-test/main/tls_version.test19
-rw-r--r--mysql-test/main/tls_version1.opt1
-rw-r--r--mysql-test/main/tls_version1.result8
-rw-r--r--mysql-test/main/tls_version1.test17
-rw-r--r--mysql-test/main/tmp_table_count-7586.result2
-rw-r--r--mysql-test/main/tmp_table_count-7586.test2
-rw-r--r--mysql-test/main/trans_read_only.result16
-rw-r--r--mysql-test/main/trans_read_only.test8
-rw-r--r--mysql-test/main/trigger.result4
-rw-r--r--mysql-test/main/trigger_notembedded.result2
-rw-r--r--mysql-test/main/type_blob.result16
-rw-r--r--mysql-test/main/type_datetime.result6
-rw-r--r--mysql-test/main/type_enum.result7
-rw-r--r--mysql-test/main/type_float.result2
-rw-r--r--mysql-test/main/type_newdecimal.result2
-rw-r--r--mysql-test/main/type_ranges.result2
-rw-r--r--mysql-test/main/type_set.result7
-rw-r--r--mysql-test/main/type_time.result4
-rw-r--r--mysql-test/main/type_time_6065.result75
-rw-r--r--mysql-test/main/type_timestamp.result747
-rw-r--r--mysql-test/main/type_timestamp.test330
-rw-r--r--mysql-test/main/type_uint.result1
-rw-r--r--mysql-test/main/type_varchar.result6
-rw-r--r--mysql-test/main/type_year.result32
-rw-r--r--mysql-test/main/union.result75
-rw-r--r--mysql-test/main/union.test20
-rw-r--r--mysql-test/main/unsafe_binlog_innodb.result4
-rw-r--r--mysql-test/main/unsafe_binlog_innodb.test4
-rw-r--r--mysql-test/main/update.result40
-rw-r--r--mysql-test/main/update.test40
-rw-r--r--mysql-test/main/update_innodb.result108
-rw-r--r--mysql-test/main/update_innodb.test47
-rw-r--r--mysql-test/main/update_single_to_multi.result3860
-rw-r--r--mysql-test/main/update_single_to_multi.test832
-rw-r--r--mysql-test/main/update_use_source.result10032
-rw-r--r--mysql-test/main/update_use_source.test252
-rw-r--r--mysql-test/main/upgrade_MDEV-19650.result1
-rw-r--r--mysql-test/main/upgrade_MDEV-19650.test4
-rw-r--r--mysql-test/main/upgrade_MDEV-23102-1.result2
-rw-r--r--mysql-test/main/upgrade_MDEV-23102-1.test8
-rw-r--r--mysql-test/main/upgrade_MDEV-23102-2.result2
-rw-r--r--mysql-test/main/upgrade_MDEV-23102-2.test8
-rw-r--r--mysql-test/main/upgrade_geometrycolumn_procedure_definer.result1
-rw-r--r--mysql-test/main/upgrade_geometrycolumn_procedure_definer.test4
-rw-r--r--mysql-test/main/upgrade_mdev_24363.result1
-rw-r--r--mysql-test/main/upgrade_mdev_24363.test4
-rw-r--r--mysql-test/main/userstat.result2
-rw-r--r--mysql-test/main/variables-notembedded-master.opt1
-rw-r--r--mysql-test/main/variables-notembedded.opt2
-rw-r--r--mysql-test/main/variables-notembedded.result18
-rw-r--r--mysql-test/main/variables-notembedded.test17
-rw-r--r--mysql-test/main/variables.result22
-rw-r--r--mysql-test/main/variables.test6
-rw-r--r--mysql-test/main/view.result69
-rw-r--r--mysql-test/main/view.test16
-rw-r--r--mysql-test/main/view_grant.result13
-rw-r--r--mysql-test/main/view_grant.test1
-rw-r--r--mysql-test/main/win.result39
-rw-r--r--mysql-test/main/win.test12
-rw-r--r--mysql-test/main/win_empty_over.result6
-rw-r--r--mysql-test/main/win_empty_over.test2
-rw-r--r--mysql-test/main/xtradb_mrr.result6
-rw-r--r--mysql-test/main/xtradb_mrr.test3
-rwxr-xr-xmysql-test/mariadb-test-run.pl54
-rw-r--r--mysql-test/std_data/bug47142_master-bin.000001bin386 -> 0 bytes
-rw-r--r--mysql-test/std_data/master-bin.000001bin98 -> 0 bytes
-rw-r--r--mysql-test/std_data/trunc_binlog.000001bin174 -> 0 bytes
-rwxr-xr-xmysql-test/std_data/wsrep_notify_ssl.sh2
-rw-r--r--mysql-test/suite.pm7
-rw-r--r--mysql-test/suite/archive/archive.result4
-rw-r--r--mysql-test/suite/archive/archive.test3
-rw-r--r--mysql-test/suite/atomic/alter_partition.test2
-rw-r--r--mysql-test/suite/binlog/include/binlog_expire_warnings.inc2
-rw-r--r--mysql-test/suite/binlog/include/binlog_incident-master.opt2
-rw-r--r--mysql-test/suite/binlog/include/binlog_ioerr.inc3
-rw-r--r--mysql-test/suite/binlog/include/row_img.test56
-rw-r--r--mysql-test/suite/binlog/my.cnf4
-rw-r--r--mysql-test/suite/binlog/r/binlog_base64_flag.result33
-rw-r--r--mysql-test/suite/binlog/r/binlog_grant.result38
-rw-r--r--mysql-test/suite/binlog/r/binlog_gtid_index.result135
-rw-r--r--mysql-test/suite/binlog/r/binlog_gtid_index_crash.result28
-rw-r--r--mysql-test/suite/binlog/r/binlog_ioerr.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_raw_flush.result1
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result21
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result6
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result7
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_old_versions.result70
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result1
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_img.result1365
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result3
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_do_db.result6
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_mysqlbinlog_collate_implicit.result193
-rw-r--r--mysql-test/suite/binlog/r/binlog_unsafe.result4
-rw-r--r--mysql-test/suite/binlog/r/flashback.result54
-rw-r--r--mysql-test/suite/binlog/r/max_binlog_total_size.result123
-rw-r--r--mysql-test/suite/binlog/std_data/binlog_old_version_4_1.000001bin149436 -> 0 bytes
-rw-r--r--mysql-test/suite/binlog/std_data/bug32407.001bin368 -> 0 bytes
-rw-r--r--mysql-test/suite/binlog/std_data/ver_5_1-telco.001bin150385 -> 0 bytes
-rw-r--r--mysql-test/suite/binlog/std_data/ver_5_1_17.001bin150385 -> 0 bytes
-rw-r--r--mysql-test/suite/binlog/std_data/ver_5_1_23.001bin150402 -> 0 bytes
-rw-r--r--mysql-test/suite/binlog/std_data/ver_trunk_row_v2.001bin151722 -> 0 bytes
-rw-r--r--mysql-test/suite/binlog/t/binlog_base64_flag.test28
-rw-r--r--mysql-test/suite/binlog/t/binlog_expire_warnings.opt1
-rw-r--r--mysql-test/suite/binlog/t/binlog_grant.test33
-rw-r--r--mysql-test/suite/binlog/t/binlog_gtid_index.test229
-rw-r--r--mysql-test/suite/binlog/t/binlog_gtid_index_crash.opt1
-rw-r--r--mysql-test/suite/binlog/t/binlog_gtid_index_crash.test66
-rw-r--r--mysql-test/suite/binlog/t/binlog_killed.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_killed_simulate-master.opt2
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_raw_flush.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_old_versions.test153
-rw-r--r--mysql-test/suite/binlog/t/binlog_row_img.test35
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_do_db.test8
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_mysqlbinlog_collate_implicit.test77
-rw-r--r--mysql-test/suite/binlog/t/binlog_table_map_optional_metadata.test4
-rw-r--r--mysql-test/suite/binlog/t/binlog_truncate_multi_engine.test1
-rw-r--r--mysql-test/suite/binlog/t/flashback.combinations4
-rw-r--r--mysql-test/suite/binlog/t/flashback.test67
-rw-r--r--mysql-test/suite/binlog/t/max_binlog_total_size-master.opt5
-rw-r--r--mysql-test/suite/binlog/t/max_binlog_total_size.test94
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_index-master.opt1
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_ioerr.result2
-rw-r--r--mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.result6
-rw-r--r--mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.test10
-rw-r--r--mysql-test/suite/binlog_encryption/multisource.result4
-rw-r--r--mysql-test/suite/binlog_encryption/my.cnf3
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_skip_replication.result2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_ssl.result2
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_sync-master.opt1
-rw-r--r--mysql-test/suite/binlog_encryption/rpl_sync-slave.opt2
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-inout.result12
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-package-innodb.result2
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-package-mysqldump.result4
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-package.result40
-rw-r--r--mysql-test/suite/compat/oracle/r/sp-row.result18
-rw-r--r--mysql-test/suite/compat/oracle/r/table_value_constr.result66
-rw-r--r--mysql-test/suite/compat/oracle/r/update_innodb.result4
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-inout.test8
-rw-r--r--mysql-test/suite/compat/oracle/t/sp-package.test25
-rw-r--r--mysql-test/suite/compat/oracle/t/table_value_constr.test1
-rw-r--r--mysql-test/suite/encryption/r/encrypt_and_grep.result1
-rw-r--r--mysql-test/suite/encryption/r/innochecksum.result1
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change.result2
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change2.result1
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change4.result26
-rw-r--r--mysql-test/suite/encryption/r/innodb-checksum-algorithm.result3
-rw-r--r--mysql-test/suite/encryption/r/innodb-compressed-blob.result1
-rw-r--r--mysql-test/suite/encryption/r/innodb-force-corrupt.result1
-rw-r--r--mysql-test/suite/encryption/r/innodb-key-rotation-disable.result1
-rw-r--r--mysql-test/suite/encryption/r/innodb-redo-badkey.result1
-rw-r--r--mysql-test/suite/encryption/r/innodb-redo-nokeys.result1
-rw-r--r--mysql-test/suite/encryption/r/innodb-remove-encryption.result2
-rw-r--r--mysql-test/suite/encryption/r/innodb-spatial-index.result3
-rw-r--r--mysql-test/suite/encryption/r/innodb_encrypt_freed.result8
-rw-r--r--mysql-test/suite/encryption/r/innodb_import.result19
-rw-r--r--mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result1
-rw-r--r--mysql-test/suite/encryption/r/tempfiles_encrypted.result39
-rw-r--r--mysql-test/suite/encryption/t/encrypt_and_grep.test2
-rw-r--r--mysql-test/suite/encryption/t/innochecksum.test1
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change.test3
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change2.test2
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change4.combinations5
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change4.opt5
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change4.test44
-rw-r--r--mysql-test/suite/encryption/t/innodb-checksum-algorithm.test3
-rw-r--r--mysql-test/suite/encryption/t/innodb-compressed-blob.test2
-rw-r--r--mysql-test/suite/encryption/t/innodb-force-corrupt.test1
-rw-r--r--mysql-test/suite/encryption/t/innodb-key-rotation-disable.test1
-rw-r--r--mysql-test/suite/encryption/t/innodb-redo-badkey.opt1
-rw-r--r--mysql-test/suite/encryption/t/innodb-redo-badkey.test2
-rw-r--r--mysql-test/suite/encryption/t/innodb-redo-nokeys.opt1
-rw-r--r--mysql-test/suite/encryption/t/innodb-redo-nokeys.test2
-rw-r--r--mysql-test/suite/encryption/t/innodb_encrypt_freed.test2
-rw-r--r--mysql-test/suite/encryption/t/innodb_import.test19
-rw-r--r--mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test2
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_000010.result1
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_drop_db.result2
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_dual_pos_advance.result3
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_flushlog_loop.result4
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_misc_functions.result2
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_row_drop.result2
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_sp,myisam,mix.rdiff4
-rw-r--r--mysql-test/suite/engines/funcs/r/rpl_temporary.result4
-rw-r--r--mysql-test/suite/engines/funcs/r/tc_temporary_column.result56
-rw-r--r--mysql-test/suite/engines/funcs/r/tc_temporary_column_length.result22
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_dual_pos_advance.test3
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test4
-rw-r--r--mysql-test/suite/engines/iuds/r/delete_year.result8
-rw-r--r--mysql-test/suite/engines/iuds/r/insert_year.result16
-rw-r--r--mysql-test/suite/engines/iuds/r/type_bit_iuds.result296
-rw-r--r--mysql-test/suite/engines/iuds/r/update_delete_number.result22
-rw-r--r--mysql-test/suite/engines/iuds/r/update_year.result8
-rw-r--r--mysql-test/suite/engines/iuds/t/type_bit_iuds.test64
-rw-r--r--mysql-test/suite/engines/iuds/t/update_delete_number.test20
-rw-r--r--mysql-test/suite/engines/rr_trx/include/rr_init.test3
-rw-r--r--mysql-test/suite/engines/rr_trx/r/init_innodb.result4
-rw-r--r--mysql-test/suite/events/disabled.def12
-rw-r--r--mysql-test/suite/events/events_1.result (renamed from mysql-test/main/events_1.result)5
-rw-r--r--mysql-test/suite/events/events_1.test (renamed from mysql-test/main/events_1.test)11
-rw-r--r--mysql-test/suite/events/events_2.result (renamed from mysql-test/main/events_2.result)0
-rw-r--r--mysql-test/suite/events/events_2.test (renamed from mysql-test/main/events_2.test)0
-rw-r--r--mysql-test/suite/events/events_bugs-master.opt (renamed from mysql-test/main/events_bugs-master.opt)0
-rw-r--r--mysql-test/suite/events/events_bugs.result (renamed from mysql-test/main/events_bugs.result)5
-rw-r--r--mysql-test/suite/events/events_bugs.test (renamed from mysql-test/main/events_bugs.test)2
-rw-r--r--mysql-test/suite/events/events_embedded.result (renamed from mysql-test/main/events_embedded.result)0
-rw-r--r--mysql-test/suite/events/events_embedded.test (renamed from mysql-test/main/events_embedded.test)2
-rw-r--r--mysql-test/suite/events/events_grant.result (renamed from mysql-test/main/events_grant.result)2
-rw-r--r--mysql-test/suite/events/events_grant.test (renamed from mysql-test/main/events_grant.test)0
-rw-r--r--mysql-test/suite/events/events_logs_tests-master.opt (renamed from mysql-test/main/events_logs_tests-master.opt)0
-rw-r--r--mysql-test/suite/events/events_logs_tests.result (renamed from mysql-test/main/events_logs_tests.result)0
-rw-r--r--mysql-test/suite/events/events_logs_tests.test (renamed from mysql-test/main/events_logs_tests.test)0
-rw-r--r--mysql-test/suite/events/events_microsec.result (renamed from mysql-test/main/events_microsec.result)0
-rw-r--r--mysql-test/suite/events/events_microsec.test (renamed from mysql-test/main/events_microsec.test)0
-rw-r--r--mysql-test/suite/events/events_restart-master.opt (renamed from mysql-test/main/events_restart-master.opt)0
-rw-r--r--mysql-test/suite/events/events_restart.result (renamed from mysql-test/main/events_restart.result)18
-rw-r--r--mysql-test/suite/events/events_restart.test (renamed from mysql-test/main/events_restart.test)20
-rw-r--r--mysql-test/suite/events/events_scheduling.result (renamed from mysql-test/main/events_scheduling.result)1
-rw-r--r--mysql-test/suite/events/events_scheduling.test (renamed from mysql-test/main/events_scheduling.test)2
-rw-r--r--mysql-test/suite/events/events_skip_grant_tables.opt1
-rw-r--r--mysql-test/suite/events/events_skip_grant_tables.result12
-rw-r--r--mysql-test/suite/events/events_skip_grant_tables.test26
-rw-r--r--mysql-test/suite/events/events_slowlog.result (renamed from mysql-test/main/events_slowlog.result)0
-rw-r--r--mysql-test/suite/events/events_slowlog.test (renamed from mysql-test/main/events_slowlog.test)0
-rw-r--r--mysql-test/suite/events/events_stress.result (renamed from mysql-test/main/events_stress.result)0
-rw-r--r--mysql-test/suite/events/events_stress.test (renamed from mysql-test/main/events_stress.test)0
-rw-r--r--mysql-test/suite/events/events_time_zone.result (renamed from mysql-test/main/events_time_zone.result)0
-rw-r--r--mysql-test/suite/events/events_time_zone.test (renamed from mysql-test/main/events_time_zone.test)0
-rw-r--r--mysql-test/suite/events/events_trans.result (renamed from mysql-test/main/events_trans.result)0
-rw-r--r--mysql-test/suite/events/events_trans.test (renamed from mysql-test/main/events_trans.test)0
-rw-r--r--mysql-test/suite/events/events_trans_notembedded.result (renamed from mysql-test/main/events_trans_notembedded.result)0
-rw-r--r--mysql-test/suite/events/events_trans_notembedded.test (renamed from mysql-test/main/events_trans_notembedded.test)0
-rw-r--r--mysql-test/suite/federated/federated_bug_25714.result8
-rw-r--r--mysql-test/suite/federated/federated_bug_25714.test21
-rw-r--r--mysql-test/suite/federated/federated_server.result10
-rw-r--r--mysql-test/suite/federated/federated_server.test4
-rw-r--r--mysql-test/suite/federated/federatedx.result16
-rw-r--r--mysql-test/suite/federated/federatedx.test22
-rw-r--r--mysql-test/suite/federated/federatedx_create_handlers.result726
-rw-r--r--mysql-test/suite/federated/federatedx_create_handlers.test421
-rw-r--r--mysql-test/suite/federated/my.cnf3
-rw-r--r--mysql-test/suite/funcs_1/datadict/processlist_priv.inc26
-rw-r--r--mysql-test/suite/funcs_1/datadict/processlist_val.inc14
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_03.result16
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_03e.result10
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_views.result4
-rw-r--r--mysql-test/suite/funcs_1/r/is_cml_innodb.result22
-rw-r--r--mysql-test/suite/funcs_1/r/is_cml_memory.result14
-rw-r--r--mysql-test/suite/funcs_1/r/is_cml_myisam.result22
-rw-r--r--mysql-test/suite/funcs_1/r/is_collations.result2
-rw-r--r--mysql-test/suite/funcs_1/r/is_column_privileges.result1
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns.result50
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_innodb.result660
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is.result1046
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_is_embedded.result1046
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_memory.result630
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_myisam.result710
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result710
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_mysql.result514
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result476
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables.result2
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_embedded.result2
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_is.result150
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_is_embedded.result150
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_mysql.result2
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result4
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_03.result16
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_03e.result10
-rw-r--r--mysql-test/suite/funcs_1/r/memory_views.result4
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_03.result16
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_03e.result10
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_views-big.result4
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result158
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_priv_ps.result158
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_val_no_prot.result55
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_val_ps.result55
-rw-r--r--mysql-test/suite/funcs_1/r/storedproc.result4
-rw-r--r--mysql-test/suite/funcs_1/t/is_collations.test2
-rw-r--r--mysql-test/suite/galera/galera_2nodes.cnf2
-rw-r--r--mysql-test/suite/galera/galera_2nodes_as_master.cnf2
-rw-r--r--mysql-test/suite/galera/galera_2nodes_as_slave.cnf2
-rw-r--r--mysql-test/suite/galera/galera_2x2nodes.cnf2
-rw-r--r--mysql-test/suite/galera/galera_3nodes_as_slave.cnf2
-rw-r--r--mysql-test/suite/galera/galera_4nodes.cnf2
-rw-r--r--mysql-test/suite/galera/r/MDEV-29142.result2
-rw-r--r--mysql-test/suite/galera/r/galera_defaults.result1
-rw-r--r--mysql-test/suite/galera/r/galera_event_node_evict.result21
-rw-r--r--mysql-test/suite/galera/r/galera_gtid_server_id.result12
-rw-r--r--mysql-test/suite/galera/r/galera_ist_MDEV-28423,debug.rdiff4
-rw-r--r--mysql-test/suite/galera/r/galera_ist_MDEV-28583,debug.rdiff4
-rw-r--r--mysql-test/suite/galera/r/galera_ist_mariabackup,debug.rdiff4
-rw-r--r--mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs,debug.rdiff4
-rw-r--r--mysql-test/suite/galera/r/galera_ist_rsync,debug.rdiff4
-rw-r--r--mysql-test/suite/galera/r/galera_many_indexes.result2
-rw-r--r--mysql-test/suite/galera/r/galera_query_cache_invalidate.result2
-rw-r--r--mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir,debug.rdiff4
-rw-r--r--mysql-test/suite/galera/r/galera_sst_mariabackup_force_recovery,debug.rdiff4
-rw-r--r--mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff4
-rw-r--r--mysql-test/suite/galera/r/galera_sst_rsync_data_dir,debug.rdiff4
-rw-r--r--mysql-test/suite/galera/r/galera_var_sync_wait.result3
-rw-r--r--mysql-test/suite/galera/r/rpl_galera_to_mariadb_clone_slave_using_mariadb-backup.result10
-rw-r--r--mysql-test/suite/galera/t/MDEV-28053.test2
-rw-r--r--mysql-test/suite/galera/t/MDEV-29142.test2
-rw-r--r--mysql-test/suite/galera/t/MDEV-6860.test2
-rw-r--r--mysql-test/suite/galera/t/MW-284.test2
-rw-r--r--mysql-test/suite/galera/t/galera_as_master.test2
-rw-r--r--mysql-test/suite/galera/t/galera_as_master_large.test2
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave.test2
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave_autoinc.test2
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave_gtid.inc2
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.test2
-rw-r--r--mysql-test/suite/galera/t/galera_as_slave_nonprim.test2
-rw-r--r--mysql-test/suite/galera/t/galera_event_node_evict.cnf14
-rw-r--r--mysql-test/suite/galera/t/galera_event_node_evict.test96
-rw-r--r--mysql-test/suite/galera/t/galera_gtid_slave.test2
-rw-r--r--mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.test2
-rw-r--r--mysql-test/suite/galera/t/galera_ist_MDEV-28423.cnf2
-rw-r--r--mysql-test/suite/galera/t/galera_ist_MDEV-28583.cnf2
-rw-r--r--mysql-test/suite/galera/t/galera_load_data.cnf2
-rw-r--r--mysql-test/suite/galera/t/galera_query_cache_invalidate.test2
-rw-r--r--mysql-test/suite/galera/t/galera_sst_encrypted.cnf1
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mariabackup.test1
-rw-r--r--mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf1
-rw-r--r--mysql-test/suite/galera/t/galera_sync_wait_upto-master.opt2
-rw-r--r--mysql-test/suite/galera/t/galera_var_sync_wait.test1
-rw-r--r--mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf2
-rw-r--r--mysql-test/suite/galera_3nodes/galera_3nodes.cnf2
-rw-r--r--mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc8
-rw-r--r--mysql-test/suite/gcol/inc/gcol_keys.inc6
-rw-r--r--mysql-test/suite/gcol/inc/gcol_select.inc11
-rw-r--r--mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_innodb.result10
-rw-r--r--mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_myisam.result10
-rw-r--r--mysql-test/suite/gcol/r/gcol_bugfixes.result4
-rw-r--r--mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result2
-rw-r--r--mysql-test/suite/gcol/r/gcol_keys_innodb.result6
-rw-r--r--mysql-test/suite/gcol/r/gcol_keys_myisam.result6
-rw-r--r--mysql-test/suite/gcol/r/gcol_select_innodb.result34
-rw-r--r--mysql-test/suite/gcol/r/gcol_select_myisam.result42
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_basic.result6
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_debug.result2
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_rebuild.result16
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_basic.test6
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_debug.test2
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_rebuild.test4
-rw-r--r--mysql-test/suite/handler/aria.result2
-rw-r--r--mysql-test/suite/handler/heap.result2
-rw-r--r--mysql-test/suite/handler/innodb.result2
-rw-r--r--mysql-test/suite/handler/myisam.result2
-rw-r--r--mysql-test/suite/heap/heap.result3
-rw-r--r--mysql-test/suite/heap/heap.test1
-rw-r--r--mysql-test/suite/heap/heap_btree.result4
-rw-r--r--mysql-test/suite/heap/heap_btree.test2
-rw-r--r--mysql-test/suite/innodb/include/import_begin.inc32
-rw-r--r--mysql-test/suite/innodb/include/import_end.inc8
-rw-r--r--mysql-test/suite/innodb/include/innodb_bulk_create_index.inc8
-rw-r--r--mysql-test/suite/innodb/include/innodb_bulk_create_index_debug.inc8
-rw-r--r--mysql-test/suite/innodb/include/innodb_merge_threshold_delete.inc2
-rw-r--r--mysql-test/suite/innodb/include/innodb_merge_threshold_secondary.inc2
-rw-r--r--mysql-test/suite/innodb/include/innodb_merge_threshold_update.inc2
-rw-r--r--mysql-test/suite/innodb/include/innodb_row_format_2.combinations5
-rw-r--r--mysql-test/suite/innodb/include/innodb_row_format_2.inc4
-rw-r--r--mysql-test/suite/innodb/r/alter_algorithm,INPLACE.rdiff13
-rw-r--r--mysql-test/suite/innodb/r/alter_algorithm,INSTANT.rdiff13
-rw-r--r--mysql-test/suite/innodb/r/alter_algorithm,NOCOPY.rdiff13
-rw-r--r--mysql-test/suite/innodb/r/alter_algorithm.result4
-rw-r--r--mysql-test/suite/innodb/r/alter_kill.result11
-rw-r--r--mysql-test/suite/innodb/r/alter_missing_tablespace.result1
-rw-r--r--mysql-test/suite/innodb/r/alter_rename_existing.result6
-rw-r--r--mysql-test/suite/innodb/r/alter_table.result6
-rw-r--r--mysql-test/suite/innodb/r/autoinc_persist.result2
-rw-r--r--mysql-test/suite/innodb/r/data_types.result2
-rw-r--r--mysql-test/suite/innodb/r/defrag_mdl-9155.result18
-rw-r--r--mysql-test/suite/innodb/r/dropdb_cs.result4
-rw-r--r--mysql-test/suite/innodb/r/gap_locks.result2
-rw-r--r--mysql-test/suite/innodb/r/ibuf_delete.result53
-rw-r--r--mysql-test/suite/innodb/r/ibuf_not_empty.result21
-rw-r--r--mysql-test/suite/innodb/r/import.result18
-rw-r--r--mysql-test/suite/innodb/r/import_no_cfg.result21
-rw-r--r--mysql-test/suite/innodb/r/import_recovery.result80
-rw-r--r--mysql-test/suite/innodb/r/import_run_once.result104
-rw-r--r--mysql-test/suite/innodb/r/import_update_stats.result12
-rw-r--r--mysql-test/suite/innodb/r/index_tree_operation.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-autoinc.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-timestamp.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter.result24
-rw-r--r--mysql-test/suite/innodb/r/innodb-blob.result14
-rw-r--r--mysql-test/suite/innodb/r/innodb-fkcheck.result7
-rw-r--r--mysql-test/suite/innodb/r/innodb-index-debug.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb-index-online.result5
-rw-r--r--mysql-test/suite/innodb/r/innodb-index.result8
-rw-r--r--mysql-test/suite/innodb/r/innodb-isolation.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb-lock-inherit-read_commited.result12
-rw-r--r--mysql-test/suite/innodb/r/innodb-online-alter-gis.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb-system-table-view.result5
-rw-r--r--mysql-test/suite/innodb/r/innodb-table-online.result9
-rw-r--r--mysql-test/suite/innodb/r/innodb-wl5522-debug.result11
-rw-r--r--mysql-test/suite/innodb/r/innodb-wl5522.result5
-rw-r--r--mysql-test/suite/innodb/r/innodb-wl5980-alter.result7
-rw-r--r--mysql-test/suite/innodb/r/innodb.result32
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug14147491.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug30423.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug30919.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug40360.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug49164.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug51920.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug53592.result8
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug53756.result28
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug56947.result9
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug57252.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug59733.result18
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug68148.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb_bulk_create_index.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_bulk_create_index_debug.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb_bulk_create_index_small.result3
-rw-r--r--mysql-test/suite/innodb/r/innodb_defrag_binlog.result31
-rw-r--r--mysql-test/suite/innodb/r/innodb_defrag_concurrent.result102
-rw-r--r--mysql-test/suite/innodb/r/innodb_defrag_stats.result133
-rw-r--r--mysql-test/suite/innodb/r/innodb_defrag_stats_many_tables.result38
-rw-r--r--mysql-test/suite/innodb/r/innodb_defragment.result133
-rw-r--r--mysql-test/suite/innodb/r/innodb_defragment_small.result40
-rw-r--r--mysql-test/suite/innodb/r/innodb_lock_wait_timeout_1.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb_mysql.result89
-rw-r--r--mysql-test/suite/innodb/r/innodb_scrub.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result16
-rw-r--r--mysql-test/suite/innodb/r/innodb_stats.result8
-rw-r--r--mysql-test/suite/innodb/r/innodb_stats_fetch.result12
-rw-r--r--mysql-test/suite/innodb/r/innodb_stats_fetch_corrupted.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb_stats_fetch_nonexistent.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_status_variables.result13
-rw-r--r--mysql-test/suite/innodb/r/insert_debug.result2
-rw-r--r--mysql-test/suite/innodb/r/insert_into_empty.result4
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_debug.result6
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_limit,16k.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_limit,32k.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_limit,4k.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_limit,64k.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_limit,8k.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/log_data_file_size.result4
-rw-r--r--mysql-test/suite/innodb/r/log_file_name.result1
-rw-r--r--mysql-test/suite/innodb/r/log_file_size.result4
-rw-r--r--mysql-test/suite/innodb/r/log_upgrade_101_flags.result2
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,16k,compact.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,16k,dynamic.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,16k,redundant.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,32k,compact.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,32k,dynamic.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,32k,redundant.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,4k,compact.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,4k,dynamic.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,4k,redundant.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,64k,compact.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,64k,dynamic.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,64k,redundant.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,8k,compact.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/max_record_size,8k,dynamic.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/mdev-14846.result14
-rw-r--r--mysql-test/suite/innodb/r/mdev-15707.result24
-rw-r--r--mysql-test/suite/innodb/r/monitor.result16
-rw-r--r--mysql-test/suite/innodb/r/mvcc.result3
-rw-r--r--mysql-test/suite/innodb/r/page_reorganize.result2
-rw-r--r--mysql-test/suite/innodb/r/partition_locking.result2
-rw-r--r--mysql-test/suite/innodb/r/read_only_recovery.result5
-rw-r--r--mysql-test/suite/innodb/r/restart,16k.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/restart,32k.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/restart,4k.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/restart,64k.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/restart,8k.rdiff4
-rw-r--r--mysql-test/suite/innodb/r/row_format_redundant.result15
-rw-r--r--mysql-test/suite/innodb/r/scrub.result2
-rw-r--r--mysql-test/suite/innodb/r/sys_truncate.result21
-rw-r--r--mysql-test/suite/innodb/r/sys_truncate_debug.result49
-rw-r--r--mysql-test/suite/innodb/r/sys_truncate_large.result22
-rw-r--r--mysql-test/suite/innodb/r/sys_truncate_shutdown.result23
-rw-r--r--mysql-test/suite/innodb/r/sys_truncate_shutdown_debug.result41
-rw-r--r--mysql-test/suite/innodb/r/table_flags.result1
-rw-r--r--mysql-test/suite/innodb/r/table_index_statistics.result3
-rw-r--r--mysql-test/suite/innodb/r/temp_truncate.result46
-rw-r--r--mysql-test/suite/innodb/r/temp_truncate_debug.result22
-rw-r--r--mysql-test/suite/innodb/r/temporary_table.result20
-rw-r--r--mysql-test/suite/innodb/r/undo_upgrade.result24
-rw-r--r--mysql-test/suite/innodb/t/alter_kill-master.opt2
-rw-r--r--mysql-test/suite/innodb/t/alter_kill.test9
-rw-r--r--mysql-test/suite/innodb/t/alter_missing_tablespace.test1
-rw-r--r--mysql-test/suite/innodb/t/autoinc_persist.test2
-rw-r--r--mysql-test/suite/innodb/t/defrag_mdl-9155.test22
-rw-r--r--mysql-test/suite/innodb/t/encryption_threads_shutdown.test13
-rw-r--r--mysql-test/suite/innodb/t/gap_locks.test2
-rw-r--r--mysql-test/suite/innodb/t/ibuf_delete.test67
-rw-r--r--mysql-test/suite/innodb/t/ibuf_not_empty.combinations9
-rw-r--r--mysql-test/suite/innodb/t/ibuf_not_empty.test118
-rw-r--r--mysql-test/suite/innodb/t/import.test3
-rw-r--r--mysql-test/suite/innodb/t/import_no_cfg.test4
-rw-r--r--mysql-test/suite/innodb/t/import_recovery.test163
-rw-r--r--mysql-test/suite/innodb/t/import_run_once.test86
-rw-r--r--mysql-test/suite/innodb/t/import_update_stats.test10
-rw-r--r--mysql-test/suite/innodb/t/index_tree_operation.test10
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter-autoinc.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter-timestamp.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter.test24
-rw-r--r--mysql-test/suite/innodb/t/innodb-blob.test10
-rw-r--r--mysql-test/suite/innodb/t/innodb-bug-14068765.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb-bug-14084530.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb-enlarge-blob.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb-fkcheck.test23
-rw-r--r--mysql-test/suite/innodb/t/innodb-index-debug.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb-index-online.test5
-rw-r--r--mysql-test/suite/innodb/t/innodb-index.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb-lock-inherit-read_commited.test6
-rw-r--r--mysql-test/suite/innodb/t/innodb-online-alter-gis.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb-table-online.test11
-rw-r--r--mysql-test/suite/innodb/t/innodb-wl5522-debug.test25
-rw-r--r--mysql-test/suite/innodb/t/innodb-wl5522.test9
-rw-r--r--mysql-test/suite/innodb/t/innodb-wl5980-alter.test6
-rw-r--r--mysql-test/suite/innodb/t/innodb.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb.test16
-rw-r--r--mysql-test/suite/innodb/t/innodb_buffer_pool_load_now.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug14147491-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug14147491.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug39438-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug39438.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug40360.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug49164.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug53592.test6
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug53756.test14
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug56947.test5
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug59733.test53
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug68148.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_bulk_create_index_small.test7
-rw-r--r--mysql-test/suite/innodb/t/innodb_defrag_binlog.opt5
-rw-r--r--mysql-test/suite/innodb/t/innodb_defrag_binlog.test21
-rw-r--r--mysql-test/suite/innodb/t/innodb_defrag_concurrent.opt5
-rw-r--r--mysql-test/suite/innodb/t/innodb_defrag_concurrent.test143
-rw-r--r--mysql-test/suite/innodb/t/innodb_defrag_stats.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_defrag_stats.test88
-rw-r--r--mysql-test/suite/innodb/t/innodb_defrag_stats_many_tables.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb_defrag_stats_many_tables.test77
-rw-r--r--mysql-test/suite/innodb/t/innodb_defragment.opt5
-rw-r--r--mysql-test/suite/innodb/t/innodb_defragment.test157
-rw-r--r--mysql-test/suite/innodb/t/innodb_defragment_small.test41
-rw-r--r--mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1.test6
-rw-r--r--mysql-test/suite/innodb/t/innodb_mysql.test2
-rw-r--r--mysql-test/suite/innodb/t/innodb_stats_fetch.test4
-rw-r--r--mysql-test/suite/innodb/t/insert_debug.test2
-rw-r--r--mysql-test/suite/innodb/t/insert_into_empty.test4
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_debug.test5
-rw-r--r--mysql-test/suite/innodb/t/log_corruption.test26
-rw-r--r--mysql-test/suite/innodb/t/log_data_file_size.opt1
-rw-r--r--mysql-test/suite/innodb/t/log_file_name.test2
-rw-r--r--mysql-test/suite/innodb/t/log_file_size.test4
-rw-r--r--mysql-test/suite/innodb/t/log_upgrade.test19
-rw-r--r--mysql-test/suite/innodb/t/log_upgrade_101_flags.test22
-rw-r--r--mysql-test/suite/innodb/t/mdev-14846.test6
-rw-r--r--mysql-test/suite/innodb/t/mdev-15707.opt1
-rw-r--r--mysql-test/suite/innodb/t/mdev-15707.test30
-rw-r--r--mysql-test/suite/innodb/t/monitor.test2
-rw-r--r--mysql-test/suite/innodb/t/mvcc.test5
-rw-r--r--mysql-test/suite/innodb/t/page_reorganize.test2
-rw-r--r--mysql-test/suite/innodb/t/partition_locking.test2
-rw-r--r--mysql-test/suite/innodb/t/read_only_recovery.test3
-rw-r--r--mysql-test/suite/innodb/t/row_format_redundant.opt1
-rw-r--r--mysql-test/suite/innodb/t/row_format_redundant.test14
-rw-r--r--mysql-test/suite/innodb/t/sys_truncate.opt2
-rw-r--r--mysql-test/suite/innodb/t/sys_truncate.test17
-rw-r--r--mysql-test/suite/innodb/t/sys_truncate_debug.opt3
-rw-r--r--mysql-test/suite/innodb/t/sys_truncate_debug.test62
-rw-r--r--mysql-test/suite/innodb/t/sys_truncate_large.opt2
-rw-r--r--mysql-test/suite/innodb/t/sys_truncate_large.test31
-rw-r--r--mysql-test/suite/innodb/t/sys_truncate_shutdown.opt3
-rw-r--r--mysql-test/suite/innodb/t/sys_truncate_shutdown.test20
-rw-r--r--mysql-test/suite/innodb/t/sys_truncate_shutdown_debug.opt3
-rw-r--r--mysql-test/suite/innodb/t/sys_truncate_shutdown_debug.test51
-rw-r--r--mysql-test/suite/innodb/t/table_flags.opt2
-rw-r--r--mysql-test/suite/innodb/t/table_flags.test7
-rw-r--r--mysql-test/suite/innodb/t/temp_truncate.opt2
-rw-r--r--mysql-test/suite/innodb/t/temp_truncate.test44
-rw-r--r--mysql-test/suite/innodb/t/temp_truncate_debug.opt2
-rw-r--r--mysql-test/suite/innodb/t/temp_truncate_debug.test22
-rw-r--r--mysql-test/suite/innodb/t/temporary_table.test20
-rw-r--r--mysql-test/suite/innodb/t/undo_upgrade.test43
-rw-r--r--mysql-test/suite/innodb_fts/r/crash_recovery.result2
-rw-r--r--mysql-test/suite/innodb_fts/r/ft_result_cache_limit.result2
-rw-r--r--mysql-test/suite/innodb_fts/r/fulltext.result11
-rw-r--r--mysql-test/suite/innodb_fts/r/fulltext_misc.result20
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb-fts-ddl,vers.rdiff10
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb-fts-ddl,vers_trx.rdiff10
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result4
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result5
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb_fts_proximity.result3
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb_fts_transaction.result16
-rw-r--r--mysql-test/suite/innodb_fts/r/misc_1.result2
-rw-r--r--mysql-test/suite/innodb_fts/r/opt.result5
-rw-r--r--mysql-test/suite/innodb_fts/t/ft_result_cache_limit.test2
-rw-r--r--mysql-test/suite/innodb_fts/t/fulltext.test2
-rw-r--r--mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test4
-rw-r--r--mysql-test/suite/innodb_fts/t/innodb_fts_misc_1.test11
-rw-r--r--mysql-test/suite/innodb_fts/t/innodb_fts_proximity.test13
-rw-r--r--mysql-test/suite/innodb_fts/t/innodb_fts_transaction.test8
-rw-r--r--mysql-test/suite/innodb_fts/t/misc_1.test6
-rw-r--r--mysql-test/suite/innodb_gis/r/alter_spatial_index.result11
-rw-r--r--mysql-test/suite/innodb_gis/r/check_rtree.result2
-rw-r--r--mysql-test/suite/innodb_gis/r/create_spatial_index.result166
-rw-r--r--mysql-test/suite/innodb_gis/r/geometry.result2
-rw-r--r--mysql-test/suite/innodb_gis/r/repeatable_spatial.result16
-rw-r--r--mysql-test/suite/innodb_gis/r/rollback.result2
-rw-r--r--mysql-test/suite/innodb_gis/r/rtree.result8
-rw-r--r--mysql-test/suite/innodb_gis/r/rtree_compress.result2
-rw-r--r--mysql-test/suite/innodb_gis/r/rtree_concurrent_srch.result28
-rw-r--r--mysql-test/suite/innodb_gis/r/rtree_create_inplace.result2
-rw-r--r--mysql-test/suite/innodb_gis/r/rtree_multi_pk.result8
-rw-r--r--mysql-test/suite/innodb_gis/r/rtree_optimize.result44
-rw-r--r--mysql-test/suite/innodb_gis/t/alter_spatial_index.test12
-rw-r--r--mysql-test/suite/innodb_gis/t/check_rtree.test2
-rw-r--r--mysql-test/suite/innodb_gis/t/create_spatial_index.test97
-rw-r--r--mysql-test/suite/innodb_gis/t/geometry.test2
-rw-r--r--mysql-test/suite/innodb_gis/t/repeatable_spatial.test8
-rw-r--r--mysql-test/suite/innodb_gis/t/rollback.test4
-rw-r--r--mysql-test/suite/innodb_gis/t/rtree_compress.test2
-rw-r--r--mysql-test/suite/innodb_gis/t/rtree_concurrent_srch.test14
-rw-r--r--mysql-test/suite/innodb_gis/t/rtree_create_inplace.test2
-rw-r--r--mysql-test/suite/innodb_gis/t/rtree_multi_pk.test1
-rw-r--r--mysql-test/suite/innodb_gis/t/rtree_optimize.test44
-rw-r--r--mysql-test/suite/innodb_zip/r/bug36169.result2
-rw-r--r--mysql-test/suite/innodb_zip/r/bug53591.result7
-rw-r--r--mysql-test/suite/innodb_zip/r/bug56680.result5
-rw-r--r--mysql-test/suite/innodb_zip/r/cmp_drop_table.result1
-rw-r--r--mysql-test/suite/innodb_zip/r/create_options.result17
-rw-r--r--mysql-test/suite/innodb_zip/r/index_large_prefix.result50
-rw-r--r--mysql-test/suite/innodb_zip/r/index_large_prefix_4k.result50
-rw-r--r--mysql-test/suite/innodb_zip/r/index_large_prefix_8k.result50
-rw-r--r--mysql-test/suite/innodb_zip/r/innochecksum_2.result3
-rw-r--r--mysql-test/suite/innodb_zip/r/innodb-zip.result12
-rw-r--r--mysql-test/suite/innodb_zip/r/large_blob.result5
-rw-r--r--mysql-test/suite/innodb_zip/r/page_size,4k.rdiff22
-rw-r--r--mysql-test/suite/innodb_zip/r/page_size,8k.rdiff22
-rw-r--r--mysql-test/suite/innodb_zip/r/page_size.result7
-rw-r--r--mysql-test/suite/innodb_zip/r/prefix_index_liftedlimit.result12
-rw-r--r--mysql-test/suite/innodb_zip/r/restart.result34
-rw-r--r--mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result5
-rw-r--r--mysql-test/suite/innodb_zip/r/wl5522_zip.result4
-rw-r--r--mysql-test/suite/innodb_zip/r/wl6347_comp_indx_stat.result16
-rw-r--r--mysql-test/suite/innodb_zip/t/bug36169.test7
-rw-r--r--mysql-test/suite/innodb_zip/t/bug53591.test10
-rw-r--r--mysql-test/suite/innodb_zip/t/bug56680.test5
-rw-r--r--mysql-test/suite/innodb_zip/t/cmp_drop_table.test11
-rw-r--r--mysql-test/suite/innodb_zip/t/create_options.test9
-rw-r--r--mysql-test/suite/innodb_zip/t/index_large_prefix.test30
-rw-r--r--mysql-test/suite/innodb_zip/t/index_large_prefix_4k.test31
-rw-r--r--mysql-test/suite/innodb_zip/t/index_large_prefix_8k.test31
-rw-r--r--mysql-test/suite/innodb_zip/t/innochecksum_2.test4
-rw-r--r--mysql-test/suite/innodb_zip/t/innodb-zip.test8
-rw-r--r--mysql-test/suite/innodb_zip/t/large_blob.test9
-rw-r--r--mysql-test/suite/innodb_zip/t/page_size.test28
-rw-r--r--mysql-test/suite/innodb_zip/t/prefix_index_liftedlimit.test6
-rw-r--r--mysql-test/suite/innodb_zip/t/restart.test13
-rw-r--r--mysql-test/suite/innodb_zip/t/wl5522_debug_zip.test15
-rw-r--r--mysql-test/suite/innodb_zip/t/wl5522_zip.test8
-rw-r--r--mysql-test/suite/innodb_zip/t/wl6347_comp_indx_stat.test16
-rw-r--r--mysql-test/suite/json/r/json_table.result104
-rw-r--r--mysql-test/suite/json/r/json_table_mysql.result6
-rw-r--r--mysql-test/suite/json/t/json_table.test96
-rw-r--r--mysql-test/suite/json/t/json_table_mysql.test1
-rw-r--r--mysql-test/suite/maria/crash-recursive.result53
-rw-r--r--mysql-test/suite/maria/crash-recursive.test67
-rw-r--r--mysql-test/suite/maria/icp.result28
-rw-r--r--mysql-test/suite/maria/mrr.result10
-rw-r--r--mysql-test/suite/mariabackup/backup_ssl.result8
-rw-r--r--mysql-test/suite/mariabackup/backup_ssl.test15
-rw-r--r--mysql-test/suite/mariabackup/backup_ssl_not_win.result4
-rw-r--r--mysql-test/suite/mariabackup/backup_ssl_not_win.test10
-rw-r--r--mysql-test/suite/mariabackup/compat_xtrabackup.result21
-rw-r--r--mysql-test/suite/mariabackup/compat_xtrabackup.test62
-rw-r--r--mysql-test/suite/mariabackup/extra_lsndir.result4
-rw-r--r--mysql-test/suite/mariabackup/extra_lsndir_stream.result4
-rw-r--r--mysql-test/suite/mariabackup/include/show_xtrabackup_slave_info.inc4
-rw-r--r--mysql-test/suite/mariabackup/incremental_compressed.test4
-rw-r--r--mysql-test/suite/mariabackup/innodb_force_recovery.result8
-rw-r--r--mysql-test/suite/mariabackup/innodb_force_recovery.test10
-rw-r--r--mysql-test/suite/mariabackup/mdev-14447.result2
-rw-r--r--mysql-test/suite/mariabackup/rpl_clone_slave.result10
-rw-r--r--mysql-test/suite/mariabackup/rpl_slave_info.result12
-rw-r--r--mysql-test/suite/mariabackup/rpl_slave_info.test6
-rw-r--r--mysql-test/suite/mariabackup/slave_info_norpl.result2
-rw-r--r--mysql-test/suite/mariabackup/slave_info_norpl.test4
-rw-r--r--mysql-test/suite/mariabackup/slave_provision_nolock.cnf2
-rw-r--r--mysql-test/suite/mariabackup/slave_provision_nolock.result1
-rw-r--r--mysql-test/suite/mariabackup/slave_provision_nolock.test1
-rw-r--r--mysql-test/suite/mariabackup/sys_truncate.opt2
-rw-r--r--mysql-test/suite/mariabackup/sys_truncate.result28
-rw-r--r--mysql-test/suite/mariabackup/sys_truncate.test36
-rw-r--r--mysql-test/suite/mariabackup/undo_space_id.opt2
-rw-r--r--mysql-test/suite/mariabackup/xb_compressed_encrypted.opt1
-rw-r--r--mysql-test/suite/mariabackup/xb_fulltext_encrypted.opt1
-rw-r--r--mysql-test/suite/merge/alter_table.result22
-rw-r--r--mysql-test/suite/merge/alter_table.test12
-rw-r--r--mysql-test/suite/merge/merge.result (renamed from mysql-test/main/merge.result)69
-rw-r--r--mysql-test/suite/merge/merge.test (renamed from mysql-test/main/merge.test)60
-rw-r--r--mysql-test/suite/merge/merge_debug.result (renamed from mysql-test/main/merge_debug.result)0
-rw-r--r--mysql-test/suite/merge/merge_debug.test (renamed from mysql-test/main/merge_debug.test)0
-rw-r--r--mysql-test/suite/merge/merge_innodb.result (renamed from mysql-test/main/merge_innodb.result)0
-rw-r--r--mysql-test/suite/merge/merge_innodb.test (renamed from mysql-test/main/merge_innodb.test)0
-rw-r--r--mysql-test/suite/merge/merge_mmap-master.opt (renamed from mysql-test/main/merge_mmap-master.opt)0
-rw-r--r--mysql-test/suite/merge/merge_mmap.result (renamed from mysql-test/main/merge_mmap.result)0
-rw-r--r--mysql-test/suite/merge/merge_mmap.test (renamed from mysql-test/main/merge_mmap.test)0
-rw-r--r--mysql-test/suite/mtr/t/simple,c2,s1.rdiff4
-rw-r--r--mysql-test/suite/mtr/t/simple,s2,c2.rdiff4
-rw-r--r--mysql-test/suite/multi_source/gtid.result12
-rw-r--r--mysql-test/suite/multi_source/gtid.test12
-rw-r--r--mysql-test/suite/multi_source/gtid_ignore_duplicates.result14
-rw-r--r--mysql-test/suite/multi_source/gtid_ignore_duplicates.test14
-rw-r--r--mysql-test/suite/multi_source/gtid_slave_pos.result4
-rw-r--r--mysql-test/suite/multi_source/gtid_slave_pos.test4
-rw-r--r--mysql-test/suite/multi_source/info_logs.result14
-rw-r--r--mysql-test/suite/multi_source/info_logs.test6
-rw-r--r--mysql-test/suite/multi_source/load_data.result4
-rw-r--r--mysql-test/suite/multi_source/load_data.test4
-rw-r--r--mysql-test/suite/multi_source/mdev-8874.result12
-rw-r--r--mysql-test/suite/multi_source/mdev-8874.test12
-rw-r--r--mysql-test/suite/multi_source/mdev-9544.result6
-rw-r--r--mysql-test/suite/multi_source/mdev-9544.test6
-rw-r--r--mysql-test/suite/multi_source/multi_parallel.result4
-rw-r--r--mysql-test/suite/multi_source/multi_parallel.test4
-rw-r--r--mysql-test/suite/multi_source/multi_source_slave_alias_replica.result8
-rw-r--r--mysql-test/suite/multi_source/multi_source_slave_alias_replica.test4
-rw-r--r--mysql-test/suite/multi_source/multisource.result4
-rw-r--r--mysql-test/suite/multi_source/multisource_for_channel.result4
-rw-r--r--mysql-test/suite/multi_source/multisource_for_channel.test4
-rw-r--r--mysql-test/suite/multi_source/my.cnf3
-rw-r--r--mysql-test/suite/multi_source/relaylog_events.result2
-rw-r--r--mysql-test/suite/multi_source/relaylog_events.test2
-rw-r--r--mysql-test/suite/multi_source/replicate_rewrite_db_dynamic.result4
-rw-r--r--mysql-test/suite/multi_source/replicate_rewrite_db_dynamic.test4
-rw-r--r--mysql-test/suite/multi_source/reset_slave.result6
-rw-r--r--mysql-test/suite/multi_source/reset_slave.test2
-rw-r--r--mysql-test/suite/multi_source/simple.result22
-rw-r--r--mysql-test/suite/multi_source/simple.test4
-rw-r--r--mysql-test/suite/multi_source/skip_counter.result4
-rw-r--r--mysql-test/suite/multi_source/skip_counter.test4
-rw-r--r--mysql-test/suite/multi_source/status_vars.result4
-rw-r--r--mysql-test/suite/multi_source/status_vars.test4
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/r/bug41029.result4
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/r/bug42991.result8
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/t/bug41029.test2
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/t/bug42991.test5
-rw-r--r--mysql-test/suite/parts/inc/partition_decimal.inc4
-rw-r--r--mysql-test/suite/parts/inc/partition_double.inc4
-rw-r--r--mysql-test/suite/parts/inc/partition_key_16col.inc1
-rw-r--r--mysql-test/suite/parts/inc/partition_key_32col.inc1
-rw-r--r--mysql-test/suite/parts/inc/partition_key_4col.inc1
-rw-r--r--mysql-test/suite/parts/inc/partition_key_8col.inc1
-rw-r--r--mysql-test/suite/parts/inc/partition_time.inc2
-rw-r--r--mysql-test/suite/parts/inc/partition_timestamp.inc5
-rw-r--r--mysql-test/suite/parts/r/alter_data_directory_innodb.result4
-rw-r--r--mysql-test/suite/parts/r/alter_table.result182
-rw-r--r--mysql-test/suite/parts/r/longname.result4
-rw-r--r--mysql-test/suite/parts/r/optimizer.result8
-rw-r--r--mysql-test/suite/parts/r/partition_basic_symlink_innodb.result8
-rw-r--r--mysql-test/suite/parts/r/partition_char_innodb.resultbin50530 -> 50530 bytes
-rw-r--r--mysql-test/suite/parts/r/partition_datetime_innodb.result966
-rw-r--r--mysql-test/suite/parts/r/partition_datetime_myisam.result122
-rw-r--r--mysql-test/suite/parts/r/partition_decimal_innodb.result28
-rw-r--r--mysql-test/suite/parts/r/partition_decimal_myisam.result28
-rw-r--r--mysql-test/suite/parts/r/partition_double_innodb.result16
-rw-r--r--mysql-test/suite/parts/r/partition_double_myisam.result16
-rw-r--r--mysql-test/suite/parts/r/partition_float_innodb.result10
-rw-r--r--mysql-test/suite/parts/r/partition_special_innodb.result8
-rw-r--r--mysql-test/suite/parts/r/partition_special_myisam.result8
-rw-r--r--mysql-test/suite/parts/r/percona_nonflushing_analyze_debug.result12
-rw-r--r--mysql-test/suite/parts/r/reorganize_partition_innodb.result4
-rw-r--r--mysql-test/suite/parts/t/alter_table.test139
-rw-r--r--mysql-test/suite/parts/t/debug_innodb_crash-master.opt2
-rw-r--r--mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt1
-rw-r--r--mysql-test/suite/perfschema/include/hostcache_set_state.inc2
-rw-r--r--mysql-test/suite/perfschema/include/upgrade_check.inc2
-rw-r--r--mysql-test/suite/perfschema/r/alter_table_progress.result8
-rw-r--r--mysql-test/suite/perfschema/r/batch_table_io_func.result11
-rw-r--r--mysql-test/suite/perfschema/r/ddl_events_stages_current.result6
-rw-r--r--mysql-test/suite/perfschema/r/ddl_events_stages_history.result6
-rw-r--r--mysql-test/suite/perfschema/r/ddl_events_stages_history_long.result6
-rw-r--r--mysql-test/suite/perfschema/r/digest_view.result60
-rw-r--r--mysql-test/suite/perfschema/r/dml_handler.result2
-rw-r--r--mysql-test/suite/perfschema/r/dml_setup_instruments.result2
-rw-r--r--mysql-test/suite/perfschema/r/dml_setup_timers.result34
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate.result1334
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_a.result918
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result784
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result478
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result344
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_h.result1200
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_u.result894
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result760
-rw-r--r--mysql-test/suite/perfschema/r/max_program_zero.result2
-rw-r--r--mysql-test/suite/perfschema/r/ortho_iter.result8
-rw-r--r--mysql-test/suite/perfschema/r/privilege.result8
-rw-r--r--mysql-test/suite/perfschema/r/query_cache.result4
-rw-r--r--mysql-test/suite/perfschema/r/relaylog.result2
-rw-r--r--mysql-test/suite/perfschema/r/rpl_threads.result6
-rw-r--r--mysql-test/suite/perfschema/r/selects.result2
-rw-r--r--mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_idle.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_stages.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_statements.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_transactions.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_waits.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_innodb.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_low_digest_sql_length.result10
-rw-r--r--mysql-test/suite/perfschema/r/start_server_low_index.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_low_table_lock.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_account.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_cond_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_cond_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_file_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_file_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_host.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_index.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_mdl.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_memory_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_mutex_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_setup_actors.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_setup_objects.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_socket_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_socket_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stage_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stages_history.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_statement_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_statements_history.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_table_hdl.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_table_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_table_lock.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_thread_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_thread_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_transactions_history.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_user.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_waits_history.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_nothing.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_off.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_on.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_variables.result2
-rw-r--r--mysql-test/suite/perfschema/r/statement_program_lost_inst.result2
-rw-r--r--mysql-test/suite/perfschema/r/table_schema.result2350
-rw-r--r--mysql-test/suite/perfschema/r/transaction.result8
-rw-r--r--mysql-test/suite/perfschema/t/cnf_option.cnf2
-rw-r--r--mysql-test/suite/perfschema/t/digest_view.test8
-rw-r--r--mysql-test/suite/perfschema/t/ortho_iter.test4
-rw-r--r--mysql-test/suite/perfschema/t/show_sanity.test4
-rw-r--r--mysql-test/suite/perfschema/t/start_server_low_digest_sql_length.test6
-rw-r--r--mysql-test/suite/perfschema/t/transaction.test4
-rw-r--r--mysql-test/suite/period/r/create.result52
-rw-r--r--mysql-test/suite/period/r/delete,myisam.rdiff4
-rw-r--r--mysql-test/suite/period/r/i_s_notembedded,win.rdiff20
-rw-r--r--mysql-test/suite/period/r/i_s_notembedded.result118
-rw-r--r--mysql-test/suite/period/r/overlaps.result14
-rw-r--r--mysql-test/suite/period/r/update.result2
-rw-r--r--mysql-test/suite/period/t/create.test36
-rw-r--r--mysql-test/suite/period/t/i_s_notembedded.test119
-rw-r--r--mysql-test/suite/period/t/overlaps.test11
-rw-r--r--mysql-test/suite/period/t/update.test2
-rw-r--r--mysql-test/suite/plugins/r/locales.result2
-rw-r--r--mysql-test/suite/roles/admin.result4
-rw-r--r--mysql-test/suite/roles/create_and_drop_role_invalid_user_table.test4
-rw-r--r--mysql-test/suite/roles/definer.result3
-rw-r--r--mysql-test/suite/roles/definer.test2
-rw-r--r--mysql-test/suite/rpl/include/multisource.inc4
-rw-r--r--mysql-test/suite/rpl/include/rpl_change_master_demote.inc2
-rw-r--r--mysql-test/suite/rpl/include/rpl_extra_col_slave.test3
-rw-r--r--mysql-test/suite/rpl/include/rpl_get_master_version_and_clock.test4
-rw-r--r--mysql-test/suite/rpl/include/rpl_gtid_index.inc187
-rw-r--r--mysql-test/suite/rpl/include/rpl_gtid_until_before_after_gtids.test375
-rw-r--r--mysql-test/suite/rpl/include/rpl_row_blob.test18
-rw-r--r--mysql-test/suite/rpl/my.cnf2
-rw-r--r--mysql-test/suite/rpl/r/grant_replication_slave.result2
-rw-r--r--mysql-test/suite/rpl/r/max_binlog_total_size.result49
-rw-r--r--mysql-test/suite/rpl/r/rpl_000010.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_alter_extra_persistent.result291
-rw-r--r--mysql-test/suite/rpl/r/rpl_alter_innodb.result (renamed from mysql-test/suite/rpl/r/rpl_alter_instant.result)0
-rw-r--r--mysql-test/suite/rpl/r/rpl_alter_online_debug.result84
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug26395.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_change_master_demote.result18
-rw-r--r--mysql-test/suite/rpl/r/rpl_checksum_cache.result43
-rw-r--r--mysql-test/suite/rpl/r/rpl_circular_semi_sync.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_connection.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_cross_version.result22
-rw-r--r--mysql-test/suite/rpl/r/rpl_ctype_collate_implicit.result83
-rw-r--r--mysql-test/suite/rpl/r/rpl_delayed_slave,parallel.rdiff4
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop_db.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_extra_col_slave_minimal.result46
-rw-r--r--mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_geometry.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_glle_no_terminate.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_index.result366
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_master_promote.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_mdev4485.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_until_before_after_gtids.result239
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_hrtime.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_bug28430.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_bug30888.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff4
-rw-r--r--mysql-test/suite/rpl/r/rpl_invoked_features.result35
-rw-r--r--mysql-test/suite/rpl/r/rpl_iodku,stmt.rdiff4
-rw-r--r--mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_ipv6.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_master_pos_wait.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_mdev12179.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_mdev33798.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_misc_functions.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_old_master_29078.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_29322.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_optimistic.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_optimistic_nobinlog.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_worker.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_perfschema_connect_config.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_rewrite_db_sys_vars.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_rotate_logs.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_big_table_id,32bit.rdiff4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_blob_innodb.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_blob_myisam.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_create_table.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_drop.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_end_of_statement_loss.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_img_blobs.result2317
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_img_eng_full_nodup.result4799
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_img_full_nodup.result4784
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_img_sequence_full_nodup.result796
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_cond_var_per_thd.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_fail_over.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_slave_reply_fail.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_semisync_ali_issues.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_set_statement_default_master.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_show_slave_hosts.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_skip_replication.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_shutdown_mdev20821.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_ssl.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_ssl1.result39
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_alter_restart_master.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_alter_restart_slave.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporary.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_timestamp.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_upgrade_master_info.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_xa.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_xa_gtid_pos_auto_engine.result2
-rw-r--r--mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result2
-rw-r--r--mysql-test/suite/rpl/rpl_1slave_base.cnf3
-rw-r--r--mysql-test/suite/rpl/t/grant_replication_slave.test2
-rw-r--r--mysql-test/suite/rpl/t/max_binlog_total_size-master.opt5
-rw-r--r--mysql-test/suite/rpl/t/max_binlog_total_size.test58
-rw-r--r--mysql-test/suite/rpl/t/rpl_000010.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_alter_extra_persistent.test177
-rw-r--r--mysql-test/suite/rpl/t/rpl_alter_innodb.test (renamed from mysql-test/suite/rpl/t/rpl_alter_instant.test)0
-rw-r--r--mysql-test/suite/rpl/t/rpl_alter_online_debug.test128
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug26395.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_checksum_cache.test98
-rw-r--r--mysql-test/suite/rpl/t/rpl_circular_semi_sync.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_connection.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_corruption.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_cross_version-master.opt1
-rw-r--r--mysql-test/suite/rpl/t/rpl_cross_version.test48
-rw-r--r--mysql-test/suite/rpl/t/rpl_ctype_collate_implicit.test60
-rw-r--r--mysql-test/suite/rpl/t/rpl_extra_col_slave_minimal.test44
-rw-r--r--mysql-test/suite/rpl/t/rpl_geometry.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_glle_no_terminate.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_index.test89
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_master_promote.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_mdev4485.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_until_before_after_gtids.test45
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_invoked_features.test95
-rw-r--r--mysql-test/suite/rpl/t/rpl_ip_mix.cnf3
-rw-r--r--mysql-test/suite/rpl/t/rpl_ip_mix2.cnf3
-rw-r--r--mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.cnf3
-rw-r--r--mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_ipv6.cnf3
-rw-r--r--mysql-test/suite/rpl/t/rpl_ipv6.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_known_bugs_detection-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_fatal-slave.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_master_pos_wait.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_mdev33798.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_mysql_upgrade.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_optimistic.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_optimistic_nobinlog.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_worker.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_perfschema_connect_config.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_rewrite_db_sys_vars.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_rotate_logs.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_4_bytes-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_end_of_statement_loss.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_img.cnf2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_img_blobs.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_img_eng_full_nodup.cnf1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_img_eng_full_nodup.test67
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_img_full_nodup.cnf1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_img_full_nodup.test34
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_img_sequence_full.cnf2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_img_sequence_full_nodup.cnf21
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_img_sequence_full_nodup.test51
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_img_sequence_min.cnf2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_img_sequence_noblob.cnf2
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_cond_var_per_thd.cnf3
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_cond_var_per_thd.test24
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_crash.inc2
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_slave_reply_fail.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_semisync_ali_issues.test11
-rw-r--r--mysql-test/suite/rpl/t/rpl_set_statement_default_master.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_show_slave_hosts.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_skip_incident-master.opt2
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_shutdown_mdev20821.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_ssl.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_ssl1.test43
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_7.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_8.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_2.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_restart_master.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_start_alter_restart_slave.test10
-rw-r--r--mysql-test/suite/rpl/t/rpl_upgrade_master_info.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_xa.inc2
-rw-r--r--mysql-test/suite/rpl/t/rpl_xa_empty_transaction.cnf2
-rw-r--r--mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test2
-rw-r--r--mysql-test/suite/s3/alter.result4
-rw-r--r--mysql-test/suite/s3/alter.test6
-rw-r--r--mysql-test/suite/s3/my.cnf3
-rw-r--r--mysql-test/suite/storage_engine/type_char_indexes.result11
-rw-r--r--mysql-test/suite/storage_engine/type_char_indexes.test7
-rw-r--r--mysql-test/suite/sys_vars/inc/explicit_defaults_for_timestamp.inc2
-rw-r--r--mysql-test/suite/sys_vars/inc/sysvar_global_and_session_grant.inc17
-rw-r--r--mysql-test/suite/sys_vars/inc/sysvar_global_grant.inc20
-rw-r--r--mysql-test/suite/sys_vars/inc/sysvar_global_grant_alone.inc16
-rw-r--r--mysql-test/suite/sys_vars/inc/sysvar_session_grant.inc18
-rw-r--r--mysql-test/suite/sys_vars/inc/sysvar_session_grant_alone.inc16
-rw-r--r--mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic,32bit.rdiff9
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_annotate_row_events_grant.result21
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_cache_size_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_commit_wait_count_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_commit_wait_usec_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_direct_non_transactional_updates_grant.result21
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_expire_logs_seconds_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_file_cache_size_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_format_grant.result21
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_row_image_grant.result21
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_row_metadata_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/connect_timeout_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/date_format_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/datetime_format_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/debug_basic.result25
-rw-r--r--mysql-test/suite/sys_vars/r/debug_dbug_basic.result20
-rw-r--r--mysql-test/suite/sys_vars/r/debug_dbug_func_notembedded.result16
-rw-r--r--mysql-test/suite/sys_vars/r/debug_no_thread_alarm_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/disconnect_on_expired_password_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/expire_logs_days_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_off.result4
-rw-r--r--mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_on.result2
-rw-r--r--mysql-test/suite/sys_vars/r/extra_max_connections_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/gtid_binlog_state_grant.result20
-rw-r--r--mysql-test/suite/sys_vars/r/gtid_cleanup_batch_size_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/gtid_domain_id_grant.result33
-rw-r--r--mysql-test/suite/sys_vars/r/gtid_ignore_duplicates_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/gtid_pos_auto_engines_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/gtid_seq_no_grant.result20
-rw-r--r--mysql-test/suite/sys_vars/r/gtid_slave_pos_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/gtid_strict_mode_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/histogram_type_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/init_connect_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/init_slave_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_change_buffer_max_size_basic.result77
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_change_buffering_basic.result73
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_change_buffering_debug_basic.result67
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_defragment_basic.result18
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_defragment_fill_factor_basic.result37
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_defragment_fill_factor_n_recs_basic.result42
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_defragment_frequency_basic.result42
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_defragment_n_pages_basic.result28
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_defragment_stats_accuracy_basic.result33
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_doublewrite_basic.result47
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_fil_make_page_dirty_debug_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result10
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit,32bit.rdiff4
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_saved_page_number_debug_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/lc_time_names_basic.result20
-rw-r--r--mysql-test/suite/sys_vars/r/log_bin_compress_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/log_bin_compress_min_len_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result12
-rw-r--r--mysql-test/suite/sys_vars/r/master_verify_checksum_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/max_binlog_cache_size_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/max_binlog_size_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/max_binlog_total_size_basic.result41
-rw-r--r--mysql-test/suite/sys_vars/r/max_connect_errors_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/max_connections_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/max_join_size_basic.result8
-rw-r--r--mysql-test/suite/sys_vars/r/max_join_size_func.result6
-rw-r--r--mysql-test/suite/sys_vars/r/max_password_errors_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/max_tmp_tables_basic.result251
-rw-r--r--mysql-test/suite/sys_vars/r/mdev_15935.result10
-rw-r--r--mysql-test/suite/sys_vars/r/mdev_32254.result13
-rw-r--r--mysql-test/suite/sys_vars/r/mdev_32525.result11
-rw-r--r--mysql-test/suite/sys_vars/r/mdev_32640.result15
-rw-r--r--mysql-test/suite/sys_vars/r/old_alter_table_basic.result130
-rw-r--r--mysql-test/suite/sys_vars/r/old_mode_basic.result40
-rw-r--r--mysql-test/suite/sys_vars/r/old_passwords_func.result5
-rw-r--r--mysql-test/suite/sys_vars/r/optimizer_switch_basic.result38
-rw-r--r--mysql-test/suite/sys_vars/r/preudo_thread_id_grant.result20
-rw-r--r--mysql-test/suite/sys_vars/r/proxy_protocol_networks_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/read_binlog_speed_limit_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/read_only_grant.result2
-rw-r--r--mysql-test/suite/sys_vars/r/redirect.result81
-rw-r--r--mysql-test/suite/sys_vars/r/relay_log_purge_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/relay_log_recovery_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/replicate_do_db_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/replicate_do_table_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/replicate_events_marked_for_skip_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/replicate_ignore_db_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/replicate_ignore_table_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/replicate_wild_do_table_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/replicate_wild_ignore_table_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_semi_sync_master_timeout_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_semi_sync_master_trace_level_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_no_slave_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_point_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_delay_master_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_kill_conn_timeout_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_trace_level_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/secure_auth_func.result2
-rw-r--r--mysql-test/suite/sys_vars/r/secure_auth_grant.result21
-rw-r--r--mysql-test/suite/sys_vars/r/secure_file_priv.result2
-rw-r--r--mysql-test/suite/sys_vars/r/server_id_grant.result33
-rw-r--r--mysql-test/suite/sys_vars/r/session_track_system_variables_basic.result22
-rw-r--r--mysql-test/suite/sys_vars/r/slave_compressed_protocol_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/slave_ddl_exec_mode_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/slave_domain_parallel_threads_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/slave_exec_mode_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/slave_max_allowed_packet_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/slave_net_timeout_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/slave_parallel_max_queued_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/slave_parallel_mode_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/slave_parallel_threads_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/slave_parallel_workers_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/slave_run_triggers_for_rbr_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/slave_sql_verify_checksum_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/slave_transaction_retry_interval_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/slave_type_conversions_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/slow_launch_time_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/sql_big_selects_func.result2
-rw-r--r--mysql-test/suite/sys_vars/r/sql_log_bin_grant.result22
-rw-r--r--mysql-test/suite/sys_vars/r/sql_notes_basic.result107
-rw-r--r--mysql-test/suite/sys_vars/r/sql_notes_func.result10
-rw-r--r--mysql-test/suite/sys_vars/r/stored_program_cache_func.result3
-rw-r--r--mysql-test/suite/sys_vars/r/sync_binlog_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/sync_master_info_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/sync_relay_log_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/sync_relay_log_info_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_aria,32bit.rdiff16
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_debug,32bit.rdiff8
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_debug.result15
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb.result180
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff282
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_embedded.result314
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff311
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_notembedded,aix.rdiff4
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result364
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_wsrep,32bit.rdiff22
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_wsrep.result15
-rw-r--r--mysql-test/suite/sys_vars/r/thread_pool_idle_timeout_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/thread_pool_max_threads_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/thread_pool_oversubscribe_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/thread_pool_stall_limit_grant.result19
-rw-r--r--mysql-test/suite/sys_vars/r/time_format_basic.result21
-rw-r--r--mysql-test/suite/sys_vars/r/transaction_isolation_basic.result141
-rw-r--r--mysql-test/suite/sys_vars/r/transaction_isolation_func.result (renamed from mysql-test/suite/sys_vars/r/tx_isolation_func.result)50
-rw-r--r--mysql-test/suite/sys_vars/r/transaction_read_only_basic.result181
-rw-r--r--mysql-test/suite/sys_vars/r/tx_compatibility.result139
-rw-r--r--mysql-test/suite/sys_vars/r/tx_isolation_basic.result141
-rw-r--r--mysql-test/suite/sys_vars/r/tx_read_only_basic.result181
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_causal_reads_basic.result64
-rw-r--r--mysql-test/suite/sys_vars/t/binlog_direct_non_transactional_updates_grant.test19
-rw-r--r--mysql-test/suite/sys_vars/t/binlog_format_grant.test18
-rw-r--r--mysql-test/suite/sys_vars/t/connect_timeout_grant.test19
-rw-r--r--mysql-test/suite/sys_vars/t/date_format_basic.test18
-rw-r--r--mysql-test/suite/sys_vars/t/datetime_format_basic.test18
-rw-r--r--mysql-test/suite/sys_vars/t/debug_basic.test22
-rw-r--r--mysql-test/suite/sys_vars/t/debug_dbug_basic.test12
-rw-r--r--mysql-test/suite/sys_vars/t/debug_dbug_func_notembedded.test10
-rw-r--r--mysql-test/suite/sys_vars/t/debug_no_thread_alarm_basic.test21
-rw-r--r--mysql-test/suite/sys_vars/t/disconnect_on_expired_password_grant.test19
-rw-r--r--mysql-test/suite/sys_vars/t/extra_max_connections_grant.test19
-rw-r--r--mysql-test/suite/sys_vars/t/gtid_binlog_state_grant.test23
-rw-r--r--mysql-test/suite/sys_vars/t/init_connect_grant.test19
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_change_buffer_max_size_basic.test71
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test65
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test59
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_defragment_basic.test20
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_defragment_fill_factor_basic.test27
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_defragment_fill_factor_n_recs_basic.test31
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_defragment_frequency_basic.test37
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_defragment_n_pages_basic.test22
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_defragment_stats_accuracy_basic.test24
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_doublewrite_basic.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_doublewrite_basic.test82
-rw-r--r--mysql-test/suite/sys_vars/t/lc_time_names_basic.test10
-rw-r--r--mysql-test/suite/sys_vars/t/max_binlog_total_size_basic.test42
-rw-r--r--mysql-test/suite/sys_vars/t/max_connect_errors_grant.test19
-rw-r--r--mysql-test/suite/sys_vars/t/max_connections_grant.test19
-rw-r--r--mysql-test/suite/sys_vars/t/max_join_size_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/max_join_size_func.test4
-rw-r--r--mysql-test/suite/sys_vars/t/max_password_errors_grant.test19
-rw-r--r--mysql-test/suite/sys_vars/t/max_tmp_tables_basic.test227
-rw-r--r--mysql-test/suite/sys_vars/t/mdev_15935.test13
-rw-r--r--mysql-test/suite/sys_vars/t/mdev_32254.test17
-rw-r--r--mysql-test/suite/sys_vars/t/mdev_32525.test23
-rw-r--r--mysql-test/suite/sys_vars/t/mdev_32640.test18
-rw-r--r--mysql-test/suite/sys_vars/t/old_alter_table_basic.test68
-rw-r--r--mysql-test/suite/sys_vars/t/old_mode_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/old_passwords_func.test6
-rw-r--r--mysql-test/suite/sys_vars/t/optimizer_switch_basic.test4
-rw-r--r--mysql-test/suite/sys_vars/t/proxy_protocol_networks_grant.test19
-rw-r--r--mysql-test/suite/sys_vars/t/redirect.opt1
-rw-r--r--mysql-test/suite/sys_vars/t/redirect.test74
-rw-r--r--mysql-test/suite/sys_vars/t/secure_auth_func.test3
-rw-r--r--mysql-test/suite/sys_vars/t/secure_auth_grant.test19
-rw-r--r--mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.cnf2
-rw-r--r--mysql-test/suite/sys_vars/t/slow_launch_time_grant.test19
-rw-r--r--mysql-test/suite/sys_vars/t/sql_big_selects_func.test4
-rw-r--r--mysql-test/suite/sys_vars/t/sql_log_bin_grant.test19
-rw-r--r--mysql-test/suite/sys_vars/t/sql_notes_basic.test171
-rw-r--r--mysql-test/suite/sys_vars/t/stored_program_cache_func.test6
-rw-r--r--mysql-test/suite/sys_vars/t/thread_pool_idle_timeout_grant.test19
-rw-r--r--mysql-test/suite/sys_vars/t/thread_pool_max_threads_grant.test19
-rw-r--r--mysql-test/suite/sys_vars/t/thread_pool_oversubscribe_grant.test19
-rw-r--r--mysql-test/suite/sys_vars/t/thread_pool_stall_limit_grant.test19
-rw-r--r--mysql-test/suite/sys_vars/t/time_format_basic.test18
-rw-r--r--mysql-test/suite/sys_vars/t/transaction_isolation_basic.test (renamed from mysql-test/suite/sys_vars/t/tx_isolation_basic.test)152
-rw-r--r--mysql-test/suite/sys_vars/t/transaction_isolation_func-master.opt (renamed from mysql-test/suite/sys_vars/t/tx_isolation_func-master.opt)0
-rw-r--r--mysql-test/suite/sys_vars/t/transaction_isolation_func.test (renamed from mysql-test/suite/sys_vars/t/tx_isolation_func.test)46
-rw-r--r--mysql-test/suite/sys_vars/t/transaction_read_only_basic.test (renamed from mysql-test/suite/sys_vars/t/tx_read_only_basic.test)170
-rw-r--r--mysql-test/suite/sys_vars/t/tx_compatibility-master.opt2
-rw-r--r--mysql-test/suite/sys_vars/t/tx_compatibility.test68
-rw-r--r--mysql-test/suite/sys_vars/t/version.test2
-rw-r--r--mysql-test/suite/sys_vars/t/wsrep_causal_reads_basic.test45
-rw-r--r--mysql-test/suite/sysschema/r/all_sys_objects_exist.result6
-rw-r--r--mysql-test/suite/sysschema/r/optimizer_switch.result42
-rw-r--r--mysql-test/suite/sysschema/r/pr_create_synonym_db.result33
-rw-r--r--mysql-test/suite/sysschema/r/pr_diagnostics.result4
-rw-r--r--mysql-test/suite/sysschema/r/pr_table_exists.result117
-rw-r--r--mysql-test/suite/sysschema/r/v_host_summary.result6
-rw-r--r--mysql-test/suite/sysschema/r/v_host_summary_by_file_io.result2
-rw-r--r--mysql-test/suite/sysschema/r/v_host_summary_by_file_io_type.result4
-rw-r--r--mysql-test/suite/sysschema/r/v_host_summary_by_stages.result4
-rw-r--r--mysql-test/suite/sysschema/r/v_host_summary_by_statement_latency.result6
-rw-r--r--mysql-test/suite/sysschema/r/v_host_summary_by_statement_type.result6
-rw-r--r--mysql-test/suite/sysschema/r/v_io_by_thread_by_latency.result8
-rw-r--r--mysql-test/suite/sysschema/r/v_io_global_by_file_by_latency.result8
-rw-r--r--mysql-test/suite/sysschema/r/v_io_global_by_wait_by_bytes.result8
-rw-r--r--mysql-test/suite/sysschema/r/v_io_global_by_wait_by_latency.result12
-rw-r--r--mysql-test/suite/sysschema/r/v_latest_file_io.result2
-rw-r--r--mysql-test/suite/sysschema/r/v_privileges_by_table_by_level.result264
-rw-r--r--mysql-test/suite/sysschema/r/v_processlist.result10
-rw-r--r--mysql-test/suite/sysschema/r/v_schema_index_statistics.result8
-rw-r--r--mysql-test/suite/sysschema/r/v_schema_redundant_indexes.result2
-rw-r--r--mysql-test/suite/sysschema/r/v_schema_table_statistics.result16
-rw-r--r--mysql-test/suite/sysschema/r/v_schema_table_statistics_with_buffer.result14
-rw-r--r--mysql-test/suite/sysschema/r/v_schema_tables_with_full_table_scans.result2
-rw-r--r--mysql-test/suite/sysschema/r/v_session.result10
-rw-r--r--mysql-test/suite/sysschema/r/v_statement_analysis.result8
-rw-r--r--mysql-test/suite/sysschema/r/v_statements_with_full_table_scans.result2
-rw-r--r--mysql-test/suite/sysschema/r/v_statements_with_runtimes_in_95th_percentile.result6
-rw-r--r--mysql-test/suite/sysschema/r/v_statements_with_sorting.result2
-rw-r--r--mysql-test/suite/sysschema/r/v_statements_with_temp_tables.result2
-rw-r--r--mysql-test/suite/sysschema/r/v_user_summary.result6
-rw-r--r--mysql-test/suite/sysschema/r/v_user_summary_by_file_io.result2
-rw-r--r--mysql-test/suite/sysschema/r/v_user_summary_by_file_io_type.result4
-rw-r--r--mysql-test/suite/sysschema/r/v_user_summary_by_stages.result4
-rw-r--r--mysql-test/suite/sysschema/r/v_user_summary_by_statement_latency.result6
-rw-r--r--mysql-test/suite/sysschema/r/v_user_summary_by_statement_type.result6
-rw-r--r--mysql-test/suite/sysschema/r/v_version.result2
-rw-r--r--mysql-test/suite/sysschema/r/v_wait_classes_global_by_avg_latency.result8
-rw-r--r--mysql-test/suite/sysschema/r/v_wait_classes_global_by_latency.result8
-rw-r--r--mysql-test/suite/sysschema/r/v_waits_by_host_by_latency.result6
-rw-r--r--mysql-test/suite/sysschema/r/v_waits_by_user_by_latency.result6
-rw-r--r--mysql-test/suite/sysschema/r/v_waits_global_by_latency.result6
-rw-r--r--mysql-test/suite/sysschema/t/mysqldump.test2
-rw-r--r--mysql-test/suite/sysschema/t/optimizer_switch.test2
-rw-r--r--mysql-test/suite/sysschema/t/pr_create_synonym_db.test28
-rw-r--r--mysql-test/suite/sysschema/t/pr_diagnostics.test4
-rw-r--r--mysql-test/suite/sysschema/t/pr_statement_performance_analyzer.test5
-rw-r--r--mysql-test/suite/sysschema/t/pr_table_exists.test110
-rw-r--r--mysql-test/suite/sysschema/t/v_privileges_by_table_by_level.test54
-rw-r--r--mysql-test/suite/sysschema/t/v_schema_redundant_indexes.test1
-rw-r--r--mysql-test/suite/vcol/inc/vcol_ins_upd.inc3
-rw-r--r--mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result9
-rw-r--r--mysql-test/suite/vcol/r/vcol_ins_upd_innodb.result1
-rw-r--r--mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result1
-rw-r--r--mysql-test/suite/vcol/r/vcol_misc.result4
-rw-r--r--mysql-test/suite/vcol/r/vcol_select_innodb.result2
-rw-r--r--mysql-test/suite/vcol/r/vcol_select_myisam.result4
-rw-r--r--mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_main.inc10
-rw-r--r--mysql-test/suite/vcol/t/vcol_misc.test4
-rw-r--r--mysql-test/suite/versioning/r/alter.result2
-rw-r--r--mysql-test/suite/versioning/r/commit_id.result14
-rw-r--r--mysql-test/suite/versioning/r/create.result29
-rw-r--r--mysql-test/suite/versioning/r/cte.result16
-rw-r--r--mysql-test/suite/versioning/r/delete_history.result2
-rw-r--r--mysql-test/suite/versioning/r/derived.result4
-rw-r--r--mysql-test/suite/versioning/r/foreign.result2
-rw-r--r--mysql-test/suite/versioning/r/insert.result2
-rw-r--r--mysql-test/suite/versioning/r/load_data.result2
-rw-r--r--mysql-test/suite/versioning/r/online.result6
-rw-r--r--mysql-test/suite/versioning/r/partition.result16
-rw-r--r--mysql-test/suite/versioning/r/rpl.result13
-rw-r--r--mysql-test/suite/versioning/r/select,trx_id.rdiff11
-rw-r--r--mysql-test/suite/versioning/r/select.result14
-rw-r--r--mysql-test/suite/versioning/r/select2,trx_id.rdiff16
-rw-r--r--mysql-test/suite/versioning/r/select2.result4
-rw-r--r--mysql-test/suite/versioning/r/trx_id.result16
-rw-r--r--mysql-test/suite/versioning/r/update,trx_id.rdiff6
-rw-r--r--mysql-test/suite/versioning/r/update.result1
-rw-r--r--mysql-test/suite/versioning/t/create.test10
-rw-r--r--mysql-test/suite/versioning/t/cte.test6
-rw-r--r--mysql-test/suite/versioning/t/derived.test4
-rw-r--r--mysql-test/suite/versioning/t/online.test2
-rw-r--r--mysql-test/suite/versioning/t/rpl.test23
-rw-r--r--mysql-test/suite/versioning/t/select.test5
-rw-r--r--mysql-test/suite/versioning/t/update.test1
-rw-r--r--mysql-test/suite/wsrep/my.cnf2
-rw-r--r--mysql-test/suite/wsrep/r/variables.result2
-rw-r--r--mysql-test/suite/wsrep/r/variables_debug.result2
-rw-r--r--mysql-test/suite/wsrep/r/wsrep-recover-v25,binlogon.rdiff4
-rw-r--r--mysql-test/suite/wsrep/r/wsrep_provider_plugin.result24
-rw-r--r--mysql-test/suite/wsrep/r/wsrep_provider_plugin_basic.result66
-rw-r--r--mysql-test/suite/wsrep/r/wsrep_provider_plugin_defaults.result1259
-rw-r--r--mysql-test/suite/wsrep/r/wsrep_provider_plugin_wsrep_off.result5
-rw-r--r--mysql-test/suite/wsrep/t/alter_table_innodb.cnf2
-rw-r--r--mysql-test/suite/wsrep/t/mdev_10186.cnf2
-rw-r--r--mysql-test/suite/wsrep/t/pool_of_threads.test1
-rw-r--r--mysql-test/suite/wsrep/t/variables_debug.test2
-rw-r--r--mysql-test/suite/wsrep/t/wsrep_provider_plugin.cnf8
-rw-r--r--mysql-test/suite/wsrep/t/wsrep_provider_plugin.test41
-rw-r--r--mysql-test/suite/wsrep/t/wsrep_provider_plugin_basic.cnf8
-rw-r--r--mysql-test/suite/wsrep/t/wsrep_provider_plugin_basic.test77
-rw-r--r--mysql-test/suite/wsrep/t/wsrep_provider_plugin_defaults.cnf8
-rw-r--r--mysql-test/suite/wsrep/t/wsrep_provider_plugin_defaults.test34
-rw-r--r--mysql-test/suite/wsrep/t/wsrep_provider_plugin_wsrep_off.cnf12
-rw-r--r--mysql-test/suite/wsrep/t/wsrep_provider_plugin_wsrep_off.test6
-rw-r--r--mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.cnf2
2013 files changed, 121068 insertions, 29572 deletions
diff --git a/mysql-test/README b/mysql-test/README
index ef9e07fa..9dc5c6e5 100644
--- a/mysql-test/README
+++ b/mysql-test/README
@@ -12,18 +12,18 @@ To run the tests in a source directory, you must do "make" first.
In Red Hat distributions, you should run the script as user "mysql".
The user is created with nologin shell, so the best bet is something like
# su -
- # cd /usr/share/mysql-test
+ # cd /usr/share/mariadb-test
# su -s /bin/bash mysql -c ./mysql-test-run
This will use the installed MariaDB executables, but will run a private
-copy of the server process (using data files within /usr/share/mysql-test),
+copy of the server process (using data files within /usr/share/mariadb-test),
so you need not start the mysqld service beforehand.
You can omit --skip-test-list option if you want to check whether
the listed failures occur for you.
To clean up afterwards, remove the created "var" subdirectory, e.g.
- # su -s /bin/bash - mysql -c "rm -rf /usr/share/mysql-test/var"
+ # su -s /bin/bash - mysql -c "rm -rf /usr/share/mariadb-test/var"
If tests fail on your system, please read the following manual section
for instructions on how to report the problem:
@@ -37,7 +37,7 @@ you are expected to provide names of the tests to run.
For example, here is the command to run the "alias" and "analyze" tests
with an external server:
- # mysql-test-run --extern socket=/tmp/mysql.sock alias analyze
+ # mariadb-test-run --extern socket=/tmp/mysql.sock alias analyze
To match your setup, you might need to provide other relevant options.
@@ -63,20 +63,20 @@ and over again.
If you are using mysqltest commands in your test case, you should create
the result file as follows:
- # mysql-test-run --record test_case_name
+ # mariadb-test-run --record test_case_name
or
- # mysqltest --record < t/test_case_name.test
+ # mariadb-test --record < t/test_case_name.test
If you only have a simple test case consisting of SQL statements and
comments, you can create the result file in one of the following ways:
- # mysql-test-run --record test_case_name
+ # mariadb-test-run --record test_case_name
- # mysql test < t/test_case_name.test > r/test_case_name.result
+ # mariadb test < t/test_case_name.test > r/test_case_name.result
- # mysqltest --record --database test --result-file=r/test_case_name.result < t/test_case_name.test
+ # mariadb-test --record --database test --result-file=r/test_case_name.result < t/test_case_name.test
When this is done, take a look at r/test_case_name.result.
If the result is incorrect, you have found a bug. In this case, you should
diff --git a/mysql-test/README.stress b/mysql-test/README.stress
index 6be4e9a0..696f28c1 100644
--- a/mysql-test/README.stress
+++ b/mysql-test/README.stress
@@ -6,13 +6,12 @@ The stress script is designed to perform testing of the MySQL server in
a multi-threaded environment.
All functionality regarding stress testing is implemented in the
-mysql-stress-test.pl script.
+mariadb-stress-test.pl script.
The stress script allows:
- - To stress test the mysqltest binary test engine.
- - To stress test the regular test suite and any additional test suites
- (such as mysql-test-extra-5.0).
+ - To stress test the mariadb-test binary test engine.
+ - To stress test the regular test suite.
- To specify files with lists of tests both for initialization of
stress db and for further testing itself.
- To define the number of threads to be concurrently used in testing.
@@ -22,14 +21,14 @@ The stress script allows:
- To get a readable log file that can be used for identification of
errors that occur during testing.
-There are two ways to run the mysql-stress-test.pl script:
+There are two ways to run the mariadb-stress-test.pl script:
- For most cases, it is enough to use the options below for starting
- the stress test from the mysql-test-run wrapper. In this case, the
+ the stress test from the mariadb-test-run wrapper. In this case, the
server is run automatically, all preparation steps are performed,
and after that the stress test is started.
- - In advanced case, you can run the mysql-stress-test.pl script directly.
+ - In advanced case, you can run the mariadb-stress-test.pl script directly.
But this requires that you perform some preparation steps and to specify
a bunch of options as well, so this invocation method may be a bit
complicated.
@@ -87,21 +86,21 @@ Examples
1. Example of a simple command line to start a stress test:
- mysql-test-run --stress alias
+ mariadb-test-run --stress alias
Runs a stress test with default values for number of threads and number
of tests, with test 'alias' from suite 'main'.
2. Using in stress testing tests from other suites:
- - mysql-test-run --stress --stress-threads=10 --stress-test-count=1000 \
+ - mariadb-test-run --stress --stress-threads=10 --stress-test-count=1000 \
--stress-suite=example --stress-tests-file=testslist.txt
Runs a stress test with 10 threads, executes 1000 tests by all
threads, tests are used from suite 'example', the list of tests is
taken from file 'testslist.txt'
- - mysql-test-run --stress --stress-threads=10 --stress-test-count=1000 \
+ - mariadb-test-run --stress --stress-threads=10 --stress-test-count=1000 \
--stress-suite=example sum_distinct
Runs stress test with 10 threads, executes 1000 tests by all
@@ -110,11 +109,11 @@ of tests, with test 'alias' from suite 'main'.
3. Debugging of issues found with stress test
- Right now, the stress test is not fully integrated in mysql-test-run
+ Right now, the stress test is not fully integrated in mariadb-test-run
and does not support the --gdb option. To debug issues found with the
- stress test, you must start the MySQL server separately under a debugger
+ stress test, you must start the MariaDB server separately under a debugger
and then run the stress test like this:
- - mysql-test-run --extern --stress --stress-threads=10 \
+ - mariadb-test-run --extern --stress --stress-threads=10 \
--stress-test-count=1000 --stress-suite=example \
sum_distinct
diff --git a/mysql-test/collections/buildbot_suites.bat b/mysql-test/collections/buildbot_suites.bat
index 13ea5ddb..86a2c08f 100644
--- a/mysql-test/collections/buildbot_suites.bat
+++ b/mysql-test/collections/buildbot_suites.bat
@@ -1,6 +1,6 @@
if "%MTR_PARALLEL%"=="" set MTR_PARALLEL=%NUMBER_OF_PROCESSORS%
perl mysql-test-run.pl --force --suite-timeout=120 --max-test-fail=10 --retry=3 --suite=^
-vcol,gcol,perfschema,^
+vcol,gcol,period,perfschema,^
main,^
innodb,^
versioning,^
diff --git a/mysql-test/collections/smoke_test b/mysql-test/collections/smoke_test
index deaf38be..6a949f03 100644
--- a/mysql-test/collections/smoke_test
+++ b/mysql-test/collections/smoke_test
@@ -30,7 +30,6 @@ handler.interface
heap.heap
innodb.innodb
innodb.autoinc_persist
-innodb.innodb_defrag_binlog
innodb.innodb_mysql
innodb.monitor
innodb.purge
diff --git a/mysql-test/include/analyze-format.inc b/mysql-test/include/analyze-format.inc
index 49edd009..907f4e71 100644
--- a/mysql-test/include/analyze-format.inc
+++ b/mysql-test/include/analyze-format.inc
@@ -4,4 +4,4 @@
# - r_engine_stats depends on buffer pool state and whether old record versions
# were purged.
---replace_regex /("(r_[a-z_]*_time(_in_progress)?_ms|r_buffer_size)": )[^, \n]*/\1"REPLACED"/ /("r_engine_stats":) {[^}]*}/\1 REPLACED/
+--replace_regex /("(r_[a-z_]*_time(_in_progress)?_ms|r_buffer_size|cost)": )[^, \n]*/\1"REPLACED"/ /("r_engine_stats":) {[^}]*}/\1 REPLACED/
diff --git a/mysql-test/include/analyze-no-filtered.inc b/mysql-test/include/analyze-no-filtered.inc
new file mode 100644
index 00000000..eb166316
--- /dev/null
+++ b/mysql-test/include/analyze-no-filtered.inc
@@ -0,0 +1,2 @@
+--replace_regex /("(filtered|r_total_time_ms|r_table_time_ms|r_other_time_ms|r_buffer_size|r_filling_time_ms|r_query_time_in_progress_ms|r_unpack_time_ms|cost)": )[^, \n]*/\1"REPLACED"/
+
diff --git a/mysql-test/include/binlog_combinations.combinations b/mysql-test/include/binlog_combinations.combinations
index 07042c2c..5bd64366 100644
--- a/mysql-test/include/binlog_combinations.combinations
+++ b/mysql-test/include/binlog_combinations.combinations
@@ -1,8 +1,3 @@
-[row]
-binlog-format=row
-
-[stmt]
-binlog-format=statement
-
-[mix]
-binlog-format=mixed
+[nobinlog]
+[binlog]
+--log-bin=master-bin
diff --git a/mysql-test/include/binlog_combinations.inc b/mysql-test/include/binlog_combinations.inc
index 2ddd7876..b9fff341 100644
--- a/mysql-test/include/binlog_combinations.inc
+++ b/mysql-test/include/binlog_combinations.inc
@@ -1,5 +1,3 @@
-# The goal of including this file is to test with different
-# binlog combinations: row, stmt or mix
-# (see include/binlog_combinations.combinations)
-
---source include/have_log_bin.inc
+#
+# Adds standalone and binlog combinations
+#
diff --git a/mysql-test/include/binlog_format_combinations.combinations b/mysql-test/include/binlog_format_combinations.combinations
new file mode 100644
index 00000000..07042c2c
--- /dev/null
+++ b/mysql-test/include/binlog_format_combinations.combinations
@@ -0,0 +1,8 @@
+[row]
+binlog-format=row
+
+[stmt]
+binlog-format=statement
+
+[mix]
+binlog-format=mixed
diff --git a/mysql-test/include/binlog_format_combinations.inc b/mysql-test/include/binlog_format_combinations.inc
new file mode 100644
index 00000000..68ea4eee
--- /dev/null
+++ b/mysql-test/include/binlog_format_combinations.inc
@@ -0,0 +1,5 @@
+# The goal of including this file is to test with different
+# binlog format combinations: row, stmt or mix
+# (see include/binlog_format_combinations.combinations)
+
+--source include/have_log_bin.inc
diff --git a/mysql-test/include/check-testcase.test b/mysql-test/include/check-testcase.test
index b43dffbf..25990c1a 100644
--- a/mysql-test/include/check-testcase.test
+++ b/mysql-test/include/check-testcase.test
@@ -46,7 +46,7 @@ if ($tmp)
--echo Until_Condition #
--echo Until_Log_File #
--echo Until_Log_Pos #
- --echo Master_SSL_Allowed No
+ --echo Master_SSL_Allowed Yes
--echo Master_SSL_CA_File
--echo Master_SSL_CA_Path
--echo Master_SSL_Cert
@@ -105,7 +105,7 @@ select count(*) from mysql.proc;
call mtr.check_testcase();
let $datadir=`select @@datadir`;
-list_files $datadir mysql_upgrade_info;
+list_files $datadir mariadb_upgrade_info;
list_files $datadir/test #sql*;
list_files $datadir/mysql #sql*;
diff --git a/mysql-test/include/check_digest.inc b/mysql-test/include/check_digest.inc
new file mode 100644
index 00000000..9e5d6ccc
--- /dev/null
+++ b/mysql-test/include/check_digest.inc
@@ -0,0 +1,34 @@
+#
+# check_digest() checks digests validity from performance_schema.events_statements_summary_by_digest
+#
+
+--disable_query_log
+create table test._digests(d varchar(32) primary key);
+
+delimiter ~~;
+create function test.check_digest(digest varchar(255))
+returns tinyint
+not deterministic
+begin
+ declare digest_exists tinyint;
+ if length(digest) != 32 or conv(digest, 16, 10) = 0 then
+ return 0;
+ end if;
+ select exists (select d from test._digests where d = digest) into digest_exists;
+ if digest_exists then
+ return 0;
+ end if;
+ #insert into test._digests values (digest);
+ return 1;
+end~~
+
+create procedure test.reset_digests()
+begin
+ delete from test._digests;
+end~~
+delimiter ;~~
+
+--disable_result_log
+call sys.ps_truncate_all_tables(false);
+--enable_result_log
+--enable_query_log
diff --git a/mysql-test/include/check_digest_end.inc b/mysql-test/include/check_digest_end.inc
new file mode 100644
index 00000000..7d4adf8a
--- /dev/null
+++ b/mysql-test/include/check_digest_end.inc
@@ -0,0 +1,9 @@
+#
+# Deinit for check_digest.inc
+#
+
+--disable_query_log
+drop table test._digests;
+drop function test.check_digest;
+drop procedure test.reset_digests;
+--enable_query_log
diff --git a/mysql-test/include/common-tests.inc b/mysql-test/include/common-tests.inc
index 9c6b2985..9b54b049 100644
--- a/mysql-test/include/common-tests.inc
+++ b/mysql-test/include/common-tests.inc
@@ -13,6 +13,11 @@
drop table if exists t1,t2,t3,t4;
--enable_warnings
+# We have to use Aria instead of MyISAM as MyISAM has a very high row
+# access cost which causes some tests to use use join_cache instead of eq_ref
+
+set @@default_storage_engine="aria";
+
CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
@@ -1429,7 +1434,7 @@ set tmp_memory_table_size=default;
select distinct fld3,repeat("a",length(fld3)),count(*) from t2 group by companynr,fld3 limit 100,10;
#
-# A big order by that should trigger a merge in filesort
+# A big order by that should traigger a merge in filesort
#
select distinct companynr,rtrim(space(512+companynr)) from t3 order by 1,2;
@@ -1446,9 +1451,9 @@ select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr orde
explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3;
-#
-# Some test with ORDER BY and limit
-#
+--echo #
+--echo # Some test with ORDER BY and limit
+--echo #
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
@@ -1501,7 +1506,7 @@ create table t4 (
companyname char(30) NOT NULL default '',
PRIMARY KEY (companynr),
UNIQUE KEY companyname(companyname)
-) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
+) ENGINE=aria MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
--disable_query_log
INSERT INTO t4 (companynr, companyname) VALUES (29,'company 1');
@@ -1555,8 +1560,9 @@ explain select companynr,companyname from t2 left join t4 using (companynr) wher
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null;
delete from t2 where fld1=999999;
-#
-# Test left join optimization
+--echo #
+--echo # Test left join optimization
+--echo #
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
diff --git a/mysql-test/include/concurrent.inc b/mysql-test/include/concurrent.inc
index 1d65549f..f9058c06 100644
--- a/mysql-test/include/concurrent.inc
+++ b/mysql-test/include/concurrent.inc
@@ -30,7 +30,7 @@ SET SQL_MODE="";
#
# Show prerequisites for this test.
#
-SELECT @@global.tx_isolation;
+SELECT @@global.transaction_isolation;
#
# With the transaction isolation level REPEATABLE READ (the default)
# or SERIALIZEBLE, InnoDB takes "next-key locks"/"gap locks". This means it
@@ -43,7 +43,7 @@ SELECT @@global.tx_isolation;
# We use the variable $keep_locks to set the expectations for
# lock wait timeouts accordingly.
#
-let $keep_locks= `SELECT @@global.tx_isolation IN ('REPEATABLE-READ','SERIALIZABLE')`;
+let $keep_locks= `SELECT @@global.transaction_isolation IN ('REPEATABLE-READ','SERIALIZABLE')`;
--echo # keep_locks == $keep_locks
#
diff --git a/mysql-test/include/ctype_numconv.inc b/mysql-test/include/ctype_numconv.inc
index a4eaf72c..6241d29e 100644
--- a/mysql-test/include/ctype_numconv.inc
+++ b/mysql-test/include/ctype_numconv.inc
@@ -1741,6 +1741,7 @@ CREATE TABLE t1 (
date_column DATE DEFAULT NULL,
KEY(date_column));
INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01');
+INSERT INTO t1 VALUES (3,'2012-09-01'),(4,'2012-10-01'),(5,'2012-10-01');
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL;
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
diff --git a/mysql-test/include/default_client.cnf b/mysql-test/include/default_client.cnf
index fc2fcf19..dea6eb91 100644
--- a/mysql-test/include/default_client.cnf
+++ b/mysql-test/include/default_client.cnf
@@ -2,6 +2,8 @@
# We use default-character-set=latin1 to avoid character set auto-detection
# when running tests - not to depend on the current machine localization.
#
+[client]
+loose-disable-ssl-verify-server-cert
[mysql]
default-character-set=latin1
diff --git a/mysql-test/include/default_my.cnf b/mysql-test/include/default_my.cnf
index a1c427fe..c4c98900 100644
--- a/mysql-test/include/default_my.cnf
+++ b/mysql-test/include/default_my.cnf
@@ -27,9 +27,6 @@
# Run tests with the performance schema instrumentation
loose-enable-performance-schema
-[mysqlbinlog]
-disable-force-if-open
-
[ENV]
MASTER_MYPORT= @mysqld.1.port
MASTER_MYSOCK= @mysqld.1.socket
diff --git a/mysql-test/include/default_optimizer_switch.inc b/mysql-test/include/default_optimizer_switch.inc
index 8634c2ee..5790cec4 100644
--- a/mysql-test/include/default_optimizer_switch.inc
+++ b/mysql-test/include/default_optimizer_switch.inc
@@ -8,7 +8,7 @@
set @save_optimizer_switch=@@optimizer_switch;
set @save_join_cache_level=@@join_cache_level;
-set optimizer_switch="index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on";
+set optimizer_switch="index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on";
set optimizer_use_condition_selectivity=4;
set optimizer_search_depth=62;
diff --git a/mysql-test/include/delete_use_source.inc b/mysql-test/include/delete_use_source.inc
new file mode 100644
index 00000000..3f789767
--- /dev/null
+++ b/mysql-test/include/delete_use_source.inc
@@ -0,0 +1,94 @@
+create table t1 (c1 integer, c2 integer, c3 integer);
+
+insert into t1(c1,c2,c3)
+ values (1,1,1),(1,2,2),(1,3,3),
+ (2,1,4),(2,2,5),(2,3,6),
+ (2,4,7),(2,5,8);
+insert into t1 select c1+10,c2,c3+10 from t1;
+insert into t1 select c1+20,c2+1,c3+20 from t1;
+analyze table t1 persistent for all;
+
+create view v1 as select * from t1 where c2=2;
+
+--echo #######################################
+--echo # Test without any index #
+--echo #######################################
+--source include/delete_use_source_cases.inc
+--source include/delete_use_source_cases_non_innodb.inc
+
+--echo #######################################
+--echo # Test with an index #
+--echo #######################################
+create index t1_c2 on t1 (c2,c1);
+--source include/delete_use_source_cases.inc
+--source include/delete_use_source_cases_non_innodb.inc
+
+--echo #######################################
+--echo # Test with a primary key #
+--echo #######################################
+drop index t1_c2 on t1;
+alter table t1 add primary key (c3);
+--source include/delete_use_source_cases.inc
+--source include/delete_use_source_cases_non_innodb.inc
+
+drop view v1;
+drop table t1;
+
+--echo #
+--echo # Test on dynamic columns (blob)
+--echo #
+create table assets (
+ item_name varchar(32) primary key, -- A common attribute for all items
+ dynamic_cols blob -- Dynamic columns will be stored here
+);
+
+INSERT INTO assets
+ VALUES ('MariaDB T-shirt',
+ COLUMN_CREATE('color', 'blue', 'size', 'XL'));
+INSERT INTO assets
+ VALUES ('Thinkpad Laptop',
+ COLUMN_CREATE('color', 'black', 'price', 500));
+INSERT INTO assets
+ VALUES ('Fridge',
+ COLUMN_CREATE('color', 'white', 'warranty', '5 years'));
+INSERT INTO assets
+ VALUES ('Microwave',
+ COLUMN_CREATE('warranty', '3 years'));
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+ FROM assets ORDER BY item_name;
+UPDATE assets SET dynamic_cols=COLUMN_DELETE(dynamic_cols, 'color')
+ WHERE item_name='Fridge';
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+ FROM assets ORDER BY item_name;
+DELETE FROM assets
+ WHERE item_name in
+ (select b.item_name from assets b
+ where COLUMN_GET(b.dynamic_cols, 'color' as char) ='black');
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+ FROM assets ORDER BY item_name;
+DELETE FROM assets WHERE item_name='Microwave';
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+ FROM assets ORDER BY item_name;
+drop table assets ;
+
+
+--echo #
+--echo # Test on fulltext columns
+--echo #
+CREATE TABLE ft2(copy TEXT,FULLTEXT(copy));
+INSERT INTO ft2(copy) VALUES
+ ('MySQL vs MariaDB database'),
+ ('Oracle vs MariaDB database'),
+ ('PostgreSQL vs MariaDB database'),
+ ('MariaDB overview'),
+ ('Foreign keys'),
+ ('Primary keys'),
+ ('Indexes'),
+ ('Transactions'),
+ ('Triggers');
+
+SELECT * FROM ft2 WHERE MATCH(copy) AGAINST('database');
+DELETE FROM ft2 WHERE MATCH(copy) AGAINST('database');
+SELECT * FROM ft2 WHERE MATCH(copy) AGAINST('database');
+drop table ft2;
+
diff --git a/mysql-test/include/delete_use_source_cases.inc b/mysql-test/include/delete_use_source_cases.inc
new file mode 100644
index 00000000..ce0507d5
--- /dev/null
+++ b/mysql-test/include/delete_use_source_cases.inc
@@ -0,0 +1,216 @@
+--echo #
+--echo # Delete with value from subquery on the same table
+--echo #
+
+analyze table t1 persistent for all;
+
+let $c = c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+eval create table tmp as select * from t1 where $c;
+let $q = delete from t1 where $c;
+eval explain select * from t1 where $c;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+
+--echo #
+--echo # Delete with EXISTS subquery over the updated table
+--echo # in WHERE + possibly sargable condition
+--echo #
+
+analyze table t1 persistent for all;
+
+let $c = c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+eval create table tmp as select * from t1 where $c;
+let $q = delete from t1 where $c;
+eval explain select * from t1 where $c;
+eval explain $q;
+eval analyze $q;
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+
+--echo #
+--echo # Delete with IN predicand over the updated table in WHERE
+--echo #
+let $c = c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+eval create table tmp as select * from t1 where $c;
+let $q = delete from t1 where $c;
+eval explain select * from t1 where $c;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+
+--echo #
+--echo # Delete with a limit - can be deleted
+--echo #
+let $c = c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+eval create table tmp as select * from t1 where $c;
+let $q = delete from t1 where $c;
+eval explain select * from t1 where $c;
+eval explain $q;
+eval analyze $q;
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+
+--echo #
+--echo # Delete with a limit and an order by
+--echo #
+
+let $c = c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+ order by c3 desc limit 1;
+eval create table tmp as select * from t1 where $c;
+let $q = delete from t1 where $c;
+eval explain select * from t1 where $c;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+
+--echo #
+--echo # Delete: 2 execution of PS
+--echo #
+
+prepare create_tmp_stmt from
+ "create table tmp as select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+prepare delete_t1_stmt from
+ "delete from t1 where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=5;
+execute create_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+execute delete_t1_stmt using @a;
+--sorted_result
+select * from t1;
+
+prepare insert_tmp_stmt from
+ "insert into tmp(c1,c2,c3) select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=2;
+execute insert_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+--sorted_result
+select * from t1;
+
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+--sorted_result
+select * from t1;
+
+drop table tmp;
+
+--echo #
+--echo # Delete in stored procedure
+--echo #
+
+delimiter //;
+create procedure sp()
+begin
+ delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+ order by c3 desc limit 1;
+end
+//
+delimiter ;//
+
+create table tmp as select * from t1
+ where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+ order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+ where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+ order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+ where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+ order by c3 desc limit 1;
+CALL sp;
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop procedure sp;
+drop table tmp;
+
+--echo #
+--echo # Delete in stored function
+--echo #
+delimiter //;
+create function f1(IN a INT) returns int
+begin
+ delete from t1 where c3 < a order by c3 limit 1;
+ return 1;
+end;//
+delimiter ;//
+
+set @a:=7;
+create table tmp as select * from t1 where c3 < @a
+ order by c3 limit 1;
+--disable_ps2_protocol # because SELECT with side effects
+select f1(@a);
+insert into tmp(c1,c2,c3) select * from t1 where c3 < @a
+ order by c3 limit 1;
+select f1(@a);
+--enable_ps2_protocol
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop function f1;
+drop table tmp;
+
+--echo #
+--echo # Delete in trigger
+--echo #
+
+create table t2 (c1 integer);
+insert into t2(c1) values (1), (2), (3), (4), (5), (6), (7), (8);
+
+CREATE TABLE cnt(del integer);
+INSERT INTO cnt VALUES(0);
+
+CREATE TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW
+ UPDATE cnt SET del=del+1;
+CREATE TRIGGER tr2 AFTER DELETE ON t1 FOR EACH ROW
+ DELETE FROM t2 WHERE c1> (SELECT count(*)-1 FROM t2);
+
+CREATE TABLE tmp as SELECT * FROM t1 WHERE c2>=3;
+--enable_info ONCE
+DELETE FROM t1 WHERE c2>=3;
+
+--sorted_result
+select * from t1;
+--sorted_result
+SELECT * FROM t2;
+SELECT * FROM cnt;
+
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+
+DROP TRIGGER tr1;
+DROP TRIGGER tr2;
+drop table t2, cnt, tmp;
+
+--echo #
+--echo # Delete with a reference to view in subquery
+--echo #
+let $c = t1.c2 in ( select max(a.c2) from v1 a
+ where a.c1 = t1.c1);
+eval create table tmp as select * from t1 where $c;
+let $q = delete from t1 where $c;
+eval explain select * from t1 where $c;
+eval explain $q;
+eval analyze $q;
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+
diff --git a/mysql-test/include/delete_use_source_cases_memory.inc b/mysql-test/include/delete_use_source_cases_memory.inc
new file mode 100644
index 00000000..e1b49f54
--- /dev/null
+++ b/mysql-test/include/delete_use_source_cases_memory.inc
@@ -0,0 +1,296 @@
+--echo #
+--echo # Delete with value from subquery on the same table
+--echo #
+
+analyze table t1 persistent for all;
+
+let $c = c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+eval create table tmp as select * from t1 where $c;
+let $q = delete from t1 where $c;
+eval explain select * from t1 where $c;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+
+--echo #
+--echo # Delete with EXISTS subquery over the updated table
+--echo # in WHERE + possibly sargable condition
+--echo #
+
+analyze table t1 persistent for all;
+
+let $c = c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+eval create table tmp as select * from t1 where $c;
+let $q = delete from t1 where $c;
+eval explain select * from t1 where $c;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+
+--echo #
+--echo # Delete with EXISTS subquery over the updated table
+--echo # in WHERE + non-sargable condition
+--echo #
+
+analyze table t1 persistent for all;
+
+let $c = exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+eval create table tmp as select * from t1 where $c;
+let $q = delete from t1 where $c;
+eval explain select * from t1 where $c;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+
+--echo #
+--echo # Delete with order by
+--echo #
+
+analyze table t1 persistent for all;
+
+let $c = exists (select 'X' from t1 a where a.c2 = t1.c2)
+ and c2 >= 3 order by c2;
+eval create table tmp as select * from t1 where $c;
+let $q = delete from t1 where $c;
+eval explain select * from t1 where $c;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+
+--echo #
+--echo # Delete with IN predicand over the updated table in WHERE
+--echo #
+let $c = c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+eval create table tmp as select * from t1 where $c;
+let $q = delete from t1 where $c;
+eval explain select * from t1 where $c;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+
+--echo #
+--echo # Delete with a limit - can be deleted
+--echo #
+let $c = c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+eval create table tmp as select * from t1 where $c;
+let $q = delete from t1 where $c;
+eval explain select * from t1 where $c;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+
+--echo #
+--echo # Delete with a limit and an order by
+--echo #
+
+let $c = c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+ order by c3 desc limit 1;
+eval create table tmp as select * from t1 where $c;
+let $q = delete from t1 where $c;
+eval explain select * from t1 where $c;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+
+--echo #
+--echo # Delete: 2 execution of PS
+--echo #
+
+prepare create_tmp_stmt from
+ "create table tmp as select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+prepare delete_t1_stmt from
+ "delete from t1 where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=5;
+execute create_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+execute delete_t1_stmt using @a;
+--sorted_result
+select * from t1;
+
+prepare insert_tmp_stmt from
+ "insert into tmp(c1,c2,c3) select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=2;
+execute insert_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+--sorted_result
+select * from t1;
+
+drop table tmp;
+
+--echo #
+--echo # Delete in stored procedure
+--echo #
+
+delimiter //;
+create procedure sp()
+begin
+ delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+ order by c3 desc limit 1;
+end
+//
+delimiter ;//
+
+create table tmp as select * from t1
+ where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+ order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+ where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+ order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+ where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+ order by c3 desc limit 1;
+CALL sp;
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop procedure sp;
+drop table tmp;
+
+--echo #
+--echo # Delete in stored function
+--echo #
+delimiter //;
+create function f1(IN a INT) returns int
+begin
+ delete from t1 where c3 < a order by c3 limit 1;
+ return 1;
+end;//
+delimiter ;//
+
+set @a:=7;
+create table tmp as select * from t1 where c3 < @a
+ order by c3 limit 1;
+--disable_ps2_protocol # because SELECT with side effects
+select f1(@a);
+insert into tmp(c1,c2,c3) select * from t1 where c3 < @a
+ order by c3 limit 1;
+select f1(@a);
+--enable_ps2_protocol
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop function f1;
+drop table tmp;
+
+--echo #
+--echo # Delete in trigger
+--echo #
+
+create table t2 (c1 integer);
+insert into t2(c1) values (1), (2), (3), (4), (5), (6), (7), (8);
+
+CREATE TABLE cnt(del integer);
+INSERT INTO cnt VALUES(0);
+
+CREATE TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW
+ UPDATE cnt SET del=del+1;
+CREATE TRIGGER tr2 AFTER DELETE ON t1 FOR EACH ROW
+ DELETE FROM t2 WHERE c1> (SELECT count(*)-1 FROM t2);
+
+CREATE TABLE tmp as SELECT * FROM t1 WHERE c2>=3;
+--enable_info ONCE
+DELETE FROM t1 WHERE c2>=3;
+
+--sorted_result
+select * from t1;
+--sorted_result
+SELECT * FROM t2;
+SELECT * FROM cnt;
+
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+
+DROP TRIGGER tr1;
+DROP TRIGGER tr2;
+drop table t2, cnt, tmp;
+
+--echo #
+--echo Delete with a reference to view in subquery
+--echo #
+let $c = t1.c2 in ( select max(a.c2) from v1 a
+ where a.c1 = t1.c1);
+eval create table tmp as select * from t1 where $c;
+let $q = delete from t1 where $c;
+eval explain select * from t1 where $c;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+
+--echo #
+--echo # Delete from view
+--echo #
+
+analyze table t1 persistent for all;
+
+let $c = v1.c1 in
+ (select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+eval create table tmp as select * from v1 where $c;
+let $q = delete from v1 where $c;
+eval explain select * from v1 where $c;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+
+--echo #
+--echo # Delete from view using reference
+--echo # to the same view in subquery
+--echo #
+
+analyze table t1 persistent for all;
+
+let $c = v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+ and c1 = 2
+ and exists (select 'X' from v1 a where a.c1 = v1.c1);
+eval create table tmp as select * from v1 where $c;
+let $q = delete from v1 where $c;
+eval explain select * from v1 where $c;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+
diff --git a/mysql-test/include/delete_use_source_cases_non_innodb.inc b/mysql-test/include/delete_use_source_cases_non_innodb.inc
new file mode 100644
index 00000000..caa58171
--- /dev/null
+++ b/mysql-test/include/delete_use_source_cases_non_innodb.inc
@@ -0,0 +1,81 @@
+--echo #
+--echo # Delete with EXISTS subquery over the updated table
+--echo # in WHERE + non-sargable condition
+--echo #
+
+analyze table t1 persistent for all;
+
+let $c = exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+eval create table tmp as select * from t1 where $c;
+let $q = delete from t1 where $c;
+eval explain select * from t1 where $c;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+
+--echo #
+--echo # Delete with order by
+--echo #
+
+analyze table t1 persistent for all;
+
+let $c = exists (select 'X' from t1 a where a.c2 = t1.c2)
+ and c2 >= 3 order by c2;
+eval create table tmp as select * from t1 where $c;
+let $q = delete from t1 where $c;
+--replace_column 9 #
+eval explain select * from t1 where $c;
+--replace_column 9 #
+eval explain $q;
+--replace_column 9 #
+eval analyze $q;
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+
+--echo #
+--echo # Delete from view
+--echo #
+
+analyze table t1 persistent for all;
+
+let $c = v1.c1 in
+ (select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+eval create table tmp as select * from v1 where $c;
+let $q = delete from v1 where $c;
+eval explain select * from v1 where $c;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+
+--echo #
+--echo # Delete from view using reference
+--echo # to the same view in subquery
+--echo #
+
+analyze table t1 persistent for all;
+
+let $c = v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+ and c1 = 2
+ and exists (select 'X' from v1 a where a.c1 = v1.c1);
+eval create table tmp as select * from v1 where $c;
+let $q = delete from v1 where $c;
+--replace_column 9 #
+eval explain select * from v1 where $c;
+--replace_column 9 #
+eval explain $q;
+--replace_column 9 #
+eval analyze $q;
+--sorted_result
+select * from t1;
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
diff --git a/mysql-test/include/delete_use_source_innodb.inc b/mysql-test/include/delete_use_source_innodb.inc
new file mode 100644
index 00000000..83915d47
--- /dev/null
+++ b/mysql-test/include/delete_use_source_innodb.inc
@@ -0,0 +1,91 @@
+create table t1 (c1 integer, c2 integer, c3 integer);
+
+insert into t1(c1,c2,c3)
+ values (1,1,1),(1,2,2),(1,3,3),
+ (2,1,4),(2,2,5),(2,3,6),
+ (2,4,7),(2,5,8);
+insert into t1 select c1+10,c2,c3+10 from t1;
+insert into t1 select c1+20,c2+1,c3+20 from t1;
+analyze table t1 persistent for all;
+
+create view v1 as select * from t1 where c2=2;
+
+--echo #######################################
+--echo # Test without any index #
+--echo #######################################
+--source include/delete_use_source_cases.inc
+
+--echo #######################################
+--echo # Test with an index #
+--echo #######################################
+create index t1_c2 on t1 (c2,c1);
+--source include/delete_use_source_cases.inc
+
+--echo #######################################
+--echo # Test with a primary key #
+--echo #######################################
+drop index t1_c2 on t1;
+alter table t1 add primary key (c3);
+--source include/delete_use_source_cases.inc
+
+drop view v1;
+drop table t1;
+
+--echo #
+--echo # Test on dynamic columns (blob)
+--echo #
+create table assets (
+ item_name varchar(32) primary key, -- A common attribute for all items
+ dynamic_cols blob -- Dynamic columns will be stored here
+);
+
+INSERT INTO assets
+ VALUES ('MariaDB T-shirt',
+ COLUMN_CREATE('color', 'blue', 'size', 'XL'));
+INSERT INTO assets
+ VALUES ('Thinkpad Laptop',
+ COLUMN_CREATE('color', 'black', 'price', 500));
+INSERT INTO assets
+ VALUES ('Fridge',
+ COLUMN_CREATE('color', 'white', 'warranty', '5 years'));
+INSERT INTO assets
+ VALUES ('Microwave',
+ COLUMN_CREATE('warranty', '3 years'));
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+ FROM assets ORDER BY item_name;
+UPDATE assets SET dynamic_cols=COLUMN_DELETE(dynamic_cols, 'color')
+ WHERE item_name='Fridge';
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+ FROM assets ORDER BY item_name;
+DELETE FROM assets
+ WHERE item_name in
+ (select b.item_name from assets b
+ where COLUMN_GET(b.dynamic_cols, 'color' as char) ='black');
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+ FROM assets ORDER BY item_name;
+DELETE FROM assets WHERE item_name='Microwave';
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+ FROM assets ORDER BY item_name;
+drop table assets ;
+
+
+--echo #
+--echo # Test on fulltext columns
+--echo #
+CREATE TABLE ft2(copy TEXT,FULLTEXT(copy));
+INSERT INTO ft2(copy) VALUES
+ ('MySQL vs MariaDB database'),
+ ('Oracle vs MariaDB database'),
+ ('PostgreSQL vs MariaDB database'),
+ ('MariaDB overview'),
+ ('Foreign keys'),
+ ('Primary keys'),
+ ('Indexes'),
+ ('Transactions'),
+ ('Triggers');
+
+SELECT * FROM ft2 WHERE MATCH(copy) AGAINST('database');
+DELETE FROM ft2 WHERE MATCH(copy) AGAINST('database');
+SELECT * FROM ft2 WHERE MATCH(copy) AGAINST('database');
+drop table ft2;
+
diff --git a/mysql-test/include/delete_use_source_memory.inc b/mysql-test/include/delete_use_source_memory.inc
new file mode 100644
index 00000000..dbaae1a6
--- /dev/null
+++ b/mysql-test/include/delete_use_source_memory.inc
@@ -0,0 +1,33 @@
+create table t1 (c1 integer, c2 integer, c3 integer);
+
+insert into t1(c1,c2,c3)
+ values (1,1,1),(1,2,2),(1,3,3),
+ (2,1,4),(2,2,5),(2,3,6),
+ (2,4,7),(2,5,8);
+insert into t1 select c1+10,c2,c3+10 from t1;
+insert into t1 select c1+20,c2+1,c3+20 from t1;
+analyze table t1 persistent for all;
+
+create view v1 as select * from t1 where c2=2;
+
+--echo #######################################
+--echo # Test without any index #
+--echo #######################################
+--source include/delete_use_source_cases_memory.inc
+
+--echo #######################################
+--echo # Test with an index #
+--echo #######################################
+create index t1_c2 on t1 (c2,c1);
+--source include/delete_use_source_cases_memory.inc
+
+--echo #######################################
+--echo # Test with a primary key #
+--echo #######################################
+drop index t1_c2 on t1;
+alter table t1 add primary key (c3);
+--source include/delete_use_source_cases_memory.inc
+
+drop view v1;
+drop table t1;
+
diff --git a/mysql-test/include/explain-no-costs-filtered.inc b/mysql-test/include/explain-no-costs-filtered.inc
new file mode 100644
index 00000000..585d8b3f
--- /dev/null
+++ b/mysql-test/include/explain-no-costs-filtered.inc
@@ -0,0 +1 @@
+--replace_regex /("(cost|filtered)": )[^, \n]*/\1"REPLACED"/
diff --git a/mysql-test/include/explain-no-costs.inc b/mysql-test/include/explain-no-costs.inc
new file mode 100644
index 00000000..f2f362b8
--- /dev/null
+++ b/mysql-test/include/explain-no-costs.inc
@@ -0,0 +1 @@
+--replace_regex /("(cost)": )[^, \n]*/\1"COST_REPLACED"/
diff --git a/mysql-test/include/explain_non_select.inc b/mysql-test/include/explain_non_select.inc
index bab76ffb..c7bf68ff 100644
--- a/mysql-test/include/explain_non_select.inc
+++ b/mysql-test/include/explain_non_select.inc
@@ -1,6 +1,7 @@
# This file is a collection of regression and coverage tests
# for WL#4897: Add EXPLAIN INSERT/UPDATE/DELETE.
+-- source include/have_sequence.inc
-- disable_query_log
-- disable_result_log
# SET GLOBAL innodb_stats_persistent=0;
@@ -73,15 +74,18 @@ INSERT INTO t2 VALUES (1), (2), (3);
--source include/explain_utils.inc
DROP TABLE t1, t2;
---echo #7
+--echo #7a
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1), (2), (3);
CREATE TABLE t2 (b INT);
-INSERT INTO t2 VALUES (1), (2), (3);
---let $query = UPDATE t1, t2 SET a = 10 WHERE a IN (SELECT b FROM t2 WHERE t2.b < 3)
---let $select = SELECT * FROM t1, t2 WHERE a IN (SELECT b FROM t2 WHERE t2.b < 3)
+INSERT INTO t2 VALUES (1), (2), (3), (1000);
+CREATE TABLE t3 like t2;
+insert into t3 select * from t2;
+insert into t3 select seq from seq_1001_to_2000;
+--let $query = UPDATE t1, t2 SET a = 10 WHERE a IN (SELECT b FROM t3 WHERE t3.b < 3)
+--let $select = SELECT * FROM t1, t2 WHERE a IN (SELECT b FROM t3 WHERE t3.b < 3)
--source include/explain_utils.inc
-DROP TABLE t1, t2;
+DROP TABLE t1, t2, t3;
--echo #8
CREATE TABLE t1 (a INT);
@@ -197,7 +201,7 @@ DROP TABLE t1, t2, t3;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1), (2), (3);
CREATE TABLE t2 (a INT);
-INSERT INTO t2 VALUES (1), (2), (3);
+INSERT INTO t2 VALUES (1), (2), (3), (1000);
--let $query = UPDATE t1 SET a = 10 WHERE a IN (SELECT a FROM t2)
--let $select = SELECT * FROM t1 WHERE a IN (SELECT a FROM t2)
--source include/explain_utils.inc
diff --git a/mysql-test/include/galera_cluster.inc b/mysql-test/include/galera_cluster.inc
index 48b5bc63..12708bfc 100644
--- a/mysql-test/include/galera_cluster.inc
+++ b/mysql-test/include/galera_cluster.inc
@@ -13,10 +13,8 @@ if (!$galera_cluster_size)
}
--source include/galera_init.inc
---source include/have_innodb.inc
--source include/galera_wait_ready.inc
-
--let $_galera_node= $galera_cluster_size
while ($_galera_node != 1)
diff --git a/mysql-test/include/galera_variables_ok.inc b/mysql-test/include/galera_variables_ok.inc
index c9a54724..e420b3af 100644
--- a/mysql-test/include/galera_variables_ok.inc
+++ b/mysql-test/include/galera_variables_ok.inc
@@ -1,6 +1,6 @@
--disable_query_log
---let $galera_variables_ok = `SELECT COUNT(*) = 50 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep%'`
+--let $galera_variables_ok = `SELECT COUNT(*) = 51 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep%'`
--if (!$galera_variables_ok) {
--skip Galera number of variables has changed!
diff --git a/mysql-test/include/have_wsrep_enabled.inc b/mysql-test/include/have_wsrep_enabled.inc
index 7eb8b437..33ff58b9 100644
--- a/mysql-test/include/have_wsrep_enabled.inc
+++ b/mysql-test/include/have_wsrep_enabled.inc
@@ -1,8 +1,6 @@
# To be used in a test which requires wsrep plugin to be ACTIVE and enabled
# (i.e. wsrep_on=ON). It includes have_wsrep.inc.
---source include/have_innodb.inc
-
if (`SELECT COUNT(*)=0 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME = 'wsrep_on' AND VARIABLE_VALUE='ON'`)
{
--skip Test requires wsrep_on=ON
diff --git a/mysql-test/include/icp_tests.inc b/mysql-test/include/icp_tests.inc
index d7fa6b5d..e42645fa 100644
--- a/mysql-test/include/icp_tests.inc
+++ b/mysql-test/include/icp_tests.inc
@@ -487,7 +487,7 @@ CREATE TABLE t1 (
);
INSERT INTO t1 VALUES (1,9),(2,7),(3,6),(4,3),(5,1);
-
+insert into t1 select seq,seq from seq_100_to_110;
EXPLAIN SELECT pk, c1 FROM t1 WHERE (pk<3 or pk>3);
SET SESSION optimizer_switch='index_condition_pushdown=off';
@@ -724,7 +724,6 @@ DROP TABLE t1;
CREATE TABLE t1 (b int NOT NULL, c int, a varchar(1024), PRIMARY KEY (b));
INSERT INTO t1 VALUES (1,4,'Ill');
-insert into t1 select seq+100,5,seq from seq_1_to_100;
CREATE TABLE t2 (a varchar(1024), KEY (a(512)));
INSERT INTO t2 VALUES
@@ -858,6 +857,8 @@ ANALYZE TABLE t1,t2;
SET @save_optimize_switch=@@optimizer_switch;
SET optimizer_switch='materialization=on';
+set @save_optimizer_where_cost=@@optimizer_where_cost;
+set @@optimizer_where_cost=1;
EXPLAIN
SELECT COUNT(*) FROM t1 AS t, t2
@@ -875,6 +876,7 @@ WHERE c = g
OR a = 0 AND h < 'z' );
SET optimizer_switch=@save_optimizer_switch;
+set @@optimizer_where_cost=@save_optimizer_where_cost;
DROP TABLE t1,t2;
diff --git a/mysql-test/include/index_merge1.inc b/mysql-test/include/index_merge1.inc
index 91609f62..199fc9d3 100644
--- a/mysql-test/include/index_merge1.inc
+++ b/mysql-test/include/index_merge1.inc
@@ -517,7 +517,7 @@ DROP TABLE t1;
create table t1 (a int);
insert into t1 values (1),(2);
create table t2(a int, b int);
-insert into t2 values (1,1), (2, 1000);
+insert into t2 values (1,1), (2, 1000),(5000,5000);
create table t3 (a int, b int, filler char(100), key(a), key(b));
insert into t3 select 1000, 1000,'filler' from seq_1_to_1000;
diff --git a/mysql-test/include/last_query_cost.inc b/mysql-test/include/last_query_cost.inc
new file mode 100644
index 00000000..a18fd9e4
--- /dev/null
+++ b/mysql-test/include/last_query_cost.inc
@@ -0,0 +1,5 @@
+--disable_query_log
+--disable_column_names
+show status like 'last_query_cost';
+--enable_column_names
+--enable_query_log
diff --git a/mysql-test/include/load_dump_and_upgrade.inc b/mysql-test/include/load_dump_and_upgrade.inc
index 52351ea4..86ebc12c 100644
--- a/mysql-test/include/load_dump_and_upgrade.inc
+++ b/mysql-test/include/load_dump_and_upgrade.inc
@@ -46,4 +46,4 @@ SELECT COUNT(*) > 0 AS `mysql.user has data` FROM mysql.user;
# It will fail if the file doesn't exist, which is good,
# which is an extra check that it was written
---remove_file $ddir/mysql_upgrade_info
+--remove_file $ddir/mariadb_upgrade_info
diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc
index 2ec0868c..cbb79668 100644
--- a/mysql-test/include/mix1.inc
+++ b/mysql-test/include/mix1.inc
@@ -1183,14 +1183,14 @@ set @my_innodb_autoextend_increment=@@global.innodb_autoextend_increment;
set global innodb_autoextend_increment=8;
set global innodb_autoextend_increment=@my_innodb_autoextend_increment;
-#
-# Bug #37830: ORDER BY ASC/DESC - no difference
-#
+--echo #
+--echo # Bug #37830: ORDER BY ASC/DESC - no difference
+--echo #
CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY (a), KEY t1_b (b))
ENGINE=InnoDB;
-INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1);
+INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1), (100,2,2);
INSERT INTO t1 (a,b,c) SELECT a+4,b,c FROM t1;
-- disable_query_log
diff --git a/mysql-test/include/mix2.inc b/mysql-test/include/mix2.inc
index 6a6fbcbc..5ea4b795 100644
--- a/mysql-test/include/mix2.inc
+++ b/mysql-test/include/mix2.inc
@@ -776,7 +776,7 @@ eval create table t1 (id int unsigned not null auto_increment, code tinyint unsi
BEGIN;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
-SELECT @@tx_isolation,@@global.tx_isolation;
+SELECT @@transaction_isolation,@@global.transaction_isolation;
insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David');
select id, code, name from t1 order by id;
COMMIT;
diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql
index d02f504a..88b3eb69 100644
--- a/mysql-test/include/mtr_warnings.sql
+++ b/mysql-test/include/mtr_warnings.sql
@@ -93,7 +93,6 @@ INSERT INTO global_suppressions VALUES
("Enabling keys got errno"),
("Error reading master configuration"),
("Error reading packet"),
- ("Event Scheduler"),
("Failed to open log"),
("Failed to open the existing master info file"),
("Forcing shutdown of [0-9]* plugins"),
diff --git a/mysql-test/include/percona_nonflushing_analyze_debug.inc b/mysql-test/include/percona_nonflushing_analyze_debug.inc
index 95621c70..8cdf6218 100644
--- a/mysql-test/include/percona_nonflushing_analyze_debug.inc
+++ b/mysql-test/include/percona_nonflushing_analyze_debug.inc
@@ -8,7 +8,7 @@
--connect con1,localhost,root
-SET DEBUG_SYNC="handler_ha_index_next_end SIGNAL idx_scan_in_progress WAIT_FOR finish_scan";
+SET DEBUG_SYNC="handler_rnd_next_end SIGNAL idx_scan_in_progress WAIT_FOR finish_scan";
send_eval SELECT * FROM $percona_nonflushing_analyze_table;
diff --git a/mysql-test/include/rowid_filter_debug_kill.inc b/mysql-test/include/rowid_filter_debug_kill.inc
index 513efed8..230bef6d 100644
--- a/mysql-test/include/rowid_filter_debug_kill.inc
+++ b/mysql-test/include/rowid_filter_debug_kill.inc
@@ -2,13 +2,15 @@
--source include/have_debug_sync.inc
--source include/have_sequence.inc
--source include/count_sessions.inc
+--source include/have_sequence.inc
+--source include/no_valgrind_without_big.inc
--echo #
--echo # MDEV-22761 KILL QUERY during rowid_filter, crashes
--echo #
create table t2(a int);
-insert into t2 select * from seq_0_to_99;
+insert into t2 select seq from seq_1_to_100;
# 10K rows
CREATE TABLE t3 (
@@ -18,30 +20,24 @@ CREATE TABLE t3 (
KEY (key1),
KEY (key2)
);
+insert into t3 select seq,seq, 'filler-data-filler-data' from seq_1_to_2000;
+
select engine from information_schema.tables
where table_schema=database() and table_name='t3';
-
-insert into t3
-select
- A.seq,
- B.seq,
- 'filler-data-filler-data'
-from seq_0_to_99 A, seq_0_to_99 B;
-
analyze table t2,t3;
explain
-select * from t2, t3
+select straight_join * from t2, t3
where
- t3.key1=t2.a and t3.key2 in (2,3);
+ t3.key1=t2.a and t3.key2 between 2 and 10;
let $target_id= `select connection_id()`;
set debug_sync='handler_rowid_filter_check SIGNAL at_rowid_filter_check WAIT_FOR go';
send
-select * from t2, t3
+select straight_join * from t2, t3
where
- t3.key1=t2.a and t3.key2 in (2,3);
+ t3.key1=t2.a and t3.key2 between 2 and 10;
connect (con1, localhost, root,,);
set debug_sync='now WAIT_FOR at_rowid_filter_check';
diff --git a/mysql-test/include/rpl_change_topology.inc b/mysql-test/include/rpl_change_topology.inc
index ddaf90a9..299277a4 100644
--- a/mysql-test/include/rpl_change_topology.inc
+++ b/mysql-test/include/rpl_change_topology.inc
@@ -236,11 +236,11 @@ if (!$rpl_skip_change_master)
}
if ($rpl_master_log_file)
{
- eval CHANGE MASTER TO MASTER_HOST = '127.0.0.1', MASTER_PORT = $_rpl_port, MASTER_USER = 'root', MASTER_LOG_FILE = '$_rpl_master_log_file'$_rpl_master_log_pos, MASTER_CONNECT_RETRY = 1$_timeout_adjustment, MASTER_USE_GTID=NO;
+ eval CHANGE MASTER TO MASTER_HOST = '127.0.0.1', MASTER_PORT = $_rpl_port, MASTER_USER = 'root', MASTER_LOG_FILE = '$_rpl_master_log_file'$_rpl_master_log_pos, MASTER_CONNECT_RETRY = 1$_timeout_adjustmen, MASTER_SSL_VERIFY_SERVER_CERT=0, MASTER_USE_GTID=NO;
}
if (!$rpl_master_log_file)
{
- eval CHANGE MASTER TO MASTER_HOST = '127.0.0.1', MASTER_PORT = $_rpl_port, MASTER_USER = 'root', MASTER_CONNECT_RETRY=1$_timeout_adjustment;
+ eval CHANGE MASTER TO MASTER_HOST = '127.0.0.1', MASTER_PORT = $_rpl_port, MASTER_USER = 'root', MASTER_CONNECT_RETRY=1$_timeout_adjustment, MASTER_SSL_VERIFY_SERVER_CERT=0;
}
}
if ($_rpl_master == '')
diff --git a/mysql-test/include/rpl_clone_slave_using_mariadb-backup.inc b/mysql-test/include/rpl_clone_slave_using_mariadb-backup.inc
index 96fcfa21..5961e3cc 100644
--- a/mysql-test/include/rpl_clone_slave_using_mariadb-backup.inc
+++ b/mysql-test/include/rpl_clone_slave_using_mariadb-backup.inc
@@ -5,13 +5,14 @@ if ($cnf == "galera2_to_mariadb")
--connect slave, 127.0.0.1, root, , test, $NODE_MYPORT_3
--disable_query_log
--replace_result $MASTER_MYPORT ###
- --eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$MASTER_MYPORT, MASTER_USE_GTID=NO;
+ --eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$MASTER_MYPORT, MASTER_USE_GTID=NO, MASTER_SSL_VERIFY_SERVER_CERT=0;
--enable_query_log
START SLAVE;
--source include/wait_for_slave_to_start.inc
- --let XTRABACKUP_BACKUP_OPTIONS=--no-defaults --user=root --host='127.0.0.1' --port=$NODE_MYPORT_3
- --let XTRABACKUP_COPY_BACK_OPTIONS= --no-defaults
+ --let XTRABACKUP_BACKUP_OPTIONS=--no-defaults --user=root --host='127.0.0.1' --port=$NODE_MYPORT_3 --loose-disable-ssl-verify-server-cert --loose-ssl-cert=$MYSQL_TEST_DIR/std_data/server-cert.pem --loose-ssl-key=$MYSQL_TEST_DIR/std_data/server-key.pem --loose-ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem
+
+ --let XTRABACKUP_COPY_BACK_OPTIONS=--no-defaults
}
if ($cnf == "mariadb_to_mariadb")
@@ -92,7 +93,7 @@ COMMIT;
--echo ##############################################################
--echo ### Running `mariadb-backup --backup,--prepare` and checking
---echo ### that xtrabackup_slave_info and xtrabackup_binlog_info are OK
+--echo ### that mariadb_backup_slave_info and mariadb_backup_binlog_info are OK
--echo ### Slave: Create a backup
--let $backup_slave=$MYSQLTEST_VARDIR/tmp/backup-slave
@@ -104,12 +105,12 @@ COMMIT;
--exec $XTRABACKUP --prepare --target-dir=$backup_slave
--echo ### Slave: xtrabackup files:
---echo ############################ xtrabackup_slave_info
+--echo ############################ mariadb_backup_slave_info
--replace_result $master_after_tr01_show_master_status_file master_after_tr01_show_master_status_file $master_after_tr01_show_master_status_position master_after_tr01_show_master_status_position
---cat_file $backup_slave/xtrabackup_slave_info
---echo ############################ xtrabackup_binlog_info
+--cat_file $backup_slave/mariadb_backup_slave_info
+--echo ############################ mariadb_backup_binlog_info
--replace_result $slave_after_tr01_show_master_status_file slave_after_tr01_show_master_status_file $slave_after_tr01_show_master_status_position slave_after_tr01_show_master_status_position $slave_after_tr01_gtid_binlog_pos slave_after_tr01_gtid_binlog_pos
---cat_file $backup_slave/xtrabackup_binlog_info
+--cat_file $backup_slave/mariadb_backup_binlog_info
--echo ############################
@@ -229,11 +230,11 @@ SELECT * FROM t1 ORDER BY a;
--echo ### Slave: Execute the CHANGE MASTER statement to set up the host and port
--replace_result $MASTER_MYPORT ###
---eval CHANGE MASTER '' TO MASTER_USER='root', MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_CONNECT_RETRY=1
+--eval CHANGE MASTER '' TO MASTER_USER='root', MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_CONNECT_RETRY=1, MASTER_SSL_VERIFY_SERVER_CERT=0
---echo ### Slave: Execute the CHANGE MASTER statement from xtrabackup_slave_info
+--echo ### Slave: Execute the CHANGE MASTER statement from mariadb_backup_slave_info
--replace_result $master_after_tr01_show_master_status_file master_after_tr01_show_master_status_file $master_after_tr01_show_master_status_position master_after_tr01_show_master_status_position
---source $backup_slave/xtrabackup_slave_info
+--source $backup_slave/mariadb_backup_slave_info
--echo ### Slave: Execute START SLAVE
--source include/start_slave.inc
diff --git a/mysql-test/include/sargable_casefold.inc b/mysql-test/include/sargable_casefold.inc
new file mode 100644
index 00000000..c10e78e6
--- /dev/null
+++ b/mysql-test/include/sargable_casefold.inc
@@ -0,0 +1,44 @@
+# Check sargable_casefold rewrite for $collation
+
+eval create table t1 (
+ col1 varchar(32),
+ col2 varchar(32),
+ col3 char(32),
+ col4 text,
+ key(col1),
+ key(col2),
+ key(col3),
+ key(col4(32))
+) collate $collation;
+
+insert into t1
+select
+ concat('A-', seq),
+ concat('A-', seq),
+ concat('A-', seq),
+ concat('A-', seq)
+from seq_1_to_100;
+
+analyze table t1 persistent for all;
+
+--echo # Basic examples. All should use ref(col1):
+explain
+select * from t1 where upper(col1)='A-3';
+select * from t1 where upper(col1)='A-3';
+
+explain
+select * from t1 where ucase(col1)='a-3';
+select * from t1 where ucase(col1)='a-3';
+
+explain select * from t1 where 'abc'=upper(col1);
+explain select * from t1 where 'xyz'=ucase(col1);
+
+create view v1 as select * from t1;
+explain select * from v1 where 'abc'=upper(col1);
+drop view v1;
+
+explain select * from t1 where upper(col3)='a-3';
+explain select * from t1 where upper(col4)='a-3';
+
+# DROP TABLE t1 is missing intentionally here.
+
diff --git a/mysql-test/include/update_use_source.inc b/mysql-test/include/update_use_source.inc
index 3c487704..e1b66d2b 100644
--- a/mysql-test/include/update_use_source.inc
+++ b/mysql-test/include/update_use_source.inc
@@ -1,150 +1,188 @@
# Include to test update with same table as source and target
---echo #
---echo # Update a with value from subquery on the same table, no search clause. ALL access
---echo #
-
-#Enable view protocol after fix MDEV-29207
---disable_view_protocol
-start transaction;
+create table t1 (old_c1 integer,
+ old_c2 integer,
+ c1 integer,
+ c2 integer,
+ c3 integer);
+
+create view v1 as select * from t1 where c2=2;
+delimiter /;
+create trigger trg_t1 before update on t1 for each row
+begin
+ set new.old_c1=old.c1;
+ set new.old_c2=old.c2;
+end;
+/
+delimiter ;/
+
+insert into t1(c1,c2,c3)
+ values (1,1,1), (1,2,2), (1,3,3),
+ (2,1,4), (2,2,5), (2,3,6),
+ (2,4,7), (2,5,8);
+insert into t1 select NULL, NULL, c1+10,c2,c3+10 from t1;
+insert into t1 select NULL, NULL, c1+20,c2+1,c3+20 from t1;
+analyze table t1 persistent for all;
+
+create table tmp as select * from t1;
+
+--echo #######################################
+--echo # Test without any index #
+--echo #######################################
+--source include/update_use_source_cases.inc
+
+--echo #######################################
+--echo # Test with an index #
+--echo #######################################
+create index t1_c2 on t1 (c2,c1);
+analyze table t1;
+--source include/update_use_source_cases.inc
+
+--echo #######################################
+--echo # Test with a primary key #
+--echo #######################################
+drop index t1_c2 on t1;
+alter table t1 add primary key (c3);
+analyze table t1;
+--source include/update_use_source_cases.inc
+
+--echo # Update with error "Subquery returns more than 1 row"
+--error ER_SUBQUERY_NO_1_ROW
+update t1 set c2=(select c2 from t1);
+--sorted_result
+select c1,c2,c3 from t1;
+
+--echo # Update with error "Subquery returns more than 1 row"
+--echo # and order by
+--error ER_SUBQUERY_NO_1_ROW
+update t1 set c2=(select c2 from t1) order by c3;
+--sorted_result
+select c1,c2,c3 from t1;
+
+-- echo # Duplicate value on update a primary key
+--error ER_DUP_ENTRY
+
+update t1 set c3=0
+ where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+--sorted_result
+select c1,c2,c3 from t1;
+truncate table t1;
+insert into t1 select * from tmp;
+
+-- echo # Duplicate value on update a primary key with ignore
--enable_info ONCE
-update t1
- set c1=(select a.c3
- from t1 a
- where a.c3 = t1.c3);
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ;
-rollback;
-
---echo #
---echo # Update with search clause on the same table
---echo #
-
-start transaction;
+update ignore t1 set c3=0
+ where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+--sorted_result
+select c1,c2,c3 from t1;
+truncate table t1;
+insert into t1 select * from tmp;
+
+-- echo # Duplicate value on update a primary key and limit
+--error ER_DUP_ENTRY
+update t1 set c3=0
+ where exists (select 'X' from t1 a where a.c2 = t1.c2)
+ and c2 >= 3 limit 2;
+--sorted_result
+select c1,c2,c3 from t1;
+truncate table t1;
+insert into t1 select * from tmp;
+
+-- echo # Duplicate value on update a primary key with ignore
+-- echo # and limit
--enable_info ONCE
-update t1
- set c1=10
- where c1 <2
- and exists (select 'X'
- from t1 a
- where a.c1 = t1.c1);
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ;
-rollback;
-
---echo #
---echo # Update via RANGE or INDEX access if an index or a primary key exists
---echo #
-
-explain update t1 set c1=0 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 > 3;
-start transaction;
+update ignore t1 set c3=0
+ where exists (select 'X' from t1 a where a.c2 = t1.c2)
+ and c2 >= 3 limit 2;
+--sorted_result
+select c1,c2,c3 from t1;
+truncate table t1;
+insert into t1 select * from tmp;
+
+--echo # Update no rows found
--enable_info ONCE
-update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
-rollback;
-
---echo #
---echo # Update with order by
---echo #
-
-start transaction;
-update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3 order by c2;
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
-rollback;
-
---echo #
---echo Update using a view in subquery
---echo #
-
-start transaction;
+update t1 set c1=10
+ where c1 <2 and exists (select 'X' from t1 a where a.c1 = t1.c1 + 10);
+--sorted_result
+select c1,c2,c3 from t1;
+truncate table t1;
+insert into t1 select * from tmp;
+
+--echo # Update no rows changed
+drop trigger trg_t1;
--enable_info ONCE
-update t1
- set c1=c1 +(select max(a.c2)
- from v1 a
- where a.c1 = t1.c1) ;
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
-rollback;
+update t1 set c1=c1
+ where c1 <2 and exists (select 'X' from t1 a where a.c1 = t1.c1);
+--sorted_result
+select c1,c2,c3 from t1;
+truncate table t1;
+insert into t1 select * from tmp;
--echo #
---echo # Update throw a view
+--echo # Check call of after trigger
--echo #
-start transaction;
---enable_info ONCE
-update v1
- set c1=c1 + (select max(a.c2)
- from t1 a
- where a.c1 = v1.c1) +10
-where c3 > 3;
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
-rollback;
-
---echo #
---echo # Update through a view and using the view in subquery
---echo #
+delimiter /;
+create or replace trigger trg_t2 after update on t1 for each row
+begin
+ declare msg varchar(100);
+ if (new.c3 = 5) then
+ set msg=concat('in after update trigger on ',new.c3);
+ SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = msg;
+ end if;
+end;
+/
+delimiter ;/
+--error 1644
-start transaction;
---enable_info ONCE
-update v1
- set c1=c1 + 1
- where c1 <2
- and exists (select 'X'
- from v1 a
- where a.c1 = v1.c1);
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
-rollback;
+update t1 set c1=2
+ where c3 in (select distinct a.c3 from t1 a where a.c1=t1.c1);
+--sorted_result
+select c1,c2,c3 from t1;
+truncate table t1;
+insert into t1 select * from tmp;
--echo #
---echo # Update through a view and using the view in subquery
+--echo # Check update with order by and after trigger
--echo #
-start transaction;
---enable_info ONCE
-update v1
- set c1=(select max(a.c1)+10
- from v1 a
- where a.c1 = v1.c1)
- where c1 <10
- and exists (select 'X'
- from v1 a
- where a.c2 = v1.c2);
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
-rollback;
+--error 1644
+update t1 set c1=2
+ where c3 in (select distinct a.c3 from t1 a where a.c1=t1.c1)
+ order by t1.c2, t1.c1;
+--sorted_result
+select c1,c2,c3 from t1;
+truncate table t1;
+insert into t1 select * from tmp;
+
+drop view v1;
--echo #
---echo # Update of the index or primary key (c3)
+--echo # Check update on view with check option
--echo #
-start transaction;
-explain update t1 set c3=c3+10 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
---enable_info ONCE
-update t1 set c3=c3+10 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
-select c3 from t1;
-rollback;
+create view v1 as select * from t1 where c2=2 with check option;
---echo #
---echo # update with a limit
---echo #
+-- error 1369
+update v1 set c2=3 where c1=1;
+--sorted_result
+select c1,c2,c3 from t1;
+truncate table t1;
+insert into t1 select * from tmp;
-start transaction;
---enable_info ONCE
-update t1
- set c1=(select a.c3
- from t1 a
- where a.c3 = t1.c3)
- limit 2;
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ;
-rollback;
+-- error 1369
+update v1 set c2=(select max(c3) from v1) where c1=1;
+--sorted_result
+select c1,c2,c3 from t1;
+truncate table t1;
+insert into t1 select * from tmp;
---echo #
---echo # update with a limit and an order by
---echo #
+update v1 set c2=(select min(va.c3) from v1 va), c1=0 where c1=1;
+--sorted_result
+select c1,c2,c3 from t1;
+truncate table t1;
+insert into t1 select * from tmp;
-start transaction;
---enable_info ONCE
-update t1
- set c1=(select a.c3
- from t1 a
- where a.c3 = t1.c3)
- order by c3 desc limit 2;
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ;
-rollback;
---enable_view_protocol
+drop table tmp;
+drop view v1;
+drop table t1;
diff --git a/mysql-test/include/update_use_source_cases.inc b/mysql-test/include/update_use_source_cases.inc
new file mode 100644
index 00000000..f1025f75
--- /dev/null
+++ b/mysql-test/include/update_use_source_cases.inc
@@ -0,0 +1,183 @@
+--echo #
+--echo # Update with value from subquery on the same table
+--echo #
+
+analyze table t1 persistent for all;
+let $q = update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+eval explain select * from t1;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+select concat(old_c1,'->',c1),c3,
+ case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+truncate table t1;
+insert into t1 select * from tmp;
+
+--echo #
+--echo # Update with EXISTS subquery over the updated table
+--echo # in WHERE + possibly sargable condition
+--echo #
+
+analyze table t1 persistent for all;
+let $c = c1 <2
+ and exists (select 'X' from t1 a where a.c1 = t1.c1);
+let $q = update t1 set c1=10 where $c;
+eval explain select * from t1 where $c;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+select concat(old_c1,'->',c1),c3,
+ case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+truncate table t1;
+insert into t1 select * from tmp;
+
+--echo #
+--echo # Update with EXISTS subquery over the updated table
+--echo # in WHERE + non-sargable condition
+--echo #
+
+analyze table t1 persistent for all;
+let $c = exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+let $q = update t1 set c1=c1+10 where $c;
+eval explain select * from t1 where $c;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+select concat(old_c1,'->',c1),c3,
+ case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+truncate table t1;
+insert into t1 select * from tmp;
+
+--echo #
+--echo # Update with order by
+--echo #
+
+analyze table t1 persistent for all;
+let $c = exists (select 'X' from t1 a where a.c2 = t1.c2)
+ and c2 >= 3 order by c2;
+let $q = update t1 set c1=c1+10 where $c;
+eval explain select * from t1 where $c;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+select concat(old_c1,'->',c1),c3,
+ case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+truncate table t1;
+insert into t1 select * from tmp;
+
+--echo #
+--echo # Update with a reference to view in subquery
+--echo # in settable value
+--echo #
+
+analyze table t1 persistent for all;
+let $q = update t1 set c1=c1 +(select max(a.c2) from v1 a
+ where a.c1 = t1.c1);
+eval explain select * from t1;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+select concat(old_c1,'->',c1),c3,
+ case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+truncate table t1;
+insert into t1 select * from tmp;
+
+--echo #
+--echo # Update view
+--echo #
+
+analyze table t1 persistent for all;
+let $q = update v1 set c1=c1 + (select max(a.c2) from t1 a
+ where a.c1 = v1.c1) +10 where c3 > 3;
+eval explain select * from v1;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+select concat(old_c1,'->',c1),c3,
+ case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+truncate table t1;
+insert into t1 select * from tmp;
+
+--echo #
+--echo # Update view with reference to the same view in subquery
+--echo #
+
+analyze table t1 persistent for all;
+let $c = c1 <2
+ and exists (select 'X' from v1 a where a.c1 = v1.c1);
+let $q = update v1 set c1=c1 + 1 where $c;
+eval explain select * from v1 where $c;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+select concat(old_c1,'->',c1),c3,
+ case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+truncate table t1;
+insert into t1 select * from tmp;
+
+--echo #
+--echo # Update view with EXISTS and reference to the same view in subquery
+--echo #
+
+analyze table t1 persistent for all;
+let $c = c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+let $q = update v1
+ set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+ where $c;
+eval explain select * from v1 where $c;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+select concat(old_c1,'->',c1),c3,
+ case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+truncate table t1;
+insert into t1 select * from tmp;
+
+--echo #
+--echo # Update with IN predicand over the updated table in WHERE
+--echo #
+
+analyze table t1 persistent for all;
+let $c = c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+let $q = update t1 set c3=c3+110 where $c;
+eval explain select * from t1 where $c;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+--sorted_result
+select c3 from t1;
+truncate table t1;
+insert into t1 select * from tmp;
+
+--echo #
+--echo # Update with a limit
+--echo #
+
+analyze table t1 persistent for all;
+let $q = update t1
+ set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
+eval explain select * from t1 limit 2;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+select concat(old_c1,'->',c1),c3,
+ case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+truncate table t1;
+insert into t1 select * from tmp;
+
+--echo #
+--echo # Update with a limit and an order by
+--echo #
+
+analyze table t1 persistent for all;
+let $q=update t1
+ set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
+ order by c3 desc limit 2;
+eval explain select * from t1 order by c3 desc limit 2;
+eval explain $q;
+--enable_info ONCE
+eval $q;
+select concat(old_c1,'->',c1),c3,
+ case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+truncate table t1;
+insert into t1 select * from tmp;
diff --git a/mysql-test/include/update_use_source_ext.inc b/mysql-test/include/update_use_source_ext.inc
new file mode 100644
index 00000000..004f7a96
--- /dev/null
+++ b/mysql-test/include/update_use_source_ext.inc
@@ -0,0 +1,59 @@
+--echo #
+--echo # Test on dynamic columns (blob)
+--echo #
+
+create table assets (
+ item_name varchar(32) primary key, -- A common attribute for all items
+ dynamic_cols blob -- Dynamic columns will be stored here
+);
+INSERT INTO assets VALUES ('MariaDB T-shirt',
+ COLUMN_CREATE('color', 'blue', 'size', 'XL'));
+INSERT INTO assets VALUES ('Thinkpad Laptop',
+ COLUMN_CREATE('color', 'black', 'price', 500));
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+ FROM assets;
+UPDATE assets
+ SET dynamic_cols=COLUMN_ADD(dynamic_cols, 'warranty', '3 years')
+ WHERE item_name='Thinkpad Laptop';
+SELECT item_name,
+ COLUMN_GET(dynamic_cols, 'warranty' as char) AS color
+ FROM assets;
+UPDATE assets
+ SET dynamic_cols=COLUMN_ADD(dynamic_cols, 'warranty', '4 years')
+ WHERE item_name in
+ (select b.item_name from assets b
+ where COLUMN_GET(b.dynamic_cols, 'color' as char) ='black');
+SELECT item_name,
+ COLUMN_GET(dynamic_cols, 'warranty' as char) AS color
+ FROM assets;
+
+UPDATE assets SET dynamic_cols=COLUMN_ADD(dynamic_cols, 'warranty',
+ (select COLUMN_GET(b.dynamic_cols, 'color' as char)
+ from assets b
+ where assets.item_name = item_name));
+SELECT item_name,
+ COLUMN_GET(dynamic_cols, 'warranty' as char) AS color
+ FROM assets;
+drop table assets;
+
+--echo #
+--echo # Test on fulltext columns
+--echo #
+CREATE TABLE ft2(copy TEXT,FULLTEXT(copy));
+INSERT INTO ft2(copy) VALUES
+ ('MySQL vs MariaDB database'),
+ ('Oracle vs MariaDB database'),
+ ('PostgreSQL vs MariaDB database'),
+ ('MariaDB overview'),
+ ('Foreign keys'),
+ ('Primary keys'),
+ ('Indexes'),
+ ('Transactions'),
+ ('Triggers');
+SELECT * FROM ft2 WHERE MATCH(copy) AGAINST('database');
+
+update ft2 set copy = (select max(concat('mykeyword ',substr(b.copy,1,5)))
+ from ft2 b WHERE MATCH(b.copy) AGAINST('database'))
+ where MATCH(copy) AGAINST('keys');
+SELECT * FROM ft2 WHERE MATCH(copy) AGAINST('mykeyword');
+drop table ft2;
diff --git a/mysql-test/include/world.inc b/mysql-test/include/world.inc
index 1451a4ab..91ea66ef 100644
--- a/mysql-test/include/world.inc
+++ b/mysql-test/include/world.inc
@@ -4,6 +4,7 @@
# Table Country
+BEGIN;
INSERT IGNORE INTO Country VALUES
('AFG','Afghanistan',652090.00,22720000,1),
('NLD','Netherlands',41526.00,15864000,5),
@@ -5339,5 +5340,6 @@ INSERT INTO CountryLanguage VALUES
('CHN','Dong',0.2),
('RUS','Belorussian',0.3),
('USA','Portuguese',0.2);
+COMMIT;
ANALYZE TABLE Country, City, CountryLanguage;
diff --git a/mysql-test/lib/My/Debugger.pm b/mysql-test/lib/My/Debugger.pm
index 907638c9..2ab8a352 100644
--- a/mysql-test/lib/My/Debugger.pm
+++ b/mysql-test/lib/My/Debugger.pm
@@ -78,7 +78,7 @@ my %debuggers = (
options => '-f -o {log} {exe} {args}',
},
rr => {
- options => '_RR_TRACE_DIR={log} rr record {exe} {args} --loose-skip-innodb-use-native-aio --loose-innodb-flush-method=fsync',
+ options => '_RR_TRACE_DIR={log} rr record {exe} {args}',
run => 'env',
pre => sub {
::mtr_error('rr requires kernel.perf_event_paranoid <= 1')
diff --git a/mysql-test/lib/generate-ssl-certs.sh b/mysql-test/lib/generate-ssl-certs.sh
index 57caf3b7..050a5aa8 100755
--- a/mysql-test/lib/generate-ssl-certs.sh
+++ b/mysql-test/lib/generate-ssl-certs.sh
@@ -27,7 +27,7 @@ openssl rsa -in server-key.pem -out server-key.pem
# sign the server certificate with CA certificate
openssl ca -keyfile cakey.pem -days 7300 -batch -cert cacert.pem -policy policy_anything -out server-cert.pem -in demoCA/server-req.pem
-# server certificate with different validity period (MDEV-7598)
+# server certificate with different validity period (MDEV-16266)
openssl req -newkey rsa:4096 -keyout server-new-key.pem -out demoCA/server-new-req.pem -days 7301 -nodes -subj '/CN=server-new/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB'
openssl rsa -in server-new-key.pem -out server-new-key.pem
openssl ca -keyfile cakey.pem -days 7301 -batch -cert cacert.pem -policy policy_anything -out server-new-cert.pem -in demoCA/server-new-req.pem
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
index c7271757..be1c2be8 100644
--- a/mysql-test/lib/mtr_cases.pm
+++ b/mysql-test/lib/mtr_cases.pm
@@ -67,8 +67,8 @@ if (-d '../sql') {
@plugin_suitedirs= ('storage/*/mysql-test', 'plugin/*/mysql-test', 'storage/*/*/mysql-test', );
$overlay_regex= '\b(?:storage|plugin|storage[/][^/]*)/(\w+)/mysql-test\b';
} else {
- @plugin_suitedirs= ('mysql-test/plugin/*');
- $overlay_regex= '\bmysql-test/plugin/(\w+)\b';
+ @plugin_suitedirs= ('mariadb-test/plugin/*');
+ $overlay_regex= '\bmariadb-test/plugin/(\w+)\b';
}
$plugin_suitedir_regex= $overlay_regex;
$plugin_suitedir_regex=~ s/\Q(\w+)\E/\\w+/;
@@ -288,8 +288,8 @@ sub load_suite_object {
sub suite_for_file($) {
my ($file) = @_;
return ($2, $1) if $file =~ m@^(.*/$plugin_suitedir_regex/(\w+))/@o;
- return ($2, $1) if $file =~ m@^(.*/mysql-test/suite/(\w+))/@;
- return ('main', $1) if $file =~ m@^(.*/mysql-test)/@;
+ return ($2, $1) if $file =~ m@^(.*/(?:mysql|mariadb)-test/suite/(\w+))/@;
+ return ('main', $1) if $file =~ m@^(.*/(?:mysql|mariadb)-test)/@;
mtr_error("Cannot determine suite for $file");
}
@@ -397,14 +397,14 @@ sub collect_suite_name($$)
else
{
my @dirs = my_find_dir(dirname($::glob_mysql_test_dir),
- ["mysql-test/suite", @plugin_suitedirs ],
+ ["mariadb-test/suite", "mysql-test/suite", @plugin_suitedirs ],
$suitename);
#
# if $suitename contained wildcards, we'll have many suites and
# their overlays here. Let's group them appropriately.
#
for (@dirs) {
- m@^.*/(?:mysql-test/suite|$plugin_suitedir_regex)/(.*)$@o or confess $_;
+ m@^.*/(?:mariadb-test/suite|mysql-test/suite|$plugin_suitedir_regex)/(.*)$@o or confess $_;
push @{$suites{$1}}, $_;
}
}
diff --git a/mysql-test/lib/ssl-mitm.pl b/mysql-test/lib/ssl-mitm.pl
new file mode 100755
index 00000000..73652f0f
--- /dev/null
+++ b/mysql-test/lib/ssl-mitm.pl
@@ -0,0 +1,95 @@
+#!/usr/bin/env perl
+
+# mitm for mariadb procotol with ssl
+
+use strict;
+use warnings;
+use autodie;
+use Getopt::Long;
+use Socket qw(PF_INET SOCK_STREAM INADDR_ANY INADDR_LOOPBACK sockaddr_in SO_REUSEADDR SOL_SOCKET);
+use Net::SSLeay;
+
+my $opt_listen_port;
+my $opt_connect_port;
+my $opt_key;
+my $opt_cert;
+my $opt_ca;
+
+my %options=(
+ 'listen-on=i' => \$opt_listen_port,
+ 'connect-to=i' => \$opt_connect_port,
+ 'ssl-key=s' => \$opt_key,
+ 'ssl-cert=s' => \$opt_cert,
+ 'ssl-ca=s' => \$opt_ca,
+);
+
+GetOptions(%options) or usage("Can't read options");
+die "not all options set" unless $opt_listen_port and $opt_connect_port
+ and $opt_key and $opt_cert and $opt_ca;
+
+Net::SSLeay::load_error_strings();
+Net::SSLeay::SSLeay_add_ssl_algorithms();
+
+my $servctx = Net::SSLeay::CTX_new();
+my $servssl = Net::SSLeay::new($servctx);
+
+my $clictx = Net::SSLeay::CTX_new();
+Net::SSLeay::CTX_load_verify_locations($clictx, $opt_ca, '');
+Net::SSLeay::set_cert_and_key($clictx, $opt_cert, $opt_key);
+my $clissl = Net::SSLeay::new($clictx);
+
+socket(my $listen, PF_INET, SOCK_STREAM, getprotobyname('tcp'));
+setsockopt($listen, SOL_SOCKET, SO_REUSEADDR, pack("l", 1));
+bind($listen, sockaddr_in($opt_listen_port, INADDR_ANY));
+listen($listen, 1);
+warn "$$: listening";
+
+print ">> MitM active <<\n";
+close STDOUT;
+
+fork and exit;
+warn "$$: forked";
+
+accept(my $client, $listen);
+warn "$$: accepted";
+
+socket(my $server, PF_INET, SOCK_STREAM, getprotobyname('tcp'));
+connect($server, sockaddr_in($opt_connect_port, INADDR_LOOPBACK));
+warn "$$: connected";
+
+# handshake server -> client
+recv $server, $_, 1e6, 0;
+send $client, $_, 0;
+warn "$$: handshake server -> client (".length.")";
+
+# client replies with a dummy
+recv $client, $_, 36, 0;
+send $server, $_, 0;
+warn "$$: client replies with a dummy (".length.")";
+
+# SSL with server
+Net::SSLeay::set_fd($servssl, fileno($server));
+Net::SSLeay::connect($servssl);
+warn "$$: ssl connect server";
+
+# SSL accept client
+Net::SSLeay::set_fd($clissl, fileno($client));
+Net::SSLeay::accept($clissl);
+warn "$$: ssl accept client";
+
+while (1) {
+ $_=Net::SSLeay::read($clissl) or last;
+ warn "$$: ssl read client ".length.")";
+ s/Detecting MitM/No MitM found!/;
+ Net::SSLeay::write($servssl, $_) or last;
+ warn "$$: ssl write server ".length.")";
+ $_=Net::SSLeay::read($servssl) or last;
+ warn "$$: ssl read server ".length.")";
+ Net::SSLeay::write($clissl, $_) or last;
+ warn "$$: ssl write client ".length.")";
+}
+
+close($server);
+close($client);
+close($listen);
+warn "$$: ----------\n";
diff --git a/mysql-test/lib/v1/mysql-test-run.pl b/mysql-test/lib/v1/mysql-test-run.pl
index aabe3d75..ce1d38b1 100755
--- a/mysql-test/lib/v1/mysql-test-run.pl
+++ b/mysql-test/lib/v1/mysql-test-run.pl
@@ -1497,7 +1497,7 @@ sub mysql_client_test_arguments()
if ( $opt_debug )
{
mtr_add_arg($args,
- "--debug=d:t:A,$path_vardir_trace/log/mysql_client_test.trace");
+ "--debug-dbug=d:t:A,$path_vardir_trace/log/mysql_client_test.trace");
}
if ( $glob_use_embedded_server )
@@ -1535,7 +1535,7 @@ sub mysql_upgrade_arguments()
if ( $opt_debug )
{
mtr_add_arg($args,
- "--debug=d:t:A,$path_vardir_trace/log/mysql_upgrade.trace");
+ "--debug-dbug=d:t:A,$path_vardir_trace/log/mysql_upgrade.trace");
}
return join(" ", $exe, @$args);
@@ -1663,7 +1663,7 @@ sub environment_setup () {
if ( $opt_debug )
{
$cmdline_mysqlcheck .=
- " --debug=d:t:A,$path_vardir_trace/log/mysqlcheck.trace";
+ " --debug-dbug=d:t:A,$path_vardir_trace/log/mysqlcheck.trace";
}
$ENV{'MYSQL_CHECK'}= $cmdline_mysqlcheck;
@@ -1676,9 +1676,9 @@ sub environment_setup () {
if ( $opt_debug )
{
$cmdline_mysqldump .=
- " --debug=d:t:A,$path_vardir_trace/log/mysqldump-master.trace";
+ " --debug-dbug=d:t:A,$path_vardir_trace/log/mysqldump-master.trace";
$cmdline_mysqldumpslave .=
- " --debug=d:t:A,$path_vardir_trace/log/mysqldump-slave.trace";
+ " --debug-dbug=d:t:A,$path_vardir_trace/log/mysqldump-slave.trace";
}
$ENV{'MYSQL_DUMP'}= $cmdline_mysqldump;
$ENV{'MYSQL_DUMP_SLAVE'}= $cmdline_mysqldumpslave;
@@ -1698,7 +1698,7 @@ sub environment_setup () {
if ( $opt_debug )
{
$cmdline_mysqlslap .=
- " --debug=d:t:A,$path_vardir_trace/log/mysqlslap.trace";
+ " --debug-dbug=d:t:A,$path_vardir_trace/log/mysqlslap.trace";
}
$ENV{'MYSQL_SLAP'}= $cmdline_mysqlslap;
}
@@ -1715,7 +1715,7 @@ sub environment_setup () {
if ( $opt_debug )
{
$cmdline_mysqlimport .=
- " --debug=d:t:A,$path_vardir_trace/log/mysqlimport.trace";
+ " --debug-dbug=d:t:A,$path_vardir_trace/log/mysqlimport.trace";
}
$ENV{'MYSQL_IMPORT'}= $cmdline_mysqlimport;
@@ -1732,7 +1732,7 @@ sub environment_setup () {
if ( $opt_debug )
{
$cmdline_mysqlshow .=
- " --debug=d:t:A,$path_vardir_trace/log/mysqlshow.trace";
+ " --debug-dbug=d:t:A,$path_vardir_trace/log/mysqlshow.trace";
}
$ENV{'MYSQL_SHOW'}= $cmdline_mysqlshow;
@@ -1753,7 +1753,7 @@ sub environment_setup () {
if ( $opt_debug )
{
$cmdline_mysqlbinlog .=
- " --debug=d:t:A,$path_vardir_trace/log/mysqlbinlog.trace";
+ " --debug-dbug=d:t:A,$path_vardir_trace/log/mysqlbinlog.trace";
}
$ENV{'MYSQL_BINLOG'}= $cmdline_mysqlbinlog;
@@ -2460,7 +2460,7 @@ sub install_db ($$) {
if ( $opt_debug )
{
- mtr_add_arg($args, "--debug=d:t:i:A,%s/log/bootstrap_%s.trace",
+ mtr_add_arg($args, "--debug-dbug=d:t:i:A,%s/log/bootstrap_%s.trace",
$path_vardir_trace, $type);
}
@@ -3186,7 +3186,7 @@ sub mysqld_arguments ($$$$) {
{
if ( $opt_debug )
{
- mtr_add_arg($args, "%s--debug=d:t:i:A,%s/log/%s%s.trace",
+ mtr_add_arg($args, "%s--debug-dbug=d:t:i:A,%s/log/%s%s.trace",
$prefix, $path_vardir_trace, $mysqld->{'type'}, $sidx);
}
else
@@ -3825,7 +3825,7 @@ sub run_mysqltest ($) {
if ( $opt_debug )
{
- mtr_add_arg($args, "--debug=d:t:A,%s/log/mysqltest.trace",
+ mtr_add_arg($args, "--debug-dbug=d:t:A,%s/log/mysqltest.trace",
$path_vardir_trace);
}
diff --git a/mysql-test/main/alter_events.result b/mysql-test/main/alter_events.result
index b3bd8d26..41d5f7a6 100644
--- a/mysql-test/main/alter_events.result
+++ b/mysql-test/main/alter_events.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression('Event Scheduler: .* Duplicate entry');
SET GLOBAL event_scheduler=1;
CREATE TABLE t1 (a int primary key, b int) engine=innodb;
insert into t1 values (1,1),(2,2),(3,3);
diff --git a/mysql-test/main/alter_events.test b/mysql-test/main/alter_events.test
index 309a0ce0..beaffb5a 100644
--- a/mysql-test/main/alter_events.test
+++ b/mysql-test/main/alter_events.test
@@ -2,6 +2,7 @@
--source include/have_innodb.inc
#--source include/have_metadata_lock_info.inc
+call mtr.add_suppression('Event Scheduler: .* Duplicate entry');
#
# Testing of problems with ALTER TABLE and events on the same table(s)
#
diff --git a/mysql-test/main/alter_table.result b/mysql-test/main/alter_table.result
index 949f36e2..9b2fe43a 100644
--- a/mysql-test/main/alter_table.result
+++ b/mysql-test/main/alter_table.result
@@ -268,28 +268,6 @@ ERROR 42000: Incorrect table name ''
rename table t1 to ``;
ERROR 42000: Incorrect table name ''
drop table t1;
-drop table if exists t1, t2;
-Warnings:
-Note 1051 Unknown table 'test.t1,test.t2'
-create table t1 ( a varchar(10) not null primary key ) engine=myisam;
-create table t2 ( a varchar(10) not null primary key ) engine=merge union=(t1);
-flush tables;
-alter table t1 modify a varchar(10);
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` varchar(10) NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci UNION=(`t1`)
-flush tables;
-alter table t1 modify a varchar(10) not null;
-show create table t2;
-Table Create Table
-t2 CREATE TABLE `t2` (
- `a` varchar(10) NOT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci UNION=(`t1`)
-drop table if exists t1, t2;
create table t1 (a int, b int, c int, d int, e int, f int, g int, h int,i int, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM;
insert ignore into t1 (a) values(1);
Warnings:
@@ -1013,10 +991,14 @@ CREATE TEMPORARY TABLE `#sql1` (c1 INT);
CREATE TEMPORARY TABLE `@0023sql2` (c1 INT);
SHOW TABLES;
Tables_in_test
+@0023sql2
+#sql1
ALTER TABLE `#sql1` RENAME `@0023sql1`;
ALTER TABLE `@0023sql2` RENAME `#sql2`;
SHOW TABLES;
Tables_in_test
+#sql2
+@0023sql1
INSERT INTO `#sql2` VALUES (1);
INSERT INTO `@0023sql1` VALUES (2);
SHOW CREATE TABLE `#sql2`;
@@ -1672,18 +1654,16 @@ ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE;
affected rows: 0
ALTER TABLE t1 DROP INDEX i1, DROP INDEX i2, DROP INDEX i3, DROP INDEX i4;
#
-# 2: Test ALGORITHM + old_alter_table
+# 2: Test ALGORITHM + alter_algorithm
#
-SET SESSION old_alter_table= 1;
+SET SESSION alter_algorithm= 1;
affected rows: 0
-Warnings:
-Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
ALTER TABLE t1 ADD INDEX i1(b);
affected rows: 2
info: Records: 2 Duplicates: 0 Warnings: 0
ALTER TABLE t1 ADD INDEX i2(b), ALGORITHM= DEFAULT;
-affected rows: 2
-info: Records: 2 Duplicates: 0 Warnings: 1
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
Note 1831 Duplicate index `i2`. This is deprecated and will be disallowed in a future release
ALTER TABLE t1 ADD INDEX i3(b), ALGORITHM= COPY;
@@ -1696,10 +1676,8 @@ affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
Note 1831 Duplicate index `i4`. This is deprecated and will be disallowed in a future release
-SET SESSION old_alter_table= 0;
+SET SESSION alter_algorithm= 0;
affected rows: 0
-Warnings:
-Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
ALTER TABLE t1 DROP INDEX i1, DROP INDEX i2, DROP INDEX i3, DROP INDEX i4;
#
# 3: Test unsupported in-place operation
@@ -1756,7 +1734,6 @@ info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
Note 1831 Duplicate index `i3`. This is deprecated and will be disallowed in a future release
ALTER TABLE t1 ADD INDEX i4(b), ALGORITHM= COPY, LOCK= NONE;
-ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED
ALTER TABLE t1 ADD INDEX i5(b), ALGORITHM= COPY, LOCK= SHARED;
affected rows: 2
info: Records: 2 Duplicates: 0 Warnings: 1
@@ -1774,9 +1751,6 @@ ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCL
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE, LOCK= EXCLUSIVE;
affected rows: 0
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= COPY, LOCK= NONE;
-ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED
-ALTER ONLINE TABLE m1 ADD COLUMN c int;
-ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= COPY, LOCK= SHARED;
affected rows: 2
info: Records: 2 Duplicates: 0 Warnings: 0
diff --git a/mysql-test/main/alter_table.test b/mysql-test/main/alter_table.test
index 5ffa300f..48175f49 100644
--- a/mysql-test/main/alter_table.test
+++ b/mysql-test/main/alter_table.test
@@ -244,20 +244,6 @@ alter table t1 rename to ``;
rename table t1 to ``;
drop table t1;
-#
-# BUG#6236 - ALTER TABLE MODIFY should set implicit NOT NULL on PK columns
-#
-drop table if exists t1, t2;
-create table t1 ( a varchar(10) not null primary key ) engine=myisam;
-create table t2 ( a varchar(10) not null primary key ) engine=merge union=(t1);
-flush tables;
-alter table t1 modify a varchar(10);
-show create table t2;
-flush tables;
-alter table t1 modify a varchar(10) not null;
-show create table t2;
-drop table if exists t1, t2;
-
# The following is also part of bug #6236 (CREATE TABLE didn't properly count
# not null columns for primary keys)
@@ -1476,16 +1462,16 @@ ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE;
ALTER TABLE t1 DROP INDEX i1, DROP INDEX i2, DROP INDEX i3, DROP INDEX i4;
--echo #
---echo # 2: Test ALGORITHM + old_alter_table
+--echo # 2: Test ALGORITHM + alter_algorithm
--echo #
--enable_info
-SET SESSION old_alter_table= 1;
+SET SESSION alter_algorithm= 1;
ALTER TABLE t1 ADD INDEX i1(b);
ALTER TABLE t1 ADD INDEX i2(b), ALGORITHM= DEFAULT;
ALTER TABLE t1 ADD INDEX i3(b), ALGORITHM= COPY;
ALTER TABLE t1 ADD INDEX i4(b), ALGORITHM= INPLACE;
-SET SESSION old_alter_table= 0;
+SET SESSION alter_algorithm= 0;
--disable_info
ALTER TABLE t1 DROP INDEX i1, DROP INDEX i2, DROP INDEX i3, DROP INDEX i4;
@@ -1531,8 +1517,13 @@ ALTER TABLE t1 DROP INDEX i1, DROP INDEX i2, DROP INDEX i3, DROP INDEX i4;
ALTER TABLE t1 ADD INDEX i1(b), ALGORITHM= INPLACE, LOCK= NONE;
ALTER TABLE t1 ADD INDEX i2(b), ALGORITHM= INPLACE, LOCK= SHARED;
ALTER TABLE t1 ADD INDEX i3(b), ALGORITHM= INPLACE, LOCK= EXCLUSIVE;
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+--disable_info
+--disable_warnings
+--error 0,ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+# COPY/NONE works now, but still an error in embedded
ALTER TABLE t1 ADD INDEX i4(b), ALGORITHM= COPY, LOCK= NONE;
+--enable_warnings
+--enable_info
ALTER TABLE t1 ADD INDEX i5(b), ALGORITHM= COPY, LOCK= SHARED;
ALTER TABLE t1 ADD INDEX i6(b), ALGORITHM= COPY, LOCK= EXCLUSIVE;
@@ -1541,10 +1532,11 @@ ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE, LOCK= NONE;
--error ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE, LOCK= SHARED;
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE, LOCK= EXCLUSIVE;
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+--disable_info
+--error 0,ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+# COPY/NONE works now, but still an error in embedded
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= COPY, LOCK= NONE;
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-ALTER ONLINE TABLE m1 ADD COLUMN c int;
+--enable_info
# This works because the lock will be SNW for the copy phase.
# It will still require exclusive lock for actually enabling keys.
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= COPY, LOCK= SHARED;
diff --git a/mysql-test/main/alter_table_combinations,aria.rdiff b/mysql-test/main/alter_table_combinations,aria.rdiff
index 9ea38135..e0305716 100644
--- a/mysql-test/main/alter_table_combinations,aria.rdiff
+++ b/mysql-test/main/alter_table_combinations,aria.rdiff
@@ -1,5 +1,5 @@
---- main/alter_table_combinations.result 2022-05-24 17:16:56.769146869 +0200
-+++ main/alter_table_combinations.reject 2022-05-24 17:25:20.847126357 +0200
+--- main/alter_table_combinations.result
++++ main/alter_table_combinations.reject
@@ -173,8 +173,7 @@
t3 CREATE TABLE `t3` (
`a` int(11) DEFAULT NULL,
diff --git a/mysql-test/main/alter_table_combinations,heap.rdiff b/mysql-test/main/alter_table_combinations,heap.rdiff
index 0ca6d3de..493ce0ea 100644
--- a/mysql-test/main/alter_table_combinations,heap.rdiff
+++ b/mysql-test/main/alter_table_combinations,heap.rdiff
@@ -1,5 +1,5 @@
---- main/alter_table_combinations.result 2022-05-24 17:16:56.769146869 +0200
-+++ main/alter_table_combinations.reject 2022-05-24 17:25:01.216127156 +0200
+--- main/alter_table_combinations.result
++++ main/alter_table_combinations.reject
@@ -11,7 +11,7 @@
alter table t1 change x xx int, algorithm=inplace;
check table t1;
diff --git a/mysql-test/main/alter_table_lock.result b/mysql-test/main/alter_table_lock.result
index 620fca23..5a787055 100644
--- a/mysql-test/main/alter_table_lock.result
+++ b/mysql-test/main/alter_table_lock.result
@@ -14,4 +14,49 @@ ALTER TABLE t1 CHANGE COLUMN IF EXISTS b c INT;
SET SESSION max_session_mem_used = @max_session_mem_used_save;
UNLOCK TABLES;
DROP TABLE t1;
+#
# End of 10.5 tests
+#
+#
+# MDEV-28943 Online alter fails under LOCK TABLE with ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+#
+create table t1 (f int) engine=innodb;
+insert t1 values (1);
+alter table t1 force, algorithm=copy, lock=none;
+alter table t1 force, algorithm=inplace, lock=none;
+alter table t1 force, algorithm=copy, lock=shared;
+alter table t1 force, algorithm=inplace, lock=shared;
+alter table t1 force, algorithm=copy, lock=exclusive;
+alter table t1 force, algorithm=inplace, lock=exclusive;
+lock table t1 write;
+connect con1, localhost, root;
+select count(*) as 'must be 0' from t1;
+connection default;
+alter table t1 force, algorithm=copy, lock=none;
+alter table t1 force, algorithm=inplace, lock=none;
+alter table t1 force, algorithm=copy, lock=shared;
+alter table t1 force, algorithm=inplace, lock=shared;
+alter table t1 force, algorithm=copy, lock=exclusive;
+alter table t1 force, algorithm=inplace, lock=exclusive;
+delete from t1;
+unlock tables;
+connection con1;
+must be 0
+0
+connection default;
+drop table t1;
+#
+# MDEV-29056 Replica SQL thread stops with 1846 error on ALTER ONLINE after LOCK WRITE
+#
+create table t1 (c varchar(1), key (c)) engine=innodb;
+insert into t1 (c) values ('g') ;
+alter table t1 add fulltext key(c), algorithm=inplace;
+alter online table t1 add column s blob not null, algorithm=inplace;
+ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
+lock table t1 write;
+alter online table t1 add column s blob not null, algorithm=inplace;
+ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
+drop table t1;
+#
+# End of 10.11 tests
+#
diff --git a/mysql-test/main/alter_table_lock.test b/mysql-test/main/alter_table_lock.test
index bd26c1ac..1ed267e5 100644
--- a/mysql-test/main/alter_table_lock.test
+++ b/mysql-test/main/alter_table_lock.test
@@ -1,4 +1,6 @@
--source include/not_msan.inc
+--source include/not_embedded.inc
+--source include/have_innodb.inc
--echo #
--echo # MDEV-23836: Assertion `! is_set() || m_can_overwrite_status' in
@@ -26,4 +28,54 @@ SET SESSION max_session_mem_used = @max_session_mem_used_save;
UNLOCK TABLES;
DROP TABLE t1;
+--echo #
--echo # End of 10.5 tests
+--echo #
+
+--echo #
+--echo # MDEV-28943 Online alter fails under LOCK TABLE with ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+--echo #
+
+# test that any lock=xxx works under LOCK TABLES
+# and that it is ignored, does not actually downgrade the lock
+create table t1 (f int) engine=innodb;
+insert t1 values (1);
+alter table t1 force, algorithm=copy, lock=none;
+alter table t1 force, algorithm=inplace, lock=none;
+alter table t1 force, algorithm=copy, lock=shared;
+alter table t1 force, algorithm=inplace, lock=shared;
+alter table t1 force, algorithm=copy, lock=exclusive;
+alter table t1 force, algorithm=inplace, lock=exclusive;
+lock table t1 write;
+connect con1, localhost, root;
+--send select count(*) as 'must be 0' from t1
+--connection default
+alter table t1 force, algorithm=copy, lock=none;
+alter table t1 force, algorithm=inplace, lock=none;
+alter table t1 force, algorithm=copy, lock=shared;
+alter table t1 force, algorithm=inplace, lock=shared;
+alter table t1 force, algorithm=copy, lock=exclusive;
+alter table t1 force, algorithm=inplace, lock=exclusive;
+delete from t1;
+unlock tables;
+--connection con1
+--reap
+--connection default
+drop table t1;
+
+--echo #
+--echo # MDEV-29056 Replica SQL thread stops with 1846 error on ALTER ONLINE after LOCK WRITE
+--echo #
+create table t1 (c varchar(1), key (c)) engine=innodb;
+insert into t1 (c) values ('g') ;
+alter table t1 add fulltext key(c), algorithm=inplace;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter online table t1 add column s blob not null, algorithm=inplace;
+lock table t1 write;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter online table t1 add column s blob not null, algorithm=inplace;
+drop table t1;
+
+--echo #
+--echo # End of 10.11 tests
+--echo #
diff --git a/mysql-test/main/alter_table_locknone.result b/mysql-test/main/alter_table_locknone.result
new file mode 100644
index 00000000..e6cc47ed
--- /dev/null
+++ b/mysql-test/main/alter_table_locknone.result
@@ -0,0 +1,251 @@
+create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b')) engine=myisam;
+insert into t1 (a) values (1),(2),(3);
+alter online table t1 modify b int default 5, alter c set default 'X';
+alter online table t1 change b new_name int;
+alter online table t1 modify e enum('a','b','c');
+alter online table t1 comment "new comment";
+alter table t1 add constraint q check (a > 0);
+alter online table t1 drop constraint q;
+alter online table t1 algorithm=INPLACE, lock=NONE;
+alter online table t1;
+alter table t1 algorithm=INPLACE;
+alter table t1 lock=NONE;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `new_name` int(11) DEFAULT NULL,
+ `c` varchar(80) DEFAULT 'X',
+ `e` enum('a','b','c') DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new comment'
+drop table t1;
+create temporary table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
+insert into t1 (a) values (1),(2),(3);
+alter online table t1 modify b int default 5, alter c set default 'X';
+alter online table t1 change b new_name int;
+alter online table t1 modify e enum('a','b','c');
+alter online table t1 comment "new comment";
+alter online table t1 rename to t2;
+show create table t2;
+Table Create Table
+t2 CREATE TEMPORARY TABLE `t2` (
+ `a` int(11) NOT NULL,
+ `new_name` int(11) DEFAULT NULL,
+ `c` varchar(80) DEFAULT 'X',
+ `e` enum('a','b','c') DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new comment'
+drop table t2;
+create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b')) engine=aria;
+insert into t1 (a) values (1),(2),(3);
+alter online table t1 modify b int default 5;
+alter online table t1 change b new_name int;
+alter online table t1 modify e enum('a','b','c');
+alter online table t1 comment "new comment";
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `new_name` int(11) DEFAULT NULL,
+ `c` varchar(80) DEFAULT NULL,
+ `e` enum('a','b','c') DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new comment'
+alter online table t1 page_checksum=1;
+drop table t1;
+create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
+insert into t1 (a) values (1),(2),(3);
+alter online table t1 rename to t2;
+ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE
+alter table t1 engine=innodb;
+alter table t1 add index (b);
+alter online table t1 add index c (c);
+alter online table t1 drop index b;
+alter online table t1 comment "new comment";
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `b` int(11) DEFAULT NULL,
+ `c` varchar(80) DEFAULT NULL,
+ `e` enum('a','b') DEFAULT NULL,
+ PRIMARY KEY (`a`),
+ KEY `c` (`c`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new comment'
+drop table t1;
+create temporary table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
+insert into t1 (a) values (1),(2),(3);
+alter online table t1 drop column b, add b int;
+alter online table t1 modify b bigint;
+alter online table t1 modify e enum('c','a','b');
+alter online table t1 modify c varchar(50);
+alter online table t1 modify c varchar(100);
+alter online table t1 add f int;
+alter online table t1 engine=memory;
+alter table t1 engine=innodb;
+alter table t1 add index (b);
+alter online table t1 add index c (c);
+alter online table t1 drop index b;
+drop table t1;
+create table t1 (a int not null primary key, b int, c varchar(80));
+create table t2 (a int not null primary key, b int, c varchar(80));
+create table t3 (a int not null primary key, b int, c varchar(80)) engine=merge UNION=(t1);
+alter online table t3 union=(t1,t2);
+ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=EXCLUSIVE
+drop table t1,t2,t3;
+create table t1 (i int) partition by hash(i) partitions 2;
+alter online table t1 comment 'test';
+drop table t1;
+create table t1 (a int);
+alter online table t1 modify a int comment 'test';
+drop table t1;
+create table t1 (a int) engine=innodb;
+alter online table t1 modify a int comment 'test';
+drop table t1;
+create table t1 (a int) partition by hash(a) partitions 2;
+alter online table t1 modify a int comment 'test';
+drop table t1;
+#
+# MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB
+#
+CREATE TABLE t1 (a BINARY(10));
+ALTER TABLE t1 MODIFY a BINARY(10), ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a VARBINARY(10));
+ALTER TABLE t1 MODIFY a VARBINARY(10), ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYBLOB);
+ALTER TABLE t1 MODIFY a TINYBLOB, ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMBLOB);
+ALTER TABLE t1 MODIFY a MEDIUMBLOB, ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a BLOB);
+ALTER TABLE t1 MODIFY a BLOB, ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGBLOB);
+ALTER TABLE t1 MODIFY a LONGBLOB, ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a CHAR(10));
+ALTER TABLE t1 MODIFY a CHAR(10), ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10));
+ALTER TABLE t1 MODIFY a VARCHAR(10), ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYTEXT);
+ALTER TABLE t1 MODIFY a TINYTEXT, ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMTEXT);
+ALTER TABLE t1 MODIFY a MEDIUMTEXT, ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT);
+ALTER TABLE t1 MODIFY a TEXT, ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGTEXT);
+ALTER TABLE t1 MODIFY a LONGTEXT, ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a CHAR(10));
+ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_bin, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10));
+ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_bin, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYTEXT);
+ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMTEXT);
+ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT);
+ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGTEXT);
+ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+DROP TABLE t1;
+CREATE TABLE t1 (a CHAR(10) COLLATE latin1_bin);
+ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10) COLLATE latin1_bin);
+ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYTEXT COLLATE latin1_bin);
+ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMTEXT COLLATE latin1_bin);
+ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT COLLATE latin1_bin);
+ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGTEXT COLLATE latin1_bin);
+ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+DROP TABLE t1;
+CREATE TABLE t1 (a CHAR(10) COLLATE latin1_general_ci);
+ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10) COLLATE latin1_general_ci);
+ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYTEXT COLLATE latin1_general_ci);
+ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMTEXT COLLATE latin1_general_ci);
+ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT COLLATE latin1_general_ci);
+ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGTEXT COLLATE latin1_general_ci);
+ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+DROP TABLE t1;
+select @@global.delay_key_write;
+@@global.delay_key_write
+ON
+create table t1 (a int, b int, key(b));
+flush tables;
+flush status;
+show status like 'Feature_delay_key_write';
+Variable_name Value
+Feature_delay_key_write 0
+insert t1 values (1,2),(2,3),(3,4);
+show status like 'Feature_delay_key_write';
+Variable_name Value
+Feature_delay_key_write 0
+alter online table t1 delay_key_write=1;
+show status like 'Feature_delay_key_write';
+Variable_name Value
+Feature_delay_key_write 0
+flush tables;
+insert t1 values (1,2),(2,3),(3,4);
+show status like 'Feature_delay_key_write';
+Variable_name Value
+Feature_delay_key_write 1
+alter online table t1 delay_key_write=0;
+show status like 'Feature_delay_key_write';
+Variable_name Value
+Feature_delay_key_write 1
+flush tables;
+insert t1 values (1,2),(2,3),(3,4);
+show status like 'Feature_delay_key_write';
+Variable_name Value
+Feature_delay_key_write 1
+drop table t1;
diff --git a/mysql-test/main/alter_table_locknone.test b/mysql-test/main/alter_table_locknone.test
new file mode 100644
index 00000000..9588ec66
--- /dev/null
+++ b/mysql-test/main/alter_table_locknone.test
@@ -0,0 +1,311 @@
+#
+# Test of ALTER ONLINE TABLE syntax
+# (same as LOCK=NONE)
+#
+
+--source include/have_innodb.inc
+--source include/have_partition.inc
+#
+# Test of things that can be done online
+#
+
+create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b')) engine=myisam;
+insert into t1 (a) values (1),(2),(3);
+
+alter online table t1 modify b int default 5, alter c set default 'X';
+alter online table t1 change b new_name int;
+alter online table t1 modify e enum('a','b','c');
+alter online table t1 comment "new comment";
+alter table t1 add constraint q check (a > 0);
+alter online table t1 drop constraint q;
+
+# No OPs
+
+alter online table t1 algorithm=INPLACE, lock=NONE;
+alter online table t1;
+alter table t1 algorithm=INPLACE;
+alter table t1 lock=NONE;
+show create table t1;
+drop table t1;
+
+#
+# everything with temporary tables is "online", i.e. without locks
+#
+create temporary table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
+insert into t1 (a) values (1),(2),(3);
+alter online table t1 modify b int default 5, alter c set default 'X';
+alter online table t1 change b new_name int;
+alter online table t1 modify e enum('a','b','c');
+alter online table t1 comment "new comment";
+alter online table t1 rename to t2;
+show create table t2;
+drop table t2;
+
+#
+# Test also with Aria
+#
+
+create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b')) engine=aria;
+insert into t1 (a) values (1),(2),(3);
+alter online table t1 modify b int default 5;
+alter online table t1 change b new_name int;
+alter online table t1 modify e enum('a','b','c');
+alter online table t1 comment "new comment";
+show create table t1;
+alter online table t1 page_checksum=1;
+drop table t1;
+
+create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
+insert into t1 (a) values (1),(2),(3);
+
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+alter online table t1 rename to t2;
+
+alter table t1 engine=innodb;
+alter table t1 add index (b);
+alter online table t1 add index c (c);
+alter online table t1 drop index b;
+alter online table t1 comment "new comment";
+show create table t1;
+drop table t1;
+
+create temporary table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
+insert into t1 (a) values (1),(2),(3);
+
+#
+# everything with temporary tables is "online", i.e. without locks
+#
+alter online table t1 drop column b, add b int;
+alter online table t1 modify b bigint;
+alter online table t1 modify e enum('c','a','b');
+alter online table t1 modify c varchar(50);
+alter online table t1 modify c varchar(100);
+alter online table t1 add f int;
+alter online table t1 engine=memory;
+
+alter table t1 engine=innodb;
+alter table t1 add index (b);
+alter online table t1 add index c (c);
+alter online table t1 drop index b;
+drop table t1;
+
+#
+# Test merge tables
+#
+create table t1 (a int not null primary key, b int, c varchar(80));
+create table t2 (a int not null primary key, b int, c varchar(80));
+create table t3 (a int not null primary key, b int, c varchar(80)) engine=merge UNION=(t1);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+alter online table t3 union=(t1,t2);
+drop table t1,t2,t3;
+
+#
+# MDEV-9868 Altering a partitioned table comment does a full copy
+#
+create table t1 (i int) partition by hash(i) partitions 2;
+alter online table t1 comment 'test';
+drop table t1;
+
+#
+# MDEV-9168 altering a column comment does a full copy
+#
+create table t1 (a int);
+alter online table t1 modify a int comment 'test';
+drop table t1;
+
+create table t1 (a int) engine=innodb;
+alter online table t1 modify a int comment 'test';
+drop table t1;
+
+create table t1 (a int) partition by hash(a) partitions 2;
+alter online table t1 modify a int comment 'test';
+drop table t1;
+
+--echo #
+--echo # MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB
+--echo #
+#
+# ALTER to the same [VAR]BINARY type
+#
+CREATE TABLE t1 (a BINARY(10));
+ALTER TABLE t1 MODIFY a BINARY(10), ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a VARBINARY(10));
+ALTER TABLE t1 MODIFY a VARBINARY(10), ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+#
+# ALTER to the same BLOB variant
+#
+CREATE TABLE t1 (a TINYBLOB);
+ALTER TABLE t1 MODIFY a TINYBLOB, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a MEDIUMBLOB);
+ALTER TABLE t1 MODIFY a MEDIUMBLOB, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a BLOB);
+ALTER TABLE t1 MODIFY a BLOB, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a LONGBLOB);
+ALTER TABLE t1 MODIFY a LONGBLOB, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+#
+# ALTER to the same [VAR]CHAR type
+#
+CREATE TABLE t1 (a CHAR(10));
+ALTER TABLE t1 MODIFY a CHAR(10), ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a VARCHAR(10));
+ALTER TABLE t1 MODIFY a VARCHAR(10), ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+
+#
+# ALTER to the same TEXT variant
+#
+CREATE TABLE t1 (a TINYTEXT);
+ALTER TABLE t1 MODIFY a TINYTEXT, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a MEDIUMTEXT);
+ALTER TABLE t1 MODIFY a MEDIUMTEXT, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TEXT);
+ALTER TABLE t1 MODIFY a TEXT, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a LONGTEXT);
+ALTER TABLE t1 MODIFY a LONGTEXT, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+#
+# ALTER from a non-binary to a binary collation
+#
+CREATE TABLE t1 (a CHAR(10));
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_bin, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a VARCHAR(10));
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_bin, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TINYTEXT);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a MEDIUMTEXT);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TEXT);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a LONGTEXT);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+#
+# ALTER from a binary to a non-binary collation
+#
+CREATE TABLE t1 (a CHAR(10) COLLATE latin1_bin);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a VARCHAR(10) COLLATE latin1_bin);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TINYTEXT COLLATE latin1_bin);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a MEDIUMTEXT COLLATE latin1_bin);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TEXT COLLATE latin1_bin);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a LONGTEXT COLLATE latin1_bin);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+#
+# ALTER from a non-binary collation to another non-binary collation
+#
+CREATE TABLE t1 (a CHAR(10) COLLATE latin1_general_ci);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a VARCHAR(10) COLLATE latin1_general_ci);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TINYTEXT COLLATE latin1_general_ci);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a MEDIUMTEXT COLLATE latin1_general_ci);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TEXT COLLATE latin1_general_ci);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a LONGTEXT COLLATE latin1_general_ci);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+# End of 10.0 tests
+
+#
+# MDEV-11335 Changing delay_key_write option for MyISAM table should not copy rows
+#
+select @@global.delay_key_write;
+create table t1 (a int, b int, key(b));
+flush tables;
+flush status;
+show status like 'Feature_delay_key_write';
+insert t1 values (1,2),(2,3),(3,4);
+show status like 'Feature_delay_key_write';
+alter online table t1 delay_key_write=1;
+show status like 'Feature_delay_key_write';
+flush tables;
+insert t1 values (1,2),(2,3),(3,4);
+show status like 'Feature_delay_key_write';
+alter online table t1 delay_key_write=0;
+show status like 'Feature_delay_key_write';
+flush tables;
+insert t1 values (1,2),(2,3),(3,4);
+show status like 'Feature_delay_key_write';
+drop table t1;
+
+# End of 10.1 tests
diff --git a/mysql-test/main/alter_table_locknone_notembedded.result b/mysql-test/main/alter_table_locknone_notembedded.result
new file mode 100644
index 00000000..a3cbac0d
--- /dev/null
+++ b/mysql-test/main/alter_table_locknone_notembedded.result
@@ -0,0 +1,25 @@
+create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b')) engine=aria;
+insert into t1 (a) values (1),(2),(3);
+alter online table t1 page_checksum=1;
+alter online table t1 page_checksum=0;
+alter online table t1 drop column b, add b int;
+alter online table t1 modify b bigint;
+alter online table t1 modify e enum('c','a','b');
+alter online table t1 modify c varchar(50);
+alter online table t1 modify c varchar(100);
+alter online table t1 add f int;
+alter online table t1 engine=memory;
+alter online table t1 checksum=1;
+alter online table t1 add constraint check (b > 0);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `c` varchar(100) DEFAULT NULL,
+ `e` enum('c','a','b') DEFAULT NULL,
+ `b` bigint(20) DEFAULT NULL,
+ `f` int(11) DEFAULT NULL,
+ PRIMARY KEY (`a`),
+ CONSTRAINT `CONSTRAINT_1` CHECK (`b` > 0)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci CHECKSUM=1
+drop table t1;
diff --git a/mysql-test/main/alter_table_locknone_notembedded.test b/mysql-test/main/alter_table_locknone_notembedded.test
new file mode 100644
index 00000000..00649740
--- /dev/null
+++ b/mysql-test/main/alter_table_locknone_notembedded.test
@@ -0,0 +1,22 @@
+source include/not_embedded.inc;
+#
+# Test of ALTER ONLINE TABLE syntax
+# (same as LOCK=NONE)
+#
+
+create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b')) engine=aria;
+insert into t1 (a) values (1),(2),(3);
+alter online table t1 page_checksum=1;
+alter online table t1 page_checksum=0;
+alter online table t1 drop column b, add b int;
+alter online table t1 modify b bigint;
+alter online table t1 modify e enum('c','a','b');
+alter online table t1 modify c varchar(50);
+alter online table t1 modify c varchar(100);
+alter online table t1 add f int;
+alter online table t1 engine=memory;
+alter online table t1 checksum=1;
+alter online table t1 add constraint check (b > 0);
+
+show create table t1;
+drop table t1;
diff --git a/mysql-test/main/alter_table_online.result b/mysql-test/main/alter_table_online.result
index 4d0e0f09..fb5f2abf 100644
--- a/mysql-test/main/alter_table_online.result
+++ b/mysql-test/main/alter_table_online.result
@@ -1,271 +1,263 @@
-create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b')) engine=myisam;
-insert into t1 (a) values (1),(2),(3);
-alter online table t1 modify b int default 5, alter c set default 'X';
-alter online table t1 change b new_name int;
-alter online table t1 modify e enum('a','b','c');
-alter online table t1 comment "new comment";
-alter table t1 add constraint q check (a > 0);
-alter online table t1 drop constraint q;
-alter online table t1 algorithm=INPLACE, lock=NONE;
-alter online table t1;
-alter table t1 algorithm=INPLACE;
-alter table t1 lock=NONE;
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `new_name` int(11) DEFAULT NULL,
- `c` varchar(80) DEFAULT 'X',
- `e` enum('a','b','c') DEFAULT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new comment'
-drop table t1;
-create temporary table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
-insert into t1 (a) values (1),(2),(3);
-alter online table t1 modify b int default 5, alter c set default 'X';
-alter online table t1 change b new_name int;
-alter online table t1 modify e enum('a','b','c');
-alter online table t1 comment "new comment";
-alter online table t1 rename to t2;
-show create table t2;
-Table Create Table
-t2 CREATE TEMPORARY TABLE `t2` (
- `a` int(11) NOT NULL,
- `new_name` int(11) DEFAULT NULL,
- `c` varchar(80) DEFAULT 'X',
- `e` enum('a','b','c') DEFAULT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new comment'
-drop table t2;
-create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b')) engine=aria;
-insert into t1 (a) values (1),(2),(3);
-alter online table t1 modify b int default 5;
-alter online table t1 change b new_name int;
-alter online table t1 modify e enum('a','b','c');
-alter online table t1 comment "new comment";
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
- `new_name` int(11) DEFAULT NULL,
- `c` varchar(80) DEFAULT NULL,
- `e` enum('a','b','c') DEFAULT NULL,
- PRIMARY KEY (`a`)
-) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1 COMMENT='new comment'
-alter online table t1 page_checksum=1;
-alter online table t1 page_checksum=0;
-ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
+#
+# alter ignore cannot be done online
+#
+create table t (a int);
+alter ignore table t add primary key (a), algorithm=copy, lock=none;
+ERROR 0A000: LOCK=NONE is not supported. Reason: ALTER IGNORE TABLE. Try LOCK=SHARED
+drop table t;
+#
+# MDEV-28771 Assertion `table->in_use&&tdc->flushed' failed after ALTER
+#
+create table t (a char(1));
+insert into t values ('a'),('b');
+select * from t join t as t2 join t as t3;
+a a a
+a a a
+b a a
+a b a
+b b a
+a a b
+b a b
+a b b
+b b b
+alter table t modify a int;
+ERROR 22007: Truncated incorrect INTEGER value: 'a'
+select * from t;
+a
+a
+b
+drop table t;
+create table t (c double precision key,c2 char,c3 year);
+insert into t values (7,3,1);
+select a from t where a=all (select a from t where b=2 union select a from t where b=2);
+ERROR 42S22: Unknown column 'a' in 'field list'
+insert into t values (3,1,1);
+alter table t change c c date,add key(c);
+ERROR 22007: Incorrect date value: '7' for column `test`.`t`.`c` at row 1
+select * from t;
+c c2 c3
+7 3 2001
+3 1 2001
+drop table t;
+set sql_mode='';
+create table t (c char unique,c2 int,stamp timestamp);
+insert into t values (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5);
+Warnings:
+Warning 1265 Data truncated for column 'stamp' at row 1
+Warning 1265 Data truncated for column 'stamp' at row 2
+Warning 1265 Data truncated for column 'stamp' at row 3
+Warning 1265 Data truncated for column 'stamp' at row 4
+Warning 1265 Data truncated for column 'stamp' at row 5
+update t set c=(select * from t) where c in (select * from t);
+ERROR 21000: Operand should contain 1 column(s)
+alter table t modify c date;
+ERROR 23000: Duplicate entry '0000-00-00' for key 'c'
+select * from t;
+c c2 stamp
+1 1 0000-00-00 00:00:00
+2 2 0000-00-00 00:00:00
+3 3 0000-00-00 00:00:00
+4 4 0000-00-00 00:00:00
+5 5 0000-00-00 00:00:00
+drop table t;
+set sql_mode=default;
+#
+# MDEV-28944 XA assertions failing in binlog_rollback and binlog_commit
+#
+CREATE TABLE t (a INT) ENGINE=MyISAM;
+INSERT INTO t VALUES (1);
+connect con1,localhost,root,,test;
+XA START 'xid';
+SELECT * FROM t;
+a
+1
+connection default;
+ALTER TABLE t NOWAIT ADD KEY (a);
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection con1;
+UPDATE t SET a = 2;
+XA END 'xid';
+XA COMMIT 'xid' ONE PHASE;
+DROP TABLE t;
+disconnect con1;
+connection default;
+#
+# MDEV-29068 Cascade foreign key updates do not apply in online alter
+#
+create table t1 (a int primary key) engine=InnoDB;
+insert into t1 values (1),(2),(3);
+create table t2 (b int, foreign key (b)
+references t1 (a)
+on update cascade) engine=InnoDB;
+insert into t2 values (1),(2),(3);
+alter table t2 add c int, algorithm=copy, lock=none;
+ERROR 0A000: LOCK=NONE is not supported. Reason: ON UPDATE CASCADE. Try LOCK=SHARED
+alter table t2 add c int, algorithm=inplace, lock=none;
+create or replace table t2 (b int, foreign key (b)
+references t1 (a)
+on delete set null) engine=InnoDB;
+alter table t2 add c int, algorithm=copy, lock=none;
+ERROR 0A000: LOCK=NONE is not supported. Reason: ON DELETE SET NULL. Try LOCK=SHARED
+alter table t2 add c int, algorithm=inplace, lock=none;
+create or replace table t2 (b int, foreign key (b)
+references t1 (a)
+on delete no action) engine=InnoDB;
+insert into t2 values (1),(2),(3);
+alter table t2 add c int, algorithm=copy, lock=none;
+create or replace table t2 (b int, foreign key (b)
+references t1 (a)
+on update restrict) engine=InnoDB;
+insert into t2 values (1),(2),(3);
+alter table t2 add c int, algorithm=copy, lock=none;
+drop table t2, t1;
+create table t1 (a int primary key, b int unique) engine=InnoDB;
+insert into t1 values (1, 1),(2, 2),(3, 3);
+create table t2 (a int references t1 (a),
+b int references t1 (b) on update cascade) engine=InnoDB;
+insert into t2 values (1, 1),(2, 2);
+alter table t2 add c int, algorithm=copy, lock=none;
+ERROR 0A000: LOCK=NONE is not supported. Reason: ON UPDATE CASCADE. Try LOCK=SHARED
+alter table t2 add c int, algorithm=copy;
+alter table t2 add d int, algorithm=inplace;
+drop table t2, t1;
+#
+# MDEV-30891 Assertion `!table->versioned(VERS_TRX_ID)' failed
+# in Write_rows_log_event::binlog_row_logging_function
+#
+set system_versioning_alter_history= keep;
+create table t1 (id int,
+row_start bigint unsigned generated always as row start,
+row_end bigint unsigned generated always as row end,
+period for system_time (row_start, row_end))
+engine=innodb with system versioning;
+alter table t1 add c int, algorithm=copy, lock=none;
+ERROR 0A000: LOCK=NONE is not supported. Reason: BIGINT GENERATED ALWAYS AS ROW_START. Try LOCK=SHARED
+alter table t1 add c int, algorithm=inplace;
+alter table t1 add d int, lock=none;
+set system_versioning_alter_history= default;
drop table t1;
-create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
-insert into t1 (a) values (1),(2),(3);
-alter online table t1 drop column b, add b int;
-ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
-alter online table t1 modify b bigint;
-ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
-alter online table t1 modify e enum('c','a','b');
-ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
-alter online table t1 modify c varchar(50);
-ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
-alter online table t1 modify c varchar(100);
-ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
-alter online table t1 add f int;
-ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
-alter online table t1 engine=memory;
-ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED
-alter online table t1 rename to t2;
-ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE
-alter online table t1 checksum=1;
-ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
-alter online table t1 add constraint check (b > 0);
-ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
-alter table t1 engine=innodb;
-alter table t1 add index (b);
-alter online table t1 add index c (c);
-alter online table t1 drop index b;
-alter online table t1 comment "new comment";
-show create table t1;
+#
+# MDEV-31058 ER_KEY_NOT_FOUND upon concurrent CHANGE column autoinc
+# and DML
+#
+create table t (a serial, b int) engine=innodb;
+alter table t drop a, modify b serial, algorithm=copy, lock=none;
+ERROR 0A000: LOCK=NONE is not supported. Reason: CHANGE COLUMN ... AUTO_INCREMENT. Try LOCK=SHARED
+set statement sql_mode= NO_AUTO_VALUE_ON_ZERO for
+alter table t drop a, modify b serial, algorithm=copy, lock=none;
+create or replace table t (a serial, b int) engine=innodb;
+show create table t;
Table Create Table
-t1 CREATE TABLE `t1` (
- `a` int(11) NOT NULL,
+t CREATE TABLE `t` (
+ `a` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`b` int(11) DEFAULT NULL,
- `c` varchar(80) DEFAULT NULL,
- `e` enum('a','b') DEFAULT NULL,
- PRIMARY KEY (`a`),
- KEY `c` (`c`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci COMMENT='new comment'
-drop table t1;
-create temporary table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
-insert into t1 (a) values (1),(2),(3);
-alter online table t1 drop column b, add b int;
-alter online table t1 modify b bigint;
-alter online table t1 modify e enum('c','a','b');
-alter online table t1 modify c varchar(50);
-alter online table t1 modify c varchar(100);
-alter online table t1 add f int;
-alter online table t1 engine=memory;
-alter table t1 engine=innodb;
-alter table t1 add index (b);
-alter online table t1 add index c (c);
-alter online table t1 drop index b;
-drop table t1;
-create table t1 (a int not null primary key, b int, c varchar(80));
-create table t2 (a int not null primary key, b int, c varchar(80));
-create table t3 (a int not null primary key, b int, c varchar(80)) engine=merge UNION=(t1);
-alter online table t3 union=(t1,t2);
-ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=EXCLUSIVE
-drop table t1,t2,t3;
-create table t1 (i int) partition by hash(i) partitions 2;
-alter online table t1 comment 'test';
-drop table t1;
-create table t1 (a int);
-alter online table t1 modify a int comment 'test';
-drop table t1;
-create table t1 (a int) engine=innodb;
-alter online table t1 modify a int comment 'test';
-drop table t1;
-create table t1 (a int) partition by hash(a) partitions 2;
-alter online table t1 modify a int comment 'test';
-drop table t1;
+ UNIQUE KEY `a` (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+# a is unique in the old table, but is shrunk in the new one.
+# Only unsafe approach is fine because of possible collisions.
+alter table t modify a int, modify b serial, algorithm=copy, lock=none;
+ERROR 0A000: LOCK=NONE is not supported. Reason: CHANGE COLUMN ... AUTO_INCREMENT. Try LOCK=SHARED
#
-# MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB
+# Check that we treat autoinc columns correctly modify old autoinc is
+# fine, adding new autoinc for existed column is unsafe.
#
-CREATE TABLE t1 (a BINARY(10));
-ALTER TABLE t1 MODIFY a BINARY(10), ALGORITHM=INPLACE;
-DROP TABLE t1;
-CREATE TABLE t1 (a VARBINARY(10));
-ALTER TABLE t1 MODIFY a VARBINARY(10), ALGORITHM=INPLACE;
-DROP TABLE t1;
-CREATE TABLE t1 (a TINYBLOB);
-ALTER TABLE t1 MODIFY a TINYBLOB, ALGORITHM=INPLACE;
-DROP TABLE t1;
-CREATE TABLE t1 (a MEDIUMBLOB);
-ALTER TABLE t1 MODIFY a MEDIUMBLOB, ALGORITHM=INPLACE;
-DROP TABLE t1;
-CREATE TABLE t1 (a BLOB);
-ALTER TABLE t1 MODIFY a BLOB, ALGORITHM=INPLACE;
-DROP TABLE t1;
-CREATE TABLE t1 (a LONGBLOB);
-ALTER TABLE t1 MODIFY a LONGBLOB, ALGORITHM=INPLACE;
-DROP TABLE t1;
-CREATE TABLE t1 (a CHAR(10));
-ALTER TABLE t1 MODIFY a CHAR(10), ALGORITHM=INPLACE;
-DROP TABLE t1;
-CREATE TABLE t1 (a VARCHAR(10));
-ALTER TABLE t1 MODIFY a VARCHAR(10), ALGORITHM=INPLACE;
-DROP TABLE t1;
-CREATE TABLE t1 (a TINYTEXT);
-ALTER TABLE t1 MODIFY a TINYTEXT, ALGORITHM=INPLACE;
-DROP TABLE t1;
-CREATE TABLE t1 (a MEDIUMTEXT);
-ALTER TABLE t1 MODIFY a MEDIUMTEXT, ALGORITHM=INPLACE;
-DROP TABLE t1;
-CREATE TABLE t1 (a TEXT);
-ALTER TABLE t1 MODIFY a TEXT, ALGORITHM=INPLACE;
-DROP TABLE t1;
-CREATE TABLE t1 (a LONGTEXT);
-ALTER TABLE t1 MODIFY a LONGTEXT, ALGORITHM=INPLACE;
-DROP TABLE t1;
-CREATE TABLE t1 (a CHAR(10));
-ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_bin, ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
-DROP TABLE t1;
-CREATE TABLE t1 (a VARCHAR(10));
-ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_bin, ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
-DROP TABLE t1;
-CREATE TABLE t1 (a TINYTEXT);
-ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
-DROP TABLE t1;
-CREATE TABLE t1 (a MEDIUMTEXT);
-ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
-DROP TABLE t1;
-CREATE TABLE t1 (a TEXT);
-ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
-DROP TABLE t1;
-CREATE TABLE t1 (a LONGTEXT);
-ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
-DROP TABLE t1;
-CREATE TABLE t1 (a CHAR(10) COLLATE latin1_bin);
-ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
-DROP TABLE t1;
-CREATE TABLE t1 (a VARCHAR(10) COLLATE latin1_bin);
-ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
-DROP TABLE t1;
-CREATE TABLE t1 (a TINYTEXT COLLATE latin1_bin);
-ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
-DROP TABLE t1;
-CREATE TABLE t1 (a MEDIUMTEXT COLLATE latin1_bin);
-ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
-DROP TABLE t1;
-CREATE TABLE t1 (a TEXT COLLATE latin1_bin);
-ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
-DROP TABLE t1;
-CREATE TABLE t1 (a LONGTEXT COLLATE latin1_bin);
-ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
-DROP TABLE t1;
-CREATE TABLE t1 (a CHAR(10) COLLATE latin1_general_ci);
-ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
-DROP TABLE t1;
-CREATE TABLE t1 (a VARCHAR(10) COLLATE latin1_general_ci);
-ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
-DROP TABLE t1;
-CREATE TABLE t1 (a TINYTEXT COLLATE latin1_general_ci);
-ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
-DROP TABLE t1;
-CREATE TABLE t1 (a MEDIUMTEXT COLLATE latin1_general_ci);
-ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
-DROP TABLE t1;
-CREATE TABLE t1 (a TEXT COLLATE latin1_general_ci);
-ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
-ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
-DROP TABLE t1;
-CREATE TABLE t1 (a LONGTEXT COLLATE latin1_general_ci);
-ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+create or replace table t (a serial) engine=innodb;
+alter table t change a b serial, algorithm=copy, lock=none;
+Warnings:
+Note 1831 Duplicate index `b`. This is deprecated and will be disallowed in a future release
+# Shrinking the autoinc field is considered safe.
+# ER_WARN_DATA_OUT_OF_RANGE should be emitted otherwise.
+alter table t change b b int auto_increment primary key,
+algorithm=copy, lock=none;
+alter table t add c int default(0), drop primary key, drop key a;
+# key `b` is still there
+show create table t;
+Table Create Table
+t CREATE TABLE `t` (
+ `b` int(11) NOT NULL AUTO_INCREMENT,
+ `c` int(11) DEFAULT 0,
+ UNIQUE KEY `b` (`b`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+alter table t drop b, change c c serial, algorithm=copy, lock=none;
+ERROR 0A000: LOCK=NONE is not supported. Reason: CHANGE COLUMN ... AUTO_INCREMENT. Try LOCK=SHARED
+# Check existed unique keys.
+create or replace table t(a int, b int not null, c int not null, d int);
+# No unique in the old table;
+alter table t add unique(b, c), modify d int auto_increment, add key(d),
+algorithm=copy, lock=none;
+ERROR 0A000: LOCK=NONE is not supported. Reason: CHANGE COLUMN ... AUTO_INCREMENT. Try LOCK=SHARED
+alter table t add unique(a, b);
+# Unique in the old table has nulls;
+alter table t modify d int auto_increment, add key(d),
+algorithm=copy, lock=none;
+ERROR 0A000: LOCK=NONE is not supported. Reason: CHANGE COLUMN ... AUTO_INCREMENT. Try LOCK=SHARED
+alter table t add unique(b, c);
+# Change unique's column;
+alter table t change b x bigint, modify d int auto_increment, add key(d),
+algorithm=copy, lock=none;
+ERROR 0A000: LOCK=NONE is not supported. Reason: CHANGE COLUMN ... AUTO_INCREMENT. Try LOCK=SHARED
+# Finally good. Simple renames with a type unchanged will not affect
+# the result. Also NOT NULL -> NULL transform is fine.
+alter table t modify d int auto_increment, add key(d),
+change b x int null,
+algorithm=copy, lock=none;
+drop table t;
+# MDEV-31172 Server crash or ASAN errors in online_alter_check_autoinc
+create table t (a int, b int, c char(8), key(a,b,c));
+alter table t modify c int auto_increment key, algorithm=copy;
+drop table t;
+# MDEV-31601 Some ALTER TABLE .. fail when they worked before, and with
+# a wrong error message
+create table t (a int) engine=aria;
+insert into t values (1),(2);
+alter table t algorithm=nocopy, order by a;
+ERROR 0A000: ALGORITHM=NOCOPY is not supported for this operation. Try ALGORITHM=COPY
+alter table t engine=myisam, algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
-DROP TABLE t1;
-select @@global.delay_key_write;
-@@global.delay_key_write
-ON
-create table t1 (a int, b int, key(b));
-flush tables;
-flush status;
-show status like 'Feature_delay_key_write';
-Variable_name Value
-Feature_delay_key_write 0
-insert t1 values (1,2),(2,3),(3,4);
-show status like 'Feature_delay_key_write';
-Variable_name Value
-Feature_delay_key_write 0
-alter online table t1 delay_key_write=1;
-show status like 'Feature_delay_key_write';
-Variable_name Value
-Feature_delay_key_write 0
-flush tables;
-insert t1 values (1,2),(2,3),(3,4);
-show status like 'Feature_delay_key_write';
-Variable_name Value
-Feature_delay_key_write 1
-alter online table t1 delay_key_write=0;
-show status like 'Feature_delay_key_write';
-Variable_name Value
-Feature_delay_key_write 1
-flush tables;
-insert t1 values (1,2),(2,3),(3,4);
-show status like 'Feature_delay_key_write';
-Variable_name Value
-Feature_delay_key_write 1
+drop table t;
+create temporary table t (f int);
+alter table t force, algorithm=instant;
+ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=COPY
+drop table t;
+create sequence s engine=MyISAM;
+alter table s engine=Aria, lock=none;
+ERROR 0A000: LOCK=NONE is not supported. Reason: SEQUENCE. Try LOCK=SHARED
+alter table s engine=Aria;
+drop sequence s;
+# MDEV-31631 Adding auto-increment column to a table with history online
+# behaves differently from non-online
+create sequence s;
+create table t1(a int, x int NULL default(nextval(s)));
+alter table t1 add b int default (nextval(s)), lock=none;
+ERROR 0A000: LOCK=NONE is not supported. Reason: Function or expression 'NEXTVAL()' cannot be used in the DEFAULT clause of `b`. Try LOCK=SHARED
+alter table t1 add b int primary key auto_increment, lock=none;
+ERROR 0A000: LOCK=NONE is not supported. Reason: ADD COLUMN ... AUTO_INCREMENT. Try LOCK=SHARED
+create table t2(a int, b int NULL default(nextval(s)));
+alter table t2 modify b int not null default (nextval(s)), lock=none;
+ERROR 0A000: LOCK=NONE is not supported. Reason: Function or expression 'NEXTVAL()' cannot be used in the DEFAULT clause of `b`. Try LOCK=SHARED
+drop table t2;
+drop table t1;
+drop sequence s;
+#
+# MDEV-33348 ALTER TABLE lock waiting stages are indistinguishable
+#
+connect con2, localhost, root;
+create table t1 (a int);
+insert t1 values (5);
+start transaction;
+select * from t1;
+a
+5
+connection default;
+alter table t1 add b int NULL, algorithm= copy, lock= none;
+connection con2;
+set @con= $con;
+select stage, state, info from information_schema.processlist where id = @con;
+stage 4
+state Waiting for table metadata lock
+info alter table t1 add b int NULL, algorithm= copy, lock= none
+rollback;
+connection default;
drop table t1;
+disconnect con2;
+# End of 11.2 tests
diff --git a/mysql-test/main/alter_table_online.test b/mysql-test/main/alter_table_online.test
index 6ef9661c..4d8f8311 100644
--- a/mysql-test/main/alter_table_online.test
+++ b/mysql-test/main/alter_table_online.test
@@ -1,335 +1,285 @@
-#
-# Test of ALTER ONLINE TABLE syntax
-#
-
+--source include/binlog_combinations.inc
--source include/have_innodb.inc
---source include/have_partition.inc
-#
-# Test of things that can be done online
-#
-
-create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b')) engine=myisam;
-insert into t1 (a) values (1),(2),(3);
-
-alter online table t1 modify b int default 5, alter c set default 'X';
-alter online table t1 change b new_name int;
-alter online table t1 modify e enum('a','b','c');
-alter online table t1 comment "new comment";
-alter table t1 add constraint q check (a > 0);
-alter online table t1 drop constraint q;
-
-# No OPs
-
-alter online table t1 algorithm=INPLACE, lock=NONE;
-alter online table t1;
-alter table t1 algorithm=INPLACE;
-alter table t1 lock=NONE;
-show create table t1;
-drop table t1;
+--source include/not_embedded.inc
-#
-# everything with temporary tables is "online", i.e. without locks
-#
-create temporary table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
-insert into t1 (a) values (1),(2),(3);
-
-alter online table t1 modify b int default 5, alter c set default 'X';
-alter online table t1 change b new_name int;
-alter online table t1 modify e enum('a','b','c');
-alter online table t1 comment "new comment";
-alter online table t1 rename to t2;
-show create table t2;
-drop table t2;
+--echo #
+--echo # alter ignore cannot be done online
+--echo #
+create table t (a int);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter ignore table t add primary key (a), algorithm=copy, lock=none;
+drop table t;
-#
-# Test also with Aria
-#
-
-create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b')) engine=aria;
-insert into t1 (a) values (1),(2),(3);
-alter online table t1 modify b int default 5;
-alter online table t1 change b new_name int;
-alter online table t1 modify e enum('a','b','c');
-alter online table t1 comment "new comment";
-show create table t1;
-alter online table t1 page_checksum=1;
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-alter online table t1 page_checksum=0;
-drop table t1;
+--echo #
+--echo # MDEV-28771 Assertion `table->in_use&&tdc->flushed' failed after ALTER
+--echo #
-#
-# Test of things that is not possible to do online
-#
+create table t (a char(1));
+insert into t values ('a'),('b');
+select * from t join t as t2 join t as t3;
+--error ER_TRUNCATED_WRONG_VALUE
+alter table t modify a int;
+select * from t;
+drop table t;
+
+create table t (c double precision key,c2 char,c3 year);
+insert into t values (7,3,1);
+--error ER_BAD_FIELD_ERROR
+select a from t where a=all (select a from t where b=2 union select a from t where b=2);
+insert into t values (3,1,1);
+--error ER_TRUNCATED_WRONG_VALUE
+alter table t change c c date,add key(c);
+select * from t;
+drop table t;
+
+set sql_mode='';
+create table t (c char unique,c2 int,stamp timestamp);
+insert into t values (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5);
+--error ER_OPERAND_COLUMNS
+update t set c=(select * from t) where c in (select * from t);
+--error ER_DUP_ENTRY
+alter table t modify c date;
+select * from t;
+drop table t;
+set sql_mode=default;
-create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
-insert into t1 (a) values (1),(2),(3);
+--echo #
+--echo # MDEV-28944 XA assertions failing in binlog_rollback and binlog_commit
+--echo #
+--disable_view_protocol
+CREATE TABLE t (a INT) ENGINE=MyISAM;
+INSERT INTO t VALUES (1);
+
+--connect (con1,localhost,root,,test)
+XA START 'xid';
+SELECT * FROM t;
+
+--connection default
+--error ER_LOCK_WAIT_TIMEOUT
+ALTER TABLE t NOWAIT ADD KEY (a);
+
+--connection con1
+UPDATE t SET a = 2;
+XA END 'xid';
+XA COMMIT 'xid' ONE PHASE;
+
+DROP TABLE t;
+--disconnect con1
+--connection default
+--enable_view_protocol
+
+--echo #
+--echo # MDEV-29068 Cascade foreign key updates do not apply in online alter
+--echo #
+create table t1 (a int primary key) engine=InnoDB;
+insert into t1 values (1),(2),(3);
+create table t2 (b int, foreign key (b)
+ references t1 (a)
+ on update cascade) engine=InnoDB;
+insert into t2 values (1),(2),(3);
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-alter online table t1 drop column b, add b int;
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-alter online table t1 modify b bigint;
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-alter online table t1 modify e enum('c','a','b');
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-alter online table t1 modify c varchar(50);
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-alter online table t1 modify c varchar(100);
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-alter online table t1 add f int;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-alter online table t1 engine=memory;
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-alter online table t1 rename to t2;
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-alter online table t1 checksum=1;
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-alter online table t1 add constraint check (b > 0);
-
-alter table t1 engine=innodb;
-alter table t1 add index (b);
-alter online table t1 add index c (c);
-alter online table t1 drop index b;
-alter online table t1 comment "new comment";
-show create table t1;
-drop table t1;
+alter table t2 add c int, algorithm=copy, lock=none;
+alter table t2 add c int, algorithm=inplace, lock=none;
-create temporary table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
-insert into t1 (a) values (1),(2),(3);
-
-#
-# everything with temporary tables is "online", i.e. without locks
-#
-alter online table t1 drop column b, add b int;
-alter online table t1 modify b bigint;
-alter online table t1 modify e enum('c','a','b');
-alter online table t1 modify c varchar(50);
-alter online table t1 modify c varchar(100);
-alter online table t1 add f int;
-alter online table t1 engine=memory;
-
-alter table t1 engine=innodb;
-alter table t1 add index (b);
-alter online table t1 add index c (c);
-alter online table t1 drop index b;
-drop table t1;
+create or replace table t2 (b int, foreign key (b)
+ references t1 (a)
+ on delete set null) engine=InnoDB;
-#
-# Test merge tables
-#
-create table t1 (a int not null primary key, b int, c varchar(80));
-create table t2 (a int not null primary key, b int, c varchar(80));
-create table t3 (a int not null primary key, b int, c varchar(80)) engine=merge UNION=(t1);
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-alter online table t3 union=(t1,t2);
-drop table t1,t2,t3;
-
-#
-# MDEV-9868 Altering a partitioned table comment does a full copy
-#
-create table t1 (i int) partition by hash(i) partitions 2;
-alter online table t1 comment 'test';
-drop table t1;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table t2 add c int, algorithm=copy, lock=none;
+alter table t2 add c int, algorithm=inplace, lock=none;
-#
-# MDEV-9168 altering a column comment does a full copy
-#
-create table t1 (a int);
-alter online table t1 modify a int comment 'test';
-drop table t1;
+create or replace table t2 (b int, foreign key (b)
+ references t1 (a)
+ on delete no action) engine=InnoDB;
-create table t1 (a int) engine=innodb;
-alter online table t1 modify a int comment 'test';
-drop table t1;
+insert into t2 values (1),(2),(3);
+alter table t2 add c int, algorithm=copy, lock=none;
+
+create or replace table t2 (b int, foreign key (b)
+ references t1 (a)
+ on update restrict) engine=InnoDB;
+
+insert into t2 values (1),(2),(3);
+alter table t2 add c int, algorithm=copy, lock=none;
+drop table t2, t1;
+
+create table t1 (a int primary key, b int unique) engine=InnoDB;
+insert into t1 values (1, 1),(2, 2),(3, 3);
+create table t2 (a int references t1 (a),
+ b int references t1 (b) on update cascade) engine=InnoDB;
+insert into t2 values (1, 1),(2, 2);
+
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table t2 add c int, algorithm=copy, lock=none;
+alter table t2 add c int, algorithm=copy;
+alter table t2 add d int, algorithm=inplace;
+# Cleanup
+drop table t2, t1;
+
+--echo #
+--echo # MDEV-30891 Assertion `!table->versioned(VERS_TRX_ID)' failed
+--echo # in Write_rows_log_event::binlog_row_logging_function
+--echo #
+set system_versioning_alter_history= keep;
+create table t1 (id int,
+ row_start bigint unsigned generated always as row start,
+ row_end bigint unsigned generated always as row end,
+ period for system_time (row_start, row_end))
+ engine=innodb with system versioning;
+
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table t1 add c int, algorithm=copy, lock=none;
+alter table t1 add c int, algorithm=inplace;
+alter table t1 add d int, lock=none;
-create table t1 (a int) partition by hash(a) partitions 2;
-alter online table t1 modify a int comment 'test';
+set system_versioning_alter_history= default;
drop table t1;
--echo #
---echo # MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB
+--echo # MDEV-31058 ER_KEY_NOT_FOUND upon concurrent CHANGE column autoinc
+--echo # and DML
--echo #
-#
-# ALTER to the same [VAR]BINARY type
-#
-CREATE TABLE t1 (a BINARY(10));
-ALTER TABLE t1 MODIFY a BINARY(10), ALGORITHM=INPLACE;
-DROP TABLE t1;
-
-CREATE TABLE t1 (a VARBINARY(10));
-ALTER TABLE t1 MODIFY a VARBINARY(10), ALGORITHM=INPLACE;
-DROP TABLE t1;
-
-#
-# ALTER to the same BLOB variant
-#
-CREATE TABLE t1 (a TINYBLOB);
-ALTER TABLE t1 MODIFY a TINYBLOB, ALGORITHM=INPLACE;
-DROP TABLE t1;
-
-CREATE TABLE t1 (a MEDIUMBLOB);
-ALTER TABLE t1 MODIFY a MEDIUMBLOB, ALGORITHM=INPLACE;
-DROP TABLE t1;
-
-CREATE TABLE t1 (a BLOB);
-ALTER TABLE t1 MODIFY a BLOB, ALGORITHM=INPLACE;
-DROP TABLE t1;
-
-CREATE TABLE t1 (a LONGBLOB);
-ALTER TABLE t1 MODIFY a LONGBLOB, ALGORITHM=INPLACE;
-DROP TABLE t1;
-
-#
-# ALTER to the same [VAR]CHAR type
-#
-CREATE TABLE t1 (a CHAR(10));
-ALTER TABLE t1 MODIFY a CHAR(10), ALGORITHM=INPLACE;
-DROP TABLE t1;
-
-CREATE TABLE t1 (a VARCHAR(10));
-ALTER TABLE t1 MODIFY a VARCHAR(10), ALGORITHM=INPLACE;
-DROP TABLE t1;
-
-
-#
-# ALTER to the same TEXT variant
-#
-CREATE TABLE t1 (a TINYTEXT);
-ALTER TABLE t1 MODIFY a TINYTEXT, ALGORITHM=INPLACE;
-DROP TABLE t1;
-
-CREATE TABLE t1 (a MEDIUMTEXT);
-ALTER TABLE t1 MODIFY a MEDIUMTEXT, ALGORITHM=INPLACE;
-DROP TABLE t1;
-
-CREATE TABLE t1 (a TEXT);
-ALTER TABLE t1 MODIFY a TEXT, ALGORITHM=INPLACE;
-DROP TABLE t1;
-
-CREATE TABLE t1 (a LONGTEXT);
-ALTER TABLE t1 MODIFY a LONGTEXT, ALGORITHM=INPLACE;
-DROP TABLE t1;
-
-#
-# ALTER from a non-binary to a binary collation
-#
-CREATE TABLE t1 (a CHAR(10));
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_bin, ALGORITHM=INPLACE;
-DROP TABLE t1;
+create table t (a serial, b int) engine=innodb;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table t drop a, modify b serial, algorithm=copy, lock=none;
-CREATE TABLE t1 (a VARCHAR(10));
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_bin, ALGORITHM=INPLACE;
-DROP TABLE t1;
+set statement sql_mode= NO_AUTO_VALUE_ON_ZERO for
+alter table t drop a, modify b serial, algorithm=copy, lock=none;
-CREATE TABLE t1 (a TINYTEXT);
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
-DROP TABLE t1;
+create or replace table t (a serial, b int) engine=innodb;
+show create table t;
+--echo # a is unique in the old table, but is shrunk in the new one.
+--echo # Only unsafe approach is fine because of possible collisions.
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table t modify a int, modify b serial, algorithm=copy, lock=none;
-CREATE TABLE t1 (a MEDIUMTEXT);
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
-DROP TABLE t1;
+--echo #
+--echo # Check that we treat autoinc columns correctly modify old autoinc is
+--echo # fine, adding new autoinc for existed column is unsafe.
+--echo #
+create or replace table t (a serial) engine=innodb;
-CREATE TABLE t1 (a TEXT);
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
-DROP TABLE t1;
+alter table t change a b serial, algorithm=copy, lock=none;
-CREATE TABLE t1 (a LONGTEXT);
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
-DROP TABLE t1;
+--echo # Shrinking the autoinc field is considered safe.
+--echo # ER_WARN_DATA_OUT_OF_RANGE should be emitted otherwise.
+alter table t change b b int auto_increment primary key,
+ algorithm=copy, lock=none;
-#
-# ALTER from a binary to a non-binary collation
-#
-CREATE TABLE t1 (a CHAR(10) COLLATE latin1_bin);
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
-DROP TABLE t1;
+alter table t add c int default(0), drop primary key, drop key a;
+--echo # key `b` is still there
+show create table t;
-CREATE TABLE t1 (a VARCHAR(10) COLLATE latin1_bin);
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
-DROP TABLE t1;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table t drop b, change c c serial, algorithm=copy, lock=none;
-CREATE TABLE t1 (a TINYTEXT COLLATE latin1_bin);
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
-DROP TABLE t1;
+--echo # Check existed unique keys.
+create or replace table t(a int, b int not null, c int not null, d int);
-CREATE TABLE t1 (a MEDIUMTEXT COLLATE latin1_bin);
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
-DROP TABLE t1;
+--echo # No unique in the old table;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table t add unique(b, c), modify d int auto_increment, add key(d),
+ algorithm=copy, lock=none;
-CREATE TABLE t1 (a TEXT COLLATE latin1_bin);
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
-DROP TABLE t1;
+alter table t add unique(a, b);
+--echo # Unique in the old table has nulls;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table t modify d int auto_increment, add key(d),
+ algorithm=copy, lock=none;
-CREATE TABLE t1 (a LONGTEXT COLLATE latin1_bin);
+alter table t add unique(b, c);
+--echo # Change unique's column;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table t change b x bigint, modify d int auto_increment, add key(d),
+ algorithm=copy, lock=none;
+
+--echo # Finally good. Simple renames with a type unchanged will not affect
+--echo # the result. Also NOT NULL -> NULL transform is fine.
+alter table t modify d int auto_increment, add key(d),
+ change b x int null,
+ algorithm=copy, lock=none;
+
+drop table t;
+
+--echo # MDEV-31172 Server crash or ASAN errors in online_alter_check_autoinc
+create table t (a int, b int, c char(8), key(a,b,c));
+alter table t modify c int auto_increment key, algorithm=copy;
+drop table t;
+
+--echo # MDEV-31601 Some ALTER TABLE .. fail when they worked before, and with
+--echo # a wrong error message
+create table t (a int) engine=aria;
+insert into t values (1),(2);
--error ER_ALTER_OPERATION_NOT_SUPPORTED
-ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
-DROP TABLE t1;
-
-#
-# ALTER from a non-binary collation to another non-binary collation
-#
-CREATE TABLE t1 (a CHAR(10) COLLATE latin1_general_ci);
+alter table t algorithm=nocopy, order by a;
--error ER_ALTER_OPERATION_NOT_SUPPORTED
-ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
-DROP TABLE t1;
+alter table t engine=myisam, algorithm=inplace;
+drop table t;
-CREATE TABLE t1 (a VARCHAR(10) COLLATE latin1_general_ci);
+create temporary table t (f int);
--error ER_ALTER_OPERATION_NOT_SUPPORTED
-ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
-DROP TABLE t1;
+alter table t force, algorithm=instant;
+drop table t;
-CREATE TABLE t1 (a TINYTEXT COLLATE latin1_general_ci);
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
-DROP TABLE t1;
+create sequence s engine=MyISAM;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table s engine=Aria, lock=none;
+alter table s engine=Aria;
+drop sequence s;
-CREATE TABLE t1 (a MEDIUMTEXT COLLATE latin1_general_ci);
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
-DROP TABLE t1;
-CREATE TABLE t1 (a TEXT COLLATE latin1_general_ci);
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
-DROP TABLE t1;
+--echo # MDEV-31631 Adding auto-increment column to a table with history online
+--echo # behaves differently from non-online
+create sequence s;
+create table t1(a int, x int NULL default(nextval(s)));
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table t1 add b int default (nextval(s)), lock=none;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table t1 add b int primary key auto_increment, lock=none;
+
+create table t2(a int, b int NULL default(nextval(s)));
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table t2 modify b int not null default (nextval(s)), lock=none;
+
+drop table t2;
+drop table t1;
+drop sequence s;
+
+--echo #
+--echo # MDEV-33348 ALTER TABLE lock waiting stages are indistinguishable
+--echo #
+--disable_view_protocol
+--connect con2, localhost, root
+
+create table t1 (a int);
+insert t1 values (5);
+
+start transaction;
+select * from t1;
+
+--connection default
+--let $con= `select connection_id()`
+send alter table t1 add b int NULL, algorithm= copy, lock= none;
+
+--connection con2
+evalp set @con= $con;
+
+let $wait_condition= select stage = 4 and progress = 100
+ and state= "Waiting for table metadata lock"
+ from information_schema.processlist where id = @con;
+--source include/wait_condition.inc
+
+query_vertical select stage, state, info from information_schema.processlist where id = @con;
+
+rollback;
+
+--connection default
+reap;
-CREATE TABLE t1 (a LONGTEXT COLLATE latin1_general_ci);
---error ER_ALTER_OPERATION_NOT_SUPPORTED
-ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
-DROP TABLE t1;
-
-# End of 10.0 tests
-
-#
-# MDEV-11335 Changing delay_key_write option for MyISAM table should not copy rows
-#
-select @@global.delay_key_write;
-create table t1 (a int, b int, key(b));
-flush tables;
-flush status;
-show status like 'Feature_delay_key_write';
-insert t1 values (1,2),(2,3),(3,4);
-show status like 'Feature_delay_key_write';
-alter online table t1 delay_key_write=1;
-show status like 'Feature_delay_key_write';
-flush tables;
-insert t1 values (1,2),(2,3),(3,4);
-show status like 'Feature_delay_key_write';
-alter online table t1 delay_key_write=0;
-show status like 'Feature_delay_key_write';
-flush tables;
-insert t1 values (1,2),(2,3),(3,4);
-show status like 'Feature_delay_key_write';
drop table t1;
+--disconnect con2
+--enable_view_protocol
-# End of 10.1 tests
+--echo # End of 11.2 tests
diff --git a/mysql-test/main/alter_table_online_debug.result b/mysql-test/main/alter_table_online_debug.result
new file mode 100644
index 00000000..37fadcd8
--- /dev/null
+++ b/mysql-test/main/alter_table_online_debug.result
@@ -0,0 +1,1837 @@
+set global default_storage_engine= innodb;
+set default_storage_engine= innodb;
+connect con2, localhost, root,,;
+connection default;
+#
+# Test insert
+#
+# Insert and add column
+create or replace table t1 (a int);
+insert t1 values (5);
+connection con2;
+set debug_sync= 'now WAIT_FOR ended';
+connection default;
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+alter table t1 add b int NULL, algorithm= copy, lock= none;
+connection con2;
+insert into t1 values (123), (456), (789);
+set debug_sync= 'now SIGNAL end';
+connection default;
+affected rows: 4
+info: Records: 4 Duplicates: 0 Warnings: 0
+select * from t1;
+a b
+5 NULL
+123 NULL
+456 NULL
+789 NULL
+# Insert, error
+create or replace table t1 (a int);
+insert t1 values (5), (5);
+connection con2;
+set debug_sync= 'now WAIT_FOR ended';
+connection default;
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+alter table t1 nowait add unique (a), algorithm= copy, lock= none;
+connection con2;
+start transaction;
+insert into t1 values (123), (456), (789);
+set debug_sync= 'now SIGNAL end';
+connection default;
+ERROR 23000: Duplicate entry '5' for key 'a'
+connection con2;
+commit;
+connection default;
+select variable_value into @otd from information_schema.session_status where variable_name='Opened_table_definitions';
+select * from t1;
+a
+5
+5
+123
+456
+789
+select variable_value-@otd from information_schema.session_status where variable_name='Opened_table_definitions';
+variable_value-@otd
+1
+# long transaction and add column
+create or replace table t1 (a int);
+insert t1 values (5);
+connection con2;
+set debug_sync= 'now WAIT_FOR ended';
+connection default;
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+alter table t1 nowait add b int NULL, algorithm= copy, lock= none;
+connection con2;
+start transaction;
+insert into t1 values (123), (456), (789);
+set debug_sync= 'now SIGNAL end';
+connection default;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+select * from t1;
+a
+5
+connection con2;
+rollback;
+connection default;
+# Insert and add NOT NULL column without default value
+create or replace table t1 (a int);
+insert t1 values (5);
+connection con2;
+set debug_sync= 'now WAIT_FOR ended';
+connection default;
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+alter table t1 add b int NOT NULL, algorithm= copy, lock= none;
+connection con2;
+insert into t1 values (123), (456), (789);
+set debug_sync= 'now SIGNAL end';
+connection default;
+select * from t1;
+a b
+5 0
+123 0
+456 0
+789 0
+# Insert and add a column with a default value
+create or replace table t1 (a int);
+insert t1 values (5);
+connection con2;
+set debug_sync= 'now WAIT_FOR ended';
+connection default;
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+alter table t1 add b int NOT NULL default (222), algorithm= copy, lock= none;
+connection con2;
+insert into t1 values (123), (456), (789);
+set debug_sync= 'now SIGNAL end';
+connection default;
+select * from t1;
+a b
+5 222
+123 222
+456 222
+789 222
+#
+# Test update
+#
+# Update and add a column
+create or replace table t1 (a int primary key, b int);
+insert t1 values (1, 22);
+insert t1 values (3, 44);
+connection con2;
+set debug_sync= 'now WAIT_FOR ended';
+connection default;
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+alter table t1 add c int default(1),
+algorithm= copy, lock= none;
+connection con2;
+update t1 set b= 55 where a = 1;
+set debug_sync= 'now SIGNAL end';
+connection default;
+affected rows: 2
+info: Records: 2 Duplicates: 0 Warnings: 0
+select * from t1;
+a b c
+1 55 1
+3 44 1
+# Update and add a column in the middle
+create or replace table t1 (a int primary key, b int);
+insert t1 values (1, 22);
+insert t1 values (3, 44);
+connection con2;
+set debug_sync= 'now WAIT_FOR ended';
+connection default;
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+alter table t1 add c int default(1) after a,
+algorithm= copy, lock= none;
+connection con2;
+update t1 set b= 55 where a = 1;
+set debug_sync= 'now SIGNAL end';
+connection default;
+select * from t1;
+a c b
+1 1 55
+3 1 44
+#
+# Test primary key change
+#
+# Drop key, add key
+create or replace table t1 (a int primary key, b int);
+insert t1 values (1, 22);
+insert t1 values (3, 44);
+connection con2;
+set debug_sync= 'now WAIT_FOR ended';
+connection default;
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+alter table t1 drop primary key, add primary key(b),
+algorithm= copy, lock= none;
+connection con2;
+update t1 set b= 55 where a = 1;
+set debug_sync= 'now SIGNAL end';
+connection default;
+select * from t1;
+a b
+3 44
+1 55
+# Drop key, add key. Two updates
+create or replace table t1 (a int primary key, b int);
+insert t1 values (1, 11);
+insert t1 values (2, 22);
+connection con2;
+set debug_sync= 'now WAIT_FOR ended';
+connection default;
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+alter table t1 drop primary key, add primary key(b),
+algorithm= copy, lock= none;
+connection con2;
+update t1 set b= 33 where a = 1;
+update t1 set b= 44 where a = 2;
+set debug_sync= 'now SIGNAL end';
+connection default;
+select * from t1;
+a b
+1 33
+2 44
+#
+# Various tests, see below
+#
+create or replace table t1 (a int primary key, b int);
+insert t1 values (1, 11);
+insert t1 values (2, 22);
+insert t1 values (3, 33);
+insert t1 values (4, 44);
+insert t1 values (5, 55);
+insert t1 values (6, 66);
+insert t1 values (7, 77);
+insert t1 values (8, 88);
+insert t1 values (9, 99);
+connection con2;
+set debug_sync= 'now WAIT_FOR ended';
+connection default;
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+alter table t1 drop primary key, add primary key(b),
+algorithm= copy, lock= none;
+connection con2;
+# Two updates
+update t1 set b= 1001 where a = 1;
+update t1 set b= 2002 where a = 2;
+# Two updates in transaction
+set autocommit = 0;
+start transaction;
+update t1 set b= 3003 where a = 3;
+update t1 set b= 4004 where a = 4;
+commit;
+set autocommit = 1;
+# Second update is rolled back
+update t1 set b= 5005 where a = 5;
+set autocommit = 0;
+start transaction;
+update t1 set b= 6006 where a = 6;
+rollback;
+set autocommit = 1;
+# Second execution in transaction fails
+set autocommit = 0;
+start transaction;
+update t1 set b= 7007 where a = 7;
+update t1 set a= 8, b= 8008 where a = 8 or a = 9 order by a;
+ERROR 23000: Duplicate entry '8' for key 'PRIMARY'
+commit;
+set autocommit = 1;
+select * from t1;
+a b
+1 1001
+2 2002
+3 3003
+4 4004
+5 5005
+6 66
+7 7007
+8 88
+9 99
+set debug_sync= 'now SIGNAL end';
+connection default;
+select * from t1;
+a b
+1 1001
+2 2002
+3 3003
+4 4004
+5 5005
+6 66
+7 7007
+8 88
+9 99
+#
+# MYISAM. Only Inserts can be tested.
+# (everything else is a table lock disallowing concurrent reads)
+#
+create or replace table t1 (a int) engine=myisam;
+insert t1 values (5);
+connection con2;
+set debug_sync= 'now WAIT_FOR ended';
+connection default;
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+alter table t1 add b int NULL, algorithm= copy, lock= none;
+connection con2;
+insert into t1 values (123), (456), (789);
+set debug_sync= 'now SIGNAL end';
+connection default;
+select * from t1;
+a b
+5 NULL
+123 NULL
+456 NULL
+789 NULL
+# MYISAM + error
+create or replace table t1 (a int primary key) engine=myisam;
+insert t1 values (5);
+connection con2;
+set debug_sync= 'now WAIT_FOR ended';
+connection default;
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+alter table t1 add b int NULL, algorithm= copy, lock= none;
+connection con2;
+insert into t1 values (1),(2),(3),(4),(5),(6);
+Got one of the listed errors
+select * from t1;
+a
+1
+2
+3
+4
+5
+set debug_sync= 'now SIGNAL end';
+connection default;
+select * from t1;
+a b
+5 NULL
+1 NULL
+2 NULL
+3 NULL
+4 NULL
+# Aria + error
+set @@binlog_format=row;
+create or replace table t1 (a int primary key) engine=aria;
+insert t1 values (5);
+connection con2;
+set debug_sync= 'now WAIT_FOR ended';
+connection default;
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+alter table t1 add b int NULL, algorithm= copy, lock= none;
+connection con2;
+insert into t1 values (1),(2),(3),(4),(5),(6);
+ERROR 23000: Duplicate entry '5' for key 'PRIMARY'
+select * from t1;
+a
+1
+2
+3
+4
+5
+set debug_sync= 'now SIGNAL end';
+connection default;
+select * from t1;
+a b
+5 NULL
+1 NULL
+2 NULL
+3 NULL
+4 NULL
+set @@binlog_format=default;
+# Test incompatible changes
+create or replace table t1 (a int primary key, b int);
+insert t1 values (1, 22);
+insert t1 values (3, 44);
+connection con2;
+set debug_sync= 'now WAIT_FOR ended';
+connection default;
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+alter table t1 drop primary key, add primary key(b),
+algorithm= copy, lock= none;
+connection con2;
+update t1 set b= 44 where a = 1;
+set debug_sync= 'now SIGNAL end';
+connection default;
+ERROR 23000: Duplicate entry '44' for key 'PRIMARY'
+select * from t1;
+a b
+1 44
+3 44
+# Test log read after EXCLUSIVE lock
+# Transaction is started before ALTER, and UPDATE is made.
+# Then more UPDATEs.
+create or replace table t1 (a int primary key, b int);
+insert t1 values (1, 11);
+insert t1 values (2, 22);
+insert t1 values (3, 33);
+insert t1 values (4, 44);
+insert t1 values (5, 55);
+set debug_sync= 'alter_table_online_before_lock SIGNAL locking WAIT_FOR end';
+set debug_sync= 'alter_table_online_downgraded SIGNAL downgraded';
+alter table t1 drop primary key, add primary key(b),
+algorithm= copy, lock= none;
+connection con2;
+begin;
+set debug_sync= 'now WAIT_FOR downgraded';
+update t1 set b= 111 where a = 1;
+set debug_sync= 'now WAIT_FOR locking';
+set debug_sync= 'now SIGNAL end';
+update t1 set b= 222 where a = 2;
+update t1 set b= 333 where a = 3;
+update t1 set b= 444 where a = 4;
+commit;
+update t1 set b= 555 where a = 5;
+connection default;
+select * from t1;
+a b
+1 111
+2 222
+3 333
+4 444
+5 555
+#
+# Test progress report.
+#
+create or replace table t1 (a int primary key, b int);
+insert t1 values (1, 11);
+insert t1 values (2, 22);
+insert t1 values (3, 33);
+insert t1 values (4, 44);
+set debug_sync= 'alter_table_online_before_lock SIGNAL locking WAIT_FOR end';
+set debug_sync= 'alter_table_online_downgraded SIGNAL downgraded'
+ ' WAIT_FOR start_replication';
+set debug_sync= 'alter_table_online_progress SIGNAL applied WAIT_FOR proceed'
+ ' EXECUTE 9';
+alter table t1 drop primary key, add primary key(b),
+algorithm= copy, lock= none;
+connection con2;
+set debug_sync= 'now WAIT_FOR downgraded';
+update t1 set b= 111 where a = 1;
+insert t1 values (5, 55);
+update t1 set b= 555 where a = 5;
+insert t1 values (6, 66);
+update t1 set b= 666 where a = 6;
+set debug_sync= 'now SIGNAL start_replication';
+# First signal is for log description event.
+set debug_sync= 'now WAIT_FOR applied';
+select stage, progress, examined_rows from INFORMATION_SCHEMA.PROCESSLIST where id = @con;
+stage progress examined_rows
+3 53.390 0
+set debug_sync= 'now SIGNAL proceed WAIT_FOR applied';
+select stage, progress, examined_rows from INFORMATION_SCHEMA.PROCESSLIST where id = @con;
+stage progress examined_rows
+3 63.559 1
+set debug_sync= 'now SIGNAL proceed WAIT_FOR applied';
+select stage, progress, examined_rows from INFORMATION_SCHEMA.PROCESSLIST where id = @con;
+stage progress examined_rows
+3 71.610 2
+set debug_sync= 'now SIGNAL proceed WAIT_FOR applied';
+select stage, progress, examined_rows from INFORMATION_SCHEMA.PROCESSLIST where id = @con;
+stage progress examined_rows
+3 81.780 3
+set debug_sync= 'now SIGNAL proceed WAIT_FOR applied';
+select stage, progress, examined_rows from INFORMATION_SCHEMA.PROCESSLIST where id = @con;
+stage progress examined_rows
+3 89.831 4
+set debug_sync= 'now SIGNAL proceed WAIT_FOR applied';
+select stage, progress, examined_rows from INFORMATION_SCHEMA.PROCESSLIST where id = @con;
+stage progress examined_rows
+3 100.000 5
+set debug_sync= 'now SIGNAL proceed WAIT_FOR locking';
+begin;
+update t1 set b= 222 where a = 2;
+update t1 set b= 333 where a = 3;
+update t1 set b= 444 where a = 4;
+commit;
+set debug_sync= 'now SIGNAL end WAIT_FOR applied';
+select stage, progress, examined_rows from INFORMATION_SCHEMA.PROCESSLIST where id = @con;
+stage progress examined_rows
+4 33.333 6
+set debug_sync= 'now SIGNAL proceed WAIT_FOR applied';
+select stage, progress, examined_rows from INFORMATION_SCHEMA.PROCESSLIST where id = @con;
+stage progress examined_rows
+4 66.667 7
+set debug_sync= 'now SIGNAL proceed WAIT_FOR applied';
+select stage, progress, examined_rows from INFORMATION_SCHEMA.PROCESSLIST where id = @con;
+stage progress examined_rows
+4 100.000 8
+set debug_sync= 'now SIGNAL proceed';
+connection default;
+select * from t1;
+a b
+1 111
+2 222
+3 333
+4 444
+5 555
+6 666
+#
+# Test system versioning
+#
+create or replace table t1 (a int primary key, b int);
+insert t1 values (1, 22);
+insert t1 values (3, 44);
+connection con2;
+set debug_sync= 'now WAIT_FOR ended';
+connection default;
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+set timestamp = 1;
+alter table t1 add system versioning,
+algorithm= copy, lock= none;
+connection con2;
+set timestamp = 2;
+update t1 set b= 55 where a = 1;
+set timestamp = 3;
+insert into t1 values (6, 77);
+set debug_sync= 'now SIGNAL end';
+connection default;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL,
+ `b` int(11) DEFAULT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+select *, UNIX_TIMESTAMP(row_start), UNIX_TIMESTAMP(row_end) from t1 for system_time all;
+a b UNIX_TIMESTAMP(row_start) UNIX_TIMESTAMP(row_end)
+1 55 1.000000 2147483647.999999
+3 44 1.000000 2147483647.999999
+6 77 1.000000 2147483647.999999
+alter table t1 drop system versioning, algorithm= copy, lock= none;
+ERROR 0A000: LOCK=NONE is not supported. Reason: DROP SYSTEM VERSIONING. Try LOCK=SHARED
+drop table t1;
+#
+# Test ROLLBACK TO SAVEPOINT
+#
+create or replace table t1 (a int);
+insert t1 values (1), (2);
+create or replace table t2 (a int);
+insert t2 values (1), (2);
+connection con2;
+begin;
+update t2 set a= 222 where a = 2;
+savepoint savie;
+update t2 set a= 111 where a = 1;
+set debug_sync= 'now WAIT_FOR ended';
+connection default;
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+alter table t1 add b int NULL, algorithm= copy, lock= none;
+connection con2;
+update t1 set a= 123 where a = 1;
+savepoint whoopsie;
+rollback to savepoint savie;
+commit;
+set debug_sync= 'now SIGNAL end';
+connection default;
+select * from t1;
+a b
+1 NULL
+2 NULL
+select * from t2;
+a
+1
+222
+create or replace table t1 (a int);
+insert t1 values (1), (2);
+create or replace table t2 (a int);
+insert t2 values (1), (2);
+create or replace table t3 (a int) engine=myisam;
+insert t3 values (1);
+connection con2;
+begin;
+update t2 set a= 222 where a = 2;
+savepoint savie;
+update t2 set a= 111 where a = 1;
+set debug_sync= 'now WAIT_FOR ended';
+connection default;
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+alter table t1 add b int NULL, algorithm= copy, lock= none;
+connection con2;
+update t1 set a= 222 where a = 2;
+savepoint whoopsie;
+update t1 set a= 123 where a = 1;
+insert t3 values (2);
+select * from t1;
+a
+123
+222
+rollback to savepoint whoopsie;
+Warnings:
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+select * from t1;
+a
+1
+222
+select * from t3;
+a
+1
+2
+commit;
+set debug_sync= 'now SIGNAL end';
+connection default;
+select * from t1;
+a b
+1 NULL
+222 NULL
+select * from t2;
+a
+111
+222
+select * from t3;
+a
+1
+2
+# Cleanup
+set debug_sync= 'reset';
+drop table t1;
+drop table t2;
+drop table t3;
+create table t1 (a char(6), b int);
+insert t1 values ('abcde1',1),('abcde2',2);
+set debug_sync= 'now wait_for downgraded';
+connection con2;
+set sql_mode='';
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t1 modify a char(4), algorithm=copy, lock=none;
+connection default;
+update t1 set b=b+10 where a='abcde2';
+select * from t1;
+a b
+abcde1 1
+abcde2 12
+set debug_sync= 'now signal goforit';
+connection con2;
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+Warning 1265 Data truncated for column 'a' at row 2
+Warning 1265 Data truncated for column 'a' at row 3
+set sql_mode=default;
+connection default;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(4) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+select * from t1;
+a b
+abcd 1
+abcd 12
+drop table t1;
+set debug_sync= 'reset';
+#
+# MDEV-28930 ALTER TABLE Deadlocks with parallel TL_WRITE
+#
+create table t1(a int) engine=myisam select 1;
+set debug_sync='alter_table_online_before_lock SIGNAL ready WAIT_FOR go_for_locking';
+alter table t1 force;
+connection con2;
+set debug_sync='now WAIT_FOR ready';
+set debug_sync='thr_multi_lock_before_thr_lock SIGNAL go_for_locking';
+update t1 set a=2;
+connection default;
+set debug_sync='alter_table_online_before_lock SIGNAL ready WAIT_FOR go_for_locking';
+alter table mysql.global_priv force;
+connection con2;
+set debug_sync='now WAIT_FOR ready';
+set debug_sync='thr_multi_lock_before_thr_lock SIGNAL go_for_locking';
+create user user1@localhost;
+connection default;
+set debug_sync=reset;
+drop user user1@localhost;
+drop table t1;
+#
+# MDEV-28959 Online alter ignores strict table mode
+#
+create table t1 (a int);
+insert into t1 values (1),(2),(3);
+set debug_sync= 'now wait_for downgraded';
+connection con2;
+set sql_mode='STRICT_TRANS_TABLES,STRICT_ALL_TABLES';
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t1 modify a int not null, algorithm=copy, lock=none;
+connection default;
+insert into t1 values (null),(null);
+set debug_sync= 'now signal goforit';
+connection con2;
+ERROR 01000: Data truncated for column 'a' at row 4
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+select * from t1;
+a
+1
+2
+3
+NULL
+NULL
+set sql_mode=default;
+connection default;
+drop table t1;
+set debug_sync= reset;
+#
+# MDEV-28967 Assertion `marked_for_write_or_computed()' failed in Field_new_decimal::store_value / online_alter_read_from_binlog`
+#
+create table t1 (a decimal(8,2), b varchar(8));
+insert into t1 (b) values ('x');
+set debug_sync= 'now wait_for downgraded';
+connection con2;
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t1 force, algorithm=copy, lock=none;
+connection default;
+insert t1 (b) values ('k');
+insert t1 (b) values ('m');
+set debug_sync= 'now signal goforit';
+connection con2;
+connection default;
+drop table t1;
+set debug_sync= reset;
+#
+# MDEV-29021 ALTER TABLE fails when a stored virtual column is dropped and added
+#
+create table t1 (a char(9), b char(9) as (a) stored);
+insert into t1(a) values ('foobar');
+set debug_sync= 'now wait_for downgraded';
+connection con2;
+set sql_mode='';
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t1 drop b, add b char(3) as (a) stored, algorithm=copy, lock=none;
+connection default;
+update t1 set a = 'foobarqux';
+set debug_sync= 'now signal goforit';
+connection con2;
+Warnings:
+Warning 1265 Data truncated for column 'b' at row 1
+Warning 1265 Data truncated for column 'b' at row 2
+set sql_mode=default;
+connection default;
+drop table t1;
+set debug_sync= reset;
+# (duplicate) MDEV-29007 Assertion `marked_for_write_or_computed()'
+# failed upon online ADD COLUMN .. FIRST
+create table t (a int);
+insert into t values (1),(2);
+set debug_sync= 'now wait_for downgraded';
+connection con2;
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t add c int first, algorithm=copy, lock=none;
+connection default;
+insert into t values (3);
+set debug_sync= 'now signal goforit';
+connection con2;
+connection default;
+drop table t;
+set debug_sync= reset;
+# UNIQUE blob duplicates are not ignored.
+create table t1 (b blob);
+insert into t1 values ('foo'),('bar');
+set debug_sync= 'now wait_for downgraded';
+connection con2;
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t1 add unique(b), algorithm=copy, lock=none;
+connection default;
+insert into t1 values ('qux'),('foo');
+set debug_sync= 'now signal goforit';
+connection con2;
+ERROR 23000: Duplicate entry 'foo' for key 'b'
+select * from t1;
+b
+foo
+bar
+qux
+foo
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `b` blob DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection default;
+drop table t1;
+set debug_sync= reset;
+#
+# DELETE with added virtual column
+#
+CREATE TABLE t1 (a CHAR(3), b CHAR(3) AS (a));
+INSERT INTO t1 (a) VALUES ('foo'),('bar');
+set debug_sync= 'now wait_for downgraded';
+connection con2;
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+ALTER TABLE t1 ADD c INT, ALGORITHM=COPY, LOCK=NONE;
+connection default;
+DELETE FROM t1;
+set debug_sync= 'now signal goforit';
+connection con2;
+select * from t1;
+a b c
+connection default;
+DROP TABLE t1;
+set debug_sync= reset;
+#
+# Do not ignore sql_mode when replicating
+#
+create table t1 (a int);
+insert into t1 values (1);
+set debug_sync= 'now wait_for downgraded';
+connection con2;
+set sql_mode='STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO';
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t1 add b int as (1/a) stored, algorithm=copy, lock=none;
+connection default;
+update t1 set a= 0 where a=1;
+set debug_sync= 'now signal goforit';
+connection con2;
+ERROR 22012: Division by 0
+set sql_mode= default;
+connection default;
+drop table t1;
+set debug_sync= reset;
+#
+# MDEV-29067 Online alter ignores check constraint violation
+#
+## CHECK, INSERT
+create table t1 (a int);
+insert t1 values (1),(2);
+set debug_sync= 'now wait_for downgraded';
+connection con2;
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t1 add check (a<10), algorithm=copy, lock=none;
+connection default;
+insert t1 values (11),(12);
+set debug_sync= 'now signal goforit';
+connection con2;
+ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1`
+connection default;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+select * from t1;
+a
+1
+2
+11
+12
+drop table t1;
+## DEFAULT, INSERT
+create table t1 (a int);
+insert t1 values (1),(2);
+set debug_sync= 'now wait_for downgraded';
+connection con2;
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t1 add b int default(a+10), algorithm=copy, lock=none;
+connection default;
+insert t1 values (11),(12);
+set debug_sync= 'now signal goforit';
+connection con2;
+connection default;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT (`a` + 10)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+select * from t1;
+a b
+1 11
+2 12
+11 21
+12 22
+drop table t1;
+set debug_sync= 'reset';
+## CHECK, UPDATE
+create table t1 (a int);
+insert t1 values (1),(2),(3),(4);
+set debug_sync= 'now wait_for downgraded';
+connection con2;
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t1 add check (a<10), algorithm=copy, lock=none;
+connection default;
+update t1 set a=a+10 where a > 2;
+set debug_sync= 'now signal goforit';
+connection con2;
+ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1`
+connection default;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+select * from t1;
+a
+1
+2
+13
+14
+drop table t1;
+## DEFAULT, UPDATE
+create table t1 (a int);
+insert t1 values (1),(2),(3),(4);
+set debug_sync= 'now wait_for downgraded';
+connection con2;
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t1 add b int default(a), algorithm=copy, lock=none;
+connection default;
+update t1 set a=a+10 where a > 2;
+insert t1 values(5);
+update t1 set a=a+10 where a = 5;
+set debug_sync= 'now signal goforit';
+connection con2;
+connection default;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT `a`
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+select * from t1;
+a b
+1 1
+2 2
+13 13
+14 14
+15 15
+drop table t1;
+set debug_sync= 'reset';
+## VCOL + CHECK
+create table t1 (a int);
+insert t1 values (1),(2),(3),(4);
+set debug_sync= 'now wait_for downgraded';
+connection con2;
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t1 add b int as (a), add check(b=a), algorithm=copy, lock=none;
+connection default;
+update t1 set a=a+10 where a > 2;
+insert t1 values(5);
+update t1 set a=a+10 where a = 5;
+set debug_sync= 'now signal goforit';
+connection con2;
+connection default;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) GENERATED ALWAYS AS (`a`) VIRTUAL,
+ CONSTRAINT `CONSTRAINT_1` CHECK (`b` = `a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+select * from t1;
+a b
+1 1
+2 2
+13 13
+14 14
+15 15
+drop table t1;
+set debug_sync= 'reset';
+#
+# MDEV-29013 ER_KEY_NOT_FOUND/lock timeout upon online alter
+# with long unique indexes
+#
+create table t1 (b text not null, unique(b));
+insert into t1 values ('foo'),('bar');
+set debug_sync= 'now wait_for downgraded';
+connection con2;
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t1 add c int, algorithm=copy, lock=none;
+connection default;
+delete from t1;
+set debug_sync= 'now signal goforit';
+connection con2;
+connection default;
+drop table t1;
+set debug_sync= reset;
+###
+create table t1 (a text, unique(a));
+create table t2 (b text, unique(b));
+insert into t2 values (null),(null);
+set debug_sync= 'now wait_for downgraded';
+connection con2;
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t2 add column c int, algorithm=copy, lock=none;
+connection default;
+delete from t2;
+set debug_sync= 'now signal goforit';
+connection con2;
+connection default;
+alter table t2 force;
+alter table t1 force;
+drop table t1, t2;
+set debug_sync= reset;
+#
+# MDEV-29038 XA assertions failing in binlog_rollback and binlog_commit
+#
+create table t (a int);
+insert into t values (1);
+xa begin 'xid';
+set debug_sync= 'now wait_for downgraded';
+connect con1,localhost,root,,test;
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t force, algorithm=copy, lock=none;
+connection default;
+insert into t values (2);
+set debug_sync= 'now signal goforit';
+xa end 'xid';
+xa rollback 'xid';
+xa begin 'xid';
+connection con1;
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t force, algorithm=copy, lock=none;
+connection default;
+set debug_sync= 'now wait_for downgraded';
+insert into t values (3);
+set debug_sync= 'now signal goforit';
+xa end 'xid';
+xa commit 'xid' one phase;
+connection con1;
+connection default;
+drop table t;
+set debug_sync= reset;
+#
+# MDEV-29069 ER_KEY_NOT_FOUND upon online autoinc addition and
+# concurrent DELETE
+#
+set @old_dbug=@@debug_dbug;
+set debug_dbug="+d,rpl_report_chosen_key";
+#
+# Add clumsy DEFAULT
+#
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t add b int default(RAND() * 20), add key(b),
+algorithm=copy, lock=none;
+connection con2;
+set debug_sync= 'now wait_for downgraded';
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+set debug_sync= 'now signal goforit';
+connection default;
+Warnings:
+Note 1105 Key chosen: -1
+Note 1105 Key chosen: -1
+select a from t;
+a
+11
+30
+# CURRENT_TIMESTAMP
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t add b timestamp default CURRENT_TIMESTAMP, add key(b),
+algorithm=copy, lock=none;
+connection con2;
+set debug_sync= 'now wait_for downgraded';
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+set debug_sync= 'now signal goforit';
+connection default;
+Warnings:
+Note 1105 Key chosen: -1
+Note 1105 Key chosen: -1
+select a from t;
+a
+11
+30
+# CURRENT_TIMESTAMP, mixed key
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t add b timestamp default CURRENT_TIMESTAMP, add key(a, b),
+algorithm=copy, lock=none;
+connection con2;
+set debug_sync= 'now wait_for downgraded';
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+set debug_sync= 'now signal goforit';
+connection default;
+Warnings:
+Note 1105 Key chosen: 0
+Note 1105 Key chosen: 0
+select a from t;
+a
+11
+30
+# Mixed primary key
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t add b int default (a+1), add primary key(b, a),
+algorithm=copy, lock=none;
+connection con2;
+set debug_sync= 'now wait_for downgraded';
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+set debug_sync= 'now signal goforit';
+connection default;
+Warnings:
+Note 1105 Key chosen: 0
+Note 1105 Key chosen: 0
+select a from t;
+a
+11
+30
+#
+# Normal row, could be used as a key
+#
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t add b int as (a * 10) unique, algorithm=copy, lock=none;
+connection con2;
+set debug_sync= 'now wait_for downgraded';
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+set debug_sync= 'now signal goforit';
+connection default;
+Warnings:
+Note 1105 Key chosen: 0
+Note 1105 Key chosen: 0
+#
+# Add key for old row
+#
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t add unique(a), algorithm=copy, lock=none;
+connection con2;
+set debug_sync= 'now wait_for downgraded';
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+set debug_sync= 'now signal goforit';
+connection default;
+Warnings:
+Note 1105 Key chosen: 0
+Note 1105 Key chosen: 0
+#
+# Useful UNIQUE, though a virtual column on another extra field
+#
+create or replace table t (a int primary key, b int default (a+1));
+insert into t values (10, 10),(20, 20),(30, 30);
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t drop primary key, add c int default(a),
+add d int as (c) stored unique, algorithm=copy, lock=none;
+connection con2;
+set debug_sync= 'now wait_for downgraded';
+delete from t where a = 20;
+update t set a = a + 2 where a = 10;
+set debug_sync= 'now signal goforit';
+connection default;
+Warnings:
+Note 1105 Key chosen: 0
+Note 1105 Key chosen: 0
+select * from t;
+a b c d
+12 10 12 12
+30 30 30 30
+#
+# Now this index is not usable (missing DEFAULT on field c)
+#
+create or replace table t (a int primary key, b int);
+insert into t values (10, 10),(20, 20),(30, 30);
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+alter table t drop primary key, add c real default(rand(a)),
+add d real as (c) stored unique, algorithm=copy, lock=none;
+connection con2;
+set debug_sync= 'now wait_for downgraded';
+delete from t where a = 20;
+update t set a = a + 2 where a = 10;
+set debug_sync= 'now signal goforit';
+connection default;
+Warnings:
+Note 1105 Key chosen: -1
+Note 1105 Key chosen: -1
+select a, b from t;
+a b
+12 10
+30 30
+drop table t;
+set debug_sync= reset;
+set debug_dbug= @old_dbug;
+connection default;
+#
+# MDEV-30902 Server crash in LEX::first_lists_tables_same
+#
+create table t1 engine=myisam select 1 as x ;
+create procedure p() alter table t1 engine=heap;
+set debug_sync= 'alter_table_copy_end signal ended wait_for end';
+call p;
+connection con1;
+set debug_sync= 'now wait_for ended';
+insert into t1 values (2);
+set debug_sync= 'now signal end';
+connection default;
+call p;
+drop table t1;
+drop procedure p;
+set debug_sync=reset;
+#
+# MDEV-30902 Server crash in LEX::first_lists_tables_same
+#
+create table t (id int, s date, e date, period for p(s,e),
+unique(id, p without overlaps)) engine=aria;
+insert into t values (1,'1971-01-01','1971-01-02');
+set debug_sync= 'alter_table_online_before_lock signal lock wait_for goon';
+alter table t force;
+connection con1;
+set debug_sync= 'now wait_for lock';
+delete from t;
+set debug_sync= 'now signal goon';
+connection default;
+drop table t;
+#
+# MDEV-30924 Server crashes in MYSQL_LOG::is_open upon ALTER vs FUNCTION
+#
+create table t (a int);
+insert into t values (1),(2);
+create function f () returns int
+begin
+update t set a = 10;
+return 0;
+end $
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goon';
+alter table t force, algorithm=copy;
+connection con1;
+set debug_sync= 'now wait_for downgraded';
+select f();
+f()
+0
+set debug_sync= 'now signal goon';
+connection default;
+drop table t;
+drop function f;
+# Partitioning
+create or replace table t1 (a serial);
+insert t1 values (5), (6), (7);
+set debug_sync= 'alter_table_online_downgraded SIGNAL downgraded wait_for goon';
+alter table t1 ENGINE=InnoDB, ALGORITHM=COPY, LOCK=NONE
+PARTITION BY HASH(a) PARTITIONS 5;
+connection con1;
+set debug_sync= 'now WAIT_FOR downgraded';
+insert into t1 values (123), (456), (789);
+update t1 set a= a+100;
+set debug_sync= 'now SIGNAL goon';
+connection default;
+select * from t1;
+a
+105
+106
+556
+107
+223
+889
+drop table t1;
+#
+# MDEV-31033 ER_KEY_NOT_FOUND upon online COPY ALTER on a partitioned
+# table
+create table t (a int) partition by hash(a) partitions 2;
+insert into t values (1),(3);
+set debug_sync= 'alter_table_online_downgraded SIGNAL downgraded wait_for goon';
+alter table t force, algorithm=copy, lock=none;
+connection con1;
+set debug_sync= 'now WAIT_FOR downgraded';
+update t set a = a + 1;
+insert t values (1),(2);
+delete from t where a = 4 limit 1;
+set debug_sync= 'now SIGNAL goon';
+connection default;
+select * from t;
+a
+2
+2
+1
+drop table t;
+#
+# MDEV-31043 ER_KEY_NOT_FOUND upon concurrent ALTER and transaction
+#
+create table t (a int, b int) engine=myisam;
+insert into t values (1,10),(2,20);
+set debug_sync= 'alter_table_online_before_lock signal burnit wait_for goforit';
+alter table t add c int, algorithm=copy, lock=none;
+connection con1;
+set debug_sync= 'now wait_for burnit';
+update t set b = 100;
+start transaction;
+update t set b = 200;
+connection con2;
+delete from t order by a limit 1;
+delete from t order by a limit 1;
+select * from t;
+a b
+connection con1;
+commit;
+set debug_sync= 'now signal goforit';
+connection default;
+select * from t;
+a b c
+drop table t;
+create table t (a int, b int) engine=aria;
+insert into t values (1,10),(2,20);
+set debug_sync= 'alter_table_online_before_lock signal burnit wait_for goforit';
+alter table t add c int, algorithm=copy, lock=none;
+connection con1;
+set debug_sync= 'now wait_for burnit';
+update t set b = 100;
+start transaction;
+update t set b = 200;
+connection con2;
+delete from t order by a limit 1;
+delete from t order by a limit 1;
+select * from t;
+a b
+connection con1;
+commit;
+set debug_sync= 'now signal goforit';
+connection default;
+select * from t;
+a b c
+drop table t;
+#
+# MDEV-30949 Direct leak in binlog_online_alter_end_trans
+#
+create table t (f longblob default null) engine=myisam;
+insert into t values (null);
+set debug_sync= "alter_table_copy_end signal copy wait_for goon";
+set debug_sync= "alter_table_online_before_lock signal lock wait_for end";
+alter table t force, algorithm=copy;
+connection con1;
+set debug_sync= "now wait_for copy";
+insert into t select repeat('a',130000);
+set debug_sync= "now signal goon wait_for lock";
+insert into t select repeat('a',130000);
+set debug_sync= "now signal end";
+connection default;
+drop table t;
+#
+# Test that correct fields are marked as explicit:
+# Drop a, reorder b, add new column with default.
+#
+create table t (a int primary key, b int);
+insert into t values (1, 1), (2, 2), (3, 3);
+set debug_sync= "alter_table_copy_end signal copy wait_for goon";
+alter table t drop primary key, drop a,
+change b c bigint,
+add x longblob default 123456;
+connection con1;
+set debug_sync= "now wait_for copy";
+update t set b = 5 where a = 1;
+update t set b = NULL where a = 1;
+select * from t;
+a b
+1 NULL
+2 2
+3 3
+update t set a = 100 where a = 1;
+update t set b = -10 where a = 100;
+select * from t;
+a b
+2 2
+3 3
+100 -10
+set debug_sync= "now signal goon";
+connection default;
+select * from t;
+c x
+-10 123456
+2 123456
+3 123456
+drop table t;
+# Test that all the fields are unpacked.
+create table t (a int, b int);
+insert into t values (NULL, 123), (NULL, 456);
+set debug_sync= "alter_table_copy_end signal copy wait_for goon";
+alter table t drop a, add primary key(b), algorithm=copy;
+connection con1;
+set debug_sync= "now wait_for copy";
+update t set b = b + 100;
+set debug_sync= "now signal goon";
+connection default;
+select * from t;
+b
+223
+556
+drop table t;
+set debug_sync= reset;
+NOT FOUND /Slave SQL/ in mysqld.1.err
+#
+# MDEV-31646 Online alter applies binlog cache limit to cache writes
+#
+create table t (pk int primary key, a varchar(100)) engine=MyISAM;
+insert into t select seq, repeat('x', 100) from seq_1_to_500;
+set @cache.size= @@max_binlog_cache_size;
+set global max_binlog_cache_size= 4096;
+set debug_sync= 'now wait_for do_updates';
+connection con1;
+set debug_sync= 'alter_table_online_progress signal do_updates wait_for go';
+alter table t add b int, algorithm=copy, lock=none;
+connection default;
+update t set a = repeat('y', 100);
+show warnings;
+Level Code Message
+set debug_sync= 'now signal go';
+connection con1;
+show warnings;
+Level Code Message
+connection default;
+drop table t;
+set debug_sync= reset;
+set global max_binlog_cache_size= @cache.size;
+# Now make sure that smaller limits will be processed fine
+set @old_dbug=@@debug_dbug;
+create table t (pk int primary key, a text) engine=MyISAM;
+insert into t select seq, repeat('x', 1000) from seq_1_to_50;
+connection con1;
+set debug_sync= 'alter_table_online_progress signal do_updates wait_for go';
+alter table t add b int, algorithm=copy, lock=none;
+connection default;
+set debug_sync= 'now wait_for do_updates';
+set debug_dbug="+d,online_alter_small_cache";
+update t set a = repeat('y', 1000);
+ERROR HY000: Multi-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.
+show warnings;
+Level Code Message
+Error 1705 Multi-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.
+Error 1534 Writing one row to the row-based binary log failed
+Warning 1196 Some non-transactional changed tables couldn't be rolled back
+set debug_sync= 'now signal go';
+connection con1;
+show warnings;
+Level Code Message
+connection default;
+drop table t;
+set debug_sync= reset;
+set debug_dbug= @old_dbug;
+create table t (id int, a int, b text, primary key (id));
+insert into t values (1,10,''),(2,20,'');
+set debug_sync= 'alter_table_online_progress signal do_update wait_for go';
+alter table t force, algorithm=copy, lock=none;
+connection con1;
+set @old_binlog_row_image= @@binlog_row_image;
+set binlog_row_image= noblob;
+set debug_sync= 'now wait_for do_update';
+update t set a = 1;
+delete from t where id = 1;
+set debug_sync= 'now signal go';
+set binlog_row_image= @old_binlog_row_image;
+connection default;
+select * from t;
+id a b
+2 1
+drop table t;
+set debug_sync= reset;
+#
+# MDEV-31812 Add switch to old_mode to disable non-locking ALTER
+#
+set @old_old_mode= @@old_mode;
+create or replace table t1 (a int primary key, b int);
+set debug_sync= 'alter_table_copy_end SIGNAL copy_end WAIT_FOR proceed';
+alter table t1 drop primary key, add primary key(b), algorithm= copy;
+connection con2;
+set debug_sync= 'now WAIT_FOR copy_end';
+select if(max_stage = 4, "online", "old") as mode
+from information_schema.processlist where id = @con;
+mode
+online
+set debug_sync= 'now SIGNAL proceed';
+connection default;
+set old_mode= LOCK_ALTER_TABLE_COPY;
+Warnings:
+Warning 1287 'LOCK_ALTER_TABLE_COPY' is deprecated and will be removed in a future release
+set debug_sync= 'alter_table_copy_end SIGNAL copy_end WAIT_FOR proceed';
+alter table t1 drop primary key, add primary key(b), algorithm= copy;
+connection con2;
+set debug_sync= 'now WAIT_FOR copy_end';
+select if(max_stage = 4, "online", "old") as mode
+from information_schema.processlist where id = @con;
+mode
+old
+set debug_sync= 'now SIGNAL proceed';
+connection default;
+set debug_sync= 'alter_table_copy_end SIGNAL copy_end WAIT_FOR proceed';
+alter table t1 drop primary key, add primary key(b),
+algorithm= copy, lock=none;
+connection con2;
+set debug_sync= 'now WAIT_FOR copy_end';
+select if(max_stage = 4, "online", "old") as mode
+from information_schema.processlist where id = @con;
+mode
+online
+set debug_sync= 'now SIGNAL proceed';
+connection default;
+set old_mode= @old_old_mode;
+drop table t1;
+set debug_sync= reset;
+#
+# MDEV-32100 Online ALTER TABLE ends with 1032 under some isolation levels
+#
+create table iso_levels(id int, level text);
+INSERT iso_levels VALUES (0, "READ UNCOMMITTED"),
+(1, "READ COMMITTED"),
+(2, "REPEATABLE READ"),
+(3, "SERIALIZABLE");
+create table t1 (a int, b int, key(b));
+connection con2;
+insert into t1 values (1,1),(null,null),(3,3),(4,null),(null,5);
+connection default;
+set session transaction isolation level SERIALIZABLE;
+set debug_sync= "alter_table_online_downgraded signal downgraded wait_for goalters";
+alter table t1 force, algorithm=copy;
+connection con2;
+set debug_sync= "now wait_for downgraded";
+delete from t1 where b is null;
+set debug_sync= "now signal goalters";
+connection default;
+drop table t1;
+create table t1 (a int, b int, key(b));
+connection con2;
+insert into t1 values (1,1),(null,null),(3,3),(4,null),(null,5);
+connection default;
+set session transaction isolation level REPEATABLE READ;
+set debug_sync= "alter_table_online_downgraded signal downgraded wait_for goalters";
+alter table t1 force, algorithm=copy;
+connection con2;
+set debug_sync= "now wait_for downgraded";
+delete from t1 where b is null;
+set debug_sync= "now signal goalters";
+connection default;
+drop table t1;
+create table t1 (a int, b int, key(b));
+connection con2;
+insert into t1 values (1,1),(null,null),(3,3),(4,null),(null,5);
+connection default;
+set session transaction isolation level READ COMMITTED;
+set debug_sync= "alter_table_online_downgraded signal downgraded wait_for goalters";
+alter table t1 force, algorithm=copy;
+connection con2;
+set debug_sync= "now wait_for downgraded";
+delete from t1 where b is null;
+set debug_sync= "now signal goalters";
+connection default;
+drop table t1;
+create table t1 (a int, b int, key(b));
+connection con2;
+insert into t1 values (1,1),(null,null),(3,3),(4,null),(null,5);
+connection default;
+set session transaction isolation level READ UNCOMMITTED;
+set debug_sync= "alter_table_online_downgraded signal downgraded wait_for goalters";
+alter table t1 force, algorithm=copy;
+connection con2;
+set debug_sync= "now wait_for downgraded";
+delete from t1 where b is null;
+set debug_sync= "now signal goalters";
+connection default;
+drop table t1;
+set debug_sync= reset;
+drop table iso_levels;
+# MDEV-32126 Assertion fails upon online ALTER and binary log enabled
+create temporary table tmp (id int, primary key(id)) engine=innodb;
+create table t1 (a int, b text);
+create table t2 (a int, b int, c char(8), d text, unique(a));
+insert into t2 values (1,1,'f','e'),(1000,1000,'c','b');
+connection default;
+set debug_sync= 'alter_table_online_before_lock signal go_trx wait_for go_alter';
+alter table t2 force, algorithm=copy, lock=none;
+connection con2;
+set debug_sync= 'now wait_for go_trx';
+start transaction;
+insert into t1 values (3,'a');
+insert into t2 values (3,3,'a','x'), (3,3,'a','x');
+ERROR 23000: Duplicate entry '3' for key 'a'
+insert into t2 values (3,3,'a','x');
+commit;
+set debug_sync= 'now signal go_alter';
+connection default;
+truncate t2;
+set @@binlog_format=mixed;
+connection con2;
+start transaction;
+create temporary table tmp (id int, primary key(id));
+insert into t1 values (1, repeat('x',8000)),(2, repeat('x',8000));
+update t2 set b = null order by b limit 2;
+insert into t1 values (3, repeat('x',8000));
+delete from t1;
+insert into t2 values (1,1,'f','e'),(1000,1000,'c','b');
+commit;
+connection default;
+set debug_sync= 'alter_table_online_before_lock signal go_trx wait_for go_alter';
+alter table t2 force, algorithm=copy, lock=none;
+connection con2;
+set debug_sync= 'now wait_for go_trx';
+start transaction;
+drop temporary table if exists tmp;
+insert into t2 values (3,3,'a','x'), (3,3,'a','x');
+ERROR 23000: Duplicate entry '3' for key 'a'
+insert into t2 values (3,3,'a','x');
+commit;
+set debug_sync= 'now signal go_alter';
+connection default;
+drop table t1, t2;
+set @@binlog_format=default;
+set debug_sync= reset;
+# MDEV-32444 Data from orphaned XA transaction is lost after online alter
+create table t (a int primary key);
+insert into t values (1);
+# XA commit
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for go';
+alter table t force, algorithm=copy, lock=none;
+connection con1;
+set debug_sync= 'now wait_for downgraded';
+xa begin 'x1';
+update t set a = 2 where a = 1;
+xa end 'x1';
+xa prepare 'x1';
+set debug_sync= 'thread_end signal xa_detach wait_for close';
+disconnect con1;
+connection con2;
+set debug_sync= 'now signal close wait_for xa_detach';
+xa commit 'x1';
+set debug_sync= 'now signal go';
+connection default;
+select * from t;
+a
+2
+# XA rollback
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for go';
+alter table t force, algorithm=copy, lock=none;
+connect con1, localhost, root,,;
+set debug_sync= 'now wait_for downgraded';
+xa begin 'x2';
+insert into t values (53);
+xa end 'x2';
+xa prepare 'x2';
+set debug_sync= 'thread_end signal xa_detach wait_for close';
+disconnect con1;
+connection con2;
+set debug_sync= 'now signal close wait_for xa_detach';
+xa rollback 'x2';
+set debug_sync= 'now signal go';
+connection default;
+select * from t;
+a
+2
+# XA transaction is left uncommitted
+# end then is rollbacked after alter fails
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for go';
+set statement innodb_lock_wait_timeout=0, lock_wait_timeout= 0
+for alter table t force, algorithm=copy, lock=none;
+connect con1, localhost, root,,;
+set debug_sync= 'now wait_for downgraded';
+xa begin 'xuncommitted';
+insert into t values (3);
+xa end 'xuncommitted';
+xa prepare 'xuncommitted';
+set debug_sync= 'now signal go';
+set debug_sync= 'thread_end signal xa_detach wait_for close';
+disconnect con1;
+connection default;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+set debug_sync= 'now signal close wait_for xa_detach';
+xa rollback 'xuncommitted';
+select * from t;
+a
+2
+# Same, but commit
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for go';
+set statement innodb_lock_wait_timeout=0, lock_wait_timeout= 0
+for alter table t force, algorithm=copy, lock=none;
+connect con1, localhost, root,,;
+set debug_sync= 'now wait_for downgraded';
+xa begin 'committed_later';
+insert into t values (3);
+xa end 'committed_later';
+xa prepare 'committed_later';
+set debug_sync= 'now signal go';
+set debug_sync= 'thread_end signal xa_detach wait_for close';
+disconnect con1;
+connection default;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+set debug_sync= 'now signal close wait_for xa_detach';
+xa commit 'committed_later';
+select * from t;
+a
+2
+3
+# Commit, but error in statement, and there is some stmt data to rollback
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for go';
+alter table t force, algorithm=copy, lock=none;
+connect con1, localhost, root,,;
+set debug_sync= 'now wait_for downgraded';
+xa begin 'x1';
+insert into t values (4), (3);
+ERROR 23000: Duplicate entry '3' for key 'PRIMARY'
+insert into t values (5);
+xa end 'x1';
+xa prepare 'x1';
+set debug_sync= 'thread_end signal xa_detach wait_for close';
+disconnect con1;
+connection con2;
+set debug_sync= 'now signal close wait_for xa_detach';
+xa commit 'x1';
+set debug_sync= 'now signal go';
+connection default;
+select * from t;
+a
+2
+3
+5
+connect con1, localhost, root,,;
+connection default;
+drop table t;
+set debug_sync= reset;
+# MDEV-32771 Server crash upon online alter with concurrent XA
+create table t (a int primary key);
+insert t values(1),(2),(3);
+# First, check that nothing from the rollbacked statement commits
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for go';
+alter table t add b int default (555), algorithm=copy;
+connection con1;
+set debug_sync= 'now wait_for downgraded';
+xa start 'xid';
+update t set a = 0;
+ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
+xa end 'xid';
+xa prepare 'xid';
+xa commit 'xid';
+set debug_sync= 'now signal go';
+connection default;
+select * from t;
+a b
+1 555
+2 555
+3 555
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for go';
+alter table t add c int default(777), algorithm=copy;
+connection con1;
+set debug_sync= 'now wait_for downgraded';
+xa start 'xid';
+update t set a = 0;
+ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
+xa end 'xid';
+xa prepare 'xid';
+xa rollback 'xid';
+set debug_sync= 'now signal go';
+connection default;
+select * from t;
+a b c
+1 555 777
+2 555 777
+3 555 777
+# Same, but add one successful statement into transaction
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for go';
+alter table t drop b, algorithm=copy;
+connection con1;
+set debug_sync= 'now wait_for downgraded';
+xa start 'xid';
+update t set a = 10 where a = 1;
+update t set a = 0;
+ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
+xa end 'xid';
+xa prepare 'xid';
+xa rollback 'xid';
+set debug_sync= 'now signal go';
+connection default;
+select * from t;
+a c
+1 777
+2 777
+3 777
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for go';
+alter table t drop primary key, algorithm=copy;
+connection con1;
+set debug_sync= 'now wait_for downgraded';
+xa start 'xid';
+# This statement will take effect.
+update t set a = 10 where a = 1;
+update t set a = 0;
+ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
+xa end 'xid';
+xa prepare 'xid';
+xa commit 'xid';
+set debug_sync= 'now signal go';
+connection default;
+select * from t;
+a c
+10 777
+2 777
+3 777
+# The only statement succeeds (test both commit and rollback)
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for go';
+alter table t add d text default ('qwe'), algorithm=copy;
+connection con1;
+set debug_sync= 'now wait_for downgraded';
+xa start 'xid';
+update t set a = 0;
+xa end 'xid';
+xa prepare 'xid';
+xa rollback 'xid';
+set debug_sync= 'now signal go';
+connection default;
+select * from t;
+a c d
+10 777 qwe
+2 777 qwe
+3 777 qwe
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for go';
+alter table t drop c, algorithm=copy;
+connection con1;
+set debug_sync= 'now wait_for downgraded';
+xa start 'xid';
+update t set a = 0;
+xa end 'xid';
+xa prepare 'xid';
+xa commit 'xid';
+set debug_sync= 'now signal go';
+connection default;
+select * from t;
+a d
+0 qwe
+0 qwe
+0 qwe
+drop table t;
+#
+# MDEV-32803 Assertion `total == 0' failed in Event_log::write_cache_raw
+#
+create or replace table t1 (a int) engine=aria;
+insert t1 values (5);
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+alter table t1 add b int NULL, algorithm= copy, lock= none;
+connection con2;
+set debug_sync= 'now WAIT_FOR ended';
+begin;
+insert into t1 values (123);
+insert into t1 values (456), (789);
+commit;
+set debug_sync= 'now SIGNAL end';
+connection default;
+select * from t1;
+a b
+5 NULL
+123 NULL
+456 NULL
+789 NULL
+drop table t1;
+# MDEV-32614 LeakSanitizer errors in copy_data_between_tables
+create table t (a int, b int) engine=aria;
+insert into t select seq, seq from seq_1_to_5;
+backup stage start;
+connect con_lock,localhost,root,,;
+set lock_wait_timeout= 1;
+set debug_sync='copy_data_between_tables_before_reset_backup_lock signal backup wait_for continue';
+alter table t add index (b), algorithm=copy, lock=none;
+connection default;
+set debug_sync='now wait_for backup';
+backup stage block_commit;
+set debug_sync='now signal continue';
+connection con_lock;
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+disconnect con_lock;
+connection default;
+backup stage end;
+alter table t add index (a), algorithm=copy, lock=none;
+connection default;
+drop table t;
+set global default_storage_engine= MyISAM;
+disconnect con1;
+disconnect con2;
+#
+# End of 11.2 tests
+#
diff --git a/mysql-test/main/alter_table_online_debug.test b/mysql-test/main/alter_table_online_debug.test
new file mode 100644
index 00000000..64b73157
--- /dev/null
+++ b/mysql-test/main/alter_table_online_debug.test
@@ -0,0 +1,2107 @@
+--source include/have_debug_sync.inc
+--source include/not_embedded.inc
+--source include/binlog_combinations.inc
+--source include/have_innodb.inc
+--source include/have_sequence.inc
+--source include/have_partition.inc
+
+let $default_storage_engine= `select @@global.default_storage_engine`;
+set global default_storage_engine= innodb;
+set default_storage_engine= innodb;
+--connect (con2, localhost, root,,)
+--connection default
+
+--echo #
+--echo # Test insert
+--echo #
+
+--echo # Insert and add column
+create or replace table t1 (a int);
+insert t1 values (5);
+
+--connection con2
+--send
+set debug_sync= 'now WAIT_FOR ended';
+
+--connection default
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+
+--send
+alter table t1 add b int NULL, algorithm= copy, lock= none;
+
+--connection con2
+--reap
+insert into t1 values (123), (456), (789);
+set debug_sync= 'now SIGNAL end';
+
+--connection default
+--enable_info
+--reap
+--disable_info
+select * from t1;
+
+--echo # Insert, error
+create or replace table t1 (a int);
+insert t1 values (5), (5);
+
+--connection con2
+--send
+set debug_sync= 'now WAIT_FOR ended';
+
+--connection default
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+
+--send
+alter table t1 nowait add unique (a), algorithm= copy, lock= none;
+
+--connection con2
+--reap
+start transaction;
+insert into t1 values (123), (456), (789);
+set debug_sync= 'now SIGNAL end';
+
+--connection default
+--error ER_DUP_ENTRY
+--reap
+--connection con2
+commit;
+--connection default
+--disable_view_protocol
+select variable_value into @otd from information_schema.session_status where variable_name='Opened_table_definitions';
+select * from t1;
+select variable_value-@otd from information_schema.session_status where variable_name='Opened_table_definitions';
+--enable_view_protocol
+
+--echo # long transaction and add column
+create or replace table t1 (a int);
+insert t1 values (5);
+
+--connection con2
+--send
+set debug_sync= 'now WAIT_FOR ended';
+
+--connection default
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+--send
+alter table t1 nowait add b int NULL, algorithm= copy, lock= none;
+
+--connection con2
+--reap
+start transaction;
+insert into t1 values (123), (456), (789);
+set debug_sync= 'now SIGNAL end';
+
+--connection default
+--error ER_LOCK_WAIT_TIMEOUT
+--reap
+select * from t1;
+--connection con2
+rollback;
+--connection default
+
+--echo # Insert and add NOT NULL column without default value
+create or replace table t1 (a int);
+insert t1 values (5);
+
+--connection con2
+--send
+set debug_sync= 'now WAIT_FOR ended';
+
+--connection default
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+
+--send
+alter table t1 add b int NOT NULL, algorithm= copy, lock= none;
+
+--connection con2
+--reap
+insert into t1 values (123), (456), (789);
+set debug_sync= 'now SIGNAL end';
+
+--connection default
+--reap
+select * from t1;
+
+--echo # Insert and add a column with a default value
+create or replace table t1 (a int);
+insert t1 values (5);
+
+--connection con2
+--send
+set debug_sync= 'now WAIT_FOR ended';
+
+--connection default
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+
+--send
+alter table t1 add b int NOT NULL default (222), algorithm= copy, lock= none;
+
+--connection con2
+--reap
+insert into t1 values (123), (456), (789);
+set debug_sync= 'now SIGNAL end';
+
+--connection default
+--reap
+select * from t1;
+
+--echo #
+--echo # Test update
+--echo #
+
+--echo # Update and add a column
+create or replace table t1 (a int primary key, b int);
+insert t1 values (1, 22);
+insert t1 values (3, 44);
+
+--connection con2
+--send
+set debug_sync= 'now WAIT_FOR ended';
+
+--connection default
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+
+--send
+alter table t1 add c int default(1),
+ algorithm= copy, lock= none;
+
+--connection con2
+--reap
+update t1 set b= 55 where a = 1;
+set debug_sync= 'now SIGNAL end';
+
+--connection default
+--enable_info
+--reap
+--disable_info
+select * from t1;
+
+--echo # Update and add a column in the middle
+create or replace table t1 (a int primary key, b int);
+insert t1 values (1, 22);
+insert t1 values (3, 44);
+
+--connection con2
+--send
+set debug_sync= 'now WAIT_FOR ended';
+
+--connection default
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+
+--send
+alter table t1 add c int default(1) after a,
+ algorithm= copy, lock= none;
+
+--connection con2
+--reap
+update t1 set b= 55 where a = 1;
+set debug_sync= 'now SIGNAL end';
+
+--connection default
+--reap
+select * from t1;
+
+--echo #
+--echo # Test primary key change
+--echo #
+
+--echo # Drop key, add key
+create or replace table t1 (a int primary key, b int);
+insert t1 values (1, 22);
+insert t1 values (3, 44);
+
+--connection con2
+--send
+set debug_sync= 'now WAIT_FOR ended';
+
+--connection default
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+
+--send
+alter table t1 drop primary key, add primary key(b),
+ algorithm= copy, lock= none;
+
+--connection con2
+--reap
+update t1 set b= 55 where a = 1;
+set debug_sync= 'now SIGNAL end';
+
+--connection default
+--reap
+select * from t1;
+
+--echo # Drop key, add key. Two updates
+create or replace table t1 (a int primary key, b int);
+insert t1 values (1, 11);
+insert t1 values (2, 22);
+
+--connection con2
+--send
+set debug_sync= 'now WAIT_FOR ended';
+
+--connection default
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+
+--send
+alter table t1 drop primary key, add primary key(b),
+ algorithm= copy, lock= none;
+
+--connection con2
+--reap
+update t1 set b= 33 where a = 1;
+update t1 set b= 44 where a = 2;
+
+set debug_sync= 'now SIGNAL end';
+
+--connection default
+--reap
+select * from t1;
+
+--echo #
+--echo # Various tests, see below
+--echo #
+
+create or replace table t1 (a int primary key, b int);
+insert t1 values (1, 11);
+insert t1 values (2, 22);
+insert t1 values (3, 33);
+insert t1 values (4, 44);
+insert t1 values (5, 55);
+insert t1 values (6, 66);
+insert t1 values (7, 77);
+insert t1 values (8, 88);
+insert t1 values (9, 99);
+
+--connection con2
+--send
+set debug_sync= 'now WAIT_FOR ended';
+
+--connection default
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+
+--send
+alter table t1 drop primary key, add primary key(b),
+ algorithm= copy, lock= none;
+
+--connection con2
+--reap
+
+--echo # Two updates
+update t1 set b= 1001 where a = 1;
+update t1 set b= 2002 where a = 2;
+
+--echo # Two updates in transaction
+set autocommit = 0;
+start transaction;
+update t1 set b= 3003 where a = 3;
+update t1 set b= 4004 where a = 4;
+commit;
+set autocommit = 1;
+
+--echo # Second update is rolled back
+update t1 set b= 5005 where a = 5;
+
+set autocommit = 0;
+start transaction;
+update t1 set b= 6006 where a = 6;
+rollback;
+set autocommit = 1;
+
+--echo # Second execution in transaction fails
+
+set autocommit = 0;
+start transaction;
+update t1 set b= 7007 where a = 7;
+--error ER_DUP_ENTRY
+update t1 set a= 8, b= 8008 where a = 8 or a = 9 order by a;
+commit;
+set autocommit = 1;
+
+select * from t1;
+
+set debug_sync= 'now SIGNAL end';
+
+--connection default
+--reap
+--sorted_result
+select * from t1;
+
+--echo #
+--echo # MYISAM. Only Inserts can be tested.
+--echo # (everything else is a table lock disallowing concurrent reads)
+--echo #
+
+create or replace table t1 (a int) engine=myisam;
+insert t1 values (5);
+
+--connection con2
+--send
+set debug_sync= 'now WAIT_FOR ended';
+
+--connection default
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+
+--send
+alter table t1 add b int NULL, algorithm= copy, lock= none;
+
+--connection con2
+--reap
+insert into t1 values (123), (456), (789);
+set debug_sync= 'now SIGNAL end';
+
+--connection default
+--reap
+select * from t1;
+
+--echo # MYISAM + error
+
+create or replace table t1 (a int primary key) engine=myisam;
+insert t1 values (5);
+
+--connection con2
+--send
+set debug_sync= 'now WAIT_FOR ended';
+
+--connection default
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+
+--send
+alter table t1 add b int NULL, algorithm= copy, lock= none;
+
+--connection con2
+--reap
+--error ER_DUP_ENTRY,ER_DUP_KEY
+insert into t1 values (1),(2),(3),(4),(5),(6);
+select * from t1;
+set debug_sync= 'now SIGNAL end';
+
+--connection default
+--reap
+select * from t1;
+
+--echo # Aria + error
+
+set @@binlog_format=row; # otherwise aria upgrades the lock to TL_READ_NO_INSERT
+create or replace table t1 (a int primary key) engine=aria;
+insert t1 values (5);
+
+--connection con2
+--send
+set debug_sync= 'now WAIT_FOR ended';
+
+--connection default
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+
+--send
+alter table t1 add b int NULL, algorithm= copy, lock= none;
+
+--connection con2
+--reap
+--error ER_DUP_ENTRY
+insert into t1 values (1),(2),(3),(4),(5),(6);
+select * from t1;
+set debug_sync= 'now SIGNAL end';
+
+--connection default
+--reap
+select * from t1;
+set @@binlog_format=default;
+
+--echo # Test incompatible changes
+create or replace table t1 (a int primary key, b int);
+insert t1 values (1, 22);
+insert t1 values (3, 44);
+
+--connection con2
+--send
+set debug_sync= 'now WAIT_FOR ended';
+
+--connection default
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+
+--send
+alter table t1 drop primary key, add primary key(b),
+ algorithm= copy, lock= none;
+
+--connection con2
+--reap
+update t1 set b= 44 where a = 1;
+set debug_sync= 'now SIGNAL end';
+
+--connection default
+--error ER_DUP_ENTRY
+--reap
+select * from t1;
+
+--echo # Test log read after EXCLUSIVE lock
+--echo # Transaction is started before ALTER, and UPDATE is made.
+--echo # Then more UPDATEs.
+
+create or replace table t1 (a int primary key, b int);
+insert t1 values (1, 11);
+insert t1 values (2, 22);
+insert t1 values (3, 33);
+insert t1 values (4, 44);
+insert t1 values (5, 55);
+
+set debug_sync= 'alter_table_online_before_lock SIGNAL locking WAIT_FOR end';
+set debug_sync= 'alter_table_online_downgraded SIGNAL downgraded';
+
+--send
+alter table t1 drop primary key, add primary key(b),
+ algorithm= copy, lock= none;
+
+--connection con2
+begin;
+
+set debug_sync= 'now WAIT_FOR downgraded';
+update t1 set b= 111 where a = 1;
+
+set debug_sync= 'now WAIT_FOR locking';
+set debug_sync= 'now SIGNAL end';
+
+update t1 set b= 222 where a = 2;
+update t1 set b= 333 where a = 3;
+update t1 set b= 444 where a = 4;
+
+commit;
+
+update t1 set b= 555 where a = 5;
+
+--connection default
+--reap
+select * from t1;
+
+--echo #
+--echo # Test progress report.
+--echo #
+
+create or replace table t1 (a int primary key, b int);
+insert t1 values (1, 11);
+insert t1 values (2, 22);
+insert t1 values (3, 33);
+insert t1 values (4, 44);
+
+set debug_sync= 'alter_table_online_before_lock SIGNAL locking WAIT_FOR end';
+set debug_sync= 'alter_table_online_downgraded SIGNAL downgraded'
+ ' WAIT_FOR start_replication';
+set debug_sync= 'alter_table_online_progress SIGNAL applied WAIT_FOR proceed'
+ ' EXECUTE 9';
+--let $con= `select connection_id()`
+
+--send
+alter table t1 drop primary key, add primary key(b),
+ algorithm= copy, lock= none;
+
+--connection con2
+
+set debug_sync= 'now WAIT_FOR downgraded';
+
+update t1 set b= 111 where a = 1;
+insert t1 values (5, 55);
+update t1 set b= 555 where a = 5;
+insert t1 values (6, 66);
+update t1 set b= 666 where a = 6;
+set debug_sync= 'now SIGNAL start_replication';
+
+--disable_query_log
+eval set @con= $con;
+--enable_query_log
+
+--echo # First signal is for log description event.
+set debug_sync= 'now WAIT_FOR applied';
+select stage, progress, examined_rows from INFORMATION_SCHEMA.PROCESSLIST where id = @con;
+set debug_sync= 'now SIGNAL proceed WAIT_FOR applied';
+
+select stage, progress, examined_rows from INFORMATION_SCHEMA.PROCESSLIST where id = @con;
+set debug_sync= 'now SIGNAL proceed WAIT_FOR applied';
+
+select stage, progress, examined_rows from INFORMATION_SCHEMA.PROCESSLIST where id = @con;
+set debug_sync= 'now SIGNAL proceed WAIT_FOR applied';
+
+select stage, progress, examined_rows from INFORMATION_SCHEMA.PROCESSLIST where id = @con;
+set debug_sync= 'now SIGNAL proceed WAIT_FOR applied';
+
+select stage, progress, examined_rows from INFORMATION_SCHEMA.PROCESSLIST where id = @con;
+set debug_sync= 'now SIGNAL proceed WAIT_FOR applied';
+
+select stage, progress, examined_rows from INFORMATION_SCHEMA.PROCESSLIST where id = @con;
+set debug_sync= 'now SIGNAL proceed WAIT_FOR locking';
+
+begin;
+
+update t1 set b= 222 where a = 2;
+update t1 set b= 333 where a = 3;
+update t1 set b= 444 where a = 4;
+
+commit;
+set debug_sync= 'now SIGNAL end WAIT_FOR applied';
+
+select stage, progress, examined_rows from INFORMATION_SCHEMA.PROCESSLIST where id = @con;
+set debug_sync= 'now SIGNAL proceed WAIT_FOR applied';
+
+select stage, progress, examined_rows from INFORMATION_SCHEMA.PROCESSLIST where id = @con;
+set debug_sync= 'now SIGNAL proceed WAIT_FOR applied';
+
+select stage, progress, examined_rows from INFORMATION_SCHEMA.PROCESSLIST where id = @con;
+set debug_sync= 'now SIGNAL proceed';
+
+--connection default
+--reap
+select * from t1;
+
+--echo #
+--echo # Test system versioning
+--echo #
+create or replace table t1 (a int primary key, b int);
+insert t1 values (1, 22);
+insert t1 values (3, 44);
+
+--connection con2
+--send
+set debug_sync= 'now WAIT_FOR ended';
+
+--connection default
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+
+set timestamp = 1;
+
+--send
+alter table t1 add system versioning,
+ algorithm= copy, lock= none;
+
+--connection con2
+--reap
+set timestamp = 2;
+update t1 set b= 55 where a = 1;
+set timestamp = 3;
+insert into t1 values (6, 77);
+
+set debug_sync= 'now SIGNAL end';
+
+--connection default
+--reap
+show create table t1;
+select *, UNIX_TIMESTAMP(row_start), UNIX_TIMESTAMP(row_end) from t1 for system_time all;
+
+## at the moment DROP SYSTEM VERSIONING cannot be done online
+## because it not only alters the structure, but also deletes history rows
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table t1 drop system versioning, algorithm= copy, lock= none;
+#--connection con2
+#--send
+#set debug_sync= 'now WAIT_FOR ended';
+#
+#--connection default
+#set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+#
+#--send
+#alter table t1 drop system versioning,
+# algorithm= copy, lock= none;
+#
+#--connection con2
+#--reap
+#update t1 set b= 88 where a = 1;
+#
+#set debug_sync= 'now SIGNAL end';
+#
+#--connection default
+#--reap
+#show create table t1;
+#select *, UNIX_TIMESTAMP(row_start), UNIX_TIMESTAMP(row_end) from t1 for system_time all;
+#
+#--connection con2
+#--send
+#set debug_sync= 'now WAIT_FOR ended';
+#
+#--connection default
+#set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+#
+#--send
+#alter table t1 drop system versioning,
+# algorithm= copy, lock= none;
+#
+#--connection con2
+#--reap
+#insert into t1 values (8, 99);
+#
+#set debug_sync= 'now SIGNAL end';
+#
+#--connection default
+#--reap
+#show create table t1;
+#select * from t1;
+drop table t1;
+
+--echo #
+--echo # Test ROLLBACK TO SAVEPOINT
+--echo #
+
+create or replace table t1 (a int);
+insert t1 values (1), (2);
+
+create or replace table t2 (a int);
+insert t2 values (1), (2);
+
+--connection con2
+begin;
+update t2 set a= 222 where a = 2;
+savepoint savie;
+update t2 set a= 111 where a = 1;
+
+--send
+set debug_sync= 'now WAIT_FOR ended';
+
+--connection default
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+
+--send
+alter table t1 add b int NULL, algorithm= copy, lock= none;
+
+--connection con2
+--reap
+update t1 set a= 123 where a = 1;
+
+savepoint whoopsie;
+
+rollback to savepoint savie;
+commit;
+
+set debug_sync= 'now SIGNAL end';
+
+--connection default
+--reap
+
+select * from t1;
+select * from t2;
+
+
+create or replace table t1 (a int);
+insert t1 values (1), (2);
+
+create or replace table t2 (a int);
+insert t2 values (1), (2);
+
+create or replace table t3 (a int) engine=myisam;
+insert t3 values (1);
+
+--connection con2
+begin;
+update t2 set a= 222 where a = 2;
+savepoint savie;
+update t2 set a= 111 where a = 1;
+
+--send
+set debug_sync= 'now WAIT_FOR ended';
+
+--connection default
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+
+--send
+alter table t1 add b int NULL, algorithm= copy, lock= none;
+
+--connection con2
+--reap
+update t1 set a= 222 where a = 2;
+--disable_view_protocol
+savepoint whoopsie;
+update t1 set a= 123 where a = 1;
+insert t3 values (2);
+
+select * from t1;
+rollback to savepoint whoopsie;
+select * from t1;
+select * from t3;
+commit;
+--enable_view_protocol
+
+set debug_sync= 'now SIGNAL end';
+
+--connection default
+--reap
+
+select * from t1;
+select * from t2;
+select * from t3;
+
+--echo # Cleanup
+set debug_sync= 'reset';
+drop table t1;
+drop table t2;
+drop table t3;
+
+#
+# Lossy alter, Update_row_log_event cannot find 'abcde2' in the new table
+#
+create table t1 (a char(6), b int);
+insert t1 values ('abcde1',1),('abcde2',2);
+--send set debug_sync= 'now wait_for downgraded'
+--connection con2
+set sql_mode='';
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send alter table t1 modify a char(4), algorithm=copy, lock=none
+--connection default
+--reap
+update t1 set b=b+10 where a='abcde2';
+select * from t1;
+set debug_sync= 'now signal goforit';
+--connection con2
+--reap
+set sql_mode=default;
+--connection default
+show create table t1;
+select * from t1;
+drop table t1;
+set debug_sync= 'reset';
+
+--echo #
+--echo # MDEV-28930 ALTER TABLE Deadlocks with parallel TL_WRITE
+--echo #
+create table t1(a int) engine=myisam select 1;
+
+set debug_sync='alter_table_online_before_lock SIGNAL ready WAIT_FOR go_for_locking';
+--send
+alter table t1 force;
+
+--connection con2
+set debug_sync='now WAIT_FOR ready';
+set debug_sync='thr_multi_lock_before_thr_lock SIGNAL go_for_locking';
+update t1 set a=2;
+
+--connection default
+--reap
+
+set debug_sync='alter_table_online_before_lock SIGNAL ready WAIT_FOR go_for_locking';
+--send
+alter table mysql.global_priv force;
+
+--connection con2
+set debug_sync='now WAIT_FOR ready';
+set debug_sync='thr_multi_lock_before_thr_lock SIGNAL go_for_locking';
+create user user1@localhost;
+
+--connection default
+--reap
+
+set debug_sync=reset;
+drop user user1@localhost;
+drop table t1;
+
+--echo #
+--echo # MDEV-28959 Online alter ignores strict table mode
+--echo #
+create table t1 (a int);
+insert into t1 values (1),(2),(3);
+--send set debug_sync= 'now wait_for downgraded'
+
+--connection con2
+set sql_mode='STRICT_TRANS_TABLES,STRICT_ALL_TABLES';
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send alter table t1 modify a int not null, algorithm=copy, lock=none
+
+--connection default
+--reap
+insert into t1 values (null),(null);
+set debug_sync= 'now signal goforit';
+
+--connection con2
+--error WARN_DATA_TRUNCATED
+--reap
+show create table t1;
+select * from t1;
+set sql_mode=default;
+--connection default
+drop table t1;
+set debug_sync= reset;
+
+--echo #
+--echo # MDEV-28967 Assertion `marked_for_write_or_computed()' failed in Field_new_decimal::store_value / online_alter_read_from_binlog`
+--echo #
+create table t1 (a decimal(8,2), b varchar(8));
+insert into t1 (b) values ('x');
+
+--send set debug_sync= 'now wait_for downgraded'
+
+--connection con2
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send alter table t1 force, algorithm=copy, lock=none
+
+--connection default
+--reap
+insert t1 (b) values ('k');
+insert t1 (b) values ('m');
+set debug_sync= 'now signal goforit';
+
+--connection con2
+--reap
+--connection default
+drop table t1;
+set debug_sync= reset;
+
+--echo #
+--echo # MDEV-29021 ALTER TABLE fails when a stored virtual column is dropped and added
+--echo #
+create table t1 (a char(9), b char(9) as (a) stored);
+insert into t1(a) values ('foobar');
+
+--send set debug_sync= 'now wait_for downgraded'
+
+--connection con2
+set sql_mode='';
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send alter table t1 drop b, add b char(3) as (a) stored, algorithm=copy, lock=none
+
+--connection default
+--reap
+update t1 set a = 'foobarqux';
+set debug_sync= 'now signal goforit';
+
+--connection con2
+--reap
+set sql_mode=default;
+--connection default
+drop table t1;
+set debug_sync= reset;
+
+--echo # (duplicate) MDEV-29007 Assertion `marked_for_write_or_computed()'
+--echo # failed upon online ADD COLUMN .. FIRST
+create table t (a int);
+insert into t values (1),(2);
+--send
+set debug_sync= 'now wait_for downgraded';
+
+--connection con2
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send
+alter table t add c int first, algorithm=copy, lock=none;
+
+--connection default
+--reap
+insert into t values (3);
+set debug_sync= 'now signal goforit';
+
+--connection con2
+--reap
+--connection default
+drop table t;
+set debug_sync= reset;
+
+--echo # UNIQUE blob duplicates are not ignored.
+
+create table t1 (b blob);
+insert into t1 values ('foo'),('bar');
+--send
+set debug_sync= 'now wait_for downgraded';
+
+--connection con2
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send
+alter table t1 add unique(b), algorithm=copy, lock=none;
+
+--connection default
+--reap
+insert into t1 values ('qux'),('foo');
+set debug_sync= 'now signal goforit';
+
+--connection con2
+--error ER_DUP_ENTRY
+--reap
+select * from t1;
+show create table t1;
+
+# Cleanup
+--connection default
+drop table t1;
+set debug_sync= reset;
+
+--echo #
+--echo # DELETE with added virtual column
+--echo #
+CREATE TABLE t1 (a CHAR(3), b CHAR(3) AS (a));
+INSERT INTO t1 (a) VALUES ('foo'),('bar');
+--send
+set debug_sync= 'now wait_for downgraded';
+
+--connection con2
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send
+ALTER TABLE t1 ADD c INT, ALGORITHM=COPY, LOCK=NONE;
+
+--connection default
+--reap
+DELETE FROM t1;
+set debug_sync= 'now signal goforit';
+
+--connection con2
+--reap
+select * from t1;
+
+--connection default
+DROP TABLE t1;
+set debug_sync= reset;
+
+--echo #
+--echo # Do not ignore sql_mode when replicating
+--echo #
+create table t1 (a int);
+insert into t1 values (1);
+
+--send set debug_sync= 'now wait_for downgraded'
+
+--connection con2
+set sql_mode='STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO';
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send alter table t1 add b int as (1/a) stored, algorithm=copy, lock=none
+
+--connection default
+--reap
+update t1 set a= 0 where a=1;
+set debug_sync= 'now signal goforit';
+
+--connection con2
+--error ER_DIVISION_BY_ZERO
+--reap
+
+set sql_mode= default;
+--connection default
+drop table t1;
+set debug_sync= reset;
+
+--echo #
+--echo # MDEV-29067 Online alter ignores check constraint violation
+--echo #
+
+--echo ## CHECK, INSERT
+create table t1 (a int);
+insert t1 values (1),(2);
+--send set debug_sync= 'now wait_for downgraded'
+--connection con2
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send alter table t1 add check (a<10), algorithm=copy, lock=none
+--connection default
+--reap
+insert t1 values (11),(12);
+set debug_sync= 'now signal goforit';
+--connection con2
+--error ER_CONSTRAINT_FAILED
+--reap
+--connection default
+show create table t1;
+select * from t1;
+drop table t1;
+
+--echo ## DEFAULT, INSERT
+create table t1 (a int);
+insert t1 values (1),(2);
+--send set debug_sync= 'now wait_for downgraded'
+--connection con2
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send alter table t1 add b int default(a+10), algorithm=copy, lock=none
+--connection default
+--reap
+insert t1 values (11),(12);
+set debug_sync= 'now signal goforit';
+--connection con2
+--reap
+--connection default
+show create table t1;
+select * from t1;
+drop table t1;
+set debug_sync= 'reset';
+
+--echo ## CHECK, UPDATE
+create table t1 (a int);
+insert t1 values (1),(2),(3),(4);
+--send set debug_sync= 'now wait_for downgraded'
+--connection con2
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send alter table t1 add check (a<10), algorithm=copy, lock=none
+--connection default
+--reap
+update t1 set a=a+10 where a > 2;
+set debug_sync= 'now signal goforit';
+--connection con2
+--error ER_CONSTRAINT_FAILED
+--reap
+--connection default
+show create table t1;
+select * from t1;
+drop table t1;
+
+--echo ## DEFAULT, UPDATE
+create table t1 (a int);
+insert t1 values (1),(2),(3),(4);
+--send set debug_sync= 'now wait_for downgraded'
+--connection con2
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send alter table t1 add b int default(a), algorithm=copy, lock=none
+--connection default
+--reap
+update t1 set a=a+10 where a > 2;
+insert t1 values(5);
+update t1 set a=a+10 where a = 5;
+
+set debug_sync= 'now signal goforit';
+--connection con2
+--reap
+--connection default
+show create table t1;
+select * from t1;
+drop table t1;
+set debug_sync= 'reset';
+
+--echo ## VCOL + CHECK
+create table t1 (a int);
+insert t1 values (1),(2),(3),(4);
+--send set debug_sync= 'now wait_for downgraded'
+--connection con2
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send alter table t1 add b int as (a), add check(b=a), algorithm=copy, lock=none
+--connection default
+--reap
+update t1 set a=a+10 where a > 2;
+insert t1 values(5);
+update t1 set a=a+10 where a = 5;
+
+set debug_sync= 'now signal goforit';
+--connection con2
+--reap
+--connection default
+show create table t1;
+select * from t1;
+drop table t1;
+set debug_sync= 'reset';
+
+--echo #
+--echo # MDEV-29013 ER_KEY_NOT_FOUND/lock timeout upon online alter
+--echo # with long unique indexes
+--echo #
+create table t1 (b text not null, unique(b));
+insert into t1 values ('foo'),('bar');
+--send
+set debug_sync= 'now wait_for downgraded';
+
+--connection con2
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send
+alter table t1 add c int, algorithm=copy, lock=none;
+
+--connection default
+--reap
+delete from t1;
+set debug_sync= 'now signal goforit';
+
+--connection con2
+--reap
+
+--connection default
+drop table t1;
+set debug_sync= reset;
+
+--echo ###
+
+create table t1 (a text, unique(a));
+create table t2 (b text, unique(b));
+insert into t2 values (null),(null);
+--send
+set debug_sync= 'now wait_for downgraded';
+
+--connection con2
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send
+alter table t2 add column c int, algorithm=copy, lock=none;
+
+--connection default
+--reap
+delete from t2;
+set debug_sync= 'now signal goforit';
+
+--connection con2
+--reap
+
+--connection default
+alter table t2 force;
+alter table t1 force;
+
+drop table t1, t2;
+set debug_sync= reset;
+
+--echo #
+--echo # MDEV-29038 XA assertions failing in binlog_rollback and binlog_commit
+--echo #
+create table t (a int);
+insert into t values (1);
+xa begin 'xid';
+--send
+set debug_sync= 'now wait_for downgraded';
+
+--connect (con1,localhost,root,,test)
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send
+alter table t force, algorithm=copy, lock=none;
+
+--connection default
+--reap
+insert into t values (2);
+set debug_sync= 'now signal goforit';
+xa end 'xid';
+xa rollback 'xid';
+
+xa begin 'xid';
+--connection con1
+--reap
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send
+alter table t force, algorithm=copy, lock=none;
+
+--connection default
+set debug_sync= 'now wait_for downgraded';
+insert into t values (3);
+set debug_sync= 'now signal goforit';
+xa end 'xid';
+xa commit 'xid' one phase;
+
+# Cleanup
+--connection con1
+--reap
+--connection default
+drop table t;
+set debug_sync= reset;
+
+--echo #
+--echo # MDEV-29069 ER_KEY_NOT_FOUND upon online autoinc addition and
+--echo # concurrent DELETE
+--echo #
+set @old_dbug=@@debug_dbug;
+set debug_dbug="+d,rpl_report_chosen_key";
+
+# UB
+#
+# create table t (a int);
+# insert into t values (10),(20),(30);
+#
+# set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+# --send
+# alter table t add pk int auto_increment primary key, algorithm=copy, lock=none;
+# --connection con2
+# set debug_sync= 'now wait_for downgraded';
+# delete from t where a = 20;
+# update t set a = a + 1 where a = 10;
+# set debug_sync= 'now signal goforit';
+#
+# --connection default
+# --reap
+# select * from t;
+
+--echo #
+--echo # Add clumsy DEFAULT
+--echo #
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send
+alter table t add b int default(RAND() * 20), add key(b),
+ algorithm=copy, lock=none;
+--connection con2
+set debug_sync= 'now wait_for downgraded';
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+set debug_sync= 'now signal goforit';
+--connection default
+--reap
+select a from t;
+
+--echo # CURRENT_TIMESTAMP
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send
+alter table t add b timestamp default CURRENT_TIMESTAMP, add key(b),
+ algorithm=copy, lock=none;
+--connection con2
+set debug_sync= 'now wait_for downgraded';
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+set debug_sync= 'now signal goforit';
+--connection default
+--reap
+select a from t;
+
+--echo # CURRENT_TIMESTAMP, mixed key
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send
+alter table t add b timestamp default CURRENT_TIMESTAMP, add key(a, b),
+ algorithm=copy, lock=none;
+--connection con2
+set debug_sync= 'now wait_for downgraded';
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+set debug_sync= 'now signal goforit';
+
+--connection default
+--reap
+select a from t;
+
+--echo # Mixed primary key
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send
+alter table t add b int default (a+1), add primary key(b, a),
+ algorithm=copy, lock=none;
+--connection con2
+set debug_sync= 'now wait_for downgraded';
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+set debug_sync= 'now signal goforit';
+
+--connection default
+--reap
+select a from t;
+
+--echo #
+--echo # Normal row, could be used as a key
+--echo #
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send
+alter table t add b int as (a * 10) unique, algorithm=copy, lock=none;
+--connection con2
+set debug_sync= 'now wait_for downgraded';
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+set debug_sync= 'now signal goforit';
+
+--connection default
+--reap
+
+--echo #
+--echo # Add key for old row
+--echo #
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send
+alter table t add unique(a), algorithm=copy, lock=none;
+--connection con2
+set debug_sync= 'now wait_for downgraded';
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+set debug_sync= 'now signal goforit';
+
+--connection default
+--reap
+
+
+--echo #
+--echo # Useful UNIQUE, though a virtual column on another extra field
+--echo #
+create or replace table t (a int primary key, b int default (a+1));
+insert into t values (10, 10),(20, 20),(30, 30);
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send
+alter table t drop primary key, add c int default(a),
+ add d int as (c) stored unique, algorithm=copy, lock=none;
+--connection con2
+set debug_sync= 'now wait_for downgraded';
+delete from t where a = 20;
+update t set a = a + 2 where a = 10;
+set debug_sync= 'now signal goforit';
+--connection default
+--reap
+select * from t;
+
+--echo #
+--echo # Now this index is not usable (missing DEFAULT on field c)
+--echo #
+create or replace table t (a int primary key, b int);
+insert into t values (10, 10),(20, 20),(30, 30);
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
+--send
+alter table t drop primary key, add c real default(rand(a)),
+ add d real as (c) stored unique, algorithm=copy, lock=none;
+--connection con2
+set debug_sync= 'now wait_for downgraded';
+delete from t where a = 20;
+update t set a = a + 2 where a = 10;
+set debug_sync= 'now signal goforit';
+--connection default
+--reap
+select a, b from t;
+
+# Cleanup
+drop table t;
+set debug_sync= reset;
+set debug_dbug= @old_dbug;
+--connection default
+
+--echo #
+--echo # MDEV-30902 Server crash in LEX::first_lists_tables_same
+--echo #
+create table t1 engine=myisam select 1 as x ;
+create procedure p() alter table t1 engine=heap;
+
+set debug_sync= 'alter_table_copy_end signal ended wait_for end';
+send call p;
+
+--connection con1
+set debug_sync= 'now wait_for ended';
+insert into t1 values (2);
+set debug_sync= 'now signal end';
+
+--connection default
+--reap
+call p;
+
+drop table t1;
+drop procedure p;
+set debug_sync=reset;
+
+--echo #
+--echo # MDEV-30902 Server crash in LEX::first_lists_tables_same
+--echo #
+create table t (id int, s date, e date, period for p(s,e),
+ unique(id, p without overlaps)) engine=aria;
+insert into t values (1,'1971-01-01','1971-01-02');
+
+set debug_sync= 'alter_table_online_before_lock signal lock wait_for goon';
+send alter table t force;
+
+--connection con1
+set debug_sync= 'now wait_for lock';
+delete from t;
+set debug_sync= 'now signal goon';
+
+--connection default
+--reap
+drop table t;
+
+--echo #
+--echo # MDEV-30924 Server crashes in MYSQL_LOG::is_open upon ALTER vs FUNCTION
+--echo #
+create table t (a int);
+insert into t values (1),(2);
+
+--delimiter $
+create function f () returns int
+begin
+ update t set a = 10;
+ return 0;
+end $
+--delimiter ;
+
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goon';
+send alter table t force, algorithm=copy;
+
+--connection con1
+set debug_sync= 'now wait_for downgraded';
+select f();
+set debug_sync= 'now signal goon';
+
+--connection default
+--reap
+drop table t;
+drop function f;
+
+--echo # Partitioning
+create or replace table t1 (a serial);
+insert t1 values (5), (6), (7);
+
+set debug_sync= 'alter_table_online_downgraded SIGNAL downgraded wait_for goon';
+send alter table t1 ENGINE=InnoDB, ALGORITHM=COPY, LOCK=NONE
+ PARTITION BY HASH(a) PARTITIONS 5;
+
+--connection con1
+set debug_sync= 'now WAIT_FOR downgraded';
+insert into t1 values (123), (456), (789);
+update t1 set a= a+100;
+set debug_sync= 'now SIGNAL goon';
+
+--connection default
+--reap
+select * from t1;
+
+drop table t1;
+
+--echo #
+--echo # MDEV-31033 ER_KEY_NOT_FOUND upon online COPY ALTER on a partitioned
+--echo # table
+create table t (a int) partition by hash(a) partitions 2;
+insert into t values (1),(3);
+set debug_sync= 'alter_table_online_downgraded SIGNAL downgraded wait_for goon';
+send alter table t force, algorithm=copy, lock=none;
+
+--connection con1
+set debug_sync= 'now WAIT_FOR downgraded';
+update t set a = a + 1;
+insert t values (1),(2);
+delete from t where a = 4 limit 1;
+set debug_sync= 'now SIGNAL goon';
+
+--connection default
+--reap
+
+select * from t;
+
+drop table t;
+
+--echo #
+--echo # MDEV-31043 ER_KEY_NOT_FOUND upon concurrent ALTER and transaction
+--echo #
+let $i=2;
+let local_engine=myisam;
+while ($i) {
+eval create table t (a int, b int) engine=$local_engine;
+insert into t values (1,10),(2,20);
+set debug_sync= 'alter_table_online_before_lock signal burnit wait_for goforit';
+--send
+alter table t add c int, algorithm=copy, lock=none;
+
+--connection con1
+
+set debug_sync= 'now wait_for burnit';
+update t set b = 100;
+start transaction;
+update t set b = 200;
+
+--connection con2
+delete from t order by a limit 1;
+delete from t order by a limit 1;
+select * from t;
+--connection con1
+commit;
+set debug_sync= 'now signal goforit';
+
+--connection default
+--reap
+select * from t;
+drop table t;
+dec $i;
+let local_engine=aria;
+}
+
+--echo #
+--echo # MDEV-30949 Direct leak in binlog_online_alter_end_trans
+--echo #
+create table t (f longblob default null) engine=myisam;
+insert into t values (null);
+
+set debug_sync= "alter_table_copy_end signal copy wait_for goon";
+set debug_sync= "alter_table_online_before_lock signal lock wait_for end";
+
+send alter table t force, algorithm=copy;
+
+--connection con1
+set debug_sync= "now wait_for copy";
+insert into t select repeat('a',130000);
+set debug_sync= "now signal goon wait_for lock";
+insert into t select repeat('a',130000);
+set debug_sync= "now signal end";
+
+
+--connection default
+--reap
+drop table t;
+
+--echo #
+--echo # Test that correct fields are marked as explicit:
+--echo # Drop a, reorder b, add new column with default.
+--echo #
+create table t (a int primary key, b int);
+insert into t values (1, 1), (2, 2), (3, 3);
+
+set debug_sync= "alter_table_copy_end signal copy wait_for goon";
+send alter table t drop primary key, drop a,
+ change b c bigint,
+ add x longblob default 123456;
+
+--connection con1
+set debug_sync= "now wait_for copy";
+
+update t set b = 5 where a = 1;
+update t set b = NULL where a = 1;
+select * from t;
+update t set a = 100 where a = 1;
+update t set b = -10 where a = 100;
+select * from t;
+
+set debug_sync= "now signal goon";
+
+--connection default
+--reap
+select * from t;
+drop table t;
+
+--echo # Test that all the fields are unpacked.
+create table t (a int, b int);
+insert into t values (NULL, 123), (NULL, 456);
+
+set debug_sync= "alter_table_copy_end signal copy wait_for goon";
+send alter table t drop a, add primary key(b), algorithm=copy;
+--connection con1
+set debug_sync= "now wait_for copy";
+update t set b = b + 100;
+
+set debug_sync= "now signal goon";
+
+--connection default
+--reap
+select * from t;
+
+drop table t;
+
+
+set debug_sync= reset;
+let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
+let SEARCH_PATTERN= Slave SQL;
+--source include/search_pattern_in_file.inc
+
+
+--echo #
+--echo # MDEV-31646 Online alter applies binlog cache limit to cache writes
+--echo #
+create table t (pk int primary key, a varchar(100)) engine=MyISAM;
+insert into t select seq, repeat('x', 100) from seq_1_to_500;
+
+set @cache.size= @@max_binlog_cache_size;
+set global max_binlog_cache_size= 4096;
+
+send set debug_sync= 'now wait_for do_updates';
+
+--connection con1
+set debug_sync= 'alter_table_online_progress signal do_updates wait_for go';
+send alter table t add b int, algorithm=copy, lock=none;
+
+--connection default
+--reap
+update t set a = repeat('y', 100);
+show warnings;
+
+set debug_sync= 'now signal go';
+
+--connection con1
+--reap
+show warnings;
+
+--connection default
+drop table t;
+set debug_sync= reset;
+set global max_binlog_cache_size= @cache.size;
+
+--echo # Now make sure that smaller limits will be processed fine
+
+set @old_dbug=@@debug_dbug;
+create table t (pk int primary key, a text) engine=MyISAM;
+insert into t select seq, repeat('x', 1000) from seq_1_to_50;
+
+--connection con1
+set debug_sync= 'alter_table_online_progress signal do_updates wait_for go';
+--send
+alter table t add b int, algorithm=copy, lock=none;
+
+--connection default
+set debug_sync= 'now wait_for do_updates';
+set debug_dbug="+d,online_alter_small_cache";
+--error ER_STMT_CACHE_FULL
+update t set a = repeat('y', 1000);
+show warnings;
+
+set debug_sync= 'now signal go';
+
+--connection con1
+--reap
+show warnings;
+
+--connection default
+drop table t;
+set debug_sync= reset;
+set debug_dbug= @old_dbug;
+
+
+
+
+create table t (id int, a int, b text, primary key (id));
+insert into t values (1,10,''),(2,20,'');
+
+set debug_sync= 'alter_table_online_progress signal do_update wait_for go';
+send alter table t force, algorithm=copy, lock=none;
+
+--connection con1
+set @old_binlog_row_image= @@binlog_row_image;
+set binlog_row_image= noblob;
+set debug_sync= 'now wait_for do_update';
+
+update t set a = 1;
+delete from t where id = 1;
+
+set debug_sync= 'now signal go';
+set binlog_row_image= @old_binlog_row_image;
+
+--connection default
+--reap
+select * from t;
+
+drop table t;
+set debug_sync= reset;
+
+--echo #
+--echo # MDEV-31812 Add switch to old_mode to disable non-locking ALTER
+--echo #
+set @old_old_mode= @@old_mode;
+create or replace table t1 (a int primary key, b int);
+set debug_sync= 'alter_table_copy_end SIGNAL copy_end WAIT_FOR proceed';
+send alter table t1 drop primary key, add primary key(b), algorithm= copy;
+
+--connection con2
+set debug_sync= 'now WAIT_FOR copy_end';
+select if(max_stage = 4, "online", "old") as mode
+ from information_schema.processlist where id = @con;
+set debug_sync= 'now SIGNAL proceed';
+
+--connection default
+--reap
+
+set old_mode= LOCK_ALTER_TABLE_COPY;
+set debug_sync= 'alter_table_copy_end SIGNAL copy_end WAIT_FOR proceed';
+send alter table t1 drop primary key, add primary key(b), algorithm= copy;
+--connection con2
+set debug_sync= 'now WAIT_FOR copy_end';
+select if(max_stage = 4, "online", "old") as mode
+ from information_schema.processlist where id = @con;
+set debug_sync= 'now SIGNAL proceed';
+
+--connection default
+--reap
+
+set debug_sync= 'alter_table_copy_end SIGNAL copy_end WAIT_FOR proceed';
+send alter table t1 drop primary key, add primary key(b),
+ algorithm= copy, lock=none;
+--connection con2
+set debug_sync= 'now WAIT_FOR copy_end';
+
+select if(max_stage = 4, "online", "old") as mode
+ from information_schema.processlist where id = @con;
+set debug_sync= 'now SIGNAL proceed';
+
+--connection default
+--reap
+set old_mode= @old_old_mode;
+drop table t1;
+set debug_sync= reset;
+
+--echo #
+--echo # MDEV-32100 Online ALTER TABLE ends with 1032 under some isolation levels
+--echo #
+
+let $tx_iso_id=4;
+
+create table iso_levels(id int, level text);
+INSERT iso_levels VALUES (0, "READ UNCOMMITTED"),
+ (1, "READ COMMITTED"),
+ (2, "REPEATABLE READ"),
+ (3, "SERIALIZABLE");
+
+while($tx_iso_id) {
+dec $tx_iso_id;
+let tx_iso= `select level from iso_levels where id = $tx_iso_id`;
+
+create table t1 (a int, b int, key(b));
+
+--connection con2
+insert into t1 values (1,1),(null,null),(3,3),(4,null),(null,5);
+
+--connection default
+
+eval set session transaction isolation level $tx_iso;
+set debug_sync= "alter_table_online_downgraded signal downgraded wait_for goalters";
+
+send alter table t1 force, algorithm=copy;
+
+--connection con2
+set debug_sync= "now wait_for downgraded";
+delete from t1 where b is null;
+set debug_sync= "now signal goalters";
+
+--connection default
+--reap
+drop table t1;
+}
+set debug_sync= reset;
+drop table iso_levels;
+
+
+--echo # MDEV-32126 Assertion fails upon online ALTER and binary log enabled
+create temporary table tmp (id int, primary key(id)) engine=innodb;
+create table t1 (a int, b text);
+create table t2 (a int, b int, c char(8), d text, unique(a));
+insert into t2 values (1,1,'f','e'),(1000,1000,'c','b');
+--connection default
+set debug_sync= 'alter_table_online_before_lock signal go_trx wait_for go_alter';
+send alter table t2 force, algorithm=copy, lock=none;
+
+--connection con2
+set debug_sync= 'now wait_for go_trx';
+start transaction;
+insert into t1 values (3,'a');
+--error ER_DUP_ENTRY
+insert into t2 values (3,3,'a','x'), (3,3,'a','x');
+insert into t2 values (3,3,'a','x');
+commit;
+set debug_sync= 'now signal go_alter';
+--connection default
+--reap
+truncate t2;
+set @@binlog_format=mixed;
+--connection con2
+start transaction;
+create temporary table tmp (id int, primary key(id));
+insert into t1 values (1, repeat('x',8000)),(2, repeat('x',8000));
+update t2 set b = null order by b limit 2;
+insert into t1 values (3, repeat('x',8000));
+delete from t1;
+insert into t2 values (1,1,'f','e'),(1000,1000,'c','b');
+commit;
+
+
+--connection default
+set debug_sync= 'alter_table_online_before_lock signal go_trx wait_for go_alter';
+send alter table t2 force, algorithm=copy, lock=none;
+
+--connection con2
+set debug_sync= 'now wait_for go_trx';
+start transaction;
+drop temporary table if exists tmp;
+--error ER_DUP_ENTRY
+insert into t2 values (3,3,'a','x'), (3,3,'a','x');
+insert into t2 values (3,3,'a','x');
+commit;
+set debug_sync= 'now signal go_alter';
+
+--connection default
+--reap
+
+drop table t1, t2;
+set @@binlog_format=default;
+set debug_sync= reset;
+
+
+--echo # MDEV-32444 Data from orphaned XA transaction is lost after online alter
+
+create table t (a int primary key);
+insert into t values (1);
+
+--echo # XA commit
+
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for go';
+send alter table t force, algorithm=copy, lock=none;
+
+--connection con1
+set debug_sync= 'now wait_for downgraded';
+xa begin 'x1';
+update t set a = 2 where a = 1;
+xa end 'x1';
+xa prepare 'x1';
+set debug_sync= 'thread_end signal xa_detach wait_for close';
+--disconnect con1
+
+--connection con2
+set debug_sync= 'now signal close wait_for xa_detach';
+xa commit 'x1';
+set debug_sync= 'now signal go';
+--connection default
+--reap # alter table
+
+select * from t;
+
+--echo # XA rollback
+
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for go';
+send alter table t force, algorithm=copy, lock=none;
+--connect(con1, localhost, root,,)
+set debug_sync= 'now wait_for downgraded';
+xa begin 'x2';
+insert into t values (53);
+xa end 'x2';
+xa prepare 'x2';
+set debug_sync= 'thread_end signal xa_detach wait_for close';
+--disconnect con1
+
+--connection con2
+set debug_sync= 'now signal close wait_for xa_detach';
+xa rollback 'x2';
+set debug_sync= 'now signal go';
+--connection default
+--reap # alter table
+
+select * from t;
+
+--echo # XA transaction is left uncommitted
+--echo # end then is rollbacked after alter fails
+
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for go';
+send set statement innodb_lock_wait_timeout=0, lock_wait_timeout= 0
+ for alter table t force, algorithm=copy, lock=none;
+
+--connect(con1, localhost, root,,)
+set debug_sync= 'now wait_for downgraded';
+xa begin 'xuncommitted';
+insert into t values (3);
+xa end 'xuncommitted';
+xa prepare 'xuncommitted';
+set debug_sync= 'now signal go';
+set debug_sync= 'thread_end signal xa_detach wait_for close';
+--disconnect con1
+
+--connection default
+--error ER_LOCK_WAIT_TIMEOUT
+--reap # alter table
+set debug_sync= 'now signal close wait_for xa_detach';
+xa rollback 'xuncommitted';
+
+select * from t;
+
+--echo # Same, but commit
+
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for go';
+send set statement innodb_lock_wait_timeout=0, lock_wait_timeout= 0
+ for alter table t force, algorithm=copy, lock=none;
+
+--connect(con1, localhost, root,,)
+set debug_sync= 'now wait_for downgraded';
+xa begin 'committed_later';
+insert into t values (3);
+xa end 'committed_later';
+xa prepare 'committed_later';
+set debug_sync= 'now signal go';
+set debug_sync= 'thread_end signal xa_detach wait_for close';
+--disconnect con1
+
+--connection default
+--error ER_LOCK_WAIT_TIMEOUT
+--reap # alter table
+set debug_sync= 'now signal close wait_for xa_detach';
+xa commit 'committed_later';
+
+
+select * from t;
+
+--echo # Commit, but error in statement, and there is some stmt data to rollback
+
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for go';
+send alter table t force, algorithm=copy, lock=none;
+--connect(con1, localhost, root,,)
+set debug_sync= 'now wait_for downgraded';
+xa begin 'x1';
+--error ER_DUP_ENTRY
+insert into t values (4), (3);
+insert into t values (5);
+xa end 'x1';
+xa prepare 'x1';
+set debug_sync= 'thread_end signal xa_detach wait_for close';
+--disconnect con1
+
+--connection con2
+set debug_sync= 'now signal close wait_for xa_detach';
+xa commit 'x1';
+set debug_sync= 'now signal go';
+--connection default
+--reap # alter table
+
+select * from t;
+
+--connect(con1, localhost, root,,)
+--connection default
+drop table t;
+set debug_sync= reset;
+
+--echo # MDEV-32771 Server crash upon online alter with concurrent XA
+
+create table t (a int primary key);
+insert t values(1),(2),(3);
+
+--echo # First, check that nothing from the rollbacked statement commits
+
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for go';
+send alter table t add b int default (555), algorithm=copy;
+
+--connection con1
+set debug_sync= 'now wait_for downgraded';
+xa start 'xid';
+--error ER_DUP_ENTRY
+update t set a = 0;
+xa end 'xid';
+xa prepare 'xid';
+xa commit 'xid';
+set debug_sync= 'now signal go';
+
+--connection default
+--reap
+select * from t;
+
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for go';
+send alter table t add c int default(777), algorithm=copy;
+
+--connection con1
+set debug_sync= 'now wait_for downgraded';
+xa start 'xid';
+--error ER_DUP_ENTRY
+update t set a = 0;
+xa end 'xid';
+xa prepare 'xid';
+xa rollback 'xid';
+set debug_sync= 'now signal go';
+
+--connection default
+--reap
+select * from t;
+
+--echo # Same, but add one successful statement into transaction
+
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for go';
+send alter table t drop b, algorithm=copy;
+
+--connection con1
+set debug_sync= 'now wait_for downgraded';
+xa start 'xid';
+update t set a = 10 where a = 1;
+--error ER_DUP_ENTRY
+update t set a = 0;
+xa end 'xid';
+xa prepare 'xid';
+xa rollback 'xid';
+set debug_sync= 'now signal go';
+
+--connection default
+--reap
+select * from t;
+
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for go';
+send alter table t drop primary key, algorithm=copy;
+
+--connection con1
+set debug_sync= 'now wait_for downgraded';
+xa start 'xid';
+--echo # This statement will take effect.
+update t set a = 10 where a = 1;
+--error ER_DUP_ENTRY
+update t set a = 0;
+xa end 'xid';
+xa prepare 'xid';
+xa commit 'xid';
+set debug_sync= 'now signal go';
+
+--connection default
+--reap
+select * from t;
+
+
+--echo # The only statement succeeds (test both commit and rollback)
+
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for go';
+send alter table t add d text default ('qwe'), algorithm=copy;
+
+--connection con1
+set debug_sync= 'now wait_for downgraded';
+xa start 'xid';
+update t set a = 0;
+xa end 'xid';
+xa prepare 'xid';
+xa rollback 'xid';
+set debug_sync= 'now signal go';
+
+--connection default
+--reap
+select * from t;
+
+set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for go';
+send alter table t drop c, algorithm=copy;
+
+--connection con1
+set debug_sync= 'now wait_for downgraded';
+xa start 'xid';
+update t set a = 0;
+xa end 'xid';
+xa prepare 'xid';
+xa commit 'xid';
+set debug_sync= 'now signal go';
+
+--connection default
+--reap
+select * from t;
+
+drop table t;
+
+
+--echo #
+--echo # MDEV-32803 Assertion `total == 0' failed in Event_log::write_cache_raw
+--echo #
+
+create or replace table t1 (a int) engine=aria;
+insert t1 values (5);
+set debug_sync= 'alter_table_copy_end SIGNAL ended WAIT_FOR end';
+
+send alter table t1 add b int NULL, algorithm= copy, lock= none;
+
+--connection con2
+set debug_sync= 'now WAIT_FOR ended';
+begin;
+insert into t1 values (123);
+insert into t1 values (456), (789);
+commit;
+set debug_sync= 'now SIGNAL end';
+
+--connection default
+--reap
+select * from t1;
+
+drop table t1;
+
+
+--echo # MDEV-32614 LeakSanitizer errors in copy_data_between_tables
+create table t (a int, b int) engine=aria;
+insert into t select seq, seq from seq_1_to_5;
+backup stage start;
+
+--connect (con_lock,localhost,root,,)
+set lock_wait_timeout= 1;
+
+set debug_sync='copy_data_between_tables_before_reset_backup_lock signal backup wait_for continue';
+send alter table t add index (b), algorithm=copy, lock=none;
+
+--connection default
+
+set debug_sync='now wait_for backup';
+
+backup stage block_commit;
+
+set debug_sync='now signal continue';
+
+--connection con_lock
+--error ER_LOCK_WAIT_TIMEOUT
+--reap
+--disconnect con_lock
+
+--connection default
+backup stage end;
+alter table t add index (a), algorithm=copy, lock=none;
+
+--connection default
+drop table t;
+
+
+eval set global default_storage_engine= $default_storage_engine;
+
+--disconnect con1
+--disconnect con2
+--echo #
+--echo # End of 11.2 tests
+--echo #
diff --git a/mysql-test/main/analyze_engine_stats.result b/mysql-test/main/analyze_engine_stats.result
index b3212632..02eb936c 100644
--- a/mysql-test/main/analyze_engine_stats.result
+++ b/mysql-test/main/analyze_engine_stats.result
@@ -21,6 +21,7 @@ X
},
"query_block": {
"select_id": 1,
+ "cost": 1.6664988,
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -28,9 +29,11 @@ X
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10000,
"r_rows": 10000,
+ "cost": 1.6664988,
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": {
@@ -134,6 +137,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"const_condition": "1",
@@ -142,9 +146,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 100,
"r_rows": 100,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -162,6 +168,7 @@ ANALYZE
"used_key_parts": ["s"],
"ref": ["func"],
"r_loops": 100,
+ "r_table_loops": 110,
"rows": 1,
"r_rows": 0.1,
"r_table_time_ms": "REPLACED",
@@ -177,9 +184,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
diff --git a/mysql-test/main/analyze_format_json.result b/mysql-test/main/analyze_format_json.result
index 5572a4f3..00fdc10f 100644
--- a/mysql-test/main/analyze_format_json.result
+++ b/mysql-test/main/analyze_format_json.result
@@ -10,6 +10,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -17,9 +18,11 @@ ANALYZE
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -47,6 +50,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -54,9 +58,11 @@ ANALYZE
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -74,9 +80,11 @@ ANALYZE
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t0.a"],
+ "loops": 10,
"r_loops": 0,
"rows": 1,
"r_rows": null,
+ "cost": "REPLACED",
"r_engine_stats": REPLACED,
"filtered": 100,
"r_filtered": null
@@ -99,6 +107,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -106,9 +115,11 @@ ANALYZE
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -126,9 +137,11 @@ ANALYZE
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t0.a"],
+ "loops": 10,
"r_loops": 10,
"rows": 1,
"r_rows": 1,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -154,6 +167,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -161,9 +175,11 @@ ANALYZE
"table": {
"table_name": "tbl1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 100,
"r_rows": 100,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -177,9 +193,11 @@ ANALYZE
"table": {
"table_name": "tbl2",
"access_type": "ALL",
+ "loops": 100,
"r_loops": 1,
"rows": 100,
"r_rows": 100,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -209,6 +227,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -216,9 +235,11 @@ ANALYZE
"table": {
"table_name": "tbl1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 100,
"r_rows": 100,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -232,9 +253,11 @@ ANALYZE
"table": {
"table_name": "tbl2",
"access_type": "ALL",
+ "loops": 100,
"r_loops": 1,
"rows": 100,
"r_rows": 100,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -273,6 +296,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -280,9 +304,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -300,9 +326,11 @@ ANALYZE
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t1.a"],
+ "loops": 10,
"r_loops": 10,
- "rows": 2,
+ "rows": 1,
"r_rows": 0.2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -336,6 +364,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -343,9 +372,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -402,6 +433,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -413,9 +445,11 @@ ANALYZE
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["pk"],
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -484,6 +518,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -491,9 +526,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 5,
"r_rows": 5,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -518,9 +555,11 @@ ANALYZE
"table_name": "t2",
"access_type": "ALL",
"possible_keys": ["key1", "key2", "key3", "key4"],
+ "loops": 5,
"r_loops": 5,
"rows": 1010,
"r_rows": 203.8,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -556,6 +595,7 @@ ANALYZE
{
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -563,9 +603,11 @@ ANALYZE
"table": {
"table_name": "tbl1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -581,6 +623,7 @@ ANALYZE
"query_block": {
"select_id": 2,
"operation": "UNION",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -588,9 +631,11 @@ ANALYZE
"table": {
"table_name": "tbl2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -629,6 +674,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"having_condition": "TOP > t2.a",
@@ -646,9 +692,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 256,
"r_rows": 256,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -670,6 +718,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"filesort": {
@@ -686,9 +735,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 256,
"r_rows": 256,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -724,6 +775,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"filesort": {
@@ -740,9 +792,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 256,
"r_rows": 256,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -771,6 +825,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -778,9 +833,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -793,9 +850,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 2,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -819,6 +878,7 @@ ANALYZE
{
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -826,9 +886,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -842,6 +904,8 @@ ANALYZE
]
}
}
+SELECT STRAIGHT_JOIN * FROM t1, t2 WHERE b IN ( SELECT a FROM t1 );
+a b
drop table t1,t2;
#
# MDEV-8864: Server crash #2 in Item_field::print on ANALYZE FORMAT=JSON
@@ -864,6 +928,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"filesort": {
@@ -889,9 +954,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -904,9 +971,11 @@ ANALYZE
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 2,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -932,14 +1001,17 @@ ANALYZE
"r_loops": 0,
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 0,
"rows": 2,
"r_rows": null,
+ "cost": "REPLACED",
"r_engine_stats": REPLACED,
"filtered": 100,
"r_filtered": null
@@ -950,9 +1022,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 2,
"r_loops": 0,
"rows": 2,
"r_rows": null,
+ "cost": "REPLACED",
"r_engine_stats": REPLACED,
"filtered": 100,
"r_filtered": null
@@ -996,6 +1070,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -1003,9 +1078,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1022,6 +1099,7 @@ ANALYZE
"r_loops": 0,
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"nested_loop": [
{
"read_sorted_file": {
@@ -1036,9 +1114,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 0,
"rows": 10,
"r_rows": null,
+ "cost": "REPLACED",
"r_engine_stats": REPLACED,
"filtered": 100,
"r_filtered": null,
@@ -1087,6 +1167,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -1094,9 +1175,11 @@ ANALYZE
"table": {
"table_name": "t11",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 1000,
"r_rows": 1000,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1110,9 +1193,11 @@ ANALYZE
"table": {
"table_name": "t10",
"access_type": "ALL",
+ "loops": 100,
"r_loops": 1,
"rows": 1000,
"r_rows": 1000,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1148,6 +1233,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -1155,9 +1241,11 @@ ANALYZE
"table": {
"table_name": "t11",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 1000,
"r_rows": 1000,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1175,13 +1263,15 @@ ANALYZE
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t11.b"],
+ "loops": 100,
"r_loops": 1,
"rows": 1000,
"r_rows": 1000,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
- "filtered": 70,
+ "filtered": 0.209580004,
"r_filtered": 70,
"attached_condition": "t10.a < 700"
},
diff --git a/mysql-test/main/analyze_format_json.test b/mysql-test/main/analyze_format_json.test
index 84f44869..00161630 100644
--- a/mysql-test/main/analyze_format_json.test
+++ b/mysql-test/main/analyze_format_json.test
@@ -154,6 +154,7 @@ drop table t0, t1;
--echo #
--echo # MDEV-7970: EXPLAIN FORMAT=JSON does not print HAVING
+--source include/explain-no-costs.inc
--echo #
create table t0(a int);
insert into t0 values (0),(1),(2),(3);
@@ -190,6 +191,7 @@ INSERT INTO t2 VALUES (3),(4);
--source include/analyze-format.inc
ANALYZE FORMAT=JSON SELECT STRAIGHT_JOIN * FROM t1, t2 WHERE b IN ( SELECT a FROM t1 );
+SELECT STRAIGHT_JOIN * FROM t1, t2 WHERE b IN ( SELECT a FROM t1 );
drop table t1,t2;
diff --git a/mysql-test/main/analyze_format_json_timings.result b/mysql-test/main/analyze_format_json_timings.result
index dead44b3..1b5f9776 100644
--- a/mysql-test/main/analyze_format_json_timings.result
+++ b/mysql-test/main/analyze_format_json_timings.result
@@ -42,6 +42,7 @@ X
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -49,9 +50,11 @@ X
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 500,
"r_rows": 500,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -69,13 +72,15 @@ X
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t1.b"],
+ "loops": 500,
"r_loops": 1,
"rows": 500,
"r_rows": 500,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
- "filtered": 100,
+ "filtered": 10,
"r_filtered": 20,
"attached_condition": "t2.a < 100"
},
@@ -135,6 +140,7 @@ X
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -142,9 +148,11 @@ X
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 1000,
"r_rows": 1000,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -162,13 +170,15 @@ X
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t1.a"],
+ "loops": 1000,
"r_loops": 1,
"rows": 2000,
"r_rows": 2000,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
- "filtered": 100,
+ "filtered": 10,
"r_filtered": 100
},
"buffer_type": "flat",
diff --git a/mysql-test/main/analyze_stmt.result b/mysql-test/main/analyze_stmt.result
index c5d35759..8ba089d8 100644
--- a/mysql-test/main/analyze_stmt.result
+++ b/mysql-test/main/analyze_stmt.result
@@ -258,7 +258,7 @@ drop table t1;
create table t1 (i int);
analyze delete from t1 returning *;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 0 0.00 100.00 100.00
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
drop table t1;
#
# MDEV-6396: ANALYZE INSERT/REPLACE is accepted, but does not produce a plan
@@ -314,7 +314,7 @@ insert into t2 values (0),(1);
analyze select * from t1 straight_join t2 force index(a) where t2.a=t1.a;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 100.00 100.00 Using where
-1 SIMPLE t2 ref a a 5 test.t1.a 2 0.20 100.00 100.00 Using index
+1 SIMPLE t2 ref a a 5 test.t1.a 1 0.20 100.00 100.00 Using index
drop table t1,t2;
#
# MDEV-8063: Unconditional ANALYZE DELETE does not delete rows
diff --git a/mysql-test/main/analyze_stmt_orderby.result b/mysql-test/main/analyze_stmt_orderby.result
index 273c3f34..020e68f3 100644
--- a/mysql-test/main/analyze_stmt_orderby.result
+++ b/mysql-test/main/analyze_stmt_orderby.result
@@ -185,6 +185,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t2.b",
"temporary_table": {
@@ -193,7 +194,9 @@ EXPLAIN
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t0.a is not null"
}
@@ -207,7 +210,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t0.a"],
+ "loops": 10,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -225,6 +230,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"filesort": {
@@ -241,9 +247,11 @@ ANALYZE
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -261,9 +269,11 @@ ANALYZE
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t0.a"],
+ "loops": 10,
"r_loops": 10,
"rows": 1,
"r_rows": 0.4,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -290,6 +300,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"read_sorted_file": {
@@ -298,7 +309,9 @@ EXPLAIN
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t0.a is not null"
}
@@ -314,7 +327,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t0.a"],
+ "loops": 10,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -330,6 +345,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -347,9 +363,11 @@ ANALYZE
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -369,9 +387,11 @@ ANALYZE
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t0.a"],
+ "loops": 10,
"r_loops": 10,
"rows": 1,
"r_rows": 0.4,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -403,6 +423,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"filesort": {
@@ -419,9 +440,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 1000,
"r_rows": 1000,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -467,6 +490,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"duplicate_removal": {
@@ -476,9 +500,11 @@ ANALYZE
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -491,9 +517,11 @@ ANALYZE
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 10,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -540,6 +568,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"filesort": {
@@ -565,9 +594,11 @@ ANALYZE
"table": {
"table_name": "t6",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 5,
"r_rows": 5,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -581,9 +612,11 @@ ANALYZE
"table": {
"table_name": "t5",
"access_type": "ALL",
+ "loops": 5,
"r_loops": 1,
"rows": 7,
"r_rows": 7,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -616,6 +649,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "count(distinct t5.b)",
"temporary_table": {
@@ -627,7 +661,9 @@ EXPLAIN
"table": {
"table_name": "t6",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t6.b > 0 and t6.a <= 5"
}
@@ -637,7 +673,9 @@ EXPLAIN
"table": {
"table_name": "t5",
"access_type": "ALL",
+ "loops": 5,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -684,6 +722,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -694,9 +733,11 @@ ANALYZE
"key": "idx",
"key_length": "5",
"used_key_parts": ["col1"],
+ "loops": 1,
"r_loops": 1,
"rows": 7,
"r_rows": 20,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
diff --git a/mysql-test/main/analyze_stmt_orderby.test b/mysql-test/main/analyze_stmt_orderby.test
index ecee8040..519cae45 100644
--- a/mysql-test/main/analyze_stmt_orderby.test
+++ b/mysql-test/main/analyze_stmt_orderby.test
@@ -21,6 +21,7 @@ insert into t2 select A.a*1000 + B.a, A.a*1000 + B.a from t0 A, t1 B;
--echo #
explain
update t2 set b=b+1 order by b limit 5;
+--source include/explain-no-costs.inc
explain format=json
update t2 set b=b+1 order by b limit 5;
--source include/analyze-format.inc
@@ -32,6 +33,7 @@ update t2 set b=b+1 order by b limit 5;
--echo #
explain
update t2 set a=a+1 where a<10;
+--source include/explain-no-costs.inc
explain format=json
update t2 set a=a+1 where a<10;
--source include/analyze-format.inc
@@ -43,6 +45,7 @@ update t2 set a=a+1 where a<10;
--echo #
explain
delete from t2 order by b limit 5;
+--source include/explain-no-costs.inc
explain format=json
delete from t2 order by b limit 5;
--source include/analyze-format.inc
@@ -54,6 +57,7 @@ delete from t2 order by b limit 5;
--echo #
explain
select * from t0,t2 where t2.a=t0.a order by t2.b limit 4;
+--source include/explain-no-costs.inc
explain format=json
select * from t0,t2 where t2.a=t0.a order by t2.b limit 4;
--source include/analyze-format.inc
@@ -66,6 +70,7 @@ select * from t0,t2 where t2.a=t0.a order by t2.b limit 4;
--echo #
explain
select * from t0,t2 where t2.a=t0.a order by t0.a limit 4;
+--source include/explain-no-costs.inc
explain format=json
select * from t0,t2 where t2.a=t0.a order by t0.a limit 4;
--source include/analyze-format.inc
@@ -143,6 +148,7 @@ select count(distinct t5.b) as sum from t5, t6
where t5.a=t6.a and t6.b > 0 and t5.a <= 5
group by t5.a order by sum limit 1;
+--source include/explain-no-costs.inc
explain format=json
select count(distinct t5.b) as sum from t5, t6
where t5.a=t6.a and t6.b > 0 and t5.a <= 5
diff --git a/mysql-test/main/analyze_stmt_privileges2.result b/mysql-test/main/analyze_stmt_privileges2.result
index 2b75f736..244fc5a7 100644
--- a/mysql-test/main/analyze_stmt_privileges2.result
+++ b/mysql-test/main/analyze_stmt_privileges2.result
@@ -377,13 +377,11 @@ a b
EXPLAIN SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
ANALYZE SELECT * FROM t1 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 4.00 100.00 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 0.00 100.00 100.00
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 3.00 100.00 100.00
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 3.00 33.33 0.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
#------------------------------------------------------------------------
# I/R/U/D/S on the inner view
# Expectation: Can run everything
@@ -492,13 +490,11 @@ a b
EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 8 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 NULL 100.00 NULL
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 NULL 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 NULL 33.33 NULL Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
#------------------------------------------------------------------------
# I/R/U/D/S on the outer view
# Expectation: Can run everything
@@ -599,13 +595,11 @@ a b
EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 12 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 12 12.00 100.00 0.00 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 NULL 100.00 NULL
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 NULL 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 NULL 33.33 NULL Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
#========================================================================
# Test: Grant INSERT on the table
@@ -1445,10 +1439,10 @@ id select_type table type possible_keys key key_len ref rows r_rows filtered r_f
DELETE FROM t1 WHERE a = 10;
EXPLAIN DELETE FROM t1 WHERE a = 10;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
ANALYZE DELETE FROM t1 WHERE a = 10;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 1 0.00 100.00 100.00 Using where
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
DELETE FROM t1 USING t1, t2;
EXPLAIN DELETE FROM t1 USING t1, t2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -1592,13 +1586,11 @@ a b
EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 4.00 100.00 0.00 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 NULL 100.00 NULL
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 NULL 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 NULL 33.33 NULL Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
#------------------------------------------------------------------------
# I/R/U/D/S on the outer view
# Expectation: Can run everything: SELECT access to the column `a`
@@ -1709,13 +1701,11 @@ a b
EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 8 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 NULL 100.00 NULL
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 NULL 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 NULL 33.33 NULL Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
#========================================================================
# Test: Grant SELECT, INSERT, UPDATE, DELETE on the table
@@ -1790,10 +1780,10 @@ id select_type table type possible_keys key key_len ref rows r_rows filtered r_f
DELETE FROM t1 WHERE a = 10;
EXPLAIN DELETE FROM t1 WHERE a = 10;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
ANALYZE DELETE FROM t1 WHERE a = 10;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 1 0.00 100.00 100.00 Using where
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
DELETE FROM t1 USING t1, t2;
EXPLAIN DELETE FROM t1 USING t1, t2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -1941,13 +1931,11 @@ a b
EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 4.00 100.00 0.00 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 NULL 100.00 NULL
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 NULL 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 NULL 33.33 NULL Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
#------------------------------------------------------------------------
# I/R/U/D/S on the outer view
# Expectation: Can run everything
@@ -2049,13 +2037,11 @@ a b
EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 8 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 8 8.00 100.00 0.00 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 NULL 100.00 NULL
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 NULL 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 NULL 33.33 NULL Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
#########################################################################
# Inner view permission tests
@@ -2698,13 +2684,11 @@ a b
EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 14 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 14 14.00 100.00 0.00 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 NULL 100.00 NULL
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 NULL 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 NULL 33.33 NULL Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
#------------------------------------------------------------------------
# I/R/U/D/S on the outer view
# Expectation: Can run everything
@@ -2805,13 +2789,11 @@ a b
EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 18 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 18 18.00 100.00 0.00 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 NULL 100.00 NULL
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 NULL 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 NULL 33.33 NULL Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
#========================================================================
# Test: Grant INSERT on the inner view
@@ -3034,6 +3016,7 @@ ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for unde
ANALYZE UPDATE v1 SET a = 10;
ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
UPDATE v1 SET a = a + 1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 'v1'
EXPLAIN UPDATE v1 SET a = a + 1;
ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
ANALYZE UPDATE v1 SET a = a + 1;
@@ -3988,13 +3971,11 @@ a b
EXPLAIN SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 35 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
ANALYZE SELECT * FROM v1 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 35 35.00 100.00 0.00 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 NULL 100.00 NULL
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 NULL 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 NULL 33.33 NULL Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
#------------------------------------------------------------------------
# I/R/U/D/S on the outer view
# Expectation: Can run everything
@@ -4095,13 +4076,11 @@ a b
EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 39 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 39 39.00 100.00 0.00 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 NULL 100.00 NULL
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 NULL 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 NULL 33.33 NULL Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
#########################################################################
# Outer view permission tests
@@ -4615,13 +4594,11 @@ a b
EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 39 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 39 39.00 100.00 0.00 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 NULL 100.00 NULL
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 NULL 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 NULL 33.33 NULL Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
#========================================================================
# Test: Grant INSERT on the outer view
@@ -4767,6 +4744,7 @@ ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for unde
ANALYZE UPDATE v2 SET a = 10;
ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
UPDATE v2 SET a = a + 1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 'v2'
EXPLAIN UPDATE v2 SET a = a + 1;
ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
ANALYZE UPDATE v2 SET a = a + 1;
@@ -4865,12 +4843,11 @@ ANALYZE UPDATE v2 SET a = 10;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 43 43.00 100.00 6.98 Using where
UPDATE v2 SET a = a + 1;
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 'v2'
EXPLAIN UPDATE v2 SET a = a + 1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 43 Using where
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 'v2'
ANALYZE UPDATE v2 SET a = a + 1;
-id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 43 43.00 100.00 6.98 Using where
+ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 'v2'
UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 'v2'
EXPLAIN UPDATE v2, t2 SET v2.a = v2.a + 1 WHERE v2.a = t2.a;
@@ -5222,13 +5199,11 @@ a b
EXPLAIN SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 44 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
ANALYZE SELECT * FROM v2 WHERE a IN ( SELECT a FROM t2 );
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 44 44.00 100.00 0.00 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 NULL 100.00 NULL
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 NULL 100.00 NULL
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 NULL 33.33 NULL Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
disconnect con1;
connection default;
DROP USER 'privtest'@localhost;
diff --git a/mysql-test/main/analyze_stmt_privileges2.test b/mysql-test/main/analyze_stmt_privileges2.test
index a0f1f490..8b011c2b 100644
--- a/mysql-test/main/analyze_stmt_privileges2.test
+++ b/mysql-test/main/analyze_stmt_privileges2.test
@@ -2987,8 +2987,7 @@ EXPLAIN UPDATE v1 SET a = 10;
--error ER_VIEW_NO_EXPLAIN
ANALYZE UPDATE v1 SET a = 10;
-# Wrong result due to MDEV-7042
-#--error ER_COLUMNACCESS_DENIED_ERROR
+--error ER_COLUMNACCESS_DENIED_ERROR
UPDATE v1 SET a = a + 1;
# Strange error code due to MDEV-7042
#--error ER_COLUMNACCESS_DENIED_ERROR
@@ -4891,8 +4890,7 @@ EXPLAIN UPDATE v2 SET a = 10;
--error ER_VIEW_NO_EXPLAIN
ANALYZE UPDATE v2 SET a = 10;
-# Wrong result due to MDEV-7042
-# --error ER_COLUMNACCESS_DENIED_ERROR
+--error ER_COLUMNACCESS_DENIED_ERROR
UPDATE v2 SET a = a + 1;
# Strange error code due to MDEV-7042
#--error ER_COLUMNACCESS_DENIED_ERROR
@@ -5009,14 +5007,11 @@ UPDATE v2 SET a = 10;
EXPLAIN UPDATE v2 SET a = 10;
ANALYZE UPDATE v2 SET a = 10;
-# Wrong result due to MDEV-7042
-# --error ER_COLUMNACCESS_DENIED_ERROR
+--error ER_COLUMNACCESS_DENIED_ERROR
UPDATE v2 SET a = a + 1;
-# Wrong result due to MDEV-7042
-# --error ER_COLUMNACCESS_DENIED_ERROR
+--error ER_COLUMNACCESS_DENIED_ERROR
EXPLAIN UPDATE v2 SET a = a + 1;
-# Wrong result due to MDEV-7042
-# --error ER_COLUMNACCESS_DENIED_ERROR
+--error ER_COLUMNACCESS_DENIED_ERROR
ANALYZE UPDATE v2 SET a = a + 1;
--error ER_COLUMNACCESS_DENIED_ERROR
diff --git a/mysql-test/main/backup_interaction.result b/mysql-test/main/backup_interaction.result
index c775c5eb..c2f7cf12 100644
--- a/mysql-test/main/backup_interaction.result
+++ b/mysql-test/main/backup_interaction.result
@@ -321,20 +321,20 @@ col1
HANDLER t1_myisam CLOSE;
BACKUP STAGE END;
drop table t1_innodb,t1_myisam;
-# Show the fate and impact of some SET GLOBAL tx_read_only = 1/0
+# Show the fate and impact of some SET GLOBAL transaction_read_only = 1/0
# sliding through the sequence.
BACKUP STAGE START;
-SET GLOBAL tx_read_only = 1;
-SET GLOBAL tx_read_only = 0;
+SET GLOBAL transaction_read_only = 1;
+SET GLOBAL transaction_read_only = 0;
BACKUP STAGE FLUSH;
-SET GLOBAL tx_read_only = 1;
-SET GLOBAL tx_read_only = 0;
+SET GLOBAL transaction_read_only = 1;
+SET GLOBAL transaction_read_only = 0;
BACKUP STAGE BLOCK_DDL;
-SET GLOBAL tx_read_only = 1;
-SET GLOBAL tx_read_only = 0;
+SET GLOBAL transaction_read_only = 1;
+SET GLOBAL transaction_read_only = 0;
BACKUP STAGE BLOCK_COMMIT;
-SET GLOBAL tx_read_only = 1;
-SET GLOBAL tx_read_only = 0;
+SET GLOBAL transaction_read_only = 1;
+SET GLOBAL transaction_read_only = 0;
BACKUP STAGE END;
# Show the fate and impact of some SET SESSION sql_log_bin = 0/1
# sliding through the sequence.
diff --git a/mysql-test/main/backup_interaction.test b/mysql-test/main/backup_interaction.test
index 25f22f66..be3b2070 100644
--- a/mysql-test/main/backup_interaction.test
+++ b/mysql-test/main/backup_interaction.test
@@ -301,21 +301,21 @@ HANDLER t1_myisam CLOSE;
BACKUP STAGE END;
drop table t1_innodb,t1_myisam;
---echo # Show the fate and impact of some SET GLOBAL tx_read_only = 1/0
+--echo # Show the fate and impact of some SET GLOBAL transaction_read_only = 1/0
--echo # sliding through the sequence.
BACKUP STAGE START;
-SET GLOBAL tx_read_only = 1;
-SET GLOBAL tx_read_only = 0;
+SET GLOBAL transaction_read_only = 1;
+SET GLOBAL transaction_read_only = 0;
BACKUP STAGE FLUSH;
-SET GLOBAL tx_read_only = 1;
-SET GLOBAL tx_read_only = 0;
+SET GLOBAL transaction_read_only = 1;
+SET GLOBAL transaction_read_only = 0;
BACKUP STAGE BLOCK_DDL;
-SET GLOBAL tx_read_only = 1;
-SET GLOBAL tx_read_only = 0;
+SET GLOBAL transaction_read_only = 1;
+SET GLOBAL transaction_read_only = 0;
BACKUP STAGE BLOCK_COMMIT;
-SET GLOBAL tx_read_only = 1;
-SET GLOBAL tx_read_only = 0;
+SET GLOBAL transaction_read_only = 1;
+SET GLOBAL transaction_read_only = 0;
BACKUP STAGE END;
--echo # Show the fate and impact of some SET SESSION sql_log_bin = 0/1
diff --git a/mysql-test/main/backup_lock.result b/mysql-test/main/backup_lock.result
index 488e81fd..e6fc89d7 100644
--- a/mysql-test/main/backup_lock.result
+++ b/mysql-test/main/backup_lock.result
@@ -43,7 +43,7 @@ connection default;
start transaction;
insert into t1 values (1);
connection con1;
-alter table t1 add column (j int), algorithm copy;
+alter table t1 add column (j int), algorithm copy, lock shared;
connection con2;
backup stage flush;
SELECT LOCK_MODE, LOCK_TYPE, TABLE_SCHEMA, TABLE_NAME FROM information_schema.metadata_lock_info
diff --git a/mysql-test/main/backup_lock.test b/mysql-test/main/backup_lock.test
index f86f2f36..fbb5f30c 100644
--- a/mysql-test/main/backup_lock.test
+++ b/mysql-test/main/backup_lock.test
@@ -54,7 +54,7 @@ insert into t1 values (1);
connection con1;
# Waits on MDL
---send alter table t1 add column (j int), algorithm copy
+--send alter table t1 add column (j int), algorithm copy, lock shared
connection con2;
let $wait_condition=
diff --git a/mysql-test/main/backup_stages.result b/mysql-test/main/backup_stages.result
index 3fb912af..0d3f99e8 100644
--- a/mysql-test/main/backup_stages.result
+++ b/mysql-test/main/backup_stages.result
@@ -222,11 +222,11 @@ SELECT * FROM t_permanent_myisam ORDER BY col1;
col1 col2
3 NULL
SET AUTOCOMMIT = 0;
-SET GLOBAL tx_read_only = 1;
+SET GLOBAL transaction_read_only = 1;
connection con12;
BACKUP STAGE START;
BACKUP STAGE END;
-SET GLOBAL tx_read_only = 0;
+SET GLOBAL transaction_read_only = 0;
DROP VIEW v_some_view;
DROP TABLE t_con1_innodb;
DROP TABLE t_con1_myisam;
@@ -242,8 +242,8 @@ LOCK TABLES t_permanent_myisam READ;
LOCK TABLES t_permanent_innodb WRITE;
LOCK TABLES t_permanent_myisam WRITE;
UNLOCK TABLES;
-SET GLOBAL tx_read_only = 1;
-SET GLOBAL tx_read_only = 0;
+SET GLOBAL transaction_read_only = 1;
+SET GLOBAL transaction_read_only = 0;
connection backup;
BACKUP STAGE FLUSH;
connection con11;
@@ -256,8 +256,8 @@ LOCK TABLES t_permanent_innodb WRITE;
LOCK TABLES t_permanent_myisam WRITE;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
UNLOCK TABLES;
-SET GLOBAL tx_read_only = 1;
-SET GLOBAL tx_read_only = 0;
+SET GLOBAL transaction_read_only = 1;
+SET GLOBAL transaction_read_only = 0;
connection backup;
BACKUP STAGE BLOCK_DDL;
connection con11;
@@ -271,8 +271,8 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
LOCK TABLES t_permanent_myisam WRITE;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
UNLOCK TABLES;
-SET GLOBAL tx_read_only = 1;
-SET GLOBAL tx_read_only = 0;
+SET GLOBAL transaction_read_only = 1;
+SET GLOBAL transaction_read_only = 0;
connection backup;
BACKUP STAGE BLOCK_COMMIT;
connection con11;
@@ -286,8 +286,8 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
LOCK TABLES t_permanent_myisam WRITE;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
UNLOCK TABLES;
-SET GLOBAL tx_read_only = 1;
-SET GLOBAL tx_read_only = 0;
+SET GLOBAL transaction_read_only = 1;
+SET GLOBAL transaction_read_only = 0;
connection backup;
BACKUP STAGE END;
DROP TABLE t_permanent_innodb;
diff --git a/mysql-test/main/backup_stages.test b/mysql-test/main/backup_stages.test
index 56be6205..1f5fb2d6 100644
--- a/mysql-test/main/backup_stages.test
+++ b/mysql-test/main/backup_stages.test
@@ -255,11 +255,11 @@ COMMIT;
SELECT * FROM t_permanent_innodb ORDER BY col1;
SELECT * FROM t_permanent_myisam ORDER BY col1;
SET AUTOCOMMIT = 0;
-SET GLOBAL tx_read_only = 1;
+SET GLOBAL transaction_read_only = 1;
--connection con12
BACKUP STAGE START;
BACKUP STAGE END;
-SET GLOBAL tx_read_only = 0;
+SET GLOBAL transaction_read_only = 0;
DROP VIEW v_some_view;
DROP TABLE t_con1_innodb;
DROP TABLE t_con1_myisam;
@@ -277,8 +277,8 @@ LOCK TABLES t_permanent_myisam READ;
LOCK TABLES t_permanent_innodb WRITE;
LOCK TABLES t_permanent_myisam WRITE;
UNLOCK TABLES;
-SET GLOBAL tx_read_only = 1;
-SET GLOBAL tx_read_only = 0;
+SET GLOBAL transaction_read_only = 1;
+SET GLOBAL transaction_read_only = 0;
--connection backup
BACKUP STAGE FLUSH;
--connection con11
@@ -291,8 +291,8 @@ LOCK TABLES t_permanent_innodb WRITE;
--error ER_LOCK_WAIT_TIMEOUT
LOCK TABLES t_permanent_myisam WRITE;
UNLOCK TABLES;
-SET GLOBAL tx_read_only = 1;
-SET GLOBAL tx_read_only = 0;
+SET GLOBAL transaction_read_only = 1;
+SET GLOBAL transaction_read_only = 0;
--connection backup
BACKUP STAGE BLOCK_DDL;
--connection con11
@@ -306,8 +306,8 @@ LOCK TABLES t_permanent_innodb WRITE;
--error ER_LOCK_WAIT_TIMEOUT
LOCK TABLES t_permanent_myisam WRITE;
UNLOCK TABLES;
-SET GLOBAL tx_read_only = 1;
-SET GLOBAL tx_read_only = 0;
+SET GLOBAL transaction_read_only = 1;
+SET GLOBAL transaction_read_only = 0;
--connection backup
BACKUP STAGE BLOCK_COMMIT;
--connection con11
@@ -321,8 +321,8 @@ LOCK TABLES t_permanent_innodb WRITE;
--error ER_LOCK_WAIT_TIMEOUT
LOCK TABLES t_permanent_myisam WRITE;
UNLOCK TABLES;
-SET GLOBAL tx_read_only = 1;
-SET GLOBAL tx_read_only = 0;
+SET GLOBAL transaction_read_only = 1;
+SET GLOBAL transaction_read_only = 0;
--connection backup
BACKUP STAGE END;
diff --git a/mysql-test/main/brackets.result b/mysql-test/main/brackets.result
index f87afdc0..1f192241 100644
--- a/mysql-test/main/brackets.result
+++ b/mysql-test/main/brackets.result
@@ -261,6 +261,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"read_sorted_file": {
@@ -269,7 +270,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -291,6 +294,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"read_sorted_file": {
@@ -299,7 +303,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -329,12 +335,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 20"
}
@@ -346,12 +355,15 @@ EXPLAIN
"query_block": {
"select_id": 2,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -383,12 +395,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 20"
}
@@ -400,12 +415,15 @@ EXPLAIN
"query_block": {
"select_id": 2,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -445,6 +463,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"read_sorted_file": {
@@ -453,7 +472,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -466,12 +487,15 @@ EXPLAIN
"query_block": {
"select_id": 2,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.pk > 4"
}
@@ -488,7 +512,7 @@ drop table t1;
# MDEV-18689: parenthesis around table names and derived tables
#
select * from ( mysql.db );
-Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Execute_priv Event_priv Trigger_priv Delete_history_priv
+Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Execute_priv Event_priv Trigger_priv Delete_history_priv Show_create_routine_priv
create table t1 (a int);
insert into t1 values (7), (2), (7);
select * from (t1);
diff --git a/mysql-test/main/brackets.test b/mysql-test/main/brackets.test
index 9a0c204e..4300e8a0 100644
--- a/mysql-test/main/brackets.test
+++ b/mysql-test/main/brackets.test
@@ -117,24 +117,28 @@ let $q1=
select a from t1 order by a desc limit 1;
eval $q1;
eval explain extended $q1;
+--source include/explain-no-costs.inc
eval explain format=json $q1;
let $q2=
(select a from t1 order by a desc) limit 1;
eval $q2;
eval explain extended $q2;
+--source include/explain-no-costs.inc
eval explain format=json $q2;
let $q1=
(select a from t1 where a=20 union select a from t1) order by a desc limit 1;
eval $q1;
eval explain extended $q1;
+--source include/explain-no-costs.inc
eval explain format=json $q1;
let $q2=
((select a from t1 where a=20 union select a from t1) order by a desc) limit 1;
eval $q2;
eval explain extended $q2;
+--source include/explain-no-costs.inc
eval explain format=json $q2;
drop table t1;
@@ -150,6 +154,7 @@ let $q=
((select * from t1 order by pk) limit 2) union (select * from t1 where pk > 4);
eval $q;
eval explain extended $q;
+--source include/explain-no-costs.inc
eval explain format=json $q;
drop table t1;
diff --git a/mysql-test/main/bug12427262.result b/mysql-test/main/bug12427262.result
index 6e79ec3a..8ec14efc 100644
--- a/mysql-test/main/bug12427262.result
+++ b/mysql-test/main/bug12427262.result
@@ -16,8 +16,6 @@ create table t10 (c1 int);
select Sum(ALL(COUNT_READ)) from performance_schema.file_summary_by_instance where FILE_NAME
like "%show_table_lw_db%" AND FILE_NAME like "%.frm%" AND EVENT_NAME='wait/io/file/sql/FRM'
into @count_read_before;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
show tables;
Tables_in_show_table_lw_db
t1
@@ -33,8 +31,6 @@ t9
select Sum(ALL(COUNT_READ)) from performance_schema.file_summary_by_instance where FILE_NAME
like "%show_table_lw_db%" AND FILE_NAME like "%.frm%" AND EVENT_NAME='wait/io/file/sql/FRM'
into @count_read_after;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select @count_read_after-@count_read_before;
@count_read_after-@count_read_before
0.00000000000000000000000000000000000000
@@ -53,8 +49,6 @@ t9 BASE TABLE
select Sum(ALL(COUNT_READ)) from performance_schema.file_summary_by_instance where FILE_NAME
like "%show_table_lw_db%" AND FILE_NAME like "%.frm%" AND EVENT_NAME='wait/io/file/sql/FRM'
into @count_read_after;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select @count_read_after-@count_read_before;
@count_read_after-@count_read_before
10.00000000000000000000000000000000000000
diff --git a/mysql-test/main/bug46760-master.opt b/mysql-test/main/bug46760-master.opt
index 2d7be7fb..5b4331aa 100644
--- a/mysql-test/main/bug46760-master.opt
+++ b/mysql-test/main/bug46760-master.opt
@@ -1,2 +1 @@
--loose-innodb-lock-wait-timeout=2
---loose-innodb-file-per-table
diff --git a/mysql-test/main/change_user.result b/mysql-test/main/change_user.result
index c91522dc..d9bbb34b 100644
--- a/mysql-test/main/change_user.result
+++ b/mysql-test/main/change_user.result
@@ -1,3 +1,4 @@
+connect old,localhost,root,,,,,auth=mysql_old_password:mysql_native_password;
set global secure_auth=0;
Warnings:
Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release
diff --git a/mysql-test/main/change_user.test b/mysql-test/main/change_user.test
index 4073b79a..5f7d5a21 100644
--- a/mysql-test/main/change_user.test
+++ b/mysql-test/main/change_user.test
@@ -1,5 +1,9 @@
# This test is checking that old password authentication works
--disable_service_connection
+
+# connect with mysql_old_password enabled
+connect old,localhost,root,,,,,auth=mysql_old_password:mysql_native_password;
+
set global secure_auth=0;
#
# functional change user tests
diff --git a/mysql-test/main/check_constraint.result b/mysql-test/main/check_constraint.result
index 3ba0f12e..66cf84d3 100644
--- a/mysql-test/main/check_constraint.result
+++ b/mysql-test/main/check_constraint.result
@@ -320,3 +320,62 @@ drop table t1;
#
# End of 10.4 tests
#
+#
+# MDEV-32439 INSERT IGNORE VALUES (one row) errors on constraint
+#
+CREATE TABLE t1 (v1 varchar(10), v2 varchar(10), constraint unequal check (v1 != v2));
+INSERT IGNORE INTO t1 VALUES (1,1);
+Warnings:
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
+SHOW WARNINGS;
+Level Code Message
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
+INSERT IGNORE INTO t1 VALUES (1,2),(2,2);
+Warnings:
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
+SHOW WARNINGS;
+Level Code Message
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
+INSERT IGNORE INTO t1 VALUES (3,3),(4,4);
+Warnings:
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
+SHOW WARNINGS;
+Level Code Message
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
+SELECT * FROM t1;
+v1 v2
+1 2
+DROP TABLE t1;
+#
+# MDEV-32439 INSERT IGNORE VALUES (one row) errors on constraint
+#
+CREATE TABLE t1 (v1 varchar(10), v2 varchar(10), constraint unequal check (v1 != v2));
+INSERT IGNORE INTO t1 VALUES (1,1);
+Warnings:
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
+SHOW WARNINGS;
+Level Code Message
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
+INSERT IGNORE INTO t1 VALUES (1,2),(2,2);
+Warnings:
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
+SHOW WARNINGS;
+Level Code Message
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
+INSERT IGNORE INTO t1 VALUES (3,3),(4,4);
+Warnings:
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
+SHOW WARNINGS;
+Level Code Message
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
+Warning 4025 CONSTRAINT `unequal` failed for `test`.`t1`
+SELECT * FROM t1;
+v1 v2
+1 2
+DROP TABLE t1;
+#
+# End of 11.4 tests
+#
diff --git a/mysql-test/main/check_constraint.test b/mysql-test/main/check_constraint.test
index a5abe32b..73685981 100644
--- a/mysql-test/main/check_constraint.test
+++ b/mysql-test/main/check_constraint.test
@@ -247,3 +247,35 @@ drop table t1;
--echo #
--echo # End of 10.4 tests
--echo #
+
+--echo #
+--echo # MDEV-32439 INSERT IGNORE VALUES (one row) errors on constraint
+--echo #
+
+CREATE TABLE t1 (v1 varchar(10), v2 varchar(10), constraint unequal check (v1 != v2));
+INSERT IGNORE INTO t1 VALUES (1,1);
+SHOW WARNINGS;
+INSERT IGNORE INTO t1 VALUES (1,2),(2,2);
+SHOW WARNINGS;
+INSERT IGNORE INTO t1 VALUES (3,3),(4,4);
+SHOW WARNINGS;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-32439 INSERT IGNORE VALUES (one row) errors on constraint
+--echo #
+
+CREATE TABLE t1 (v1 varchar(10), v2 varchar(10), constraint unequal check (v1 != v2));
+INSERT IGNORE INTO t1 VALUES (1,1);
+SHOW WARNINGS;
+INSERT IGNORE INTO t1 VALUES (1,2),(2,2);
+SHOW WARNINGS;
+INSERT IGNORE INTO t1 VALUES (3,3),(4,4);
+SHOW WARNINGS;
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--echo #
+--echo # End of 11.4 tests
+--echo #
diff --git a/mysql-test/main/column_compression_parts.test b/mysql-test/main/column_compression_parts.test
index 4c77a730..8dfb3041 100644
--- a/mysql-test/main/column_compression_parts.test
+++ b/mysql-test/main/column_compression_parts.test
@@ -141,7 +141,6 @@ CREATE TABLE t1 (a BLOB COMPRESSED)
CREATE TABLE t1 (a VARCHAR(200) COMPRESSED) PARTITION BY KEY(a) partitions 30;
ALTER TABLE t1 COALESCE PARTITION 20;
-#ALTER TABLE t1 ADD PARTITION (PARTITION pm TABLESPACE = `innodb_file_per_table`); --mdev MDEV-13584
ALTER TABLE t1 ADD PARTITION (PARTITION pm);
CREATE TABLE t2 like t1;
ALTER TABLE t2 REMOVE PARTITIONING;
diff --git a/mysql-test/main/comments.result b/mysql-test/main/comments.result
index c13eb510..506c31b0 100644
--- a/mysql-test/main/comments.result
+++ b/mysql-test/main/comments.result
@@ -64,7 +64,10 @@ SELECT 1 /*!99999 +1*/;
SELECT 1 /*!100000 +1*/;
1 +1
2
-SELECT 1 /*!110000 +1*/;
+SELECT 1 /*!210000 +1*/;
+1
+1
+SELECT 1 /*!190000 +1*/;
1
1
#
@@ -86,7 +89,10 @@ SELECT 1 /*M!99999 +1*/;
SELECT 1 /*M!100000 +1*/;
1 +1
2
-SELECT 1 /*M!110000 +1*/;
+SELECT 1 /*M!210000 +1*/;
+1
+1
+SELECT 1 /*M!190000 +1*/;
1
1
select 1/*!2*/;
diff --git a/mysql-test/main/comments.test b/mysql-test/main/comments.test
index 6cf69635..42cdc425 100644
--- a/mysql-test/main/comments.test
+++ b/mysql-test/main/comments.test
@@ -41,7 +41,8 @@ SELECT 1 /*!50700 +1*/;
SELECT 1 /*!50999 +1*/;
SELECT 1 /*!99999 +1*/;
SELECT 1 /*!100000 +1*/;
-SELECT 1 /*!110000 +1*/;
+SELECT 1 /*!210000 +1*/;
+SELECT 1 /*!190000 +1*/;
--echo #
--echo # Tesing that versions >= 5.7.x and < 10.0.0 are not ignored
@@ -52,7 +53,8 @@ SELECT 1 /*M!50700 +1*/;
SELECT 1 /*M!50999 +1*/;
SELECT 1 /*M!99999 +1*/;
SELECT 1 /*M!100000 +1*/;
-SELECT 1 /*M!110000 +1*/;
+SELECT 1 /*M!210000 +1*/;
+SELECT 1 /*M!190000 +1*/;
#
# Bug#25411 (trigger code truncated)
diff --git a/mysql-test/main/commit.result b/mysql-test/main/commit.result
index 44d46900..bf12f3e0 100644
--- a/mysql-test/main/commit.result
+++ b/mysql-test/main/commit.result
@@ -19,21 +19,21 @@ SET @@autocommit=0;
COMMIT;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
START TRANSACTION;
-SELECT @@tx_isolation;
-@@tx_isolation
+SELECT @@transaction_isolation;
+@@transaction_isolation
REPEATABLE-READ
Should be REPEATABLE READ
SELECT * FROM t1;
s1
1
2
-SELECT @@tx_isolation;
-@@tx_isolation
+SELECT @@transaction_isolation;
+@@transaction_isolation
REPEATABLE-READ
Should be REPEATABLE READ
INSERT INTO t1 VALUES (-1);
-SELECT @@tx_isolation;
-@@tx_isolation
+SELECT @@transaction_isolation;
+@@transaction_isolation
REPEATABLE-READ
Should be REPEATABLE READ
COMMIT;
@@ -310,20 +310,20 @@ COMMIT;
#
# Test 2: Check setting of variable.
SET SESSION TRANSACTION READ WRITE;
-SELECT @@tx_read_only;
-@@tx_read_only
+SELECT @@transaction_read_only;
+@@transaction_read_only
0
SET SESSION TRANSACTION READ ONLY;
-SELECT @@tx_read_only;
-@@tx_read_only
+SELECT @@transaction_read_only;
+@@transaction_read_only
1
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ WRITE;
-SELECT @@tx_read_only;
-@@tx_read_only
+SELECT @@transaction_read_only;
+@@transaction_read_only
0
SET SESSION TRANSACTION READ ONLY, ISOLATION LEVEL REPEATABLE READ;
-SELECT @@tx_read_only;
-@@tx_read_only
+SELECT @@transaction_read_only;
+@@transaction_read_only
1
START TRANSACTION;
# Not allowed inside a transaction
@@ -528,16 +528,16 @@ DROP TABLE t1;
# Test 7: SET TRANSACTION inside stored routines
CREATE PROCEDURE p1() SET SESSION TRANSACTION READ ONLY;
CALL p1();
-SELECT @@tx_read_only;
-@@tx_read_only
+SELECT @@transaction_read_only;
+@@transaction_read_only
1
SET SESSION TRANSACTION READ WRITE;
DROP PROCEDURE p1;
CREATE PROCEDURE p1() SET SESSION TRANSACTION READ ONLY,
ISOLATION LEVEL SERIALIZABLE;
CALL p1();
-SELECT @@tx_read_only;
-@@tx_read_only
+SELECT @@transaction_read_only;
+@@transaction_read_only
1
SET SESSION TRANSACTION READ WRITE, ISOLATION LEVEL REPEATABLE READ;
DROP PROCEDURE p1;
@@ -549,8 +549,8 @@ END|
SELECT f1();
f1()
1
-SELECT @@tx_read_only;
-@@tx_read_only
+SELECT @@transaction_read_only;
+@@transaction_read_only
1
SET SESSION TRANSACTION READ WRITE;
DROP FUNCTION f1;
@@ -562,8 +562,8 @@ END|
SELECT f1();
f1()
1
-SELECT @@tx_read_only;
-@@tx_read_only
+SELECT @@transaction_read_only;
+@@transaction_read_only
1
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ WRITE;
DROP FUNCTION f1;
diff --git a/mysql-test/main/commit.test b/mysql-test/main/commit.test
index a0d4ddee..4fb86f5e 100644
--- a/mysql-test/main/commit.test
+++ b/mysql-test/main/commit.test
@@ -34,23 +34,23 @@ COMMIT;
#
# Verify consistent output from
-# SELECT @@tx_isolation (Bug#20837)
+# SELECT @@transaction_isolation (Bug#20837)
#
# The transaction will be in READ UNCOMMITTED mode,
-# but SELECT @@tx_isolation should report the session
+# but SELECT @@transaction_isolation should report the session
# value, which is REPEATABLE READ
#
SET @@autocommit=0;
COMMIT;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
START TRANSACTION;
-SELECT @@tx_isolation;
+SELECT @@transaction_isolation;
--echo Should be REPEATABLE READ
SELECT * FROM t1;
-SELECT @@tx_isolation;
+SELECT @@transaction_isolation;
--echo Should be REPEATABLE READ
INSERT INTO t1 VALUES (-1);
-SELECT @@tx_isolation;
+SELECT @@transaction_isolation;
--echo Should be REPEATABLE READ
COMMIT;
@@ -370,16 +370,16 @@ COMMIT;
--echo # Test 2: Check setting of variable.
SET SESSION TRANSACTION READ WRITE;
-SELECT @@tx_read_only;
+SELECT @@transaction_read_only;
SET SESSION TRANSACTION READ ONLY;
-SELECT @@tx_read_only;
+SELECT @@transaction_read_only;
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ WRITE;
-SELECT @@tx_read_only;
+SELECT @@transaction_read_only;
SET SESSION TRANSACTION READ ONLY, ISOLATION LEVEL REPEATABLE READ;
-SELECT @@tx_read_only;
+SELECT @@transaction_read_only;
START TRANSACTION;
--echo # Not allowed inside a transaction
@@ -628,14 +628,14 @@ DROP TABLE t1;
CREATE PROCEDURE p1() SET SESSION TRANSACTION READ ONLY;
CALL p1();
-SELECT @@tx_read_only;
+SELECT @@transaction_read_only;
SET SESSION TRANSACTION READ WRITE;
DROP PROCEDURE p1;
CREATE PROCEDURE p1() SET SESSION TRANSACTION READ ONLY,
ISOLATION LEVEL SERIALIZABLE;
CALL p1();
-SELECT @@tx_read_only;
+SELECT @@transaction_read_only;
SET SESSION TRANSACTION READ WRITE, ISOLATION LEVEL REPEATABLE READ;
DROP PROCEDURE p1;
@@ -648,7 +648,7 @@ END|
delimiter ;|
SELECT f1();
-SELECT @@tx_read_only;
+SELECT @@transaction_read_only;
SET SESSION TRANSACTION READ WRITE;
DROP FUNCTION f1;
@@ -661,7 +661,7 @@ END|
delimiter ;|
SELECT f1();
-SELECT @@tx_read_only;
+SELECT @@transaction_read_only;
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ WRITE;
DROP FUNCTION f1;
diff --git a/mysql-test/main/compress.result b/mysql-test/main/compress.result
index 24979346..f5c85d3e 100644
--- a/mysql-test/main/compress.result
+++ b/mysql-test/main/compress.result
@@ -6,6 +6,7 @@ select * from information_schema.session_status where variable_name= 'COMPRESSIO
VARIABLE_NAME VARIABLE_VALUE
COMPRESSION ON
drop table if exists t1,t2,t3,t4;
+set @@default_storage_engine="aria";
CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
@@ -606,6 +607,9 @@ explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index
+#
+# Some test with ORDER BY and limit
+#
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using filesort
@@ -1295,7 +1299,7 @@ companynr tinyint(2) unsigned zerofill NOT NULL default '00',
companyname char(30) NOT NULL default '',
PRIMARY KEY (companynr),
UNIQUE KEY companyname(companyname)
-) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
+) ENGINE=aria MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
companynr companyname
00 Unknown
@@ -1385,6 +1389,9 @@ explain select companynr,companyname from t4 left join t2 using (companynr) wher
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
delete from t2 where fld1=999999;
+#
+# Test left join optimization
+#
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
@@ -1399,15 +1406,15 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null;
id select_type table type possible_keys key key_len ref rows Extra
@@ -1423,11 +1430,11 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0;
id select_type table type possible_keys key key_len ref rows Extra
diff --git a/mysql-test/main/concurrent_innodb_safelog.result b/mysql-test/main/concurrent_innodb_safelog.result
index 40f89c7c..182e9925 100644
--- a/mysql-test/main/concurrent_innodb_safelog.result
+++ b/mysql-test/main/concurrent_innodb_safelog.result
@@ -3,8 +3,8 @@ SET GLOBAL innodb_lock_wait_timeout = 1;
SET GLOBAL TRANSACTION ISOLATION LEVEL REPEATABLE READ;
connection default;
SET SQL_MODE="";
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
+SELECT @@global.transaction_isolation;
+@@global.transaction_isolation
REPEATABLE-READ
# keep_locks == 1
GRANT ALL ON test.* TO mysqltest@localhost;
diff --git a/mysql-test/main/concurrent_innodb_unsafelog.result b/mysql-test/main/concurrent_innodb_unsafelog.result
index 3771438b..b87a420b 100644
--- a/mysql-test/main/concurrent_innodb_unsafelog.result
+++ b/mysql-test/main/concurrent_innodb_unsafelog.result
@@ -1,11 +1,11 @@
SET @save_timeout = @@GLOBAL.innodb_lock_wait_timeout;
SET GLOBAL innodb_lock_wait_timeout = 1;
-SET @save_isolation = @@GLOBAL.tx_isolation;
+SET @save_isolation = @@GLOBAL.transaction_isolation;
SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
connection default;
SET SQL_MODE="";
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
+SELECT @@global.transaction_isolation;
+@@global.transaction_isolation
READ-COMMITTED
# keep_locks == 0
GRANT ALL ON test.* TO mysqltest@localhost;
@@ -791,4 +791,4 @@ drop table t1;
drop user mysqltest@localhost;
SET SQL_MODE=default;
SET GLOBAL innodb_lock_wait_timeout = @save_timeout;
-SET GLOBAL tx_isolation = @save_isolation;
+SET GLOBAL transaction_isolation = @save_isolation;
diff --git a/mysql-test/main/concurrent_innodb_unsafelog.test b/mysql-test/main/concurrent_innodb_unsafelog.test
index d9e5effa..400d7ef8 100644
--- a/mysql-test/main/concurrent_innodb_unsafelog.test
+++ b/mysql-test/main/concurrent_innodb_unsafelog.test
@@ -18,10 +18,10 @@ let $engine_type= InnoDB;
SET @save_timeout = @@GLOBAL.innodb_lock_wait_timeout;
SET GLOBAL innodb_lock_wait_timeout = 1;
-SET @save_isolation = @@GLOBAL.tx_isolation;
+SET @save_isolation = @@GLOBAL.transaction_isolation;
SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
--disable_service_connection
--source include/concurrent.inc
--enable_service_connection
SET GLOBAL innodb_lock_wait_timeout = @save_timeout;
-SET GLOBAL tx_isolation = @save_isolation;
+SET GLOBAL transaction_isolation = @save_isolation;
diff --git a/mysql-test/main/connect.result b/mysql-test/main/connect.result
index 6642b8a1..43a4871c 100644
--- a/mysql-test/main/connect.result
+++ b/mysql-test/main/connect.result
@@ -106,14 +106,14 @@ update mysql.user set plugin="", authentication_string="", password=old_password
flush privileges;
show grants for test@localhost;
Grants for test@localhost
-GRANT ALL PRIVILEGES ON *.* TO `test`@`localhost` IDENTIFIED BY PASSWORD '2f27438961437573'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `test`@`localhost` IDENTIFIED BY PASSWORD '2f27438961437573'
update mysql.user set plugin='mysql_old_password' where user='test';
flush privileges;
show grants for test@localhost;
Grants for test@localhost
-GRANT ALL PRIVILEGES ON *.* TO `test`@`localhost` IDENTIFIED BY PASSWORD '2f27438961437573'
-connect con10,localhost,test,gambling2,;
-connect con5,localhost,test,gambling2,mysql;
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `test`@`localhost` IDENTIFIED BY PASSWORD '2f27438961437573'
+connect con10,localhost,test,gambling2,,,,auth=mysql_old_password:mysql_native_password;
+connect con5,localhost,test,gambling2,mysql,,,auth=mysql_old_password:mysql_native_password;
set password="";
set password='gambling3';
ERROR HY000: Password hash should be a 41-digit hexadecimal number
@@ -152,7 +152,7 @@ time_zone_transition_type
transaction_registry
user
user_bak
-connect con6,localhost,test,gambling3,test;
+connect con6,localhost,test,gambling3,test,,,auth=mysql_old_password:mysql_native_password;
show tables;
Tables_in_test
connection default;
@@ -160,16 +160,16 @@ disconnect con10;
disconnect con5;
disconnect con6;
connect(localhost,test,,test2,MASTER_PORT,MASTER_SOCKET);
-connect fail_con,localhost,test,,test2;
+connect fail_con,localhost,test,,test2,,,auth=mysql_old_password:mysql_native_password;
ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO)
connect(localhost,test,,test,MASTER_PORT,MASTER_SOCKET);
-connect fail_con,localhost,test,,;
+connect fail_con,localhost,test,,,,,auth=mysql_old_password:mysql_native_password;
ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO)
connect(localhost,test,zorro,test2,MASTER_PORT,MASTER_SOCKET);
-connect fail_con,localhost,test,zorro,test2;
+connect fail_con,localhost,test,zorro,test2,,,auth=mysql_old_password:mysql_native_password;
ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES)
connect(localhost,test,zorro,test,MASTER_PORT,MASTER_SOCKET);
-connect fail_con,localhost,test,zorro,;
+connect fail_con,localhost,test,zorro,,,,auth=mysql_old_password:mysql_native_password;
ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES)
# switching back from mysql.user to mysql.global_priv
delete from mysql.user where user=_binary"test";
@@ -353,9 +353,9 @@ user() current_user()
mysqltest_up1@localhost mysqltest_up1@%
disconnect pcon2;
connect(localhost,mysqltest_up2,newpw,test,MASTER_PORT,MASTER_SOCKET);
-connect pcon3,localhost,mysqltest_up2,newpw,,$MASTER_MYPORT,;
+connect pcon3,localhost,mysqltest_up2,newpw,,$MASTER_MYPORT,,auth=mysql_old_password:mysql_native_password;
ERROR 28000: Access denied for user 'mysqltest_up2'@'localhost' (using password: YES)
-connect pcon4,localhost,mysqltest_up2,oldpw,,$MASTER_MYPORT,;
+connect pcon4,localhost,mysqltest_up2,oldpw,,$MASTER_MYPORT,,auth=mysql_old_password:mysql_native_password;
select user(), current_user();
user() current_user()
mysqltest_up2@localhost mysqltest_up2@%
@@ -381,7 +381,7 @@ select user(), current_user();
user() current_user()
mysqltest_up1@localhost mysqltest_up1@%
disconnect pcon6;
-connect pcon7,localhost,mysqltest_up2,oldpw,,$MASTER_MYPORT,;
+connect pcon7,localhost,mysqltest_up2,oldpw,,$MASTER_MYPORT,,auth=mysql_old_password:mysql_native_password;
select user(), current_user();
user() current_user()
mysqltest_up2@localhost mysqltest_up2@%
diff --git a/mysql-test/main/connect.test b/mysql-test/main/connect.test
index c9969633..9758e2ae 100644
--- a/mysql-test/main/connect.test
+++ b/mysql-test/main/connect.test
@@ -70,14 +70,14 @@ update mysql.user set plugin='mysql_old_password' where user='test';
flush privileges;
show grants for test@localhost;
-connect (con10,localhost,test,gambling2,);
-connect (con5,localhost,test,gambling2,mysql);
+connect con10,localhost,test,gambling2,,,,auth=mysql_old_password:mysql_native_password;
+connect con5,localhost,test,gambling2,mysql,,,auth=mysql_old_password:mysql_native_password;
set password="";
--error ER_PASSWD_LENGTH
set password='gambling3';
set password=old_password('gambling3');
show tables;
-connect (con6,localhost,test,gambling3,test);
+connect (con6,localhost,test,gambling3,test,,,auth=mysql_old_password:mysql_native_password);
show tables;
connection default;
@@ -87,16 +87,16 @@ disconnect con6;
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error ER_ACCESS_DENIED_ERROR
-connect (fail_con,localhost,test,,test2);
+connect (fail_con,localhost,test,,test2,,,auth=mysql_old_password:mysql_native_password);
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error ER_ACCESS_DENIED_ERROR
-connect (fail_con,localhost,test,,);
+connect (fail_con,localhost,test,,,,,auth=mysql_old_password:mysql_native_password);
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error ER_ACCESS_DENIED_ERROR
-connect (fail_con,localhost,test,zorro,test2);
+connect (fail_con,localhost,test,zorro,test2,,,auth=mysql_old_password:mysql_native_password);
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error ER_ACCESS_DENIED_ERROR
-connect (fail_con,localhost,test,zorro,);
+connect (fail_con,localhost,test,zorro,,,,auth=mysql_old_password:mysql_native_password);
source include/switch_to_mysql_global_priv.inc;
# remove user 'test' so that other tests which may use 'test'
@@ -379,8 +379,8 @@ disconnect pcon2;
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
--error ER_ACCESS_DENIED_ERROR
-connect(pcon3,localhost,mysqltest_up2,newpw,,$MASTER_MYPORT,);
-connect(pcon4,localhost,mysqltest_up2,oldpw,,$MASTER_MYPORT,);
+connect(pcon3,localhost,mysqltest_up2,newpw,,$MASTER_MYPORT,,auth=mysql_old_password:mysql_native_password);
+connect(pcon4,localhost,mysqltest_up2,oldpw,,$MASTER_MYPORT,,auth=mysql_old_password:mysql_native_password);
select user(), current_user();
disconnect pcon4;
@@ -415,7 +415,7 @@ connect(pcon6,localhost,mysqltest_up1,bar,,$MASTER_MYPORT,);
select user(), current_user();
disconnect pcon6;
-connect(pcon7,localhost,mysqltest_up2,oldpw,,$MASTER_MYPORT,);
+connect(pcon7,localhost,mysqltest_up2,oldpw,,$MASTER_MYPORT,,auth=mysql_old_password:mysql_native_password);
select user(), current_user();
disconnect pcon7;
connection default;
diff --git a/mysql-test/main/connect2.result b/mysql-test/main/connect2.result
index 5430626a..5ea681c3 100644
--- a/mysql-test/main/connect2.result
+++ b/mysql-test/main/connect2.result
@@ -1,5 +1,5 @@
call mtr.add_suppression("Allocation failed");
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
set @old_thread_cache_size=@@global.thread_cache_size;
set @@global.thread_cache_size=0;
connect con1,localhost,root,,test,,;
diff --git a/mysql-test/main/connect2.test b/mysql-test/main/connect2.test
index 9d2a438a..486bbd57 100644
--- a/mysql-test/main/connect2.test
+++ b/mysql-test/main/connect2.test
@@ -5,7 +5,7 @@
--source include/not_embedded.inc
--source include/have_debug.inc
call mtr.add_suppression("Allocation failed");
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
set @old_thread_cache_size=@@global.thread_cache_size;
set @@global.thread_cache_size=0;
# Test connections to the
diff --git a/mysql-test/main/connect_debug.result b/mysql-test/main/connect_debug.result
index 2adafc2c..1be7722f 100644
--- a/mysql-test/main/connect_debug.result
+++ b/mysql-test/main/connect_debug.result
@@ -18,3 +18,23 @@ connect(localhost,root,,test,MASTER_MYPORT,MYSQL_TMP_DIR/mysqld.1.sock);
connect con2,localhost,root;
ERROR HY000: Received malformed packet
set global debug_dbug=@old_dbug;
+#
+# Start of 11.2 tests
+#
+#
+# MDEV-33182 Server assertion fails when trying to test the connection with DBeaver
+#
+SET global debug_dbug='+d,thd_init_client_charset_utf8mb3_bin';
+connect con1,localhost,root;
+connection con1;
+SHOW VARIABLES LIKE 'collation%';
+Variable_name Value
+collation_connection utf8mb3_bin
+collation_database latin1_swedish_ci
+collation_server latin1_swedish_ci
+disconnect con1;
+connection default;
+SET global debug_dbug=@old_debug;
+#
+# End of 11.2 tests
+#
diff --git a/mysql-test/main/connect_debug.test b/mysql-test/main/connect_debug.test
index 169ba6e9..9471cb76 100644
--- a/mysql-test/main/connect_debug.test
+++ b/mysql-test/main/connect_debug.test
@@ -19,7 +19,7 @@ set global debug_dbug='+d,auth_invalid_plugin';
create user 'bad' identified by 'worse';
--replace_regex /loaded: [^\n]*/loaded: invalid plugin name/
--error 1
---exec $MYSQL --default-auth=mysql_old_password --user=bad --password=worse 2>&1
+--exec $MYSQL --default-auth=ed25519 --user=bad --password=worse 2>&1
set global debug_dbug=@old_dbug;
drop user bad;
@@ -37,3 +37,24 @@ set global debug_dbug='+d,poison_srv_handshake_scramble_len';
--error 2027
connect con2,localhost,root;
set global debug_dbug=@old_dbug;
+
+
+--echo #
+--echo # Start of 11.2 tests
+--echo #
+
+--echo #
+--echo # MDEV-33182 Server assertion fails when trying to test the connection with DBeaver
+--echo #
+
+SET global debug_dbug='+d,thd_init_client_charset_utf8mb3_bin';
+connect con1,localhost,root;
+connection con1;
+SHOW VARIABLES LIKE 'collation%';
+disconnect con1;
+connection default;
+SET global debug_dbug=@old_debug;
+
+--echo #
+--echo # End of 11.2 tests
+--echo #
diff --git a/mysql-test/main/costs.result b/mysql-test/main/costs.result
new file mode 100644
index 00000000..9d69207f
--- /dev/null
+++ b/mysql-test/main/costs.result
@@ -0,0 +1,126 @@
+create table t1 (a int primary key, b int, c int, d int, e int, key ba (b,a), key bda (b,d,a), key cba (c,b,a), key cb (c,b), key d (d)) engine=aria;
+insert into t1 select seq,seq,seq,seq,seq from seq_1_to_10;
+insert into t1 values(20,2,2,2,2),(21,3,4,5,6);
+#
+# Get different scan costs
+#
+explain select sum(e) as "table_scan" from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 12
+Last_query_cost 0.012556
+explain select sum(a) as "index scan" from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 12 Using index
+Last_query_cost 0.007441
+#
+# Range scans should be used if we don't examine all rows in the table
+#
+explain select count(a) from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+Last_query_cost 0.000000
+explain select count(*) from t1 where a > 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 12 Using where; Using index
+Last_query_cost 0.002877
+explain select count(*) from t1 where a > 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 12 Using where; Using index
+Last_query_cost 0.002877
+explain select count(*) from t1 where a > 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 11 Using where; Using index
+Last_query_cost 0.002747
+#
+# Shorter indexes are prefered over longer indexs
+#
+explain select sum(a+b) from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL ba 9 NULL 12 Using index
+Last_query_cost 0.007441
+explain select count(*) from t1 where b between 5 and 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range ba,bda ba 5 NULL 6 Using where; Using index
+Last_query_cost 0.002097
+explain select sum(b+c) from t1 where b between 5 and 6 and c between 5 and 6;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range ba,bda,cba,cb cba 10 NULL 2 Using where; Using index
+Last_query_cost 0.001577
+# Cost of 'd' should be slightly smaller as key 'ba' is longer than 'd'
+explain select count(*) from t1 where b > 6;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range ba,bda ba 5 NULL 5 Using where; Using index
+Last_query_cost 0.001967
+explain select count(*) from t1 where d > 6;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range d d 5 NULL 5 Using where; Using index
+Last_query_cost 0.001967
+#
+# Check covering index usage
+#
+explain select a,b,c from t1 where a=b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL cba 14 NULL 12 Using where; Using index
+Last_query_cost 0.007441
+#
+# Prefer ref keys over ranges
+#
+explain select count(*) from t1 where b=2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref ba,bda ba 5 const 2 Using index
+Last_query_cost 0.001141
+explain select count(*) from t1 where b=2 and c=2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref ba,bda,cba,cb cba 10 const,const 2 Using index
+Last_query_cost 0.001141
+explain select count(*) from t1 where b=3 and c between 3 and 4;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range ba,bda,cba,cb cba 10 NULL 2 Using where; Using index
+Last_query_cost 0.001577
+#
+# Prefer eq keys over ref keys
+#
+explain select a,b,e from t1 where a=10 or a=11;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using index condition
+Last_query_cost 0.003126
+explain select a,b,e from t1 where d=10 or d=11;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range d d 5 NULL 2 Using index condition
+Last_query_cost 0.003291
+drop table t1;
+#
+# MDEV-30328 Assertion `avg_io_cost != 0.0 || index_cost.io + row_cost.io == 0' failed in
+# Cost_estimate::total_cost()
+#
+set @save=@@InnoDB.optimizer_disk_read_ratio;
+set global InnoDB.optimizer_disk_read_ratio=0;
+create table t1 (
+`l_orderkey` int(11) NOT NULL,
+`l_partkey` int(11) DEFAULT NULL,
+`l_suppkey` int(11) DEFAULT NULL,
+`l_linenumber` int(11) NOT NULL,
+`l_extra` int(11) NOT NULL,
+`l_quantity` double DEFAULT NULL,
+`l_extendedprice` double DEFAULT NULL,
+`l_discount` double DEFAULT NULL,
+`l_tax` double DEFAULT NULL,
+`l_returnflag` char(1) DEFAULT NULL,
+`l_linestatus` char(1) DEFAULT NULL,
+`l_shipDATE` date DEFAULT NULL,
+`l_commitDATE` date DEFAULT NULL,
+`l_receiptDATE` date DEFAULT NULL,
+`l_shipinstruct` char(25) DEFAULT NULL,
+`l_shipmode` char(10) DEFAULT NULL,
+`l_comment` varchar(44) DEFAULT NULL,
+PRIMARY KEY (`l_orderkey`),
+UNIQUE (`l_linenumber`),
+UNIQUE (`l_extra`) ,
+KEY `l_suppkey` (l_suppkey, l_partkey),
+KEY `long_suppkey` (l_partkey, l_suppkey, l_linenumber, l_extra) )
+ENGINE= InnoDB;
+explain select count(*) from test.t1 force index (l_suppkey) where l_suppkey >= 0 and l_partkey >=0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range l_suppkey l_suppkey 10 NULL 1 Using where; Using index
+drop table t1;
+set global InnoDB.optimizer_disk_read_ratio=@save;
diff --git a/mysql-test/main/costs.test b/mysql-test/main/costs.test
new file mode 100644
index 00000000..bb933a20
--- /dev/null
+++ b/mysql-test/main/costs.test
@@ -0,0 +1,116 @@
+#
+# Test of cost calculations. This test is using the Aria engine as the cost
+# calculations are stable for it.
+#
+# This file also includes MDEV's that shows errors in cost calculation functions.
+#
+
+--source include/have_sequence.inc
+--source include/have_innodb.inc
+
+create table t1 (a int primary key, b int, c int, d int, e int, key ba (b,a), key bda (b,d,a), key cba (c,b,a), key cb (c,b), key d (d)) engine=aria;
+insert into t1 select seq,seq,seq,seq,seq from seq_1_to_10;
+insert into t1 values(20,2,2,2,2),(21,3,4,5,6);
+
+--echo #
+--echo # Get different scan costs
+--echo #
+
+explain select sum(e) as "table_scan" from t1;
+--source include/last_query_cost.inc
+explain select sum(a) as "index scan" from t1;
+--source include/last_query_cost.inc
+
+--echo #
+--echo # Range scans should be used if we don't examine all rows in the table
+--echo #
+explain select count(a) from t1;
+--source include/last_query_cost.inc
+explain select count(*) from t1 where a > 0;
+--source include/last_query_cost.inc
+explain select count(*) from t1 where a > 1;
+--source include/last_query_cost.inc
+explain select count(*) from t1 where a > 2;
+--source include/last_query_cost.inc
+
+--echo #
+--echo # Shorter indexes are prefered over longer indexs
+--echo #
+explain select sum(a+b) from t1;
+--source include/last_query_cost.inc
+explain select count(*) from t1 where b between 5 and 10;
+--source include/last_query_cost.inc
+explain select sum(b+c) from t1 where b between 5 and 6 and c between 5 and 6;
+--source include/last_query_cost.inc
+
+--echo # Cost of 'd' should be slightly smaller as key 'ba' is longer than 'd'
+explain select count(*) from t1 where b > 6;
+--source include/last_query_cost.inc
+explain select count(*) from t1 where d > 6;
+--source include/last_query_cost.inc
+
+
+--echo #
+--echo # Check covering index usage
+--echo #
+explain select a,b,c from t1 where a=b;
+--source include/last_query_cost.inc
+
+--echo #
+--echo # Prefer ref keys over ranges
+--echo #
+
+explain select count(*) from t1 where b=2;
+--source include/last_query_cost.inc
+explain select count(*) from t1 where b=2 and c=2;
+--source include/last_query_cost.inc
+explain select count(*) from t1 where b=3 and c between 3 and 4;
+--source include/last_query_cost.inc
+
+--echo #
+--echo # Prefer eq keys over ref keys
+--echo #
+
+explain select a,b,e from t1 where a=10 or a=11;
+--source include/last_query_cost.inc
+explain select a,b,e from t1 where d=10 or d=11;
+--source include/last_query_cost.inc
+
+drop table t1;
+
+--echo #
+--echo # MDEV-30328 Assertion `avg_io_cost != 0.0 || index_cost.io + row_cost.io == 0' failed in
+--echo # Cost_estimate::total_cost()
+--echo #
+
+set @save=@@InnoDB.optimizer_disk_read_ratio;
+set global InnoDB.optimizer_disk_read_ratio=0;
+
+create table t1 (
+ `l_orderkey` int(11) NOT NULL,
+ `l_partkey` int(11) DEFAULT NULL,
+ `l_suppkey` int(11) DEFAULT NULL,
+ `l_linenumber` int(11) NOT NULL,
+ `l_extra` int(11) NOT NULL,
+ `l_quantity` double DEFAULT NULL,
+ `l_extendedprice` double DEFAULT NULL,
+ `l_discount` double DEFAULT NULL,
+ `l_tax` double DEFAULT NULL,
+ `l_returnflag` char(1) DEFAULT NULL,
+ `l_linestatus` char(1) DEFAULT NULL,
+ `l_shipDATE` date DEFAULT NULL,
+ `l_commitDATE` date DEFAULT NULL,
+ `l_receiptDATE` date DEFAULT NULL,
+ `l_shipinstruct` char(25) DEFAULT NULL,
+ `l_shipmode` char(10) DEFAULT NULL,
+ `l_comment` varchar(44) DEFAULT NULL,
+ PRIMARY KEY (`l_orderkey`),
+ UNIQUE (`l_linenumber`),
+ UNIQUE (`l_extra`) ,
+ KEY `l_suppkey` (l_suppkey, l_partkey),
+ KEY `long_suppkey` (l_partkey, l_suppkey, l_linenumber, l_extra) )
+ ENGINE= InnoDB;
+explain select count(*) from test.t1 force index (l_suppkey) where l_suppkey >= 0 and l_partkey >=0;
+drop table t1;
+
+set global InnoDB.optimizer_disk_read_ratio=@save;
diff --git a/mysql-test/main/crash_commit_before-master.opt b/mysql-test/main/crash_commit_before-master.opt
index f464a101..d1bf57fe 100644
--- a/mysql-test/main/crash_commit_before-master.opt
+++ b/mysql-test/main/crash_commit_before-master.opt
@@ -1,3 +1,2 @@
--loose-skip-stack-trace --skip-core-file
--default-storage-engine=MyISAM
---loose-skip-innodb-file-per-table
diff --git a/mysql-test/main/create.result b/mysql-test/main/create.result
index 9db7d5ca..d7f4eb27 100644
--- a/mysql-test/main/create.result
+++ b/mysql-test/main/create.result
@@ -1083,12 +1083,13 @@ t1 CREATE TABLE `t1` (
`STAGE` tinyint(2) NOT NULL,
`MAX_STAGE` tinyint(2) NOT NULL,
`PROGRESS` decimal(7,3) NOT NULL,
- `MEMORY_USED` bigint(7) NOT NULL,
- `MAX_MEMORY_USED` bigint(7) NOT NULL,
- `EXAMINED_ROWS` int(7) NOT NULL,
- `QUERY_ID` bigint(4) NOT NULL,
+ `MEMORY_USED` bigint(10) NOT NULL,
+ `MAX_MEMORY_USED` bigint(10) NOT NULL,
+ `EXAMINED_ROWS` bigint(10) NOT NULL,
+ `SENT_ROWS` bigint(10) NOT NULL,
+ `QUERY_ID` bigint(10) NOT NULL,
`INFO_BINARY` blob,
- `TID` bigint(4) NOT NULL
+ `TID` bigint(10) NOT NULL
) DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
drop table t1;
create temporary table t1 like information_schema.processlist;
@@ -1107,12 +1108,13 @@ t1 CREATE TEMPORARY TABLE `t1` (
`STAGE` tinyint(2) NOT NULL,
`MAX_STAGE` tinyint(2) NOT NULL,
`PROGRESS` decimal(7,3) NOT NULL,
- `MEMORY_USED` bigint(7) NOT NULL,
- `MAX_MEMORY_USED` bigint(7) NOT NULL,
- `EXAMINED_ROWS` int(7) NOT NULL,
- `QUERY_ID` bigint(4) NOT NULL,
+ `MEMORY_USED` bigint(10) NOT NULL,
+ `MAX_MEMORY_USED` bigint(10) NOT NULL,
+ `EXAMINED_ROWS` bigint(10) NOT NULL,
+ `SENT_ROWS` bigint(10) NOT NULL,
+ `QUERY_ID` bigint(10) NOT NULL,
`INFO_BINARY` blob,
- `TID` bigint(4) NOT NULL
+ `TID` bigint(10) NOT NULL
) DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
drop table t1;
create table t1 like information_schema.character_sets;
diff --git a/mysql-test/main/create_or_replace2.result b/mysql-test/main/create_or_replace2.result
index c84d5400..90258d23 100644
--- a/mysql-test/main/create_or_replace2.result
+++ b/mysql-test/main/create_or_replace2.result
@@ -1,7 +1,7 @@
include/master-slave.inc
[connection master]
drop table if exists t1;
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
CREATE TABLE t1 (i INT, KEY(i)) ENGINE=InnoDB;
CREATE OR REPLACE TEMPORARY TABLE tmp (a int, b int, key(a)) engine=myisam;
SET debug_dbug='+d,send_kill_after_delete';
@@ -9,6 +9,7 @@ CREATE OR REPLACE TABLE t1 LIKE tmp;
SET debug_dbug=@old_debug;
SHOW TABLES;
Tables_in_test
+tmp
t1
show create table t1;
Table Create Table
diff --git a/mysql-test/main/create_or_replace2.test b/mysql-test/main/create_or_replace2.test
index 80c8b635..fc951aa8 100644
--- a/mysql-test/main/create_or_replace2.test
+++ b/mysql-test/main/create_or_replace2.test
@@ -10,7 +10,7 @@
--disable_warnings
drop table if exists t1;
--enable_warnings
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
#
# MDEV-5854
diff --git a/mysql-test/main/cset_narrowing.result b/mysql-test/main/cset_narrowing.result
index e048e85b..377cbdae 100644
--- a/mysql-test/main/cset_narrowing.result
+++ b/mysql-test/main/cset_narrowing.result
@@ -57,12 +57,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t10",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t10.mb4 is not null"
}
@@ -76,7 +79,9 @@ EXPLAIN
"key_length": "99",
"used_key_parts": ["mb3"],
"ref": ["test.t10.mb4"],
+ "loops": 4,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t1.mb3 = t10.mb4"
}
@@ -102,12 +107,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t10",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -120,7 +128,9 @@ EXPLAIN
"key_length": "99",
"used_key_parts": ["mb3"],
"ref": ["test.t10.mb4"],
+ "loops": 4,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t10.mb4 <=> t1.mb3"
}
@@ -141,12 +151,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t10",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -154,7 +167,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 4,
"rows": 10002,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t10.mb4 = convert(t1.mb3 using utf8mb4)"
}
@@ -171,12 +186,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t10",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -189,7 +207,9 @@ EXPLAIN
"key_length": "99",
"used_key_parts": ["mb3"],
"ref": ["func"],
+ "loops": 4,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t1.mb3 = concat('',t10.mb4)"
}
@@ -239,7 +259,7 @@ JS
"using_mrr": false,
"index_only": false,
"rows": 3,
- "cost": 3.760377105,
+ "cost": "COST_REPLACED",
"chosen": true
}
]
@@ -256,6 +276,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -278,7 +299,9 @@ EXPLAIN
"key": "mb3",
"key_length": "99",
"used_key_parts": ["mb3"],
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t1.mb3 = '????' or t1.mb3 = 'hello'"
}
@@ -292,6 +315,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -310,7 +334,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 10002,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "convert(t1.mb3 using utf8mb4) > '????'"
}
@@ -331,6 +357,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -353,7 +380,9 @@ EXPLAIN
"key": "mb4",
"key_length": "131",
"used_key_parts": ["mb4"],
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t2.mb4 > '????'"
}
@@ -374,12 +403,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t10",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t10.mb4 is not null and t10.mb4 is not null"
}
@@ -393,7 +425,9 @@ EXPLAIN
"key_length": "99",
"used_key_parts": ["mb3"],
"ref": ["test.t10.mb4"],
+ "loops": 4,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t1.mb3 = t10.mb4"
}
@@ -407,7 +441,9 @@ EXPLAIN
"key_length": "131",
"used_key_parts": ["mb4"],
"ref": ["test.t10.mb4"],
+ "loops": 4,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "concat(convert(t1.mb3 using utf8mb4),t2.mb4,t10.mb4) <> 'Bebebe'"
}
@@ -458,12 +494,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t10",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 25,
"attached_condition": "t10.mb4 = 'hello'"
}
@@ -477,7 +516,9 @@ EXPLAIN
"key_length": "99",
"used_key_parts": ["mb3"],
"ref": ["const"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t1.mb3 = t10.mb4"
}
@@ -491,7 +532,9 @@ EXPLAIN
"key_length": "131",
"used_key_parts": ["mb4"],
"ref": ["const"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t2.mb4 = t10.mb4 and concat(convert(t1.mb3 using utf8mb4),t2.mb4,t10.mb4) <> 'Bebebe'"
}
diff --git a/mysql-test/main/cset_narrowing.test b/mysql-test/main/cset_narrowing.test
index 4d0947f6..4b97c4f0 100644
--- a/mysql-test/main/cset_narrowing.test
+++ b/mysql-test/main/cset_narrowing.test
@@ -50,6 +50,7 @@ explain select * from t1 force index (mb3) where t1.mb3='😊';
--echo #
--echo # Check ref access on mb3_field=mb4_field
--echo #
+--source include/explain-no-costs.inc
explain format=json
select * from t10,t1 where t10.mb4=t1.mb3;
@@ -57,11 +58,13 @@ select * from t10,t1 where t10.mb4=t1.mb3;
select * from t10,t1 use index() where t10.mb4=t1.mb3;
+--source include/explain-no-costs.inc
explain format=json
select * from t10,t1 where t10.mb4<=>t1.mb3;
select * from t10,t1 where t10.mb4<=>t1.mb3;
+--source include/explain-no-costs.inc
set statement optimizer_switch='cset_narrowing=off', join_cache_level=0 for
explain format=json
select * from t10,t1 where t10.mb4=t1.mb3;
@@ -69,6 +72,7 @@ select * from t10,t1 where t10.mb4=t1.mb3;
--echo #
--echo # Check ref access on mb3_field=mb4_expr
--echo #
+--source include/explain-no-costs.inc
explain format=json
select * from t10,t1 where t1.mb3=concat('',t10.mb4);
@@ -88,6 +92,7 @@ set optimizer_trace=1;
explain
select * from t10, t1 where t10.mb4=t1.mb3 and t10.pk=3;
+--source include/explain-no-costs.inc
select
json_detailed(json_extract(trace, '$**.range_scan_alternatives')) as JS
from
@@ -99,9 +104,11 @@ select * from t10, t1 where t10.mb4=t1.mb3 and t10.pk=3;
--echo # Will range optimizer handle t1.mb3>t10.mb4? No...
--echo #
+--source include/explain-no-costs.inc
explain format=json
select * from t10, t1 where (t1.mb3=t10.mb4 or t1.mb3='hello') and t10.pk=3;
+--source include/explain-no-costs.inc
explain format=json
select * from t10, t1 where t1.mb3>t10.mb4 and t10.pk=3;
@@ -112,6 +119,7 @@ create table t2 (
key(mb4)
);
insert into t2 select * from t1;
+--source include/explain-no-costs.inc
explain format=json
select * from t10, t2 where t2.mb4>t10.mb4 and t10.pk=3;
@@ -121,6 +129,7 @@ select * from t10, t2 where t2.mb4>t10.mb4 and t10.pk=3;
--echo # - ref acccess lookup keys do use equality substitution,
--echo # - concat() arguments don't
+--source include/explain-no-costs.inc
explain format=json
select straight_join * from t10,t1 force index(mb3),t2
where
@@ -134,6 +143,7 @@ where
--echo # Equality substitution doesn't happen for constants, for both narrowing
--echo # and non-narrowing comparisons:
+--source include/explain-no-costs.inc
explain format=json
select * from t10,t1,t2
where
diff --git a/mysql-test/main/cte_nonrecursive.result b/mysql-test/main/cte_nonrecursive.result
index 67a38ce0..88c27492 100644
--- a/mysql-test/main/cte_nonrecursive.result
+++ b/mysql-test/main/cte_nonrecursive.result
@@ -85,14 +85,14 @@ with t as (select a, count(*) from t1 where b >= 'c' group by a)
select * from t2,t where t2.c=t.a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 4 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.c 2
+1 PRIMARY <derived2> ref key0 key0 5 test.t2.c 1
2 DERIVED t1 ALL NULL NULL NULL NULL 8 Using where; Using temporary; Using filesort
explain
select * from t2, (select a, count(*) from t1 where b >= 'c' group by a) as t
where t2.c=t.a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 4 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.c 2
+1 PRIMARY <derived2> ref key0 key0 5 test.t2.c 1
2 DERIVED t1 ALL NULL NULL NULL NULL 8 Using where; Using temporary; Using filesort
# specivication of t contains having
with t as (select a, count(*) from t1 where b >= 'c'
@@ -150,16 +150,14 @@ explain
with t as (select a from t1 where a<5)
select * from t2 where c in (select a from t);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 ALL NULL NULL NULL NULL 4
-1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1
-3 MATERIALIZED t1 ALL NULL NULL NULL NULL 8 Using where
+1 PRIMARY t2 ALL NULL NULL NULL NULL 4 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 8 Using where; FirstMatch(t2); Using join buffer (flat, BNL join)
explain
select * from t2
where c in (select a from (select a from t1 where a<5) as t);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 ALL NULL NULL NULL NULL 4
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t1 ALL NULL NULL NULL NULL 8 Using where
+1 PRIMARY t2 ALL NULL NULL NULL NULL 4 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 8 Using where; FirstMatch(t2); Using join buffer (flat, BNL join)
# materialized t is used in a subquery
with t as (select count(*) as c from t1 where b >= 'c' group by a)
select * from t2 where c in (select c from t);
@@ -175,7 +173,7 @@ with t as (select count(*) as c from t1 where b >= 'c' group by a)
select * from t2 where c in (select c from t);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 4 Using where
-1 PRIMARY <derived2> ref key0 key0 8 test.t2.c 2 Using where; FirstMatch(t2)
+1 PRIMARY <derived2> ref key0 key0 8 test.t2.c 1 Using where; FirstMatch(t2)
2 DERIVED t1 ALL NULL NULL NULL NULL 8 Using where; Using temporary; Using filesort
explain
select * from t2
@@ -183,7 +181,7 @@ where c in (select c from (select count(*) as c from t1
where b >= 'c' group by a) as t);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 4 Using where
-1 PRIMARY <derived3> ref key0 key0 8 test.t2.c 2 Using where; FirstMatch(t2)
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 8 test.t2.c 1 Using where
3 DERIVED t1 ALL NULL NULL NULL NULL 8 Using where; Using temporary; Using filesort
# two references to t specified by a query
# selecting a field: both in main query
@@ -369,7 +367,7 @@ select c as a from t2 where c < 4)
select * from t2,t where t2.c=t.a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 4 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.c 1
+1 PRIMARY <derived2> eq_ref distinct_key distinct_key 5 test.t2.c 1
2 DERIVED t1 ALL NULL NULL NULL NULL 8 Using where
3 UNION t2 ALL NULL NULL NULL NULL 4 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
@@ -381,7 +379,7 @@ select c as a from t2 where c < 4) as t
where t2.c=t.a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 4 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.c 1
+1 PRIMARY <derived2> eq_ref distinct_key distinct_key 5 test.t2.c 1
2 DERIVED t1 ALL NULL NULL NULL NULL 8 Using where
3 UNION t2 ALL NULL NULL NULL NULL 4 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
@@ -597,7 +595,7 @@ explain
select * from v2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 4 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.c 2
+1 PRIMARY <derived2> ref key0 key0 5 test.t2.c 1
2 DERIVED t1 ALL NULL NULL NULL NULL 8 Using where; Using temporary; Using filesort
# with clause in the specification of a view that whose definition
# table alias for a with table
@@ -2300,14 +2298,14 @@ WHERE col1 IN ( SELECT col FROM t );
SELECT * FROM tt;
col2
2018-10-01
-2018-10-01
2017-10-01
+2018-10-01
SELECT t4.col1
FROM tt, t4
WHERE t4.col2 = tt.col2 AND t4.col1 IN ( SELECT col FROM t );
col1
-8
4
+8
DROP TABLE t,tt;
CALL SP1();
col1
@@ -2485,17 +2483,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "REPLACED",
"filtered": 100,
"attached_condition": "cte.c1 < 4 and cte.c2 > 1",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"having_condition": "sum(t1.b) < 5 and c2 > 1",
"filesort": {
"sort_key": "t1.a",
@@ -2505,7 +2507,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 1 and t1.a < 4"
}
diff --git a/mysql-test/main/cte_recursive.result b/mysql-test/main/cte_recursive.result
index ef0920bf..b92804dc 100644
--- a/mysql-test/main/cte_recursive.result
+++ b/mysql-test/main/cte_recursive.result
@@ -689,17 +689,17 @@ from ancestor_couple_ids c, coupled_ancestors h, coupled_ancestors w
where c.h_id = h.id and c.w_id= w.id;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 100.00 Using where
-1 PRIMARY <derived3> ref key0 key0 5 c.h_id 2 100.00
-1 PRIMARY <derived3> ref key0 key0 5 c.w_id 2 100.00
+1 PRIMARY <derived3> ref key0 key0 5 c.h_id 1 100.00
+1 PRIMARY <derived3> ref key0 key0 5 c.w_id 1 100.00
3 DERIVED folks ALL NULL NULL NULL NULL 12 100.00 Using where
-4 RECURSIVE UNION <derived2> ALL NULL NULL NULL NULL 2 100.00
-4 RECURSIVE UNION p ALL NULL NULL NULL NULL 12 100.00 Using where; Using join buffer (flat, BNL join)
-5 RECURSIVE UNION <derived2> ALL NULL NULL NULL NULL 2 100.00
-5 RECURSIVE UNION p ALL NULL NULL NULL NULL 12 100.00 Using where; Using join buffer (flat, BNL join)
+4 RECURSIVE UNION p ALL NULL NULL NULL NULL 12 100.00 Using where
+4 RECURSIVE UNION <derived2> ref key0 key0 5 test.p.id 1 100.00
+5 RECURSIVE UNION p ALL NULL NULL NULL NULL 12 100.00 Using where
+5 RECURSIVE UNION <derived2> ref key0 key0 5 test.p.id 1 100.00
NULL UNION RESULT <union3,4,5> ALL NULL NULL NULL NULL NULL NULL
2 DERIVED <derived3> ALL NULL NULL NULL NULL 12 100.00 Using where
Warnings:
-Note 1003 with recursive ancestor_couple_ids(`h_id`,`w_id`) as (/* select#2 */ select `a`.`father` AS `h_id`,`a`.`mother` AS `w_id` from `coupled_ancestors` `a` where `a`.`father` is not null and `a`.`mother` is not null), coupled_ancestors(`id`,`name`,`dob`,`father`,`mother`) as (/* select#3 */ select `test`.`folks`.`id` AS `id`,`test`.`folks`.`name` AS `name`,`test`.`folks`.`dob` AS `dob`,`test`.`folks`.`father` AS `father`,`test`.`folks`.`mother` AS `mother` from `test`.`folks` where `test`.`folks`.`name` = 'Me' union all /* select#4 */ select `test`.`p`.`id` AS `id`,`test`.`p`.`name` AS `name`,`test`.`p`.`dob` AS `dob`,`test`.`p`.`father` AS `father`,`test`.`p`.`mother` AS `mother` from `test`.`folks` `p` join `ancestor_couple_ids` `fa` where `test`.`p`.`id` = `fa`.`h_id` union all /* select#5 */ select `test`.`p`.`id` AS `id`,`test`.`p`.`name` AS `name`,`test`.`p`.`dob` AS `dob`,`test`.`p`.`father` AS `father`,`test`.`p`.`mother` AS `mother` from `test`.`folks` `p` join `ancestor_couple_ids` `ma` where `test`.`p`.`id` = `ma`.`w_id`)/* select#1 */ select `h`.`name` AS `name`,`h`.`dob` AS `dob`,`w`.`name` AS `name`,`w`.`dob` AS `dob` from `ancestor_couple_ids` `c` join `coupled_ancestors` `h` join `coupled_ancestors` `w` where `h`.`id` = `c`.`h_id` and `w`.`id` = `c`.`w_id`
+Note 1003 with recursive ancestor_couple_ids(`h_id`,`w_id`) as (/* select#2 */ select `a`.`father` AS `h_id`,`a`.`mother` AS `w_id` from `coupled_ancestors` `a` where `a`.`father` is not null and `a`.`mother` is not null), coupled_ancestors(`id`,`name`,`dob`,`father`,`mother`) as (/* select#3 */ select `test`.`folks`.`id` AS `id`,`test`.`folks`.`name` AS `name`,`test`.`folks`.`dob` AS `dob`,`test`.`folks`.`father` AS `father`,`test`.`folks`.`mother` AS `mother` from `test`.`folks` where `test`.`folks`.`name` = 'Me' union all /* select#4 */ select `test`.`p`.`id` AS `id`,`test`.`p`.`name` AS `name`,`test`.`p`.`dob` AS `dob`,`test`.`p`.`father` AS `father`,`test`.`p`.`mother` AS `mother` from `test`.`folks` `p` join `ancestor_couple_ids` `fa` where `fa`.`h_id` = `test`.`p`.`id` union all /* select#5 */ select `test`.`p`.`id` AS `id`,`test`.`p`.`name` AS `name`,`test`.`p`.`dob` AS `dob`,`test`.`p`.`father` AS `father`,`test`.`p`.`mother` AS `mother` from `test`.`folks` `p` join `ancestor_couple_ids` `ma` where `ma`.`w_id` = `test`.`p`.`id`)/* select#1 */ select `h`.`name` AS `name`,`h`.`dob` AS `dob`,`w`.`name` AS `name`,`w`.`dob` AS `dob` from `ancestor_couple_ids` `c` join `coupled_ancestors` `h` join `coupled_ancestors` `w` where `h`.`id` = `c`.`h_id` and `w`.`id` = `c`.`w_id`
# simple mutual recursion
with recursive
ancestor_couple_ids(h_id, w_id)
@@ -1240,9 +1240,9 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 12
2 DERIVED folks ALL NULL NULL NULL NULL 12 Using where
3 RECURSIVE UNION p ALL PRIMARY NULL NULL NULL 12
-3 RECURSIVE UNION <derived2> ref key0 key0 5 test.p.id 2
+3 RECURSIVE UNION <derived2> ref key0 key0 5 test.p.id 1
4 RECURSIVE UNION p ALL PRIMARY NULL NULL NULL 12
-4 RECURSIVE UNION <derived2> ref key0 key0 5 test.p.id 2
+4 RECURSIVE UNION <derived2> ref key0 key0 5 test.p.id 1
NULL UNION RESULT <union2,3,4> ALL NULL NULL NULL NULL NULL
with recursive
ancestors
@@ -1341,12 +1341,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 1,
"rows": 24,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
@@ -1357,12 +1360,15 @@ EXPLAIN
{
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "folks",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "folks.`name` = 'Me2'"
}
@@ -1374,12 +1380,15 @@ EXPLAIN
"query_block": {
"select_id": 6,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "prev_gen.`id` < 345",
"materialized": {
@@ -1391,12 +1400,15 @@ EXPLAIN
{
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "folks",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "folks.`name` = 'Me'"
}
@@ -1408,13 +1420,16 @@ EXPLAIN
"query_block": {
"select_id": 2,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "folks",
"access_type": "ALL",
"possible_keys": ["PRIMARY"],
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -1423,7 +1438,9 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 12,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -1448,12 +1465,15 @@ EXPLAIN
"query_block": {
"select_id": 5,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 1,
"rows": 24,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "ancestors.`id` < 234"
}
@@ -1501,12 +1521,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
@@ -1517,12 +1540,15 @@ EXPLAIN
{
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "v",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v.`name` = 'Me' and v.father is not null and v.mother is not null"
}
@@ -1536,7 +1562,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["id"],
"ref": ["test.v.father"],
+ "loops": 12,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -1549,7 +1577,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["id"],
"ref": ["test.v.mother"],
+ "loops": 12,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1560,12 +1590,15 @@ EXPLAIN
"query_block": {
"select_id": 2,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "a.father is not null and a.mother is not null"
}
@@ -1579,7 +1612,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["id"],
"ref": ["a.father"],
+ "loops": 2,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -1592,7 +1627,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["id"],
"ref": ["a.mother"],
+ "loops": 2,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1826,12 +1863,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
@@ -1842,12 +1882,15 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1858,12 +1901,15 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.a < 1000"
}
@@ -2465,6 +2511,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -2472,9 +2519,11 @@ ANALYZE
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
@@ -2499,6 +2548,7 @@ ANALYZE
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "REPLACED",
"r_loops": 10,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -2506,9 +2556,11 @@ ANALYZE
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 10,
"rows": 2,
"r_rows": 1,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
@@ -3165,7 +3217,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 16 100.00
2 DERIVED a ALL NULL NULL NULL NULL 16 100.00 Using where
3 RECURSIVE UNION b ALL NULL NULL NULL NULL 16 100.00 Using where
-3 RECURSIVE UNION <derived2> ref key0 key0 35 test.b.departure 2 100.00
+3 RECURSIVE UNION <derived2> ref key0 key0 35 test.b.departure 1 100.00
4 DEPENDENT SUBQUERY <derived2> ALL NULL NULL NULL NULL 16 100.00 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
@@ -3268,9 +3320,9 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 15 Using filesort
2 DERIVED t2 ALL NULL NULL NULL NULL 15 Using where
3 RECURSIVE UNION t2 ALL NULL NULL NULL NULL 15 Using where
-3 RECURSIVE UNION <derived2> ref key0 key0 5 test.t2.id 2
+3 RECURSIVE UNION <derived2> ref key0 key0 5 test.t2.id 1
4 RECURSIVE UNION t2 ALL NULL NULL NULL NULL 15 Using where
-4 RECURSIVE UNION <derived2> ref key0 key0 5 test.t2.id 2
+4 RECURSIVE UNION <derived2> ref key0 key0 5 test.t2.id 1
NULL UNION RESULT <union2,3,4> ALL NULL NULL NULL NULL NULL
DROP TABLE t1,t2;
set tmp_memory_table_size=default;
@@ -3861,8 +3913,8 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where
1 PRIMARY <derived3> ref key0 key0 23 test.t1.a1 1 FirstMatch(t1)
3 DERIVED t2 const PRIMARY PRIMARY 22 const 1 Using index
-4 RECURSIVE UNION <derived3> ALL NULL NULL NULL NULL 2 Using where
-4 RECURSIVE UNION tt2 ref b1 b1 23 cte.a2 2
+4 RECURSIVE UNION tt2 ALL b1 NULL NULL NULL 14 Using where
+4 RECURSIVE UNION <derived3> ref key0 key0 23 test.tt2.b1 1
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
analyze format=json select fv
from (select t1.a1, f1(t1.a2) fv from t1) dt
@@ -3876,6 +3928,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -3883,9 +3936,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -3903,9 +3958,11 @@ ANALYZE
"key_length": "23",
"used_key_parts": ["a2"],
"ref": ["test.t1.a1"],
+ "loops": 3,
"r_loops": 3,
"rows": 1,
"r_rows": 0.333333333,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
@@ -3950,38 +4007,44 @@ ANALYZE
"query_block": {
"select_id": 4,
"operation": "UNION",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
- "table_name": "<derived3>",
+ "table_name": "tt2",
"access_type": "ALL",
+ "possible_keys": ["b1"],
+ "loops": 1,
"r_loops": 1,
- "rows": 2,
- "r_rows": 1,
+ "rows": 14,
+ "r_rows": 14,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
"filtered": 100,
"r_filtered": 100,
- "attached_condition": "cte.a2 is not null"
+ "attached_condition": "tt2.b1 is not null"
}
},
{
"table": {
- "table_name": "tt2",
+ "table_name": "<derived3>",
"access_type": "ref",
- "possible_keys": ["b1"],
- "key": "b1",
+ "possible_keys": ["key0"],
+ "key": "key0",
"key_length": "23",
- "used_key_parts": ["b1"],
- "ref": ["cte.a2"],
- "r_loops": 1,
- "rows": 2,
- "r_rows": 1,
+ "used_key_parts": ["a2"],
+ "ref": ["test.tt2.b1"],
+ "loops": 14,
+ "r_loops": 14,
+ "rows": 1,
+ "r_rows": 0.071428571,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
- "r_engine_stats": REPLACED,
"filtered": 100,
"r_filtered": 100
}
@@ -4042,8 +4105,8 @@ FROM cte JOIN t3 ON t3.tm BETWEEN cte.st AND cte.fn)
SELECT t1.* FROM t1 JOIN cte2 USING (YEAR) JOIN cte3 USING (YEAR);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00
-1 PRIMARY <derived5> ref key0 key0 5 const 0 0.00
-1 PRIMARY <derived4> ref key0 key0 5 const 0 0.00
+1 PRIMARY <derived5> ref key0 key0 5 const 0 100.00
+1 PRIMARY <derived4> ref key0 key0 5 const 0 100.00
2 DERIVED t1 system NULL NULL NULL NULL 1 100.00
3 RECURSIVE UNION t1 system NULL NULL NULL NULL 1 100.00
3 RECURSIVE UNION <derived2> ALL NULL NULL NULL NULL 2 100.00 Using where
@@ -4115,7 +4178,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
2 DERIVED s ALL NULL NULL NULL NULL 4
3 RECURSIVE UNION t1 ALL NULL NULL NULL NULL 4 Using where
-3 RECURSIVE UNION <derived2> ref key0 key0 9 test.t1.c 2
+3 RECURSIVE UNION <derived2> ref key0 key0 9 test.t1.c 1
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
4 UNION <derived2> ALL NULL NULL NULL NULL 4
with recursive r_cte as
@@ -4154,6 +4217,7 @@ ANALYZE
"query_block": {
"select_id": 4,
"operation": "UNION",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -4161,9 +4225,11 @@ ANALYZE
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 4,
"r_rows": 4,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
@@ -4179,6 +4245,7 @@ ANALYZE
{
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -4186,9 +4253,11 @@ ANALYZE
"table": {
"table_name": "s",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 4,
"r_rows": 4,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -4203,6 +4272,7 @@ ANALYZE
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -4210,9 +4280,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 4,
"r_rows": 4,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -4230,9 +4302,11 @@ ANALYZE
"key_length": "9",
"used_key_parts": ["a"],
"ref": ["test.t1.c"],
+ "loops": 4,
"r_loops": 4,
- "rows": 2,
+ "rows": 1,
"r_rows": 0.5,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
@@ -4311,6 +4385,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -4318,9 +4393,11 @@ ANALYZE
"table": {
"table_name": "tt",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 4,
"r_rows": 4,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -4480,9 +4557,9 @@ NULL UNION RESULT <union4,5> ALL NULL NULL NULL NULL NULL
3 DERIVED v ALL NULL NULL NULL NULL 12 Using where
3 DERIVED h ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
3 DERIVED w ALL NULL NULL NULL NULL 12 Using where; Using join buffer (incremental, BNL join)
-2 RECURSIVE UNION <derived4> ALL NULL NULL NULL NULL 2
-2 RECURSIVE UNION h ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
-2 RECURSIVE UNION w ALL NULL NULL NULL NULL 12 Using where; Using join buffer (incremental, BNL join)
+2 RECURSIVE UNION h ALL NULL NULL NULL NULL 12 Using where
+2 RECURSIVE UNION <derived4> ref key0 key0 5 test.h.id 1
+2 RECURSIVE UNION w ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
NULL UNION RESULT <union3,2> ALL NULL NULL NULL NULL NULL
prepare stmt from "with recursive
ancestor_couples(h_id, h_name, h_dob, h_father, h_mother,
@@ -4578,9 +4655,9 @@ id select_type table type possible_keys key key_len ref rows Extra
4 RECURSIVE UNION <derived2> ALL NULL NULL NULL NULL 2
5 RECURSIVE UNION <derived2> ALL NULL NULL NULL NULL 2
NULL UNION RESULT <union3,4,5> ALL NULL NULL NULL NULL NULL
-2 DERIVED h ALL NULL NULL NULL NULL 12
-2 DERIVED w ALL NULL NULL NULL NULL 12 Using join buffer (flat, BNL join)
-2 DERIVED <derived3> ALL NULL NULL NULL NULL 12 Using where; Using join buffer (incremental, BNL join)
+2 DERIVED h ALL NULL NULL NULL NULL 12 Using where
+2 DERIVED <derived3> ref key0 key0 5 test.h.id 1
+2 DERIVED w ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
prepare stmt from "with recursive
ancestor_couples(h_id, h_name, h_dob, h_father, h_mother,
w_id, w_name, w_dob, w_father, w_mother)
diff --git a/mysql-test/main/cte_recursive.test b/mysql-test/main/cte_recursive.test
index 4ecdaa4f..45057f91 100644
--- a/mysql-test/main/cte_recursive.test
+++ b/mysql-test/main/cte_recursive.test
@@ -1111,6 +1111,7 @@ as
)
select ancestors.name, ancestors.dob from ancestors;
+--source include/explain-no-costs.inc
explain FORMAT=JSON
with recursive
prev_gen
@@ -1140,6 +1141,7 @@ as
select ancestors.name, ancestors.dob from ancestors;
--echo #
+--source include/explain-no-costs.inc
explain format=json
with recursive
ancestor_couples(h_id, h_name, h_dob, h_father, h_mother,
@@ -1344,6 +1346,7 @@ drop table folks;
create table t1(a int);
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--source include/explain-no-costs.inc
explain format=json
with recursive t as (select a from t1 union select a+10 from t where a < 1000)
select * from t;
diff --git a/mysql-test/main/ctype_binary.result b/mysql-test/main/ctype_binary.result
index 03c7d902..418f1c14 100644
--- a/mysql-test/main/ctype_binary.result
+++ b/mysql-test/main/ctype_binary.result
@@ -2040,7 +2040,7 @@ hex(concat(a)) a
drop table t1;
create table t1 (a year(2));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1);
select hex(concat(a)) from t1;
hex(concat(a))
@@ -2355,7 +2355,7 @@ drop table t1;
drop view v1;
create table t1 (a year(2));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1);
create view v1(a) as select concat(a) from t1;
show columns from v1;
@@ -2763,6 +2763,7 @@ id INT(11) DEFAULT NULL,
date_column DATE DEFAULT NULL,
KEY(date_column));
INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01');
+INSERT INTO t1 VALUES (3,'2012-09-01'),(4,'2012-10-01'),(5,'2012-10-01');
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range date_column date_column 4 NULL 2 Using index condition
diff --git a/mysql-test/main/ctype_collate.result b/mysql-test/main/ctype_collate.result
index 7b713df7..9f2eca8e 100644
--- a/mysql-test/main/ctype_collate.result
+++ b/mysql-test/main/ctype_collate.result
@@ -755,7 +755,7 @@ hex(b)
explain
select hex(b) from t1 where b<'zzz' order by b;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 4 Using where; Using filesort
+1 SIMPLE t1 range PRIMARY PRIMARY 34 NULL 4 Using where; Using filesort
select hex(b) from t1 where b<'zzz' order by b;
hex(b)
00
diff --git a/mysql-test/main/ctype_collate_implicit.result b/mysql-test/main/ctype_collate_implicit.result
new file mode 100644
index 00000000..7d42ab1b
--- /dev/null
+++ b/mysql-test/main/ctype_collate_implicit.result
@@ -0,0 +1,291 @@
+#
+# MDEV-30164 System variable for default collations
+#
+SET @@character_set_collations= ' utf8mb3 = utf8mb3_bin , LATIN1 = LATIN1_BIN ';
+SELECT @@character_set_collations;
+@@character_set_collations
+latin1=latin1_bin,utf8mb3=utf8mb3_bin
+SET @@character_set_collations='';
+SELECT @@character_set_collations;
+@@character_set_collations
+
+SET @@character_set_collations= ',,, utf8mb3 = utf8mb3_bin , , LATIN1 = LATIN1_BIN ,,';
+SELECT @@character_set_collations;
+@@character_set_collations
+latin1=latin1_bin,utf8mb3=utf8mb3_bin
+SET @@character_set_collations='';
+SELECT @@character_set_collations;
+@@character_set_collations
+
+SET @@character_set_collations= 'utf8mb3 = utf8mb3_bin LATIN1 = LATIN1_BIN ';
+ERROR 42000: Variable 'character_set_collations' can't be set to the value of 'utf8mb3 = utf8mb3_bin LATIN1 = LATIN1_BIN '
+SELECT @@character_set_collations;
+@@character_set_collations
+
+SET @@character_set_collations= ' 123 ';
+ERROR 42000: Variable 'character_set_collations' can't be set to the value of ' 123 '
+SELECT @@character_set_collations;
+@@character_set_collations
+
+SET @@character_set_collations= ' utf8mb3 ';
+ERROR 42000: Variable 'character_set_collations' can't be set to the value of ' utf8mb3 '
+SELECT @@character_set_collations;
+@@character_set_collations
+
+SET @@character_set_collations= ' utf8mb3 = ';
+ERROR 42000: Variable 'character_set_collations' can't be set to the value of ' utf8mb3 = '
+SELECT @@character_set_collations;
+@@character_set_collations
+
+SET @@character_set_collations= ' utf8mb3 = 123 ';
+ERROR 42000: Variable 'character_set_collations' can't be set to the value of ' utf8mb3 = 123 '
+SELECT @@character_set_collations;
+@@character_set_collations
+
+SET @@character_set_collations='utf8mb3=utf8mb3_bin';
+SELECT @@character_set_collations;
+@@character_set_collations
+utf8mb3=utf8mb3_bin
+SET @@character_set_collations='';
+SET @@character_set_collations='utf8mb3=utf8mb4_general_ci';
+ERROR 42000: COLLATION 'utf8mb4_general_ci' is not valid for CHARACTER SET 'utf8mb3'
+SELECT @@character_set_collations;
+@@character_set_collations
+
+SET @@character_set_collations='utf8mb4=utf8mb3_general_ci';
+ERROR 42000: COLLATION 'utf8mb3_general_ci' is not valid for CHARACTER SET 'utf8mb4'
+SELECT @@character_set_collations;
+@@character_set_collations
+
+SET @@character_set_collations='utf8mb3=utf8mb3_general_ci';
+SELECT @@character_set_collations;
+@@character_set_collations
+utf8mb3=utf8mb3_general_ci
+SET @@character_set_collations='utf8mb4=utf8mb4_general_ci,latin1=latin1_bin';
+SELECT @@character_set_collations;
+@@character_set_collations
+latin1=latin1_bin,utf8mb4=utf8mb4_general_ci
+SET @@character_set_collations='utf8mb4=uca1400_ai_ci,latin1=uca1400_ai_ci';
+ERROR 42000: COLLATION 'uca1400_ai_ci' is not valid for CHARACTER SET 'latin1'
+SELECT @@character_set_collations;
+@@character_set_collations
+latin1=latin1_bin,utf8mb4=utf8mb4_general_ci
+SELECT @@character_set_collations RLIKE 'utf8mb4=utf8mb4_general_ci' AS expect_true;
+expect_true
+1
+SET @@character_set_collations='utf8mb4=uca1400_ai_ci';
+SELECT @@character_set_collations;
+@@character_set_collations
+utf8mb4=utf8mb4_uca1400_ai_ci
+SET NAMES utf8mb4;
+SELECT @@collation_connection;
+@@collation_connection
+utf8mb4_uca1400_ai_ci
+SELECT collation('literal');
+collation('literal')
+utf8mb4_uca1400_ai_ci
+EXECUTE IMMEDIATE 'SELECT COLLATION(?)' USING 'literal';
+COLLATION(?)
+utf8mb4_uca1400_ai_ci
+CREATE VIEW v1 AS SELECT 'literal', collation('literal') as cl;
+SHOW CREATE VIEW v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 'literal' AS `literal`,collation('literal') AS `cl` utf8mb4 utf8mb4_uca1400_ai_ci
+SELECT * FROM v1;
+literal cl
+literal utf8mb4_uca1400_ai_ci
+DROP VIEW v1;
+SET NAMES utf8mb4 COLLATE utf8mb4_general_ci;
+CREATE TABLE t1 (a TEXT CHARACTER SET utf8mb4);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` text CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT CHARACTER SET utf8mb4 COLLATE DEFAULT);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` text CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT COLLATE DEFAULT) CHARACTER SET utf8mb4;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` text DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT) CHARACTER SET utf8mb4;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` text DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
+DROP TABLE t1;
+CREATE DATABASE db1 CHARACTER SET utf8mb4;
+SHOW CREATE DATABASE db1;
+Database Create Database
+db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci */
+DROP DATABASE db1;
+SET NAMES utf8mb4 COLLATE utf8mb4_general_ci;
+SELECT
+@@collation_connection AS conn,
+COLLATION('a') AS lit,
+COLLATION(CONCAT(1)) AS num,
+COLLATION(CAST(123 AS CHAR)) AS casti,
+COLLATION(_utf8mb4'a') AS litu,
+COLLATION(_utf8mb4 0x62) AS lituh,
+COLLATION(_utf8mb4 X'63') AS lituhs,
+COLLATION(CAST(123 AS CHAR CHARACTER SET utf8mb4)) AS castic,
+COLLATION(CHAR(0x61 USING utf8mb4)) AS chr,
+COLLATION(CONVERT('a' USING utf8mb4)) AS conv;;
+conn utf8mb4_general_ci
+lit utf8mb4_general_ci
+num utf8mb4_general_ci
+casti utf8mb4_general_ci
+litu utf8mb4_uca1400_ai_ci
+lituh utf8mb4_uca1400_ai_ci
+lituhs utf8mb4_uca1400_ai_ci
+castic utf8mb4_uca1400_ai_ci
+chr utf8mb4_uca1400_ai_ci
+conv utf8mb4_uca1400_ai_ci
+SET NAMES utf8mb4;
+SELECT
+@@collation_connection AS conn,
+COLLATION('a') AS lit,
+COLLATION(CONCAT(1)) AS num,
+COLLATION(CAST(123 AS CHAR)) AS casti,
+COLLATION(_utf8mb4'a') AS litu,
+COLLATION(_utf8mb4 0x62) AS lituh,
+COLLATION(_utf8mb4 X'63') AS lituhs,
+COLLATION(CAST(123 AS CHAR CHARACTER SET utf8mb4)) AS castic,
+COLLATION(CHAR(0x61 USING utf8mb4)) AS chr,
+COLLATION(CONVERT('a' USING utf8mb4)) AS conv;;
+conn utf8mb4_uca1400_ai_ci
+lit utf8mb4_uca1400_ai_ci
+num utf8mb4_uca1400_ai_ci
+casti utf8mb4_uca1400_ai_ci
+litu utf8mb4_uca1400_ai_ci
+lituh utf8mb4_uca1400_ai_ci
+lituhs utf8mb4_uca1400_ai_ci
+castic utf8mb4_uca1400_ai_ci
+chr utf8mb4_uca1400_ai_ci
+conv utf8mb4_uca1400_ai_ci
+SET character_set_collations='latin1=latin1_bin,utf8mb4=uca1400_ai_ci';
+SHOW CHARACTER SET LIKE 'latin1';
+Charset Description Default collation Maxlen
+latin1 cp1252 West European latin1_bin 1
+SELECT * FROM INFORMATION_SCHEMA.CHARACTER_SETS
+WHERE CHARACTER_SET_NAME='latin1';
+CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN
+latin1 latin1_bin cp1252 West European 1
+SHOW COLLATION LIKE 'latin1%';
+Collation Charset Id Default Compiled Sortlen
+latin1_german1_ci latin1 5 Yes 1
+latin1_swedish_ci latin1 8 Yes 1
+latin1_danish_ci latin1 15 Yes 1
+latin1_german2_ci latin1 31 Yes 2
+latin1_bin latin1 47 Yes Yes 1
+latin1_general_ci latin1 48 Yes 1
+latin1_general_cs latin1 49 Yes 1
+latin1_spanish_ci latin1 94 Yes 1
+latin1_swedish_nopad_ci latin1 1032 Yes 1
+latin1_nopad_bin latin1 1071 Yes 1
+SELECT COLLATION_NAME, IS_DEFAULT
+FROM INFORMATION_SCHEMA.COLLATIONS
+WHERE CHARACTER_SET_NAME LIKE 'latin1%';
+COLLATION_NAME IS_DEFAULT
+latin1_german1_ci
+latin1_swedish_ci
+latin1_danish_ci
+latin1_german2_ci
+latin1_bin Yes
+latin1_general_ci
+latin1_general_cs
+latin1_spanish_ci
+latin1_swedish_nopad_ci
+latin1_nopad_bin
+SELECT COLLATION_NAME, FULL_COLLATION_NAME, IS_DEFAULT
+FROM INFORMATION_SCHEMA.COLLATION_CHARACTER_SET_APPLICABILITY
+WHERE COLLATION_NAME LIKE 'latin1%';
+COLLATION_NAME FULL_COLLATION_NAME IS_DEFAULT
+latin1_german1_ci latin1_german1_ci
+latin1_swedish_ci latin1_swedish_ci
+latin1_danish_ci latin1_danish_ci
+latin1_german2_ci latin1_german2_ci
+latin1_bin latin1_bin Yes
+latin1_general_ci latin1_general_ci
+latin1_general_cs latin1_general_cs
+latin1_spanish_ci latin1_spanish_ci
+latin1_swedish_nopad_ci latin1_swedish_nopad_ci
+latin1_nopad_bin latin1_nopad_bin
+SHOW CHARACTER SET LIKE 'utf8mb4';
+Charset Description Default collation Maxlen
+utf8mb4 UTF-8 Unicode utf8mb4_uca1400_ai_ci 4
+SELECT * FROM INFORMATION_SCHEMA.CHARACTER_SETS
+WHERE CHARACTER_SET_NAME='utf8mb4';
+CHARACTER_SET_NAME DEFAULT_COLLATE_NAME DESCRIPTION MAXLEN
+utf8mb4 utf8mb4_uca1400_ai_ci UTF-8 Unicode 4
+SHOW COLLATION LIKE '%uca1400_ai_ci%';
+Collation Charset Id Default Compiled Sortlen
+uca1400_ai_ci NULL NULL NULL Yes 8
+SELECT COLLATION_NAME, IS_DEFAULT
+FROM INFORMATION_SCHEMA.COLLATIONS
+WHERE COLLATION_NAME LIKE '%uca1400_ai_ci%';
+COLLATION_NAME IS_DEFAULT
+uca1400_ai_ci NULL
+SELECT COLLATION_NAME, FULL_COLLATION_NAME, IS_DEFAULT
+FROM INFORMATION_SCHEMA.COLLATION_CHARACTER_SET_APPLICABILITY
+WHERE COLLATION_NAME LIKE '%uca1400_ai_ci%';
+COLLATION_NAME FULL_COLLATION_NAME IS_DEFAULT
+uca1400_ai_ci utf8mb3_uca1400_ai_ci
+uca1400_ai_ci ucs2_uca1400_ai_ci
+uca1400_ai_ci utf8mb4_uca1400_ai_ci Yes
+uca1400_ai_ci utf16_uca1400_ai_ci
+uca1400_ai_ci utf32_uca1400_ai_ci
+SET @@character_set_collations='';
+PREPARE stmt FROM 'SELECT '
+ 'COLLATION(CAST("x" AS CHAR CHARACTER SET utf8mb3)) AS a, '
+ 'COLLATION(_utf8mb3"x") AS b';
+EXECUTE stmt;
+a b
+utf8mb3_general_ci utf8mb3_general_ci
+SET @@character_set_collations='utf8mb3=utf8mb3_bin';
+EXECUTE stmt;
+a b
+utf8mb3_bin utf8mb3_bin
+SET @@character_set_collations='utf8mb3=utf8mb3_bin';
+PREPARE stmt FROM 'SELECT '
+ 'COLLATION(CAST("x" AS CHAR CHARACTER SET utf8mb3)) AS a, '
+ 'COLLATION(_utf8mb3"x") AS b';
+EXECUTE stmt;
+a b
+utf8mb3_bin utf8mb3_bin
+SET @@character_set_collations=DEFAULT;
+EXECUTE stmt;
+a b
+utf8mb3_general_ci utf8mb3_general_ci
+SET NAMES utf8mb3;
+SET @@character_set_collations='';
+PREPARE stmt FROM 'CREATE TABLE t1 '
+ '(a TEXT CHARACTER SET utf8mb3 COLLATE DEFAULT COLLATE utf8mb3_general_ci)';
+EXECUTE stmt;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+DROP TABLE t1;
+SET @@character_set_collations='utf8mb3=utf8mb3_bin';
+EXECUTE stmt;
+ERROR HY000: Conflicting declarations: 'COLLATE utf8mb3_bin' and 'COLLATE utf8mb3_general_ci'
+SET @@character_set_collations='';
+EXECUTE stmt;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` text CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+DROP TABLE t1;
diff --git a/mysql-test/main/ctype_collate_implicit.test b/mysql-test/main/ctype_collate_implicit.test
new file mode 100644
index 00000000..eb8e3a74
--- /dev/null
+++ b/mysql-test/main/ctype_collate_implicit.test
@@ -0,0 +1,237 @@
+--source include/have_utf8.inc
+--source include/have_utf8mb4.inc
+
+--echo #
+--echo # MDEV-30164 System variable for default collations
+--echo #
+
+SET @@character_set_collations= ' utf8mb3 = utf8mb3_bin , LATIN1 = LATIN1_BIN ';
+SELECT @@character_set_collations;
+SET @@character_set_collations='';
+SELECT @@character_set_collations;
+
+# Relaxed redundant comma parsing
+SET @@character_set_collations= ',,, utf8mb3 = utf8mb3_bin , , LATIN1 = LATIN1_BIN ,,';
+SELECT @@character_set_collations;
+SET @@character_set_collations='';
+SELECT @@character_set_collations;
+
+# But at least one comma must be between pairs
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@character_set_collations= 'utf8mb3 = utf8mb3_bin LATIN1 = LATIN1_BIN ';
+SELECT @@character_set_collations;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@character_set_collations= ' 123 ';
+SELECT @@character_set_collations;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@character_set_collations= ' utf8mb3 ';
+SELECT @@character_set_collations;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@character_set_collations= ' utf8mb3 = ';
+SELECT @@character_set_collations;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@character_set_collations= ' utf8mb3 = 123 ';
+SELECT @@character_set_collations;
+
+
+SET @@character_set_collations='utf8mb3=utf8mb3_bin';
+SELECT @@character_set_collations;
+SET @@character_set_collations='';
+
+--error ER_COLLATION_CHARSET_MISMATCH
+SET @@character_set_collations='utf8mb3=utf8mb4_general_ci';
+SELECT @@character_set_collations;
+
+--error ER_COLLATION_CHARSET_MISMATCH
+SET @@character_set_collations='utf8mb4=utf8mb3_general_ci';
+SELECT @@character_set_collations;
+
+SET @@character_set_collations='utf8mb3=utf8mb3_general_ci';
+SELECT @@character_set_collations;
+
+SET @@character_set_collations='utf8mb4=utf8mb4_general_ci,latin1=latin1_bin';
+SELECT @@character_set_collations;
+
+--error ER_COLLATION_CHARSET_MISMATCH
+SET @@character_set_collations='utf8mb4=uca1400_ai_ci,latin1=uca1400_ai_ci';
+
+# All or nothing is set. "Nothing" in this case because of the error on latin1.
+# The "uca1400_ai_ci FOR utf8mb4" part was ignored.
+SELECT @@character_set_collations;
+SELECT @@character_set_collations RLIKE 'utf8mb4=utf8mb4_general_ci' AS expect_true;
+
+
+SET @@character_set_collations='utf8mb4=uca1400_ai_ci';
+SELECT @@character_set_collations;
+
+SET NAMES utf8mb4;
+SELECT @@collation_connection;
+
+# We have to disable --view-protocol for the following statement.
+# 'mtr --view-protocol' creates a separate connection for these statements:
+# CREATE VIEW mysqltest_tmp_sp AS ...;
+# DROP VIEW mysqltest_tmp_sp;
+# The current @@character_set_collations does not affect this connection.
+# So --view-protocol would return the hard-coded character set collation here,
+# instead of utf8mb4_uca1400_ai_ci
+
+--disable_view_protocol
+SELECT collation('literal');
+--enable_view_protocol
+EXECUTE IMMEDIATE 'SELECT COLLATION(?)' USING 'literal';
+
+CREATE VIEW v1 AS SELECT 'literal', collation('literal') as cl;
+SHOW CREATE VIEW v1;
+SELECT * FROM v1;
+DROP VIEW v1;
+
+
+# Override @@collation_connection to utf8mb4_general_ci.
+# Make sure that CREATE statements does not use @@collation_connection.
+# to detect implicit collations.
+# Implicit collations are detected using @@character_set_collations!
+
+SET NAMES utf8mb4 COLLATE utf8mb4_general_ci;
+
+CREATE TABLE t1 (a TEXT CHARACTER SET utf8mb4);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TEXT CHARACTER SET utf8mb4 COLLATE DEFAULT);
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TEXT COLLATE DEFAULT) CHARACTER SET utf8mb4;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TEXT) CHARACTER SET utf8mb4;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+CREATE DATABASE db1 CHARACTER SET utf8mb4;
+SHOW CREATE DATABASE db1;
+DROP DATABASE db1;
+
+
+# Test how @@character_set_collations affects various expressions
+# with implicit collations.
+
+
+let query=SELECT
+ @@collation_connection AS conn,
+ COLLATION('a') AS lit,
+ COLLATION(CONCAT(1)) AS num,
+ COLLATION(CAST(123 AS CHAR)) AS casti,
+ COLLATION(_utf8mb4'a') AS litu,
+ COLLATION(_utf8mb4 0x62) AS lituh,
+ COLLATION(_utf8mb4 X'63') AS lituhs,
+ COLLATION(CAST(123 AS CHAR CHARACTER SET utf8mb4)) AS castic,
+ COLLATION(CHAR(0x61 USING utf8mb4)) AS chr,
+ COLLATION(CONVERT('a' USING utf8mb4)) AS conv;
+
+# The below SET NAMES sets @@collation_connection to utf8mb4_general_ci.
+# But @@character_set_collations still contains utf8mb4=uca1400_ai_ci.
+
+SET NAMES utf8mb4 COLLATE utf8mb4_general_ci;
+
+# Columns expected to print utf8mb4_general_ci
+# because they use @@collation_connection:
+# - String literals without introducers
+# - Automatic number-to-string conversions
+# - CAST(AS CHAR) - without USING
+#
+# Columns expected to print utf8mb4_uca1400_ai_ci
+# because they use the current session default collation
+# for the character set (as specified in @@collation_connection)
+# - String literals with introducers
+# - CAST(AS CHAR USING cs)
+# - CHAR()
+# - CONVERT()
+
+--vertical_results
+--eval $query;
+--horizontal_results
+
+# This sets collation_connection to utf8mb4_uca1400_ai_ci
+# according to @@character_set_collations.
+SET NAMES utf8mb4;
+
+# Now all columns are expected to print utf8mb4_uca1400_ai_ci:
+# - Some columns because @@collation_connection says so
+# - Some columns because @@character_set_collations says so.
+
+--vertical_results
+--eval $query;
+--horizontal_results
+
+
+#
+# INFORMATION_SCHEMA
+#
+
+SET character_set_collations='latin1=latin1_bin,utf8mb4=uca1400_ai_ci';
+SHOW CHARACTER SET LIKE 'latin1';
+SELECT * FROM INFORMATION_SCHEMA.CHARACTER_SETS
+WHERE CHARACTER_SET_NAME='latin1';
+
+SHOW COLLATION LIKE 'latin1%';
+SELECT COLLATION_NAME, IS_DEFAULT
+FROM INFORMATION_SCHEMA.COLLATIONS
+WHERE CHARACTER_SET_NAME LIKE 'latin1%';
+SELECT COLLATION_NAME, FULL_COLLATION_NAME, IS_DEFAULT
+FROM INFORMATION_SCHEMA.COLLATION_CHARACTER_SET_APPLICABILITY
+WHERE COLLATION_NAME LIKE 'latin1%';
+
+SHOW CHARACTER SET LIKE 'utf8mb4';
+SELECT * FROM INFORMATION_SCHEMA.CHARACTER_SETS
+WHERE CHARACTER_SET_NAME='utf8mb4';
+
+SHOW COLLATION LIKE '%uca1400_ai_ci%';
+SELECT COLLATION_NAME, IS_DEFAULT
+FROM INFORMATION_SCHEMA.COLLATIONS
+WHERE COLLATION_NAME LIKE '%uca1400_ai_ci%';
+SELECT COLLATION_NAME, FULL_COLLATION_NAME, IS_DEFAULT
+FROM INFORMATION_SCHEMA.COLLATION_CHARACTER_SET_APPLICABILITY
+WHERE COLLATION_NAME LIKE '%uca1400_ai_ci%';
+
+#
+# Prepared statements: reprepare on @@character_set_collations change.
+#
+
+SET @@character_set_collations='';
+PREPARE stmt FROM 'SELECT '
+ 'COLLATION(CAST("x" AS CHAR CHARACTER SET utf8mb3)) AS a, '
+ 'COLLATION(_utf8mb3"x") AS b';
+EXECUTE stmt;
+SET @@character_set_collations='utf8mb3=utf8mb3_bin';
+EXECUTE stmt;
+
+SET @@character_set_collations='utf8mb3=utf8mb3_bin';
+PREPARE stmt FROM 'SELECT '
+ 'COLLATION(CAST("x" AS CHAR CHARACTER SET utf8mb3)) AS a, '
+ 'COLLATION(_utf8mb3"x") AS b';
+EXECUTE stmt;
+SET @@character_set_collations=DEFAULT;
+EXECUTE stmt;
+
+SET NAMES utf8mb3;
+SET @@character_set_collations='';
+PREPARE stmt FROM 'CREATE TABLE t1 '
+ '(a TEXT CHARACTER SET utf8mb3 COLLATE DEFAULT COLLATE utf8mb3_general_ci)';
+EXECUTE stmt;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+SET @@character_set_collations='utf8mb3=utf8mb3_bin';
+--error ER_CONFLICTING_DECLARATIONS
+EXECUTE stmt;
+
+SET @@character_set_collations='';
+EXECUTE stmt;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
diff --git a/mysql-test/main/ctype_collate_implicit_def.opt b/mysql-test/main/ctype_collate_implicit_def.opt
new file mode 100644
index 00000000..a5d4c19f
--- /dev/null
+++ b/mysql-test/main/ctype_collate_implicit_def.opt
@@ -0,0 +1 @@
+--character-set-collations=utf8mb3=uca1400_ai_ci,latin1=latin1_bin
diff --git a/mysql-test/main/ctype_collate_implicit_def.result b/mysql-test/main/ctype_collate_implicit_def.result
new file mode 100644
index 00000000..fbbacd03
--- /dev/null
+++ b/mysql-test/main/ctype_collate_implicit_def.result
@@ -0,0 +1,85 @@
+#
+# MDEV-30164 System variable for default collations
+#
+SELECT @@global.character_set_collations;
+@@global.character_set_collations
+latin1=latin1_bin,utf8mb3=utf8mb3_uca1400_ai_ci
+SELECT @@session.character_set_collations;
+@@session.character_set_collations
+latin1=latin1_bin,utf8mb3=utf8mb3_uca1400_ai_ci
+SELECT COLLATION('literal');
+COLLATION('literal')
+latin1_bin
+CREATE TABLE t1 AS SELECT 'literal' AS c1;
+SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name='t1';
+COLLATION_NAME
+latin1_bin
+DROP TABLE t1;
+SET NAMES utf8mb3;
+SELECT COLLATION('literal');
+COLLATION('literal')
+utf8mb3_uca1400_ai_ci
+CREATE TABLE t1 AS SELECT 'literal' AS c1;
+SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name='t1';
+COLLATION_NAME
+utf8mb3_uca1400_ai_ci
+DROP TABLE t1;
+SET @@session.character_set_collations='latin1=latin1_german2_ci';
+SELECT @@session.character_set_collations;
+@@session.character_set_collations
+latin1=latin1_german2_ci
+SET @@session.character_set_collations=DEFAULT;
+SELECT @@session.character_set_collations;
+@@session.character_set_collations
+latin1=latin1_bin,utf8mb3=utf8mb3_uca1400_ai_ci
+SET @@global.character_set_collations='utf8mb3=uca1400_as_ci,latin1=latin1_danish_ci';
+connect con1,localhost,root,,;
+connection con1;
+SELECT @@session.character_set_collations;
+@@session.character_set_collations
+latin1=latin1_danish_ci,utf8mb3=utf8mb3_uca1400_as_ci
+SELECT COLLATION('literal');
+COLLATION('literal')
+latin1_danish_ci
+CREATE TABLE t1 AS SELECT 'literal' AS c1;
+SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name='t1';
+COLLATION_NAME
+latin1_danish_ci
+DROP TABLE t1;
+disconnect con1;
+connection default;
+SET @@global.character_set_collations=DEFAULT;
+SELECT @@global.character_set_collations;
+@@global.character_set_collations
+
+connect con2,localhost,root,,;
+connection con2;
+SELECT @@session.character_set_collations;
+@@session.character_set_collations
+
+SELECT COLLATION('literal');
+COLLATION('literal')
+latin1_swedish_ci
+CREATE TABLE t1 AS SELECT 'literal' AS c1;
+SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name='t1';
+COLLATION_NAME
+latin1_swedish_ci
+DROP TABLE t1;
+disconnect con2;
+connection default;
+SET @@global.character_set_collations='utf8mb3=uca1400_ai_ci,latin1=latin1_bin';
+connect con3,localhost,root,,;
+connection con3;
+SELECT @@session.character_set_collations;
+@@session.character_set_collations
+latin1=latin1_bin,utf8mb3=utf8mb3_uca1400_ai_ci
+SELECT COLLATION('literal');
+COLLATION('literal')
+latin1_bin
+CREATE TABLE t1 AS SELECT 'literal' AS c1;
+SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name='t1';
+COLLATION_NAME
+latin1_bin
+DROP TABLE t1;
+disconnect con3;
+connection default;
diff --git a/mysql-test/main/ctype_collate_implicit_def.test b/mysql-test/main/ctype_collate_implicit_def.test
new file mode 100644
index 00000000..75da99ae
--- /dev/null
+++ b/mysql-test/main/ctype_collate_implicit_def.test
@@ -0,0 +1,73 @@
+--source include/have_utf8.inc
+--source include/have_utf8mb4.inc
+
+--echo #
+--echo # MDEV-30164 System variable for default collations
+--echo #
+
+SELECT @@global.character_set_collations;
+SELECT @@session.character_set_collations;
+--disable_view_protocol
+SELECT COLLATION('literal');
+--enable_view_protocol
+CREATE TABLE t1 AS SELECT 'literal' AS c1;
+SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name='t1';
+DROP TABLE t1;
+
+SET NAMES utf8mb3;
+--disable_view_protocol
+SELECT COLLATION('literal');
+--enable_view_protocol
+CREATE TABLE t1 AS SELECT 'literal' AS c1;
+SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name='t1';
+DROP TABLE t1;
+
+SET @@session.character_set_collations='latin1=latin1_german2_ci';
+SELECT @@session.character_set_collations;
+
+SET @@session.character_set_collations=DEFAULT;
+SELECT @@session.character_set_collations;
+
+SET @@global.character_set_collations='utf8mb3=uca1400_as_ci,latin1=latin1_danish_ci';
+
+--connect (con1,localhost,root,,)
+--connection con1
+SELECT @@session.character_set_collations;
+--disable_view_protocol
+SELECT COLLATION('literal');
+--enable_view_protocol
+CREATE TABLE t1 AS SELECT 'literal' AS c1;
+SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name='t1';
+DROP TABLE t1;
+--disconnect con1
+--connection default
+
+SET @@global.character_set_collations=DEFAULT;
+SELECT @@global.character_set_collations;
+
+--connect (con2,localhost,root,,)
+--connection con2
+SELECT @@session.character_set_collations;
+--disable_view_protocol
+SELECT COLLATION('literal');
+--enable_view_protocol
+CREATE TABLE t1 AS SELECT 'literal' AS c1;
+SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name='t1';
+DROP TABLE t1;
+--disconnect con2
+--connection default
+
+# Set back to the command line value, to avoid mtr internal check failure.
+SET @@global.character_set_collations='utf8mb3=uca1400_ai_ci,latin1=latin1_bin';
+
+--connect (con3,localhost,root,,)
+--connection con3
+SELECT @@session.character_set_collations;
+--disable_view_protocol
+SELECT COLLATION('literal');
+--enable_view_protocol
+CREATE TABLE t1 AS SELECT 'literal' AS c1;
+SELECT COLLATION_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name='t1';
+DROP TABLE t1;
+--disconnect con3
+--connection default
diff --git a/mysql-test/main/ctype_collate_implicit_utf32.result b/mysql-test/main/ctype_collate_implicit_utf32.result
new file mode 100644
index 00000000..790e444d
--- /dev/null
+++ b/mysql-test/main/ctype_collate_implicit_utf32.result
@@ -0,0 +1,19 @@
+#
+# MDEV-30164 System variable for default collations
+#
+SET @@character_set_collations= CONVERT('latin1=latin1_bin,utf8mb3=utf8mb3_bin' USING utf32);
+SELECT @@character_set_collations;
+@@character_set_collations
+latin1=latin1_bin,utf8mb3=utf8mb3_bin
+SET @@character_set_collations=_utf32'';
+SELECT @@character_set_collations;
+@@character_set_collations
+
+SET @@character_set_collations= CONVERT('utf32=utf32_bin' USING utf32);
+SELECT @@character_set_collations;
+@@character_set_collations
+utf32=utf32_bin
+SET @@character_set_collations='';
+SELECT @@character_set_collations;
+@@character_set_collations
+
diff --git a/mysql-test/main/ctype_collate_implicit_utf32.test b/mysql-test/main/ctype_collate_implicit_utf32.test
new file mode 100644
index 00000000..a0dbd7d2
--- /dev/null
+++ b/mysql-test/main/ctype_collate_implicit_utf32.test
@@ -0,0 +1,16 @@
+--source include/have_utf8.inc
+--source include/have_utf32.inc
+
+--echo #
+--echo # MDEV-30164 System variable for default collations
+--echo #
+
+SET @@character_set_collations= CONVERT('latin1=latin1_bin,utf8mb3=utf8mb3_bin' USING utf32);
+SELECT @@character_set_collations;
+SET @@character_set_collations=_utf32'';
+SELECT @@character_set_collations;
+
+SET @@character_set_collations= CONVERT('utf32=utf32_bin' USING utf32);
+SELECT @@character_set_collations;
+SET @@character_set_collations='';
+SELECT @@character_set_collations;
diff --git a/mysql-test/main/ctype_cp1251.result b/mysql-test/main/ctype_cp1251.result
index a341d9ce..3702c9d8 100644
--- a/mysql-test/main/ctype_cp1251.result
+++ b/mysql-test/main/ctype_cp1251.result
@@ -2452,7 +2452,7 @@ hex(concat(a)) a
drop table t1;
create table t1 (a year(2));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1);
select hex(concat(a)) from t1;
hex(concat(a))
@@ -2767,7 +2767,7 @@ drop table t1;
drop view v1;
create table t1 (a year(2));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1);
create view v1(a) as select concat(a) from t1;
show columns from v1;
@@ -3175,6 +3175,7 @@ id INT(11) DEFAULT NULL,
date_column DATE DEFAULT NULL,
KEY(date_column));
INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01');
+INSERT INTO t1 VALUES (3,'2012-09-01'),(4,'2012-10-01'),(5,'2012-10-01');
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range date_column date_column 4 NULL 2 Using index condition
diff --git a/mysql-test/main/ctype_gbk.result b/mysql-test/main/ctype_gbk.result
index 5218dbfd..f27c5720 100644
--- a/mysql-test/main/ctype_gbk.result
+++ b/mysql-test/main/ctype_gbk.result
@@ -680,11 +680,7 @@ b MEDIUMTEXT CHARACTER SET big5);
INSERT INTO t1 VALUES
(REPEAT(0x1125,200000), REPEAT(0x1125,200000)), ('', ''), ('', '');
SELECT a FROM t1 GROUP BY 1 LIMIT 1 INTO @nullll;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
SELECT b FROM t1 GROUP BY 1 LIMIT 1 INTO @nullll;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
DROP TABLES t1;
End of 5.0 tests
#
diff --git a/mysql-test/main/ctype_latin1.result b/mysql-test/main/ctype_latin1.result
index 5556a9cf..4c08f8f4 100644
--- a/mysql-test/main/ctype_latin1.result
+++ b/mysql-test/main/ctype_latin1.result
@@ -2761,7 +2761,7 @@ hex(concat(a)) a
drop table t1;
create table t1 (a year(2));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1);
select hex(concat(a)) from t1;
hex(concat(a))
@@ -3076,7 +3076,7 @@ drop table t1;
drop view v1;
create table t1 (a year(2));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1);
create view v1(a) as select concat(a) from t1;
show columns from v1;
@@ -3484,6 +3484,7 @@ id INT(11) DEFAULT NULL,
date_column DATE DEFAULT NULL,
KEY(date_column));
INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01');
+INSERT INTO t1 VALUES (3,'2012-09-01'),(4,'2012-10-01'),(5,'2012-10-01');
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range date_column date_column 4 NULL 2 Using index condition
diff --git a/mysql-test/main/ctype_ucs.result b/mysql-test/main/ctype_ucs.result
index cab41feb..88838245 100644
--- a/mysql-test/main/ctype_ucs.result
+++ b/mysql-test/main/ctype_ucs.result
@@ -207,8 +207,6 @@ DROP TABLE t1;
# Problem # 1 (original report): wrong parsing of ucs2 data
SET character_set_connection=ucs2;
SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp.txt';
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CREATE TABLE t1(a INT);
LOAD DATA INFILE 'tmpp.txt' INTO TABLE t1 CHARACTER SET ucs2
(@b) SET a=REVERSE(@b);
@@ -220,8 +218,6 @@ a
DROP TABLE t1;
# Problem # 2 : if you write and read ucs2 data to a file they're lost
SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp2.txt' CHARACTER SET ucs2;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CREATE TABLE t1(a INT);
LOAD DATA INFILE 'tmpp2.txt' INTO TABLE t1 CHARACTER SET ucs2
(@b) SET a=REVERSE(@b);
@@ -3645,7 +3641,7 @@ hex(concat(a)) a
drop table t1;
create table t1 (a year(2));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1);
select hex(concat(a)) from t1;
hex(concat(a))
@@ -3960,7 +3956,7 @@ drop table t1;
drop view v1;
create table t1 (a year(2));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1);
create view v1(a) as select concat(a) from t1;
show columns from v1;
@@ -4368,6 +4364,7 @@ id INT(11) DEFAULT NULL,
date_column DATE DEFAULT NULL,
KEY(date_column));
INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01');
+INSERT INTO t1 VALUES (3,'2012-09-01'),(4,'2012-10-01'),(5,'2012-10-01');
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range date_column date_column 4 NULL 2 Using index condition
diff --git a/mysql-test/main/ctype_upgrade.result b/mysql-test/main/ctype_upgrade.result
index 97c797e8..819ff32d 100644
--- a/mysql-test/main/ctype_upgrade.result
+++ b/mysql-test/main/ctype_upgrade.result
@@ -283,6 +283,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
@@ -445,6 +446,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
diff --git a/mysql-test/main/ctype_upgrade.test b/mysql-test/main/ctype_upgrade.test
index 7cb1ec9b..f28d23ee 100644
--- a/mysql-test/main/ctype_upgrade.test
+++ b/mysql-test/main/ctype_upgrade.test
@@ -197,7 +197,7 @@ SELECT GROUP_CONCAT(a ORDER BY BINARY a) FROM maria100004_xxx_croatian_ci GROUP
SHOW CREATE TABLE mysql050614_xxx_croatian_ci;
SELECT GROUP_CONCAT(a ORDER BY BINARY a) FROM mysql050614_xxx_croatian_ci GROUP BY a;
-remove_file $MYSQLD_DATADIR/mysql_upgrade_info;
+remove_file $MYSQLD_DATADIR/mariadb_upgrade_info;
DROP TABLE maria050313_ucs2_croatian_ci_def;
DROP TABLE maria050313_utf8_croatian_ci;
DROP TABLE maria050533_xxx_croatian_ci;
diff --git a/mysql-test/main/ctype_utf32.result b/mysql-test/main/ctype_utf32.result
index f9523a78..9ff4cd95 100644
--- a/mysql-test/main/ctype_utf32.result
+++ b/mysql-test/main/ctype_utf32.result
@@ -3024,3 +3024,10 @@ HEX(DATE_FORMAT(TIME'11:22:33',@format))
#
# End of 10.4 tests
#
+#
+# MDEV-33729 UBSAN negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself in my_strntoll_mb2_or_mb4
+#
+SET NAMES utf8mb3, character_set_connection=utf32;
+SELECT CONV('-AzL8n0Y58m8', -62, -10);
+CONV('-AzL8n0Y58m8', -62, -10)
+-9223372036854775808
diff --git a/mysql-test/main/ctype_utf32.test b/mysql-test/main/ctype_utf32.test
index bcbc3b14..82a0830d 100644
--- a/mysql-test/main/ctype_utf32.test
+++ b/mysql-test/main/ctype_utf32.test
@@ -1168,3 +1168,10 @@ SELECT HEX(DATE_FORMAT(TIME'11:22:33',@format));
--echo #
--enable_service_connection
+
+--echo #
+--echo # MDEV-33729 UBSAN negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself in my_strntoll_mb2_or_mb4
+--echo #
+
+SET NAMES utf8mb3, character_set_connection=utf32;
+SELECT CONV('-AzL8n0Y58m8', -62, -10);
diff --git a/mysql-test/main/ctype_utf8.result b/mysql-test/main/ctype_utf8.result
index 42ab1dec..b02e07e9 100644
--- a/mysql-test/main/ctype_utf8.result
+++ b/mysql-test/main/ctype_utf8.result
@@ -1819,6 +1819,7 @@ SET CHARACTER SET utf8;
SHOW VARIABLES LIKE 'character\_set\_%';
Variable_name Value
character_set_client utf8mb3
+character_set_collations
character_set_connection latin1
character_set_database latin1
character_set_filesystem binary
@@ -4512,7 +4513,7 @@ hex(concat(a)) a
drop table t1;
create table t1 (a year(2));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1);
select hex(concat(a)) from t1;
hex(concat(a))
@@ -4827,7 +4828,7 @@ drop table t1;
drop view v1;
create table t1 (a year(2));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (1);
create view v1(a) as select concat(a) from t1;
show columns from v1;
@@ -5235,6 +5236,7 @@ id INT(11) DEFAULT NULL,
date_column DATE DEFAULT NULL,
KEY(date_column));
INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01');
+INSERT INTO t1 VALUES (3,'2012-09-01'),(4,'2012-10-01'),(5,'2012-10-01');
EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range date_column date_column 4 NULL 2 Using index condition
diff --git a/mysql-test/main/ctype_utf8mb4.result b/mysql-test/main/ctype_utf8mb4.result
index 26e8784e..00d22c32 100644
--- a/mysql-test/main/ctype_utf8mb4.result
+++ b/mysql-test/main/ctype_utf8mb4.result
@@ -1844,6 +1844,7 @@ SET CHARACTER SET utf8mb4;
SHOW VARIABLES LIKE 'character\_set\_%';
Variable_name Value
character_set_client utf8mb4
+character_set_collations
character_set_connection latin1
character_set_database latin1
character_set_filesystem binary
diff --git a/mysql-test/main/ctype_utf8mb4_heap.result b/mysql-test/main/ctype_utf8mb4_heap.result
index 657f0636..4b23040d 100644
--- a/mysql-test/main/ctype_utf8mb4_heap.result
+++ b/mysql-test/main/ctype_utf8mb4_heap.result
@@ -1676,6 +1676,7 @@ SET CHARACTER SET utf8mb4;
SHOW VARIABLES LIKE 'character\_set\_%';
Variable_name Value
character_set_client utf8mb4
+character_set_collations
character_set_connection latin1
character_set_database latin1
character_set_filesystem binary
diff --git a/mysql-test/main/ctype_utf8mb4_innodb.result b/mysql-test/main/ctype_utf8mb4_innodb.result
index da6a4656..0291823d 100644
--- a/mysql-test/main/ctype_utf8mb4_innodb.result
+++ b/mysql-test/main/ctype_utf8mb4_innodb.result
@@ -1802,6 +1802,7 @@ SET CHARACTER SET utf8mb4;
SHOW VARIABLES LIKE 'character\_set\_%';
Variable_name Value
character_set_client utf8mb4
+character_set_collations
character_set_connection latin1
character_set_database latin1
character_set_filesystem binary
diff --git a/mysql-test/main/ctype_utf8mb4_myisam.result b/mysql-test/main/ctype_utf8mb4_myisam.result
index 7e579e60..0ccde4cc 100644
--- a/mysql-test/main/ctype_utf8mb4_myisam.result
+++ b/mysql-test/main/ctype_utf8mb4_myisam.result
@@ -1809,6 +1809,7 @@ SET CHARACTER SET utf8mb4;
SHOW VARIABLES LIKE 'character\_set\_%';
Variable_name Value
character_set_client utf8mb4
+character_set_collations
character_set_connection latin1
character_set_database latin1
character_set_filesystem binary
diff --git a/mysql-test/main/custom_aggregates_i_s.result b/mysql-test/main/custom_aggregates_i_s.result
index cb98aee3..2a19e9f7 100644
--- a/mysql-test/main/custom_aggregates_i_s.result
+++ b/mysql-test/main/custom_aggregates_i_s.result
@@ -39,7 +39,7 @@ explain
select * from t1, (select f1(sal) as a from t1 where id>= 1) q where q.a=t1.sal;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t1.sal 2
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.sal 1
2 DERIVED t1 ALL NULL NULL NULL NULL 3 Using where
show status like "%custom_aggregate%";
Variable_name Value
diff --git a/mysql-test/main/date_formats-master.opt b/mysql-test/main/date_formats-master.opt
deleted file mode 100644
index ab243fe7..00000000
--- a/mysql-test/main/date_formats-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---date-format=%d.%m.%Y --time-format=%H.%i.%s
diff --git a/mysql-test/main/date_formats.result b/mysql-test/main/date_formats.result
index 463cce39..9db6b321 100644
--- a/mysql-test/main/date_formats.result
+++ b/mysql-test/main/date_formats.result
@@ -1,24 +1,6 @@
-drop table if exists t1;
-SELECT variable_name, variable_value
-FROM information_schema.global_variables
-WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
-ORDER BY variable_name;
-variable_name variable_value
-DATETIME_FORMAT %Y-%m-%d %H:%i:%s
-DATE_FORMAT %d.%m.%Y
-TIME_FORMAT %H.%i.%s
-SELECT variable_name, variable_value
-FROM information_schema.session_variables
-WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
-ORDER BY variable_name;
-variable_name variable_value
-DATETIME_FORMAT %Y-%m-%d %H:%i:%s
-DATE_FORMAT %d.%m.%Y
-TIME_FORMAT %H.%i.%s
select str_to_date(concat('15-01-2001',' 2:59:58.999'),
-concat('%d-%m-%Y',' ','%H:%i:%s.%f'));
-str_to_date(concat('15-01-2001',' 2:59:58.999'),
-concat('%d-%m-%Y',' ','%H:%i:%s.%f'))
+concat('%d-%m-%Y',' ','%H:%i:%s.%f')) as s;
+s
2001-01-15 02:59:58.999000
select STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T');
STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T')
@@ -256,8 +238,8 @@ Tuesday 52 2001 %W %V %X 00:00:00.000000
15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00.000000
15-01-20 %d-%m-%y 00:00:00.000000
15-2001-1 %d-%Y-%c 00:00:00.000000
-select concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d'));
-concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d'))
+select concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d')) as s;
+s
2003-01-02 08:11:02.123456
truncate table t1;
insert into t1 values
@@ -551,8 +533,8 @@ Thursday 01 January 2009
# Bug#58005 utf8 + get_format causes failed assertion: !str || str != Ptr'
#
SET NAMES utf8;
-SELECT LEAST('%', GET_FORMAT(datetime, 'eur'), CAST(GET_FORMAT(datetime, 'eur') AS CHAR(65535)));
-LEAST('%', GET_FORMAT(datetime, 'eur'), CAST(GET_FORMAT(datetime, 'eur') AS CHAR(65535)))
+SELECT LEAST('%', GET_FORMAT(datetime, 'eur'), CAST(GET_FORMAT(datetime, 'eur') AS CHAR(65535))) as s;
+s
%
SET NAMES latin1;
#
@@ -573,3 +555,76 @@ time_format('01 02:02:02', '%T')
select time_format('2001-01-01 02:02:02', '%T');
time_format('2001-01-01 02:02:02', '%T')
02:02:02
+#
+# End of 10.2 test
+#
+#
+# MDEV-31684 Add timezone information to DATE_FORMAT
+#
+SET @old_timezone= @@time_zone;
+# Using named timezones
+SET TIME_ZONE='Japan';
+SELECT DATE_FORMAT('2009-10-04 22:23:00', '%z %Z') AS current_timezone;
+current_timezone
++0900 JST
+SET @@time_zone='Europe/Moscow';
+SELECT DATE_FORMAT('1965-02-17 22:23:00', '%z %Z') AS current_timezone;
+current_timezone
++0300 MSK
+SELECT DATE_FORMAT('1965-12-31 22:23:00', '%z %Z') AS current_timezone;
+current_timezone
++0300 MSK
+SELECT DATE_FORMAT('1985-06-01', '%z %Z');
+DATE_FORMAT('1985-06-01', '%z %Z')
++0400 MSD
+# Using positive and negative offset
+SET TIME_ZONE= '-05:30';
+SELECT DATE_FORMAT('2009-10-04 22:23:00', '%z %Z') AS current_timezone;
+current_timezone
+-0530 -05:30
+SET TIME_ZONE= '+04:30';
+SELECT DATE_FORMAT('2009-10-04 22:23:00', '%z %Z') AS current_timezone;
+current_timezone
++0430 +04:30
+# Using UTC
+SET TIME_ZONE='UTC';
+SELECT DATE_FORMAT('2009-10-04 22:23:00', '%z %Z') AS current_timezone;
+current_timezone
++0000 UTC
+SET @@time_zone= @old_timezone;
+# More timezone test:
+#
+# Check for time zone with leap seconds
+#
+set time_zone='Europe/Moscow';
+SELECT DATE_FORMAT('2023-03-01 01:30:00', '%z %Z');
+DATE_FORMAT('2023-03-01 01:30:00', '%z %Z')
++0300 MSK
+SELECT DATE_FORMAT('2023-04-01 01:30:00', '%z %Z');
+DATE_FORMAT('2023-04-01 01:30:00', '%z %Z')
++0400 MSD
+set time_zone='leap/Europe/Moscow';
+SELECT DATE_FORMAT('2023-03-01 01:30:00', '%z %Z');
+DATE_FORMAT('2023-03-01 01:30:00', '%z %Z')
++0300 MSK
+SELECT DATE_FORMAT('2023-04-01 01:30:00', '%z %Z');
+DATE_FORMAT('2023-04-01 01:30:00', '%z %Z')
++0400 MSD
+#
+# Values around and in spring time-gap
+#
+set time_zone='MET';
+# Normal value with DST
+SELECT DATE_FORMAT('2003-03-30 01:59:59', '%z %Z');
+DATE_FORMAT('2003-03-30 01:59:59', '%z %Z')
++0100 MET
+# Values around and in spring time-gap
+SELECT DATE_FORMAT('2023-03-26 01:59:59', '%z %Z');
+DATE_FORMAT('2023-03-26 01:59:59', '%z %Z')
++0100 MET
+SELECT DATE_FORMAT('2023-03-26 03:00:00', '%z %Z');
+DATE_FORMAT('2023-03-26 03:00:00', '%z %Z')
++0200 MEST
+#
+# End of 11.3 test
+#
diff --git a/mysql-test/main/date_formats.test b/mysql-test/main/date_formats.test
index 4f252f29..691966de 100644
--- a/mysql-test/main/date_formats.test
+++ b/mysql-test/main/date_formats.test
@@ -2,134 +2,12 @@
# Test of date format functions
#
-#remove this include after fix MDEV-27871
--- source include/no_view_protocol.inc
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-SELECT variable_name, variable_value
-FROM information_schema.global_variables
-WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
-ORDER BY variable_name;
-
-SELECT variable_name, variable_value
-FROM information_schema.session_variables
-WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
-ORDER BY variable_name;
-
-#
-# The following tests will work only when we at some point will enable
-# dynamic changing of formats
-#
-
-# SET time_format='%H%i%s';
-# SET time_format='%H:%i:%s.%f';
-# SET time_format='%h-%i-%s.%f%p';
-# SET time_format='%h:%i:%s.%f %p';
-# SET time_format='%h:%i:%s%p';
-#
-# SET date_format='%Y%m%d';
-# SET date_format='%Y.%m.%d';
-# SET date_format='%d.%m.%Y';
-# SET date_format='%m-%d-%Y';
-#
-# --error ER_WRONG_VALUE_FOR_VAR
-# SET datetime_format= NULL;
-# set datetime_format= '%Y%m%d%H%i%s';
-# set datetime_format= '%Y-%m-%d %H:%i:%s';
-# set datetime_format= '%m-%d-%y %H:%i:%s.%f';
-# set datetime_format= '%d-%m-%Y %h:%i:%s%p';
-# set datetime_format= '%H:%i:%s %Y-%m-%d';
-# set datetime_format= '%H:%i:%s.%f %m-%d-%Y';
-# set datetime_format= '%h:%i:%s %p %Y-%m-%d';
-# set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d';
-#
-# SELECT variable_name, variable_value
-# FROM information_schema.session_variables
-# WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
-# ORDER BY variable_name;
-#
-# --error 1231
-# SET time_format='%h:%i:%s';
-# --error 1231
-# SET time_format='%H %i:%s';
-# --error 1231
-# SET time_format='%H::%i:%s';
-# --error 1231
-# SET time_format='%H:%i:%s%f';
-# --error 1231
-# SET time_format='%H:%i.%f:%s';
-# --error 1231
-# SET time_format='%H:%i:%s%p';
-# --error 1231
-# SET time_format='%h:%i:%s.%f %p %Y-%m-%d';
-# --error 1231
-# SET time_format='%H%i%s.%f';
-# --error 1231
-# SET time_format='%H:%i-%s.%f';
-# --error 1231
-# SET date_format='%d.%m.%d';
-# --error 1231
-# SET datetime_format='%h.%m.%y %d.%i.%s';
-# --error 1231
-# set datetime_format= '%H:%i:%s.%f %p %Y-%m-%d';
-#
-# #
-# # Test GLOBAL values
-#
-# set GLOBAL datetime_format= '%H:%i:%s %Y-%m-%d';
-# SET SESSION datetime_format=default;
-# select @@global.datetime_format, @@session.datetime_format;
-# SET GLOBAL datetime_format=default;
-# SET SESSION datetime_format=default;
-# select @@global.datetime_format, @@session.datetime_format;
-#
-# SET GLOBAL date_format=default;
-# SET GLOBAL time_format=default;
-# SET GLOBAL datetime_format=default;
-# SET time_format=default;
-# SET date_format=default;
-# SET datetime_format=default;
-
-# SET date_format='%d.%m.%Y';
-# select CAST('01.01.2001' as DATE) as a;
-# SET datetime_format='%d.%m.%Y %H.%i.%s';
-# select CAST('01.01.2001 05.12.06' as DATETIME) as a;
-# SET time_format='%H.%i.%s';
-# select CAST('05.12.06' as TIME) as a;
-#
-# SET datetime_format='%d.%m.%Y %h:%i:%s %p';
-# select CAST('01.01.2001 05:12:06AM' as DATETIME) as a;
-# select CAST('01.01.2001 05:12:06 PM' as DATETIME) as a;
-#
-# SET time_format='%h:%i:%s %p';
-# select CAST('05:12:06 AM' as TIME) as a;
-# select CAST('05:12:06.1234PM' as TIME) as a;
-#
-# SET time_format='%h.%i.%s %p';
-# SET date_format='%d.%m.%y';
-# SET datetime_format='%d.%m.%y %h.%i.%s %p';
-# select CAST('12-12-06' as DATE) as a;
-#
-# select adddate('01.01.97 11.59.59.000001 PM', 10);
-# select datediff('31.12.97 11.59:59.000001 PM','01.01.98');
-# select weekofyear('31.11.97 11:59:59.000001 PM');
-# select makedate(1997,1);
-# select addtime('31.12.97 11.59.59.999999 PM', '1 1.1.1.000002');
-# select maketime(23,11,12);
-# select timediff('01.01.97 11:59:59.000001 PM','31.12.95 11:59:59.000002 PM');
-#
-# SET time_format='%i:%s:%H';
-# select cast(str_to_date('15-01-2001 12:59:59', '%d-%m-%Y %H:%i:%S') as TIME);
-
#
# Test of str_to_date
#
select str_to_date(concat('15-01-2001',' 2:59:58.999'),
- concat('%d-%m-%Y',' ','%H:%i:%s.%f'));
+ concat('%d-%m-%Y',' ','%H:%i:%s.%f')) as s;
select STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T');
create table t1 (date char(30), format char(30) not null);
@@ -175,7 +53,7 @@ select date,format,DATE(str_to_date(date, format)) as date2 from t1;
select date,format,TIME(str_to_date(date, format)) as time from t1;
select date,format,concat(TIME(str_to_date(date, format))) as time2 from t1;
# Test small bug in %f handling
-select concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d'));
+select concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d')) as s;
# Test wrong dates or converion specifiers
@@ -363,7 +241,7 @@ SELECT DATE_FORMAT("2009-01-01",'%W %d %M %Y') as valid_date;
--echo # Bug#58005 utf8 + get_format causes failed assertion: !str || str != Ptr'
--echo #
SET NAMES utf8;
-SELECT LEAST('%', GET_FORMAT(datetime, 'eur'), CAST(GET_FORMAT(datetime, 'eur') AS CHAR(65535)));
+SELECT LEAST('%', GET_FORMAT(datetime, 'eur'), CAST(GET_FORMAT(datetime, 'eur') AS CHAR(65535))) as s;
SET NAMES latin1;
--echo #
@@ -378,3 +256,72 @@ select time_format('2001-01-01 02:02:02', '%d %T');
select time_format('01 02:02:02', '%d %T');
select time_format('01 02:02:02', '%T');
select time_format('2001-01-01 02:02:02', '%T');
+
+--echo #
+--echo # End of 10.2 test
+--echo #
+
+--echo #
+--echo # MDEV-31684 Add timezone information to DATE_FORMAT
+--echo #
+
+SET @old_timezone= @@time_zone;
+
+
+--echo # Using named timezones
+
+SET TIME_ZONE='Japan';
+SELECT DATE_FORMAT('2009-10-04 22:23:00', '%z %Z') AS current_timezone;
+
+SET @@time_zone='Europe/Moscow';
+SELECT DATE_FORMAT('1965-02-17 22:23:00', '%z %Z') AS current_timezone;
+SELECT DATE_FORMAT('1965-12-31 22:23:00', '%z %Z') AS current_timezone;
+SELECT DATE_FORMAT('1985-06-01', '%z %Z');
+
+--echo # Using positive and negative offset
+
+SET TIME_ZONE= '-05:30';
+SELECT DATE_FORMAT('2009-10-04 22:23:00', '%z %Z') AS current_timezone;
+
+SET TIME_ZONE= '+04:30';
+SELECT DATE_FORMAT('2009-10-04 22:23:00', '%z %Z') AS current_timezone;
+
+
+--echo # Using UTC
+
+SET TIME_ZONE='UTC';
+SELECT DATE_FORMAT('2009-10-04 22:23:00', '%z %Z') AS current_timezone;
+
+SET @@time_zone= @old_timezone;
+
+--echo # More timezone test:
+
+--echo #
+--echo # Check for time zone with leap seconds
+--echo #
+set time_zone='Europe/Moscow';
+
+SELECT DATE_FORMAT('2023-03-01 01:30:00', '%z %Z');
+SELECT DATE_FORMAT('2023-04-01 01:30:00', '%z %Z');
+
+set time_zone='leap/Europe/Moscow';
+SELECT DATE_FORMAT('2023-03-01 01:30:00', '%z %Z');
+SELECT DATE_FORMAT('2023-04-01 01:30:00', '%z %Z');
+
+--echo #
+--echo # Values around and in spring time-gap
+--echo #
+
+set time_zone='MET';
+
+--echo # Normal value with DST
+SELECT DATE_FORMAT('2003-03-30 01:59:59', '%z %Z');
+
+--echo # Values around and in spring time-gap
+SELECT DATE_FORMAT('2023-03-26 01:59:59', '%z %Z');
+SELECT DATE_FORMAT('2023-03-26 03:00:00', '%z %Z');
+
+
+--echo #
+--echo # End of 11.3 test
+--echo #
diff --git a/mysql-test/main/delayed.test b/mysql-test/main/delayed.test
index 38c3de9a..36f2b665 100644
--- a/mysql-test/main/delayed.test
+++ b/mysql-test/main/delayed.test
@@ -437,7 +437,7 @@ SELECT * FROM t1 WHERE a=0;
connection con1;
--echo # Sending:
---send ALTER TABLE t1 MODIFY a INT UNSIGNED;
+--send ALTER TABLE t1 MODIFY a INT UNSIGNED, LOCK=SHARED;
connection default;
--echo # Wait until ALTER TABLE is blocked on table 't1'.
diff --git a/mysql-test/main/delete.result b/mysql-test/main/delete.result
index 7a9963ab..c4bf3350 100644
--- a/mysql-test/main/delete.result
+++ b/mysql-test/main/delete.result
@@ -92,6 +92,9 @@ select * from t1;
a b
1 apple
drop table t1;
+#
+# IGNORE option
+#
create table t11 (a int NOT NULL, b int, primary key (a));
create table t12 (a int NOT NULL, b int, primary key (a));
create table t2 (a int NOT NULL, b int, primary key (a));
@@ -125,10 +128,14 @@ a b
33 10
0 11
2 12
+explain delete ignore t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b <> (select b from t2 where t11.a < t2.a);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t12 ALL PRIMARY NULL NULL NULL 3
+1 PRIMARY t11 eq_ref PRIMARY PRIMARY 4 test.t12.a 1 Using where
+2 DEPENDENT SUBQUERY t2 ALL PRIMARY NULL NULL NULL 3 Using where
delete ignore t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b <> (select b from t2 where t11.a < t2.a);
Warnings:
Warning 1242 Subquery returns more than 1 row
-Warning 1242 Subquery returns more than 1 row
select * from t11;
a b
0 10
@@ -557,3 +564,50 @@ having t3.a > any (select t2.b from t2
where t2.b*10 < sum(t3.b)));
drop table t1,t2,t3;
End of 10.4 tests
+#
+# MDEV-29428: DELETE with ORDER BY without LIMIT clause
+#
+create table t1 (c1 integer, c2 integer, c3 integer);
+insert into t1 values
+(1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+create temporary table t select * from t1;
+explain delete from t1 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL 8 Deleting all rows
+delete from t1 order by c2;
+select *from t1;
+c1 c2 c3
+delete from t1;
+insert into t1 select * from t;
+explain delete from t1
+where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 8 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 8 Using where; FirstMatch(t1)
+delete from t1
+where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+select *from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+2 1 4
+2 2 5
+delete from t1;
+insert into t1 select * from t;
+explain delete from t1
+where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3
+order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 8 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 8 Using where; FirstMatch(t1)
+delete from t1
+where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3
+order by c2;
+select *from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+2 1 4
+2 2 5
+drop table t1;
+End of 11.1 tests
diff --git a/mysql-test/main/delete.test b/mysql-test/main/delete.test
index 0b0e7ce4..583d8223 100644
--- a/mysql-test/main/delete.test
+++ b/mysql-test/main/delete.test
@@ -106,9 +106,9 @@ delete t1 from t1, t1 as t2 where t1.b = t2.b and t1.a > t2.a;
select * from t1;
drop table t1;
-#
-# IGNORE option
-#
+--echo #
+--echo # IGNORE option
+--echo #
create table t11 (a int NOT NULL, b int, primary key (a));
create table t12 (a int NOT NULL, b int, primary key (a));
create table t2 (a int NOT NULL, b int, primary key (a));
@@ -122,6 +122,7 @@ select * from t2;
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b <> (select b from t2 where t11.a < t2.a);
select * from t11;
select * from t12;
+explain delete ignore t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b <> (select b from t2 where t11.a < t2.a);
delete ignore t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b <> (select b from t2 where t11.a < t2.a);
select * from t11;
select * from t12;
@@ -625,3 +626,45 @@ update t1 set t1.a=t1.a+10
drop table t1,t2,t3;
--echo End of 10.4 tests
+
+--echo #
+--echo # MDEV-29428: DELETE with ORDER BY without LIMIT clause
+--echo #
+
+create table t1 (c1 integer, c2 integer, c3 integer);
+
+insert into t1 values
+ (1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+
+create temporary table t select * from t1;
+
+let $q1=
+delete from t1 order by c2;
+eval explain $q1;
+eval $q1;
+select *from t1;
+
+delete from t1;
+insert into t1 select * from t;
+
+let $q2=
+delete from t1
+ where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+eval explain $q2;
+eval $q2;
+select *from t1;
+
+delete from t1;
+insert into t1 select * from t;
+
+let $q3=
+delete from t1
+ where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3
+ order by c2;
+eval explain $q3;
+eval $q3;
+select *from t1;
+
+drop table t1;
+
+--echo End of 11.1 tests
diff --git a/mysql-test/main/delete_innodb.result b/mysql-test/main/delete_innodb.result
index b9f4c8bd..c171e8d0 100644
--- a/mysql-test/main/delete_innodb.result
+++ b/mysql-test/main/delete_innodb.result
@@ -17,10 +17,570 @@ a
b
EXPLAIN DELETE b FROM t1 AS a JOIN t1 AS b;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE a index NULL PRIMARY 255 NULL 3 Using index
+1 SIMPLE a ALL NULL NULL NULL NULL 3
1 SIMPLE b ALL NULL NULL NULL NULL 3
DELETE b FROM t1 AS a JOIN t1 AS b;
SELECT * FROM t1;
c1
SET sort_buffer_size=@save_sort_buffer_size;
DROP TABLE t1;
+#
+# MDEV-32212 DELETE with ORDER BY and semijoin optimization causing crash
+#
+CREATE TABLE t1 (c1 INT) ENGINE=InnoDB;
+CREATE TABLE t2 (c2 INT) ENGINE=InnoDB;
+INSERT INTO t1 values (1),(2),(3),(4),(5),(6);
+INSERT INTO t2 values (2);
+DELETE FROM t1 WHERE c1 IN (select c2 from t2);
+select * from t1;
+c1
+1
+3
+4
+5
+6
+truncate t1;
+truncate t2;
+INSERT INTO t1 values (1),(2),(3),(4),(5),(6);
+INSERT INTO t2 values (2);
+check sj optimization with order-by
+analyze DELETE FROM t1 WHERE c1 IN (select c2 from t2) ORDER BY c1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 6.00 100.00 100.00 Using filesort
+1 PRIMARY t2 ALL NULL NULL NULL NULL 1 1.00 100.00 16.67 Using where; FirstMatch(t1)
+select * from t1;
+c1
+1
+3
+4
+5
+6
+truncate t2;
+INSERT INTO t2 values (3);
+disallows sj optimization
+analyze DELETE FROM t1 WHERE c1 IN (select c2 from t2) ORDER BY c1 limit 1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 1.00 100.00 100.00 Using where; Using filesort
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 1 1.00 100.00 20.00 Using where
+select * from t1;
+c1
+1
+4
+5
+6
+DROP TABLE t1, t2;
+#
+# MDEV-33533: multi-delete using rowid filter
+#
+set @save_default_storage_engine=@@default_storage_engine;
+set default_storage_engine=InnoDB;
+CREATE DATABASE dbt3_s001;
+use dbt3_s001;
+create index i_n_name on nation(n_name);
+analyze table
+nation, lineitem, customer, orders, part, supplier, partsupp, region
+persistent for all;
+Table Op Msg_type Msg_text
+dbt3_s001.nation analyze status Engine-independent statistics collected
+dbt3_s001.nation analyze status OK
+dbt3_s001.lineitem analyze status Engine-independent statistics collected
+dbt3_s001.lineitem analyze status OK
+dbt3_s001.customer analyze status Engine-independent statistics collected
+dbt3_s001.customer analyze status OK
+dbt3_s001.orders analyze status Engine-independent statistics collected
+dbt3_s001.orders analyze status OK
+dbt3_s001.part analyze status Engine-independent statistics collected
+dbt3_s001.part analyze status OK
+dbt3_s001.supplier analyze status Engine-independent statistics collected
+dbt3_s001.supplier analyze status OK
+dbt3_s001.partsupp analyze status Engine-independent statistics collected
+dbt3_s001.partsupp analyze status OK
+dbt3_s001.region analyze status Engine-independent statistics collected
+dbt3_s001.region analyze status OK
+explain
+select o_orderkey, o_totalprice from orders, customer, nation where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey = c_custkey and
+c_nationkey = n_nationkey and
+n_name='PERU';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using where; Using index
+1 SIMPLE customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6 Using index
+1 SIMPLE orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (8%) Using where; Using rowid filter
+explain format=json
+select o_orderkey, o_totalprice from orders, customer, nation where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey = c_custkey and
+c_nationkey = n_nationkey and
+n_name='PERU';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": "COST_REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "nation",
+ "access_type": "ref",
+ "possible_keys": ["PRIMARY", "i_n_name"],
+ "key": "i_n_name",
+ "key_length": "26",
+ "used_key_parts": ["n_name"],
+ "ref": ["const"],
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "attached_condition": "nation.n_name = 'PERU'",
+ "using_index": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "customer",
+ "access_type": "ref",
+ "possible_keys": ["PRIMARY", "i_c_nationkey"],
+ "key": "i_c_nationkey",
+ "key_length": "5",
+ "used_key_parts": ["c_nationkey"],
+ "ref": ["dbt3_s001.nation.n_nationkey"],
+ "loops": 1,
+ "rows": 6,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "using_index": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "ref",
+ "possible_keys": ["i_o_orderdate", "i_o_custkey"],
+ "key": "i_o_custkey",
+ "key_length": "5",
+ "used_key_parts": ["o_custkey"],
+ "ref": ["dbt3_s001.customer.c_custkey"],
+ "rowid_filter": {
+ "range": {
+ "key": "i_o_orderdate",
+ "used_key_parts": ["o_orderDATE"]
+ },
+ "rows": 119,
+ "selectivity_pct": 7.933333333
+ },
+ "loops": 6,
+ "rows": 15,
+ "cost": "COST_REPLACED",
+ "filtered": 7.933333397,
+ "attached_condition": "orders.o_orderDATE between '1992-01-01' and '1992-06-30'"
+ }
+ }
+ ]
+ }
+}
+select o_orderkey, o_totalprice from orders, customer, nation where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey = c_custkey and
+c_nationkey = n_nationkey and
+n_name='PERU';
+o_orderkey o_totalprice
+1729 12137.76
+2880 145761.99
+3142 16030.15
+5095 184583.99
+5121 150334.57
+5382 138423.03
+644 201268.06
+737 12984.85
+create table t as
+select orders.* from orders, customer, nation where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey = c_custkey and
+c_nationkey = n_nationkey and
+n_name='PERU';
+explain
+delete from orders using orders, customer, nation where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey = c_custkey and
+c_nationkey = n_nationkey and
+n_name='PERU';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using where; Using index
+1 SIMPLE customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6 Using index
+1 SIMPLE orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (8%) Using where; Using rowid filter
+explain format=json
+delete from orders using orders, customer, nation where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey = c_custkey and
+c_nationkey = n_nationkey and
+n_name='PERU';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": "COST_REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "nation",
+ "access_type": "ref",
+ "possible_keys": ["PRIMARY", "i_n_name"],
+ "key": "i_n_name",
+ "key_length": "26",
+ "used_key_parts": ["n_name"],
+ "ref": ["const"],
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "attached_condition": "nation.n_name = 'PERU'",
+ "using_index": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "customer",
+ "access_type": "ref",
+ "possible_keys": ["PRIMARY", "i_c_nationkey"],
+ "key": "i_c_nationkey",
+ "key_length": "5",
+ "used_key_parts": ["c_nationkey"],
+ "ref": ["dbt3_s001.nation.n_nationkey"],
+ "loops": 1,
+ "rows": 6,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "using_index": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "ref",
+ "possible_keys": ["i_o_orderdate", "i_o_custkey"],
+ "key": "i_o_custkey",
+ "key_length": "5",
+ "used_key_parts": ["o_custkey"],
+ "ref": ["dbt3_s001.customer.c_custkey"],
+ "rowid_filter": {
+ "range": {
+ "key": "i_o_orderdate",
+ "used_key_parts": ["o_orderDATE"]
+ },
+ "rows": 119,
+ "selectivity_pct": 7.933333333
+ },
+ "loops": 6,
+ "rows": 15,
+ "cost": "COST_REPLACED",
+ "filtered": 7.933333397,
+ "attached_condition": "orders.o_orderDATE between '1992-01-01' and '1992-06-30'"
+ }
+ }
+ ]
+ }
+}
+delete from orders using orders, customer, nation where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey = c_custkey and
+c_nationkey = n_nationkey and
+n_name='PERU';
+select o_orderkey, o_totalprice from orders, customer, nation where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey = c_custkey and
+c_nationkey = n_nationkey and
+n_name='PERU';
+o_orderkey o_totalprice
+insert into orders select * from t;
+select o_orderkey, o_totalprice from orders, customer, nation where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey = c_custkey and
+c_nationkey = n_nationkey and
+n_name='PERU';
+o_orderkey o_totalprice
+1729 12137.76
+2880 145761.99
+3142 16030.15
+5095 184583.99
+5121 150334.57
+5382 138423.03
+644 201268.06
+737 12984.85
+prepare stmt from "
+delete from orders using orders, customer, nation where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey = c_custkey and
+c_nationkey = n_nationkey and
+n_name='PERU';
+";
+execute stmt;
+select o_orderkey, o_totalprice from orders, customer, nation where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey = c_custkey and
+c_nationkey = n_nationkey and
+n_name='PERU';
+o_orderkey o_totalprice
+insert into orders select * from t;
+select o_orderkey, o_totalprice from orders, customer, nation where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey = c_custkey and
+c_nationkey = n_nationkey and
+n_name='PERU';
+o_orderkey o_totalprice
+1729 12137.76
+2880 145761.99
+3142 16030.15
+5095 184583.99
+5121 150334.57
+5382 138423.03
+644 201268.06
+737 12984.85
+execute stmt;
+select o_orderkey, o_totalprice from orders, customer, nation where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey = c_custkey and
+c_nationkey = n_nationkey and
+n_name='PERU';
+o_orderkey o_totalprice
+insert into orders select * from t;
+select o_orderkey, o_totalprice from orders, customer, nation where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey = c_custkey and
+c_nationkey = n_nationkey and
+n_name='PERU';
+o_orderkey o_totalprice
+1729 12137.76
+2880 145761.99
+3142 16030.15
+5095 184583.99
+5121 150334.57
+5382 138423.03
+644 201268.06
+737 12984.85
+deallocate prepare stmt;
+drop table t;
+explain
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using where; Using index
+1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6 Using index
+1 PRIMARY orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (8%) Using where; Using rowid filter
+explain format=json
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": "COST_REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "nation",
+ "access_type": "ref",
+ "possible_keys": ["PRIMARY", "i_n_name"],
+ "key": "i_n_name",
+ "key_length": "26",
+ "used_key_parts": ["n_name"],
+ "ref": ["const"],
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "attached_condition": "nation.n_name = 'PERU'",
+ "using_index": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "customer",
+ "access_type": "ref",
+ "possible_keys": ["PRIMARY", "i_c_nationkey"],
+ "key": "i_c_nationkey",
+ "key_length": "5",
+ "used_key_parts": ["c_nationkey"],
+ "ref": ["dbt3_s001.nation.n_nationkey"],
+ "loops": 1,
+ "rows": 6,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "using_index": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "ref",
+ "possible_keys": ["i_o_orderdate", "i_o_custkey"],
+ "key": "i_o_custkey",
+ "key_length": "5",
+ "used_key_parts": ["o_custkey"],
+ "ref": ["dbt3_s001.customer.c_custkey"],
+ "rowid_filter": {
+ "range": {
+ "key": "i_o_orderdate",
+ "used_key_parts": ["o_orderDATE"]
+ },
+ "rows": 119,
+ "selectivity_pct": 7.933333333
+ },
+ "loops": 6,
+ "rows": 15,
+ "cost": "COST_REPLACED",
+ "filtered": 7.933333397,
+ "attached_condition": "orders.o_orderDATE between '1992-01-01' and '1992-06-30'"
+ }
+ }
+ ]
+ }
+}
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+1729 12137.76
+2880 145761.99
+3142 16030.15
+5095 184583.99
+5121 150334.57
+5382 138423.03
+644 201268.06
+737 12984.85
+create table t as
+select * from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+explain
+delete from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using where; Using index
+1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6 Using index
+1 PRIMARY orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (8%) Using where; Using rowid filter
+explain format=json
+delete from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": "COST_REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "nation",
+ "access_type": "ref",
+ "possible_keys": ["PRIMARY", "i_n_name"],
+ "key": "i_n_name",
+ "key_length": "26",
+ "used_key_parts": ["n_name"],
+ "ref": ["const"],
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "attached_condition": "nation.n_name = 'PERU'",
+ "using_index": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "customer",
+ "access_type": "ref",
+ "possible_keys": ["PRIMARY", "i_c_nationkey"],
+ "key": "i_c_nationkey",
+ "key_length": "5",
+ "used_key_parts": ["c_nationkey"],
+ "ref": ["dbt3_s001.nation.n_nationkey"],
+ "loops": 1,
+ "rows": 6,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "using_index": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "ref",
+ "possible_keys": ["i_o_orderdate", "i_o_custkey"],
+ "key": "i_o_custkey",
+ "key_length": "5",
+ "used_key_parts": ["o_custkey"],
+ "ref": ["dbt3_s001.customer.c_custkey"],
+ "rowid_filter": {
+ "range": {
+ "key": "i_o_orderdate",
+ "used_key_parts": ["o_orderDATE"]
+ },
+ "rows": 119,
+ "selectivity_pct": 7.933333333
+ },
+ "loops": 6,
+ "rows": 15,
+ "cost": "COST_REPLACED",
+ "filtered": 7.933333397,
+ "attached_condition": "orders.o_orderDATE between '1992-01-01' and '1992-06-30'"
+ }
+ }
+ ]
+ }
+}
+delete from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+insert into orders select * from t;
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+1729 12137.76
+2880 145761.99
+3142 16030.15
+5095 184583.99
+5121 150334.57
+5382 138423.03
+644 201268.06
+737 12984.85
+drop table t;
+DROP DATABASE dbt3_s001;
+set default_storage_engine=@save_default_storage_engine;
+#
+# Additional tests of first table and rowid filter
+#
+CREATE DATABASE dbt3_s001;
+use dbt3_s001;
+set @save_default_storage_engine=@@default_storage_engine;
+set default_storage_engine=InnoDB;
+CREATE INDEX i_l_quantity ON lineitem(l_quantity);
+CREATE INDEX i_o_totalprice ON orders(o_totalprice);
+ANALYZE TABLE lineitem, orders;
+Table Op Msg_type Msg_text
+dbt3_s001.lineitem analyze status Engine-independent statistics collected
+dbt3_s001.lineitem analyze status OK
+dbt3_s001.orders analyze status Engine-independent statistics collected
+dbt3_s001.orders analyze status OK
+set optimizer_use_condition_selectivity=2;
+create table second(s_receiptDATE date, filler char(100), key(s_receiptDATE)) ;
+insert into second select date_add(l_receiptDATE, interval 1 day), 'helllo' from lineitem ;
+select count(*) from lineitem, second WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 47 and second.s_receiptDATE = date_add(l_receiptDATE, interval 1 day);
+count(*)
+114
+# lineitem should be first and with "Using rowid filter"
+explain delete lineitem FROM lineitem, second WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 47 and second.s_receiptDATE = date_add(l_receiptDATE, interval 1 day);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE lineitem range|filter i_l_shipdate,i_l_quantity i_l_quantity|i_l_shipdate 9|4 NULL 349 (8%) Using where; Using rowid filter
+1 SIMPLE second ref s_receiptDATE s_receiptDATE 4 func 1 Using where; Using index
+delete lineitem FROM lineitem, second WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 47 and second.s_receiptDATE = date_add(l_receiptDATE, interval 1 day);
+# Should be 0
+select count(*) from lineitem, second WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 47 and second.s_receiptDATE = date_add(l_receiptDATE, interval 1 day);
+count(*)
+0
+drop database dbt3_s001;
+set default_storage_engine=@save_default_storage_engine;
+End of 11.1 tests
diff --git a/mysql-test/main/delete_innodb.test b/mysql-test/main/delete_innodb.test
index c5c5c5d0..86c32732 100644
--- a/mysql-test/main/delete_innodb.test
+++ b/mysql-test/main/delete_innodb.test
@@ -1,6 +1,8 @@
--source include/have_innodb.inc
--source include/have_sequence.inc
+--source include/innodb_stable_estimates.inc
+
--echo # Tests for delete with INNODB
--echo #
@@ -20,3 +22,202 @@ SELECT * FROM t1;
SET sort_buffer_size=@save_sort_buffer_size;
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-32212 DELETE with ORDER BY and semijoin optimization causing crash
+--echo #
+--source include/have_innodb.inc
+
+CREATE TABLE t1 (c1 INT) ENGINE=InnoDB;
+CREATE TABLE t2 (c2 INT) ENGINE=InnoDB;
+INSERT INTO t1 values (1),(2),(3),(4),(5),(6);
+INSERT INTO t2 values (2);
+
+DELETE FROM t1 WHERE c1 IN (select c2 from t2);
+select * from t1;
+truncate t1;
+truncate t2;
+INSERT INTO t1 values (1),(2),(3),(4),(5),(6);
+INSERT INTO t2 values (2);
+--echo check sj optimization with order-by
+analyze DELETE FROM t1 WHERE c1 IN (select c2 from t2) ORDER BY c1;
+select * from t1;
+truncate t2;
+INSERT INTO t2 values (3);
+--echo disallows sj optimization
+analyze DELETE FROM t1 WHERE c1 IN (select c2 from t2) ORDER BY c1 limit 1;
+select * from t1;
+
+DROP TABLE t1, t2;
+
+--echo #
+--echo # MDEV-33533: multi-delete using rowid filter
+--echo #
+
+set @save_default_storage_engine=@@default_storage_engine;
+set default_storage_engine=InnoDB;
+
+CREATE DATABASE dbt3_s001;
+
+use dbt3_s001;
+
+--disable_query_log
+--disable_result_log
+--disable_warnings
+--source include/dbt3_s001.inc
+--enable_warnings
+--enable_result_log
+--enable_query_log
+
+create index i_n_name on nation(n_name);
+analyze table
+ nation, lineitem, customer, orders, part, supplier, partsupp, region
+persistent for all;
+
+let $c1=
+ o_orderDATE between '1992-01-01' and '1992-06-30' and
+ o_custkey = c_custkey and
+ c_nationkey = n_nationkey and
+ n_name='PERU';
+
+eval
+explain
+select o_orderkey, o_totalprice from orders, customer, nation where $c1;
+--source include/explain-no-costs.inc
+eval
+explain format=json
+select o_orderkey, o_totalprice from orders, customer, nation where $c1;
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders, customer, nation where $c1;
+eval
+create table t as
+select orders.* from orders, customer, nation where $c1;
+
+eval
+explain
+delete from orders using orders, customer, nation where $c1;
+--source include/explain-no-costs.inc
+eval
+explain format=json
+delete from orders using orders, customer, nation where $c1;
+eval
+delete from orders using orders, customer, nation where $c1;
+eval
+select o_orderkey, o_totalprice from orders, customer, nation where $c1;
+
+insert into orders select * from t;
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders, customer, nation where $c1;
+
+eval
+prepare stmt from "
+delete from orders using orders, customer, nation where $c1;
+";
+
+execute stmt;
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders, customer, nation where $c1;
+insert into orders select * from t;
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders, customer, nation where $c1;
+
+execute stmt;
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders, customer, nation where $c1;
+insert into orders select * from t;
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders, customer, nation where $c1;
+
+deallocate prepare stmt;
+
+drop table t;
+
+let $c1=
+ o_orderDATE between '1992-01-01' and '1992-06-30' and
+ o_custkey in (select c_custkey from customer
+ where c_nationkey in (select n_nationkey from nation
+ where n_name='PERU'));
+
+eval
+explain
+select o_orderkey, o_totalprice from orders where $c1;
+--source include/explain-no-costs.inc
+eval
+explain format=json
+select o_orderkey, o_totalprice from orders where $c1;
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+eval
+create table t as
+select * from orders where $c1;
+
+eval
+explain
+delete from orders where $c1;
+--source include/explain-no-costs.inc
+eval
+explain format=json
+delete from orders where $c1;
+eval
+delete from orders where $c1;
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+
+insert into orders select * from t;
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+drop table t;
+
+DROP DATABASE dbt3_s001;
+
+set default_storage_engine=@save_default_storage_engine;
+
+--echo #
+--echo # Additional tests of first table and rowid filter
+--echo #
+
+CREATE DATABASE dbt3_s001;
+
+use dbt3_s001;
+
+set @save_default_storage_engine=@@default_storage_engine;
+set default_storage_engine=InnoDB;
+
+--disable_query_log
+--disable_result_log
+--disable_warnings
+--source include/dbt3_s001.inc
+--enable_warnings
+--enable_result_log
+--enable_query_log
+
+CREATE INDEX i_l_quantity ON lineitem(l_quantity);
+CREATE INDEX i_o_totalprice ON orders(o_totalprice);
+ANALYZE TABLE lineitem, orders;
+set optimizer_use_condition_selectivity=2;
+create table second(s_receiptDATE date, filler char(100), key(s_receiptDATE)) ;
+insert into second select date_add(l_receiptDATE, interval 1 day), 'helllo' from lineitem ;
+
+select count(*) from lineitem, second WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 47 and second.s_receiptDATE = date_add(l_receiptDATE, interval 1 day);
+
+--echo # lineitem should be first and with "Using rowid filter"
+explain delete lineitem FROM lineitem, second WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 47 and second.s_receiptDATE = date_add(l_receiptDATE, interval 1 day);
+
+delete lineitem FROM lineitem, second WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 47 and second.s_receiptDATE = date_add(l_receiptDATE, interval 1 day);
+
+--echo # Should be 0
+select count(*) from lineitem, second WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 47 and second.s_receiptDATE = date_add(l_receiptDATE, interval 1 day);
+
+drop database dbt3_s001;
+set default_storage_engine=@save_default_storage_engine;
+
+
+--echo End of 11.1 tests
diff --git a/mysql-test/main/delete_returning.result b/mysql-test/main/delete_returning.result
index 3a95de0c..ab795149 100644
--- a/mysql-test/main/delete_returning.result
+++ b/mysql-test/main/delete_returning.result
@@ -211,3 +211,19 @@ id
3
set sql_mode=@sql_mode_save;
DROP TABLE t1;
+#
+# MDEV-3953 Add columns for ROWS_EXAMINED, ROWS_SENT, and ROWS_READ to I_S and
+# processlist
+#
+create table t1 (a int primary key, b int);
+insert into t1 select seq,seq+1 from seq_1_to_10;
+flush status;
+delete from t1 where a between 1 and 3 returning a,b;
+a b
+1 2
+2 3
+3 4
+show status like "Rows_sent";
+Variable_name Value
+Rows_sent 3
+drop table t1;
diff --git a/mysql-test/main/delete_returning.test b/mysql-test/main/delete_returning.test
index 4448a6bc..cdfb48e8 100644
--- a/mysql-test/main/delete_returning.test
+++ b/mysql-test/main/delete_returning.test
@@ -1,3 +1,4 @@
+--source include/have_sequence.inc
#
# Tests for DELETE FROM <table> ... RETURNING <expr>,...
#
@@ -170,3 +171,15 @@ DELETE FROM t1 WHERE id > 2 RETURNING *;
set sql_mode=@sql_mode_save;
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-3953 Add columns for ROWS_EXAMINED, ROWS_SENT, and ROWS_READ to I_S and
+--echo # processlist
+--echo #
+
+create table t1 (a int primary key, b int);
+insert into t1 select seq,seq+1 from seq_1_to_10;
+flush status;
+delete from t1 where a between 1 and 3 returning a,b;
+show status like "Rows_sent";
+drop table t1;
diff --git a/mysql-test/main/delete_single_to_multi.result b/mysql-test/main/delete_single_to_multi.result
new file mode 100644
index 00000000..57cc2242
--- /dev/null
+++ b/mysql-test/main/delete_single_to_multi.result
@@ -0,0 +1,4252 @@
+DROP DATABASE IF EXISTS dbt3_s001;
+CREATE DATABASE dbt3_s001;
+use dbt3_s001;
+create index i_n_name on nation(n_name);
+analyze table
+nation, lineitem, customer, orders, part, supplier, partsupp, region
+persistent for all;
+Table Op Msg_type Msg_text
+dbt3_s001.nation analyze status Engine-independent statistics collected
+dbt3_s001.nation analyze status OK
+dbt3_s001.lineitem analyze status Engine-independent statistics collected
+dbt3_s001.lineitem analyze status OK
+dbt3_s001.customer analyze status Engine-independent statistics collected
+dbt3_s001.customer analyze status OK
+dbt3_s001.orders analyze status Engine-independent statistics collected
+dbt3_s001.orders analyze status OK
+dbt3_s001.part analyze status Engine-independent statistics collected
+dbt3_s001.part analyze status OK
+dbt3_s001.supplier analyze status Engine-independent statistics collected
+dbt3_s001.supplier analyze status OK
+dbt3_s001.partsupp analyze status Engine-independent statistics collected
+dbt3_s001.partsupp analyze status OK
+dbt3_s001.region analyze status Engine-independent statistics collected
+dbt3_s001.region analyze status OK
+# Pullout
+# =======
+explain
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6
+1 PRIMARY orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (7%) Using where; Using rowid filter
+explain format=json
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.052271677,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "nation",
+ "access_type": "ref",
+ "possible_keys": ["PRIMARY", "i_n_name"],
+ "key": "i_n_name",
+ "key_length": "26",
+ "used_key_parts": ["n_name"],
+ "ref": ["const"],
+ "loops": 1,
+ "rows": 1,
+ "cost": 0.002024411,
+ "filtered": 100,
+ "index_condition": "nation.n_name = 'PERU'"
+ }
+ },
+ {
+ "table": {
+ "table_name": "customer",
+ "access_type": "ref",
+ "possible_keys": ["PRIMARY", "i_c_nationkey"],
+ "key": "i_c_nationkey",
+ "key_length": "5",
+ "used_key_parts": ["c_nationkey"],
+ "ref": ["dbt3_s001.nation.n_nationkey"],
+ "loops": 1,
+ "rows": 6,
+ "cost": 0.008193756,
+ "filtered": 100
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "ref",
+ "possible_keys": ["i_o_orderdate", "i_o_custkey"],
+ "key": "i_o_custkey",
+ "key_length": "5",
+ "used_key_parts": ["o_custkey"],
+ "ref": ["dbt3_s001.customer.c_custkey"],
+ "rowid_filter": {
+ "range": {
+ "key": "i_o_orderdate",
+ "used_key_parts": ["o_orderDATE"]
+ },
+ "rows": 108,
+ "selectivity_pct": 7.2
+ },
+ "loops": 6,
+ "rows": 15,
+ "cost": 0.04205351,
+ "filtered": 7.199999809,
+ "attached_condition": "orders.o_orderDATE between '1992-01-01' and '1992-06-30'"
+ }
+ }
+ ]
+ }
+}
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+1729 12137.76
+2880 145761.99
+3142 16030.15
+5095 184583.99
+5121 150334.57
+5382 138423.03
+644 201268.06
+737 12984.85
+create table t as
+select * from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+explain
+delete from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6
+1 PRIMARY orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (7%) Using where; Using rowid filter
+explain format=json
+delete from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.052271677,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "nation",
+ "access_type": "ref",
+ "possible_keys": ["PRIMARY", "i_n_name"],
+ "key": "i_n_name",
+ "key_length": "26",
+ "used_key_parts": ["n_name"],
+ "ref": ["const"],
+ "loops": 1,
+ "rows": 1,
+ "cost": 0.002024411,
+ "filtered": 100,
+ "index_condition": "nation.n_name = 'PERU'"
+ }
+ },
+ {
+ "table": {
+ "table_name": "customer",
+ "access_type": "ref",
+ "possible_keys": ["PRIMARY", "i_c_nationkey"],
+ "key": "i_c_nationkey",
+ "key_length": "5",
+ "used_key_parts": ["c_nationkey"],
+ "ref": ["dbt3_s001.nation.n_nationkey"],
+ "loops": 1,
+ "rows": 6,
+ "cost": 0.008193756,
+ "filtered": 100
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "ref",
+ "possible_keys": ["i_o_orderdate", "i_o_custkey"],
+ "key": "i_o_custkey",
+ "key_length": "5",
+ "used_key_parts": ["o_custkey"],
+ "ref": ["dbt3_s001.customer.c_custkey"],
+ "rowid_filter": {
+ "range": {
+ "key": "i_o_orderdate",
+ "used_key_parts": ["o_orderDATE"]
+ },
+ "rows": 108,
+ "selectivity_pct": 7.2
+ },
+ "loops": 6,
+ "rows": 15,
+ "cost": 0.04205351,
+ "filtered": 7.199999809,
+ "attached_condition": "orders.o_orderDATE between '1992-01-01' and '1992-06-30'"
+ }
+ }
+ ]
+ }
+}
+delete from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+insert into orders select * from t;
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+1729 12137.76
+2880 145761.99
+3142 16030.15
+5095 184583.99
+5121 150334.57
+5382 138423.03
+644 201268.06
+737 12984.85
+drop table t;
+explain
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where (ps_partkey, ps_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 910 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1
+1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where (ps_partkey, ps_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 910 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+ps_partkey ps_suppkey ps_supplycost
+1 8 357.84
+3 8 645.4
+4 1 444.37
+5 8 50.52
+6 1 642.13
+7 8 763.98
+8 1 957.34
+create table t as
+select * from partsupp where (ps_partkey, ps_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 910 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+explain
+delete from partsupp where (ps_partkey, ps_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 910 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1
+1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 Using where
+1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1
+delete from partsupp where (ps_partkey, ps_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 910 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where (ps_partkey, ps_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 910 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+ps_partkey ps_suppkey ps_supplycost
+insert into partsupp select * from t;
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where (ps_partkey, ps_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 910 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+ps_partkey ps_suppkey ps_supplycost
+1 8 357.84
+3 8 645.4
+4 1 444.37
+5 8 50.52
+6 1 642.13
+7 8 763.98
+8 1 957.34
+drop table t;
+explain
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where ps_partkey in (select p_partkey from part
+where p_retailprice between 901 and 910) and
+ps_suppkey in (select s_suppkey from supplier
+where s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1
+1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where ps_partkey in (select p_partkey from part
+where p_retailprice between 901 and 910) and
+ps_suppkey in (select s_suppkey from supplier
+where s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+ps_partkey ps_suppkey ps_supplycost
+1 8 357.84
+3 8 645.4
+4 1 444.37
+5 8 50.52
+6 1 642.13
+7 8 763.98
+8 1 957.34
+create table t as
+select * from partsupp where ps_partkey in (select p_partkey from part
+where p_retailprice between 901 and 910) and
+ps_suppkey in (select s_suppkey from supplier
+where s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+explain
+delete from partsupp where ps_partkey in (select p_partkey from part
+where p_retailprice between 901 and 910) and
+ps_suppkey in (select s_suppkey from supplier
+where s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1
+1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 Using where
+1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1
+delete from partsupp where ps_partkey in (select p_partkey from part
+where p_retailprice between 901 and 910) and
+ps_suppkey in (select s_suppkey from supplier
+where s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where ps_partkey in (select p_partkey from part
+where p_retailprice between 901 and 910) and
+ps_suppkey in (select s_suppkey from supplier
+where s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+ps_partkey ps_suppkey ps_supplycost
+insert into partsupp select * from t;
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where ps_partkey in (select p_partkey from part
+where p_retailprice between 901 and 910) and
+ps_suppkey in (select s_suppkey from supplier
+where s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+ps_partkey ps_suppkey ps_supplycost
+1 8 357.84
+3 8 645.4
+4 1 444.37
+5 8 50.52
+6 1 642.13
+7 8 763.98
+8 1 957.34
+drop table t;
+explain
+select l_orderkey, l_linenumber, l_tax from lineitem where l_orderkey in (select o_orderkey from orders
+where o_custkey in
+(select c_custkey from customer
+where c_nationkey in
+(select n_nationkey from nation
+where n_name='PERU'))
+and
+o_orderDATE between '1992-06-30' and '1992-12-31')
+and
+(l_partkey, l_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 1000 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1
+1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6
+1 PRIMARY orders ref|filter PRIMARY,i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (7%) Using where; Using rowid filter
+1 PRIMARY lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where
+1 PRIMARY part eq_ref PRIMARY PRIMARY 4 dbt3_s001.lineitem.l_partkey 1 Using where
+select l_orderkey, l_linenumber, l_tax from lineitem where l_orderkey in (select o_orderkey from orders
+where o_custkey in
+(select c_custkey from customer
+where c_nationkey in
+(select n_nationkey from nation
+where n_name='PERU'))
+and
+o_orderDATE between '1992-06-30' and '1992-12-31')
+and
+(l_partkey, l_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 1000 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+l_orderkey l_linenumber l_tax
+2500 2 0.02
+2500 4 0.02
+4996 1 0.01
+933 1 0.04
+create table t as
+select * from lineitem where l_orderkey in (select o_orderkey from orders
+where o_custkey in
+(select c_custkey from customer
+where c_nationkey in
+(select n_nationkey from nation
+where n_name='PERU'))
+and
+o_orderDATE between '1992-06-30' and '1992-12-31')
+and
+(l_partkey, l_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 1000 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+explain
+delete from lineitem where l_orderkey in (select o_orderkey from orders
+where o_custkey in
+(select c_custkey from customer
+where c_nationkey in
+(select n_nationkey from nation
+where n_name='PERU'))
+and
+o_orderDATE between '1992-06-30' and '1992-12-31')
+and
+(l_partkey, l_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 1000 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1
+1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6
+1 PRIMARY orders ref|filter PRIMARY,i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (7%) Using where; Using rowid filter
+1 PRIMARY lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where
+1 PRIMARY part eq_ref PRIMARY PRIMARY 4 dbt3_s001.lineitem.l_partkey 1 Using where
+delete from lineitem where l_orderkey in (select o_orderkey from orders
+where o_custkey in
+(select c_custkey from customer
+where c_nationkey in
+(select n_nationkey from nation
+where n_name='PERU'))
+and
+o_orderDATE between '1992-06-30' and '1992-12-31')
+and
+(l_partkey, l_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 1000 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+select l_orderkey, l_linenumber, l_tax from lineitem where l_orderkey in (select o_orderkey from orders
+where o_custkey in
+(select c_custkey from customer
+where c_nationkey in
+(select n_nationkey from nation
+where n_name='PERU'))
+and
+o_orderDATE between '1992-06-30' and '1992-12-31')
+and
+(l_partkey, l_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 1000 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+l_orderkey l_linenumber l_tax
+insert into lineitem select * from t;
+select l_orderkey, l_linenumber, l_tax from lineitem where l_orderkey in (select o_orderkey from orders
+where o_custkey in
+(select c_custkey from customer
+where c_nationkey in
+(select n_nationkey from nation
+where n_name='PERU'))
+and
+o_orderDATE between '1992-06-30' and '1992-12-31')
+and
+(l_partkey, l_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 1000 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+l_orderkey l_linenumber l_tax
+2500 2 0.02
+2500 4 0.02
+4996 1 0.01
+933 1 0.04
+drop table t;
+# FirstMatch
+# ==========
+set optimizer_switch='materialization=off';
+explain
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ALL PRIMARY,i_n_regionkey NULL NULL NULL 25 Using where
+1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6
+1 PRIMARY orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (9%) Using where; FirstMatch(customer); Using rowid filter
+explain format=json
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.40015207,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "nation",
+ "access_type": "ALL",
+ "possible_keys": ["PRIMARY", "i_n_regionkey"],
+ "loops": 1,
+ "rows": 25,
+ "cost": 0.013945725,
+ "filtered": 40,
+ "attached_condition": "nation.n_regionkey in (1,2)"
+ }
+ },
+ {
+ "table": {
+ "table_name": "customer",
+ "access_type": "ref",
+ "possible_keys": ["PRIMARY", "i_c_nationkey"],
+ "key": "i_c_nationkey",
+ "key_length": "5",
+ "used_key_parts": ["c_nationkey"],
+ "ref": ["dbt3_s001.nation.n_nationkey"],
+ "loops": 10,
+ "rows": 6,
+ "cost": 0.08009436,
+ "filtered": 100
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "ref",
+ "possible_keys": ["i_o_orderdate", "i_o_custkey"],
+ "key": "i_o_custkey",
+ "key_length": "5",
+ "used_key_parts": ["o_custkey"],
+ "ref": ["dbt3_s001.customer.c_custkey"],
+ "rowid_filter": {
+ "range": {
+ "key": "i_o_orderdate",
+ "used_key_parts": ["o_orderDATE"]
+ },
+ "rows": 140,
+ "selectivity_pct": 9.333333333
+ },
+ "loops": 60,
+ "rows": 15,
+ "cost": 0.306111985,
+ "filtered": 6.666666508,
+ "attached_condition": "orders.o_orderDATE between '1992-10-09' and '1993-06-08'",
+ "first_match": "customer"
+ }
+ }
+ ]
+ }
+}
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000037 -917.75
+Customer#000000040 1335.3
+Customer#000000047 274.58
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000064 -646.64
+Customer#000000067 8166.59
+Customer#000000077 1738.87
+Customer#000000082 9468.34
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000097 2164.48
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000106 3288.42
+Customer#000000115 7508.92
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000124 1842.49
+Customer#000000127 9280.71
+Customer#000000130 5073.58
+Customer#000000133 2314.67
+Customer#000000139 7897.78
+Customer#000000142 2209.81
+create table t as
+select * from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+explain
+delete from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ALL PRIMARY,i_n_regionkey NULL NULL NULL 25 Using where
+1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6
+1 PRIMARY orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (9%) Using where; FirstMatch(customer); Using rowid filter
+explain format=json
+delete from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.40015207,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "nation",
+ "access_type": "ALL",
+ "possible_keys": ["PRIMARY", "i_n_regionkey"],
+ "loops": 1,
+ "rows": 25,
+ "cost": 0.013945725,
+ "filtered": 40,
+ "attached_condition": "nation.n_regionkey in (1,2)"
+ }
+ },
+ {
+ "table": {
+ "table_name": "customer",
+ "access_type": "ref",
+ "possible_keys": ["PRIMARY", "i_c_nationkey"],
+ "key": "i_c_nationkey",
+ "key_length": "5",
+ "used_key_parts": ["c_nationkey"],
+ "ref": ["dbt3_s001.nation.n_nationkey"],
+ "loops": 10,
+ "rows": 6,
+ "cost": 0.08009436,
+ "filtered": 100
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "ref",
+ "possible_keys": ["i_o_orderdate", "i_o_custkey"],
+ "key": "i_o_custkey",
+ "key_length": "5",
+ "used_key_parts": ["o_custkey"],
+ "ref": ["dbt3_s001.customer.c_custkey"],
+ "rowid_filter": {
+ "range": {
+ "key": "i_o_orderdate",
+ "used_key_parts": ["o_orderDATE"]
+ },
+ "rows": 140,
+ "selectivity_pct": 9.333333333
+ },
+ "loops": 60,
+ "rows": 15,
+ "cost": 0.306111985,
+ "filtered": 6.666666508,
+ "attached_condition": "orders.o_orderDATE between '1992-10-09' and '1993-06-08'",
+ "first_match": "customer"
+ }
+ }
+ ]
+ }
+}
+delete from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+insert into customer select * from t;
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000037 -917.75
+Customer#000000040 1335.3
+Customer#000000047 274.58
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000064 -646.64
+Customer#000000067 8166.59
+Customer#000000077 1738.87
+Customer#000000082 9468.34
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000097 2164.48
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000106 3288.42
+Customer#000000115 7508.92
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000124 1842.49
+Customer#000000127 9280.71
+Customer#000000130 5073.58
+Customer#000000133 2314.67
+Customer#000000139 7897.78
+Customer#000000142 2209.81
+drop table t;
+set optimizer_switch='materialization=default';
+explain
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation where n_name='PERU')
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1993-01-08");
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6
+1 PRIMARY orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (14%) Using where; FirstMatch(customer); Using rowid filter
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation where n_name='PERU')
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1993-01-08");
+c_name c_acctbal
+Customer#000000008 6819.74
+Customer#000000035 1228.24
+Customer#000000061 1536.24
+Customer#000000097 2164.48
+Customer#000000121 6428.32
+Customer#000000133 2314.67
+create table t as
+select * from customer where c_nationkey in (select n_nationkey from nation where n_name='PERU')
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1993-01-08");
+explain
+delete from customer where c_nationkey in (select n_nationkey from nation where n_name='PERU')
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1993-01-08");
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6
+1 PRIMARY orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (14%) Using where; FirstMatch(customer); Using rowid filter
+delete from customer where c_nationkey in (select n_nationkey from nation where n_name='PERU')
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1993-01-08");
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation where n_name='PERU')
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1993-01-08");
+c_name c_acctbal
+insert into customer select * from t;
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation where n_name='PERU')
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1993-01-08");
+c_name c_acctbal
+Customer#000000008 6819.74
+Customer#000000035 1228.24
+Customer#000000061 1536.24
+Customer#000000097 2164.48
+Customer#000000121 6428.32
+Customer#000000133 2314.67
+drop table t;
+# Materialization
+# ===============
+set optimizer_switch='firstmatch=off';
+explain
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation where
+n_name in ('JAPAN', 'INDONESIA', 'PERU', 'ARGENTINA'))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1995-01-08");
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation range PRIMARY,i_n_name i_n_name 26 NULL 4 Using index condition
+1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6
+1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1
+3 MATERIALIZED orders ALL i_o_orderdate,i_o_custkey NULL NULL NULL 1500 Using where
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation where
+n_name in ('JAPAN', 'INDONESIA', 'PERU', 'ARGENTINA'))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1995-01-08");
+c_name c_acctbal
+Customer#000000008 6819.74
+Customer#000000014 5266.3
+Customer#000000025 7133.7
+Customer#000000035 1228.24
+Customer#000000038 6345.11
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000067 8166.59
+Customer#000000077 1738.87
+Customer#000000094 5500.11
+Customer#000000097 2164.48
+Customer#000000098 -551.37
+Customer#000000103 2757.45
+Customer#000000106 3288.42
+Customer#000000113 2912
+Customer#000000121 6428.32
+Customer#000000130 5073.58
+Customer#000000133 2314.67
+Customer#000000139 7897.78
+Customer#000000142 2209.81
+create table t as
+select * from customer where c_nationkey in (select n_nationkey from nation where
+n_name in ('JAPAN', 'INDONESIA', 'PERU', 'ARGENTINA'))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1995-01-08");
+explain
+delete from customer where c_nationkey in (select n_nationkey from nation where
+n_name in ('JAPAN', 'INDONESIA', 'PERU', 'ARGENTINA'))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1995-01-08");
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation range PRIMARY,i_n_name i_n_name 26 NULL 4 Using index condition
+1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6
+1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1
+3 MATERIALIZED orders ALL i_o_orderdate,i_o_custkey NULL NULL NULL 1500 Using where
+delete from customer where c_nationkey in (select n_nationkey from nation where
+n_name in ('JAPAN', 'INDONESIA', 'PERU', 'ARGENTINA'))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1995-01-08");
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation where
+n_name in ('JAPAN', 'INDONESIA', 'PERU', 'ARGENTINA'))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1995-01-08");
+c_name c_acctbal
+insert into customer select * from t;
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation where
+n_name in ('JAPAN', 'INDONESIA', 'PERU', 'ARGENTINA'))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1995-01-08");
+c_name c_acctbal
+Customer#000000008 6819.74
+Customer#000000014 5266.3
+Customer#000000025 7133.7
+Customer#000000035 1228.24
+Customer#000000038 6345.11
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000067 8166.59
+Customer#000000077 1738.87
+Customer#000000094 5500.11
+Customer#000000097 2164.48
+Customer#000000098 -551.37
+Customer#000000103 2757.45
+Customer#000000106 3288.42
+Customer#000000113 2912
+Customer#000000121 6428.32
+Customer#000000130 5073.58
+Customer#000000133 2314.67
+Customer#000000139 7897.78
+Customer#000000142 2209.81
+drop table t;
+set optimizer_switch='firstmatch=default';
+explain
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY customer ALL PRIMARY NULL NULL NULL 150
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED orders ALL i_o_orderdate,i_o_custkey NULL NULL NULL 1500 Using where
+explain format=json
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.382051418,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "customer",
+ "access_type": "ALL",
+ "possible_keys": ["PRIMARY"],
+ "loops": 1,
+ "rows": 150,
+ "cost": 0.03493875,
+ "filtered": 100
+ }
+ },
+ {
+ "table": {
+ "table_name": "<subquery2>",
+ "access_type": "eq_ref",
+ "possible_keys": ["distinct_key"],
+ "key": "distinct_key",
+ "key_length": "4",
+ "used_key_parts": ["o_custkey"],
+ "ref": ["func"],
+ "rows": 1,
+ "filtered": 100,
+ "materialized": {
+ "unique": 1,
+ "query_block": {
+ "select_id": 2,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "ALL",
+ "possible_keys": ["i_o_orderdate", "i_o_custkey"],
+ "loops": 1,
+ "rows": 1500,
+ "cost": 0.2532975,
+ "filtered": 16.13333321,
+ "attached_condition": "orders.o_orderDATE between '1992-01-09' and '1993-03-08'"
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ ]
+ }
+}
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+Customer#000000001 711.56
+Customer#000000002 121.65
+Customer#000000005 794.47
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000010 2753.54
+Customer#000000011 -272.6
+Customer#000000013 3857.34
+Customer#000000014 5266.3
+Customer#000000016 4681.03
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000023 3332.02
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000029 7618.27
+Customer#000000031 5236.89
+Customer#000000032 3471.53
+Customer#000000034 8589.7
+Customer#000000035 1228.24
+Customer#000000037 -917.75
+Customer#000000038 6345.11
+Customer#000000040 1335.3
+Customer#000000041 270.95
+Customer#000000043 9904.28
+Customer#000000044 7315.94
+Customer#000000046 5744.59
+Customer#000000047 274.58
+Customer#000000049 4573.94
+Customer#000000052 5630.28
+Customer#000000053 4113.64
+Customer#000000055 4572.11
+Customer#000000056 6530.86
+Customer#000000058 6478.46
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000062 595.61
+Customer#000000064 -646.64
+Customer#000000065 8795.16
+Customer#000000067 8166.59
+Customer#000000070 4867.52
+Customer#000000071 -611.19
+Customer#000000073 4288.5
+Customer#000000074 2764.43
+Customer#000000076 5745.33
+Customer#000000079 5121.28
+Customer#000000080 7383.53
+Customer#000000082 9468.34
+Customer#000000083 6463.51
+Customer#000000085 3386.64
+Customer#000000086 3306.32
+Customer#000000088 8031.44
+Customer#000000089 1530.76
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000095 5327.38
+Customer#000000097 2164.48
+Customer#000000098 -551.37
+Customer#000000100 9889.89
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000104 -588.38
+Customer#000000106 3288.42
+Customer#000000107 2514.15
+Customer#000000109 -716.1
+Customer#000000110 7462.99
+Customer#000000112 2953.35
+Customer#000000115 7508.92
+Customer#000000116 8403.99
+Customer#000000118 3582.37
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000127 9280.71
+Customer#000000128 -986.96
+Customer#000000130 5073.58
+Customer#000000131 8595.53
+Customer#000000133 2314.67
+Customer#000000134 4608.9
+Customer#000000136 -842.39
+Customer#000000137 7838.3
+Customer#000000139 7897.78
+Customer#000000140 9963.15
+Customer#000000142 2209.81
+Customer#000000143 2186.5
+Customer#000000145 9748.93
+Customer#000000148 2135.6
+Customer#000000149 8959.65
+create table t as
+select * from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+explain
+delete from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY customer ALL PRIMARY NULL NULL NULL 150
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED orders ALL i_o_orderdate,i_o_custkey NULL NULL NULL 1500 Using where
+explain format=json
+delete from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.37364371,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "customer",
+ "access_type": "ALL",
+ "possible_keys": ["PRIMARY"],
+ "loops": 1,
+ "rows": 150,
+ "cost": 0.026531042,
+ "filtered": 100
+ }
+ },
+ {
+ "table": {
+ "table_name": "<subquery2>",
+ "access_type": "eq_ref",
+ "possible_keys": ["distinct_key"],
+ "key": "distinct_key",
+ "key_length": "4",
+ "used_key_parts": ["o_custkey"],
+ "ref": ["func"],
+ "rows": 1,
+ "filtered": 100,
+ "materialized": {
+ "unique": 1,
+ "query_block": {
+ "select_id": 2,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "ALL",
+ "possible_keys": ["i_o_orderdate", "i_o_custkey"],
+ "loops": 1,
+ "rows": 1500,
+ "cost": 0.2532975,
+ "filtered": 16.13333321,
+ "attached_condition": "orders.o_orderDATE between '1992-01-09' and '1993-03-08'"
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ ]
+ }
+}
+delete from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+insert into customer select * from t;
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+Customer#000000001 711.56
+Customer#000000002 121.65
+Customer#000000005 794.47
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000010 2753.54
+Customer#000000011 -272.6
+Customer#000000013 3857.34
+Customer#000000014 5266.3
+Customer#000000016 4681.03
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000023 3332.02
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000029 7618.27
+Customer#000000031 5236.89
+Customer#000000032 3471.53
+Customer#000000034 8589.7
+Customer#000000035 1228.24
+Customer#000000037 -917.75
+Customer#000000038 6345.11
+Customer#000000040 1335.3
+Customer#000000041 270.95
+Customer#000000043 9904.28
+Customer#000000044 7315.94
+Customer#000000046 5744.59
+Customer#000000047 274.58
+Customer#000000049 4573.94
+Customer#000000052 5630.28
+Customer#000000053 4113.64
+Customer#000000055 4572.11
+Customer#000000056 6530.86
+Customer#000000058 6478.46
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000062 595.61
+Customer#000000064 -646.64
+Customer#000000065 8795.16
+Customer#000000067 8166.59
+Customer#000000070 4867.52
+Customer#000000071 -611.19
+Customer#000000073 4288.5
+Customer#000000074 2764.43
+Customer#000000076 5745.33
+Customer#000000079 5121.28
+Customer#000000080 7383.53
+Customer#000000082 9468.34
+Customer#000000083 6463.51
+Customer#000000085 3386.64
+Customer#000000086 3306.32
+Customer#000000088 8031.44
+Customer#000000089 1530.76
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000095 5327.38
+Customer#000000097 2164.48
+Customer#000000098 -551.37
+Customer#000000100 9889.89
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000104 -588.38
+Customer#000000106 3288.42
+Customer#000000107 2514.15
+Customer#000000109 -716.1
+Customer#000000110 7462.99
+Customer#000000112 2953.35
+Customer#000000115 7508.92
+Customer#000000116 8403.99
+Customer#000000118 3582.37
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000127 9280.71
+Customer#000000128 -986.96
+Customer#000000130 5073.58
+Customer#000000131 8595.53
+Customer#000000133 2314.67
+Customer#000000134 4608.9
+Customer#000000136 -842.39
+Customer#000000137 7838.3
+Customer#000000139 7897.78
+Customer#000000140 9963.15
+Customer#000000142 2209.81
+Customer#000000143 2186.5
+Customer#000000145 9748.93
+Customer#000000148 2135.6
+Customer#000000149 8959.65
+drop table t;
+explain
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-06-09' and '1993-01-08');
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY customer ALL PRIMARY NULL NULL NULL 150
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED orders range i_o_orderdate,i_o_custkey i_o_orderdate 4 NULL 114 Using index condition; Using where
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-06-09' and '1993-01-08');
+c_name c_acctbal
+Customer#000000001 711.56
+Customer#000000002 121.65
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000010 2753.54
+Customer#000000011 -272.6
+Customer#000000016 4681.03
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000023 3332.02
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000029 7618.27
+Customer#000000031 5236.89
+Customer#000000034 8589.7
+Customer#000000037 -917.75
+Customer#000000040 1335.3
+Customer#000000043 9904.28
+Customer#000000044 7315.94
+Customer#000000046 5744.59
+Customer#000000047 274.58
+Customer#000000049 4573.94
+Customer#000000053 4113.64
+Customer#000000055 4572.11
+Customer#000000061 1536.24
+Customer#000000064 -646.64
+Customer#000000067 8166.59
+Customer#000000070 4867.52
+Customer#000000071 -611.19
+Customer#000000073 4288.5
+Customer#000000074 2764.43
+Customer#000000076 5745.33
+Customer#000000079 5121.28
+Customer#000000080 7383.53
+Customer#000000082 9468.34
+Customer#000000083 6463.51
+Customer#000000085 3386.64
+Customer#000000086 3306.32
+Customer#000000088 8031.44
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000095 5327.38
+Customer#000000097 2164.48
+Customer#000000100 9889.89
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000104 -588.38
+Customer#000000106 3288.42
+Customer#000000109 -716.1
+Customer#000000110 7462.99
+Customer#000000112 2953.35
+Customer#000000118 3582.37
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000127 9280.71
+Customer#000000130 5073.58
+Customer#000000131 8595.53
+Customer#000000133 2314.67
+Customer#000000134 4608.9
+Customer#000000136 -842.39
+Customer#000000137 7838.3
+Customer#000000139 7897.78
+Customer#000000142 2209.81
+Customer#000000143 2186.5
+Customer#000000148 2135.6
+Customer#000000149 8959.65
+create table t as
+select * from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-06-09' and '1993-01-08');
+explain
+delete from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-06-09' and '1993-01-08');
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY customer ALL PRIMARY NULL NULL NULL 150
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED orders range i_o_orderdate,i_o_custkey i_o_orderdate 4 NULL 114 Using index condition; Using where
+delete from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-06-09' and '1993-01-08');
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-06-09' and '1993-01-08');
+c_name c_acctbal
+insert into customer select * from t;
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-06-09' and '1993-01-08');
+c_name c_acctbal
+Customer#000000001 711.56
+Customer#000000002 121.65
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000010 2753.54
+Customer#000000011 -272.6
+Customer#000000016 4681.03
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000023 3332.02
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000029 7618.27
+Customer#000000031 5236.89
+Customer#000000034 8589.7
+Customer#000000037 -917.75
+Customer#000000040 1335.3
+Customer#000000043 9904.28
+Customer#000000044 7315.94
+Customer#000000046 5744.59
+Customer#000000047 274.58
+Customer#000000049 4573.94
+Customer#000000053 4113.64
+Customer#000000055 4572.11
+Customer#000000061 1536.24
+Customer#000000064 -646.64
+Customer#000000067 8166.59
+Customer#000000070 4867.52
+Customer#000000071 -611.19
+Customer#000000073 4288.5
+Customer#000000074 2764.43
+Customer#000000076 5745.33
+Customer#000000079 5121.28
+Customer#000000080 7383.53
+Customer#000000082 9468.34
+Customer#000000083 6463.51
+Customer#000000085 3386.64
+Customer#000000086 3306.32
+Customer#000000088 8031.44
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000095 5327.38
+Customer#000000097 2164.48
+Customer#000000100 9889.89
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000104 -588.38
+Customer#000000106 3288.42
+Customer#000000109 -716.1
+Customer#000000110 7462.99
+Customer#000000112 2953.35
+Customer#000000118 3582.37
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000127 9280.71
+Customer#000000130 5073.58
+Customer#000000131 8595.53
+Customer#000000133 2314.67
+Customer#000000134 4608.9
+Customer#000000136 -842.39
+Customer#000000137 7838.3
+Customer#000000139 7897.78
+Customer#000000142 2209.81
+Customer#000000143 2186.5
+Customer#000000148 2135.6
+Customer#000000149 8959.65
+drop table t;
+# Materialization SJM
+# ===================
+explain
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 28
+1 PRIMARY customer eq_ref PRIMARY PRIMARY 4 <subquery2>.o_custkey 1
+2 MATERIALIZED orders range i_o_orderdate i_o_orderdate 4 NULL 28 Using index condition; Using temporary
+explain format=json
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.085533248,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "<subquery2>",
+ "access_type": "ALL",
+ "possible_keys": ["distinct_key"],
+ "loops": 1,
+ "rows": 28,
+ "cost": 0.03691572,
+ "filtered": 100,
+ "materialized": {
+ "unique": 1,
+ "query_block": {
+ "select_id": 2,
+ "cost": 0.053826401,
+ "having_condition": "count(orders.o_custkey) > 1",
+ "temporary_table": {
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "range",
+ "possible_keys": ["i_o_orderdate"],
+ "key": "i_o_orderdate",
+ "key_length": "4",
+ "used_key_parts": ["o_orderDATE"],
+ "loops": 1,
+ "rows": 28,
+ "cost": 0.035889016,
+ "filtered": 100,
+ "index_condition": "orders.o_orderDATE between '1992-01-09' and '1992-03-08'"
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ {
+ "table": {
+ "table_name": "customer",
+ "access_type": "eq_ref",
+ "possible_keys": ["PRIMARY"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["c_custkey"],
+ "ref": ["<subquery2>.o_custkey"],
+ "loops": 28,
+ "rows": 1,
+ "cost": 0.048617528,
+ "filtered": 100
+ }
+ }
+ ]
+ }
+}
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+Customer#000000013 3857.34
+Customer#000000032 3471.53
+Customer#000000037 -917.75
+Customer#000000056 6530.86
+Customer#000000118 3582.37
+create table t as
+select * from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+explain
+delete from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 28
+1 PRIMARY customer eq_ref PRIMARY PRIMARY 4 <subquery2>.o_custkey 1
+2 MATERIALIZED orders range i_o_orderdate i_o_orderdate 4 NULL 28 Using index condition; Using temporary
+explain format=json
+delete from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.054856476,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "<subquery2>",
+ "access_type": "ALL",
+ "possible_keys": ["distinct_key"],
+ "loops": 1,
+ "rows": 28,
+ "cost": 0.03691572,
+ "filtered": 100,
+ "materialized": {
+ "unique": 1,
+ "query_block": {
+ "select_id": 2,
+ "cost": 0.053826401,
+ "having_condition": "count(orders.o_custkey) > 1",
+ "temporary_table": {
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "range",
+ "possible_keys": ["i_o_orderdate"],
+ "key": "i_o_orderdate",
+ "key_length": "4",
+ "used_key_parts": ["o_orderDATE"],
+ "loops": 1,
+ "rows": 28,
+ "cost": 0.035889016,
+ "filtered": 100,
+ "index_condition": "orders.o_orderDATE between '1992-01-09' and '1992-03-08'"
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ {
+ "table": {
+ "table_name": "customer",
+ "access_type": "eq_ref",
+ "possible_keys": ["PRIMARY"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["c_custkey"],
+ "ref": ["<subquery2>.o_custkey"],
+ "loops": 28,
+ "rows": 1,
+ "cost": 0.017940756,
+ "filtered": 100
+ }
+ }
+ ]
+ }
+}
+delete from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+insert into customer select * from t;
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+Customer#000000013 3857.34
+Customer#000000032 3471.53
+Customer#000000037 -917.75
+Customer#000000056 6530.86
+Customer#000000118 3582.37
+drop table t;
+explain
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08'
+ group by o_custkey having count(o_custkey) > 5);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY customer ALL PRIMARY NULL NULL NULL 150
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 dbt3_s001.customer.c_custkey 1
+2 MATERIALIZED orders ALL i_o_orderdate NULL NULL NULL 1500 Using where; Using temporary
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08'
+ group by o_custkey having count(o_custkey) > 5);
+c_name c_acctbal
+Customer#000000007 9561.95
+Customer#000000016 4681.03
+Customer#000000037 -917.75
+Customer#000000046 5744.59
+Customer#000000091 4643.14
+Customer#000000103 2757.45
+Customer#000000118 3582.37
+Customer#000000133 2314.67
+Customer#000000134 4608.9
+create table t as
+select * from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08'
+ group by o_custkey having count(o_custkey) > 5);
+explain
+delete from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08'
+ group by o_custkey having count(o_custkey) > 5);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY customer ALL PRIMARY NULL NULL NULL 150
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 dbt3_s001.customer.c_custkey 1
+2 MATERIALIZED orders ALL i_o_orderdate NULL NULL NULL 1500 Using where; Using temporary
+delete from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08'
+ group by o_custkey having count(o_custkey) > 5);
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08'
+ group by o_custkey having count(o_custkey) > 5);
+c_name c_acctbal
+insert into customer select * from t;
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08'
+ group by o_custkey having count(o_custkey) > 5);
+c_name c_acctbal
+Customer#000000007 9561.95
+Customer#000000016 4681.03
+Customer#000000037 -917.75
+Customer#000000046 5744.59
+Customer#000000091 4643.14
+Customer#000000103 2757.45
+Customer#000000118 3582.37
+Customer#000000133 2314.67
+Customer#000000134 4608.9
+drop table t;
+# Pullout PS
+# ==========
+prepare stmt from "
+delete from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+";
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+1729 12137.76
+2880 145761.99
+3142 16030.15
+5095 184583.99
+5121 150334.57
+5382 138423.03
+644 201268.06
+737 12984.85
+create table t as
+select * from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+execute stmt;
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+insert into orders select * from t;
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+1729 12137.76
+2880 145761.99
+3142 16030.15
+5095 184583.99
+5121 150334.57
+5382 138423.03
+644 201268.06
+737 12984.85
+create table r as
+select * from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+execute stmt;
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+insert into orders select * from r;
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+1729 12137.76
+2880 145761.99
+3142 16030.15
+5095 184583.99
+5121 150334.57
+5382 138423.03
+644 201268.06
+737 12984.85
+drop table t,r;
+deallocate prepare stmt;
+# FirstMatch PS
+# =============
+set optimizer_switch='materialization=off';
+prepare stmt from "
+delete from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+";
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000037 -917.75
+Customer#000000040 1335.3
+Customer#000000047 274.58
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000064 -646.64
+Customer#000000067 8166.59
+Customer#000000077 1738.87
+Customer#000000082 9468.34
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000097 2164.48
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000106 3288.42
+Customer#000000115 7508.92
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000124 1842.49
+Customer#000000127 9280.71
+Customer#000000130 5073.58
+Customer#000000133 2314.67
+Customer#000000139 7897.78
+Customer#000000142 2209.81
+create table t as
+select * from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+execute stmt;
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+insert into customer select * from t;
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000037 -917.75
+Customer#000000040 1335.3
+Customer#000000047 274.58
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000064 -646.64
+Customer#000000067 8166.59
+Customer#000000077 1738.87
+Customer#000000082 9468.34
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000097 2164.48
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000106 3288.42
+Customer#000000115 7508.92
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000124 1842.49
+Customer#000000127 9280.71
+Customer#000000130 5073.58
+Customer#000000133 2314.67
+Customer#000000139 7897.78
+Customer#000000142 2209.81
+create table r as
+select * from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+execute stmt;
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+insert into customer select * from r;
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000037 -917.75
+Customer#000000040 1335.3
+Customer#000000047 274.58
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000064 -646.64
+Customer#000000067 8166.59
+Customer#000000077 1738.87
+Customer#000000082 9468.34
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000097 2164.48
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000106 3288.42
+Customer#000000115 7508.92
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000124 1842.49
+Customer#000000127 9280.71
+Customer#000000130 5073.58
+Customer#000000133 2314.67
+Customer#000000139 7897.78
+Customer#000000142 2209.81
+drop table t,r;
+deallocate prepare stmt;
+set optimizer_switch='materialization=default';
+# Materialization PS
+# ==================
+prepare stmt from "
+delete from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08') and c_name like ?;
+";
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+Customer#000000001 711.56
+Customer#000000002 121.65
+Customer#000000005 794.47
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000010 2753.54
+Customer#000000011 -272.6
+Customer#000000013 3857.34
+Customer#000000014 5266.3
+Customer#000000016 4681.03
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000023 3332.02
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000029 7618.27
+Customer#000000031 5236.89
+Customer#000000032 3471.53
+Customer#000000034 8589.7
+Customer#000000035 1228.24
+Customer#000000037 -917.75
+Customer#000000038 6345.11
+Customer#000000040 1335.3
+Customer#000000041 270.95
+Customer#000000043 9904.28
+Customer#000000044 7315.94
+Customer#000000046 5744.59
+Customer#000000047 274.58
+Customer#000000049 4573.94
+Customer#000000052 5630.28
+Customer#000000053 4113.64
+Customer#000000055 4572.11
+Customer#000000056 6530.86
+Customer#000000058 6478.46
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000062 595.61
+Customer#000000064 -646.64
+Customer#000000065 8795.16
+Customer#000000067 8166.59
+Customer#000000070 4867.52
+Customer#000000071 -611.19
+Customer#000000073 4288.5
+Customer#000000074 2764.43
+Customer#000000076 5745.33
+Customer#000000079 5121.28
+Customer#000000080 7383.53
+Customer#000000082 9468.34
+Customer#000000083 6463.51
+Customer#000000085 3386.64
+Customer#000000086 3306.32
+Customer#000000088 8031.44
+Customer#000000089 1530.76
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000095 5327.38
+Customer#000000097 2164.48
+Customer#000000098 -551.37
+Customer#000000100 9889.89
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000104 -588.38
+Customer#000000106 3288.42
+Customer#000000107 2514.15
+Customer#000000109 -716.1
+Customer#000000110 7462.99
+Customer#000000112 2953.35
+Customer#000000115 7508.92
+Customer#000000116 8403.99
+Customer#000000118 3582.37
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000127 9280.71
+Customer#000000128 -986.96
+Customer#000000130 5073.58
+Customer#000000131 8595.53
+Customer#000000133 2314.67
+Customer#000000134 4608.9
+Customer#000000136 -842.39
+Customer#000000137 7838.3
+Customer#000000139 7897.78
+Customer#000000140 9963.15
+Customer#000000142 2209.81
+Customer#000000143 2186.5
+Customer#000000145 9748.93
+Customer#000000148 2135.6
+Customer#000000149 8959.65
+set @a1='Customer#%1_';
+create table t as
+select * from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08') and c_name like @a1;
+execute stmt using @a1;
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+Customer#000000001 711.56
+Customer#000000002 121.65
+Customer#000000005 794.47
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000022 591.98
+Customer#000000023 3332.02
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000029 7618.27
+Customer#000000031 5236.89
+Customer#000000032 3471.53
+Customer#000000034 8589.7
+Customer#000000035 1228.24
+Customer#000000037 -917.75
+Customer#000000038 6345.11
+Customer#000000040 1335.3
+Customer#000000041 270.95
+Customer#000000043 9904.28
+Customer#000000044 7315.94
+Customer#000000046 5744.59
+Customer#000000047 274.58
+Customer#000000049 4573.94
+Customer#000000052 5630.28
+Customer#000000053 4113.64
+Customer#000000055 4572.11
+Customer#000000056 6530.86
+Customer#000000058 6478.46
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000062 595.61
+Customer#000000064 -646.64
+Customer#000000065 8795.16
+Customer#000000067 8166.59
+Customer#000000070 4867.52
+Customer#000000071 -611.19
+Customer#000000073 4288.5
+Customer#000000074 2764.43
+Customer#000000076 5745.33
+Customer#000000079 5121.28
+Customer#000000080 7383.53
+Customer#000000082 9468.34
+Customer#000000083 6463.51
+Customer#000000085 3386.64
+Customer#000000086 3306.32
+Customer#000000088 8031.44
+Customer#000000089 1530.76
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000095 5327.38
+Customer#000000097 2164.48
+Customer#000000098 -551.37
+Customer#000000100 9889.89
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000104 -588.38
+Customer#000000106 3288.42
+Customer#000000107 2514.15
+Customer#000000109 -716.1
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000127 9280.71
+Customer#000000128 -986.96
+Customer#000000130 5073.58
+Customer#000000131 8595.53
+Customer#000000133 2314.67
+Customer#000000134 4608.9
+Customer#000000136 -842.39
+Customer#000000137 7838.3
+Customer#000000139 7897.78
+Customer#000000140 9963.15
+Customer#000000142 2209.81
+Customer#000000143 2186.5
+Customer#000000145 9748.93
+Customer#000000148 2135.6
+Customer#000000149 8959.65
+insert into customer select * from t;
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+Customer#000000001 711.56
+Customer#000000002 121.65
+Customer#000000005 794.47
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000010 2753.54
+Customer#000000011 -272.6
+Customer#000000013 3857.34
+Customer#000000014 5266.3
+Customer#000000016 4681.03
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000023 3332.02
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000029 7618.27
+Customer#000000031 5236.89
+Customer#000000032 3471.53
+Customer#000000034 8589.7
+Customer#000000035 1228.24
+Customer#000000037 -917.75
+Customer#000000038 6345.11
+Customer#000000040 1335.3
+Customer#000000041 270.95
+Customer#000000043 9904.28
+Customer#000000044 7315.94
+Customer#000000046 5744.59
+Customer#000000047 274.58
+Customer#000000049 4573.94
+Customer#000000052 5630.28
+Customer#000000053 4113.64
+Customer#000000055 4572.11
+Customer#000000056 6530.86
+Customer#000000058 6478.46
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000062 595.61
+Customer#000000064 -646.64
+Customer#000000065 8795.16
+Customer#000000067 8166.59
+Customer#000000070 4867.52
+Customer#000000071 -611.19
+Customer#000000073 4288.5
+Customer#000000074 2764.43
+Customer#000000076 5745.33
+Customer#000000079 5121.28
+Customer#000000080 7383.53
+Customer#000000082 9468.34
+Customer#000000083 6463.51
+Customer#000000085 3386.64
+Customer#000000086 3306.32
+Customer#000000088 8031.44
+Customer#000000089 1530.76
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000095 5327.38
+Customer#000000097 2164.48
+Customer#000000098 -551.37
+Customer#000000100 9889.89
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000104 -588.38
+Customer#000000106 3288.42
+Customer#000000107 2514.15
+Customer#000000109 -716.1
+Customer#000000110 7462.99
+Customer#000000112 2953.35
+Customer#000000115 7508.92
+Customer#000000116 8403.99
+Customer#000000118 3582.37
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000127 9280.71
+Customer#000000128 -986.96
+Customer#000000130 5073.58
+Customer#000000131 8595.53
+Customer#000000133 2314.67
+Customer#000000134 4608.9
+Customer#000000136 -842.39
+Customer#000000137 7838.3
+Customer#000000139 7897.78
+Customer#000000140 9963.15
+Customer#000000142 2209.81
+Customer#000000143 2186.5
+Customer#000000145 9748.93
+Customer#000000148 2135.6
+Customer#000000149 8959.65
+set @a2='Customer#%3_';
+create table r as
+select * from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08') and c_name like @a2;
+execute stmt using @a2;
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+Customer#000000001 711.56
+Customer#000000002 121.65
+Customer#000000005 794.47
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000010 2753.54
+Customer#000000011 -272.6
+Customer#000000013 3857.34
+Customer#000000014 5266.3
+Customer#000000016 4681.03
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000023 3332.02
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000029 7618.27
+Customer#000000040 1335.3
+Customer#000000041 270.95
+Customer#000000043 9904.28
+Customer#000000044 7315.94
+Customer#000000046 5744.59
+Customer#000000047 274.58
+Customer#000000049 4573.94
+Customer#000000052 5630.28
+Customer#000000053 4113.64
+Customer#000000055 4572.11
+Customer#000000056 6530.86
+Customer#000000058 6478.46
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000062 595.61
+Customer#000000064 -646.64
+Customer#000000065 8795.16
+Customer#000000067 8166.59
+Customer#000000070 4867.52
+Customer#000000071 -611.19
+Customer#000000073 4288.5
+Customer#000000074 2764.43
+Customer#000000076 5745.33
+Customer#000000079 5121.28
+Customer#000000080 7383.53
+Customer#000000082 9468.34
+Customer#000000083 6463.51
+Customer#000000085 3386.64
+Customer#000000086 3306.32
+Customer#000000088 8031.44
+Customer#000000089 1530.76
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000095 5327.38
+Customer#000000097 2164.48
+Customer#000000098 -551.37
+Customer#000000100 9889.89
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000104 -588.38
+Customer#000000106 3288.42
+Customer#000000107 2514.15
+Customer#000000109 -716.1
+Customer#000000110 7462.99
+Customer#000000112 2953.35
+Customer#000000115 7508.92
+Customer#000000116 8403.99
+Customer#000000118 3582.37
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000127 9280.71
+Customer#000000128 -986.96
+Customer#000000140 9963.15
+Customer#000000142 2209.81
+Customer#000000143 2186.5
+Customer#000000145 9748.93
+Customer#000000148 2135.6
+Customer#000000149 8959.65
+insert into customer select * from r;
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+Customer#000000001 711.56
+Customer#000000002 121.65
+Customer#000000005 794.47
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000010 2753.54
+Customer#000000011 -272.6
+Customer#000000013 3857.34
+Customer#000000014 5266.3
+Customer#000000016 4681.03
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000023 3332.02
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000029 7618.27
+Customer#000000031 5236.89
+Customer#000000032 3471.53
+Customer#000000034 8589.7
+Customer#000000035 1228.24
+Customer#000000037 -917.75
+Customer#000000038 6345.11
+Customer#000000040 1335.3
+Customer#000000041 270.95
+Customer#000000043 9904.28
+Customer#000000044 7315.94
+Customer#000000046 5744.59
+Customer#000000047 274.58
+Customer#000000049 4573.94
+Customer#000000052 5630.28
+Customer#000000053 4113.64
+Customer#000000055 4572.11
+Customer#000000056 6530.86
+Customer#000000058 6478.46
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000062 595.61
+Customer#000000064 -646.64
+Customer#000000065 8795.16
+Customer#000000067 8166.59
+Customer#000000070 4867.52
+Customer#000000071 -611.19
+Customer#000000073 4288.5
+Customer#000000074 2764.43
+Customer#000000076 5745.33
+Customer#000000079 5121.28
+Customer#000000080 7383.53
+Customer#000000082 9468.34
+Customer#000000083 6463.51
+Customer#000000085 3386.64
+Customer#000000086 3306.32
+Customer#000000088 8031.44
+Customer#000000089 1530.76
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000095 5327.38
+Customer#000000097 2164.48
+Customer#000000098 -551.37
+Customer#000000100 9889.89
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000104 -588.38
+Customer#000000106 3288.42
+Customer#000000107 2514.15
+Customer#000000109 -716.1
+Customer#000000110 7462.99
+Customer#000000112 2953.35
+Customer#000000115 7508.92
+Customer#000000116 8403.99
+Customer#000000118 3582.37
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000127 9280.71
+Customer#000000128 -986.96
+Customer#000000130 5073.58
+Customer#000000131 8595.53
+Customer#000000133 2314.67
+Customer#000000134 4608.9
+Customer#000000136 -842.39
+Customer#000000137 7838.3
+Customer#000000139 7897.78
+Customer#000000140 9963.15
+Customer#000000142 2209.81
+Customer#000000143 2186.5
+Customer#000000145 9748.93
+Customer#000000148 2135.6
+Customer#000000149 8959.65
+drop table t,r;
+deallocate prepare stmt;
+# Materialization SJM PS
+# ======================
+prepare stmt from "
+delete from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1) and c_acctbal between ? and ?;
+";
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+Customer#000000013 3857.34
+Customer#000000032 3471.53
+Customer#000000037 -917.75
+Customer#000000056 6530.86
+Customer#000000118 3582.37
+set @a1=3500;
+set @a2=4000;
+create table t as
+select * from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1) and c_acctbal between @a1 and @a2;
+execute stmt using @a1, @a2;
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+Customer#000000032 3471.53
+Customer#000000037 -917.75
+Customer#000000056 6530.86
+insert into customer select * from t;
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+Customer#000000013 3857.34
+Customer#000000032 3471.53
+Customer#000000037 -917.75
+Customer#000000056 6530.86
+Customer#000000118 3582.37
+set @a3=-1000;
+set @a4=3500;
+create table r as
+select * from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1) and c_acctbal between @a3 and @a4;
+execute stmt using @a3, @a4;
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+Customer#000000013 3857.34
+Customer#000000056 6530.86
+Customer#000000118 3582.37
+insert into customer select * from r;
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+Customer#000000013 3857.34
+Customer#000000032 3471.53
+Customer#000000037 -917.75
+Customer#000000056 6530.86
+Customer#000000118 3582.37
+drop table t,r;
+deallocate prepare stmt;
+# Pullout SP
+# ==========
+create procedure p(a1 int, a2 int)
+delete from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU')) and o_totalprice between a1 and a2;
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+1729 12137.76
+2880 145761.99
+3142 16030.15
+5095 184583.99
+5121 150334.57
+5382 138423.03
+644 201268.06
+737 12984.85
+create table t as
+select * from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU')) and o_totalprice between 150000 and 200000;
+call p(150000, 200000);
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+1729 12137.76
+2880 145761.99
+3142 16030.15
+5382 138423.03
+644 201268.06
+737 12984.85
+insert into orders select * from t;
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+1729 12137.76
+2880 145761.99
+3142 16030.15
+5095 184583.99
+5121 150334.57
+5382 138423.03
+644 201268.06
+737 12984.85
+create table r as
+select * from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU')) and o_totalprice between 180000 and 210000;
+call p(180000, 210000);
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+1729 12137.76
+2880 145761.99
+3142 16030.15
+5121 150334.57
+5382 138423.03
+737 12984.85
+insert into orders select * from r;
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+1729 12137.76
+2880 145761.99
+3142 16030.15
+5095 184583.99
+5121 150334.57
+5382 138423.03
+644 201268.06
+737 12984.85
+drop table t,r;
+drop procedure p;
+# FirstMatch SP
+# =============
+set optimizer_switch='materialization=off';
+create procedure p(a int)
+delete from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08') and c_acctbal > a;
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000037 -917.75
+Customer#000000040 1335.3
+Customer#000000047 274.58
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000064 -646.64
+Customer#000000067 8166.59
+Customer#000000077 1738.87
+Customer#000000082 9468.34
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000097 2164.48
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000106 3288.42
+Customer#000000115 7508.92
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000124 1842.49
+Customer#000000127 9280.71
+Customer#000000130 5073.58
+Customer#000000133 2314.67
+Customer#000000139 7897.78
+Customer#000000142 2209.81
+create table t as
+select * from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08') and c_acctbal > 4000;
+call p(4000);
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+Customer#000000017 6.34
+Customer#000000022 591.98
+Customer#000000028 1007.18
+Customer#000000037 -917.75
+Customer#000000040 1335.3
+Customer#000000047 274.58
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000064 -646.64
+Customer#000000077 1738.87
+Customer#000000092 1182.91
+Customer#000000097 2164.48
+Customer#000000103 2757.45
+Customer#000000106 3288.42
+Customer#000000124 1842.49
+Customer#000000133 2314.67
+Customer#000000142 2209.81
+insert into customer select * from t;
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000037 -917.75
+Customer#000000040 1335.3
+Customer#000000047 274.58
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000064 -646.64
+Customer#000000067 8166.59
+Customer#000000077 1738.87
+Customer#000000082 9468.34
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000097 2164.48
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000106 3288.42
+Customer#000000115 7508.92
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000124 1842.49
+Customer#000000127 9280.71
+Customer#000000130 5073.58
+Customer#000000133 2314.67
+Customer#000000139 7897.78
+Customer#000000142 2209.81
+create table r as
+select * from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08') and c_acctbal > 2000;
+call p(2000);
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+Customer#000000017 6.34
+Customer#000000022 591.98
+Customer#000000028 1007.18
+Customer#000000037 -917.75
+Customer#000000040 1335.3
+Customer#000000047 274.58
+Customer#000000061 1536.24
+Customer#000000064 -646.64
+Customer#000000077 1738.87
+Customer#000000092 1182.91
+Customer#000000124 1842.49
+insert into customer select * from r;
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000037 -917.75
+Customer#000000040 1335.3
+Customer#000000047 274.58
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000064 -646.64
+Customer#000000067 8166.59
+Customer#000000077 1738.87
+Customer#000000082 9468.34
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000097 2164.48
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000106 3288.42
+Customer#000000115 7508.92
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000124 1842.49
+Customer#000000127 9280.71
+Customer#000000130 5073.58
+Customer#000000133 2314.67
+Customer#000000139 7897.78
+Customer#000000142 2209.81
+drop table t,r;
+drop procedure p;
+set optimizer_switch='materialization=default';
+# Materialization SP
+# ==================
+create procedure p()
+delete from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+Customer#000000001 711.56
+Customer#000000002 121.65
+Customer#000000005 794.47
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000010 2753.54
+Customer#000000011 -272.6
+Customer#000000013 3857.34
+Customer#000000014 5266.3
+Customer#000000016 4681.03
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000023 3332.02
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000029 7618.27
+Customer#000000031 5236.89
+Customer#000000032 3471.53
+Customer#000000034 8589.7
+Customer#000000035 1228.24
+Customer#000000037 -917.75
+Customer#000000038 6345.11
+Customer#000000040 1335.3
+Customer#000000041 270.95
+Customer#000000043 9904.28
+Customer#000000044 7315.94
+Customer#000000046 5744.59
+Customer#000000047 274.58
+Customer#000000049 4573.94
+Customer#000000052 5630.28
+Customer#000000053 4113.64
+Customer#000000055 4572.11
+Customer#000000056 6530.86
+Customer#000000058 6478.46
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000062 595.61
+Customer#000000064 -646.64
+Customer#000000065 8795.16
+Customer#000000067 8166.59
+Customer#000000070 4867.52
+Customer#000000071 -611.19
+Customer#000000073 4288.5
+Customer#000000074 2764.43
+Customer#000000076 5745.33
+Customer#000000079 5121.28
+Customer#000000080 7383.53
+Customer#000000082 9468.34
+Customer#000000083 6463.51
+Customer#000000085 3386.64
+Customer#000000086 3306.32
+Customer#000000088 8031.44
+Customer#000000089 1530.76
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000095 5327.38
+Customer#000000097 2164.48
+Customer#000000098 -551.37
+Customer#000000100 9889.89
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000104 -588.38
+Customer#000000106 3288.42
+Customer#000000107 2514.15
+Customer#000000109 -716.1
+Customer#000000110 7462.99
+Customer#000000112 2953.35
+Customer#000000115 7508.92
+Customer#000000116 8403.99
+Customer#000000118 3582.37
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000127 9280.71
+Customer#000000128 -986.96
+Customer#000000130 5073.58
+Customer#000000131 8595.53
+Customer#000000133 2314.67
+Customer#000000134 4608.9
+Customer#000000136 -842.39
+Customer#000000137 7838.3
+Customer#000000139 7897.78
+Customer#000000140 9963.15
+Customer#000000142 2209.81
+Customer#000000143 2186.5
+Customer#000000145 9748.93
+Customer#000000148 2135.6
+Customer#000000149 8959.65
+create table t as
+select * from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+call p();
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+insert into customer select * from t;
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+Customer#000000001 711.56
+Customer#000000002 121.65
+Customer#000000005 794.47
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000010 2753.54
+Customer#000000011 -272.6
+Customer#000000013 3857.34
+Customer#000000014 5266.3
+Customer#000000016 4681.03
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000023 3332.02
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000029 7618.27
+Customer#000000031 5236.89
+Customer#000000032 3471.53
+Customer#000000034 8589.7
+Customer#000000035 1228.24
+Customer#000000037 -917.75
+Customer#000000038 6345.11
+Customer#000000040 1335.3
+Customer#000000041 270.95
+Customer#000000043 9904.28
+Customer#000000044 7315.94
+Customer#000000046 5744.59
+Customer#000000047 274.58
+Customer#000000049 4573.94
+Customer#000000052 5630.28
+Customer#000000053 4113.64
+Customer#000000055 4572.11
+Customer#000000056 6530.86
+Customer#000000058 6478.46
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000062 595.61
+Customer#000000064 -646.64
+Customer#000000065 8795.16
+Customer#000000067 8166.59
+Customer#000000070 4867.52
+Customer#000000071 -611.19
+Customer#000000073 4288.5
+Customer#000000074 2764.43
+Customer#000000076 5745.33
+Customer#000000079 5121.28
+Customer#000000080 7383.53
+Customer#000000082 9468.34
+Customer#000000083 6463.51
+Customer#000000085 3386.64
+Customer#000000086 3306.32
+Customer#000000088 8031.44
+Customer#000000089 1530.76
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000095 5327.38
+Customer#000000097 2164.48
+Customer#000000098 -551.37
+Customer#000000100 9889.89
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000104 -588.38
+Customer#000000106 3288.42
+Customer#000000107 2514.15
+Customer#000000109 -716.1
+Customer#000000110 7462.99
+Customer#000000112 2953.35
+Customer#000000115 7508.92
+Customer#000000116 8403.99
+Customer#000000118 3582.37
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000127 9280.71
+Customer#000000128 -986.96
+Customer#000000130 5073.58
+Customer#000000131 8595.53
+Customer#000000133 2314.67
+Customer#000000134 4608.9
+Customer#000000136 -842.39
+Customer#000000137 7838.3
+Customer#000000139 7897.78
+Customer#000000140 9963.15
+Customer#000000142 2209.81
+Customer#000000143 2186.5
+Customer#000000145 9748.93
+Customer#000000148 2135.6
+Customer#000000149 8959.65
+create table r as
+select * from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+call p();
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+insert into customer select * from r;
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+Customer#000000001 711.56
+Customer#000000002 121.65
+Customer#000000005 794.47
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000010 2753.54
+Customer#000000011 -272.6
+Customer#000000013 3857.34
+Customer#000000014 5266.3
+Customer#000000016 4681.03
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000023 3332.02
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000029 7618.27
+Customer#000000031 5236.89
+Customer#000000032 3471.53
+Customer#000000034 8589.7
+Customer#000000035 1228.24
+Customer#000000037 -917.75
+Customer#000000038 6345.11
+Customer#000000040 1335.3
+Customer#000000041 270.95
+Customer#000000043 9904.28
+Customer#000000044 7315.94
+Customer#000000046 5744.59
+Customer#000000047 274.58
+Customer#000000049 4573.94
+Customer#000000052 5630.28
+Customer#000000053 4113.64
+Customer#000000055 4572.11
+Customer#000000056 6530.86
+Customer#000000058 6478.46
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000062 595.61
+Customer#000000064 -646.64
+Customer#000000065 8795.16
+Customer#000000067 8166.59
+Customer#000000070 4867.52
+Customer#000000071 -611.19
+Customer#000000073 4288.5
+Customer#000000074 2764.43
+Customer#000000076 5745.33
+Customer#000000079 5121.28
+Customer#000000080 7383.53
+Customer#000000082 9468.34
+Customer#000000083 6463.51
+Customer#000000085 3386.64
+Customer#000000086 3306.32
+Customer#000000088 8031.44
+Customer#000000089 1530.76
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000095 5327.38
+Customer#000000097 2164.48
+Customer#000000098 -551.37
+Customer#000000100 9889.89
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000104 -588.38
+Customer#000000106 3288.42
+Customer#000000107 2514.15
+Customer#000000109 -716.1
+Customer#000000110 7462.99
+Customer#000000112 2953.35
+Customer#000000115 7508.92
+Customer#000000116 8403.99
+Customer#000000118 3582.37
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000127 9280.71
+Customer#000000128 -986.96
+Customer#000000130 5073.58
+Customer#000000131 8595.53
+Customer#000000133 2314.67
+Customer#000000134 4608.9
+Customer#000000136 -842.39
+Customer#000000137 7838.3
+Customer#000000139 7897.78
+Customer#000000140 9963.15
+Customer#000000142 2209.81
+Customer#000000143 2186.5
+Customer#000000145 9748.93
+Customer#000000148 2135.6
+Customer#000000149 8959.65
+drop table t,r;
+drop procedure p;
+# Materialization SJM SP
+# ======================
+create procedure p()
+delete from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+Customer#000000013 3857.34
+Customer#000000032 3471.53
+Customer#000000037 -917.75
+Customer#000000056 6530.86
+Customer#000000118 3582.37
+create table t as
+select * from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+call p();
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+insert into customer select * from t;
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+Customer#000000013 3857.34
+Customer#000000032 3471.53
+Customer#000000037 -917.75
+Customer#000000056 6530.86
+Customer#000000118 3582.37
+create table r as
+select * from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+call p();
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+insert into customer select * from r;
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+Customer#000000013 3857.34
+Customer#000000032 3471.53
+Customer#000000037 -917.75
+Customer#000000056 6530.86
+Customer#000000118 3582.37
+drop table t,r;
+drop procedure p;
+# Checking limitations
+# ====================
+# Check for DELETE ... RETURNING with SJ subquery in WHERE
+select c_name from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name
+Customer#000000001
+Customer#000000002
+Customer#000000005
+Customer#000000007
+Customer#000000008
+Customer#000000010
+Customer#000000011
+Customer#000000013
+Customer#000000014
+Customer#000000016
+Customer#000000017
+Customer#000000019
+Customer#000000022
+Customer#000000023
+Customer#000000025
+Customer#000000028
+Customer#000000029
+Customer#000000031
+Customer#000000032
+Customer#000000034
+Customer#000000035
+Customer#000000037
+Customer#000000038
+Customer#000000040
+Customer#000000041
+Customer#000000043
+Customer#000000044
+Customer#000000046
+Customer#000000047
+Customer#000000049
+Customer#000000052
+Customer#000000053
+Customer#000000055
+Customer#000000056
+Customer#000000058
+Customer#000000059
+Customer#000000061
+Customer#000000062
+Customer#000000064
+Customer#000000065
+Customer#000000067
+Customer#000000070
+Customer#000000071
+Customer#000000073
+Customer#000000074
+Customer#000000076
+Customer#000000079
+Customer#000000080
+Customer#000000082
+Customer#000000083
+Customer#000000085
+Customer#000000086
+Customer#000000088
+Customer#000000089
+Customer#000000091
+Customer#000000092
+Customer#000000094
+Customer#000000095
+Customer#000000097
+Customer#000000098
+Customer#000000100
+Customer#000000101
+Customer#000000103
+Customer#000000104
+Customer#000000106
+Customer#000000107
+Customer#000000109
+Customer#000000110
+Customer#000000112
+Customer#000000115
+Customer#000000116
+Customer#000000118
+Customer#000000121
+Customer#000000122
+Customer#000000127
+Customer#000000128
+Customer#000000130
+Customer#000000131
+Customer#000000133
+Customer#000000134
+Customer#000000136
+Customer#000000137
+Customer#000000139
+Customer#000000140
+Customer#000000142
+Customer#000000143
+Customer#000000145
+Customer#000000148
+Customer#000000149
+create table t as
+select * from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+explain
+delete from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08') returning c_name;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY customer ALL NULL NULL NULL NULL 150 Using where
+2 DEPENDENT SUBQUERY orders index_subquery i_o_orderdate,i_o_custkey i_o_custkey 5 func 15 Using where
+delete from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08') returning c_name;
+c_name
+Customer#000000001
+Customer#000000002
+Customer#000000005
+Customer#000000007
+Customer#000000008
+Customer#000000010
+Customer#000000011
+Customer#000000013
+Customer#000000014
+Customer#000000016
+Customer#000000017
+Customer#000000019
+Customer#000000022
+Customer#000000023
+Customer#000000025
+Customer#000000028
+Customer#000000029
+Customer#000000031
+Customer#000000032
+Customer#000000034
+Customer#000000035
+Customer#000000037
+Customer#000000038
+Customer#000000040
+Customer#000000041
+Customer#000000043
+Customer#000000044
+Customer#000000046
+Customer#000000047
+Customer#000000049
+Customer#000000052
+Customer#000000053
+Customer#000000055
+Customer#000000056
+Customer#000000058
+Customer#000000059
+Customer#000000061
+Customer#000000062
+Customer#000000064
+Customer#000000065
+Customer#000000067
+Customer#000000070
+Customer#000000071
+Customer#000000073
+Customer#000000074
+Customer#000000076
+Customer#000000079
+Customer#000000080
+Customer#000000082
+Customer#000000083
+Customer#000000085
+Customer#000000086
+Customer#000000088
+Customer#000000089
+Customer#000000091
+Customer#000000092
+Customer#000000094
+Customer#000000095
+Customer#000000097
+Customer#000000098
+Customer#000000100
+Customer#000000101
+Customer#000000103
+Customer#000000104
+Customer#000000106
+Customer#000000107
+Customer#000000109
+Customer#000000110
+Customer#000000112
+Customer#000000115
+Customer#000000116
+Customer#000000118
+Customer#000000121
+Customer#000000122
+Customer#000000127
+Customer#000000128
+Customer#000000130
+Customer#000000131
+Customer#000000133
+Customer#000000134
+Customer#000000136
+Customer#000000137
+Customer#000000139
+Customer#000000140
+Customer#000000142
+Customer#000000143
+Customer#000000145
+Customer#000000148
+Customer#000000149
+select c_name from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name
+insert into customer select * from t;
+select c_name from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name
+Customer#000000001
+Customer#000000002
+Customer#000000005
+Customer#000000007
+Customer#000000008
+Customer#000000010
+Customer#000000011
+Customer#000000013
+Customer#000000014
+Customer#000000016
+Customer#000000017
+Customer#000000019
+Customer#000000022
+Customer#000000023
+Customer#000000025
+Customer#000000028
+Customer#000000029
+Customer#000000031
+Customer#000000032
+Customer#000000034
+Customer#000000035
+Customer#000000037
+Customer#000000038
+Customer#000000040
+Customer#000000041
+Customer#000000043
+Customer#000000044
+Customer#000000046
+Customer#000000047
+Customer#000000049
+Customer#000000052
+Customer#000000053
+Customer#000000055
+Customer#000000056
+Customer#000000058
+Customer#000000059
+Customer#000000061
+Customer#000000062
+Customer#000000064
+Customer#000000065
+Customer#000000067
+Customer#000000070
+Customer#000000071
+Customer#000000073
+Customer#000000074
+Customer#000000076
+Customer#000000079
+Customer#000000080
+Customer#000000082
+Customer#000000083
+Customer#000000085
+Customer#000000086
+Customer#000000088
+Customer#000000089
+Customer#000000091
+Customer#000000092
+Customer#000000094
+Customer#000000095
+Customer#000000097
+Customer#000000098
+Customer#000000100
+Customer#000000101
+Customer#000000103
+Customer#000000104
+Customer#000000106
+Customer#000000107
+Customer#000000109
+Customer#000000110
+Customer#000000112
+Customer#000000115
+Customer#000000116
+Customer#000000118
+Customer#000000121
+Customer#000000122
+Customer#000000127
+Customer#000000128
+Customer#000000130
+Customer#000000131
+Customer#000000133
+Customer#000000134
+Customer#000000136
+Customer#000000137
+Customer#000000139
+Customer#000000140
+Customer#000000142
+Customer#000000143
+Customer#000000145
+Customer#000000148
+Customer#000000149
+drop table t;
+select c_name from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name
+Customer#000000013
+Customer#000000032
+Customer#000000037
+Customer#000000056
+Customer#000000118
+create table t as
+select * from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+explain
+delete from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1) returning c_name;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY customer ALL NULL NULL NULL NULL 150 Using where
+2 DEPENDENT SUBQUERY orders range i_o_orderdate i_o_orderdate 4 NULL 28 Using index condition; Using temporary
+delete from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1) returning c_name;
+c_name
+Customer#000000013
+Customer#000000032
+Customer#000000037
+Customer#000000056
+Customer#000000118
+select c_name from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name
+insert into customer select * from t;
+select c_name from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name
+Customer#000000013
+Customer#000000032
+Customer#000000037
+Customer#000000056
+Customer#000000118
+drop table t;
+# Check for DELETE ... ORDER BY ...LIMIT with SJ subquery in WHERE
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (1,2));
+o_orderkey o_totalprice
+1221 117397.16
+1344 43809.37
+1856 189361.42
+1925 146382.71
+3139 40975.96
+324 26868.85
+4903 34363.63
+5607 24660.06
+# Should not use semi-join conversion because has ORDER BY ... LIMIT
+explain
+delete from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (1,2))
+order by o_totalprice limit 500;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY orders range i_o_orderdate i_o_orderdate 4 NULL 108 Using where; Using filesort
+2 DEPENDENT SUBQUERY customer unique_subquery PRIMARY,i_c_nationkey PRIMARY 4 func 1 Using where
+create table t as
+select * from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (1,2));
+select o_orderkey, o_totalprice from t;
+o_orderkey o_totalprice
+1221 117397.16
+324 26868.85
+1856 189361.42
+4903 34363.63
+5607 24660.06
+1344 43809.37
+1925 146382.71
+3139 40975.96
+delete from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (1,2))
+order by o_totalprice limit 500;
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (1,2));
+o_orderkey o_totalprice
+insert into orders select * from t;
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (1,2));
+o_orderkey o_totalprice
+1221 117397.16
+1344 43809.37
+1856 189361.42
+1925 146382.71
+3139 40975.96
+324 26868.85
+4903 34363.63
+5607 24660.06
+drop table t;
+# Should use semi-join converion
+explain
+delete from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (1,2));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY customer range PRIMARY,i_c_nationkey i_c_nationkey 5 NULL 13 Using index condition
+1 PRIMARY orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (7%) Using where; Using rowid filter
+create table t as
+select * from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (1,2));
+select o_orderkey, o_totalprice from t;
+o_orderkey o_totalprice
+1221 117397.16
+324 26868.85
+1856 189361.42
+4903 34363.63
+5607 24660.06
+1344 43809.37
+1925 146382.71
+3139 40975.96
+delete from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (1,2));
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (1,2));
+o_orderkey o_totalprice
+insert into orders select * from t;
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (1,2));
+o_orderkey o_totalprice
+1221 117397.16
+1344 43809.37
+1856 189361.42
+1925 146382.71
+3139 40975.96
+324 26868.85
+4903 34363.63
+5607 24660.06
+drop table t;
+CREATE TABLE partsupp_small (
+ps_partkey int(11) NOT NULL DEFAULT '0',
+ps_suppkey int(11) NOT NULL DEFAULT '0',
+ps_availqty int(11) DEFAULT NULL,
+ps_supplycost double DEFAULT NULL,
+ps_comment varchar(199) DEFAULT NULL,
+PRIMARY KEY (ps_partkey,ps_suppkey),
+KEY i_ps_partkey (ps_partkey),
+KEY i_ps_suppkey (ps_suppkey)
+);
+create index i_ps_sup_part on partsupp_small(ps_suppkey, ps_partkey);
+insert into partsupp_small select * from partsupp where ps_partkey <50;
+analyze table partsupp_small persistent for all;
+Table Op Msg_type Msg_text
+dbt3_s001.partsupp_small analyze status Engine-independent statistics collected
+dbt3_s001.partsupp_small analyze status OK
+# LooseScan
+# =========
+explain
+select count(*) from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY partsupp_small index PRIMARY,i_ps_partkey,i_ps_suppkey,i_ps_sup_part PRIMARY 8 NULL 176 Using where; Using index; LooseScan
+1 PRIMARY lineitem ref i_l_suppkey_partkey,i_l_partkey i_l_partkey 5 dbt3_s001.partsupp_small.ps_partkey 30 Using index
+explain format=json
+select count(*) from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.222764041,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "partsupp_small",
+ "access_type": "index",
+ "possible_keys": [
+ "PRIMARY",
+ "i_ps_partkey",
+ "i_ps_suppkey",
+ "i_ps_sup_part"
+ ],
+ "key": "PRIMARY",
+ "key_length": "8",
+ "used_key_parts": ["ps_partkey", "ps_suppkey"],
+ "loops": 1,
+ "rows": 176,
+ "cost": 0.019403477,
+ "filtered": 23.86363602,
+ "attached_condition": "partsupp_small.ps_suppkey in (1,2,3)",
+ "using_index": true,
+ "loose_scan": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": ["i_l_suppkey_partkey", "i_l_partkey"],
+ "key": "i_l_partkey",
+ "key_length": "5",
+ "used_key_parts": ["l_partkey"],
+ "ref": ["dbt3_s001.partsupp_small.ps_partkey"],
+ "loops": 42,
+ "rows": 30,
+ "cost": 0.203360564,
+ "filtered": 2.380952358,
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+explain
+select l_partkey from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY partsupp_small index PRIMARY,i_ps_partkey,i_ps_suppkey,i_ps_sup_part PRIMARY 8 NULL 176 Using where; Using index; LooseScan
+1 PRIMARY lineitem ref i_l_suppkey_partkey,i_l_partkey i_l_partkey 5 dbt3_s001.partsupp_small.ps_partkey 30 Using index
+explain format=json
+select l_partkey from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.222764041,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "partsupp_small",
+ "access_type": "index",
+ "possible_keys": [
+ "PRIMARY",
+ "i_ps_partkey",
+ "i_ps_suppkey",
+ "i_ps_sup_part"
+ ],
+ "key": "PRIMARY",
+ "key_length": "8",
+ "used_key_parts": ["ps_partkey", "ps_suppkey"],
+ "loops": 1,
+ "rows": 176,
+ "cost": 0.019403477,
+ "filtered": 23.86363602,
+ "attached_condition": "partsupp_small.ps_suppkey in (1,2,3)",
+ "using_index": true,
+ "loose_scan": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": ["i_l_suppkey_partkey", "i_l_partkey"],
+ "key": "i_l_partkey",
+ "key_length": "5",
+ "used_key_parts": ["l_partkey"],
+ "ref": ["dbt3_s001.partsupp_small.ps_partkey"],
+ "loops": 42,
+ "rows": 30,
+ "cost": 0.203360564,
+ "filtered": 2.380952358,
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+select count(*) from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+count(*)
+1175
+create table t as
+select * from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+explain
+delete from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY partsupp_small index PRIMARY,i_ps_partkey,i_ps_suppkey,i_ps_sup_part PRIMARY 8 NULL 176 Using where; Using index; LooseScan
+1 PRIMARY lineitem ref i_l_suppkey_partkey,i_l_partkey i_l_partkey 5 dbt3_s001.partsupp_small.ps_partkey 30
+explain format=json
+delete from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.222764041,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "partsupp_small",
+ "access_type": "index",
+ "possible_keys": [
+ "PRIMARY",
+ "i_ps_partkey",
+ "i_ps_suppkey",
+ "i_ps_sup_part"
+ ],
+ "key": "PRIMARY",
+ "key_length": "8",
+ "used_key_parts": ["ps_partkey", "ps_suppkey"],
+ "loops": 1,
+ "rows": 176,
+ "cost": 0.019403477,
+ "filtered": 23.86363602,
+ "attached_condition": "partsupp_small.ps_suppkey in (1,2,3)",
+ "using_index": true,
+ "loose_scan": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": ["i_l_suppkey_partkey", "i_l_partkey"],
+ "key": "i_l_partkey",
+ "key_length": "5",
+ "used_key_parts": ["l_partkey"],
+ "ref": ["dbt3_s001.partsupp_small.ps_partkey"],
+ "loops": 42,
+ "rows": 30,
+ "cost": 0.203360564,
+ "filtered": 2.380952358
+ }
+ }
+ ]
+ }
+}
+delete from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+select count(*) from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+count(*)
+0
+insert into lineitem select * from t;
+select count(*) from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+count(*)
+1175
+drop table t;
+# LooseScan PS
+# ============
+prepare stmt from "
+delete from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+";
+select count(*) from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+count(*)
+1175
+create table t as
+select * from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+execute stmt;
+select count(*) from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+count(*)
+0
+insert into lineitem select * from t;
+select count(*) from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+count(*)
+1175
+create table r as
+select * from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+execute stmt;
+select count(*) from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+count(*)
+0
+insert into lineitem select * from r;
+select count(*) from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+count(*)
+1175
+drop tables r, t;
+deallocate prepare stmt;
+# LooseScan SP
+# ============
+create procedure p()
+delete from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+select count(*) from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+count(*)
+1175
+create table t as
+select * from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+call p();
+select count(*) from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+count(*)
+0
+insert into lineitem select * from t;
+select count(*) from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+count(*)
+1175
+create table r as
+select * from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+call p();
+select count(*) from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+count(*)
+0
+insert into lineitem select * from r;
+select count(*) from lineitem where l_partkey in
+(select ps_partkey from partsupp_small
+where ps_suppkey in (1,2,3));
+count(*)
+1175
+drop tables r, t;
+drop procedure p;
+# DuplicateWeedout
+# ================
+set @tmp_optimizer_switch= @@optimizer_switch;
+set optimizer_switch='materialization=off';
+analyze table lineitem;
+Table Op Msg_type Msg_text
+dbt3_s001.lineitem analyze status Engine-independent statistics collected
+dbt3_s001.lineitem analyze status OK
+analyze table orders;
+Table Op Msg_type Msg_text
+dbt3_s001.orders analyze status Engine-independent statistics collected
+dbt3_s001.orders analyze status OK
+explain
+select count(*) from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY supplier range PRIMARY PRIMARY 4 NULL 1 Using where; Using index; Start temporary
+1 PRIMARY partsupp_small ref PRIMARY,i_ps_partkey,i_ps_suppkey,i_ps_sup_part i_ps_sup_part 4 dbt3_s001.supplier.s_suppkey 17 Using where; Using index
+1 PRIMARY lineitem ref i_l_suppkey_partkey,i_l_partkey i_l_suppkey_partkey 5 dbt3_s001.partsupp_small.ps_partkey 30 Using index
+1 PRIMARY lineitem ref i_l_suppkey_partkey,i_l_partkey i_l_partkey 5 dbt3_s001.partsupp_small.ps_partkey 30 Using index; End temporary
+explain format=json
+select count(*) from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 4.129940741,
+ "nested_loop": [
+ {
+ "duplicates_removal": [
+ {
+ "table": {
+ "table_name": "supplier",
+ "access_type": "range",
+ "possible_keys": ["PRIMARY"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["s_suppkey"],
+ "loops": 1,
+ "rows": 1,
+ "cost": 0.001478954,
+ "filtered": 100,
+ "attached_condition": "supplier.s_suppkey < 2",
+ "using_index": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "partsupp_small",
+ "access_type": "ref",
+ "possible_keys": [
+ "PRIMARY",
+ "i_ps_partkey",
+ "i_ps_suppkey",
+ "i_ps_sup_part"
+ ],
+ "key": "i_ps_sup_part",
+ "key_length": "4",
+ "used_key_parts": ["ps_suppkey"],
+ "ref": ["dbt3_s001.supplier.s_suppkey"],
+ "loops": 1,
+ "rows": 17,
+ "cost": 0.003160332,
+ "filtered": 79.54545593,
+ "attached_condition": "partsupp_small.ps_partkey is not null",
+ "using_index": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": ["i_l_suppkey_partkey", "i_l_partkey"],
+ "key": "i_l_suppkey_partkey",
+ "key_length": "5",
+ "used_key_parts": ["l_partkey"],
+ "ref": ["dbt3_s001.partsupp_small.ps_partkey"],
+ "loops": 14,
+ "rows": 30,
+ "cost": 0.069152188,
+ "filtered": 100,
+ "using_index": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": ["i_l_suppkey_partkey", "i_l_partkey"],
+ "key": "i_l_partkey",
+ "key_length": "5",
+ "used_key_parts": ["l_partkey"],
+ "ref": ["dbt3_s001.partsupp_small.ps_partkey"],
+ "loops": 420.35,
+ "rows": 30,
+ "cost": 1.994712365,
+ "filtered": 0.237896994,
+ "using_index": true
+ }
+ }
+ ]
+ }
+ ]
+ }
+}
+explain
+select l_partkey from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY supplier range PRIMARY PRIMARY 4 NULL 1 Using where; Using index; Start temporary
+1 PRIMARY partsupp_small ref PRIMARY,i_ps_partkey,i_ps_suppkey,i_ps_sup_part i_ps_sup_part 4 dbt3_s001.supplier.s_suppkey 17 Using where; Using index
+1 PRIMARY lineitem ref i_l_suppkey_partkey,i_l_partkey i_l_suppkey_partkey 5 dbt3_s001.partsupp_small.ps_partkey 30 Using index
+1 PRIMARY lineitem ref i_l_suppkey_partkey,i_l_partkey i_l_partkey 5 dbt3_s001.partsupp_small.ps_partkey 30 Using index; End temporary
+explain format=json
+select l_partkey from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 4.129940741,
+ "nested_loop": [
+ {
+ "duplicates_removal": [
+ {
+ "table": {
+ "table_name": "supplier",
+ "access_type": "range",
+ "possible_keys": ["PRIMARY"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["s_suppkey"],
+ "loops": 1,
+ "rows": 1,
+ "cost": 0.001478954,
+ "filtered": 100,
+ "attached_condition": "supplier.s_suppkey < 2",
+ "using_index": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "partsupp_small",
+ "access_type": "ref",
+ "possible_keys": [
+ "PRIMARY",
+ "i_ps_partkey",
+ "i_ps_suppkey",
+ "i_ps_sup_part"
+ ],
+ "key": "i_ps_sup_part",
+ "key_length": "4",
+ "used_key_parts": ["ps_suppkey"],
+ "ref": ["dbt3_s001.supplier.s_suppkey"],
+ "loops": 1,
+ "rows": 17,
+ "cost": 0.003160332,
+ "filtered": 79.54545593,
+ "attached_condition": "partsupp_small.ps_partkey is not null",
+ "using_index": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": ["i_l_suppkey_partkey", "i_l_partkey"],
+ "key": "i_l_suppkey_partkey",
+ "key_length": "5",
+ "used_key_parts": ["l_partkey"],
+ "ref": ["dbt3_s001.partsupp_small.ps_partkey"],
+ "loops": 14,
+ "rows": 30,
+ "cost": 0.069152188,
+ "filtered": 100,
+ "using_index": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": ["i_l_suppkey_partkey", "i_l_partkey"],
+ "key": "i_l_partkey",
+ "key_length": "5",
+ "used_key_parts": ["l_partkey"],
+ "ref": ["dbt3_s001.partsupp_small.ps_partkey"],
+ "loops": 420.35,
+ "rows": 30,
+ "cost": 1.994712365,
+ "filtered": 0.237896994,
+ "using_index": true
+ }
+ }
+ ]
+ }
+ ]
+ }
+}
+select count(*) from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+count(*)
+471
+create table t as
+select * from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+explain
+delete from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY supplier range PRIMARY PRIMARY 4 NULL 1 Using where; Using index; Start temporary
+1 PRIMARY partsupp_small ref PRIMARY,i_ps_partkey,i_ps_suppkey,i_ps_sup_part i_ps_sup_part 4 dbt3_s001.supplier.s_suppkey 17 Using where; Using index
+1 PRIMARY lineitem ref i_l_suppkey_partkey,i_l_partkey i_l_suppkey_partkey 5 dbt3_s001.partsupp_small.ps_partkey 30
+1 PRIMARY lineitem ref i_l_suppkey_partkey,i_l_partkey i_l_partkey 5 dbt3_s001.partsupp_small.ps_partkey 30 Using index; End temporary
+explain format=json
+delete from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 4.129940741,
+ "nested_loop": [
+ {
+ "duplicates_removal": [
+ {
+ "table": {
+ "table_name": "supplier",
+ "access_type": "range",
+ "possible_keys": ["PRIMARY"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["s_suppkey"],
+ "loops": 1,
+ "rows": 1,
+ "cost": 0.001478954,
+ "filtered": 100,
+ "attached_condition": "supplier.s_suppkey < 2",
+ "using_index": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "partsupp_small",
+ "access_type": "ref",
+ "possible_keys": [
+ "PRIMARY",
+ "i_ps_partkey",
+ "i_ps_suppkey",
+ "i_ps_sup_part"
+ ],
+ "key": "i_ps_sup_part",
+ "key_length": "4",
+ "used_key_parts": ["ps_suppkey"],
+ "ref": ["dbt3_s001.supplier.s_suppkey"],
+ "loops": 1,
+ "rows": 17,
+ "cost": 0.003160332,
+ "filtered": 79.54545593,
+ "attached_condition": "partsupp_small.ps_partkey is not null",
+ "using_index": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": ["i_l_suppkey_partkey", "i_l_partkey"],
+ "key": "i_l_suppkey_partkey",
+ "key_length": "5",
+ "used_key_parts": ["l_partkey"],
+ "ref": ["dbt3_s001.partsupp_small.ps_partkey"],
+ "loops": 14,
+ "rows": 30,
+ "cost": 0.069152188,
+ "filtered": 100
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": ["i_l_suppkey_partkey", "i_l_partkey"],
+ "key": "i_l_partkey",
+ "key_length": "5",
+ "used_key_parts": ["l_partkey"],
+ "ref": ["dbt3_s001.partsupp_small.ps_partkey"],
+ "loops": 420.35,
+ "rows": 30,
+ "cost": 1.994712365,
+ "filtered": 0.237896994,
+ "using_index": true
+ }
+ }
+ ]
+ }
+ ]
+ }
+}
+delete from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+select count(*) from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+count(*)
+0
+insert into lineitem select * from t;
+select count(*) from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+count(*)
+471
+drop table t;
+# DuplicateWeedout PS
+# ===================
+prepare stmt from "
+delete from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+";
+select count(*) from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+count(*)
+471
+create table t as
+select * from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+execute stmt;
+select count(*) from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+count(*)
+0
+insert into lineitem select * from t;
+select count(*) from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+count(*)
+471
+create table r as
+select * from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+execute stmt;
+select count(*) from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+count(*)
+0
+insert into lineitem select * from r;
+select count(*) from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+count(*)
+471
+drop tables r, t;
+deallocate prepare stmt;
+# DuplicateWeedout SP
+# ===================
+create procedure p()
+delete from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+select count(*) from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+count(*)
+471
+create table t as
+select * from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+call p();
+select count(*) from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+count(*)
+0
+insert into lineitem select * from t;
+select count(*) from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+count(*)
+471
+create table r as
+select * from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+call p();
+select count(*) from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+count(*)
+0
+insert into lineitem select * from r;
+select count(*) from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+count(*)
+471
+drop tables r, t;
+drop procedure p;
+set @@optimizer_switch=@tmp_optimizer_switch;
+drop table partsupp_small;
+DROP DATABASE dbt3_s001;
diff --git a/mysql-test/main/delete_single_to_multi.test b/mysql-test/main/delete_single_to_multi.test
new file mode 100644
index 00000000..31f1d157
--- /dev/null
+++ b/mysql-test/main/delete_single_to_multi.test
@@ -0,0 +1,1069 @@
+--disable_warnings
+DROP DATABASE IF EXISTS dbt3_s001;
+--enable_warnings
+
+CREATE DATABASE dbt3_s001;
+
+use dbt3_s001;
+
+--disable_query_log
+--disable_result_log
+--disable_warnings
+--source include/dbt3_s001.inc
+--enable_warnings
+--enable_result_log
+--enable_query_log
+
+create index i_n_name on nation(n_name);
+analyze table
+ nation, lineitem, customer, orders, part, supplier, partsupp, region
+persistent for all;
+
+
+--echo # Pullout
+--echo # =======
+
+let $c1=
+ o_orderDATE between '1992-01-01' and '1992-06-30' and
+ o_custkey in (select c_custkey from customer
+ where c_nationkey in (select n_nationkey from nation
+ where n_name='PERU'));
+
+eval
+explain
+select o_orderkey, o_totalprice from orders where $c1;
+eval
+explain format=json
+select o_orderkey, o_totalprice from orders where $c1;
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+eval
+create table t as
+select * from orders where $c1;
+
+eval
+explain
+delete from orders where $c1;
+eval
+explain format=json
+delete from orders where $c1;
+eval
+delete from orders where $c1;
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+
+
+insert into orders select * from t;
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+drop table t;
+
+
+let $c2=
+ (ps_partkey, ps_suppkey) in
+ (select p_partkey, s_suppkey from part, supplier
+ where p_retailprice between 901 and 910 and
+ s_nationkey in (select n_nationkey from nation
+ where n_name='PERU'));
+
+eval
+explain
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where $c2;
+--sorted_result
+eval
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where $c2;
+eval
+create table t as
+select * from partsupp where $c2;
+
+eval
+explain
+delete from partsupp where $c2;
+eval
+delete from partsupp where $c2;
+eval
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where $c2;
+
+insert into partsupp select * from t;
+--sorted_result
+eval
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where $c2;
+drop table t;
+
+
+let $c3=
+ ps_partkey in (select p_partkey from part
+ where p_retailprice between 901 and 910) and
+ ps_suppkey in (select s_suppkey from supplier
+ where s_nationkey in (select n_nationkey from nation
+ where n_name='PERU'));
+eval
+explain
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where $c3;
+--sorted_result
+eval
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where $c3;
+eval
+create table t as
+select * from partsupp where $c3;
+
+eval
+explain
+delete from partsupp where $c3;
+eval
+delete from partsupp where $c3;
+eval
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where $c3;
+
+insert into partsupp select * from t;
+--sorted_result
+eval
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where $c3;
+drop table t;
+
+
+let $c4=
+ l_orderkey in (select o_orderkey from orders
+ where o_custkey in
+ (select c_custkey from customer
+ where c_nationkey in
+ (select n_nationkey from nation
+ where n_name='PERU'))
+ and
+ o_orderDATE between '1992-06-30' and '1992-12-31')
+ and
+ (l_partkey, l_suppkey) in
+ (select p_partkey, s_suppkey from part, supplier
+ where p_retailprice between 901 and 1000 and
+ s_nationkey in (select n_nationkey from nation
+ where n_name='PERU'));
+
+eval
+explain
+select l_orderkey, l_linenumber, l_tax from lineitem where $c4;
+--sorted_result
+eval
+select l_orderkey, l_linenumber, l_tax from lineitem where $c4;
+eval
+create table t as
+select * from lineitem where $c4;
+
+eval
+explain
+delete from lineitem where $c4;
+eval
+delete from lineitem where $c4;
+eval
+select l_orderkey, l_linenumber, l_tax from lineitem where $c4;
+
+insert into lineitem select * from t;
+--sorted_result
+eval
+select l_orderkey, l_linenumber, l_tax from lineitem where $c4;
+drop table t;
+
+
+--echo # FirstMatch
+--echo # ==========
+
+set optimizer_switch='materialization=off';
+
+let $c5=
+ c_nationkey in (select n_nationkey from nation
+ where n_regionkey in (1,2))
+ and
+ c_custkey in (select o_custkey from orders
+ where o_orderDATE between '1992-10-09' and '1993-06-08');
+
+eval
+explain
+select c_name, c_acctbal from customer where $c5;
+eval
+explain format=json
+select c_name, c_acctbal from customer where $c5;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c5;
+eval
+create table t as
+select * from customer where $c5;
+
+eval
+explain
+delete from customer where $c5;
+eval
+explain format=json
+delete from customer where $c5;
+eval
+delete from customer where $c5;
+eval
+select c_name, c_acctbal from customer where $c5;
+
+insert into customer select * from t;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c5;
+drop table t;
+
+set optimizer_switch='materialization=default';
+
+
+let $c6=
+ c_nationkey in (select n_nationkey from nation where n_name='PERU')
+ and
+ c_custkey in (select o_custkey from orders
+ where o_orderDATE between "1992-01-09" and "1993-01-08");
+
+eval
+explain
+select c_name, c_acctbal from customer where $c6;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c6;
+eval
+create table t as
+select * from customer where $c6;
+
+eval
+explain
+delete from customer where $c6;
+eval
+delete from customer where $c6;
+eval
+select c_name, c_acctbal from customer where $c6;
+
+insert into customer select * from t;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c6;
+drop table t;
+
+
+--echo # Materialization
+--echo # ===============
+
+set optimizer_switch='firstmatch=off';
+
+let $c7=
+ c_nationkey in (select n_nationkey from nation where
+ n_name in ('JAPAN', 'INDONESIA', 'PERU', 'ARGENTINA'))
+ and
+ c_custkey in (select o_custkey from orders
+ where o_orderDATE between "1992-01-09" and "1995-01-08");
+
+eval
+explain
+select c_name, c_acctbal from customer where $c7;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c7;
+eval
+create table t as
+select * from customer where $c7;
+
+eval
+explain
+delete from customer where $c7;
+eval
+delete from customer where $c7;
+eval
+select c_name, c_acctbal from customer where $c7;
+
+insert into customer select * from t;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c7;
+drop table t;
+
+set optimizer_switch='firstmatch=default';
+
+let $c8=
+ c_custkey in (select o_custkey from orders
+ where o_orderDATE between '1992-01-09' and '1993-03-08');
+
+eval
+explain
+select c_name, c_acctbal from customer where $c8;
+eval
+explain format=json
+select c_name, c_acctbal from customer where $c8;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c8;
+eval
+create table t as
+select * from customer where $c8;
+
+eval
+explain
+delete from customer where $c8;
+eval
+explain format=json
+delete from customer where $c8;
+eval
+delete from customer where $c8;
+eval
+select c_name, c_acctbal from customer where $c8;
+
+insert into customer select * from t;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c8;
+drop table t;
+
+
+let $c9=
+ c_custkey in (select o_custkey from orders
+ where o_orderDATE between '1992-06-09' and '1993-01-08');
+
+eval
+explain
+select c_name, c_acctbal from customer where $c9;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c9;
+eval
+create table t as
+select * from customer where $c9;
+
+eval
+explain
+delete from customer where $c9;
+eval
+delete from customer where $c9;
+eval
+select c_name, c_acctbal from customer where $c9;
+
+insert into customer select * from t;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c9;
+drop table t;
+
+
+--echo # Materialization SJM
+--echo # ===================
+
+let $c10=
+ c_custkey in (select o_custkey from orders
+ where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+
+eval
+explain
+select c_name, c_acctbal from customer where $c10;
+eval
+explain format=json
+select c_name, c_acctbal from customer where $c10;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c10;
+eval
+create table t as
+select * from customer where $c10;
+
+eval
+explain
+delete from customer where $c10;
+eval
+explain format=json
+delete from customer where $c10;
+eval
+delete from customer where $c10;
+eval
+select c_name, c_acctbal from customer where $c10;
+
+insert into customer select * from t;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c10;
+drop table t;
+
+
+let $c11=
+ c_custkey in (select o_custkey from orders
+ where o_orderDATE between '1992-01-09' and '1993-03-08'
+ group by o_custkey having count(o_custkey) > 5);
+
+eval
+explain
+select c_name, c_acctbal from customer where $c11;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c11;
+eval
+create table t as
+select * from customer where $c11;
+
+eval
+explain
+delete from customer where $c11;
+eval
+delete from customer where $c11;
+eval
+select c_name, c_acctbal from customer where $c11;
+
+insert into customer select * from t;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c11;
+drop table t;
+
+
+--echo # Pullout PS
+--echo # ==========
+
+eval
+prepare stmt from "
+delete from orders where $c1;
+";
+
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+eval
+create table t as
+select * from orders where $c1;
+execute stmt;
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+insert into orders select * from t;
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+eval
+create table r as
+select * from orders where $c1;
+execute stmt;
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+insert into orders select * from r;
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+drop table t,r;
+
+deallocate prepare stmt;
+
+
+--echo # FirstMatch PS
+--echo # =============
+
+set optimizer_switch='materialization=off';
+
+eval
+prepare stmt from "
+delete from customer where $c5;
+";
+
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c5;
+eval
+create table t as
+select * from customer where $c5;
+execute stmt;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c5;
+insert into customer select * from t;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c5;
+eval
+create table r as
+select * from customer where $c5;
+execute stmt;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c5;
+insert into customer select * from r;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c5;
+drop table t,r;
+
+deallocate prepare stmt;
+
+set optimizer_switch='materialization=default';
+
+--echo # Materialization PS
+--echo # ==================
+
+eval
+prepare stmt from "
+delete from customer where $c8 and c_name like ?;
+";
+
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c8;
+set @a1='Customer#%1_';
+eval
+create table t as
+select * from customer where $c8 and c_name like @a1;
+execute stmt using @a1;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c8;
+insert into customer select * from t;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c8;
+set @a2='Customer#%3_';
+eval
+create table r as
+select * from customer where $c8 and c_name like @a2;
+execute stmt using @a2;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c8;
+insert into customer select * from r;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c8;
+drop table t,r;
+
+deallocate prepare stmt;
+
+
+--echo # Materialization SJM PS
+--echo # ======================
+
+eval
+prepare stmt from "
+delete from customer where $c10 and c_acctbal between ? and ?;
+";
+
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c10;
+set @a1=3500;
+set @a2=4000;
+eval
+create table t as
+select * from customer where $c10 and c_acctbal between @a1 and @a2;
+execute stmt using @a1, @a2;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c10;
+insert into customer select * from t;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c10;
+set @a3=-1000;
+set @a4=3500;
+eval
+create table r as
+select * from customer where $c10 and c_acctbal between @a3 and @a4;
+execute stmt using @a3, @a4;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c10;
+insert into customer select * from r;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c10;
+drop table t,r;
+
+deallocate prepare stmt;
+
+
+--echo # Pullout SP
+--echo # ==========
+
+eval
+create procedure p(a1 int, a2 int)
+delete from orders where $c1 and o_totalprice between a1 and a2;
+
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+eval
+create table t as
+select * from orders where $c1 and o_totalprice between 150000 and 200000;
+call p(150000, 200000);
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+insert into orders select * from t;
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+eval
+create table r as
+select * from orders where $c1 and o_totalprice between 180000 and 210000;
+call p(180000, 210000);
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+insert into orders select * from r;
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+drop table t,r;
+
+drop procedure p;
+
+
+--echo # FirstMatch SP
+--echo # =============
+
+set optimizer_switch='materialization=off';
+
+eval
+create procedure p(a int)
+delete from customer where $c5 and c_acctbal > a;
+
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c5;
+eval
+create table t as
+select * from customer where $c5 and c_acctbal > 4000;
+call p(4000);
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c5;
+insert into customer select * from t;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c5;
+eval
+create table r as
+select * from customer where $c5 and c_acctbal > 2000;
+call p(2000);
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c5;
+insert into customer select * from r;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c5;
+drop table t,r;
+
+drop procedure p;
+
+set optimizer_switch='materialization=default';
+
+
+--echo # Materialization SP
+--echo # ==================
+
+eval
+create procedure p()
+delete from customer where $c8;
+
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c8;
+eval
+create table t as
+select * from customer where $c8;
+call p();
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c8;
+insert into customer select * from t;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c8;
+eval
+create table r as
+select * from customer where $c8;
+call p();
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c8;
+insert into customer select * from r;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c8;
+drop table t,r;
+
+drop procedure p;
+
+
+--echo # Materialization SJM SP
+--echo # ======================
+
+eval
+create procedure p()
+delete from customer where $c10;
+
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c10;
+eval
+create table t as
+select * from customer where $c10;
+call p();
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c10;
+insert into customer select * from t;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c10;
+eval
+create table r as
+select * from customer where $c10;
+call p();
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c10;
+insert into customer select * from r;
+--sorted_result
+eval
+select c_name, c_acctbal from customer where $c10;
+drop table t,r;
+
+drop procedure p;
+
+--echo # Checking limitations
+--echo # ====================
+
+--echo # Check for DELETE ... RETURNING with SJ subquery in WHERE
+
+--sorted_result
+eval
+select c_name from customer where $c8;
+eval
+create table t as
+select * from customer where $c8;
+eval
+explain
+delete from customer where $c8 returning c_name;
+--sorted_result
+eval
+delete from customer where $c8 returning c_name;
+--sorted_result
+eval
+select c_name from customer where $c8;
+insert into customer select * from t;
+--sorted_result
+eval
+select c_name from customer where $c8;
+drop table t;
+
+--sorted_result
+eval
+select c_name from customer where $c10;
+eval
+create table t as
+select * from customer where $c10;
+eval
+explain
+delete from customer where $c10 returning c_name;
+--sorted_result
+eval
+delete from customer where $c10 returning c_name;
+--sorted_result
+eval
+select c_name from customer where $c10;
+insert into customer select * from t;
+--sorted_result
+eval
+select c_name from customer where $c10;
+drop table t;
+
+--echo # Check for DELETE ... ORDER BY ...LIMIT with SJ subquery in WHERE
+
+let $c11=
+ o_orderDATE between '1992-01-01' and '1992-06-30' and
+ o_custkey in (select c_custkey from customer
+ where c_nationkey in (1,2));
+
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders where $c11;
+
+--echo # Should not use semi-join conversion because has ORDER BY ... LIMIT
+eval
+explain
+delete from orders where $c11
+order by o_totalprice limit 500;
+eval
+create table t as
+select * from orders where $c11;
+select o_orderkey, o_totalprice from t;
+eval
+delete from orders where $c11
+order by o_totalprice limit 500;
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders where $c11;
+insert into orders select * from t;
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders where $c11;
+drop table t;
+
+--echo # Should use semi-join converion
+eval
+explain
+delete from orders where $c11;
+eval
+create table t as
+select * from orders where $c11;
+select o_orderkey, o_totalprice from t;
+eval
+delete from orders where $c11;
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders where $c11;
+insert into orders select * from t;
+--sorted_result
+eval
+select o_orderkey, o_totalprice from orders where $c11;
+drop table t;
+
+
+CREATE TABLE partsupp_small (
+ ps_partkey int(11) NOT NULL DEFAULT '0',
+ ps_suppkey int(11) NOT NULL DEFAULT '0',
+ ps_availqty int(11) DEFAULT NULL,
+ ps_supplycost double DEFAULT NULL,
+ ps_comment varchar(199) DEFAULT NULL,
+ PRIMARY KEY (ps_partkey,ps_suppkey),
+ KEY i_ps_partkey (ps_partkey),
+ KEY i_ps_suppkey (ps_suppkey)
+);
+
+create index i_ps_sup_part on partsupp_small(ps_suppkey, ps_partkey);
+insert into partsupp_small select * from partsupp where ps_partkey <50;
+analyze table partsupp_small persistent for all;
+
+--echo # LooseScan
+--echo # =========
+
+let $c12 = l_partkey in
+ (select ps_partkey from partsupp_small
+ where ps_suppkey in (1,2,3));
+
+eval
+explain
+select count(*) from lineitem where $c12;
+eval
+explain format=json
+select count(*) from lineitem where $c12;
+eval
+explain
+select l_partkey from lineitem where $c12;
+eval
+explain format=json
+select l_partkey from lineitem where $c12;
+eval
+select count(*) from lineitem where $c12;
+eval
+create table t as
+select * from lineitem where $c12;
+
+eval
+explain
+delete from lineitem where $c12;
+eval
+explain format=json
+delete from lineitem where $c12;
+eval
+delete from lineitem where $c12;
+eval
+select count(*) from lineitem where $c12;
+
+insert into lineitem select * from t;
+eval
+select count(*) from lineitem where $c12;
+
+drop table t;
+
+--echo # LooseScan PS
+--echo # ============
+
+eval
+prepare stmt from "
+delete from lineitem where $c12;
+";
+
+eval
+select count(*) from lineitem where $c12;
+eval
+create table t as
+select * from lineitem where $c12;
+execute stmt;
+eval
+select count(*) from lineitem where $c12;
+insert into lineitem select * from t;
+eval
+select count(*) from lineitem where $c12;
+
+eval
+create table r as
+select * from lineitem where $c12;
+execute stmt;
+eval
+select count(*) from lineitem where $c12;
+insert into lineitem select * from r;
+eval
+select count(*) from lineitem where $c12;
+
+drop tables r, t;
+deallocate prepare stmt;
+
+--echo # LooseScan SP
+--echo # ============
+
+eval
+create procedure p()
+delete from lineitem where $c12;
+
+eval
+select count(*) from lineitem where $c12;
+eval
+create table t as
+select * from lineitem where $c12;
+call p();
+eval
+select count(*) from lineitem where $c12;
+insert into lineitem select * from t;
+eval
+select count(*) from lineitem where $c12;
+
+eval
+create table r as
+select * from lineitem where $c12;
+call p();
+eval
+select count(*) from lineitem where $c12;
+insert into lineitem select * from r;
+eval
+select count(*) from lineitem where $c12;
+
+drop tables r, t;
+drop procedure p;
+
+--echo # DuplicateWeedout
+--echo # ================
+
+set @tmp_optimizer_switch= @@optimizer_switch;
+set optimizer_switch='materialization=off';
+
+analyze table lineitem;
+analyze table orders;
+
+let $c13 = l_partkey in (
+ select ps_partkey
+ from partsupp_small join lineitem on ps_partkey=l_partkey
+ where ps_suppkey in (
+ select s_suppkey from supplier where s_suppkey < 2
+ )
+);
+
+eval
+explain
+select count(*) from lineitem where $c13;
+eval
+explain format=json
+select count(*) from lineitem where $c13;
+eval
+explain
+select l_partkey from lineitem where $c13;
+eval
+explain format=json
+select l_partkey from lineitem where $c13;
+eval
+select count(*) from lineitem where $c13;
+eval
+create table t as
+select * from lineitem where $c13;
+
+eval
+explain
+delete from lineitem where $c13;
+eval
+explain format=json
+delete from lineitem where $c13;
+eval
+delete from lineitem where $c13;
+eval
+select count(*) from lineitem where $c13;
+
+insert into lineitem select * from t;
+eval
+select count(*) from lineitem where $c13;
+
+drop table t;
+
+--echo # DuplicateWeedout PS
+--echo # ===================
+
+eval
+prepare stmt from "
+delete from lineitem where $c13;
+";
+
+eval
+select count(*) from lineitem where $c13;
+eval
+create table t as
+select * from lineitem where $c13;
+execute stmt;
+eval
+select count(*) from lineitem where $c13;
+insert into lineitem select * from t;
+eval
+select count(*) from lineitem where $c13;
+
+eval
+create table r as
+select * from lineitem where $c13;
+execute stmt;
+eval
+select count(*) from lineitem where $c13;
+insert into lineitem select * from r;
+eval
+select count(*) from lineitem where $c13;
+
+drop tables r, t;
+deallocate prepare stmt;
+
+--echo # DuplicateWeedout SP
+--echo # ===================
+
+eval
+create procedure p()
+delete from lineitem where $c13;
+
+eval
+select count(*) from lineitem where $c13;
+eval
+create table t as
+select * from lineitem where $c13;
+call p();
+eval
+select count(*) from lineitem where $c13;
+insert into lineitem select * from t;
+eval
+select count(*) from lineitem where $c13;
+
+eval
+create table r as
+select * from lineitem where $c13;
+call p();
+eval
+select count(*) from lineitem where $c13;
+insert into lineitem select * from r;
+eval
+select count(*) from lineitem where $c13;
+
+drop tables r, t;
+drop procedure p;
+
+set @@optimizer_switch=@tmp_optimizer_switch;
+
+drop table partsupp_small;
+
+DROP DATABASE dbt3_s001;
diff --git a/mysql-test/main/delete_use_source.result b/mysql-test/main/delete_use_source.result
index 0990a551..329203af 100644
--- a/mysql-test/main/delete_use_source.result
+++ b/mysql-test/main/delete_use_source.result
@@ -49,7 +49,7 @@ rollback;
start transaction;
explain delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500 limit 1;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 range c1 c1 4 NULL 600 Using where
+1 PRIMARY t1 range c1 c1 4 NULL 600 Using index condition; Using where
2 DEPENDENT SUBQUERY b ref c1 c1 4 test.t1.c1 167 Using index
delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500 limit 1;
affected rows: 1
@@ -65,7 +65,7 @@ rollback;
start transaction;
explain delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL c1 NULL NULL NULL # Using where
+1 PRIMARY t1 range c1 c1 4 NULL # Using index condition; Using where
2 DEPENDENT SUBQUERY b ref c1 c1 4 test.t1.c1 # Using index
delete from v1 where (select count(*) from t1 b where b.c1=v1.c1) = 500 ;
affected rows: 500
@@ -154,3 +154,183 @@ set session sort_buffer_size = 1024;
delete from t1 where c1=0 and exists(select 'x' from t1 b where b.c1<10);
affected rows: 128000
drop table t1;
+#
+# MDEV-17954: multi-table DELETE with the same source and target
+#
+create table t1 (c1 int, c2 int, c3 int);
+insert into t1 values
+(1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+#
+# Single-table DELETE with the same source and target
+# handled as multi-table DELETE
+#
+explain delete from t1
+where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1 and a.c2 < 3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 8 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 8 Using where; FirstMatch(t1)
+delete from t1
+where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1 and a.c2 < 3);
+select * from t1;
+c1 c2 c3
+1 3 3
+2 3 6
+2 4 7
+2 5 8
+delete from t1;
+insert into t1 values
+(1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+prepare stmt from "delete from t1
+where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1 and a.c2 < 3)";
+execute stmt;
+select * from t1;
+c1 c2 c3
+1 3 3
+2 3 6
+2 4 7
+2 5 8
+delete from t1;
+insert into t1 values
+(2,2,5), (2,3,6), (2,4,7), (2,5,8);
+execute stmt;
+select * from t1;
+c1 c2 c3
+2 3 6
+2 4 7
+2 5 8
+deallocate prepare stmt;
+delete from t1;
+insert into t1 values
+(1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+#
+# Multi-table DELETE with the same source and target
+#
+create table t2 (c1 int, c2 int, c3 int);
+insert into t2 values
+(1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,5,8);
+explain delete from t1 using t1,t2
+where t1.c2 = t2.c2 and t1.c1 > 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 7
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where
+delete from t1 using t1,t2
+where t1.c2 = t2.c2 and t1.c1 > 1;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+2 4 7
+delete from t1;
+insert into t1 values
+(1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+prepare stmt from "delete from t1 using t1,t2
+where t1.c2 = t2.c2 and t1.c1 > 1";
+execute stmt;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+2 4 7
+delete from t1;
+insert into t1 values
+(2,2,5), (2,3,6), (2,4,7), (2,5,8);
+execute stmt;
+select * from t1;
+c1 c2 c3
+2 4 7
+deallocate prepare stmt;
+explain delete from t1 using t1,t2
+where t1.c2 = t2.c2 and t1.c1 > 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 1
+1 SIMPLE t2 ALL NULL NULL NULL NULL 7 Using where
+delete from t1 using t1,t2
+where t1.c2 = t2.c2 and t1.c1 > 1;
+select * from t1;
+c1 c2 c3
+2 4 7
+delete from t1;
+insert into t1 values
+(1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+prepare stmt from "delete from t1 using t1,t2
+where t1.c2 = t2.c2 and t1.c1 > 1";
+execute stmt;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+2 4 7
+delete from t1;
+insert into t1 values
+(2,2,5), (2,3,6), (2,4,7), (2,5,8);
+execute stmt;
+select * from t1;
+c1 c2 c3
+2 4 7
+deallocate prepare stmt;
+delete from t1;
+insert into t1 values
+(1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+explain delete from t1,t2 using t1,t2
+where t1.c2 = t2.c2 and t1.c1 > 1 and t2.c1 > 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 7 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where
+delete from t1,t2 using t1,t2
+where t1.c2 = t2.c2 and t1.c1 > 1 and t2.c1 > 1;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+2 4 7
+select * from t2;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+delete from t1;
+insert into t1 values
+(1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+delete from t2;
+insert into t2 values
+(1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,5,8);
+prepare stmt from "delete from t1,t2 using t1,t2
+where t1.c2 = t2.c2 and t1.c1 > 1 and t2.c1 > 1";
+execute stmt;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+2 4 7
+select * from t2;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+delete from t1;
+insert into t1 values
+(1,2,2), (1,3,3), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+delete from t2;
+insert into t2 values
+(1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5);
+execute stmt;
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+2 3 6
+2 4 7
+2 5 8
+select * from t2;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+2 1 4
+deallocate prepare stmt;
+drop table t1,t2;
diff --git a/mysql-test/main/delete_use_source.test b/mysql-test/main/delete_use_source.test
index 2df1e009..a0135e6b 100644
--- a/mysql-test/main/delete_use_source.test
+++ b/mysql-test/main/delete_use_source.test
@@ -137,3 +137,123 @@ set session sort_buffer_size = 1024;
delete from t1 where c1=0 and exists(select 'x' from t1 b where b.c1<10);
drop table t1;
+
+--echo #
+--echo # MDEV-17954: multi-table DELETE with the same source and target
+--echo #
+
+create table t1 (c1 int, c2 int, c3 int);
+insert into t1 values
+ (1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+
+--echo #
+--echo # Single-table DELETE with the same source and target
+--echo # handled as multi-table DELETE
+--echo #
+
+let $q1=
+delete from t1
+ where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1 and a.c2 < 3);
+
+eval explain $q1;
+eval $q1;
+select * from t1;
+delete from t1;
+insert into t1 values
+ (1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+eval prepare stmt from "$q1";
+execute stmt;
+select * from t1;
+delete from t1;
+insert into t1 values
+ (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+execute stmt;
+select * from t1;
+deallocate prepare stmt;
+
+delete from t1;
+insert into t1 values
+ (1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+
+--echo #
+--echo # Multi-table DELETE with the same source and target
+--echo #
+
+create table t2 (c1 int, c2 int, c3 int);
+insert into t2 values
+ (1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,5,8);
+
+let $q2=
+delete from t1 using t1,t2
+ where t1.c2 = t2.c2 and t1.c1 > 1;
+
+eval explain $q2;
+eval $q2;
+select * from t1;
+delete from t1;
+insert into t1 values
+ (1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+eval prepare stmt from "$q2";
+execute stmt;
+select * from t1;
+delete from t1;
+insert into t1 values
+ (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+execute stmt;
+select * from t1;
+deallocate prepare stmt;
+
+let $q2=
+delete from t1 using t1,t2
+ where t1.c2 = t2.c2 and t1.c1 > 1;
+
+eval explain $q2;
+eval $q2;
+select * from t1;
+delete from t1;
+insert into t1 values
+ (1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+eval prepare stmt from "$q2";
+execute stmt;
+select * from t1;
+delete from t1;
+insert into t1 values
+ (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+execute stmt;
+select * from t1;
+deallocate prepare stmt;
+
+delete from t1;
+insert into t1 values
+ (1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+
+let $q3=
+delete from t1,t2 using t1,t2
+ where t1.c2 = t2.c2 and t1.c1 > 1 and t2.c1 > 1;
+
+eval explain $q3;
+eval $q3;
+select * from t1;
+select * from t2;
+delete from t1;
+insert into t1 values
+ (1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+delete from t2;
+insert into t2 values
+ (1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,5,8);
+eval prepare stmt from "$q3";
+execute stmt;
+select * from t1;
+select * from t2;
+delete from t1;
+insert into t1 values
+ (1,2,2), (1,3,3), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+delete from t2;
+insert into t2 values
+ (1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5);
+execute stmt;
+select * from t1;
+select * from t2;
+deallocate prepare stmt;
+
+drop table t1,t2;
diff --git a/mysql-test/main/delete_use_source_engines.result b/mysql-test/main/delete_use_source_engines.result
new file mode 100644
index 00000000..b1ad9c00
--- /dev/null
+++ b/mysql-test/main/delete_use_source_engines.result
@@ -0,0 +1,8870 @@
+set @save_default_engine=@@default_storage_engine;
+#######################################
+# #
+# Engine InnoDB #
+# #
+#######################################
+set global innodb_stats_persistent=1;
+set default_storage_engine=InnoDB;
+create table t1 (c1 integer, c2 integer, c3 integer);
+insert into t1(c1,c2,c3)
+values (1,1,1),(1,2,2),(1,3,3),
+(2,1,4),(2,2,5),(2,3,6),
+(2,4,7),(2,5,8);
+insert into t1 select c1+10,c2,c3+10 from t1;
+insert into t1 select c1+20,c2+1,c3+20 from t1;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create view v1 as select * from t1 where c2=2;
+#######################################
+# Test without any index #
+#######################################
+#
+# Delete with value from subquery on the same table
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+explain select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+explain delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 4
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+explain select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+analyze delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 32.00 9.38 9.38 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 12.00 3.12 5.56 Using where; FirstMatch(t1)
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with IN predicand over the updated table in WHERE
+#
+create table tmp as select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+explain select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 3 3
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit - can be deleted
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+analyze delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 32.00 100.00 12.50 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 24.50 3.12 1.02 Using where; FirstMatch(t1)
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit and an order by
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using temporary; Using filesort
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+affected rows: 1
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete: 2 execution of PS
+#
+prepare create_tmp_stmt from
+"create table tmp as select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+prepare delete_t1_stmt from
+"delete from t1 where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=5;
+execute create_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 6 38
+prepare insert_tmp_stmt from
+"insert into tmp(c1,c2,c3) select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=2;
+execute insert_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+2 1 4
+2 3 6
+2 4 7
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+drop table tmp;
+#
+# Delete in stored procedure
+#
+create procedure sp()
+begin
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+end
+//
+create table tmp as select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop procedure sp;
+drop table tmp;
+#
+# Delete in stored function
+#
+create function f1(IN a INT) returns int
+begin
+delete from t1 where c3 < a order by c3 limit 1;
+return 1;
+end;//
+set @a:=7;
+create table tmp as select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+insert into tmp(c1,c2,c3) select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop function f1;
+drop table tmp;
+#
+# Delete in trigger
+#
+create table t2 (c1 integer);
+insert into t2(c1) values (1), (2), (3), (4), (5), (6), (7), (8);
+CREATE TABLE cnt(del integer);
+INSERT INTO cnt VALUES(0);
+CREATE TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW
+UPDATE cnt SET del=del+1;
+CREATE TRIGGER tr2 AFTER DELETE ON t1 FOR EACH ROW
+DELETE FROM t2 WHERE c1> (SELECT count(*)-1 FROM t2);
+CREATE TABLE tmp as SELECT * FROM t1 WHERE c2>=3;
+DELETE FROM t1 WHERE c2>=3;
+affected rows: 20
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+2 1 4
+2 2 5
+21 2 21
+22 2 24
+31 2 31
+32 2 34
+SELECT * FROM t2;
+c1
+SELECT * FROM cnt;
+del
+20
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+DROP TRIGGER tr1;
+DROP TRIGGER tr2;
+drop table t2, cnt, tmp;
+#
+# Delete with a reference to view in subquery
+#
+create table tmp as select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+explain select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+explain delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+analyze delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 32.00 100.00 25.00 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 32.00 25.00 3.12 Using where
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#######################################
+# Test with an index #
+#######################################
+create index t1_c2 on t1 (c2,c1);
+#
+# Delete with value from subquery on the same table
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+explain select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+explain delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 4
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+explain select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a index NULL t1_c2 10 NULL 32 Using where; Using index; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a index NULL t1_c2 10 NULL 32 Using where; Using index; FirstMatch(t1)
+analyze delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 32.00 9.38 9.38 Using where
+1 PRIMARY a index NULL t1_c2 10 NULL 32 11.67 3.12 5.71 Using where; Using index; FirstMatch(t1)
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with IN predicand over the updated table in WHERE
+#
+create table tmp as select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+explain select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a ref t1_c2 t1_c2 10 test.t1.c2,test.t1.c3 1 Using index; FirstMatch(t1)
+explain delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a ref t1_c2 t1_c2 10 test.t1.c2,test.t1.c3 1 Using index; FirstMatch(t1)
+delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 3 3
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit - can be deleted
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c1 5 Using index; FirstMatch(t1)
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c1 5 Using index; FirstMatch(t1)
+analyze delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 32.00 100.00 12.50 Using where
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c1 5 0.25 18.75 100.00 Using index; FirstMatch(t1)
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit and an order by
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using temporary; Using filesort
+1 PRIMARY a ALL t1_c2 NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+2 DEPENDENT SUBQUERY a index_subquery t1_c2 t1_c2 5 func 5 Using where
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+affected rows: 1
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete: 2 execution of PS
+#
+prepare create_tmp_stmt from
+"create table tmp as select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+prepare delete_t1_stmt from
+"delete from t1 where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=5;
+execute create_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 6 38
+prepare insert_tmp_stmt from
+"insert into tmp(c1,c2,c3) select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=2;
+execute insert_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+2 1 4
+2 3 6
+2 4 7
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+drop table tmp;
+#
+# Delete in stored procedure
+#
+create procedure sp()
+begin
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+end
+//
+create table tmp as select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop procedure sp;
+drop table tmp;
+#
+# Delete in stored function
+#
+create function f1(IN a INT) returns int
+begin
+delete from t1 where c3 < a order by c3 limit 1;
+return 1;
+end;//
+set @a:=7;
+create table tmp as select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+insert into tmp(c1,c2,c3) select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop function f1;
+drop table tmp;
+#
+# Delete in trigger
+#
+create table t2 (c1 integer);
+insert into t2(c1) values (1), (2), (3), (4), (5), (6), (7), (8);
+CREATE TABLE cnt(del integer);
+INSERT INTO cnt VALUES(0);
+CREATE TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW
+UPDATE cnt SET del=del+1;
+CREATE TRIGGER tr2 AFTER DELETE ON t1 FOR EACH ROW
+DELETE FROM t2 WHERE c1> (SELECT count(*)-1 FROM t2);
+CREATE TABLE tmp as SELECT * FROM t1 WHERE c2>=3;
+DELETE FROM t1 WHERE c2>=3;
+affected rows: 20
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+2 1 4
+2 2 5
+21 2 21
+22 2 24
+31 2 31
+32 2 34
+SELECT * FROM t2;
+c1
+SELECT * FROM cnt;
+del
+20
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+DROP TRIGGER tr1;
+DROP TRIGGER tr2;
+drop table t2, cnt, tmp;
+#
+# Delete with a reference to view in subquery
+#
+create table tmp as select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+explain select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 Using index
+explain delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 Using index
+analyze delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 32.00 100.00 25.00 Using where
+2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 1.00 100.00 100.00 Using index
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#######################################
+# Test with a primary key #
+#######################################
+drop index t1_c2 on t1;
+alter table t1 add primary key (c3);
+#
+# Delete with value from subquery on the same table
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+explain select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1
+explain delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1
+delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 4
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+explain select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+analyze delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 32.00 9.38 9.38 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 12.33 3.12 5.41 Using where; FirstMatch(t1)
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with IN predicand over the updated table in WHERE
+#
+create table tmp as select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+explain select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; Start temporary
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.a.c1 1 Using where; End temporary
+explain delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; Start temporary
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.a.c1 1 Using where; End temporary
+delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 3 3
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit - can be deleted
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; Start temporary
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.a.c2 1 Using where; End temporary
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; Start temporary
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.a.c2 1 Using where; End temporary
+analyze delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY a ALL NULL NULL NULL NULL 32 1.00 100.00 100.00 Using where; Start temporary
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.a.c2 1 1.00 3.12 100.00 Using where; End temporary
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit and an order by
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 index PRIMARY PRIMARY 4 NULL 1
+1 PRIMARY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1 Using where
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 index NULL PRIMARY 4 NULL 1 Using where
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1 Using where
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+affected rows: 1
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete: 2 execution of PS
+#
+prepare create_tmp_stmt from
+"create table tmp as select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+prepare delete_t1_stmt from
+"delete from t1 where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=5;
+execute create_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 6 38
+prepare insert_tmp_stmt from
+"insert into tmp(c1,c2,c3) select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=2;
+execute insert_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+2 1 4
+2 3 6
+2 4 7
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+drop table tmp;
+#
+# Delete in stored procedure
+#
+create procedure sp()
+begin
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+end
+//
+create table tmp as select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop procedure sp;
+drop table tmp;
+#
+# Delete in stored function
+#
+create function f1(IN a INT) returns int
+begin
+delete from t1 where c3 < a order by c3 limit 1;
+return 1;
+end;//
+set @a:=7;
+create table tmp as select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+insert into tmp(c1,c2,c3) select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop function f1;
+drop table tmp;
+#
+# Delete in trigger
+#
+create table t2 (c1 integer);
+insert into t2(c1) values (1), (2), (3), (4), (5), (6), (7), (8);
+CREATE TABLE cnt(del integer);
+INSERT INTO cnt VALUES(0);
+CREATE TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW
+UPDATE cnt SET del=del+1;
+CREATE TRIGGER tr2 AFTER DELETE ON t1 FOR EACH ROW
+DELETE FROM t2 WHERE c1> (SELECT count(*)-1 FROM t2);
+CREATE TABLE tmp as SELECT * FROM t1 WHERE c2>=3;
+DELETE FROM t1 WHERE c2>=3;
+affected rows: 20
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+2 1 4
+2 2 5
+21 2 21
+22 2 24
+31 2 31
+32 2 34
+SELECT * FROM t2;
+c1
+SELECT * FROM cnt;
+del
+20
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+DROP TRIGGER tr1;
+DROP TRIGGER tr2;
+drop table t2, cnt, tmp;
+#
+# Delete with a reference to view in subquery
+#
+create table tmp as select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+explain select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+explain delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+analyze delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 32.00 100.00 25.00 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 32.00 25.00 3.12 Using where
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+drop view v1;
+drop table t1;
+#
+# Test on dynamic columns (blob)
+#
+create table assets (
+item_name varchar(32) primary key, -- A common attribute for all items
+dynamic_cols blob -- Dynamic columns will be stored here
+);
+INSERT INTO assets
+VALUES ('MariaDB T-shirt',
+COLUMN_CREATE('color', 'blue', 'size', 'XL'));
+INSERT INTO assets
+VALUES ('Thinkpad Laptop',
+COLUMN_CREATE('color', 'black', 'price', 500));
+INSERT INTO assets
+VALUES ('Fridge',
+COLUMN_CREATE('color', 'white', 'warranty', '5 years'));
+INSERT INTO assets
+VALUES ('Microwave',
+COLUMN_CREATE('warranty', '3 years'));
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+FROM assets ORDER BY item_name;
+item_name color
+Fridge white
+MariaDB T-shirt blue
+Microwave NULL
+Thinkpad Laptop black
+UPDATE assets SET dynamic_cols=COLUMN_DELETE(dynamic_cols, 'color')
+WHERE item_name='Fridge';
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+FROM assets ORDER BY item_name;
+item_name color
+Fridge NULL
+MariaDB T-shirt blue
+Microwave NULL
+Thinkpad Laptop black
+DELETE FROM assets
+WHERE item_name in
+(select b.item_name from assets b
+where COLUMN_GET(b.dynamic_cols, 'color' as char) ='black');
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+FROM assets ORDER BY item_name;
+item_name color
+Fridge NULL
+MariaDB T-shirt blue
+Microwave NULL
+DELETE FROM assets WHERE item_name='Microwave';
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+FROM assets ORDER BY item_name;
+item_name color
+Fridge NULL
+MariaDB T-shirt blue
+drop table assets ;
+#
+# Test on fulltext columns
+#
+CREATE TABLE ft2(copy TEXT,FULLTEXT(copy));
+INSERT INTO ft2(copy) VALUES
+('MySQL vs MariaDB database'),
+('Oracle vs MariaDB database'),
+('PostgreSQL vs MariaDB database'),
+('MariaDB overview'),
+('Foreign keys'),
+('Primary keys'),
+('Indexes'),
+('Transactions'),
+('Triggers');
+SELECT * FROM ft2 WHERE MATCH(copy) AGAINST('database');
+copy
+MySQL vs MariaDB database
+Oracle vs MariaDB database
+PostgreSQL vs MariaDB database
+DELETE FROM ft2 WHERE MATCH(copy) AGAINST('database');
+SELECT * FROM ft2 WHERE MATCH(copy) AGAINST('database');
+copy
+drop table ft2;
+#######################################
+# #
+# Engine Aria #
+# #
+#######################################
+set default_storage_engine=Aria;
+create table t1 (c1 integer, c2 integer, c3 integer);
+insert into t1(c1,c2,c3)
+values (1,1,1),(1,2,2),(1,3,3),
+(2,1,4),(2,2,5),(2,3,6),
+(2,4,7),(2,5,8);
+insert into t1 select c1+10,c2,c3+10 from t1;
+insert into t1 select c1+20,c2+1,c3+20 from t1;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create view v1 as select * from t1 where c2=2;
+#######################################
+# Test without any index #
+#######################################
+#
+# Delete with value from subquery on the same table
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
+create table tmp as select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+explain select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+explain delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 4
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+explain select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+analyze delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 32.00 9.38 9.38 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 12.67 3.12 5.26 Using where; FirstMatch(t1)
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with IN predicand over the updated table in WHERE
+#
+create table tmp as select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+explain select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 3 3
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit - can be deleted
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+analyze delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 25.00 100.00 12.00 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 22.67 3.12 1.47 Using where; FirstMatch(t1)
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit and an order by
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using temporary; Using filesort
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+affected rows: 1
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete: 2 execution of PS
+#
+prepare create_tmp_stmt from
+"create table tmp as select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+prepare delete_t1_stmt from
+"delete from t1 where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=5;
+execute create_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 6 38
+prepare insert_tmp_stmt from
+"insert into tmp(c1,c2,c3) select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=2;
+execute insert_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+2 1 4
+2 3 6
+2 4 7
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+drop table tmp;
+#
+# Delete in stored procedure
+#
+create procedure sp()
+begin
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+end
+//
+create table tmp as select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop procedure sp;
+drop table tmp;
+#
+# Delete in stored function
+#
+create function f1(IN a INT) returns int
+begin
+delete from t1 where c3 < a order by c3 limit 1;
+return 1;
+end;//
+set @a:=7;
+create table tmp as select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+insert into tmp(c1,c2,c3) select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop function f1;
+drop table tmp;
+#
+# Delete in trigger
+#
+create table t2 (c1 integer);
+insert into t2(c1) values (1), (2), (3), (4), (5), (6), (7), (8);
+CREATE TABLE cnt(del integer);
+INSERT INTO cnt VALUES(0);
+CREATE TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW
+UPDATE cnt SET del=del+1;
+CREATE TRIGGER tr2 AFTER DELETE ON t1 FOR EACH ROW
+DELETE FROM t2 WHERE c1> (SELECT count(*)-1 FROM t2);
+CREATE TABLE tmp as SELECT * FROM t1 WHERE c2>=3;
+DELETE FROM t1 WHERE c2>=3;
+affected rows: 20
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+2 1 4
+2 2 5
+21 2 21
+22 2 24
+31 2 31
+32 2 34
+SELECT * FROM t2;
+c1
+SELECT * FROM cnt;
+del
+20
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+DROP TRIGGER tr1;
+DROP TRIGGER tr2;
+drop table t2, cnt, tmp;
+#
+# Delete with a reference to view in subquery
+#
+create table tmp as select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+explain select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+explain delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+analyze delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 32.00 100.00 25.00 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 32.00 25.00 3.12 Using where
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with EXISTS subquery over the updated table
+# in WHERE + non-sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 4 7
+2 5 8
+21 2 21
+21 4 23
+22 2 24
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 4 33
+32 2 34
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func #
+2 MATERIALIZED a ALL NULL NULL NULL NULL #
+explain delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func #
+2 MATERIALIZED a ALL NULL NULL NULL NULL #
+analyze delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # 32.00 62.50 62.50 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func # 1.00 100.00 100.00
+2 MATERIALIZED a ALL NULL NULL NULL NULL # 32.00 62.50 100.00
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+2 1 4
+2 2 5
+21 2 21
+22 2 24
+31 2 31
+32 2 34
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete from view
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+explain select * from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+explain delete from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+delete from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+affected rows: 0
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete from view using reference
+# to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
+create table tmp as select * from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+explain select * from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL # Using where
+explain delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL # Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL # Using where
+analyze delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # 32.00 3.91 3.12 Using where
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL # 5.00 25.00 20.00 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL # 32.00 100.00 3.12 Using where
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#######################################
+# Test with an index #
+#######################################
+create index t1_c2 on t1 (c2,c1);
+#
+# Delete with value from subquery on the same table
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+explain select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+explain delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 4
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+explain select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a index NULL t1_c2 10 NULL 32 Using where; Using index; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a index NULL t1_c2 10 NULL 32 Using where; Using index; FirstMatch(t1)
+analyze delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 32.00 9.38 9.38 Using where
+1 PRIMARY a index NULL t1_c2 10 NULL 32 11.67 3.12 5.71 Using where; Using index; FirstMatch(t1)
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with IN predicand over the updated table in WHERE
+#
+create table tmp as select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+explain select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a ref t1_c2 t1_c2 10 test.t1.c2,test.t1.c3 1 Using index; FirstMatch(t1)
+explain delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a ref t1_c2 t1_c2 10 test.t1.c2,test.t1.c3 1 Using index; FirstMatch(t1)
+delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 3 3
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit - can be deleted
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c1 5 Using index; FirstMatch(t1)
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c1 5 Using index; FirstMatch(t1)
+analyze delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 27.00 100.00 14.81 Using where
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c1 5 0.25 18.75 100.00 Using index; FirstMatch(t1)
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit and an order by
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c1 5 Using where; FirstMatch(t1)
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+2 DEPENDENT SUBQUERY a index_subquery t1_c2 t1_c2 5 func 5 Using where
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+affected rows: 1
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete: 2 execution of PS
+#
+prepare create_tmp_stmt from
+"create table tmp as select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+prepare delete_t1_stmt from
+"delete from t1 where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=5;
+execute create_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 6 38
+prepare insert_tmp_stmt from
+"insert into tmp(c1,c2,c3) select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=2;
+execute insert_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+2 1 4
+2 3 6
+2 4 7
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+drop table tmp;
+#
+# Delete in stored procedure
+#
+create procedure sp()
+begin
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+end
+//
+create table tmp as select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop procedure sp;
+drop table tmp;
+#
+# Delete in stored function
+#
+create function f1(IN a INT) returns int
+begin
+delete from t1 where c3 < a order by c3 limit 1;
+return 1;
+end;//
+set @a:=7;
+create table tmp as select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+insert into tmp(c1,c2,c3) select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop function f1;
+drop table tmp;
+#
+# Delete in trigger
+#
+create table t2 (c1 integer);
+insert into t2(c1) values (1), (2), (3), (4), (5), (6), (7), (8);
+CREATE TABLE cnt(del integer);
+INSERT INTO cnt VALUES(0);
+CREATE TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW
+UPDATE cnt SET del=del+1;
+CREATE TRIGGER tr2 AFTER DELETE ON t1 FOR EACH ROW
+DELETE FROM t2 WHERE c1> (SELECT count(*)-1 FROM t2);
+CREATE TABLE tmp as SELECT * FROM t1 WHERE c2>=3;
+DELETE FROM t1 WHERE c2>=3;
+affected rows: 20
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+2 1 4
+2 2 5
+21 2 21
+22 2 24
+31 2 31
+32 2 34
+SELECT * FROM t2;
+c1
+SELECT * FROM cnt;
+del
+20
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+DROP TRIGGER tr1;
+DROP TRIGGER tr2;
+drop table t2, cnt, tmp;
+#
+# Delete with a reference to view in subquery
+#
+create table tmp as select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+explain select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 Using index
+explain delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 Using index
+analyze delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 32.00 100.00 25.00 Using where
+2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 1.00 100.00 100.00 Using index
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with EXISTS subquery over the updated table
+# in WHERE + non-sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ref t1_c2 t1_c2 5 const 8
+1 PRIMARY a ref t1_c2 t1_c2 5 const 8 Using index; FirstMatch(t1)
+explain delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ref t1_c2 t1_c2 5 const 8
+1 PRIMARY a ref t1_c2 t1_c2 5 const 8 Using index; FirstMatch(t1)
+delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 4 7
+2 5 8
+21 2 21
+21 4 23
+22 2 24
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 4 33
+32 2 34
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 range t1_c2 t1_c2 5 NULL # Using index condition
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 # Using index; FirstMatch(t1)
+explain delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a index t1_c2 t1_c2 10 NULL # Using where; Using index; LooseScan
+1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 #
+analyze delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY a index t1_c2 t1_c2 10 NULL # 16.00 20.00 25.00 Using where; Using index; LooseScan
+1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 # 5.00 4.76 100.00
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+2 1 4
+2 2 5
+21 2 21
+22 2 24
+31 2 31
+32 2 34
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete from view
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+explain select * from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ref t1_c2 t1_c2 5 const 8 Using where
+2 DEPENDENT SUBQUERY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index
+explain delete from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ref t1_c2 t1_c2 5 const 8 Using where
+2 DEPENDENT SUBQUERY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index
+delete from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+affected rows: 0
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete from view using reference
+# to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
+create table tmp as select * from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+explain select * from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ref t1_c2 t1_c2 10 const,const # Using where
+1 PRIMARY t1 ref t1_c2 t1_c2 10 const,const # Using index; FirstMatch(t1)
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL # Using where
+explain delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ref t1_c2 t1_c2 10 const,const # Using where
+3 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,func # Using where; Using index
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL # Using where
+analyze delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ref t1_c2 t1_c2 10 const,const # 1.00 100.00 100.00 Using where
+3 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,func # 1.00 100.00 100.00 Using where; Using index
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL # 32.00 100.00 3.12 Using where
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#######################################
+# Test with a primary key #
+#######################################
+drop index t1_c2 on t1;
+alter table t1 add primary key (c3);
+#
+# Delete with value from subquery on the same table
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+explain select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1 Using index
+explain delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1 Using index
+delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 4
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+explain select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+analyze delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 32.00 9.38 9.38 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 12.00 3.12 5.56 Using where; FirstMatch(t1)
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with IN predicand over the updated table in WHERE
+#
+create table tmp as select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+explain select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; Start temporary
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.a.c1 1 Using where; End temporary
+explain delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; Start temporary
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.a.c1 1 Using where; End temporary
+delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 3 3
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit - can be deleted
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; Start temporary
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.a.c2 1 Using where; End temporary
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; Start temporary
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.a.c2 1 Using where; End temporary
+analyze delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY a ALL NULL NULL NULL NULL 32 4.00 100.00 100.00 Using where; Start temporary
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.a.c2 1 1.00 3.12 25.00 Using where; End temporary
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit and an order by
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 index PRIMARY PRIMARY 4 NULL 1
+1 PRIMARY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1 Using where
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 index NULL PRIMARY 4 NULL 1 Using where
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1 Using where
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+affected rows: 1
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete: 2 execution of PS
+#
+prepare create_tmp_stmt from
+"create table tmp as select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+prepare delete_t1_stmt from
+"delete from t1 where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=5;
+execute create_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 6 38
+prepare insert_tmp_stmt from
+"insert into tmp(c1,c2,c3) select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=2;
+execute insert_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+2 1 4
+2 3 6
+2 4 7
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+drop table tmp;
+#
+# Delete in stored procedure
+#
+create procedure sp()
+begin
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+end
+//
+create table tmp as select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop procedure sp;
+drop table tmp;
+#
+# Delete in stored function
+#
+create function f1(IN a INT) returns int
+begin
+delete from t1 where c3 < a order by c3 limit 1;
+return 1;
+end;//
+set @a:=7;
+create table tmp as select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+insert into tmp(c1,c2,c3) select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop function f1;
+drop table tmp;
+#
+# Delete in trigger
+#
+create table t2 (c1 integer);
+insert into t2(c1) values (1), (2), (3), (4), (5), (6), (7), (8);
+CREATE TABLE cnt(del integer);
+INSERT INTO cnt VALUES(0);
+CREATE TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW
+UPDATE cnt SET del=del+1;
+CREATE TRIGGER tr2 AFTER DELETE ON t1 FOR EACH ROW
+DELETE FROM t2 WHERE c1> (SELECT count(*)-1 FROM t2);
+CREATE TABLE tmp as SELECT * FROM t1 WHERE c2>=3;
+DELETE FROM t1 WHERE c2>=3;
+affected rows: 20
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+2 1 4
+2 2 5
+21 2 21
+22 2 24
+31 2 31
+32 2 34
+SELECT * FROM t2;
+c1
+SELECT * FROM cnt;
+del
+20
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+DROP TRIGGER tr1;
+DROP TRIGGER tr2;
+drop table t2, cnt, tmp;
+#
+# Delete with a reference to view in subquery
+#
+create table tmp as select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+explain select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+explain delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+analyze delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 32.00 100.00 25.00 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 32.00 25.00 3.12 Using where
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with EXISTS subquery over the updated table
+# in WHERE + non-sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 4 7
+2 5 8
+21 2 21
+21 4 23
+22 2 24
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 4 33
+32 2 34
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func #
+2 MATERIALIZED a ALL NULL NULL NULL NULL #
+explain delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func #
+2 MATERIALIZED a ALL NULL NULL NULL NULL #
+analyze delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # 32.00 62.50 62.50 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func # 1.00 100.00 100.00
+2 MATERIALIZED a ALL NULL NULL NULL NULL # 32.00 62.50 100.00
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+2 1 4
+2 2 5
+21 2 21
+22 2 24
+31 2 31
+32 2 34
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete from view
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+explain select * from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+explain delete from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+delete from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+affected rows: 0
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete from view using reference
+# to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
+create table tmp as select * from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+explain select * from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 #
+explain delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL # Using where
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 #
+analyze delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # 32.00 3.91 3.12 Using where
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL # 6.00 25.00 16.67 Using where
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 # 1.00 100.00 100.00
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+drop view v1;
+drop table t1;
+#
+# Test on dynamic columns (blob)
+#
+create table assets (
+item_name varchar(32) primary key, -- A common attribute for all items
+dynamic_cols blob -- Dynamic columns will be stored here
+);
+INSERT INTO assets
+VALUES ('MariaDB T-shirt',
+COLUMN_CREATE('color', 'blue', 'size', 'XL'));
+INSERT INTO assets
+VALUES ('Thinkpad Laptop',
+COLUMN_CREATE('color', 'black', 'price', 500));
+INSERT INTO assets
+VALUES ('Fridge',
+COLUMN_CREATE('color', 'white', 'warranty', '5 years'));
+INSERT INTO assets
+VALUES ('Microwave',
+COLUMN_CREATE('warranty', '3 years'));
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+FROM assets ORDER BY item_name;
+item_name color
+Fridge white
+MariaDB T-shirt blue
+Microwave NULL
+Thinkpad Laptop black
+UPDATE assets SET dynamic_cols=COLUMN_DELETE(dynamic_cols, 'color')
+WHERE item_name='Fridge';
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+FROM assets ORDER BY item_name;
+item_name color
+Fridge NULL
+MariaDB T-shirt blue
+Microwave NULL
+Thinkpad Laptop black
+DELETE FROM assets
+WHERE item_name in
+(select b.item_name from assets b
+where COLUMN_GET(b.dynamic_cols, 'color' as char) ='black');
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+FROM assets ORDER BY item_name;
+item_name color
+Fridge NULL
+MariaDB T-shirt blue
+Microwave NULL
+DELETE FROM assets WHERE item_name='Microwave';
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+FROM assets ORDER BY item_name;
+item_name color
+Fridge NULL
+MariaDB T-shirt blue
+drop table assets ;
+#
+# Test on fulltext columns
+#
+CREATE TABLE ft2(copy TEXT,FULLTEXT(copy));
+INSERT INTO ft2(copy) VALUES
+('MySQL vs MariaDB database'),
+('Oracle vs MariaDB database'),
+('PostgreSQL vs MariaDB database'),
+('MariaDB overview'),
+('Foreign keys'),
+('Primary keys'),
+('Indexes'),
+('Transactions'),
+('Triggers');
+SELECT * FROM ft2 WHERE MATCH(copy) AGAINST('database');
+copy
+MySQL vs MariaDB database
+Oracle vs MariaDB database
+PostgreSQL vs MariaDB database
+DELETE FROM ft2 WHERE MATCH(copy) AGAINST('database');
+SELECT * FROM ft2 WHERE MATCH(copy) AGAINST('database');
+copy
+drop table ft2;
+#######################################
+# #
+# Engine MyISAM #
+# #
+#######################################
+set default_storage_engine=MyISAM;
+create table t1 (c1 integer, c2 integer, c3 integer);
+insert into t1(c1,c2,c3)
+values (1,1,1),(1,2,2),(1,3,3),
+(2,1,4),(2,2,5),(2,3,6),
+(2,4,7),(2,5,8);
+insert into t1 select c1+10,c2,c3+10 from t1;
+insert into t1 select c1+20,c2+1,c3+20 from t1;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create view v1 as select * from t1 where c2=2;
+#######################################
+# Test without any index #
+#######################################
+#
+# Delete with value from subquery on the same table
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
+create table tmp as select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+explain select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+explain delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 4
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+explain select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+analyze delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 32.00 9.38 9.38 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 12.67 3.12 5.26 Using where; FirstMatch(t1)
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with IN predicand over the updated table in WHERE
+#
+create table tmp as select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+explain select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 3 3
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit - can be deleted
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+analyze delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 25.00 100.00 12.00 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 22.67 3.12 1.47 Using where; FirstMatch(t1)
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit and an order by
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using temporary; Using filesort
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+affected rows: 1
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete: 2 execution of PS
+#
+prepare create_tmp_stmt from
+"create table tmp as select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+prepare delete_t1_stmt from
+"delete from t1 where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=5;
+execute create_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 6 38
+prepare insert_tmp_stmt from
+"insert into tmp(c1,c2,c3) select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=2;
+execute insert_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+2 1 4
+2 3 6
+2 4 7
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+drop table tmp;
+#
+# Delete in stored procedure
+#
+create procedure sp()
+begin
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+end
+//
+create table tmp as select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop procedure sp;
+drop table tmp;
+#
+# Delete in stored function
+#
+create function f1(IN a INT) returns int
+begin
+delete from t1 where c3 < a order by c3 limit 1;
+return 1;
+end;//
+set @a:=7;
+create table tmp as select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+insert into tmp(c1,c2,c3) select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop function f1;
+drop table tmp;
+#
+# Delete in trigger
+#
+create table t2 (c1 integer);
+insert into t2(c1) values (1), (2), (3), (4), (5), (6), (7), (8);
+CREATE TABLE cnt(del integer);
+INSERT INTO cnt VALUES(0);
+CREATE TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW
+UPDATE cnt SET del=del+1;
+CREATE TRIGGER tr2 AFTER DELETE ON t1 FOR EACH ROW
+DELETE FROM t2 WHERE c1> (SELECT count(*)-1 FROM t2);
+CREATE TABLE tmp as SELECT * FROM t1 WHERE c2>=3;
+DELETE FROM t1 WHERE c2>=3;
+affected rows: 20
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+2 1 4
+2 2 5
+21 2 21
+22 2 24
+31 2 31
+32 2 34
+SELECT * FROM t2;
+c1
+SELECT * FROM cnt;
+del
+20
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+DROP TRIGGER tr1;
+DROP TRIGGER tr2;
+drop table t2, cnt, tmp;
+#
+# Delete with a reference to view in subquery
+#
+create table tmp as select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+explain select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+explain delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+analyze delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 32.00 100.00 25.00 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 32.00 25.00 3.12 Using where
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with EXISTS subquery over the updated table
+# in WHERE + non-sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 4 7
+2 5 8
+21 2 21
+21 4 23
+22 2 24
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 4 33
+32 2 34
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func #
+2 MATERIALIZED a ALL NULL NULL NULL NULL #
+explain delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func #
+2 MATERIALIZED a ALL NULL NULL NULL NULL #
+analyze delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # 32.00 62.50 62.50 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func # 1.00 100.00 100.00
+2 MATERIALIZED a ALL NULL NULL NULL NULL # 32.00 62.50 100.00
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+2 1 4
+2 2 5
+21 2 21
+22 2 24
+31 2 31
+32 2 34
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete from view
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+explain select * from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+explain delete from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+delete from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+affected rows: 0
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete from view using reference
+# to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
+create table tmp as select * from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+explain select * from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL # Using where
+explain delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL # Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL # Using where
+analyze delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # 32.00 3.91 3.12 Using where
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL # 5.00 25.00 20.00 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL # 32.00 100.00 3.12 Using where
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#######################################
+# Test with an index #
+#######################################
+create index t1_c2 on t1 (c2,c1);
+#
+# Delete with value from subquery on the same table
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+explain select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+explain delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 4
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+explain select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a index NULL t1_c2 10 NULL 32 Using where; Using index; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a index NULL t1_c2 10 NULL 32 Using where; Using index; FirstMatch(t1)
+analyze delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 32.00 9.38 9.38 Using where
+1 PRIMARY a index NULL t1_c2 10 NULL 32 11.67 3.12 5.71 Using where; Using index; FirstMatch(t1)
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with IN predicand over the updated table in WHERE
+#
+create table tmp as select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+explain select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a ref t1_c2 t1_c2 10 test.t1.c2,test.t1.c3 1 Using index; FirstMatch(t1)
+explain delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a ref t1_c2 t1_c2 10 test.t1.c2,test.t1.c3 1 Using index; FirstMatch(t1)
+delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 3 3
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit - can be deleted
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c1 5 Using index; FirstMatch(t1)
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c1 5 Using index; FirstMatch(t1)
+analyze delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 29.00 100.00 13.79 Using where
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c1 5 0.25 18.75 100.00 Using index; FirstMatch(t1)
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit and an order by
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using temporary; Using filesort
+1 PRIMARY a ALL t1_c2 NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+2 DEPENDENT SUBQUERY a index_subquery t1_c2 t1_c2 5 func 5 Using where
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+affected rows: 1
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete: 2 execution of PS
+#
+prepare create_tmp_stmt from
+"create table tmp as select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+prepare delete_t1_stmt from
+"delete from t1 where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=5;
+execute create_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 6 38
+prepare insert_tmp_stmt from
+"insert into tmp(c1,c2,c3) select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=2;
+execute insert_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+2 1 4
+2 3 6
+2 4 7
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+drop table tmp;
+#
+# Delete in stored procedure
+#
+create procedure sp()
+begin
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+end
+//
+create table tmp as select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop procedure sp;
+drop table tmp;
+#
+# Delete in stored function
+#
+create function f1(IN a INT) returns int
+begin
+delete from t1 where c3 < a order by c3 limit 1;
+return 1;
+end;//
+set @a:=7;
+create table tmp as select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+insert into tmp(c1,c2,c3) select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop function f1;
+drop table tmp;
+#
+# Delete in trigger
+#
+create table t2 (c1 integer);
+insert into t2(c1) values (1), (2), (3), (4), (5), (6), (7), (8);
+CREATE TABLE cnt(del integer);
+INSERT INTO cnt VALUES(0);
+CREATE TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW
+UPDATE cnt SET del=del+1;
+CREATE TRIGGER tr2 AFTER DELETE ON t1 FOR EACH ROW
+DELETE FROM t2 WHERE c1> (SELECT count(*)-1 FROM t2);
+CREATE TABLE tmp as SELECT * FROM t1 WHERE c2>=3;
+DELETE FROM t1 WHERE c2>=3;
+affected rows: 20
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+2 1 4
+2 2 5
+21 2 21
+22 2 24
+31 2 31
+32 2 34
+SELECT * FROM t2;
+c1
+SELECT * FROM cnt;
+del
+20
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+DROP TRIGGER tr1;
+DROP TRIGGER tr2;
+drop table t2, cnt, tmp;
+#
+# Delete with a reference to view in subquery
+#
+create table tmp as select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+explain select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 Using index
+explain delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 Using index
+analyze delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 32.00 100.00 25.00 Using where
+2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 1.00 100.00 100.00 Using index
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with EXISTS subquery over the updated table
+# in WHERE + non-sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ref t1_c2 t1_c2 5 const 8
+1 PRIMARY a ref t1_c2 t1_c2 5 const 8 Using index; FirstMatch(t1)
+explain delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ref t1_c2 t1_c2 5 const 8
+1 PRIMARY a ref t1_c2 t1_c2 5 const 8 Using index; FirstMatch(t1)
+delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 4 7
+2 5 8
+21 2 21
+21 4 23
+22 2 24
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 4 33
+32 2 34
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL # Using where; Using filesort
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 # Using index; FirstMatch(t1)
+explain delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a index t1_c2 t1_c2 10 NULL # Using where; Using index; LooseScan
+1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 #
+analyze delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY a index t1_c2 t1_c2 10 NULL # 16.00 20.00 25.00 Using where; Using index; LooseScan
+1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 # 5.00 5.00 100.00
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+2 1 4
+2 2 5
+21 2 21
+22 2 24
+31 2 31
+32 2 34
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete from view
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+explain select * from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ref t1_c2 t1_c2 5 const 8 Using where
+2 DEPENDENT SUBQUERY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index
+explain delete from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ref t1_c2 t1_c2 5 const 8 Using where
+2 DEPENDENT SUBQUERY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index
+delete from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+affected rows: 0
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete from view using reference
+# to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
+create table tmp as select * from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+explain select * from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ref t1_c2 t1_c2 10 const,const # Using where
+1 PRIMARY t1 ref t1_c2 t1_c2 10 const,const # Using index; FirstMatch(t1)
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL # Using where
+explain delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ref t1_c2 t1_c2 10 const,const # Using where
+3 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,func # Using where; Using index
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL # Using where
+analyze delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ref t1_c2 t1_c2 10 const,const # 1.00 100.00 100.00 Using where
+3 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,func # 1.00 100.00 100.00 Using where; Using index
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL # 32.00 100.00 3.12 Using where
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#######################################
+# Test with a primary key #
+#######################################
+drop index t1_c2 on t1;
+alter table t1 add primary key (c3);
+#
+# Delete with value from subquery on the same table
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+explain select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1 Using index
+explain delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1 Using index
+delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 4
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+explain select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+analyze delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 32.00 9.38 9.38 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 13.33 3.12 5.00 Using where; FirstMatch(t1)
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with IN predicand over the updated table in WHERE
+#
+create table tmp as select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+explain select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; Start temporary
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.a.c1 1 Using where; End temporary
+explain delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; Start temporary
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.a.c1 1 Using where; End temporary
+delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 3 3
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit - can be deleted
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; Start temporary
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.a.c2 1 Using where; End temporary
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; Start temporary
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.a.c2 1 Using where; End temporary
+analyze delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY a ALL NULL NULL NULL NULL 32 4.00 100.00 100.00 Using where; Start temporary
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.a.c2 1 1.00 3.12 25.00 Using where; End temporary
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit and an order by
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 index PRIMARY PRIMARY 4 NULL 1
+1 PRIMARY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1 Using where
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 index NULL PRIMARY 4 NULL 1 Using where
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1 Using where
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+affected rows: 1
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete: 2 execution of PS
+#
+prepare create_tmp_stmt from
+"create table tmp as select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+prepare delete_t1_stmt from
+"delete from t1 where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=5;
+execute create_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 6 38
+prepare insert_tmp_stmt from
+"insert into tmp(c1,c2,c3) select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=2;
+execute insert_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+2 1 4
+2 3 6
+2 4 7
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+drop table tmp;
+#
+# Delete in stored procedure
+#
+create procedure sp()
+begin
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+end
+//
+create table tmp as select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop procedure sp;
+drop table tmp;
+#
+# Delete in stored function
+#
+create function f1(IN a INT) returns int
+begin
+delete from t1 where c3 < a order by c3 limit 1;
+return 1;
+end;//
+set @a:=7;
+create table tmp as select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+insert into tmp(c1,c2,c3) select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop function f1;
+drop table tmp;
+#
+# Delete in trigger
+#
+create table t2 (c1 integer);
+insert into t2(c1) values (1), (2), (3), (4), (5), (6), (7), (8);
+CREATE TABLE cnt(del integer);
+INSERT INTO cnt VALUES(0);
+CREATE TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW
+UPDATE cnt SET del=del+1;
+CREATE TRIGGER tr2 AFTER DELETE ON t1 FOR EACH ROW
+DELETE FROM t2 WHERE c1> (SELECT count(*)-1 FROM t2);
+CREATE TABLE tmp as SELECT * FROM t1 WHERE c2>=3;
+DELETE FROM t1 WHERE c2>=3;
+affected rows: 20
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+2 1 4
+2 2 5
+21 2 21
+22 2 24
+31 2 31
+32 2 34
+SELECT * FROM t2;
+c1
+SELECT * FROM cnt;
+del
+20
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+DROP TRIGGER tr1;
+DROP TRIGGER tr2;
+drop table t2, cnt, tmp;
+#
+# Delete with a reference to view in subquery
+#
+create table tmp as select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+explain select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+explain delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+analyze delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 32.00 100.00 25.00 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 32.00 25.00 3.12 Using where
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with EXISTS subquery over the updated table
+# in WHERE + non-sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 4 7
+2 5 8
+21 2 21
+21 4 23
+22 2 24
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 4 33
+32 2 34
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func #
+2 MATERIALIZED a ALL NULL NULL NULL NULL #
+explain delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func #
+2 MATERIALIZED a ALL NULL NULL NULL NULL #
+analyze delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # 32.00 62.50 62.50 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func # 1.00 100.00 100.00
+2 MATERIALIZED a ALL NULL NULL NULL NULL # 32.00 62.50 100.00
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+2 1 4
+2 2 5
+21 2 21
+22 2 24
+31 2 31
+32 2 34
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete from view
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+explain select * from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+explain delete from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+delete from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+affected rows: 0
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete from view using reference
+# to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
+create table tmp as select * from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+explain select * from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 #
+explain delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL # Using where
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 #
+analyze delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL # 32.00 3.91 3.12 Using where
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL # 3.00 25.00 33.33 Using where
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 # 1.00 100.00 100.00
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+drop view v1;
+drop table t1;
+#
+# Test on dynamic columns (blob)
+#
+create table assets (
+item_name varchar(32) primary key, -- A common attribute for all items
+dynamic_cols blob -- Dynamic columns will be stored here
+);
+INSERT INTO assets
+VALUES ('MariaDB T-shirt',
+COLUMN_CREATE('color', 'blue', 'size', 'XL'));
+INSERT INTO assets
+VALUES ('Thinkpad Laptop',
+COLUMN_CREATE('color', 'black', 'price', 500));
+INSERT INTO assets
+VALUES ('Fridge',
+COLUMN_CREATE('color', 'white', 'warranty', '5 years'));
+INSERT INTO assets
+VALUES ('Microwave',
+COLUMN_CREATE('warranty', '3 years'));
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+FROM assets ORDER BY item_name;
+item_name color
+Fridge white
+MariaDB T-shirt blue
+Microwave NULL
+Thinkpad Laptop black
+UPDATE assets SET dynamic_cols=COLUMN_DELETE(dynamic_cols, 'color')
+WHERE item_name='Fridge';
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+FROM assets ORDER BY item_name;
+item_name color
+Fridge NULL
+MariaDB T-shirt blue
+Microwave NULL
+Thinkpad Laptop black
+DELETE FROM assets
+WHERE item_name in
+(select b.item_name from assets b
+where COLUMN_GET(b.dynamic_cols, 'color' as char) ='black');
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+FROM assets ORDER BY item_name;
+item_name color
+Fridge NULL
+MariaDB T-shirt blue
+Microwave NULL
+DELETE FROM assets WHERE item_name='Microwave';
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+FROM assets ORDER BY item_name;
+item_name color
+Fridge NULL
+MariaDB T-shirt blue
+drop table assets ;
+#
+# Test on fulltext columns
+#
+CREATE TABLE ft2(copy TEXT,FULLTEXT(copy));
+INSERT INTO ft2(copy) VALUES
+('MySQL vs MariaDB database'),
+('Oracle vs MariaDB database'),
+('PostgreSQL vs MariaDB database'),
+('MariaDB overview'),
+('Foreign keys'),
+('Primary keys'),
+('Indexes'),
+('Transactions'),
+('Triggers');
+SELECT * FROM ft2 WHERE MATCH(copy) AGAINST('database');
+copy
+MySQL vs MariaDB database
+Oracle vs MariaDB database
+PostgreSQL vs MariaDB database
+DELETE FROM ft2 WHERE MATCH(copy) AGAINST('database');
+SELECT * FROM ft2 WHERE MATCH(copy) AGAINST('database');
+copy
+drop table ft2;
+#######################################
+# #
+# Engine MEMORY #
+# #
+#######################################
+set default_storage_engine=MEMORY;
+create table t1 (c1 integer, c2 integer, c3 integer);
+insert into t1(c1,c2,c3)
+values (1,1,1),(1,2,2),(1,3,3),
+(2,1,4),(2,2,5),(2,3,6),
+(2,4,7),(2,5,8);
+insert into t1 select c1+10,c2,c3+10 from t1;
+insert into t1 select c1+20,c2+1,c3+20 from t1;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+create view v1 as select * from t1 where c2=2;
+#######################################
+# Test without any index #
+#######################################
+#
+# Delete with value from subquery on the same table
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+create table tmp as select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+explain select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+explain delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 4
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+create table tmp as select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+explain select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+affected rows: 2
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with EXISTS subquery over the updated table
+# in WHERE + non-sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+create table tmp as select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 4 7
+2 5 8
+21 2 21
+21 4 23
+22 2 24
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 4 33
+32 2 34
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+create table tmp as select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+explain delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+affected rows: 20
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+2 1 4
+2 2 5
+21 2 21
+22 2 24
+31 2 31
+32 2 34
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with IN predicand over the updated table in WHERE
+#
+create table tmp as select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+explain select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 3 3
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit - can be deleted
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+affected rows: 1
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit and an order by
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using temporary; Using filesort
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+affected rows: 1
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete: 2 execution of PS
+#
+prepare create_tmp_stmt from
+"create table tmp as select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+prepare delete_t1_stmt from
+"delete from t1 where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=5;
+execute create_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 6 38
+prepare insert_tmp_stmt from
+"insert into tmp(c1,c2,c3) select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=2;
+execute insert_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+2 1 4
+2 3 6
+2 4 7
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+drop table tmp;
+#
+# Delete in stored procedure
+#
+create procedure sp()
+begin
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+end
+//
+create table tmp as select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop procedure sp;
+drop table tmp;
+#
+# Delete in stored function
+#
+create function f1(IN a INT) returns int
+begin
+delete from t1 where c3 < a order by c3 limit 1;
+return 1;
+end;//
+set @a:=7;
+create table tmp as select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+insert into tmp(c1,c2,c3) select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop function f1;
+drop table tmp;
+#
+# Delete in trigger
+#
+create table t2 (c1 integer);
+insert into t2(c1) values (1), (2), (3), (4), (5), (6), (7), (8);
+CREATE TABLE cnt(del integer);
+INSERT INTO cnt VALUES(0);
+CREATE TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW
+UPDATE cnt SET del=del+1;
+CREATE TRIGGER tr2 AFTER DELETE ON t1 FOR EACH ROW
+DELETE FROM t2 WHERE c1> (SELECT count(*)-1 FROM t2);
+CREATE TABLE tmp as SELECT * FROM t1 WHERE c2>=3;
+DELETE FROM t1 WHERE c2>=3;
+affected rows: 20
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+2 1 4
+2 2 5
+21 2 21
+22 2 24
+31 2 31
+32 2 34
+SELECT * FROM t2;
+c1
+SELECT * FROM cnt;
+del
+20
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+DROP TRIGGER tr1;
+DROP TRIGGER tr2;
+drop table t2, cnt, tmp;
+#
+Delete with a reference to view in subquery
+#
+create table tmp as select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+explain select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+explain delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete from view
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+create table tmp as select * from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+explain select * from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+explain delete from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+delete from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+affected rows: 0
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete from view using reference
+# to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+create table tmp as select * from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+explain select * from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+explain delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+affected rows: 1
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#######################################
+# Test with an index #
+#######################################
+create index t1_c2 on t1 (c2,c1);
+#
+# Delete with value from subquery on the same table
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Operation failed
+create table tmp as select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+explain select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+explain delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 4
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Operation failed
+create table tmp as select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+explain select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+affected rows: 2
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with EXISTS subquery over the updated table
+# in WHERE + non-sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Operation failed
+create table tmp as select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a ALL t1_c2 NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a ALL t1_c2 NULL NULL NULL 32 Using where; FirstMatch(t1)
+delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 4 7
+2 5 8
+21 2 21
+21 4 23
+22 2 24
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 4 33
+32 2 34
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Operation failed
+create table tmp as select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL t1_c2 NULL NULL NULL 32
+explain delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL t1_c2 NULL NULL NULL 32
+delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+affected rows: 20
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+2 1 4
+2 2 5
+21 2 21
+22 2 24
+31 2 31
+32 2 34
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with IN predicand over the updated table in WHERE
+#
+create table tmp as select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+explain select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a ref t1_c2 t1_c2 10 test.t1.c2,test.t1.c3 2 FirstMatch(t1)
+explain delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a ref t1_c2 t1_c2 10 test.t1.c2,test.t1.c3 2 FirstMatch(t1)
+delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 3 3
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit - can be deleted
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL t1_c2 NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL t1_c2 NULL NULL NULL 32 Using where; FirstMatch(t1)
+delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+affected rows: 1
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit and an order by
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using temporary; Using filesort
+1 PRIMARY a ALL t1_c2 NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+2 DEPENDENT SUBQUERY a ALL t1_c2 NULL NULL NULL 32 Using where
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+affected rows: 1
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete: 2 execution of PS
+#
+prepare create_tmp_stmt from
+"create table tmp as select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+prepare delete_t1_stmt from
+"delete from t1 where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=5;
+execute create_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 6 38
+prepare insert_tmp_stmt from
+"insert into tmp(c1,c2,c3) select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=2;
+execute insert_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+2 1 4
+2 3 6
+2 4 7
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+drop table tmp;
+#
+# Delete in stored procedure
+#
+create procedure sp()
+begin
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+end
+//
+create table tmp as select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop procedure sp;
+drop table tmp;
+#
+# Delete in stored function
+#
+create function f1(IN a INT) returns int
+begin
+delete from t1 where c3 < a order by c3 limit 1;
+return 1;
+end;//
+set @a:=7;
+create table tmp as select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+insert into tmp(c1,c2,c3) select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop function f1;
+drop table tmp;
+#
+# Delete in trigger
+#
+create table t2 (c1 integer);
+insert into t2(c1) values (1), (2), (3), (4), (5), (6), (7), (8);
+CREATE TABLE cnt(del integer);
+INSERT INTO cnt VALUES(0);
+CREATE TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW
+UPDATE cnt SET del=del+1;
+CREATE TRIGGER tr2 AFTER DELETE ON t1 FOR EACH ROW
+DELETE FROM t2 WHERE c1> (SELECT count(*)-1 FROM t2);
+CREATE TABLE tmp as SELECT * FROM t1 WHERE c2>=3;
+DELETE FROM t1 WHERE c2>=3;
+affected rows: 20
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+2 1 4
+2 2 5
+21 2 21
+22 2 24
+31 2 31
+32 2 34
+SELECT * FROM t2;
+c1
+SELECT * FROM cnt;
+del
+20
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+DROP TRIGGER tr1;
+DROP TRIGGER tr2;
+drop table t2, cnt, tmp;
+#
+Delete with a reference to view in subquery
+#
+create table tmp as select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+explain select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 2
+explain delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 2
+delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete from view
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Operation failed
+create table tmp as select * from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+explain select * from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL t1_c2 NULL NULL NULL 32 Using where
+explain delete from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL t1_c2 NULL NULL NULL 32 Using where
+delete from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+affected rows: 0
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete from view using reference
+# to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Operation failed
+create table tmp as select * from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+explain select * from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ref t1_c2 t1_c2 10 const,const 2 Using where
+1 PRIMARY t1 ref t1_c2 t1_c2 10 const,const 2 FirstMatch(t1)
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+explain delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ref t1_c2 t1_c2 10 const,const 2 Using where
+3 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,func 2 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+affected rows: 1
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#######################################
+# Test with a primary key #
+#######################################
+drop index t1_c2 on t1;
+alter table t1 add primary key (c3);
+#
+# Delete with value from subquery on the same table
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+create table tmp as select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+explain select * from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1
+explain delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1
+delete from t1 where c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 4
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+create table tmp as select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+explain select * from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+delete from t1 where c1 = 1 and exists (select 'X' from t1 a where a.c1 = t1.c2);
+affected rows: 2
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with EXISTS subquery over the updated table
+# in WHERE + non-sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+create table tmp as select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 = 3;
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 4 7
+2 5 8
+21 2 21
+21 4 23
+22 2 24
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 4 33
+32 2 34
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+create table tmp as select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+explain delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+delete from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+affected rows: 20
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+2 1 4
+2 2 5
+21 2 21
+22 2 24
+31 2 31
+32 2 34
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with IN predicand over the updated table in WHERE
+#
+create table tmp as select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+explain select * from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; Start temporary
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.a.c1 1 Using where; End temporary
+explain delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; Start temporary
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.a.c1 1 Using where; End temporary
+delete from t1 where c3 in (select distinct a.c1 from t1 a where t1.c2=a.c2);
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 3 3
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit - can be deleted
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; Start temporary
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.a.c2 1 Using where; End temporary
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; Start temporary
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.a.c2 1 Using where; End temporary
+delete from t1 where c1 in (select a.c2 from t1 a where a.c2 = t1.c3) limit 1;
+affected rows: 1
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete with a limit and an order by
+#
+create table tmp as select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+explain select * from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 32 Using filesort
+1 PRIMARY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1 Using where
+explain delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1 Using where
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+affected rows: 1
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete: 2 execution of PS
+#
+prepare create_tmp_stmt from
+"create table tmp as select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+prepare delete_t1_stmt from
+"delete from t1 where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=5;
+execute create_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 6 38
+prepare insert_tmp_stmt from
+"insert into tmp(c1,c2,c3) select * from t1
+ where c2=(select a.c3 from t1 a where a.c3 = ?)";
+set @a:=2;
+execute insert_tmp_stmt using @a;
+execute delete_t1_stmt using @a;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+2 1 4
+2 3 6
+2 4 7
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+drop table tmp;
+#
+# Delete in stored procedure
+#
+create procedure sp()
+begin
+delete from t1 where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+end
+//
+create table tmp as select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+insert into tmp(c1,c2,c3) select * from t1
+where c1 in (select a.c2 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 1;
+CALL sp;
+select * from t1;
+c1 c2 c3
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop procedure sp;
+drop table tmp;
+#
+# Delete in stored function
+#
+create function f1(IN a INT) returns int
+begin
+delete from t1 where c3 < a order by c3 limit 1;
+return 1;
+end;//
+set @a:=7;
+create table tmp as select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+insert into tmp(c1,c2,c3) select * from t1 where c3 < @a
+order by c3 limit 1;
+select f1(@a);
+f1(@a)
+1
+select * from t1;
+c1 c2 c3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop function f1;
+drop table tmp;
+#
+# Delete in trigger
+#
+create table t2 (c1 integer);
+insert into t2(c1) values (1), (2), (3), (4), (5), (6), (7), (8);
+CREATE TABLE cnt(del integer);
+INSERT INTO cnt VALUES(0);
+CREATE TRIGGER tr1 AFTER DELETE ON t1 FOR EACH ROW
+UPDATE cnt SET del=del+1;
+CREATE TRIGGER tr2 AFTER DELETE ON t1 FOR EACH ROW
+DELETE FROM t2 WHERE c1> (SELECT count(*)-1 FROM t2);
+CREATE TABLE tmp as SELECT * FROM t1 WHERE c2>=3;
+DELETE FROM t1 WHERE c2>=3;
+affected rows: 20
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+11 1 11
+11 2 12
+12 1 14
+12 2 15
+2 1 4
+2 2 5
+21 2 21
+22 2 24
+31 2 31
+32 2 34
+SELECT * FROM t2;
+c1
+SELECT * FROM cnt;
+del
+20
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+DROP TRIGGER tr1;
+DROP TRIGGER tr2;
+drop table t2, cnt, tmp;
+#
+Delete with a reference to view in subquery
+#
+create table tmp as select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+explain select * from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+explain delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+delete from t1 where t1.c2 in ( select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+affected rows: 8
+select * from t1;
+c1 c2 c3
+1 1 1
+1 3 3
+11 1 11
+11 3 13
+12 1 14
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 3 22
+21 4 23
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 3 32
+31 4 33
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete from view
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+create table tmp as select * from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+explain select * from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+explain delete from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+delete from v1 where v1.c1 in
+(select max(a.c1) from t1 a where a.c2 = v1.c2) and c3 = 5;
+affected rows: 0
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+#
+# Delete from view using reference
+# to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+create table tmp as select * from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+explain select * from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1
+explain delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1
+delete from v1 where v1.c2 in (select max(a.c2) from t1 a where a.c3 = v1.c3)
+and c1 = 2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+affected rows: 1
+select * from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+insert into t1(c1,c2,c3) select c1,c2,c3 from tmp;
+drop table tmp;
+drop view v1;
+drop table t1;
+set @@default_storage_engine=@save_default_engine;
+#
+# End of 11.0 tests
+#
diff --git a/mysql-test/main/delete_use_source_engines.test b/mysql-test/main/delete_use_source_engines.test
new file mode 100644
index 00000000..1a0d98f8
--- /dev/null
+++ b/mysql-test/main/delete_use_source_engines.test
@@ -0,0 +1,42 @@
+--source include/have_innodb.inc
+
+set @save_default_engine=@@default_storage_engine;
+
+--echo #######################################
+--echo # #
+--echo # Engine InnoDB #
+--echo # #
+--echo #######################################
+set global innodb_stats_persistent=1;
+set default_storage_engine=InnoDB;
+--source include/delete_use_source_innodb.inc
+
+--echo #######################################
+--echo # #
+--echo # Engine Aria #
+--echo # #
+--echo #######################################
+set default_storage_engine=Aria;
+--source include/delete_use_source.inc
+
+--echo #######################################
+--echo # #
+--echo # Engine MyISAM #
+--echo # #
+--echo #######################################
+set default_storage_engine=MyISAM;
+--source include/delete_use_source.inc
+
+--echo #######################################
+--echo # #
+--echo # Engine MEMORY #
+--echo # #
+--echo #######################################
+set default_storage_engine=MEMORY;
+--source include/delete_use_source_memory.inc
+
+set @@default_storage_engine=@save_default_engine;
+
+--echo #
+--echo # End of 11.0 tests
+--echo #
diff --git a/mysql-test/main/derived.result b/mysql-test/main/derived.result
index aad5e510..b8ebe13c 100644
--- a/mysql-test/main/derived.result
+++ b/mysql-test/main/derived.result
@@ -370,6 +370,15 @@ a
2
3
3
+set @save2_derived_optimizer_switch_bug=@@optimizer_switch;
+set @@optimizer_switch=default;
+select * from (select * from t1 union distinct select * from t2 union all select * from t3) X;
+a
+1
+2
+3
+3
+set @@optimizer_switch=@save2_derived_optimizer_switch_bug;
drop table t1, t2, t3;
create table t1 (a int);
create table t2 (a int);
@@ -639,7 +648,7 @@ SELECT f3 FROM t2 HAVING f3 >= 8
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived2> system NULL NULL NULL NULL 1 100.00
1 PRIMARY <subquery4> eq_ref distinct_key distinct_key 4 const 1 100.00
-1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch(<subquery4>); Using join buffer (flat, BNL join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2 50.00 Using where; FirstMatch(<subquery4>); Using join buffer (flat, BNL join)
4 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00
2 DERIVED t1 system NULL NULL NULL NULL 1 100.00
Warnings:
@@ -1283,14 +1292,14 @@ id select_type table type possible_keys key key_len ref rows r_rows filtered r_f
analyze select * from t1 , ((select distinct t2.a, t2.b from t2 order by c))q where t1.a=q.a;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 6.00 100.00 100.00 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 2 1.00 100.00 100.00
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 1 1.00 100.00 100.00
2 DERIVED t2 ALL NULL NULL NULL NULL 6 6.00 100.00 100.00 Using temporary; Using filesort
# multiple selects in derived table
# NO UNION ALL
analyze select * from t1 , ( (select t2.a from t2 order by c) union (select t2.a from t2 order by c))q where t1.a=q.a;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 6.00 100.00 100.00 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 1 1.00 100.00 100.00
+1 PRIMARY <derived2> eq_ref distinct_key distinct_key 5 test.t1.a 1 1.00 100.00 100.00
2 DERIVED t2 ALL NULL NULL NULL NULL 6 6.00 100.00 100.00
3 UNION t2 ALL NULL NULL NULL NULL 6 6.00 100.00 100.00
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL 6.00 NULL NULL
@@ -1306,7 +1315,7 @@ a a
analyze select * from t1 , ( (select t2.a from t2 order by c) union all (select t2.a from t2 order by c) except(select t3.a from t3 order by b))q where t1.a=q.a;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 6.00 100.00 100.00 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 1 0.50 100.00 100.00
+1 PRIMARY <derived2> eq_ref distinct_key distinct_key 5 test.t1.a 1 0.50 100.00 100.00
2 DERIVED t2 ALL NULL NULL NULL NULL 6 6.00 100.00 100.00
3 UNION t2 ALL NULL NULL NULL NULL 6 6.00 100.00 100.00
4 EXCEPT t3 ALL NULL NULL NULL NULL 6 6.00 100.00 100.00
@@ -1316,6 +1325,23 @@ a a
3 3
4 4
6 6
+analyze select * from t1 , ( (select t2.a from t2 order by c) union all (select t2.a from t2 order by c) except ALL (select t3.a from t3 order by b))q where t1.a=q.a;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 6.00 100.00 100.00 Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 1 1.17 100.00 100.00
+2 DERIVED t2 ALL NULL NULL NULL NULL 6 6.00 100.00 100.00
+3 UNION t2 ALL NULL NULL NULL NULL 6 6.00 100.00 100.00
+4 EXCEPT t3 ALL NULL NULL NULL NULL 6 6.00 100.00 100.00
+NULL UNIT RESULT <unit2,3,4> ALL NULL NULL NULL NULL NULL 7.00 NULL NULL
+select * from t1 , ( (select t2.a from t2 order by c) union all (select t2.a from t2 order by c) except ALL (select t3.a from t3 order by b))q where t1.a=q.a;
+a a
+3 3
+3 3
+4 4
+4 4
+5 5
+6 6
+6 6
drop table t1,t2,t3;
#
# MDEV-16549: Server crashes in Item_field::fix_fields on query with
@@ -1356,3 +1382,483 @@ drop table t1,t2,t3;
#
# End of 10.3 tests
#
+#
+# Test of "Derived tables and union can now create distinct keys"
+#
+create table t1 (a int);
+insert into t1 values (100),(100),(100),(100),(100),(100),(100),(100),(100),(100);
+create table duplicates_tbl (a int);
+insert into duplicates_tbl select seq/100 from seq_1_to_10000;
+explain
+select
+t1.a IN ( SELECT COUNT(*)
+from (select a
+from duplicates_tbl
+limit 10000
+) T
+where T.a=5
+) as 'A'
+from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 10
+2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 10000 Using where
+3 DERIVED duplicates_tbl ALL NULL NULL NULL NULL 10000
+select
+t1.a IN ( SELECT COUNT(*)
+from (select a
+from duplicates_tbl
+limit 10000
+) T
+where T.a=5
+) as 'A'
+from t1;
+A
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+explain
+select
+t1.a = all ( SELECT COUNT(*)
+from (select a
+from duplicates_tbl
+limit 10000
+) T
+where T.a=5
+) as 'A'
+from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 10
+2 DEPENDENT SUBQUERY <derived3> ALL NULL NULL NULL NULL 10000 Using where
+3 DERIVED duplicates_tbl ALL NULL NULL NULL NULL 10000
+select
+t1.a = all ( SELECT COUNT(*)
+from (select a
+from duplicates_tbl
+limit 10000
+) T
+where T.a=5
+) as 'A'
+from t1;
+A
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+drop table t1, duplicates_tbl;
+#
+# MDEV-30310
+# Assertion failure in best_access_path upon IN exceeding
+# IN_PREDICATE_CONVERSION_THRESHOLD, derived_with_keys=off
+#
+CREATE TABLE t1 (l_orderkey int);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (o_orderkey int);
+INSERT INTO t2 VALUES (3),(4);
+SET IN_PREDICATE_CONVERSION_THRESHOLD= 2;
+SET OPTIMIZER_SWITCH='derived_with_keys=on';
+SELECT * FROM t1 JOIN t2 ON (l_orderkey = o_orderkey) WHERE l_orderkey IN (1, 2, 3);
+l_orderkey o_orderkey
+SET OPTIMIZER_SWITCH='derived_with_keys=off';
+SELECT * FROM t1 JOIN t2 ON (l_orderkey = o_orderkey) WHERE l_orderkey IN (1, 2, 3);
+l_orderkey o_orderkey
+SET @@IN_PREDICATE_CONVERSION_THRESHOLD=@@global.IN_PREDICATE_CONVERSION_THRESHOLD;
+SET @@OPTIMIZER_SWITCH=@@global.OPTIMIZER_SWITCH;
+DROP TABLE t1, t2;
+#
+# MDEV-30540 Wrong result with IN list length reaching
+# IN_PREDICATE_CONVERSION_THRESHOLD
+#
+CREATE TABLE t1 (a INT PRIMARY KEY);
+INSERT INTO t1 SELECT seq FROM seq_1_to_30;
+ANALYZE TABLE t1 PERSISTENT FOR ALL;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+SET IN_PREDICATE_CONVERSION_THRESHOLD=4;
+SELECT a FROM t1 WHERE a IN ( 1, 1, 2, 194 );
+a
+1
+2
+SET IN_PREDICATE_CONVERSION_THRESHOLD=100;
+SELECT a FROM t1 WHERE a IN ( 1, 1, 2, 194 );
+a
+1
+2
+drop table t1;
+#
+# MDEV-31022: SIGSEGV in maria_create from create_internal_tmp_table
+# keydef incorrectly allocated on the stack in create_internal_tmp_table()
+#
+CREATE TABLE t1 (c CHAR(1) NULL) ENGINE=MyISAM;
+INSERT INTO t1 (c) VALUES (1);
+SET statement
+optimizer_where_cost=1,
+big_tables=1,
+in_predicate_conversion_threshold=2
+FOR
+SELECT * FROM t1 WHERE c IN ('','');
+c
+Warnings:
+Warning 1287 '@@big_tables' is deprecated and will be removed in a future release
+Warning 1287 '@@big_tables' is deprecated and will be removed in a future release
+SET statement
+optimizer_where_cost=1,
+big_tables=1,
+in_predicate_conversion_threshold=2,
+sql_mode=''
+FOR
+SELECT * FROM t1 WHERE c IN ('','');
+c
+Warnings:
+Warning 1287 '@@big_tables' is deprecated and will be removed in a future release
+Warning 1287 '@@big_tables' is deprecated and will be removed in a future release
+DROP TABLE t1;
+#
+# End of 11.0 tests
+#
+#
+# MDEV-28883: single/multi-table UPDATE/DELETE whose WHERE condition
+# contains subquery from mergeable derived table
+# that uses the updated/deleted table
+#
+create table t1 (pk int, a int);
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+explain update t1 set a = 10
+where a = ( select * from (select a from t1) dt where dt.a > 7);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
+2 SUBQUERY t1 ALL NULL NULL NULL NULL 4 Using where
+update t1 set a = 10
+where a = ( select * from (select a from t1) dt where dt.a > 7);
+select * from t1;
+pk a
+1 3
+2 7
+3 1
+4 10
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+prepare stmt from "update t1 set a = 10
+where a = ( select * from (select a from t1) dt where dt.a > 7)";
+execute stmt;
+select * from t1;
+pk a
+1 3
+2 7
+3 1
+4 10
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+execute stmt;
+select * from t1;
+pk a
+4 10
+3 1
+1 3
+deallocate prepare stmt;
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+explain update t1 set a = 10
+where a <> ( select * from (select a from t1) dt where dt.a > 7)
+order by a limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where; Using filesort
+2 SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where
+update t1 set a = 10
+where a <> ( select * from (select a from t1) dt where dt.a > 7)
+order by a limit 2;
+select * from t1;
+pk a
+4 9
+3 10
+1 10
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+prepare stmt from "update t1 set a = 10
+where a <> ( select * from (select a from t1) dt where dt.a > 7)
+order by a limit 2";
+execute stmt;
+select * from t1;
+pk a
+4 9
+3 10
+1 10
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+execute stmt;
+select * from t1;
+pk a
+4 9
+3 10
+1 10
+deallocate prepare stmt;
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+explain delete from t1
+where a = ( select * from (select a from t1) dt where dt.a > 7);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
+2 SUBQUERY t1 ALL NULL NULL NULL NULL 4 Using where
+delete from t1
+where a = ( select * from (select a from t1) dt where dt.a > 7);
+select * from t1;
+pk a
+1 3
+2 7
+3 1
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+prepare stmt from "delete from t1
+where a = ( select * from (select a from t1) dt where dt.a > 7)";
+execute stmt;
+select * from t1;
+pk a
+1 3
+2 7
+3 1
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+execute stmt;
+select * from t1;
+pk a
+3 1
+1 3
+deallocate prepare stmt;
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+explain delete from t1
+where a = ( select * from (select a from t1) dt where dt.a > 5)
+returning pk, a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where
+2 SUBQUERY t1 ALL NULL NULL NULL NULL 3 Using where
+delete from t1
+where a = ( select * from (select a from t1) dt where dt.a > 5)
+returning pk, a;
+pk a
+4 9
+select * from t1;
+pk a
+3 1
+1 3
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+prepare stmt from "delete from t1
+where a = ( select * from (select a from t1) dt where dt.a > 5)
+returning pk, a";
+execute stmt;
+pk a
+4 9
+select * from t1;
+pk a
+3 1
+1 3
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+execute stmt;
+pk a
+4 9
+select * from t1;
+pk a
+3 1
+1 3
+deallocate prepare stmt;
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+explain delete from t1
+where a <> ( select * from (select a from t1) dt where dt.a > 7)
+order by a limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where; Using filesort
+2 SUBQUERY t1 ALL NULL NULL NULL NULL 4 Using where
+delete from t1
+where a <> ( select * from (select a from t1) dt where dt.a > 7)
+order by a limit 2;
+select * from t1;
+pk a
+2 7
+4 9
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+prepare stmt from "delete from t1
+where a <> ( select * from (select a from t1) dt where dt.a > 7)
+order by a limit 2";
+execute stmt;
+select * from t1;
+pk a
+2 7
+4 9
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+execute stmt;
+select * from t1;
+pk a
+2 7
+4 9
+deallocate prepare stmt;
+create table t2 (pk int, a int);
+insert into t2 values (1,3), (2, 7), (3,1), (4,9);
+create table t3 (a int);
+insert into t3 VALUES (0),(1);
+explain update t1,t3 set t1.a = 1
+where t1.a=t3.a and
+t1.a = ( select * from (select a from t1) dt where dt.a > 7);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
+1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where
+2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where
+update t1,t3 set t1.a = 1
+where t1.a=t3.a and
+t1.a = ( select * from (select a from t1) dt where dt.a > 7);
+select * from t1;
+pk a
+2 7
+4 9
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+prepare stmt from "update t1,t3 set t1.a = 1
+where t1.a=t3.a and
+t1.a = ( select * from (select a from t1) dt where dt.a > 7)";
+execute stmt;
+select * from t1;
+pk a
+1 3
+2 7
+3 1
+4 9
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+execute stmt;
+select * from t1;
+pk a
+4 9
+3 1
+1 3
+deallocate prepare stmt;
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+explain update t1,t3 set t1.a = 1
+where t1.a=t3.a and
+t1.a = ( select * from (select a from t2) dt where dt.a > 7);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
+2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 Using where
+update t1,t3 set t1.a = 1
+where t1.a=t3.a and
+t1.a = ( select * from (select a from t2) dt where dt.a > 7);
+select * from t1;
+pk a
+1 3
+2 7
+3 1
+4 9
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+prepare stmt from "update t1,t3 set t1.a = 1
+where t1.a=t3.a and
+t1.a = ( select * from (select a from t2) dt where dt.a > 7)";
+execute stmt;
+select * from t1;
+pk a
+1 3
+2 7
+3 1
+4 9
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+execute stmt;
+select * from t1;
+pk a
+4 9
+3 1
+1 3
+deallocate prepare stmt;
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+insert into t3 values (9), (10), (7);
+explain delete from t1 using t1,t3
+where t1.a=t3.a and
+t1.a = ( select * from (select a from t1) dt where dt.a > 7);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
+1 PRIMARY t3 ALL NULL NULL NULL NULL 5 Using where
+2 SUBQUERY t1 ALL NULL NULL NULL NULL 4 Using where
+delete from t1 using t1,t3
+where t1.a=t3.a and
+t1.a = ( select * from (select a from t1) dt where dt.a > 7);
+select * from t1;
+pk a
+1 3
+2 7
+3 1
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+prepare stmt from "delete from t1 using t1,t3
+where t1.a=t3.a and
+t1.a = ( select * from (select a from t1) dt where dt.a > 7)";
+execute stmt;
+select * from t1;
+pk a
+1 3
+2 7
+3 1
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+execute stmt;
+select * from t1;
+pk a
+3 1
+1 3
+deallocate prepare stmt;
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+explain delete from t1 using t1,t3
+where t1.a=t3.a and
+t1.a = ( select * from (select a from t2) dt where dt.a > 7);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
+1 PRIMARY t3 ALL NULL NULL NULL NULL 5 Using where
+2 SUBQUERY t2 ALL NULL NULL NULL NULL 4 Using where
+delete from t1 using t1,t3
+where t1.a=t3.a and
+t1.a = ( select * from (select a from t2) dt where dt.a > 7);
+select * from t1;
+pk a
+1 3
+2 7
+3 1
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+prepare stmt from "delete from t1 using t1,t3
+where t1.a=t3.a and
+t1.a = ( select * from (select a from t2) dt where dt.a > 7)";
+execute stmt;
+select * from t1;
+pk a
+1 3
+2 7
+3 1
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+execute stmt;
+select * from t1;
+pk a
+3 1
+1 3
+deallocate prepare stmt;
+drop table t1,t2,t3;
+# End of MariaDB 11.1 tests
diff --git a/mysql-test/main/derived.test b/mysql-test/main/derived.test
index 51fbe5ee..c8cd4aa6 100644
--- a/mysql-test/main/derived.test
+++ b/mysql-test/main/derived.test
@@ -260,6 +260,10 @@ insert into t2 values(2),(2);
insert into t3 values(3),(3);
select * from t1 union distinct select * from t2 union all select * from t3;
select * from (select * from t1 union distinct select * from t2 union all select * from t3) X;
+set @save2_derived_optimizer_switch_bug=@@optimizer_switch;
+set @@optimizer_switch=default;
+select * from (select * from t1 union distinct select * from t2 union all select * from t3) X;
+set @@optimizer_switch=@save2_derived_optimizer_switch_bug;
drop table t1, t2, t3;
#
@@ -1129,8 +1133,12 @@ analyze select * from t1 , ( (select t2.a from t2 order by c) union all (select
select * from t1 , ( (select t2.a from t2 order by c) union all (select t2.a from t2 order by c) except(select t3.a from t3 order by b))q where t1.a=q.a;
-drop table t1,t2,t3;
+analyze select * from t1 , ( (select t2.a from t2 order by c) union all (select t2.a from t2 order by c) except ALL (select t3.a from t3 order by b))q where t1.a=q.a;
+
+select * from t1 , ( (select t2.a from t2 order by c) union all (select t2.a from t2 order by c) except ALL (select t3.a from t3 order by b))q where t1.a=q.a;
+
+drop table t1,t2,t3;
--echo #
--echo # MDEV-16549: Server crashes in Item_field::fix_fields on query with
@@ -1180,3 +1188,326 @@ drop table t1,t2,t3;
--echo #
--echo # End of 10.3 tests
--echo #
+
+--echo #
+--echo # Test of "Derived tables and union can now create distinct keys"
+--echo #
+
+create table t1 (a int);
+insert into t1 values (100),(100),(100),(100),(100),(100),(100),(100),(100),(100);
+
+create table duplicates_tbl (a int);
+insert into duplicates_tbl select seq/100 from seq_1_to_10000;
+
+explain
+select
+ t1.a IN ( SELECT COUNT(*)
+ from (select a
+ from duplicates_tbl
+ limit 10000
+ ) T
+ where T.a=5
+ ) as 'A'
+from t1;
+
+select
+ t1.a IN ( SELECT COUNT(*)
+ from (select a
+ from duplicates_tbl
+ limit 10000
+ ) T
+ where T.a=5
+ ) as 'A'
+from t1;
+
+explain
+select
+ t1.a = all ( SELECT COUNT(*)
+ from (select a
+ from duplicates_tbl
+ limit 10000
+ ) T
+ where T.a=5
+ ) as 'A'
+from t1;
+
+select
+ t1.a = all ( SELECT COUNT(*)
+ from (select a
+ from duplicates_tbl
+ limit 10000
+ ) T
+ where T.a=5
+ ) as 'A'
+from t1;
+
+drop table t1, duplicates_tbl;
+
+--echo #
+--echo # MDEV-30310
+--echo # Assertion failure in best_access_path upon IN exceeding
+--echo # IN_PREDICATE_CONVERSION_THRESHOLD, derived_with_keys=off
+--echo #
+
+CREATE TABLE t1 (l_orderkey int);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (o_orderkey int);
+INSERT INTO t2 VALUES (3),(4);
+SET IN_PREDICATE_CONVERSION_THRESHOLD= 2;
+SET OPTIMIZER_SWITCH='derived_with_keys=on';
+SELECT * FROM t1 JOIN t2 ON (l_orderkey = o_orderkey) WHERE l_orderkey IN (1, 2, 3);
+SET OPTIMIZER_SWITCH='derived_with_keys=off';
+SELECT * FROM t1 JOIN t2 ON (l_orderkey = o_orderkey) WHERE l_orderkey IN (1, 2, 3);
+SET @@IN_PREDICATE_CONVERSION_THRESHOLD=@@global.IN_PREDICATE_CONVERSION_THRESHOLD;
+SET @@OPTIMIZER_SWITCH=@@global.OPTIMIZER_SWITCH;
+DROP TABLE t1, t2;
+
+--echo #
+--echo # MDEV-30540 Wrong result with IN list length reaching
+--echo # IN_PREDICATE_CONVERSION_THRESHOLD
+--echo #
+
+CREATE TABLE t1 (a INT PRIMARY KEY);
+INSERT INTO t1 SELECT seq FROM seq_1_to_30;
+ANALYZE TABLE t1 PERSISTENT FOR ALL;
+SET IN_PREDICATE_CONVERSION_THRESHOLD=4;
+SELECT a FROM t1 WHERE a IN ( 1, 1, 2, 194 );
+SET IN_PREDICATE_CONVERSION_THRESHOLD=100;
+SELECT a FROM t1 WHERE a IN ( 1, 1, 2, 194 );
+drop table t1;
+
+--echo #
+--echo # MDEV-31022: SIGSEGV in maria_create from create_internal_tmp_table
+--echo # keydef incorrectly allocated on the stack in create_internal_tmp_table()
+--echo #
+
+CREATE TABLE t1 (c CHAR(1) NULL) ENGINE=MyISAM;
+INSERT INTO t1 (c) VALUES (1);
+SET statement
+ optimizer_where_cost=1,
+ big_tables=1,
+ in_predicate_conversion_threshold=2
+FOR
+SELECT * FROM t1 WHERE c IN ('','');
+
+SET statement
+ optimizer_where_cost=1,
+ big_tables=1,
+ in_predicate_conversion_threshold=2,
+ sql_mode=''
+FOR
+SELECT * FROM t1 WHERE c IN ('','');
+
+DROP TABLE t1;
+
+--echo #
+--echo # End of 11.0 tests
+--echo #
+
+--echo #
+--echo # MDEV-28883: single/multi-table UPDATE/DELETE whose WHERE condition
+--echo # contains subquery from mergeable derived table
+--echo # that uses the updated/deleted table
+--echo #
+
+create table t1 (pk int, a int);
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+
+let $q1=
+update t1 set a = 10
+ where a = ( select * from (select a from t1) dt where dt.a > 7);
+
+eval explain $q1;
+eval $q1;
+select * from t1;
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+eval prepare stmt from "$q1";
+execute stmt;
+select * from t1;
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+execute stmt;
+select * from t1;
+deallocate prepare stmt;
+
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+
+let $q2=
+update t1 set a = 10
+ where a <> ( select * from (select a from t1) dt where dt.a > 7)
+order by a limit 2;
+eval explain $q2;
+eval $q2;
+select * from t1;
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+eval prepare stmt from "$q2";
+execute stmt;
+select * from t1;
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+execute stmt;
+select * from t1;
+deallocate prepare stmt;
+
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+
+let $q3=
+delete from t1
+ where a = ( select * from (select a from t1) dt where dt.a > 7);
+
+eval explain $q3;
+eval $q3;
+select * from t1;
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+eval prepare stmt from "$q3";
+execute stmt;
+select * from t1;
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+execute stmt;
+select * from t1;
+deallocate prepare stmt;
+
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+
+let $q4=
+delete from t1
+ where a = ( select * from (select a from t1) dt where dt.a > 5)
+returning pk, a;
+
+eval explain $q4;
+eval $q4;
+select * from t1;
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+eval prepare stmt from "$q4";
+execute stmt;
+select * from t1;
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+execute stmt;
+select * from t1;
+deallocate prepare stmt;
+
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+
+let $q5=
+delete from t1
+ where a <> ( select * from (select a from t1) dt where dt.a > 7)
+order by a limit 2;
+eval explain $q5;
+eval $q5;
+select * from t1;
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+eval prepare stmt from "$q5";
+execute stmt;
+select * from t1;
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+execute stmt;
+select * from t1;
+deallocate prepare stmt;
+
+create table t2 (pk int, a int);
+insert into t2 values (1,3), (2, 7), (3,1), (4,9);
+create table t3 (a int);
+insert into t3 VALUES (0),(1);
+
+let $q6=
+update t1,t3 set t1.a = 1
+ where t1.a=t3.a and
+ t1.a = ( select * from (select a from t1) dt where dt.a > 7);
+
+eval explain $q6;
+eval $q6;
+select * from t1;
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+eval prepare stmt from "$q6";
+execute stmt;
+select * from t1;
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+execute stmt;
+select * from t1;
+deallocate prepare stmt;
+
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+
+let $q7=
+update t1,t3 set t1.a = 1
+ where t1.a=t3.a and
+ t1.a = ( select * from (select a from t2) dt where dt.a > 7);
+
+eval explain $q7;
+eval $q7;
+select * from t1;
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+eval prepare stmt from "$q7";
+execute stmt;
+select * from t1;
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+execute stmt;
+select * from t1;
+deallocate prepare stmt;
+
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+insert into t3 values (9), (10), (7);
+
+let $q8=
+delete from t1 using t1,t3
+ where t1.a=t3.a and
+ t1.a = ( select * from (select a from t1) dt where dt.a > 7);
+
+eval explain $q8;
+eval $q8;
+select * from t1;
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+eval prepare stmt from "$q8";
+execute stmt;
+select * from t1;
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+execute stmt;
+select * from t1;
+deallocate prepare stmt;
+
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+
+let $q9=
+delete from t1 using t1,t3
+ where t1.a=t3.a and
+ t1.a = ( select * from (select a from t2) dt where dt.a > 7);
+
+eval explain $q9;
+eval $q9;
+select * from t1;
+delete from t1;
+insert into t1 values (1,3), (2, 7), (3,1), (4,9);
+eval prepare stmt from "$q9";
+execute stmt;
+select * from t1;
+delete from t1;
+insert into t1 value (4,9), (3,1), (1,3);
+execute stmt;
+select * from t1;
+deallocate prepare stmt;
+
+
+drop table t1,t2,t3;
+
+--echo # End of MariaDB 11.1 tests
diff --git a/mysql-test/main/derived_cond_pushdown.result b/mysql-test/main/derived_cond_pushdown.result
index e08abc22..d91b4510 100644
--- a/mysql-test/main/derived_cond_pushdown.result
+++ b/mysql-test/main/derived_cond_pushdown.result
@@ -122,12 +122,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -136,7 +139,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.max_c > 214"
},
@@ -147,6 +152,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and max_c > 214",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -156,7 +162,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -208,12 +216,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -227,12 +238,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.max_c > 300",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and max_c > 300",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -242,7 +256,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -297,12 +313,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -311,7 +330,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.max_c > 400 or v1.max_c < 135"
},
@@ -322,6 +343,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and (max_c > 400 or max_c < 135)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -331,7 +353,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -375,12 +399,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -389,7 +416,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.max_c > 300 or v1.max_c < 135"
},
@@ -400,6 +429,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and (max_c > 300 or max_c < 135)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -409,7 +439,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -442,12 +474,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -456,7 +491,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a > 6"
},
@@ -467,6 +504,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -476,7 +514,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 6"
}
@@ -519,12 +559,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -533,7 +576,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.b > 25"
},
@@ -544,6 +589,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -553,7 +599,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5 and t1.b > 25"
}
@@ -617,12 +665,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -631,7 +682,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a > 7 or v1.a < 2"
},
@@ -642,6 +695,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -651,7 +705,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 7 or t1.a < 2"
}
@@ -708,12 +764,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -722,7 +781,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.a > 7 or v2.a > 5"
},
@@ -733,6 +794,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -742,7 +804,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5 and (t1.a > 7 or t1.a > 5)"
}
@@ -785,12 +849,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -799,7 +866,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a > 4 or v1.a < 2"
},
@@ -810,6 +879,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -819,7 +889,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 4 or t1.a < 2"
}
@@ -855,12 +927,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -869,7 +944,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 2 and v1.max_c > 400"
},
@@ -880,6 +957,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and max_c > 400",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -889,7 +967,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 2"
}
@@ -928,7 +1008,7 @@ explain select * from v_double as v,t2_double as t where
(v.a=t.a) and (v.avg_a>0.45) and (v.b>10);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t.a 2 Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t.a 1 Using where
2 DERIVED t1_double ALL NULL NULL NULL NULL 9 Using where; Using temporary; Using filesort
explain format=json select * from v_double as v,t2_double as t where
(v.a=t.a) and (v.avg_a>0.45) and (v.b>10);
@@ -936,12 +1016,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.a is not null"
}
@@ -955,12 +1038,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v.avg_a > 0.45 and v.b > 10",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "avg_a < 22.333 and avg_a > 0.45",
"filesort": {
"sort_key": "t1_double.b, t1_double.c",
@@ -970,7 +1056,9 @@ EXPLAIN
"table": {
"table_name": "t1_double",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1_double.b > 12.2 and t1_double.b > 10"
}
@@ -997,7 +1085,7 @@ explain select * from v_decimal as v,t2_decimal as t where
(v.a=t.a) and (v.avg_c>15) and (v.b>1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 3 test.t.a 2 Using where
+1 PRIMARY <derived2> ref key0 key0 3 test.t.a 1 Using where
2 DERIVED t1_decimal ALL NULL NULL NULL NULL 9 Using where; Using temporary; Using filesort
explain format=json select * from v_decimal as v,t2_decimal as t where
(v.a=t.a) and (v.avg_c>15) and (v.b>1);
@@ -1005,12 +1093,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.a is not null"
}
@@ -1024,12 +1115,15 @@ EXPLAIN
"key_length": "3",
"used_key_parts": ["a"],
"ref": ["test.t.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v.avg_c > 15 and v.b > 1",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "avg_c > 12 and avg_c > 15",
"filesort": {
"sort_key": "t1_decimal.a, t1_decimal.b",
@@ -1039,7 +1133,9 @@ EXPLAIN
"table": {
"table_name": "t1_decimal",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1_decimal.b > 1"
}
@@ -1097,12 +1193,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -1111,7 +1210,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a > 7 and v1.max_c > 300 or v1.a < 4 and v1.max_c < 500"
},
@@ -1122,6 +1223,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and (t1.a > 7 and max_c > 300 or t1.a < 4 and max_c < 500)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -1131,7 +1233,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 7 or t1.a < 4"
}
@@ -1196,12 +1300,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -1210,7 +1317,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 2 and v1.max_c > 120 or v1.a > 7"
},
@@ -1221,6 +1330,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and (t1.a < 2 and max_c > 120 or t1.a > 7)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -1230,7 +1340,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 2 or t1.a > 7"
}
@@ -1284,12 +1396,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -1298,7 +1413,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 2 and v1.max_c > 120 or v1.a > 7"
},
@@ -1309,6 +1426,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and (t1.a < 2 and max_c > 120 or t1.a > 7)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -1318,7 +1436,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 2 or t1.a > 7"
}
@@ -1361,12 +1481,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -1375,7 +1498,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 2 and v1.max_c < 200 or v1.a > 4"
},
@@ -1386,6 +1511,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and (t1.a < 2 and max_c < 200 or t1.a > 4 and max_c < 500)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -1395,7 +1521,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 2 or t1.a > 4"
}
@@ -1448,12 +1576,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -1462,7 +1593,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.max_c > 400 or v1.max_c < 135"
},
@@ -1473,6 +1606,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and (max_c > 400 or max_c < 135)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -1482,7 +1616,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1501,12 +1637,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -1515,7 +1654,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.max_c > 400 or v1.max_c < 135"
},
@@ -1526,6 +1667,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and (max_c > 400 or max_c < 135)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -1535,7 +1677,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1570,12 +1714,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a = 1 and t2.b is not null"
}
@@ -1589,12 +1736,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t2.b"],
+ "loops": 9,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 1",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.b",
@@ -1604,7 +1754,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1"
}
@@ -1635,12 +1787,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.d is not null"
}
@@ -1654,12 +1809,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["max_c"],
"ref": ["test.t2.d"],
+ "loops": 9,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 5 and v1.max_c = t2.d",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.b",
@@ -1669,7 +1827,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 5"
}
@@ -1707,12 +1867,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a < 5 and t2.a is not null"
}
@@ -1726,11 +1889,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -1740,7 +1906,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 5"
}
@@ -1769,12 +1937,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null and t2.a is not null"
}
@@ -1788,11 +1959,14 @@ EXPLAIN
"key_length": "10",
"used_key_parts": ["a", "b"],
"ref": ["test.t2.a", "test.t2.a"],
+ "loops": 9,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -1802,7 +1976,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = t1.a"
}
@@ -1836,12 +2012,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.c > 150 and t2.c is not null"
}
@@ -1855,11 +2034,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["max_c"],
"ref": ["test.t2.c"],
+ "loops": 9,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and max_c > 150",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -1869,7 +2051,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1899,12 +2083,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a = 3"
}
@@ -1914,7 +2101,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 3 and v1.b = 3"
},
@@ -1924,13 +2113,16 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 3 and t1.b = 3"
}
@@ -1959,12 +2151,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a = 2"
}
@@ -1974,7 +2169,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 1 and v1.b = 21"
},
@@ -1984,13 +2181,16 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.b = 21"
}
@@ -2025,17 +2225,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v.a = 'c' and v.b < 'Hermes'",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 9",
"filesort": {
"sort_key": "t1_char.b",
@@ -2045,7 +2249,9 @@ EXPLAIN
"table": {
"table_name": "t1_char",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1_char.a = 'c' and t1_char.b < 'Hermes'"
}
@@ -2062,7 +2268,9 @@ EXPLAIN
"table": {
"table_name": "t",
"access_type": "ALL",
+ "loops": 12,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -2100,7 +2308,7 @@ explain select * from v_decimal as v,t2_decimal as t where
(v.a=v.b) and (v.b=t.b) and ((t.b>1) or (v.a=1));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 6 test.t.b,test.t.b 2
+1 PRIMARY <derived2> ref key0 key0 6 test.t.b,test.t.b 1
2 DERIVED t1_decimal ALL NULL NULL NULL NULL 9 Using where; Using temporary; Using filesort
explain format=json select * from v_decimal as v,t2_decimal as t where
(v.a=v.b) and (v.b=t.b) and ((t.b>1) or (v.a=1));
@@ -2108,12 +2316,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t.b > 1 or t.b = 1) and t.b is not null and t.b is not null"
}
@@ -2127,11 +2338,14 @@ EXPLAIN
"key_length": "6",
"used_key_parts": ["a", "b"],
"ref": ["test.t.b", "test.t.b"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "avg_c > 12",
"filesort": {
"sort_key": "t1_decimal.a, t1_decimal.b",
@@ -2141,7 +2355,9 @@ EXPLAIN
"table": {
"table_name": "t1_decimal",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1_decimal.b = t1_decimal.a and (t1_decimal.a > 1 or t1_decimal.a = 1)"
}
@@ -2187,12 +2403,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a < 4 or t2.c > 150"
}
@@ -2202,7 +2421,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -2212,6 +2433,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and (t1.a < 4 or max_c > 150)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -2221,7 +2443,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -2256,12 +2480,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 5 and t2.c > 250 and t2.a is not null and t2.c is not null"
}
@@ -2275,11 +2502,14 @@ EXPLAIN
"key_length": "10",
"used_key_parts": ["a", "max_c"],
"ref": ["test.t2.a", "test.t2.c"],
+ "loops": 9,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and max_c > 250",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -2289,7 +2519,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -2336,12 +2568,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a = 8"
}
@@ -2351,7 +2586,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 8 and v1.max_c = 404"
},
@@ -2361,6 +2598,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c = 404",
"filesort": {
"sort_key": "t1.b",
@@ -2370,7 +2608,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 8"
}
@@ -2406,12 +2646,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.d is not null"
}
@@ -2425,12 +2668,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["max_c"],
"ref": ["test.t2.d"],
+ "loops": 9,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a > 3 and v1.max_c > 200 and t2.b < v1.b and t2.d = v1.max_c",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and max_c > 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -2440,7 +2686,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 3"
}
@@ -2468,7 +2716,7 @@ explain select * from v_double as v,t2_double as t where
(v.b=v.c) and (v.c=t.c) and ((t.c>10) or (v.a=1));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 18 test.t.c,test.t.c 2 Using where
+1 PRIMARY <derived2> ref key0 key0 18 test.t.c,test.t.c 1 Using where
2 DERIVED t1_double ALL NULL NULL NULL NULL 9 Using where; Using temporary; Using filesort
explain format=json select * from v_double as v,t2_double as t where
(v.b=v.c) and (v.c=t.c) and ((t.c>10) or (v.a=1));
@@ -2476,12 +2724,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.c is not null and t.c is not null"
}
@@ -2495,12 +2746,15 @@ EXPLAIN
"key_length": "18",
"used_key_parts": ["b", "c"],
"ref": ["test.t.c", "test.t.c"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.c > 10 or v.a = 1",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "avg_a < 22.333 and (t1_double.b > 10 or t1_double.a = 1)",
"filesort": {
"sort_key": "t1_double.b, t1_double.c",
@@ -2510,7 +2764,9 @@ EXPLAIN
"table": {
"table_name": "t1_double",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1_double.c = t1_double.b and t1_double.b > 12.2"
}
@@ -2543,7 +2799,7 @@ explain select * from v_double as v,t2_double as t where
(((v.a>0.2) or (v.b<17)) or (t.c>17)) and (t.c=v.c) and (v.c>18);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 9 test.t.c 2 Using where
+1 PRIMARY <derived2> ref key0 key0 9 test.t.c 1 Using where
2 DERIVED t1_double ALL NULL NULL NULL NULL 9 Using where; Using temporary; Using filesort
explain format=json select * from v_double as v,t2_double as t where
(((v.a>0.2) or (v.b<17)) or (t.c>17)) and (t.c=v.c) and (v.c>18);
@@ -2551,12 +2807,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.c > 18 and t.c is not null"
}
@@ -2570,12 +2829,15 @@ EXPLAIN
"key_length": "9",
"used_key_parts": ["c"],
"ref": ["test.t.c"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v.a > 0.2 or v.b < 17 or t.c > 17",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "avg_a < 22.333 and (t1_double.a > 0.2 or t1_double.b < 17 or t1_double.c > 17)",
"filesort": {
"sort_key": "t1_double.b, t1_double.c",
@@ -2585,7 +2847,9 @@ EXPLAIN
"table": {
"table_name": "t1_double",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1_double.b > 12.2 and t1_double.c > 18"
}
@@ -2657,17 +2921,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(v.a > 4 or v.a = 2 or v.b > 3) and v.avg_c = 13",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "avg_c > 12 and avg_c = 13",
"filesort": {
"sort_key": "t1_decimal.a, t1_decimal.b",
@@ -2677,7 +2945,9 @@ EXPLAIN
"table": {
"table_name": "t1_decimal",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1_decimal.a > 4 or t1_decimal.a = 2 or t1_decimal.b > 3"
}
@@ -2694,7 +2964,9 @@ EXPLAIN
"table": {
"table_name": "t",
"access_type": "ALL",
+ "loops": 9,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -2731,12 +3003,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null and t2.a is not null"
}
@@ -2750,12 +3025,15 @@ EXPLAIN
"key_length": "10",
"used_key_parts": ["a", "b"],
"ref": ["test.t2.a", "test.t2.a"],
+ "loops": 9,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.max_c > 300",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and max_c > 300",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -2765,7 +3043,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = t1.a and t1.a > 5"
}
@@ -2807,12 +3087,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a < 2 and t2.c > 900"
}
@@ -2822,7 +3105,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -2831,6 +3116,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -2840,7 +3126,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -2874,12 +3162,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null and t2.b is not null"
}
@@ -2893,11 +3184,14 @@ EXPLAIN
"key_length": "10",
"used_key_parts": ["a", "b"],
"ref": ["test.t2.a", "test.t2.b"],
+ "loops": 9,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -2907,7 +3201,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -2955,12 +3251,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -2969,7 +3268,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -2979,6 +3280,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -2988,7 +3290,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -3060,12 +3364,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -3074,7 +3381,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -3084,6 +3393,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -3093,7 +3403,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -3137,12 +3449,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a < 2 and t2.c > 900"
}
@@ -3152,7 +3467,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -3162,6 +3479,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -3171,7 +3489,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -3214,12 +3534,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null and t2.a is not null"
}
@@ -3233,11 +3556,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -3247,7 +3573,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -3267,12 +3595,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 18,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.b < 50",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -3282,7 +3613,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5 and t1.b < 50"
}
@@ -3345,12 +3678,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b < 50"
}
@@ -3360,7 +3696,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -3370,6 +3708,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -3379,7 +3718,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -3399,12 +3740,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["v1.b"],
+ "loops": 180,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.a = v1.a or v1.a = t2.a",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -3414,7 +3758,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -3457,12 +3803,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -3471,7 +3820,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -3481,6 +3832,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -3490,7 +3842,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -3506,7 +3860,9 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 180,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "incremental",
@@ -3516,6 +3872,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -3525,7 +3882,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -3572,12 +3931,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -3586,7 +3948,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.max_c < 300"
},
@@ -3596,6 +3960,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and max_c < 300",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -3605,7 +3970,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -3621,7 +3988,9 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 180,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.b < 50 or v2.b = 19"
},
@@ -3632,6 +4001,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -3641,7 +4011,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5 and (t1.b < 50 or t1.b = 19)"
}
@@ -3679,12 +4051,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null and t2.a is not null and t2.a is not null"
}
@@ -3698,11 +4073,14 @@ EXPLAIN
"key_length": "10",
"used_key_parts": ["a", "b"],
"ref": ["test.t2.a", "test.t2.a"],
+ "loops": 9,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -3712,7 +4090,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = t1.a"
}
@@ -3733,12 +4113,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 18,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.max_c < 300",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and max_c < 300",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -3748,7 +4131,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -3783,12 +4168,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -3797,7 +4185,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 1 and v1.b > 10"
},
@@ -3808,6 +4198,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.b",
@@ -3817,7 +4208,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.b > 10"
}
@@ -3838,11 +4231,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["v1.b"],
+ "loops": 180,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -3852,7 +4248,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5 and t1.b > 10"
}
@@ -3898,17 +4296,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v.a = 'b' and (v.b = 'Vika' or v.b = 'Ali')",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 9",
"filesort": {
"sort_key": "t1_char.b",
@@ -3918,7 +4320,9 @@ EXPLAIN
"table": {
"table_name": "t1_char",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1_char.a = 'b' and (t1_char.b = 'Vika' or t1_char.b = 'Ali')"
}
@@ -3935,7 +4339,9 @@ EXPLAIN
"table": {
"table_name": "t",
"access_type": "ALL",
+ "loops": 12,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.a = 'b'"
},
@@ -4005,12 +4411,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -4024,12 +4433,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v3.b < 50 or v3.b = 33",
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "min_c > 109",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -4039,7 +4451,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 10 and (t1.b < 50 or t1.b = 33)"
}
@@ -4056,7 +4470,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 18,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.max_c < 500"
},
@@ -4066,6 +4482,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and max_c < 500",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -4075,7 +4492,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -4091,7 +4510,9 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 360,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.max_c > 300"
},
@@ -4102,6 +4523,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and max_c > 300",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -4111,7 +4533,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -4164,12 +4588,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b is not null"
}
@@ -4183,12 +4610,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t2.b"],
+ "loops": 9,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.max_c > 130 and v1.a is not null",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and max_c > 130",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -4198,7 +4628,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -4219,12 +4651,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["v1.a"],
+ "loops": 18,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.min_c < 130",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "min_c < 707 and min_c < 130",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -4234,7 +4669,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -4320,12 +4757,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -4334,7 +4774,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.avg_c < 400 or v1.a > 1"
},
@@ -4345,6 +4787,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and (avg_c < 400 or t1.a > 1)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -4354,7 +4797,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -4375,12 +4820,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["v1.a"],
+ "loops": 180,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.min_c < 200",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "min_c < 707 and min_c < 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -4390,7 +4838,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -4411,12 +4861,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["v1.b"],
+ "loops": 360,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v3.avg_c > 170 or v3.a < 5",
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "avg_c > 170 or t1.a < 5",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -4426,7 +4879,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 8"
}
@@ -4487,12 +4942,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -4501,7 +4959,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(v1.a = 1 or v1.max_c < 300) and v1.b > 25"
},
@@ -4512,6 +4972,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and (t1.a = 1 or max_c < 300)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -4521,7 +4982,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 25"
}
@@ -4568,12 +5031,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -4587,12 +5053,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.max_c > 300 and v1.b < 30",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and max_c > 300",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -4602,7 +5071,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5 and t1.b < 30"
}
@@ -4656,12 +5127,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.c > 800 and t2.b is not null"
}
@@ -4675,12 +5149,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t2.b"],
+ "loops": 9,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 5",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -4690,7 +5167,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 5"
}
@@ -4709,12 +5188,15 @@ EXPLAIN
"query_block": {
"select_id": 2,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.d > 800"
}
@@ -4724,7 +5206,9 @@ EXPLAIN
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.max_c > 100 and v1.a > 7"
},
@@ -4734,6 +5218,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and max_c > 100",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -4743,7 +5228,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 7"
}
@@ -4820,12 +5307,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b = 19"
}
@@ -4835,7 +5325,9 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.b = 19 and v1.a < 5"
},
@@ -4845,6 +5337,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a",
@@ -4854,7 +5347,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = 19 and t1.a < 5"
}
@@ -4873,12 +5368,15 @@ EXPLAIN
"query_block": {
"select_id": 2,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -4887,7 +5385,9 @@ EXPLAIN
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.max_c > 400 or v1.avg_c > 270"
},
@@ -4898,6 +5398,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and (max_c > 400 or avg_c > 270)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -4907,7 +5408,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -4995,12 +5498,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -5009,7 +5515,9 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 1 or v1.a = 6"
},
@@ -5020,6 +5528,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -5029,7 +5538,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 or t1.a = 6"
}
@@ -5048,12 +5559,15 @@ EXPLAIN
"query_block": {
"select_id": 2,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -5062,7 +5576,9 @@ EXPLAIN
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a > 3 and v1.b > 27 or v1.max_c > 550"
},
@@ -5073,6 +5589,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and (t1.a > 3 and t1.b > 27 or max_c > 550)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -5082,7 +5599,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -5171,12 +5690,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a = 1"
}
@@ -5186,7 +5708,9 @@ EXPLAIN
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 1 and (v1.max_c < 500 or v1.avg_c > 500)"
},
@@ -5197,6 +5721,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and (max_c < 500 or avg_c > 500)",
"filesort": {
"sort_key": "t1.b",
@@ -5206,7 +5731,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1"
}
@@ -5225,12 +5752,15 @@ EXPLAIN
"query_block": {
"select_id": 2,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a < 2"
}
@@ -5240,7 +5770,9 @@ EXPLAIN
"table": {
"table_name": "<derived5>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.b > 10"
},
@@ -5251,6 +5783,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 5,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -5260,7 +5793,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5 and t1.b > 10"
}
@@ -5279,12 +5814,15 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.c is not null"
}
@@ -5298,12 +5836,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["max_c"],
"ref": ["test.t2.c"],
+ "loops": 9,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.b < 10",
"materialized": {
"query_block": {
"select_id": 6,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -5313,7 +5854,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5 and t1.b < 10"
}
@@ -5368,12 +5911,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -5382,7 +5928,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 40,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v_union.a < 3 and v_union.c > 100"
},
@@ -5398,6 +5946,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 109 and c > 100",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -5407,7 +5956,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 10 and t1.a < 3"
}
@@ -5421,6 +5972,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and c > 100",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -5430,7 +5982,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a < 3"
}
@@ -5490,12 +6044,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -5504,7 +6061,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 40,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(v_union.a < 2 or v_union.c > 800) and v_union.b > 12"
},
@@ -5521,6 +6080,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 109 and (t1.a < 2 or c > 800)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -5530,7 +6090,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 10 and t1.b > 12"
}
@@ -5544,6 +6106,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and (t1.a < 2 or c > 800)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -5553,7 +6116,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.b > 12"
}
@@ -5590,7 +6155,7 @@ explain select * from v_union,t2 where
(v_union.a=1) and (v_union.a=t2.a) and (v_union.c<200);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 40 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY <derived2> ALL distinct_key NULL NULL NULL 40 Using where; Using join buffer (flat, BNL join)
2 DERIVED t1 ALL NULL NULL NULL NULL 20 Using where; Using temporary; Using filesort
3 UNION t1 ALL NULL NULL NULL NULL 20 Using where; Using temporary; Using filesort
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
@@ -5600,12 +6165,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a = 1"
}
@@ -5615,7 +6183,10 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "possible_keys": ["distinct_key"],
+ "loops": 9,
"rows": 40,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v_union.a = 1 and v_union.c < 200"
},
@@ -5631,6 +6202,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 109 and c < 200",
"filesort": {
"sort_key": "t1.b",
@@ -5640,7 +6212,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1"
}
@@ -5654,6 +6228,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and c < 200",
"filesort": {
"sort_key": "t1.b",
@@ -5663,7 +6238,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.b > 10"
}
@@ -5700,7 +6277,7 @@ explain select * from v_char as v,t2_char as t where
(v.a=t.a) and (v.b='Vika') and (v.max_c>2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t ALL NULL NULL NULL NULL 12 Using where
-1 PRIMARY <derived2> ref key0 key0 2 test.t.a 2 Using where
+1 PRIMARY <derived2> ref key0 key0 2 test.t.a 1 Using where
2 DERIVED t1_char ALL NULL NULL NULL NULL 12 Using where; Using temporary; Using filesort
explain format=json select * from v_char as v,t2_char as t where
(v.a=t.a) and (v.b='Vika') and (v.max_c>2);
@@ -5708,12 +6285,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.a is not null"
}
@@ -5727,12 +6307,15 @@ EXPLAIN
"key_length": "2",
"used_key_parts": ["a"],
"ref": ["test.t.a"],
- "rows": 2,
+ "loops": 12,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v.b = 'Vika' and v.max_c > 2",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 9 and max_c > 2",
"filesort": {
"sort_key": "t1_char.a",
@@ -5742,7 +6325,9 @@ EXPLAIN
"table": {
"table_name": "t1_char",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1_char.b = 'Vika'"
}
@@ -5779,7 +6364,7 @@ and ((v_union.c>800) or (v1.max_c>200));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
1 PRIMARY <derived4> ALL NULL NULL NULL NULL 20 Using where; Using join buffer (flat, BNL join)
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 40 Using where; Using join buffer (incremental, BNL join)
+1 PRIMARY <derived2> ALL distinct_key NULL NULL NULL 40 Using where; Using join buffer (incremental, BNL join)
4 DERIVED t1 ALL NULL NULL NULL NULL 20 Using where; Using temporary; Using filesort
2 DERIVED t1 ALL NULL NULL NULL NULL 20 Using where; Using temporary; Using filesort
3 UNION t1 ALL NULL NULL NULL NULL 20 Using where; Using temporary; Using filesort
@@ -5791,12 +6376,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a = 1"
}
@@ -5806,7 +6394,9 @@ EXPLAIN
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 1"
},
@@ -5816,6 +6406,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.b",
@@ -5825,7 +6416,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1"
}
@@ -5842,7 +6435,10 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "possible_keys": ["distinct_key"],
+ "loops": 180,
"rows": 40,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v_union.a = 1"
},
@@ -5859,6 +6455,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 109",
"filesort": {
"sort_key": "t1.b",
@@ -5868,7 +6465,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1"
}
@@ -5882,6 +6481,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"having_condition": "c < 300",
"filesort": {
"sort_key": "t1.b",
@@ -5891,7 +6491,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.b > 10"
}
@@ -5936,7 +6538,7 @@ explain select * from v2_union as v,t2 where
((v.a=6) or (v.a=8)) and (v.c>200) and (v.a=t2.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 6 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 6 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 20 Using where; Using temporary; Using filesort
3 UNION t1 ALL NULL NULL NULL NULL 20 Using where; Using temporary; Using filesort
4 UNION t1 ALL NULL NULL NULL NULL 20 Using where; Using temporary; Using filesort
@@ -5947,12 +6549,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t2.a = 6 or t2.a = 8) and t2.a is not null"
}
@@ -5961,12 +6566,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 6,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v.c > 200",
"materialized": {
@@ -5978,6 +6585,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 109 and c > 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -5987,7 +6595,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 10 and (t1.a = 6 or t1.a = 8)"
}
@@ -6001,6 +6611,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and c > 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -6010,7 +6621,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and (t1.a = 6 or t1.a = 8)"
}
@@ -6024,6 +6637,7 @@ EXPLAIN
"query_block": {
"select_id": 4,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"having_condition": "c < 707 and c > 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -6033,7 +6647,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c > 300 and (t1.a = 6 or t1.a = 8)"
}
@@ -6125,7 +6741,7 @@ a b c a b c d
explain select * from v3_union as v,t2 where (v.a=t2.a) and (v.c>6);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 4 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 4 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 20 Using where
3 UNION t1 ALL NULL NULL NULL NULL 20 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
@@ -6134,12 +6750,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -6148,12 +6767,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v.c > 6",
"materialized": {
@@ -6165,12 +6786,15 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 10 and t1.a + 1 > 6"
}
@@ -6182,12 +6806,15 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.c > 100 and t1.c > 6"
}
@@ -6257,7 +6884,7 @@ a b c a b c d
explain select * from v3_union as v,t2 where (v.a=t2.a) and ((t2.a>1) or (v.b<20));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 4 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 4 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 20 Using where
3 UNION t1 ALL NULL NULL NULL NULL 20 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
@@ -6266,12 +6893,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -6280,12 +6910,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 1 or v.b < 20",
"materialized": {
@@ -6297,12 +6929,15 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 10 and (t1.a > 1 or t1.b < 20)"
}
@@ -6314,12 +6949,15 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.c > 100 and (t1.a > 1 or t1.b < 20)"
}
@@ -6356,7 +6994,7 @@ explain select * from v3_union as v,t2 where
(v.a=t2.a) and ((v.b=19) or (v.b=21)) and ((v.c<3) or (v.c>600));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 4 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 4 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 20 Using where
3 UNION t1 ALL NULL NULL NULL NULL 20 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
@@ -6366,12 +7004,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -6380,12 +7021,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(v.b = 19 or v.b = 21) and (v.c < 3 or v.c > 600)",
"materialized": {
@@ -6397,12 +7040,15 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 10 and (t1.b = 19 or t1.b = 21) and (t1.a + 1 < 3 or t1.a + 1 > 600)"
}
@@ -6414,12 +7060,15 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.c > 100 and (t1.b = 19 or t1.b = 21) and (t1.c < 3 or t1.c > 600)"
}
@@ -6454,7 +7103,7 @@ a b c a b c d
explain select * from v4_union as v,t2 where (v.a=t2.a) and (v.b<20);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 4 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 4 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 20 Using where; Using temporary; Using filesort
3 UNION t1 ALL NULL NULL NULL NULL 20 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
@@ -6463,12 +7112,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -6477,12 +7129,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v.b < 20",
"materialized": {
@@ -6494,6 +7148,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 109",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -6503,7 +7158,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 10 and t1.b < 20"
}
@@ -6517,12 +7174,15 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.b < 20"
}
@@ -6575,7 +7235,7 @@ explain select * from v4_union as v,t2 where
(v.a=t2.a) and ((t2.a<3) or (v.b<40)) and (v.c>500);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 4 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 4 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 20 Using where; Using temporary; Using filesort
3 UNION t1 ALL NULL NULL NULL NULL 20 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
@@ -6585,12 +7245,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -6599,12 +7262,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t2.a < 3 or v.b < 40) and v.c > 500",
"materialized": {
@@ -6616,6 +7281,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 109 and c > 500",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -6625,7 +7291,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 10 and (t1.a < 3 or t1.b < 40)"
}
@@ -6639,12 +7307,15 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and (t1.a < 3 or t1.b < 40) and t1.c + 100 > 500"
}
@@ -6709,17 +7380,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v4.a < 13",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "v1.a, v1.b",
"temporary_table": {
@@ -6728,12 +7403,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 15 and v1.a < 13",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -6743,7 +7421,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 15 and t1.a < 13"
}
@@ -6767,7 +7447,9 @@ EXPLAIN
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 20,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a > 5 and v1.b > 12"
},
@@ -6777,6 +7459,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -6786,7 +7469,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5 and t1.b > 12"
}
@@ -6829,12 +7514,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null and t2.a is not null"
}
@@ -6848,11 +7536,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "v1.a, v1.b",
"temporary_table": {
@@ -6861,12 +7552,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 15",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -6876,7 +7570,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 15"
}
@@ -6904,12 +7600,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 18,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.b > 30",
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -6919,7 +7618,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 30"
}
@@ -6964,12 +7665,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 1 and t2.a is not null and t2.a is not null"
}
@@ -6983,12 +7687,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v4.min_c > 100",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "min_c > 100",
"filesort": {
"sort_key": "v1.a, v1.b",
@@ -6998,12 +7705,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 15 and v1.a > 1",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -7013,7 +7723,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 15 and t1.a > 1"
}
@@ -7041,12 +7753,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 18,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.b < 30",
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -7056,7 +7771,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1 and t1.b < 30"
}
@@ -7186,12 +7903,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -7200,7 +7920,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v4.b > 10 and v4.a > 1 or v4.b < 20"
},
@@ -7211,6 +7933,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "v1.a, v1.b",
"temporary_table": {
@@ -7219,12 +7942,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 15 and (v1.b > 10 and v1.a > 1 or v1.b < 20)",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -7234,7 +7960,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 15 and (t1.b > 10 and t1.a > 1 or t1.b < 20)"
}
@@ -7262,12 +7990,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["v4.a"],
+ "loops": 180,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.max_c > 200",
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and max_c > 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -7277,7 +8008,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -7315,17 +8048,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v4.a > 12 and v4.min_c < 300 and v4.b > 13 or v4.a < 1",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "v1.a > 12 and min_c < 300 and v1.b > 13 or v1.a < 1",
"filesort": {
"sort_key": "v1.a, v1.b",
@@ -7335,12 +8072,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 15 and (v1.a > 12 and v1.b > 13 or v1.a < 1)",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -7350,7 +8090,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 15 and (t1.a > 12 and t1.b > 13 or t1.a < 1)"
}
@@ -7374,7 +8116,9 @@ EXPLAIN
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 20,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -7383,6 +8127,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -7392,7 +8137,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -7432,17 +8179,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v4.b = v4.a and v4.min_c < 100 and v4.a is not null",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "min_c < 100",
"filesort": {
"sort_key": "v1.a, v1.b",
@@ -7452,12 +8203,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.b = v1.a and v1.a < 15",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -7467,7 +8221,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = t1.a and t1.a < 15"
}
@@ -7495,11 +8251,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["v4.a"],
+ "loops": 20,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -7509,7 +8268,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -7549,17 +8310,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v4.b = v4.a and v4.a < 30 and v4.a is not null",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "v1.a, v1.b",
"temporary_table": {
@@ -7568,12 +8333,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.b = v1.a and v1.a < 15 and v1.a < 30",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -7583,7 +8351,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = t1.a and t1.a < 15 and t1.a < 30"
}
@@ -7611,11 +8381,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["v4.a"],
+ "loops": 20,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -7625,7 +8398,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5 and t1.b < 30"
}
@@ -7665,17 +8440,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v4.b = v4.a and (v4.a < 30 or v4.a > 2) and v4.a is not null",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "v1.a, v1.b",
"temporary_table": {
@@ -7684,12 +8463,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.b = v1.a and v1.a < 15 and (v1.a < 30 or v1.a > 2)",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -7699,7 +8481,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = t1.a and t1.a < 15 and (t1.a < 30 or t1.a > 2)"
}
@@ -7727,11 +8511,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["v4.a"],
+ "loops": 20,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -7741,7 +8528,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5 and (t1.b < 30 or t1.b > 2)"
}
@@ -7789,17 +8578,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(v4.a < 12 and v4.b > 13 or v4.a > 10) and v4.min_c > 100 and v4.min_c is not null",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "min_c > 100",
"filesort": {
"sort_key": "v1.a, v1.b",
@@ -7809,12 +8602,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 15 and (v1.a < 12 and v1.b > 13 or v1.a > 10)",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -7824,7 +8620,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 15 and (t1.a < 12 and t1.b > 13 or t1.a > 10)"
}
@@ -7852,11 +8650,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["max_c"],
"ref": ["v4.min_c"],
+ "loops": 20,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707 and max_c > 100",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -7866,7 +8667,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -7913,12 +8716,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.c > 100 and t2.c is not null"
}
@@ -7932,12 +8738,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["min_c"],
"ref": ["test.t2.c"],
+ "loops": 9,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v4.a < 12 and t2.b > 13 or v4.a > 10",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "min_c > 100",
"filesort": {
"sort_key": "v1.a, v1.b",
@@ -7947,12 +8756,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 15 and (v1.a < 12 or v1.a > 10)",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -7962,7 +8774,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 15 and (t1.a < 12 or t1.a > 10)"
}
@@ -7986,7 +8800,9 @@ EXPLAIN
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 18,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -7995,6 +8811,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 707",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -8004,7 +8821,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 5"
}
@@ -8159,6 +8978,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"const_condition": "0 or <in_optimizer>(2,<exists>(subquery#3))",
"nested_loop": [
{
@@ -8173,8 +8993,10 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
- "filtered": 100,
+ "cost": "COST_REPLACED",
+ "filtered": 50,
"attached_condition": "t2.b = 2",
"first_match": "t1"
}
@@ -8184,6 +9006,7 @@ EXPLAIN
{
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -8194,17 +9017,22 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["c"],
"ref": ["func"],
- "rows": 2,
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 5,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.c = 2"
}
@@ -8246,7 +9074,7 @@ SELECT d FROM v4 WHERE s > a
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; FirstMatch(t1)
-3 DEPENDENT SUBQUERY <derived5> index_subquery key0 key0 5 func 2 Using where
+3 DEPENDENT SUBQUERY <derived5> index_subquery key0 key0 5 func 1 Using where
5 DERIVED t4 ALL NULL NULL NULL NULL 5 Using temporary; Using filesort
explain format=json SELECT * FROM t1 WHERE a IN (
SELECT b FROM v2 WHERE b < a OR b IN (
@@ -8257,6 +9085,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"const_condition": "0 or <in_optimizer>(2,<exists>(subquery#3))",
"nested_loop": [
{
@@ -8271,8 +9100,10 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
- "filtered": 100,
+ "cost": "COST_REPLACED",
+ "filtered": 50,
"attached_condition": "t2.b = 2",
"first_match": "t1"
}
@@ -8282,6 +9113,7 @@ EXPLAIN
{
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -8292,11 +9124,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["func"],
- "rows": 2,
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 5,
+ "cost": "COST_REPLACED",
"having_condition": "s > 2",
"filesort": {
"sort_key": "t4.d",
@@ -8306,7 +9141,9 @@ EXPLAIN
"table": {
"table_name": "t4",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -8361,23 +9198,29 @@ EXPLAIN
{
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.b = 1",
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b = 1"
}
@@ -8416,12 +9259,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -8434,18 +9280,23 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t1.a"],
- "rows": 2,
+ "loops": 2,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "trigcond(v2.b is null) and trigcond(trigcond(t1.a is not null))",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -8471,23 +9322,29 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "<nop>(v1.i <= 3)",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "<nop>(t1.i <= 3)"
}
@@ -8532,12 +9389,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "<in_optimizer>(t1.b,<exists>(subquery#2)) or t1.b = 100"
}
@@ -8547,6 +9407,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -8557,17 +9418,22 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["pk2"],
"ref": ["func"],
- "rows": 2,
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -8594,12 +9460,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "<in_optimizer>(t1.b,<exists>(subquery#3)) or t1.b = 100"
}
@@ -8609,6 +9478,7 @@ EXPLAIN
{
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -8619,17 +9489,22 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["pk2"],
"ref": ["func"],
- "rows": 2,
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -8678,23 +9553,29 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 50",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 50"
}
@@ -8736,17 +9617,21 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.s < 50",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "s < 50",
"filesort": {
"sort_key": "t3.a",
@@ -8756,7 +9641,9 @@ EXPLAIN
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -8794,13 +9681,14 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<subquery2>",
"access_type": "system",
- "rows": 1,
- "filtered": 100,
+ "rows": 0,
+ "filtered": 0,
"materialized": {
"unique": 1,
"query_block": {
@@ -8819,18 +9707,23 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.b = 2",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = 2"
}
@@ -8864,13 +9757,14 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<subquery2>",
"access_type": "system",
- "rows": 1,
- "filtered": 100,
+ "rows": 0,
+ "filtered": 0,
"materialized": {
"unique": 1,
"query_block": {
@@ -8886,18 +9780,23 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.f = 2",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.f = 2"
}
@@ -8912,7 +9811,9 @@ EXPLAIN
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 2,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.pk > 2"
},
@@ -8922,6 +9823,7 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -8931,7 +9833,9 @@ EXPLAIN
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["pk"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t.pk > 2"
}
@@ -8964,13 +9868,14 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<subquery3>",
"access_type": "system",
- "rows": 1,
- "filtered": 100,
+ "rows": 0,
+ "filtered": 0,
"materialized": {
"unique": 1,
"query_block": {
@@ -8986,18 +9891,23 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "sq.i = 3",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.i = 3"
}
@@ -9031,13 +9941,14 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<subquery3>",
"access_type": "system",
- "rows": 1,
- "filtered": 100,
+ "rows": 0,
+ "filtered": 0,
"materialized": {
"unique": 1,
"query_block": {
@@ -9053,18 +9964,23 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "sq.i = 2.71",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.i = 2.7100000381469727"
}
@@ -9093,13 +10009,14 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<subquery3>",
"access_type": "system",
- "rows": 1,
- "filtered": 100,
+ "rows": 0,
+ "filtered": 0,
"materialized": {
"unique": 1,
"query_block": {
@@ -9115,18 +10032,23 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "sq.i = 3.21",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.i = 3.21"
}
@@ -9155,13 +10077,14 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<subquery3>",
"access_type": "system",
- "rows": 1,
- "filtered": 100,
+ "rows": 0,
+ "filtered": 0,
"materialized": {
"unique": 1,
"query_block": {
@@ -9177,18 +10100,23 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "sq.i = 'aa'",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.i = 'aa'"
}
@@ -9219,13 +10147,14 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<subquery3>",
"access_type": "system",
- "rows": 1,
- "filtered": 100,
+ "rows": 0,
+ "filtered": 0,
"materialized": {
"unique": 1,
"query_block": {
@@ -9241,18 +10170,23 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "sq.i = '2007-05-28 00:00:00'",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.i = TIMESTAMP'2007-05-28 00:00:00'"
}
@@ -9281,13 +10215,14 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<subquery3>",
"access_type": "system",
- "rows": 1,
- "filtered": 100,
+ "rows": 0,
+ "filtered": 0,
"materialized": {
"unique": 1,
"query_block": {
@@ -9303,18 +10238,23 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "sq.i = '2007-05-28'",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.i = DATE'2007-05-28'"
}
@@ -9343,13 +10283,14 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<subquery3>",
"access_type": "system",
- "rows": 1,
- "filtered": 100,
+ "rows": 0,
+ "filtered": 0,
"materialized": {
"unique": 1,
"query_block": {
@@ -9365,18 +10306,23 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "sq.i = '10:00:02'",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.i = TIME'10:00:02'"
}
@@ -9405,23 +10351,29 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "nullif(1,v1.i)",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "nullif(1,t1.i)"
}
@@ -9500,23 +10452,29 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c = 'foo'",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c = 'foo'"
}
@@ -9531,12 +10489,15 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "1 = t2.a"
}
@@ -9561,23 +10522,29 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "<cache>(<in_optimizer>(1,<exists>(subquery#2))) or v1.c = 'foo'",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -9591,12 +10558,15 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 128,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "1 = t2.a"
}
@@ -9737,12 +10707,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 2 and t1.a is not null"
}
@@ -9756,11 +10729,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t1.a"],
- "rows": 2,
+ "loops": 7,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t2.b",
"temporary_table": {
@@ -9769,7 +10745,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b > 2"
}
@@ -9797,12 +10775,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 2 and t1.a is not null"
}
@@ -9816,11 +10797,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t1.a"],
- "rows": 2,
+ "loops": 7,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t2.b",
"temporary_table": {
@@ -9829,7 +10813,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b > 2"
}
@@ -9860,12 +10846,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 2 and t1.a is not null"
}
@@ -9879,18 +10868,23 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t1.a"],
- "rows": 2,
+ "loops": 7,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b > 2"
}
@@ -9917,12 +10911,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 2 and t1.a is not null"
}
@@ -9936,11 +10933,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["m"],
"ref": ["test.t1.a"],
- "rows": 2,
+ "loops": 7,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "m > 2",
"filesort": {
"sort_key": "t2.b",
@@ -9950,7 +10950,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -9980,24 +10982,30 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.f > 0",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "f > 0",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -10028,6 +11036,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -10038,7 +11047,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["i1"],
"ref": ["const"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"using_index": true
}
@@ -10048,7 +11059,9 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.i2 = 1"
},
@@ -10058,12 +11071,15 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.i2 = 1"
}
@@ -10096,24 +11112,30 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.f = 'a' or t.f = 'b'",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -10151,12 +11173,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.id2 is not null"
}
@@ -10170,12 +11195,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["id2"],
"ref": ["test.t1.id2"],
- "rows": 2,
+ "loops": 4,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "vc.ct > 0",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "ct > 0",
"filesort": {
"sort_key": "t2.id2",
@@ -10185,7 +11213,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -10250,12 +11280,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.x = 1"
}
@@ -10265,7 +11298,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 2,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 1 and v1.b = 1 and v1.max_c > 30"
},
@@ -10275,13 +11310,16 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c > 37 and max_c > 30",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.b = 1"
}
@@ -10335,12 +11373,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.x = 1"
}
@@ -10350,7 +11391,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 2,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 1 and v1.b = 1 and v1.d = 1 and v1.max_c > 30"
},
@@ -10360,13 +11403,16 @@ EXPLAIN
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c > 37 and max_c > 30",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.b = 1 and t1.d = 1"
}
@@ -10433,7 +11479,7 @@ WHERE d_tab.e>1
;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 5 Using where
-1 PRIMARY <derived3> ref key0 key0 10 test.t1.a,test.t1.b 2 FirstMatch(t1)
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 10 test.t1.a,test.t1.b 1
3 DERIVED t2 ALL NULL NULL NULL NULL 5 Using where; Using temporary; Using filesort
EXPLAIN FORMAT=JSON SELECT * FROM t1
WHERE (t1.a,t1.b) IN
@@ -10452,12 +11498,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1 and t1.a is not null and t1.b is not null"
}
@@ -10465,18 +11514,20 @@ EXPLAIN
{
"table": {
"table_name": "<derived3>",
- "access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "access_type": "eq_ref",
+ "possible_keys": ["distinct_key"],
+ "key": "distinct_key",
"key_length": "10",
"used_key_parts": ["e", "max_f"],
"ref": ["test.t1.a", "test.t1.b"],
- "rows": 2,
+ "loops": 5,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
- "first_match": "t1",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_f > 18",
"filesort": {
"sort_key": "t2.e",
@@ -10486,7 +11537,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e > 1"
}
@@ -10532,7 +11585,7 @@ WHERE d_tab.max_f<25
;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 5 Using where
-1 PRIMARY <derived3> ref key0 key0 10 test.t1.a,test.t1.b 2 FirstMatch(t1)
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 10 test.t1.a,test.t1.b 1
3 DERIVED t2 ALL NULL NULL NULL NULL 5 Using temporary; Using filesort
EXPLAIN FORMAT=JSON SELECT * FROM t1
WHERE (t1.a,t1.b) IN
@@ -10551,12 +11604,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b < 25 and t1.a is not null and t1.b is not null"
}
@@ -10564,18 +11620,20 @@ EXPLAIN
{
"table": {
"table_name": "<derived3>",
- "access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "access_type": "eq_ref",
+ "possible_keys": ["distinct_key"],
+ "key": "distinct_key",
"key_length": "10",
"used_key_parts": ["e", "max_f"],
"ref": ["test.t1.a", "test.t1.b"],
- "rows": 2,
+ "loops": 5,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
- "first_match": "t1",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_f > 18 and max_f < 25",
"filesort": {
"sort_key": "t2.e",
@@ -10585,7 +11643,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -10649,12 +11709,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a is not null and t1.b is not null"
}
@@ -10668,24 +11731,30 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["e", "max_f"],
"ref": ["test.t1.a", "test.t1.b"],
+ "loops": 5,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "d_tab.e > 1",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t2.e",
"temporary_table": {
@@ -10694,7 +11763,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e > 1"
}
@@ -10765,12 +11836,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a is not null and t1.b is not null"
}
@@ -10784,24 +11858,30 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["e", "max_f"],
"ref": ["test.t1.a", "test.t1.b"],
+ "loops": 5,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "d_tab.max_f > 20",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_f > 20",
"filesort": {
"sort_key": "t2.e",
@@ -10811,7 +11891,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -10873,17 +11955,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "dt.a = 2",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "a = 2",
"filesort": {
"sort_key": "t1.a",
@@ -10893,7 +11979,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -10930,17 +12018,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "dt.a > 1",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "a > 1",
"filesort": {
"sort_key": "t1.a",
@@ -10950,7 +12042,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 3"
}
@@ -10987,17 +12081,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "dt.a = 'ab'",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -11006,7 +12104,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -11042,17 +12142,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "dt.a = 1",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -11061,7 +12165,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -11117,12 +12223,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "1 in (0,t1.a) and t1.a is not null"
}
@@ -11136,11 +12245,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t1.a"],
- "rows": 2,
+ "loops": 2,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -11149,7 +12261,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "1 in (0,t1.a) and 1 in (0,t1.a)"
}
@@ -11185,12 +12299,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a in (1,t1.a) and t1.a is not null"
}
@@ -11204,11 +12321,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t1.a"],
- "rows": 2,
+ "loops": 2,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -11217,7 +12337,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a in (1,t1.a)"
}
@@ -11316,17 +12438,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.a <= 2",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -11335,7 +12461,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a <= 2"
}
@@ -11362,12 +12490,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -11381,12 +12512,15 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["c"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 5,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a = t.c and t.a >= 3",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -11395,7 +12529,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a >= 3"
}
@@ -11425,12 +12561,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -11438,18 +12577,23 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 5,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.a = 2 and t2.a = t.c + 9",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 2"
}
@@ -11499,17 +12643,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "case when tab2.max_a = 1 or tab2.max_a = 2 then 1 else 0 end = 1",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "case when max_a = 1 or max_a = 2 then 1 else 0 end = 1",
"filesort": {
"sort_key": "t1.b",
@@ -11519,7 +12667,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -11556,17 +12706,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "case when tab2.max_a = 1 or tab2.max_a > 2 and tab2.max_a < 4 then 1 else 0 end = 1",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "case when max_a = 1 or max_a > 2 and max_a < 4 then 1 else 0 end = 1",
"filesort": {
"sort_key": "t1.b",
@@ -11576,7 +12730,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -11613,17 +12769,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "case when tab2.max_a > 1 and (tab2.max_a = 2 or tab2.max_a > 2) then 1 else 0 end = 1",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "case when max_a > 1 and (max_a = 2 or max_a > 2) then 1 else 0 end = 1",
"filesort": {
"sort_key": "t1.b",
@@ -11633,7 +12793,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -11670,17 +12832,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "case when tab2.b = 2 or tab2.b = 4 then 1 else 0 end = 1",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.b",
"temporary_table": {
@@ -11689,7 +12855,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "case when t1.b = 2 or t1.b = 4 then 1 else 0 end = 1"
}
@@ -11747,33 +12915,42 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 144,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.f is not null",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -11787,7 +12964,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 12,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.f is not null"
},
@@ -11830,23 +13009,29 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
- "rows": 16,
+ "loops": 1,
+ "rows": 8,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.f is not null",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 8,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.f is not null"
}
@@ -11860,17 +13045,22 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["f"],
"ref": ["test.t1.f"],
- "rows": 2,
+ "loops": 8,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 8,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.f is not null"
}
@@ -11908,19 +13098,22 @@ DROP TABLE t1;
#
CREATE TABLE t1 (f1 text, f2 int);
INSERT INTO t1 VALUES ('x',1), ('y',2);
-CREATE VIEW v1 AS SELECT f2 FROM ( SELECT f2 FROM t1 ) AS t;
+CREATE VIEW v1 AS SELECT f2 FROM ( SELECT f2 FROM t1 GROUP BY f2) AS t;
UPDATE v1, t1 SET t1.f1 = 'z' WHERE v1.f2 < 2 AND t1.f2 = v1.f2;
EXPLAIN FORMAT=JSON UPDATE v1, t1 SET t1.f1 = 'z' WHERE v1.f2 < 2 AND t1.f2 = v1.f2;
EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.f2 < 2 and t1.f2 is not null"
}
@@ -11934,22 +13127,32 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["f2"],
"ref": ["test.t1.f2"],
- "rows": 2,
+ "loops": 2,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 3,
- "nested_loop": [
- {
- "table": {
- "table_name": "t1",
- "access_type": "ALL",
- "rows": 2,
- "filtered": 100,
- "attached_condition": "t1.f2 < 2"
- }
+ "cost": "COST_REPLACED",
+ "filesort": {
+ "sort_key": "t1.f2",
+ "temporary_table": {
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 2,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "attached_condition": "t1.f2 < 2"
+ }
+ }
+ ]
}
- ]
+ }
}
}
}
@@ -11970,12 +13173,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.f2 < 2 and t1.f2 is not null"
}
@@ -11989,18 +13195,23 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["f2"],
"ref": ["test.t1.f2"],
+ "loops": 2,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.f2 < 2"
}
@@ -12050,12 +13261,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
@@ -12256,12 +13470,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v3.col1 = 123 and v3.col2 = 321",
"materialized": {
@@ -12271,6 +13488,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -12281,7 +13499,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["const"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -12292,6 +13512,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -12302,7 +13523,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["const"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -12340,17 +13563,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.s + 1 > 10 and v2.a > 1 and v2.a2 > 123",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "s + 1 > 10 and a2 > 123",
"filesort": {
"sort_key": "t1.a, f1(t1.a)",
@@ -12360,7 +13587,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1"
}
@@ -12393,12 +13622,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t4",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t4.a + 1 > 10 and t4.b > 1 and t4.c > 123 and t4.a is not null and t4.b is not null and t4.c is not null"
}
@@ -12412,13 +13644,16 @@ EXPLAIN
"key_length": "23",
"used_key_parts": ["a", "f1(a)", "sum(b)"],
"ref": ["test.t4.a", "test.t4.b", "test.t4.c"],
+ "loops": 3,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t4.c = `<subquery2>`.`sum(b)`",
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "`f1(a)` > 1 and `sum(b)` > 123",
"temporary_table": {
"nested_loop": [
@@ -12426,7 +13661,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a + 1 > 10"
}
@@ -12481,7 +13718,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a<5);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL
@@ -12490,12 +13727,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a < 5 and t2.a is not null"
}
@@ -12504,12 +13744,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
@@ -12520,6 +13762,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -12529,7 +13772,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a < 5"
}
@@ -12543,6 +13788,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"having_condition": "c > 100",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -12552,7 +13798,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a < 5"
}
@@ -12583,7 +13831,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a=8);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY <derived2> ALL distinct_key NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL
@@ -12592,12 +13840,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a = 8"
}
@@ -12607,7 +13858,10 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "possible_keys": ["distinct_key"],
+ "loops": 9,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 8"
},
@@ -12623,6 +13877,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300",
"filesort": {
"sort_key": "t1.b",
@@ -12632,7 +13887,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 8"
}
@@ -12646,6 +13903,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"having_condition": "c > 100",
"filesort": {
"sort_key": "t1.b",
@@ -12655,7 +13913,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 8 and t1.b > 10"
}
@@ -12685,7 +13945,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (t2.a=8);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY <derived2> ALL distinct_key NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL
@@ -12694,12 +13954,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a = 8"
}
@@ -12709,7 +13972,10 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "possible_keys": ["distinct_key"],
+ "loops": 9,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 8"
},
@@ -12725,6 +13991,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300",
"filesort": {
"sort_key": "t1.b",
@@ -12734,7 +14001,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 8"
}
@@ -12748,6 +14017,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"having_condition": "c > 100",
"filesort": {
"sort_key": "t1.b",
@@ -12757,7 +14027,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 8 and t1.b > 10"
}
@@ -12789,7 +14061,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.c>200);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL
@@ -12798,12 +14070,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -12812,12 +14087,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c > 200",
"materialized": {
@@ -12829,6 +14106,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and c > 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -12838,7 +14116,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9"
}
@@ -12852,6 +14132,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"having_condition": "c > 100 and c > 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -12861,7 +14142,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10"
}
@@ -12894,7 +14177,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a<5) and (v1.c>110);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL
@@ -12903,12 +14186,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a < 5 and t2.a is not null"
}
@@ -12917,12 +14203,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c > 110",
"materialized": {
@@ -12934,6 +14222,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and c > 110",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -12943,7 +14232,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a < 5"
}
@@ -12957,6 +14248,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"having_condition": "c > 100 and c > 110",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -12966,7 +14258,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a < 5"
}
@@ -13000,7 +14294,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and ((v1.b>27) or (v1.b<19));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL
@@ -13009,12 +14303,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -13023,12 +14320,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.b > 27 or v1.b < 19",
"materialized": {
@@ -13040,6 +14339,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -13049,7 +14349,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and (t1.b > 27 or t1.b < 19)"
}
@@ -13063,6 +14365,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"having_condition": "c > 100",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -13072,7 +14375,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and (t1.b > 27 or t1.b < 19)"
}
@@ -13111,7 +14416,7 @@ explain select * from v1,t2 where
(v1.a=t2.a) and ((v1.c>200) or (v1.c<105));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL
@@ -13121,12 +14426,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -13135,12 +14443,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c > 200 or v1.c < 105",
"materialized": {
@@ -13152,6 +14462,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and (c > 200 or c < 105)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -13161,7 +14472,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9"
}
@@ -13175,6 +14488,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"having_condition": "c > 100 and (c > 200 or c < 105)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -13184,7 +14498,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10"
}
@@ -13255,12 +14571,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -13269,7 +14588,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a > 3 or v1.a = 1 and v1.c < 110"
},
@@ -13286,6 +14607,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and (t1.a > 3 and c > 110 or t1.a = 1 and c < 110)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -13295,7 +14617,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and (t1.a > 3 or t1.a = 1)"
}
@@ -13309,6 +14633,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"having_condition": "c > 100 and (t1.a > 3 and c > 110 or t1.a = 1 and c < 110)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -13318,7 +14643,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and (t1.a > 3 or t1.a = 1)"
}
@@ -13399,7 +14726,7 @@ where
((d1.a<4) and (d1.c<200)));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.b 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.b 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL
@@ -13418,12 +14745,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b is not null"
}
@@ -13432,12 +14762,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t2.b"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.c = 909 and t2.b > 13 or d1.a < 4 and d1.c < 200",
"materialized": {
@@ -13449,6 +14781,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and (t1.b > 13 or t1.a < 4 and c < 200)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -13458,7 +14791,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and (t1.b > 13 or t1.a < 4)"
}
@@ -13472,6 +14807,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"having_condition": "c > 100 and (t1.b > 13 or t1.a < 4 and c < 200)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -13481,7 +14817,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and (t1.b > 13 or t1.a < 4)"
}
@@ -13524,7 +14862,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a<5);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL EXCEPT RESULT <except2,3> ALL NULL NULL NULL NULL NULL
@@ -13533,12 +14871,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a < 5 and t2.a is not null"
}
@@ -13547,12 +14888,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
@@ -13563,6 +14906,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -13572,7 +14916,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a < 5"
}
@@ -13586,6 +14932,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"having_condition": "c < 300",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -13595,7 +14942,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a < 5"
}
@@ -13628,7 +14977,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a=6);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY <derived2> ALL distinct_key NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL EXCEPT RESULT <except2,3> ALL NULL NULL NULL NULL NULL
@@ -13637,12 +14986,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a = 6"
}
@@ -13652,7 +15004,10 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "possible_keys": ["distinct_key"],
+ "loops": 9,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 6"
},
@@ -13668,6 +15023,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 200",
"filesort": {
"sort_key": "t1.b",
@@ -13677,7 +15033,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 6"
}
@@ -13691,6 +15049,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"having_condition": "c < 300",
"filesort": {
"sort_key": "t1.b",
@@ -13700,7 +15059,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 6 and t1.b > 10"
}
@@ -13732,7 +15093,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (t2.a=6);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY <derived2> ALL distinct_key NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL EXCEPT RESULT <except2,3> ALL NULL NULL NULL NULL NULL
@@ -13741,12 +15102,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a = 6"
}
@@ -13756,7 +15120,10 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "possible_keys": ["distinct_key"],
+ "loops": 9,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a = 6"
},
@@ -13772,6 +15139,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 200",
"filesort": {
"sort_key": "t1.b",
@@ -13781,7 +15149,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 6"
}
@@ -13795,6 +15165,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"having_condition": "c < 300",
"filesort": {
"sort_key": "t1.b",
@@ -13804,7 +15175,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 6 and t1.b > 10"
}
@@ -13840,7 +15213,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.c>500);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL EXCEPT RESULT <except2,3> ALL NULL NULL NULL NULL NULL
@@ -13849,12 +15222,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -13863,12 +15239,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c > 500",
"materialized": {
@@ -13880,6 +15258,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 200 and c > 500",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -13889,7 +15268,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9"
}
@@ -13903,6 +15284,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and c > 500",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -13912,7 +15294,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10"
}
@@ -13945,7 +15329,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a<5) and (v1.c>500);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL EXCEPT RESULT <except2,3> ALL NULL NULL NULL NULL NULL
@@ -13954,12 +15338,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a < 5 and t2.a is not null"
}
@@ -13968,12 +15355,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c > 500",
"materialized": {
@@ -13985,6 +15374,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 200 and c > 500",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -13994,7 +15384,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a < 5"
}
@@ -14008,6 +15400,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and c > 500",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14017,7 +15410,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a < 5"
}
@@ -14053,7 +15448,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and ((v1.b>27) or (v1.b<19));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL EXCEPT RESULT <except2,3> ALL NULL NULL NULL NULL NULL
@@ -14062,12 +15457,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -14076,12 +15474,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.b > 27 or v1.b < 19",
"materialized": {
@@ -14093,6 +15493,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14102,7 +15503,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and (t1.b > 27 or t1.b < 19)"
}
@@ -14116,6 +15519,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"having_condition": "c < 300",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14125,7 +15529,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and (t1.b > 27 or t1.b < 19)"
}
@@ -14164,7 +15570,7 @@ explain select * from v1,t2 where
(v1.a=t2.a) and ((v1.c<400) or (v1.c>800));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL EXCEPT RESULT <except2,3> ALL NULL NULL NULL NULL NULL
@@ -14174,12 +15580,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a is not null"
}
@@ -14188,12 +15597,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c < 400 or v1.c > 800",
"materialized": {
@@ -14205,6 +15616,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 200 and (c < 400 or c > 800)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14214,7 +15626,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9"
}
@@ -14228,6 +15642,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and (c < 400 or c > 800)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14237,7 +15652,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10"
}
@@ -14306,12 +15723,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -14320,7 +15740,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 9,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a > 1 or v1.a = 1 and v1.c > 500"
},
@@ -14337,6 +15759,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 200 and (t1.a > 1 and c < 500 or t1.a = 1 and c > 500)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14346,7 +15769,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and (t1.a > 1 or t1.a = 1)"
}
@@ -14360,6 +15785,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and (t1.a > 1 and c < 500 or t1.a = 1 and c > 500)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14369,7 +15795,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and (t1.a > 1 or t1.a = 1)"
}
@@ -14446,7 +15874,7 @@ where
((d1.a>4) and (d1.c>500)));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.b 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.b 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL EXCEPT RESULT <except2,3> ALL NULL NULL NULL NULL NULL
@@ -14465,12 +15893,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b is not null"
}
@@ -14479,12 +15910,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t2.b"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.c = 988 and t2.b > 13 or d1.a > 4 and d1.c > 500",
"materialized": {
@@ -14496,6 +15929,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 200 and (t1.b > 13 or t1.a > 4 and c > 500)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14505,7 +15939,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and (t1.b > 13 or t1.a > 4)"
}
@@ -14519,6 +15955,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and (t1.b > 13 or t1.a > 4 and c > 500)",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14528,7 +15965,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and (t1.b > 13 or t1.a > 4)"
}
@@ -14570,7 +16009,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>5) and (v1.c>200);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 3 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 3 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 UNION <derived4> ALL NULL NULL NULL NULL 18 Using where
4 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
@@ -14582,12 +16021,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 5 and t2.a is not null"
}
@@ -14596,12 +16038,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c > 200",
"materialized": {
@@ -14613,6 +16057,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 200 and c > 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14622,7 +16067,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a > 5"
}
@@ -14636,12 +16083,15 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "__5.a > 5 and __5.c > 200",
"materialized": {
@@ -14653,6 +16103,7 @@ EXPLAIN
{
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and c > 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14662,7 +16113,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a > 5"
}
@@ -14676,6 +16129,7 @@ EXPLAIN
"query_block": {
"select_id": 5,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"having_condition": "c < 530 and c > 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14685,7 +16139,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 3 and t1.a > 5"
}
@@ -14738,7 +16194,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<200);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 3 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 3 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
4 UNION t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
@@ -14748,12 +16204,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 4 and t2.a is not null"
}
@@ -14762,12 +16221,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c < 200",
"materialized": {
@@ -14779,6 +16240,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 200 and c < 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14788,7 +16250,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a > 4"
}
@@ -14802,6 +16266,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"having_condition": "c < 500 and c < 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14811,7 +16276,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 3 and t1.a > 4"
}
@@ -14825,6 +16292,7 @@ EXPLAIN
"query_block": {
"select_id": 4,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and c < 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14834,7 +16302,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a > 4"
}
@@ -14876,7 +16346,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>5) and (v1.c>200);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 3 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 3 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 UNION t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
4 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
@@ -14886,12 +16356,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 5 and t2.a is not null"
}
@@ -14900,12 +16373,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c > 200",
"materialized": {
@@ -14917,6 +16392,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 200 and c > 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14926,7 +16402,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a > 5"
}
@@ -14940,6 +16418,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and c > 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14949,7 +16428,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a > 5"
}
@@ -14963,6 +16444,7 @@ EXPLAIN
"query_block": {
"select_id": 4,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"having_condition": "c < 530 and c > 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -14972,7 +16454,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 3 and t1.a > 5"
}
@@ -15016,7 +16500,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<200);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 3 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 3 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
4 UNION t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
@@ -15026,12 +16510,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 4 and t2.a is not null"
}
@@ -15040,12 +16527,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c < 200",
"materialized": {
@@ -15057,6 +16546,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 200 and c < 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15066,7 +16556,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a > 4"
}
@@ -15080,6 +16572,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"having_condition": "c < 500 and c < 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15089,7 +16582,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 3 and t1.a > 4"
}
@@ -15103,6 +16598,7 @@ EXPLAIN
"query_block": {
"select_id": 4,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and c < 200",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15112,7 +16608,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a > 4"
}
@@ -15154,7 +16652,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<150);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
4 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
@@ -15164,12 +16662,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 4 and t2.a is not null"
}
@@ -15178,12 +16679,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c < 150",
"materialized": {
@@ -15195,6 +16698,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and c < 150",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15204,7 +16708,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a > 4"
}
@@ -15218,6 +16724,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"having_condition": "c < 500 and c < 150",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15227,7 +16734,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 7 and t1.a > 4"
}
@@ -15241,6 +16750,7 @@ EXPLAIN
"query_block": {
"select_id": 4,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"having_condition": "c > 150 and c < 150",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15250,7 +16760,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a > 4"
}
@@ -15290,7 +16802,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<130);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT <derived4> ALL NULL NULL NULL NULL 18 Using where
4 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
@@ -15302,12 +16814,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 4 and t2.a is not null"
}
@@ -15316,12 +16831,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c < 130",
"materialized": {
@@ -15333,6 +16850,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and c < 130",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15342,7 +16860,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a > 4"
}
@@ -15356,12 +16876,15 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "__5.a > 4 and __5.c < 130",
"materialized": {
@@ -15373,6 +16896,7 @@ EXPLAIN
{
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "c > 150 and c < 130",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15382,7 +16906,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a > 4"
}
@@ -15396,6 +16922,7 @@ EXPLAIN
"query_block": {
"select_id": 5,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"having_condition": "c < 500 and c < 130",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15405,7 +16932,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 7 and t1.a > 4"
}
@@ -15457,7 +16986,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<130);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 3 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 3 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT <derived4> ALL NULL NULL NULL NULL 18 Using where
4 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
@@ -15470,12 +16999,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 4 and t2.a is not null"
}
@@ -15484,12 +17016,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c < 130",
"materialized": {
@@ -15501,6 +17035,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300 and c < 130",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15510,7 +17045,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a > 4"
}
@@ -15524,12 +17061,15 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived4>",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "__6.a > 4 and __6.c < 130",
"materialized": {
@@ -15541,6 +17081,7 @@ EXPLAIN
{
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"having_condition": "c > 150 and c < 130",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15550,7 +17091,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a > 4"
}
@@ -15564,6 +17107,7 @@ EXPLAIN
"query_block": {
"select_id": 5,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"having_condition": "c < 500 and c < 130",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15573,7 +17117,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 7 and t1.a > 4"
}
@@ -15596,6 +17142,7 @@ EXPLAIN
"query_block": {
"select_id": 6,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"having_condition": "c < 120 and c < 130",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15605,7 +17152,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 7 and t1.a > 4"
}
@@ -15648,7 +17197,7 @@ a b c a b c
explain select * from v2,t2 where (v2.a=t2.a) and (v2.a>4) and (v2.c<150);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 1 Using where
2 DERIVED <derived3> ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
4 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
@@ -15658,12 +17207,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 4 and t2.a is not null"
}
@@ -15677,12 +17229,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.c < 150",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c < 150",
"filesort": {
"sort_key": "v1.a, v1.b",
@@ -15692,7 +17247,9 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 7 and v1.a > 4",
"materialized": {
@@ -15704,6 +17261,7 @@ EXPLAIN
{
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15713,7 +17271,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a < 7 and t1.a > 4"
}
@@ -15727,6 +17287,7 @@ EXPLAIN
"query_block": {
"select_id": 4,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"having_condition": "c > 120",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15736,7 +17297,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a < 7 and t1.a > 4"
}
@@ -15786,7 +17349,7 @@ a b c a b c
explain select * from v2,t2 where (v2.a=t2.a) and (v2.a>4) and (v2.c<150);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 1 Using where
2 DERIVED <derived3> ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
4 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
@@ -15796,12 +17359,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 4 and t2.a is not null"
}
@@ -15815,12 +17381,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.c < 150",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c < 150",
"filesort": {
"sort_key": "v1.a, v1.b",
@@ -15830,7 +17399,9 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 7 and v1.a > 4",
"materialized": {
@@ -15842,6 +17413,7 @@ EXPLAIN
{
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "c < 300",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15851,7 +17423,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a < 7 and t1.a > 4"
}
@@ -15865,6 +17439,7 @@ EXPLAIN
"query_block": {
"select_id": 4,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"having_condition": "c > 150",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -15874,7 +17449,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a < 7 and t1.a > 4"
}
@@ -15921,7 +17498,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.b>12) and (v1.c<450);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL
@@ -15930,12 +17507,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 4 and t2.a is not null"
}
@@ -15944,12 +17524,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.b > 12 and v1.c < 450",
"materialized": {
@@ -15961,6 +17543,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 300 and t1.b > 12 and c < 450",
"filesort": {
"sort_key": "t1.a",
@@ -15970,7 +17553,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a > 4"
}
@@ -15984,6 +17569,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"having_condition": "c > 200 and t1.a > 4 and c < 450",
"filesort": {
"sort_key": "t1.b",
@@ -15993,7 +17579,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b < 21 and t1.b > 12"
}
@@ -16033,7 +17621,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a<2) and (v1.b<30) and (v1.c>450);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL EXCEPT RESULT <except2,3> ALL NULL NULL NULL NULL NULL
@@ -16042,12 +17630,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a < 2 and t2.a is not null"
}
@@ -16056,12 +17647,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.b < 30 and v1.c > 450",
"materialized": {
@@ -16073,6 +17666,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 300 and t1.b < 30 and c > 450",
"filesort": {
"sort_key": "t1.a",
@@ -16082,7 +17676,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 20 and t1.a < 2"
}
@@ -16096,6 +17692,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"having_condition": "c > 150 and t1.a < 2 and c > 450",
"filesort": {
"sort_key": "t1.b",
@@ -16105,7 +17702,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 7 and t1.b < 30"
}
@@ -16147,7 +17746,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and ((v1.a<2) or (v1.a<5)) and (v1.c>450);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 EXCEPT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
NULL EXCEPT RESULT <except2,3> ALL NULL NULL NULL NULL NULL
@@ -16156,12 +17755,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t2.a < 2 or t2.a < 5) and t2.a is not null"
}
@@ -16170,12 +17772,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c > 450",
"materialized": {
@@ -16187,6 +17791,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 300 and c > 450",
"filesort": {
"sort_key": "t1.a",
@@ -16196,7 +17801,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 20 and (t1.a < 2 or t1.a < 5)"
}
@@ -16210,6 +17817,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"having_condition": "c > 150 and (t1.a < 2 or t1.a < 5) and c > 450",
"filesort": {
"sort_key": "t1.b",
@@ -16219,7 +17827,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 7"
}
@@ -16262,7 +17872,7 @@ a b c a b c
explain select * from v1,t2 where (v1.a=t2.a) and (v1.a>1) and (v1.b > 12) and (v1.c>400);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.a 3 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.a 3 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
3 INTERSECT t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
4 UNION t1 ALL NULL NULL NULL NULL 18 Using where; Using temporary; Using filesort
@@ -16272,12 +17882,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a > 1 and t2.a is not null"
}
@@ -16286,12 +17899,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 9,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.b > 12 and v1.c > 400",
"materialized": {
@@ -16303,6 +17918,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "c > 100 and t1.b > 12 and c > 400",
"filesort": {
"sort_key": "t1.a",
@@ -16312,7 +17928,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 9 and t1.a > 1"
}
@@ -16326,6 +17944,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"having_condition": "c < 800 and t1.a > 1 and c > 400",
"filesort": {
"sort_key": "t1.b",
@@ -16335,7 +17954,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 3 and t1.b > 12"
}
@@ -16349,6 +17970,7 @@ EXPLAIN
"query_block": {
"select_id": 4,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"having_condition": "c > 300 and c > 400",
"filesort": {
"sort_key": "t1.a, t1.b",
@@ -16358,7 +17980,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 10 and t1.a > 1 and t1.b > 12"
}
@@ -16409,19 +18033,22 @@ a b max_c a b c
explain select * from v1,t2 where (v1.b=t2.b) and (v1.a<5);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.b 2 Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t2.b 1 Using where
2 DERIVED t3 range i1 i1 5 NULL 5 Using index condition
explain format=json select * from v1,t2 where (v1.b=t2.b) and (v1.a<5);
EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b is not null"
}
@@ -16435,12 +18062,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t2.b"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 5",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -16450,7 +18080,9 @@ EXPLAIN
"key": "i1",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t3.a > 0 and t3.a < 5"
}
@@ -16486,7 +18118,7 @@ a b c a b c
explain select * from v1,t2 where (v1.b=t2.b) and (v1.a<4);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.b 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.b 1 Using where
2 DERIVED t3 range i1 i1 5 NULL 2 Using index condition
3 UNION t3 range i1 i1 5 NULL 1 Using index condition
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
@@ -16495,12 +18127,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b is not null"
}
@@ -16509,12 +18144,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t2.b"],
- "rows": 2,
+ "loops": 9,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 4",
"materialized": {
@@ -16526,6 +18163,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -16535,7 +18173,9 @@ EXPLAIN
"key": "i1",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t3.a > 1 and t3.a < 4"
}
@@ -16547,6 +18187,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -16556,7 +18197,9 @@ EXPLAIN
"key": "i1",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t3.a > 2 and t3.a < 4"
}
@@ -16596,7 +18239,7 @@ a b c a b c
explain select * from v1,t2 where (v1.b=t2.b) and (v1.a<3);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.b 2 Using where
+1 PRIMARY <derived2> ref key1,distinct_key key1 5 test.t2.b 2 Using where
2 DERIVED t3 range i1 i1 5 NULL 1 Using index condition
3 UNION t3 ALL NULL NULL NULL NULL 20 Using where; Using temporary; Using filesort
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
@@ -16605,12 +18248,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.b is not null"
}
@@ -16619,12 +18265,14 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
+ "possible_keys": ["key1", "distinct_key"],
+ "key": "key1",
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t2.b"],
+ "loops": 9,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.a < 3",
"materialized": {
@@ -16636,6 +18284,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -16645,7 +18294,9 @@ EXPLAIN
"key": "i1",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t3.a > 1 and t3.a < 3"
}
@@ -16657,6 +18308,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"having_condition": "t3.a < 3",
"filesort": {
"sort_key": "t3.b",
@@ -16666,7 +18318,9 @@ EXPLAIN
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.b < 21"
}
@@ -16738,17 +18392,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.a > 2 and t.c in ('aa','bb','cc')",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -16764,7 +18422,9 @@ EXPLAIN
"table_name": "t2",
"access_type": "ALL",
"possible_keys": ["idx"],
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 80,
"attached_condition": "t2.a > 2 and t2.c in ('aa','bb','cc')"
}
@@ -16853,12 +18513,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 32,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.a > 2 and t.c in ('aa','bb','cc')",
"materialized": {
@@ -16868,6 +18531,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -16883,7 +18547,9 @@ EXPLAIN
"table_name": "t2",
"access_type": "ALL",
"possible_keys": ["idx"],
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 80,
"attached_condition": "t2.a > 2 and t2.c in ('aa','bb','cc')"
}
@@ -16897,6 +18563,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -16912,7 +18579,9 @@ EXPLAIN
"table_name": "t2",
"access_type": "ALL",
"possible_keys": ["idx"],
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 80,
"attached_condition": "t2.a > 2"
}
@@ -16961,12 +18630,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 8,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c in ('aa','bb','cc') and t1.a is not null and t1.c is not null"
}
@@ -16980,11 +18652,14 @@ EXPLAIN
"key_length": "24",
"used_key_parts": ["a", "c"],
"ref": ["test.t1.a", "test.t1.c"],
+ "loops": 8,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -16999,7 +18674,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.c in ('aa','bb','cc')"
}
@@ -17101,12 +18778,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 48,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.a > 2 and t.c in ('aa','bb','cc')",
"materialized": {
@@ -17116,6 +18796,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -17131,7 +18812,9 @@ EXPLAIN
"table_name": "t2",
"access_type": "ALL",
"possible_keys": ["idx"],
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 80,
"attached_condition": "t2.a > 2 and t2.c in ('aa','bb','cc')"
}
@@ -17145,6 +18828,7 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -17160,7 +18844,9 @@ EXPLAIN
"table_name": "t2",
"access_type": "ALL",
"possible_keys": ["idx"],
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 80,
"attached_condition": "t2.a > 2"
}
@@ -17174,6 +18860,7 @@ EXPLAIN
"query_block": {
"select_id": 4,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"having_condition": "t2.c in ('aa','bb','cc')",
"filesort": {
"sort_key": "t2.a",
@@ -17184,7 +18871,9 @@ EXPLAIN
"table_name": "t2",
"access_type": "ALL",
"possible_keys": ["idx"],
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 80,
"attached_condition": "t2.a > 2"
}
@@ -17250,17 +18939,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.a > 2 and t.c in ('aa','bb','cc')",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -17276,7 +18969,9 @@ EXPLAIN
"table_name": "t2",
"access_type": "ALL",
"possible_keys": ["idx"],
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 80,
"attached_condition": "t2.a > 2 and t2.c in ('aa','bb','cc')"
}
@@ -17338,17 +19033,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.a > 2 and t.c in ('aa','bb','cc')",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -17364,7 +19063,9 @@ EXPLAIN
"table_name": "t2",
"access_type": "ALL",
"possible_keys": ["idx"],
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 80,
"attached_condition": "t2.a > 2"
}
@@ -17426,17 +19127,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t.a > 2 and t.c in ('aa','bb','cc')",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -17456,7 +19161,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 20,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.c in ('aa','bb','cc')"
}
@@ -17528,7 +19235,7 @@ on t1.a=t.a
where t1.b < 3;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 range idx_b idx_b 5 NULL 4 100.00 Using index condition; Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 2 100.00
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 1 100.00
2 LATERAL DERIVED t2 ref idx_a idx_a 5 test.t1.a 1 100.00
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`t`.`s` AS `s`,`t`.`m` AS `m` from `test`.`t1` join (/* select#2 */ select `test`.`t2`.`a` AS `a`,sum(`test`.`t2`.`b`) AS `s`,min(`test`.`t2`.`c`) AS `m` from `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` group by `test`.`t2`.`a`) `t` where `t`.`a` = `test`.`t1`.`a` and `test`.`t1`.`b` < 3
@@ -17541,6 +19248,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -17550,7 +19258,9 @@ EXPLAIN
"key": "idx_b",
"key_length": "5",
"used_key_parts": ["b"],
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t1.b < 3",
"attached_condition": "t1.a is not null"
@@ -17565,12 +19275,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t1.a"],
- "rows": 2,
+ "loops": 4,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"outer_ref_condition": "t1.a is not null",
"nested_loop": [
{
@@ -17582,7 +19295,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t1.a"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -17649,7 +19364,7 @@ on t1.a=t.a
where t1.b <= 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL idx_b NULL NULL NULL 12 83.33 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 2 100.00
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 1 100.00
2 LATERAL DERIVED t2 ref idx_a idx_a 5 test.t1.a 1 100.00
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`t`.`s` AS `s`,`t`.`m` AS `m` from `test`.`t1` join (/* select#2 */ select `test`.`t2`.`a` AS `a`,sum(`test`.`t2`.`b`) AS `s`,min(`test`.`t2`.`b`) AS `m` from `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` group by `test`.`t2`.`a`) `t` where `t`.`a` = `test`.`t1`.`a` and `test`.`t1`.`b` <= 5
@@ -17662,13 +19377,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"possible_keys": ["idx_b"],
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 83.33333588,
"attached_condition": "t1.b <= 5 and t1.a is not null"
}
@@ -17682,12 +19400,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t1.a"],
- "rows": 2,
+ "loops": 10,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"outer_ref_condition": "t1.a is not null",
"nested_loop": [
{
@@ -17699,7 +19420,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t1.a"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -17764,10 +19487,10 @@ from t1 left join
on t1.a=t.a;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 12 100.00
-1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 9 100.00 Using where
-2 DERIVED t2 ALL idx_a NULL NULL NULL 90 100.00 Using temporary; Using filesort
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 1 100.00 Using where
+2 LATERAL DERIVED t2 ref idx_a idx_a 5 test.t1.a 1 100.00
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t1` left join (/* select#2 */ select `test`.`t2`.`a` AS `a`,max(`test`.`t2`.`b`) AS `max`,min(`test`.`t2`.`b`) AS `min` from `test`.`t2` group by `test`.`t2`.`a`) `t` on(`t`.`a` = `test`.`t1`.`a` and `test`.`t1`.`a` is not null) where 1
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t1` left join (/* select#2 */ select `test`.`t2`.`a` AS `a`,max(`test`.`t2`.`b`) AS `max`,min(`test`.`t2`.`b`) AS `min` from `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` group by `test`.`t2`.`a`) `t` on(`t`.`a` = `test`.`t1`.`a` and `test`.`t1`.`a` is not null) where 1
explain format=json select t1.a,t.max,t.min
from t1 left join
(select a, max(t2.b) max, min(t2.b) min from t2 group by t2.a) t
@@ -17776,13 +19499,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"const_condition": "1",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -17795,28 +19521,34 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t1.a"],
- "rows": 9,
+ "loops": 12,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "trigcond(trigcond(t1.a is not null))",
"materialized": {
+ "lateral": 1,
"query_block": {
"select_id": 2,
- "filesort": {
- "sort_key": "t2.a",
- "temporary_table": {
- "nested_loop": [
- {
- "table": {
- "table_name": "t2",
- "access_type": "ALL",
- "possible_keys": ["idx_a"],
- "rows": 90,
- "filtered": 100
- }
- }
- ]
+ "cost": "COST_REPLACED",
+ "outer_ref_condition": "t1.a is not null",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ref",
+ "possible_keys": ["idx_a"],
+ "key": "idx_a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["test.t1.a"],
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
+ "filtered": 100
+ }
}
- }
+ ]
}
}
}
@@ -17865,7 +19597,7 @@ on t3.a=t.a and t3.c=t.c
where t3.b > 15;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 range idx_b idx_b 5 NULL 2 100.00 Using index condition; Using where
-1 PRIMARY <derived2> ref key0 key0 133 test.t3.a,test.t3.c 2 100.00
+1 PRIMARY <derived2> ref key0 key0 133 test.t3.a,test.t3.c 1 100.00
2 LATERAL DERIVED t4 ref idx idx 133 test.t3.a,test.t3.c 1 100.00
Warnings:
Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t3` join (/* select#2 */ select `test`.`t4`.`a` AS `a`,`test`.`t4`.`c` AS `c`,max(`test`.`t4`.`b`) AS `max`,min(`test`.`t4`.`b`) AS `min` from `test`.`t4` where `test`.`t4`.`a` = `test`.`t3`.`a` and `test`.`t4`.`c` = `test`.`t3`.`c` group by `test`.`t4`.`a`,`test`.`t4`.`c`) `t` where `t`.`a` = `test`.`t3`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t3`.`b` > 15
@@ -17878,6 +19610,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -17887,7 +19620,9 @@ EXPLAIN
"key": "idx_b",
"key_length": "5",
"used_key_parts": ["b"],
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t3.b > 15",
"attached_condition": "t3.a is not null and t3.c is not null"
@@ -17902,12 +19637,15 @@ EXPLAIN
"key_length": "133",
"used_key_parts": ["a", "c"],
"ref": ["test.t3.a", "test.t3.c"],
- "rows": 2,
+ "loops": 2,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"outer_ref_condition": "t3.a is not null and t3.c is not null",
"nested_loop": [
{
@@ -17919,7 +19657,9 @@ EXPLAIN
"key_length": "133",
"used_key_parts": ["a", "c"],
"ref": ["test.t3.a", "test.t3.c"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -17954,10 +19694,10 @@ on t3.a=t.a and t3.c=t.c
where t3.b <= 15;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL idx_b NULL NULL NULL 12 83.33 Using where
-1 PRIMARY <derived2> ref key0 key0 133 test.t3.a,test.t3.c 4 100.00
-2 DERIVED t4 ALL idx NULL NULL NULL 40 100.00 Using temporary; Using filesort
+1 PRIMARY <derived2> ref key0 key0 133 test.t3.a,test.t3.c 1 100.00
+2 LATERAL DERIVED t4 ref idx idx 133 test.t3.a,test.t3.c 1 100.00
Warnings:
-Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t3` join (/* select#2 */ select `test`.`t4`.`a` AS `a`,`test`.`t4`.`c` AS `c`,max(`test`.`t4`.`b`) AS `max`,min(`test`.`t4`.`b`) AS `min` from `test`.`t4` group by `test`.`t4`.`a`,`test`.`t4`.`c`) `t` where `t`.`a` = `test`.`t3`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t3`.`b` <= 15
+Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t3` join (/* select#2 */ select `test`.`t4`.`a` AS `a`,`test`.`t4`.`c` AS `c`,max(`test`.`t4`.`b`) AS `max`,min(`test`.`t4`.`b`) AS `min` from `test`.`t4` where `test`.`t4`.`a` = `test`.`t3`.`a` and `test`.`t4`.`c` = `test`.`t3`.`c` group by `test`.`t4`.`a`,`test`.`t4`.`c`) `t` where `t`.`a` = `test`.`t3`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t3`.`b` <= 15
explain format=json select t3.a,t3.c,t.max,t.min
from t3 join
(select a, c, max(b) max, min(b) min from t4 group by a,c) t
@@ -17967,13 +19707,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
"possible_keys": ["idx_b"],
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 83.33333588,
"attached_condition": "t3.b <= 15 and t3.a is not null and t3.c is not null"
}
@@ -17987,27 +19730,33 @@ EXPLAIN
"key_length": "133",
"used_key_parts": ["a", "c"],
"ref": ["test.t3.a", "test.t3.c"],
- "rows": 4,
+ "loops": 10,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
+ "lateral": 1,
"query_block": {
"select_id": 2,
- "filesort": {
- "sort_key": "t4.a, t4.c",
- "temporary_table": {
- "nested_loop": [
- {
- "table": {
- "table_name": "t4",
- "access_type": "ALL",
- "possible_keys": ["idx"],
- "rows": 40,
- "filtered": 100
- }
- }
- ]
+ "cost": "COST_REPLACED",
+ "outer_ref_condition": "t3.a is not null and t3.c is not null",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t4",
+ "access_type": "ref",
+ "possible_keys": ["idx"],
+ "key": "idx",
+ "key_length": "133",
+ "used_key_parts": ["a", "c"],
+ "ref": ["test.t3.a", "test.t3.c"],
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
+ "filtered": 100
+ }
}
- }
+ ]
}
}
}
@@ -18038,7 +19787,7 @@ on t3.a=t.a and t3.c=t.c
where t3.b > 15;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 range idx_b idx_b 5 NULL 2 100.00 Using index condition; Using where
-1 PRIMARY <derived2> ref key0 key0 133 test.t3.a,test.t3.c 2 100.00
+1 PRIMARY <derived2> ref key0 key0 133 test.t3.a,test.t3.c 1 100.00
2 LATERAL DERIVED t4 ref idx idx 133 test.t3.a,test.t3.c 1 100.00
Warnings:
Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t3` join (/* select#2 */ select `test`.`t4`.`a` AS `a`,`test`.`t4`.`c` AS `c`,max(`test`.`t4`.`b`) AS `max`,min(`test`.`t4`.`b`) AS `min` from `test`.`t4` where `test`.`t4`.`a` = `test`.`t3`.`a` and `test`.`t4`.`c` = `test`.`t3`.`c` group by `test`.`t4`.`c`,`test`.`t4`.`a`) `t` where `t`.`a` = `test`.`t3`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t3`.`b` > 15
@@ -18051,6 +19800,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -18060,7 +19810,9 @@ EXPLAIN
"key": "idx_b",
"key_length": "5",
"used_key_parts": ["b"],
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t3.b > 15",
"attached_condition": "t3.a is not null and t3.c is not null"
@@ -18075,12 +19827,15 @@ EXPLAIN
"key_length": "133",
"used_key_parts": ["a", "c"],
"ref": ["test.t3.a", "test.t3.c"],
- "rows": 2,
+ "loops": 2,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"outer_ref_condition": "t3.a is not null and t3.c is not null",
"nested_loop": [
{
@@ -18092,7 +19847,9 @@ EXPLAIN
"key_length": "133",
"used_key_parts": ["a", "c"],
"ref": ["test.t3.a", "test.t3.c"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -18127,10 +19884,10 @@ on t3.a=t.a and t3.c=t.c
where t3.b <= 15;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL idx_b NULL NULL NULL 12 83.33 Using where
-1 PRIMARY <derived2> ref key0 key0 133 test.t3.a,test.t3.c 4 100.00
-2 DERIVED t4 ALL idx NULL NULL NULL 40 100.00 Using temporary; Using filesort
+1 PRIMARY <derived2> ref key0 key0 133 test.t3.a,test.t3.c 1 100.00
+2 LATERAL DERIVED t4 ref idx idx 133 test.t3.a,test.t3.c 1 100.00
Warnings:
-Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t3` join (/* select#2 */ select `test`.`t4`.`a` AS `a`,`test`.`t4`.`c` AS `c`,max(`test`.`t4`.`b`) AS `max`,min(`test`.`t4`.`b`) AS `min` from `test`.`t4` group by `test`.`t4`.`c`,`test`.`t4`.`a`) `t` where `t`.`a` = `test`.`t3`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t3`.`b` <= 15
+Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a`,`test`.`t3`.`c` AS `c`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t3` join (/* select#2 */ select `test`.`t4`.`a` AS `a`,`test`.`t4`.`c` AS `c`,max(`test`.`t4`.`b`) AS `max`,min(`test`.`t4`.`b`) AS `min` from `test`.`t4` where `test`.`t4`.`a` = `test`.`t3`.`a` and `test`.`t4`.`c` = `test`.`t3`.`c` group by `test`.`t4`.`c`,`test`.`t4`.`a`) `t` where `t`.`a` = `test`.`t3`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t3`.`b` <= 15
explain format=json select t3.a,t3.c,t.max,t.min
from t3 join
(select a, c, max(b) max, min(b) min from t4 group by c,a) t
@@ -18140,13 +19897,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
"possible_keys": ["idx_b"],
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 83.33333588,
"attached_condition": "t3.b <= 15 and t3.a is not null and t3.c is not null"
}
@@ -18160,27 +19920,33 @@ EXPLAIN
"key_length": "133",
"used_key_parts": ["a", "c"],
"ref": ["test.t3.a", "test.t3.c"],
- "rows": 4,
+ "loops": 10,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
+ "lateral": 1,
"query_block": {
"select_id": 2,
- "filesort": {
- "sort_key": "t4.c, t4.a",
- "temporary_table": {
- "nested_loop": [
- {
- "table": {
- "table_name": "t4",
- "access_type": "ALL",
- "possible_keys": ["idx"],
- "rows": 40,
- "filtered": 100
- }
- }
- ]
+ "cost": "COST_REPLACED",
+ "outer_ref_condition": "t3.a is not null and t3.c is not null",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t4",
+ "access_type": "ref",
+ "possible_keys": ["idx"],
+ "key": "idx",
+ "key_length": "133",
+ "used_key_parts": ["a", "c"],
+ "ref": ["test.t3.a", "test.t3.c"],
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
+ "filtered": 100
+ }
}
- }
+ ]
}
}
}
@@ -18224,7 +19990,7 @@ where t2.b between 80 and 85 and t2.c in ('y','z') and t2.a=t3.a and t3.c=t.c;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 range idx idx 133 NULL 2 100.00 Using index condition; Using where
1 PRIMARY t3 ref idx_a idx_a 5 test.t2.a 1 100.00 Using where
-1 PRIMARY <derived2> ref key0 key0 128 test.t3.c 2 100.00
+1 PRIMARY <derived2> ref key0 key0 128 test.t3.c 1 100.00
2 LATERAL DERIVED t4 ref idx_c idx_c 128 test.t3.c 2 100.00
Warnings:
Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`t`.`c` AS `t_c`,`t`.`max` AS `max`,`t`.`min` AS `min` from `test`.`t2` join `test`.`t3` join (/* select#2 */ select `test`.`t4`.`c` AS `c`,max(`test`.`t4`.`b`) AS `max`,min(`test`.`t4`.`b`) AS `min` from `test`.`t4` where `test`.`t4`.`c` = `test`.`t3`.`c` group by `test`.`t4`.`c`) `t` where `test`.`t3`.`a` = `test`.`t2`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t2`.`b` between 80 and 85 and `test`.`t2`.`c` in ('y','z')
@@ -18235,6 +20001,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -18244,7 +20011,9 @@ EXPLAIN
"key": "idx",
"key_length": "133",
"used_key_parts": ["c", "b"],
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t2.b between 80 and 85 and t2.c in ('y','z')",
"attached_condition": "t2.a is not null"
@@ -18259,7 +20028,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 2,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.c is not null"
}
@@ -18273,12 +20044,15 @@ EXPLAIN
"key_length": "128",
"used_key_parts": ["c"],
"ref": ["test.t3.c"],
- "rows": 2,
+ "loops": 3,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"outer_ref_condition": "t3.c is not null",
"nested_loop": [
{
@@ -18290,7 +20064,9 @@ EXPLAIN
"key_length": "128",
"used_key_parts": ["c"],
"ref": ["test.t3.c"],
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -18395,12 +20171,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 90,
+ "cost": "COST_REPLACED",
"filtered": 60,
"attached_condition": "t2.b < 40 and t2.a is not null"
}
@@ -18414,7 +20193,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 53.99999991,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.c is not null"
}
@@ -18428,11 +20209,14 @@ EXPLAIN
"key_length": "128",
"used_key_parts": ["c"],
"ref": ["test.t3.c"],
+ "loops": 80.99999987,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t4.c",
"temporary_table": {
@@ -18442,7 +20226,9 @@ EXPLAIN
"table_name": "t4",
"access_type": "ALL",
"possible_keys": ["idx_c"],
+ "loops": 1,
"rows": 160,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -18496,7 +20282,7 @@ where t2.b between 80 and 85 and t2.c in ('y','z') and t2.a=t3.a and t3.c=t.c;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 range idx idx 133 NULL 2 100.00 Using index condition; Using where
1 PRIMARY t3 ref idx_a idx_a 5 test.t2.a 1 100.00 Using where
-1 PRIMARY <derived2> ref key0 key0 128 test.t3.c 2 100.00
+1 PRIMARY <derived2> ref key0 key0 128 test.t3.c 1 100.00
2 LATERAL DERIVED t4 ref idx_c idx_c 128 test.t3.c 2 100.00 Using temporary
Warnings:
Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t3`.`c` AS `c`,`t`.`c` AS `c`,`t`.`b` AS `b`,`t`.`sum(b) over (partition by c)` AS `sum(b) over (partition by c)` from `test`.`t2` join `test`.`t3` join (/* select#2 */ select `test`.`t4`.`c` AS `c`,`test`.`t4`.`b` AS `b`,sum(`test`.`t4`.`b`) over ( partition by `test`.`t4`.`c`) AS `sum(b) over (partition by c)` from `test`.`t4` where `test`.`t4`.`c` = `test`.`t3`.`c`) `t` where `test`.`t3`.`a` = `test`.`t2`.`a` and `t`.`c` = `test`.`t3`.`c` and `test`.`t2`.`b` between 80 and 85 and `test`.`t2`.`c` in ('y','z')
@@ -18507,6 +20293,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -18516,7 +20303,9 @@ EXPLAIN
"key": "idx",
"key_length": "133",
"used_key_parts": ["c", "b"],
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t2.b between 80 and 85 and t2.c in ('y','z')",
"attached_condition": "t2.a is not null"
@@ -18531,7 +20320,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 2,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.c is not null"
}
@@ -18545,12 +20336,15 @@ EXPLAIN
"key_length": "128",
"used_key_parts": ["c"],
"ref": ["test.t3.c"],
- "rows": 2,
+ "loops": 3,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"outer_ref_condition": "t3.c is not null",
"window_functions_computation": {
"sorts": [
@@ -18571,7 +20365,9 @@ EXPLAIN
"key_length": "128",
"used_key_parts": ["c"],
"ref": ["test.t3.c"],
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -18918,12 +20714,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 90,
+ "cost": "COST_REPLACED",
"filtered": 60,
"attached_condition": "t2.b < 40 and t2.a is not null"
}
@@ -18937,7 +20736,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.a"],
+ "loops": 53.99999991,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.c is not null"
}
@@ -18951,11 +20752,14 @@ EXPLAIN
"key_length": "128",
"used_key_parts": ["c"],
"ref": ["test.t3.c"],
+ "loops": 80.99999987,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -18971,7 +20775,9 @@ EXPLAIN
"table_name": "t4",
"access_type": "ALL",
"possible_keys": ["idx_c"],
+ "loops": 1,
"rows": 160,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -19023,7 +20829,7 @@ a c
explain extended SELECT * FROM t4 WHERE c IN ( SELECT c FROM v1 ) and a < 2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t4 range a a 5 NULL 1 100.00 Using index condition; Using where
-1 PRIMARY <derived3> ref key0 key0 128 test.t4.c 2 100.00 FirstMatch(t4)
+1 PRIMARY <derived3> ref key0 key0 128 test.t4.c 1 100.00 FirstMatch(t4)
3 LATERAL DERIVED t3 ref c c 128 test.t4.c 2 100.00
3 LATERAL DERIVED <subquery4> eq_ref distinct_key distinct_key 4 func 1 100.00
4 MATERIALIZED t1 ALL NULL NULL NULL NULL 3 100.00
@@ -19035,6 +20841,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -19044,7 +20851,9 @@ EXPLAIN
"key": "a",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t4.a < 2",
"attached_condition": "t4.c is not null"
@@ -19059,13 +20868,16 @@ EXPLAIN
"key_length": "128",
"used_key_parts": ["c"],
"ref": ["test.t4.c"],
- "rows": 2,
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"first_match": "t4",
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"const_condition": "1",
"outer_ref_condition": "t4.c is not null",
"nested_loop": [
@@ -19078,7 +20890,9 @@ EXPLAIN
"key_length": "128",
"used_key_parts": ["c"],
"ref": ["test.t4.c"],
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -19102,7 +20916,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -19111,7 +20927,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 3,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -19187,7 +21005,7 @@ DROP TABLE t1;
CREATE TABLE t1 (pk1 INT PRIMARY KEY, f INT) ENGINE=Aria;
INSERT INTO t1 VALUES (1,0),(2,0);
CREATE TABLE t2 (pk2 INT PRIMARY KEY) ENGINE=Aria;
-INSERT INTO t2 VALUES (1),(2),(3);
+INSERT INTO t2 VALUES (1),(2),(3),(11),(12),(13);
CREATE VIEW v2 AS SELECT pk2, COUNT(*) AS cnt FROM t2 GROUP BY pk2;
SELECT * FROM t1 INNER JOIN v2 ON pk1 = pk2 WHERE f <> 5;
pk1 f pk2 cnt
@@ -19196,7 +21014,7 @@ pk1 f pk2 cnt
EXPLAIN EXTENDED SELECT * FROM t1 INNER JOIN v2 ON pk1 = pk2 WHERE f <> 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 2 100.00 Using where
-1 PRIMARY <derived2> ref key0 key0 4 test.t1.pk1 2 100.00
+1 PRIMARY <derived2> ref key0 key0 4 test.t1.pk1 1 100.00
2 LATERAL DERIVED t2 eq_ref PRIMARY PRIMARY 4 test.t1.pk1 1 100.00 Using index
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`f` AS `f`,`v2`.`pk2` AS `pk2`,`v2`.`cnt` AS `cnt` from `test`.`t1` join `test`.`v2` where `v2`.`pk2` = `test`.`t1`.`pk1` and `test`.`t1`.`f` <> 5
@@ -19205,13 +21023,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"possible_keys": ["PRIMARY"],
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.f <> 5"
}
@@ -19225,12 +21046,15 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["pk2"],
"ref": ["test.t1.pk1"],
- "rows": 2,
+ "loops": 2,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -19241,7 +21065,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["pk2"],
"ref": ["test.t1.pk1"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"using_index": true
}
@@ -19414,7 +21240,7 @@ GROUP BY t1.b,t2.c) dt
WHERE t3.d = dt.b;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t3.d 2 100.00
+1 PRIMARY <derived2> ref key0 key0 5 test.t3.d 1 100.00
2 LATERAL DERIVED t1 ref idx_b idx_b 5 test.t3.d 1 100.00 Using index; Using temporary; Using filesort
2 LATERAL DERIVED t2 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (flat, BNL join)
Warnings:
@@ -19449,7 +21275,7 @@ left join
on u.id=auditlastlogin.userid;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY u ALL NULL NULL NULL NULL 2
-1 PRIMARY <derived2> ref key0 key0 5 test.u.id 2
+1 PRIMARY <derived2> ref key0 key0 5 test.u.id 1
2 DERIVED au ALL NULL NULL NULL NULL 4 Using temporary; Using filesort
select * from t1 as u
left join
@@ -19504,9 +21330,9 @@ id a
explain extended select id, a from t1 where id in (select id from v1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 20 100.00
-1 PRIMARY <derived3> ref key0 key0 4 test.t1.id 2 100.00 FirstMatch(t1)
-3 LATERAL DERIVED t1 eq_ref PRIMARY PRIMARY 4 test.t1.id 1 100.00
-3 LATERAL DERIVED t2 ref ro_id ro_id 4 test.t1.id 1 100.00 Using where
+1 PRIMARY <derived3> ref key0 key0 4 test.t1.id 2 50.00 FirstMatch(t1)
+3 DERIVED t1 ALL PRIMARY NULL NULL NULL 20 100.00 Using temporary; Using filesort
+3 DERIVED t2 ref ro_id ro_id 4 test.t1.id 1 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`v1`) where `v1`.`id` = `test`.`t1`.`id`
select id, a from t1
@@ -19542,11 +21368,11 @@ on (t1.id = t2.ro_id AND t2.flag = 1)
group by t1.id) dt);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 20 100.00
-1 PRIMARY <derived3> ref key0 key0 4 test.t1.id 2 100.00 FirstMatch(t1)
-3 LATERAL DERIVED t1 eq_ref PRIMARY PRIMARY 4 test.t1.id 1 100.00
-3 LATERAL DERIVED t2 ref ro_id ro_id 4 test.t1.id 1 100.00 Using where
+1 PRIMARY <derived3> ref key1,distinct_key key1 4 test.t1.id 2 50.00 FirstMatch(t1)
+3 DERIVED t1 ALL PRIMARY NULL NULL NULL 20 100.00 Using temporary; Using filesort
+3 DERIVED t2 ref ro_id ro_id 4 test.t1.id 1 100.00 Using where
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` semi join ((/* select#3 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`ro_id` = `test`.`t1`.`id` and `test`.`t2`.`flag` = 1) where `test`.`t1`.`id` = `test`.`t1`.`id` group by `test`.`t1`.`id`) `dt`) where `dt`.`id` = `test`.`t1`.`id`
+Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` semi join ((/* select#3 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`ro_id` = `test`.`t1`.`id` and `test`.`t2`.`flag` = 1) where 1 group by `test`.`t1`.`id`) `dt`) where `dt`.`id` = `test`.`t1`.`id`
drop view v1;
drop table t1,t2;
#
@@ -19648,21 +21474,28 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
- "access_type": "ALL",
+ "access_type": "const",
+ "possible_keys": ["distinct_key"],
+ "key": "distinct_key",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["const"],
+ "loops": 1,
"r_loops": 1,
- "rows": 4,
- "r_rows": 2,
+ "rows": 1,
+ "r_rows": 1,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
- "r_filtered": 50,
- "attached_condition": "v1.a = 3",
+ "r_filtered": 100,
"materialized": {
"query_block": {
"union_result": {
@@ -19674,6 +21507,7 @@ ANALYZE
{
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -19681,9 +21515,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -19725,7 +21561,8 @@ create table t1 (id int, a int, index (a), index (id, a)) engine=myisam;
insert into t1 values
(17,1),(17,3010),(17,3013),(17,3053),(21,2446),(21,2467),(21,2);
create table t2 (a int) engine=myisam;
-insert into t2 values (1),(2),(3);
+insert into t2 values (1),(2),(3),(1000),(2000),(3000);
+insert into t2 select 5000 from seq_5000_to_6000;
create table t3 (id int) engine=myisam;
insert into t3 values (1),(2);
analyze table t1,t2,t3;
@@ -19747,22 +21584,25 @@ where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where
1 PRIMARY t1 ref a a 5 test.t3.id 1
+1 PRIMARY <derived2> ref key0 key0 5 test.t3.id 1
1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1
-1 PRIMARY <derived2> ref key0 key0 5 test.t3.id 2
-3 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
-2 DERIVED cp2 range NULL a 5 NULL 8 Using index for group-by
+3 MATERIALIZED t2 ALL NULL NULL NULL NULL 1007
+2 DERIVED cp2 range NULL a 5 NULL 7 Using index for group-by
explain format=json select * from t1, (select a from t1 cp2 group by a) dt, t3
where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2);
EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.`id` is not null and t3.`id` is not null"
}
@@ -19776,32 +21616,42 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t3.id"],
+ "loops": 2,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
{
"table": {
- "table_name": "<subquery3>",
- "access_type": "eq_ref",
- "possible_keys": ["distinct_key"],
- "key": "distinct_key",
- "key_length": "4",
+ "table_name": "<derived2>",
+ "access_type": "ref",
+ "possible_keys": ["key0"],
+ "key": "key0",
+ "key_length": "5",
"used_key_parts": ["a"],
- "ref": ["func"],
+ "ref": ["test.t3.id"],
+ "loops": 2,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
- "unique": 1,
"query_block": {
- "select_id": 3,
+ "select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
- "table_name": "t2",
- "access_type": "ALL",
- "rows": 3,
- "filtered": 100
+ "table_name": "cp2",
+ "access_type": "range",
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 7,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "using_index_for_group_by": true
}
}
]
@@ -19811,29 +21661,28 @@ EXPLAIN
},
{
"table": {
- "table_name": "<derived2>",
- "access_type": "ref",
- "possible_keys": ["key0"],
- "key": "key0",
- "key_length": "5",
+ "table_name": "<subquery3>",
+ "access_type": "eq_ref",
+ "possible_keys": ["distinct_key"],
+ "key": "distinct_key",
+ "key_length": "4",
"used_key_parts": ["a"],
- "ref": ["test.t3.id"],
- "rows": 2,
+ "ref": ["func"],
+ "rows": 1,
"filtered": 100,
"materialized": {
+ "unique": 1,
"query_block": {
- "select_id": 2,
+ "select_id": 3,
"nested_loop": [
{
"table": {
- "table_name": "cp2",
- "access_type": "range",
- "key": "a",
- "key_length": "5",
- "used_key_parts": ["a"],
- "rows": 8,
- "filtered": 100,
- "using_index_for_group_by": true
+ "table_name": "t2",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 1007,
+ "cost": "COST_REPLACED",
+ "filtered": 100
}
}
]
@@ -19855,9 +21704,9 @@ where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where
1 PRIMARY t1 ref a a 5 test.t3.id 1
+1 PRIMARY <derived2> ref key0 key0 5 test.t3.id 1
1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1
-1 PRIMARY <derived2> ref key0 key0 5 test.t3.id 2
-3 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+3 MATERIALIZED t2 ALL NULL NULL NULL NULL 1007
2 LATERAL DERIVED cp2 ref a a 5 test.t1.a 1 Using where; Using index
explain format=json select * from t1, (select a from t1 cp2 group by a) dt, t3
where dt.a = t1.a and t1.a = t3.id and t1.a in (select a from t2);
@@ -19865,12 +21714,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.`id` is not null and t3.`id` is not null"
}
@@ -19884,41 +21736,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t3.id"],
+ "loops": 2,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
{
"table": {
- "table_name": "<subquery3>",
- "access_type": "eq_ref",
- "possible_keys": ["distinct_key"],
- "key": "distinct_key",
- "key_length": "4",
- "used_key_parts": ["a"],
- "ref": ["func"],
- "rows": 1,
- "filtered": 100,
- "materialized": {
- "unique": 1,
- "query_block": {
- "select_id": 3,
- "nested_loop": [
- {
- "table": {
- "table_name": "t2",
- "access_type": "ALL",
- "rows": 3,
- "filtered": 100
- }
- }
- ]
- }
- }
- }
- },
- {
- "table": {
"table_name": "<derived2>",
"access_type": "ref",
"possible_keys": ["key0"],
@@ -19926,12 +21751,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t3.id"],
- "rows": 2,
+ "loops": 2,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"outer_ref_condition": "t1.a is not null",
"nested_loop": [
{
@@ -19943,7 +21771,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t1.a"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "cp2.a = t3.`id`",
"using_index": true
@@ -19953,6 +21783,37 @@ EXPLAIN
}
}
}
+ },
+ {
+ "table": {
+ "table_name": "<subquery3>",
+ "access_type": "eq_ref",
+ "possible_keys": ["distinct_key"],
+ "key": "distinct_key",
+ "key_length": "4",
+ "used_key_parts": ["a"],
+ "ref": ["func"],
+ "rows": 1,
+ "filtered": 100,
+ "materialized": {
+ "unique": 1,
+ "query_block": {
+ "select_id": 3,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 1007,
+ "cost": "COST_REPLACED",
+ "filtered": 100
+ }
+ }
+ ]
+ }
+ }
+ }
}
]
}
@@ -19970,7 +21831,7 @@ id a a id
deallocate prepare stmt;
drop table t1,t2,t3;
#
-# MDEV-MDEV-27132: Splittable derived with equality in WHERE
+# MDEV-27132: Splittable derived with equality in WHERE
#
CREATE TABLE t1 (
id int PRIMARY KEY
@@ -20011,6 +21872,7 @@ INSERT INTO t2(deleted, t1_id, email, reporting_person)
SELECT deleted, t1_id+80000, email, reporting_person FROM t2;
INSERT INTO t2(deleted, t1_id, email, reporting_person)
SELECT deleted, t1_id+160000, email, reporting_person FROM t2;
+insert into t2 (id,t1_id) select -seq,-seq from seq_1_to_1000;
CREATE TABLE t3 (
id int PRIMARY KEY,
deleted int,
@@ -20063,8 +21925,8 @@ WHERE t1.id BETWEEN 200 AND 100000;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 range t1_id t1_id 5 NULL 47 Using where; Using index
1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.t1_id 1 Using index
-1 PRIMARY <derived2> ref key0 key0 5 test.t3.t1_id 2
-2 LATERAL DERIVED t2 ref t1_id t1_id 5 test.t1.id 3 Using index condition; Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t3.t1_id 1
+2 LATERAL DERIVED t2 ref t1_id t1_id 5 test.t1.id 1 Using index condition; Using where
EXPLAIN FORMAT=JSON SELECT t1.id
FROM t1
JOIN t3
@@ -20076,6 +21938,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -20085,7 +21948,9 @@ EXPLAIN
"key": "t1_id",
"key_length": "5",
"used_key_parts": ["t1_id"],
+ "loops": 1,
"rows": 47,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.t1_id between 200 and 100000 and t3.t1_id is not null",
"using_index": true
@@ -20100,7 +21965,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["id"],
"ref": ["test.t3.t1_id"],
+ "loops": 47,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"using_index": true
}
@@ -20114,12 +21981,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["t1_id"],
"ref": ["test.t3.t1_id"],
- "rows": 2,
+ "loops": 47,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -20130,8 +22000,10 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["t1_id"],
"ref": ["test.t1.id"],
- "rows": 3,
- "filtered": 59.09090805,
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
+ "filtered": 34.55045319,
"index_condition": "t2.t1_id between 200 and 100000 and t2.t1_id = t3.t1_id",
"attached_condition": "t2.reporting_person = 1"
}
@@ -20153,6 +22025,18 @@ JOIN (SELECT t1_id FROM t2 WHERE reporting_person = 1 GROUP BY t1_id) tx
ON tx.t1_id = t1.id
WHERE t1.id BETWEEN 200 AND 100000;
id
+EXPLAIN SELECT t1.id
+FROM t1
+JOIN t3
+ON t3.t1_id = t1.id
+JOIN (SELECT t1_id FROM t2 WHERE reporting_person = 1 GROUP BY t1_id) tx
+ON tx.t1_id = t1.id
+WHERE t1.id BETWEEN 200 AND 100000;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t3 range t1_id t1_id 5 NULL 47 Using where; Using index
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.t1_id 1 Using index
+1 PRIMARY <derived2> ref key0 key0 5 test.t3.t1_id 10
+2 DERIVED t2 ALL t1_id NULL NULL NULL 2408 Using where; Using temporary; Using filesort
set optimizer_switch='split_materialized=default';
DROP TABLE t1,t2,t3;
#
@@ -20275,8 +22159,8 @@ ON from_agg_items.charge_id = charges.id AND
from_agg_items.ledger_id = charges.from_ledger_id
WHERE charges.to_ledger_id = 2;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY charges ALL PRIMARY,fk_charge_from_ledger,fk_charge_to_ledger NULL NULL NULL 20 Using where
-1 PRIMARY <derived2> ref key0 key0 17 test.charges.from_ledger_id,test.charges.id 2
+1 PRIMARY charges ref PRIMARY,fk_charge_from_ledger,fk_charge_to_ledger fk_charge_to_ledger 8 const 8
+1 PRIMARY <derived2> ref key0 key0 17 test.charges.from_ledger_id,test.charges.id 1
2 LATERAL DERIVED transaction_items ref fk_items_transaction,fk_items_charge fk_items_charge 9 test.charges.id 2
2 LATERAL DERIVED transactions eq_ref PRIMARY,fk_transactions_ledger PRIMARY 8 test.transaction_items.transaction_id 1 Using where
EXPLAIN FORMAT=JSON SELECT
@@ -20301,19 +22185,25 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "charges",
- "access_type": "ALL",
+ "access_type": "ref",
"possible_keys": [
"PRIMARY",
"fk_charge_from_ledger",
"fk_charge_to_ledger"
],
- "rows": 20,
- "filtered": 40,
- "attached_condition": "charges.to_ledger_id = 2"
+ "key": "fk_charge_to_ledger",
+ "key_length": "8",
+ "used_key_parts": ["to_ledger_id"],
+ "ref": ["const"],
+ "loops": 1,
+ "rows": 8,
+ "cost": "COST_REPLACED",
+ "filtered": 100
}
},
{
@@ -20325,12 +22215,15 @@ EXPLAIN
"key_length": "17",
"used_key_parts": ["ledger_id", "charge_id"],
"ref": ["test.charges.from_ledger_id", "test.charges.id"],
- "rows": 2,
+ "loops": 8,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -20341,7 +22234,9 @@ EXPLAIN
"key_length": "9",
"used_key_parts": ["charge_id"],
"ref": ["test.charges.id"],
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -20354,7 +22249,9 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["id"],
"ref": ["test.transaction_items.transaction_id"],
+ "loops": 2,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "transactions.ledger_id = charges.from_ledger_id"
}
@@ -20414,7 +22311,7 @@ ON from_agg_items.charge_id = charges.id AND
from_agg_items.ledger_id = charges.from_ledger_id
WHERE charges.to_ledger_id = 2;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY charges ALL PRIMARY,fk_charge_from_ledger,fk_charge_to_ledger NULL NULL NULL 20 Using where
+1 PRIMARY charges ref PRIMARY,fk_charge_from_ledger,fk_charge_to_ledger fk_charge_to_ledger 8 const 8
1 PRIMARY <derived2> ref key0 key0 17 test.charges.from_ledger_id,test.charges.id 4
2 DERIVED transaction_items ALL fk_items_transaction NULL NULL NULL 40 Using temporary; Using filesort
2 DERIVED transactions eq_ref PRIMARY PRIMARY 8 test.transaction_items.transaction_id 1
@@ -20469,8 +22366,8 @@ ON from_agg_items.charge_id = charges.id AND
from_agg_items.ledger_id = charges.from_ledger_id
WHERE charges.to_ledger_id = 2;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY charges ALL fk_charge_to_ledger NULL NULL NULL 20 Using where
-1 PRIMARY <derived2> ref key0 key0 18 test.charges.from_ledger_id,test.charges.id 2
+1 PRIMARY charges ref fk_charge_to_ledger fk_charge_to_ledger 8 const 10
+1 PRIMARY <derived2> ref key0 key0 18 test.charges.from_ledger_id,test.charges.id 1
2 LATERAL DERIVED transaction_items ref fk_items_transaction,fk_items_charge fk_items_charge 9 test.charges.id 2
2 LATERAL DERIVED transactions eq_ref PRIMARY,fk_transactions_ledger PRIMARY 8 test.transaction_items.transaction_id 1 Using where
EXPLAIN FORMAT=JSON SELECT
@@ -20495,15 +22392,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "charges",
- "access_type": "ALL",
+ "access_type": "ref",
"possible_keys": ["fk_charge_to_ledger"],
- "rows": 20,
- "filtered": 50,
- "attached_condition": "charges.to_ledger_id = 2"
+ "key": "fk_charge_to_ledger",
+ "key_length": "8",
+ "used_key_parts": ["to_ledger_id"],
+ "ref": ["const"],
+ "loops": 1,
+ "rows": 10,
+ "cost": "COST_REPLACED",
+ "filtered": 100
}
},
{
@@ -20515,12 +22418,15 @@ EXPLAIN
"key_length": "18",
"used_key_parts": ["ledger_id", "charge_id"],
"ref": ["test.charges.from_ledger_id", "test.charges.id"],
- "rows": 2,
+ "loops": 10,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"lateral": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -20531,7 +22437,9 @@ EXPLAIN
"key_length": "9",
"used_key_parts": ["charge_id"],
"ref": ["test.charges.id"],
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -20544,7 +22452,9 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["id"],
"ref": ["test.transaction_items.transaction_id"],
+ "loops": 2,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "transactions.ledger_id = charges.from_ledger_id"
}
@@ -20606,7 +22516,7 @@ ON from_agg_items.charge_id = charges.id AND
from_agg_items.ledger_id = charges.from_ledger_id
WHERE charges.to_ledger_id = 2;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY charges ALL fk_charge_to_ledger NULL NULL NULL 20 Using where
+1 PRIMARY charges ref fk_charge_to_ledger fk_charge_to_ledger 8 const 10
1 PRIMARY <derived2> ref key0 key0 18 test.charges.from_ledger_id,test.charges.id 4
2 DERIVED transaction_items ALL fk_items_transaction NULL NULL NULL 40 Using temporary; Using filesort
2 DERIVED transactions eq_ref PRIMARY PRIMARY 8 test.transaction_items.transaction_id 1
@@ -20673,7 +22583,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 const PRIMARY,oid PRIMARY 4 const 1
1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 Using index
1 PRIMARY t2 const PRIMARY PRIMARY 4 const 1 Using index
-1 PRIMARY t4 const PRIMARY,a NULL NULL NULL 1 Impossible ON condition
+1 PRIMARY t4 const PRIMARY,a NULL NULL NULL 0 Impossible ON condition
1 PRIMARY <derived3> ref key0 key0 5 const 0 Using where
3 LATERAL DERIVED t5 ref id1 id1 5 const 0 Using index
DROP VIEW v1;
@@ -20731,12 +22641,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": 0.012461052,
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": 0.012461052,
"filtered": 100,
"attached_condition": "v1.r < 'x'",
"materialized": {
@@ -20748,12 +22661,15 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": 0.010504815,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": 0.010504815,
"filtered": 100,
"attached_condition": "case when t1.n = 1 then convert(t1.lv using utf8mb3) when t1.n = 2 then t1.mv else NULL end < 'x'"
}
@@ -20821,8 +22737,8 @@ where dt.a=t1.a and t3.a < 3
from t1 limit 5;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 1000
-2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where
-2 DEPENDENT SUBQUERY <derived3> ref key0 key0 5 test.t1.a 2
+2 DEPENDENT SUBQUERY <derived3> ref key0 key0 5 test.t1.a 1
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
3 LATERAL DERIVED t2 ref a a 5 test.t1.a 10
select
a,
@@ -20958,11 +22874,10 @@ WHERE t1.valint1 = dt.valint1 AND
t1.valdate = dt.maxdate AND
t1.valint1 IN (SELECT * FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <subquery3> ALL distinct_key NULL NULL NULL 21
-1 PRIMARY t1 ref valint1,valint1_2 valint1 5 test.t2.a 2 Using index condition; Using where
-1 PRIMARY <derived2> ref key0 key0 11 test.t1.valdate,test.t1.valint1 5
-3 MATERIALIZED t2 ALL NULL NULL NULL NULL 21 Using where
-2 DERIVED t range valint1,valint1_2 valint1_2 5 NULL 51 Using index for group-by; Using temporary; Using filesort
+1 PRIMARY t2 ALL NULL NULL NULL NULL 21 Using where; Start temporary
+1 PRIMARY t1 ref valint1,valint1_2 valint1 5 test.t2.a 2 Using index condition; Using where; End temporary
+1 PRIMARY <derived2> ref key0 key0 11 test.t1.valdate,test.t1.valint1 1
+2 LATERAL DERIVED t ref valint1,valint1_2 valint1 5 test.t2.a 2 Using index condition
SELECT t1.valdouble, t1.valint1
FROM t1,
(SELECT max(t.valdate) AS maxdate, t.valint1 FROM t1 t GROUP BY t.valint1)
diff --git a/mysql-test/main/derived_cond_pushdown.test b/mysql-test/main/derived_cond_pushdown.test
index f668ca76..0dca9ce7 100644
--- a/mysql-test/main/derived_cond_pushdown.test
+++ b/mysql-test/main/derived_cond_pushdown.test
@@ -112,6 +112,7 @@ let $query= select * from v1,t2 where (v1.max_c>214) and (t2.a>v1.a);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
@@ -122,6 +123,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # extracted or formula : pushing into HAVING
@@ -131,6 +133,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
@@ -140,6 +143,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # conjunctive subformula : pushing into WHERE
@@ -147,12 +151,14 @@ let $query= select * from v1,t2 where (v1.a>6) and (t2.b>v1.b);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query= select * from v2,t2 where (v2.b>25) and (t2.a<v2.a);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # extracted or formula : pushing into WHERE
@@ -162,6 +168,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
@@ -170,6 +177,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
@@ -179,6 +187,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # conjunctive subformulas : pushing into HAVING and WHERE
@@ -187,6 +196,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
@@ -195,6 +205,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
@@ -203,6 +214,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # extracted or formula : pushing into HAVING and WHERE
@@ -213,6 +225,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
@@ -220,6 +233,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # extracted or formulas : pushing into WHERE and HAVING
@@ -229,6 +243,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
@@ -238,6 +253,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # prepare of a query containing extracted or formula
@@ -249,7 +265,9 @@ deallocate prepare stmt;
prepare stmt from
"explain format=json select * from v1,t2 where
((v1.max_c>400) and (t2.a>v1.a)) or ((v1.max_c<135) and (t2.a<v1.a));";
+--source include/explain-no-costs.inc
execute stmt;
+--source include/explain-no-costs.inc
execute stmt;
deallocate prepare stmt;
@@ -260,12 +278,14 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query= select * from v1,t2 where (v1.a=5) and (v1.max_c=t2.d);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # conjunctive subformula : pushing into WHERE using equalities
@@ -273,6 +293,7 @@ let $query= select * from v1,t2 where (t2.a<5) and (v1.a=t2.a);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
@@ -280,6 +301,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # conjunctive subformula : pushing into HAVING using equalities
@@ -287,6 +309,7 @@ let $query= select * from v1,t2 where (t2.c>150) and (v1.max_c=t2.c);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # extracted and formula : pushing into WHERE
@@ -296,6 +319,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
@@ -303,6 +327,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
@@ -311,6 +336,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # extracted and formula : pushing into WHERE using equalities
@@ -321,6 +347,7 @@ select * from v_decimal as v,t2_decimal as t where
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # extracted or formula : pushing into HAVING using equalities
@@ -330,6 +357,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # conjunctive subformulas : pushing into WHERE and HAVING using equalities
@@ -339,6 +367,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # conjunctive subformulas : pushing into WHERE and HAVING
@@ -351,6 +380,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # conjunctive subformulas : pushing into WHERE and HAVING
@@ -360,6 +390,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # conjunctive subformula : pushing into WHERE
@@ -371,6 +402,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # conjunctive subformula : pushing into WHERE
@@ -381,6 +413,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # extracted or formula : pushing into WHERE
@@ -392,6 +425,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
@@ -402,6 +436,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # nothing to push
@@ -410,12 +445,14 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.b=t2.b);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
@@ -424,6 +461,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
@@ -431,6 +469,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
@@ -439,6 +478,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using several derived tables : nothing to push
@@ -447,6 +487,7 @@ let $query= select * from v1,v2,t2 where
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
@@ -455,6 +496,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
@@ -463,6 +505,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using several derived tables : pushing in all tables
@@ -475,6 +518,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using several derived tables : pushing only in one table
@@ -486,6 +530,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using several derived tables : pushing only in one table
@@ -497,6 +542,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # extracted or formula : pushing into WHERE
@@ -508,6 +554,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using several derived tables : pushing in all tables
@@ -521,6 +568,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using several derived tables : pushing in all tables
@@ -535,6 +583,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using several derived tables : pushing in all tables
@@ -553,6 +602,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # extracted or formula : pushing into HAVING
@@ -565,6 +615,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # extracted and formula : pushing into WHERE
@@ -577,6 +628,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using query with union
@@ -589,6 +641,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using query with union
@@ -602,6 +655,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using query with union
@@ -616,6 +670,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using query with union
@@ -634,6 +689,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using derived table with union
@@ -642,6 +698,7 @@ let $query= select * from v_union,t2 where (v_union.a<3) and (v_union.c>100);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using derived table with union
@@ -653,6 +710,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using derived table with union
@@ -665,6 +723,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
@@ -673,6 +732,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using derived table with union
@@ -686,6 +746,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using derived table with union
@@ -698,6 +759,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using derived table with union of selects without aggregation
@@ -707,6 +769,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using derived table with union of selects without aggregation
@@ -716,6 +779,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using derived table with union of selects without aggregation
@@ -726,6 +790,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using derived table with union of
@@ -736,6 +801,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using derived table with union of
@@ -750,6 +816,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using embedded derived table : pushing the same conditions
@@ -762,6 +829,7 @@ select * from v4,v1 where
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using embedded view : nothing to push
@@ -773,6 +841,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using embedded view : pushing different conditions
@@ -786,6 +855,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using embedded view : pushing different conditions
@@ -798,6 +868,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using embedded view : pushing different conditions
@@ -810,6 +881,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using embedded view : pushing different conditions
@@ -823,6 +895,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using embedded view : pushing the same conditions
@@ -836,6 +909,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using embedded view : pushing the same conditions
@@ -849,6 +923,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using embedded view : pushing the same conditions
@@ -863,6 +938,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using embedded view : pushing the same conditions
@@ -875,6 +951,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
drop view v1,v2,v3,v4;
@@ -982,6 +1059,7 @@ SELECT * FROM t1 WHERE a IN (
)
);
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON
SELECT * FROM t1 WHERE a IN (
SELECT b FROM v2 WHERE b < a OR b IN (
@@ -1004,6 +1082,7 @@ SELECT * FROM t1 WHERE a IN (
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
DROP VIEW v2,v3,v4;
@@ -1026,6 +1105,7 @@ SELECT * FROM
( SELECT * FROM t1
WHERE EXISTS ( SELECT * FROM v2 WHERE b = a ) ) AS sq;
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON
SELECT * FROM
( SELECT * FROM t1
@@ -1051,6 +1131,7 @@ SELECT * FROM t1 LEFT JOIN t2 ON a = b WHERE b IS NULL;
SELECT * FROM t1 LEFT JOIN v2 ON a = b WHERE b IS NULL;
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON
SELECT * FROM t1 LEFT JOIN v2 ON a = b WHERE b IS NULL;
@@ -1065,6 +1146,7 @@ CREATE TABLE t1 (i INT);
CREATE OR REPLACE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1;
INSERT INTO t1 VALUES (1),(2);
--enable_prepare_warnings
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON
SELECT * FROM v1 WHERE i <= ANY ( SELECT 3 );
--disable_prepare_warnings
@@ -1092,12 +1174,14 @@ CREATE ALGORITHM=TEMPTABLE VIEW v2 AS SELECT * FROM t2;
SELECT * FROM v1 AS sq
WHERE b IN ( SELECT pk2 FROM v2 WHERE c > sq.b ) OR b = 100;
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON
SELECT * FROM v1 AS sq
WHERE b IN ( SELECT pk2 FROM v2 WHERE c > sq.b ) OR b = 100;
SELECT * FROM ( SELECT * FROM t1 ) AS sq
WHERE b IN ( SELECT pk2 FROM v2 WHERE c > sq.b ) OR b = 100;
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON
SELECT * FROM ( SELECT * FROM t1 ) AS sq
WHERE b IN ( SELECT pk2 FROM v2 WHERE c > sq.b ) OR b = 100;
@@ -1117,6 +1201,7 @@ INSERT INTO t2 VALUES (50);
CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1;
SELECT ( SELECT COUNT(*) FROM v1 WHERE a = t2.b ) AS f FROM t2 GROUP BY f;
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON
SELECT ( SELECT COUNT(*) FROM v1 WHERE a = t2.b ) AS f FROM t2 GROUP BY f;
@@ -1124,6 +1209,7 @@ CREATE TABLE t3 (a INT, b INT) ENGINE=MYISAM;
INSERT INTO t3 VALUES (1,10),(3,11),(2,10),(2,20),(3,21);
CREATE VIEW v2 AS SELECT a, sum(b) AS s FROM t3 GROUP BY a ;
SELECT ( SELECT COUNT(*) FROM v2 WHERE s < t2.b ) AS f FROM t2 GROUP BY f;
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON
SELECT ( SELECT COUNT(*) FROM v2 WHERE s < t2.b ) AS f FROM t2 GROUP BY f;
@@ -1145,6 +1231,7 @@ INSERT INTO t2 VALUES (5),(6);
SELECT a, GROUP_CONCAT(b) FROM v1
WHERE b IN ( SELECT COUNT(c) FROM t2 ) GROUP BY a;
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON
SELECT a, GROUP_CONCAT(b) FROM v1
WHERE b IN ( SELECT COUNT(c) FROM t2 ) GROUP BY a;
@@ -1163,6 +1250,7 @@ INSERT INTO t VALUES (1,1),(3,2);
SELECT * FROM v AS v1, v AS v2
WHERE v2.pk > v1.f AND v1.f IN ( SELECT COUNT(pk) FROM t );
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON
SELECT * FROM v AS v1, v AS v2
WHERE v2.pk > v1.f AND v1.f IN ( SELECT COUNT(pk) FROM t );
@@ -1182,6 +1270,7 @@ INSERT INTO t2 VALUES (3),(4);
SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq
WHERE i IN ( SELECT MIN(j) FROM t2 );
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON
SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq
WHERE i IN ( SELECT MIN(j) FROM t2 );
@@ -1200,6 +1289,7 @@ INSERT INTO t2 VALUES (3.2),(2.71);
SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq
WHERE i IN ( SELECT MIN(j) FROM t2 );
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON
SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq
WHERE i IN ( SELECT MIN(j) FROM t2 );
@@ -1214,6 +1304,7 @@ INSERT INTO t2 VALUES (3.21),(4.55);
SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq
WHERE i IN ( SELECT MIN(j) FROM t2 );
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON
SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq
WHERE i IN ( SELECT MIN(j) FROM t2 );
@@ -1228,6 +1319,7 @@ INSERT INTO t2 VALUES ('bbb'),('aa');
SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq
WHERE i IN ( SELECT MIN(j) FROM t2 );
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON
SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq
WHERE i IN ( SELECT MIN(j) FROM t2 );
@@ -1244,6 +1336,7 @@ INSERT INTO t2 VALUES
SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq
WHERE i IN ( SELECT MIN(j) FROM t2 );
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON
SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq
WHERE i IN ( SELECT MIN(j) FROM t2 );
@@ -1258,6 +1351,7 @@ INSERT INTO t2 VALUES ('2007-05-28'), ('2010-08-25');
SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq
WHERE i IN ( SELECT MIN(j) FROM t2 );
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON
SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq
WHERE i IN ( SELECT MIN(j) FROM t2 );
@@ -1272,6 +1366,7 @@ INSERT INTO t2 VALUES ('10:00:02'), ('11:00:10');
SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq
WHERE i IN ( SELECT MIN(j) FROM t2 );
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON
SELECT * FROM ( SELECT DISTINCT * FROM t1 ) AS sq
WHERE i IN ( SELECT MIN(j) FROM t2 );
@@ -1288,6 +1383,7 @@ CREATE OR REPLACE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT * FROM t1;
INSERT INTO t1 VALUES (2), (1);
SELECT * FROM v1 WHERE NULLIF(1, i);
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON
SELECT * FROM v1 WHERE NULLIF(1, i);
@@ -1306,6 +1402,7 @@ CREATE TABLE t2 (c VARCHAR(3));
INSERT INTO t2 VALUES ('foo'),('xyz');
SELECT * FROM v1 WHERE v1.c IN ( SELECT MIN(c) FROM t2 WHERE 0 );
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON
SELECT * FROM v1 WHERE v1.c IN ( SELECT MIN(c) FROM t2 WHERE 0 );
@@ -1340,7 +1437,9 @@ PREPARE stmt1 FROM
PREPARE stmt2 FROM
"EXPLAIN FORMAT=JSON
SELECT * FROM v1 WHERE 1 IN (SELECT a FROM t2) OR c = 'foo'";
+--source include/explain-no-costs.inc
EXECUTE stmt1;
+--source include/explain-no-costs.inc
EXECUTE stmt2;
INSERT INTO t2 SELECT a+1 FROM t2;
INSERT INTO t2 SELECT a+1 FROM t2;
@@ -1348,7 +1447,9 @@ INSERT INTO t2 SELECT a+1 FROM t2;
INSERT INTO t2 SELECT a+1 FROM t2;
INSERT INTO t2 SELECT a+1 FROM t2;
INSERT INTO t2 SELECT a+1 FROM t2;
+--source include/explain-no-costs.inc
EXECUTE stmt1;
+--source include/explain-no-costs.inc
EXECUTE stmt2;
DEALLOCATE PREPARE stmt1;
# the result here will change after the merge with the fix for mdev-11859
@@ -1485,6 +1586,7 @@ from ( select t1.a, v1.b, v1.s from t1, v1 where t1.a = v1.b ) as t
where b > 2;
eval $q1;
+--source include/explain-no-costs.inc
eval explain format=json $q1;
let $q2=
@@ -1493,6 +1595,7 @@ from ( select t1.a, v1.b, v1.s from t1, v1 where t1.a = v1.b ) as t
where a > 2;
eval $q2;
+--source include/explain-no-costs.inc
eval explain format=json $q2;
let $q3=
@@ -1501,6 +1604,7 @@ from ( select t1.a, v2.b, v2.c from t1, v2 where t1.a = v2.b ) as t
where a > 2;
eval $q3;
+--source include/explain-no-costs.inc
eval explain format=json $q3;
let $q4=
@@ -1509,6 +1613,7 @@ from ( select t1.a, v3.b, v3.m from t1, v3 where t1.a = v3.m ) as t
where a > 2;
eval $q4;
+--source include/explain-no-costs.inc
eval explain format=json $q4;
drop view v1,v2,v3;
@@ -1526,6 +1631,7 @@ let $q=
SELECT * FROM ( SELECT * FROM v1 ) AS sq WHERE f > 0;
eval $q;
+--source include/explain-no-costs.inc
eval explain format=json $q;
DROP VIEW v1;
@@ -1548,6 +1654,7 @@ SELECT * FROM t1, ( SELECT * FROM v2 ) AS sq
WHERE i1 = 1 AND ( i1 = i2 OR i1 = 2 );
eval $q;
+--source include/explain-no-costs.inc
eval explain format=json $q;
DROP VIEW v2;
@@ -1566,6 +1673,7 @@ from ( select distinct regexp_substr(t1.a,'^[A-Za-z]+') as f from t1) as t
where t.f = 'a' or t.f = 'b';
eval $q;
+--source include/explain-no-costs.inc
eval explain format=json $q;
drop table t1;
@@ -1589,6 +1697,7 @@ SELECT * FROM t1
WHERE (vc.ct>0);
eval $q;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $q;
DROP TABLE t1,t2;
@@ -1619,6 +1728,7 @@ WHERE (v1.a=1) AND (v1.b=v1.a) AND
(v1.a=t2.x) AND (v1.max_c>30);
eval $query;
eval EXPLAIN $query;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $query;
let $query=
@@ -1634,6 +1744,7 @@ WHERE (v1.a=1) AND (v1.b=v1.a) AND (v1.b=v1.d) AND
(v1.a=t2.x) AND (v1.max_c>30);
eval $query;
eval EXPLAIN $query;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $query;
DROP TABLE t1,t2;
@@ -1676,6 +1787,7 @@ WHERE (t1.a,t1.b) IN
;
eval $query;
eval EXPLAIN $query;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $query;
let $query=
@@ -1694,6 +1806,7 @@ WHERE (t1.a,t1.b) IN
;
eval $query;
eval EXPLAIN $query;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $query;
let $query=
@@ -1712,6 +1825,7 @@ WHERE (t1.a,t1.b) IN
;
eval $query;
eval EXPLAIN $query;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $query;
let $query=
@@ -1730,6 +1844,7 @@ WHERE (t1.a,t1.b) IN
;
eval $query;
eval EXPLAIN $query;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $query;
DROP TABLE t1,t2;
@@ -1768,6 +1883,7 @@ SELECT * FROM
) dt
WHERE (dt.a=2);
eval $query;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $query;
let $query=
@@ -1780,6 +1896,7 @@ SELECT * FROM
) dt
WHERE (dt.a>1);
eval $query;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $query;
let $query=
@@ -1791,6 +1908,7 @@ SELECT * FROM
) dt
WHERE (dt.a='ab');
eval $query;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $query;
let $query=
@@ -1802,6 +1920,7 @@ SELECT * FROM
) dt
WHERE (dt.a=1);
eval $query;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $query;
DROP TABLE t1;
@@ -1830,6 +1949,7 @@ JOIN
) AS dt2
ON dt1.a = dt2.a;
eval $query;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $query;
let $query=
@@ -1841,6 +1961,7 @@ SELECT * FROM
) AS dt, t1
WHERE dt.a=t1.a AND dt.a IN (1,t1.a);
eval $query;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $query;
DROP TABLE t1;
@@ -1943,6 +2064,7 @@ let $q1=
INSERT INTO t3
SELECT * FROM (SELECT a, count(*) as c FROM t1 GROUP BY a) t WHERE a<=2;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $q1;
eval $q1;
@@ -1952,6 +2074,7 @@ let $q2=
UPDATE t2, (SELECT a, count(*) as c FROM t1 GROUP BY a) t SET t2.a=t.c+10
WHERE t2.a= t.c and t.a>=3;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $q2;
eval $q2;
@@ -1961,6 +2084,7 @@ let $q3=
DELETE t2 FROM t2, (SELECT a, count(*) as c FROM t1 GROUP BY a) t
WHERE t2.a= t.c+9 and t.a=2;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $q3;
eval $q3;
@@ -1986,6 +2110,7 @@ FROM
) AS tab1
WHERE (tab1.max_a=1);
EVAL $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
LET $query=
@@ -1998,6 +2123,7 @@ FROM
) AS tab1
WHERE (tab1.max_a=1);
EVAL $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
LET $query=
@@ -2010,6 +2136,7 @@ FROM
) AS tab1
WHERE (tab1.max_a=1);
EVAL $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
LET $query=
@@ -2022,6 +2149,7 @@ FROM
) AS tab1
WHERE (tab1.max_a=1);
EVAL $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
DROP TABLE t1;
@@ -2061,6 +2189,7 @@ SELECT * FROM ( SELECT t1.f FROM v1 JOIN t1 ) AS t WHERE f IS NOT NULL;
eval $q1;
eval EXPLAIN $q1;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $q1;
SELECT * FROM t1;
@@ -2073,6 +2202,7 @@ SELECT * FROM ( SELECT t1.f FROM v1 JOIN t1 ON v1.f=t1.f) AS t
WHERE f IS NOT NULL;
eval $q2;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $q2;
SELECT * FROM t1;
@@ -2089,10 +2219,11 @@ DROP TABLE t1;
CREATE TABLE t1 (f1 text, f2 int);
INSERT INTO t1 VALUES ('x',1), ('y',2);
-CREATE VIEW v1 AS SELECT f2 FROM ( SELECT f2 FROM t1 ) AS t;
+CREATE VIEW v1 AS SELECT f2 FROM ( SELECT f2 FROM t1 GROUP BY f2) AS t;
let $q1 =
UPDATE v1, t1 SET t1.f1 = 'z' WHERE v1.f2 < 2 AND t1.f2 = v1.f2;
eval $q1;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $q1;
SELECT * FROM t1;
@@ -2101,6 +2232,7 @@ CREATE VIEW v2 AS SELECT f2 FROM ( SELECT DISTINCT f2 FROM t1 ) AS t;
let $q2 =
SELECT * FROM v2, t1 WHERE v2.f2 < 2 AND t1.f2 = v2.f2;
eval $q2;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $q2;
DROP VIEW v1,v2;
@@ -2136,6 +2268,7 @@ CREATE TABLE t1 (a INT, b INT);
CREATE VIEW v1 AS SELECT a, MAX(b) FROM t1 GROUP BY a;
SELECT * FROM (SELECT 1 FROM v1 UNION (SELECT 1 FROM v1 WHERE @a := uuid())) dt;
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON
SELECT * FROM (SELECT 1 FROM v1 UNION (SELECT 1 FROM v1 WHERE @a := uuid())) dt;
@@ -2280,6 +2413,7 @@ select col2, col1 from v2;
explain select * from v3 where col1=123;
--echo # This must use ref accesses for reading table t1, not full scans:
+--source include/explain-no-costs.inc
explain format=json
select * from v3 where col1=123 and col2=321;
@@ -2303,6 +2437,7 @@ select a, f1(a), sum(b) from t1 group by a, f1(a);
--echo # "a > 1" will be pushed all the way to the table scan on t1
--echo # "a2>123" will be pushed into HAVING (as it refers to an SP call which
--echo # prevents pushing it to the WHERE)
+--source include/explain-no-costs.inc
explain format=json
select * from v2 where (s+1) > 10 AND a > 1 and a2>123;
@@ -2315,6 +2450,7 @@ insert into t4 select a,a,a from t1;
--echo # The subquery must be materialized and must have
--echo # "attached_condition": "t1.a + 1 > 10",
--echo # "having_condition": "`f1(a)` > 1 and `sum(b)` > 123",
+--source include/explain-no-costs.inc
explain format=json
select *
from t4
@@ -2359,6 +2495,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a<5);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using intersect in view definition
@@ -2368,6 +2505,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a=8);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using intersect in view definition
@@ -2376,6 +2514,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (t2.a=8);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using intersect in view definition
@@ -2384,6 +2523,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.c>200);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using intersect in view definition
@@ -2393,6 +2533,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a<5) and (v1.c>110);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using intersect in view definition
@@ -2402,6 +2543,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using intersect in view definition
@@ -2412,6 +2554,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using intersect in view definition
@@ -2425,6 +2568,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using intersect in view definition
@@ -2456,6 +2600,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
drop view v1;
@@ -2473,6 +2618,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a<5);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using except in view definition
@@ -2482,6 +2628,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a=6);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using except in view definition
@@ -2490,6 +2637,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (t2.a=6);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using except in view definition
@@ -2498,6 +2646,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.c>500);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using except in view definition
@@ -2507,6 +2656,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a<5) and (v1.c>500);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using except in view definition
@@ -2516,6 +2666,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using except in view definition
@@ -2526,6 +2677,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using except in view definition
@@ -2540,6 +2692,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--echo # using except in view definition
@@ -2571,6 +2724,7 @@ let $query=
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
drop view v1;
@@ -2591,6 +2745,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a>5) and (v1.c>200);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
drop view v1;
@@ -2611,6 +2766,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<200);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
drop view v1;
@@ -2631,6 +2787,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a>5) and (v1.c>200);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
drop view v1;
@@ -2651,6 +2808,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<200);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
drop view v1;
@@ -2671,6 +2829,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<150);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
drop view v1;
@@ -2691,6 +2850,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<130);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
drop view v1;
@@ -2714,6 +2874,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.c<130);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
drop view v1;
@@ -2736,6 +2897,7 @@ let $query= select * from v2,t2 where (v2.a=t2.a) and (v2.a>4) and (v2.c<150);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
drop view v1,v2;
@@ -2758,6 +2920,7 @@ let $query= select * from v2,t2 where (v2.a=t2.a) and (v2.a>4) and (v2.c<150);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
drop view v1,v2;
@@ -2776,6 +2939,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a>4) and (v1.b>12) and
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
drop view v1;
@@ -2794,6 +2958,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a<2) and (v1.b<30) and
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
drop view v1;
@@ -2814,6 +2979,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and ((v1.a<2) or (v1.a<5)) and
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
drop view v1;
@@ -2835,6 +3001,7 @@ let $query= select * from v1,t2 where (v1.a=t2.a) and (v1.a>1) and (v1.b > 12) a
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
drop view v1;
@@ -2858,6 +3025,7 @@ let $query= select * from v1,t2 where (v1.b=t2.b) and (v1.a<5);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
drop view v1;
@@ -2876,6 +3044,7 @@ let $query= select * from v1,t2 where (v1.b=t2.b) and (v1.a<4);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
drop view v1;
@@ -2894,6 +3063,7 @@ let $query= select * from v1,t2 where (v1.b=t2.b) and (v1.a<3);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
drop view v1;
@@ -2930,6 +3100,7 @@ eval $no_pushdown $q1;
--sorted_result
eval $q1;
eval explain $q1;
+--source include/explain-no-costs.inc
eval explain format=json $q1;
let $q2=
@@ -2946,6 +3117,7 @@ eval $no_pushdown $q2;
--sorted_result
eval $q2;
eval explain $q2;
+--source include/explain-no-costs.inc
eval explain format=json $q2;
let $q3=
@@ -2956,6 +3128,7 @@ from (select a, c, sum(b) over (partition by a,c) as s from t2) as t, t1
eval $no_pushdown $q3;
eval $q3;
eval explain $q3;
+--source include/explain-no-costs.inc
eval explain format=json $q3;
let $q4=
@@ -2974,6 +3147,7 @@ eval $no_pushdown $q4;
--sorted_result
eval $q4;
eval explain $q4;
+--source include/explain-no-costs.inc
eval explain format=json $q4;
let $q5=
@@ -2988,6 +3162,7 @@ eval $no_pushdown $q5;
--sorted_result
eval $q5;
eval explain $q5;
+--source include/explain-no-costs.inc
eval explain format=json $q5;
let $q6=
@@ -3002,6 +3177,7 @@ eval $no_pushdown $q6;
--sorted_result
eval $q6;
eval explain $q6;
+--source include/explain-no-costs.inc
eval explain format=json $q6;
let $q7=
@@ -3016,6 +3192,7 @@ eval $no_pushdown $q7;
--sorted_result
eval $q7;
eval explain $q7;
+--source include/explain-no-costs.inc
eval explain format=json $q7;
drop table t1,t2;
@@ -3063,6 +3240,7 @@ where t1.b < 3;
eval $no_splitting $q1;
eval $q1;
eval explain extended $q1;
+--source include/explain-no-costs.inc
eval explain format=json $q1;
eval prepare stmt from "$q1";
execute stmt;
@@ -3079,6 +3257,7 @@ where t1.b <= 5;
eval $no_splitting $q10;
eval $q10;
eval explain extended $q10;
+--source include/explain-no-costs.inc
eval explain format=json $q10;
eval prepare stmt from "$q10";
execute stmt;
@@ -3096,6 +3275,7 @@ from t1 left join
eval $no_splitting $q2;
eval $q2;
eval explain extended $q2;
+--source include/explain-no-costs.inc
eval explain format=json $q2;
create table t3 (a int, b int, c char(127), index idx_b(b)) engine=myisam;
@@ -3125,6 +3305,7 @@ where t3.b > 15;
eval $no_splitting $q3;
eval $q3;
eval explain extended $q3;
+--source include/explain-no-costs.inc
eval explain format=json $q3;
let $q30=
@@ -3137,6 +3318,7 @@ where t3.b <= 15;
eval $no_splitting $q30;
eval $q30;
eval explain extended $q30;
+--source include/explain-no-costs.inc
eval explain format=json $q30;
let $q4=
@@ -3149,6 +3331,7 @@ where t3.b > 15;
eval $no_splitting $q4;
eval $q4;
eval explain extended $q4;
+--source include/explain-no-costs.inc
eval explain format=json $q4;
let $q40=
@@ -3161,6 +3344,7 @@ where t3.b <= 15;
eval $no_splitting $q40;
eval $q40;
eval explain extended $q40;
+--source include/explain-no-costs.inc
eval explain format=json $q40;
drop index idx_a on t2;
@@ -3184,6 +3368,7 @@ eval $no_splitting $q5;
--sorted_result
eval $q5;
eval explain extended $q5;
+--source include/explain-no-costs.inc
eval explain format=json $q5;
let $q50=
@@ -3194,6 +3379,7 @@ where t2.b < 40 and t2.a=t3.a and t3.c=t.c;
eval $no_splitting $q50;
eval $q50;
eval explain extended $q50;
+--source include/explain-no-costs.inc
eval explain format=json $q50;
let $q6=
@@ -3206,6 +3392,7 @@ eval $no_splitting $q6;
--sorted_result
eval $q6;
eval explain extended $q6;
+--source include/explain-no-costs.inc
eval explain format=json $q6;
let $q60=
@@ -3218,6 +3405,7 @@ eval $no_splitting $q60;
--sorted_result
eval $q60;
eval explain extended $q60;
+--source include/explain-no-costs.inc
eval explain format=json $q60;
drop table t1,t2,t3,t4;
@@ -3254,6 +3442,7 @@ SELECT * FROM t4 WHERE c IN ( SELECT c FROM v1 ) and a < 2;
eval $no_splitting $q1;
eval $q1;
eval explain extended $q1;
+--source include/explain-no-costs.inc
eval explain format=json $q1;
DROP VIEW v1;
@@ -3324,7 +3513,7 @@ CREATE TABLE t1 (pk1 INT PRIMARY KEY, f INT) ENGINE=Aria;
INSERT INTO t1 VALUES (1,0),(2,0);
CREATE TABLE t2 (pk2 INT PRIMARY KEY) ENGINE=Aria;
-INSERT INTO t2 VALUES (1),(2),(3);
+INSERT INTO t2 VALUES (1),(2),(3),(11),(12),(13);
CREATE VIEW v2 AS SELECT pk2, COUNT(*) AS cnt FROM t2 GROUP BY pk2;
@@ -3333,6 +3522,7 @@ SELECT * FROM t1 INNER JOIN v2 ON pk1 = pk2 WHERE f <> 5;
eval $q;
eval EXPLAIN EXTENDED $q;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $q;
DROP VIEW v2;
@@ -3601,7 +3791,8 @@ insert into t1 values
(17,1),(17,3010),(17,3013),(17,3053),(21,2446),(21,2467),(21,2);
create table t2 (a int) engine=myisam;
-insert into t2 values (1),(2),(3);
+insert into t2 values (1),(2),(3),(1000),(2000),(3000);
+insert into t2 select 5000 from seq_5000_to_6000;
create table t3 (id int) engine=myisam;
insert into t3 values (1),(2);
@@ -3615,11 +3806,13 @@ select * from t1, (select a from t1 cp2 group by a) dt, t3
set optimizer_switch="split_materialized=off";
eval $q;
eval explain $q;
+--source include/explain-no-costs.inc
eval explain format=json $q;
set optimizer_switch="split_materialized=default";
eval $q;
eval explain $q;
+--source include/explain-no-costs.inc
eval explain format=json $q;
eval prepare stmt from "$q";
@@ -3630,7 +3823,7 @@ deallocate prepare stmt;
drop table t1,t2,t3;
--echo #
---echo # MDEV-MDEV-27132: Splittable derived with equality in WHERE
+--echo # MDEV-27132: Splittable derived with equality in WHERE
--echo #
CREATE TABLE t1 (
@@ -3677,6 +3870,9 @@ INSERT INTO t2(deleted, t1_id, email, reporting_person)
INSERT INTO t2(deleted, t1_id, email, reporting_person)
SELECT deleted, t1_id+160000, email, reporting_person FROM t2;
+insert into t2 (id,t1_id) select -seq,-seq from seq_1_to_1000;
+
+
CREATE TABLE t3 (
id int PRIMARY KEY,
deleted int,
@@ -3719,11 +3915,13 @@ set optimizer_switch='split_materialized=on';
eval $q;
eval EXPLAIN $q;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $q;
set optimizer_switch='split_materialized=off';
eval $q;
+eval EXPLAIN $q;
set optimizer_switch='split_materialized=default';
@@ -3826,6 +4024,7 @@ WHERE charges.to_ledger_id = 2;
set optimizer_switch='split_materialized=on';
eval $q;
eval EXPLAIN $q;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $q;
set optimizer_switch='split_materialized=off';
@@ -3858,6 +4057,7 @@ WHERE charges.to_ledger_id = 2;
set optimizer_switch='split_materialized=on';
eval $q1;
eval EXPLAIN $q1;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $q1;
set optimizer_switch='split_materialized=off';
diff --git a/mysql-test/main/derived_opt.result b/mysql-test/main/derived_opt.result
index cf0c1cb6..2f3b29c5 100644
--- a/mysql-test/main/derived_opt.result
+++ b/mysql-test/main/derived_opt.result
@@ -92,13 +92,13 @@ pla_id test
explain SELECT STRAIGHT_JOIN d.pla_id, m2.mat_id FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY m2 ALL NULL NULL NULL NULL 9
-1 PRIMARY <derived2> ref key0 key0 7 test.m2.matintnum 2
+1 PRIMARY <derived2> ref key0 key0 7 test.m2.matintnum 1
2 DERIVED mp ALL NULL NULL NULL NULL 9 Using temporary; Using filesort
2 DERIVED m1 eq_ref PRIMARY PRIMARY 3 test.mp.mat_id 1
explain SELECT STRAIGHT_JOIN d.pla_id, m2.test FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY m2 ALL NULL NULL NULL NULL 9
-1 PRIMARY <derived2> ref key0 key0 7 test.m2.matintnum 2
+1 PRIMARY <derived2> ref key0 key0 7 test.m2.matintnum 1
2 DERIVED mp ALL NULL NULL NULL NULL 9 Using temporary; Using filesort
2 DERIVED m1 eq_ref PRIMARY PRIMARY 3 test.mp.mat_id 1
drop table t1,t2;
@@ -323,10 +323,9 @@ JOIN t1 AS tc ON (tb.pk = tc.pk)
JOIN t4 AS td ON tc.a = td.a) tu)
limit 10;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL #
+1 PRIMARY <derived3> ALL distinct_key NULL NULL NULL #
1 PRIMARY tx eq_ref PRIMARY PRIMARY 4 tu.pk # Using index
1 PRIMARY ty eq_ref PRIMARY PRIMARY 4 tu.pk # Using index
-2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL #
3 DERIVED td system PRIMARY NULL NULL NULL # Using temporary
3 DERIVED tc ref PRIMARY,a a 3 const #
3 DERIVED ta eq_ref PRIMARY PRIMARY 4 test.tc.pk # Using index
@@ -535,7 +534,7 @@ ON t2.id=t.id
WHERE t2.id < 3;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 Using index condition
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.id 2
+1 PRIMARY <derived2> ref key0 key0 5 test.t2.id 1
2 DERIVED t1 ALL NULL NULL NULL NULL 8 Using temporary; Using filesort
set join_cache_level=default;
set optimizer_switch= @save_optimizer_switch;
diff --git a/mysql-test/main/derived_split_innodb.result b/mysql-test/main/derived_split_innodb.result
index 6346b44d..90b980bb 100644
--- a/mysql-test/main/derived_split_innodb.result
+++ b/mysql-test/main/derived_split_innodb.result
@@ -20,7 +20,7 @@ EXPLAIN SELECT t1.n1 FROM t1, (SELECT n1, n2 FROM t1 WHERE c1 = 'a' GROUP BY n1)
WHERE t.n1 = t1.n1 AND t.n2 = t1.n2 AND c1 = 'a' GROUP BY n1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ref c1,n1_c1_n2 c1 1 const 2 Using index condition; Using where; Using temporary; Using filesort
-1 PRIMARY <derived2> ref key0 key0 8 test.t1.n1,test.t1.n2 2
+1 PRIMARY <derived2> ref key0 key0 8 test.t1.n1,test.t1.n2 1
2 LATERAL DERIVED t1 ref c1,n1_c1_n2 n1_c1_n2 4 test.t1.n1 1 Using where; Using index
SELECT t1.n1 FROM t1, (SELECT n1, n2 FROM t1 WHERE c1 = 'a' GROUP BY n1) as t
WHERE t.n1 = t1.n1 AND t.n2 = t1.n2 AND c1 = 'a' GROUP BY n1;
@@ -49,7 +49,7 @@ t2
WHERE t2.id2=t.id2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.id2 2
+1 PRIMARY <derived2> ref key0 key0 5 test.t2.id2 1
2 DERIVED t3 ALL NULL NULL NULL NULL 1 Using where; Using temporary; Using filesort
2 DERIVED t1 eq_ref PRIMARY,id2 PRIMARY 4 test.t3.i3 1
2 DERIVED t2 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (flat, BNL join)
@@ -99,7 +99,7 @@ ON t2.id=t.id
WHERE t2.id < 3;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.id 2
+1 PRIMARY <derived2> ref key0 key0 5 test.t2.id 1
2 LATERAL DERIVED t1 eq_ref PRIMARY PRIMARY 4 test.t2.id 1
set join_cache_level=default;
DROP TABLE t1,t2;
@@ -128,8 +128,8 @@ left join
(v1 join t1 as t on v1.f1=t.f1 and t.f2 = null)
on t1.f1=t.f1;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t const f2 NULL NULL NULL 1 Impossible ON condition
-1 PRIMARY <derived2> const key1 NULL NULL NULL 1 Impossible ON condition
+1 PRIMARY t const f2 NULL NULL NULL 0 Impossible ON condition
+1 PRIMARY <derived2> const key0,key1 NULL NULL NULL 0 Impossible ON condition
1 PRIMARY t1 ALL NULL NULL NULL NULL 3
2 DERIVED t2 ALL PRIMARY NULL NULL NULL 3 Using temporary; Using filesort
set statement optimizer_switch='split_materialized=off' for explain select t.f2
@@ -138,8 +138,8 @@ left join
(v1 join t1 as t on v1.f1=t.f1 and t.f2 = null)
on t1.f1=t.f1;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t const f2 NULL NULL NULL 1 Impossible ON condition
-1 PRIMARY <derived3> const key1 NULL NULL NULL 1 Impossible ON condition
+1 PRIMARY t const f2 NULL NULL NULL 0 Impossible ON condition
+1 PRIMARY <derived3> const key0,key1 NULL NULL NULL 0 Impossible ON condition
1 PRIMARY t1 ALL NULL NULL NULL NULL 3
3 DERIVED t2 index NULL PRIMARY 4 NULL 3
drop view v1;
@@ -157,26 +157,26 @@ set statement optimizer_switch='split_materialized=off' for EXPLAIN
SELECT *
FROM
t1 JOIN
-(SELECT t1.a, t1.b FROM t1, t2 WHERE t1.b = t2.c GROUP BY t1.a, t1.b) as dt
+(SELECT t1_inner.a, t1_inner.b FROM t1 as t1_inner, t2 as t2_inner WHERE t1_inner.b = t2_inner.c GROUP BY t1_inner.a, t1_inner.b) as dt
WHERE
t1.a = dt.a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index a,a_2 a_2 10 NULL 6 Using where; Using index
-1 PRIMARY <derived3> ref key0 key0 5 test.t1.a 2
-3 DERIVED t1 index NULL a_2 10 NULL 6 Using where; Using index
-3 DERIVED t2 ref c c 5 test.t1.b 1 Using index
+1 PRIMARY <derived3> ref key0 key0 5 test.t1.a 1
+3 DERIVED t1_inner index NULL a_2 10 NULL 6 Using where; Using index
+3 DERIVED t2_inner ref c c 5 test.t1_inner.b 1 Using index
set statement optimizer_switch='split_materialized=on' for EXPLAIN
SELECT *
FROM
t1 JOIN
-(SELECT t1.a, t1.b FROM t1, t2 WHERE t1.b = t2.c GROUP BY t1.a, t1.b) as dt
+(SELECT t1_inner.a, t1_inner.b FROM t1 as t1_inner, t2 as t2_inner WHERE t1_inner.b = t2_inner.c GROUP BY t1_inner.a, t1_inner.b) as dt
WHERE
t1.a = dt.a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index a,a_2 a_2 10 NULL 6 Using where; Using index
-1 PRIMARY <derived3> ref key0 key0 5 test.t1.a 2
-3 LATERAL DERIVED t1 ref a,a_2 a 5 test.t1.a 1 Using where; Using temporary; Using filesort
-3 LATERAL DERIVED t2 ref c c 5 test.t1.b 1 Using index
+1 PRIMARY <derived3> ref key0 key0 5 test.t1.a 1
+3 DERIVED t1_inner index a,a_2 a_2 10 NULL 6 Using where; Using index
+3 DERIVED t2_inner ref c c 5 test.t1_inner.b 1 Using index
DROP TABLE t1, t2;
#
# Bug mdev-25714: usage non-splitting covering index is cheaper than
@@ -208,8 +208,8 @@ t2
where t1.id = dt.id and t1.itemid = dt.itemid and t2.id=t1.itemid;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 1
-1 PRIMARY <derived2> ref key1 key1 4 test.t2.id 2
-1 PRIMARY t1 ALL idx NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY <derived2> ref key1 key1 4 test.t2.id 1
+1 PRIMARY t1 ref idx idx 4 test.t2.id 3 Using where
2 DERIVED t3 ref idx1,idx2 idx1 4 const 5 Using where; Using index
select t1.id, t1.itemid, dt.id, t2.id
from t1,
@@ -227,8 +227,8 @@ t2
where t1.id = dt.id and t1.itemid = dt.itemid and t2.id=t1.itemid;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 1
-1 PRIMARY <derived2> ref key1 key1 4 test.t2.id 2
-1 PRIMARY t1 ALL idx NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY <derived2> ref key1 key1 4 test.t2.id 1
+1 PRIMARY t1 ref idx idx 4 test.t2.id 3 Using where
2 DERIVED t3 ref idx1 idx1 4 const 5 Using where; Using index
select t1.id, t1.itemid, dt.id, t2.id
from t1,
@@ -273,7 +273,7 @@ on t3.a=t.a and t3.c=t.c
where t3.b > 15;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 range idx_b idx_b 5 NULL 2 Using index condition; Using where
-1 PRIMARY <derived2> ref key0 key0 133 test.t3.a,test.t3.c 2
+1 PRIMARY <derived2> ref key0 key0 133 test.t3.a,test.t3.c 1
2 LATERAL DERIVED t4 ref idx idx 133 test.t3.a,test.t3.c 1
# ... and if one adds WITH ROLLUP, then LATERAL DERIVED is no longer used:
explain select t3.a,t3.c,t.max,t.min
@@ -370,6 +370,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"const_condition": "1",
@@ -378,9 +379,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 5,
"r_rows": 5,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -397,9 +400,11 @@ ANALYZE
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t1.b"],
+ "loops": 5,
"r_loops": 5,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -417,9 +422,11 @@ ANALYZE
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t1.b"],
+ "loops": 10,
"r_loops": 10,
"rows": 3,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -437,9 +444,11 @@ ANALYZE
"key_length": "5",
"used_key_parts": ["grp_id"],
"ref": ["test.t1.b"],
+ "loops": 30,
"r_loops": 30,
"rows": 10,
"r_rows": 1,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
@@ -449,6 +458,7 @@ ANALYZE
"lateral": 1,
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 5,
"r_total_time_ms": "REPLACED",
"outer_ref_condition": "t1.b is not null",
@@ -462,9 +472,11 @@ ANALYZE
"key_length": "5",
"used_key_parts": ["grp_id"],
"ref": ["test.t1.b"],
+ "loops": 1,
"r_loops": 5,
"rows": 100,
"r_rows": 100,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -477,9 +489,11 @@ ANALYZE
"table": {
"table_name": "t11",
"access_type": "ALL",
+ "loops": 100,
"r_loops": 5,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -690,6 +704,14 @@ a b a b a b grp_id count(*)
5 5 5 2 5 2 5 100
5 5 5 2 5 3 5 100
set join_cache_level=4;
+set optimizer_trace=1;
+set @tmp=@@optimizer_switch, optimizer_switch='hash_join_cardinality=off';
+insert into t11
+select A.seq, A.seq from seq_11_to_100 A;
+analyze table t11 persistent for all;
+Table Op Msg_type Msg_text
+test.t11 analyze status Engine-independent statistics collected
+test.t11 analyze status OK
explain select *
from
(
@@ -711,7 +733,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ref a a 5 test.t1.b 3 Using where
1 PRIMARY <derived2> ref key0 key0 5 test.t1.b 10 Using where
2 LATERAL DERIVED t10 ref grp_id grp_id 5 test.t1.b 100
-2 LATERAL DERIVED t11 hash_ALL NULL #hash#$hj 5 test.t10.col1 10 Using where; Using join buffer (flat, BNLH join)
+2 LATERAL DERIVED t11 hash_ALL NULL #hash#$hj 5 test.t10.col1 100 Using where; Using join buffer (flat, BNLH join)
select *
from
(
@@ -758,7 +780,14 @@ a b a b a b grp_id count(*)
5 5 5 2 5 1 5 100
5 5 5 2 5 2 5 100
5 5 5 2 5 3 5 100
+set optimizer_switch=@tmp;
set join_cache_level=default;
+delete from t11;
+insert into t11 select A.seq, A.seq from seq_1_to_10 A;
+analyze table t11 persistent for all;
+Table Op Msg_type Msg_text
+test.t11 analyze status Engine-independent statistics collected
+test.t11 analyze status OK
drop index a on t2;
drop index a on t3;
explain select *
@@ -911,13 +940,12 @@ GROUP BY groupId, id
USING (groupId, id)
WHERE id IN (1,2,3,4,5,6,7,8);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 index PRIMARY PRIMARY 8 NULL 19 Using index
-1 PRIMARY <subquery4> eq_ref distinct_key distinct_key 4 func 1 Using where
-1 PRIMARY <derived3> ref key0 key0 8 test.t1.groupId,test.t1.id 2
-4 MATERIALIZED <derived5> ALL NULL NULL NULL NULL 8
+1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 19
+1 PRIMARY <derived3> ref key0 key0 8 test.t1.groupId,test.t1.id 1
+1 PRIMARY <derived5> eq_ref distinct_key distinct_key 4 test.t1.id 1 Using where
5 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
-3 LATERAL DERIVED t1 eq_ref PRIMARY PRIMARY 8 test.t1.groupId,test.t1.id 1 Using index
-3 LATERAL DERIVED <derived7> ref key0 key0 4 test.t1.id 2 Using where; FirstMatch(t1)
+3 LATERAL DERIVED t1 eq_ref PRIMARY PRIMARY 8 test.t1.groupId,test.t1.id 1
+3 LATERAL DERIVED <derived7> eq_ref distinct_key distinct_key 4 test.t1.id 1 Using where
7 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
set statement optimizer_switch='split_materialized=off, loosescan=off' for
set statement in_predicate_conversion_threshold=2 for
diff --git a/mysql-test/main/derived_split_innodb.test b/mysql-test/main/derived_split_innodb.test
index 67db02f7..f0498834 100644
--- a/mysql-test/main/derived_split_innodb.test
+++ b/mysql-test/main/derived_split_innodb.test
@@ -146,7 +146,7 @@ EXPLAIN
SELECT *
FROM
t1 JOIN
- (SELECT t1.a, t1.b FROM t1, t2 WHERE t1.b = t2.c GROUP BY t1.a, t1.b) as dt
+ (SELECT t1_inner.a, t1_inner.b FROM t1 as t1_inner, t2 as t2_inner WHERE t1_inner.b = t2_inner.c GROUP BY t1_inner.a, t1_inner.b) as dt
WHERE
t1.a = dt.a;
@@ -429,11 +429,23 @@ eval explain $q;
eval $q;
set join_cache_level=4;
+set optimizer_trace=1;
+set @tmp=@@optimizer_switch, optimizer_switch='hash_join_cardinality=off';
+# Need table t11 to be larger in 11.0:
+insert into t11
+select A.seq, A.seq from seq_11_to_100 A;
+analyze table t11 persistent for all;
+
eval explain $q;
eval $q;
+set optimizer_switch=@tmp;
set join_cache_level=default;
+delete from t11;
+insert into t11 select A.seq, A.seq from seq_1_to_10 A;
+analyze table t11 persistent for all;
+
drop index a on t2;
drop index a on t3;
diff --git a/mysql-test/main/derived_view.result b/mysql-test/main/derived_view.result
index 432d4e7d..5ceb04cb 100644
--- a/mysql-test/main/derived_view.result
+++ b/mysql-test/main/derived_view.result
@@ -214,7 +214,7 @@ explain extended
select * from t1 join (select * from t2 group by f2) tt on f1=f2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 11 100.00 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t1.f1 2 100.00
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.f1 1 100.00
2 DERIVED t2 ALL NULL NULL NULL NULL 11 100.00 Using temporary; Using filesort
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11`,`tt`.`f2` AS `f2`,`tt`.`f22` AS `f22` from `test`.`t1` join (/* select#2 */ select `test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f22` AS `f22` from `test`.`t2` group by `test`.`t2`.`f2`) `tt` where `tt`.`f2` = `test`.`t1`.`f1`
@@ -228,7 +228,7 @@ flush status;
explain select * from t1 join (select * from t2 group by f2) tt on f1=f2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 11 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t1.f1 2
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.f1 1
2 DERIVED t2 ALL NULL NULL NULL NULL 11 Using temporary; Using filesort
show status like 'Handler_read%';
Variable_name Value
@@ -288,7 +288,7 @@ explain showing created indexes
explain extended select * from t1 join v2 on f1=f2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 11 100.00 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t1.f1 2 100.00
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.f1 1 100.00
2 DERIVED t2 ALL NULL NULL NULL NULL 11 100.00 Using temporary; Using filesort
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f11` AS `f11`,`v2`.`f2` AS `f2`,`v2`.`f22` AS `f22` from `test`.`t1` join `test`.`v2` where `v2`.`f2` = `test`.`t1`.`f1`
@@ -339,7 +339,7 @@ flush status;
explain select * from t1 join v2 on f1=f2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 11 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t1.f1 2
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.f1 1
2 DERIVED t2 ALL NULL NULL NULL NULL 11 Using temporary; Using filesort
show status like 'Handler_read%';
Variable_name Value
@@ -372,7 +372,7 @@ Handler_read_rnd_next 36
explain extended select * from v1 join v4 on f1=f2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 11 100.00 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.f2 2 100.00
+1 PRIMARY <derived2> ref key0 key0 5 test.t2.f2 1 100.00
2 DERIVED t1 ALL NULL NULL NULL NULL 11 100.00 Using where; Using temporary; Using filesort
Warnings:
Note 1003 /* select#1 */ select `v1`.`f1` AS `f1`,`v1`.`f11` AS `f11`,`test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f22` AS `f22` from `test`.`v1` join `test`.`t2` where `v1`.`f1` = `test`.`t2`.`f2` and `test`.`t2`.`f2` in (2,3)
@@ -381,12 +381,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 11,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.f2 in (2,3) and t2.f2 is not null"
}
@@ -400,11 +403,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["f1"],
"ref": ["test.t2.f2"],
- "rows": 2,
+ "loops": 11,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
@@ -413,7 +419,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 11,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.f1 in (2,3)"
}
@@ -485,16 +493,20 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 11,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "tt.f1",
"temporary_table": {
@@ -503,12 +515,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 11,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "tt.f1 > 2",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
@@ -517,7 +532,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 11,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.f1 < 7 and t1.f1 > 2"
}
@@ -552,7 +569,7 @@ join
on x.f1 = z.f1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived3> ALL NULL NULL NULL NULL 11 100.00 Using where
-1 PRIMARY <derived5> ref key0 key0 5 tt.f1 2 100.00
+1 PRIMARY <derived5> ref key0 key0 5 tt.f1 1 100.00
5 DERIVED t1 ALL NULL NULL NULL NULL 11 100.00 Using where; Using temporary; Using filesort
3 DERIVED t1 ALL NULL NULL NULL NULL 11 100.00 Using where; Using temporary; Using filesort
Warnings:
@@ -566,17 +583,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 11,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "tt.f1 > 2 and tt.f1 > 2 and tt.f1 is not null",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
@@ -585,7 +606,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 11,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.f1 < 7 and t1.f1 > 2 and t1.f1 > 2"
}
@@ -606,11 +629,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["f1"],
"ref": ["tt.f1"],
- "rows": 2,
+ "loops": 11,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 5,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
@@ -619,7 +645,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 11,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.f1 < 7 and t1.f1 > 2 and t1.f1 > 2"
}
@@ -689,7 +717,7 @@ join
on x.f1 = z.f1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 11 100.00 Using where
-1 PRIMARY <derived4> ref key0 key0 5 x.f1 2 100.00
+1 PRIMARY <derived4> ref key0 key0 5 x.f1 1 100.00
4 DERIVED <derived5> ALL NULL NULL NULL NULL 11 100.00 Using where; Using temporary; Using filesort
5 DERIVED t1 ALL NULL NULL NULL NULL 11 100.00 Using where; Using temporary; Using filesort
2 DERIVED <derived3> ALL NULL NULL NULL NULL 11 100.00 Using where; Using temporary; Using filesort
@@ -707,17 +735,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 11,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "x.f1 is not null",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "tt.f1",
"temporary_table": {
@@ -726,12 +758,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 11,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "tt.f1 > 2",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
@@ -740,7 +775,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 11,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.f1 < 7 and t1.f1 > 2"
}
@@ -768,11 +805,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["f1"],
"ref": ["x.f1"],
- "rows": 2,
+ "loops": 11,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 4,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "tt.f1",
"temporary_table": {
@@ -781,12 +821,15 @@ EXPLAIN
"table": {
"table_name": "<derived5>",
"access_type": "ALL",
+ "loops": 1,
"rows": 11,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "tt.f1 > 2",
"materialized": {
"query_block": {
"select_id": 5,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
@@ -795,7 +838,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 11,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.f1 < 7 and t1.f1 > 2"
}
@@ -853,17 +898,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 11,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.f1 < 7",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
@@ -872,7 +921,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 11,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.f1 < 7"
}
@@ -930,7 +981,7 @@ join of above two
explain extended select * from v6 join v7 on f2=f1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 11 100.00 Using where
-1 PRIMARY <derived5> ref key0 key0 5 test.t2.f2 2 100.00
+1 PRIMARY <derived5> ref key0 key0 5 test.t2.f2 1 100.00
5 DERIVED t1 ALL NULL NULL NULL NULL 11 100.00 Using where; Using temporary; Using filesort
Warnings:
Note 1003 /* select#1 */ select `test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f22` AS `f22`,`v1`.`f1` AS `f1`,`v1`.`f11` AS `f11` from `test`.`t2` join `test`.`v1` where `v1`.`f1` = `test`.`t2`.`f2` and `test`.`t2`.`f2` < 7 and `test`.`t2`.`f2` in (2,3)
@@ -939,12 +990,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 11,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.f2 < 7 and t2.f2 in (2,3) and t2.f2 is not null"
}
@@ -958,11 +1012,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["f1"],
"ref": ["test.t2.f2"],
- "rows": 2,
+ "loops": 11,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 5,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.f1",
"temporary_table": {
@@ -971,7 +1028,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 11,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.f1 < 7 and t1.f1 in (2,3)"
}
@@ -994,7 +1053,7 @@ test two keys
explain select * from t1 join (select * from t2 group by f2) tt on t1.f1=tt.f2 join t1 xx on tt.f22=xx.f1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 11 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t1.f1 2
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.f1 1
1 PRIMARY xx ALL NULL NULL NULL NULL 11 Using where; Using join buffer (flat, BNL join)
2 DERIVED t2 ALL NULL NULL NULL NULL 11 Using temporary; Using filesort
select * from t1 join (select * from t2 group by f2) tt on t1.f1=tt.f2 join t1 xx on tt.f22=xx.f1;
@@ -1019,7 +1078,7 @@ EXPLAIN
SELECT * FROM v1 JOIN t2 ON v1.f1 = t2.f1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 index f1 f1 5 NULL 3 Using where; Using index
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.f1 2
+1 PRIMARY <derived2> ref key0 key0 5 test.t2.f1 1
2 DERIVED t1 ALL NULL NULL NULL NULL 4
SELECT * FROM v1 JOIN t2 ON v1.f1 = t2.f1;
f1 f1
@@ -1216,7 +1275,7 @@ SELECT * FROM t3
WHERE t3.a IN (SELECT v1.a FROM v1, t2 WHERE t2.a = v1.b);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 4 100.00 Using where
-2 DEPENDENT SUBQUERY <derived3> ref key1 key1 5 func 2 100.00
+2 DEPENDENT SUBQUERY <derived3> ref key1 key1 5 func 1 100.00
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
3 DERIVED t1 ALL NULL NULL NULL NULL 3 100.00 Using temporary; Using filesort
Warnings:
@@ -1248,9 +1307,9 @@ SELECT t.f1 AS f
FROM (SELECT DISTINCT t1.* FROM t1,t2 WHERE t2.f2 = t1.f2) t,t3,t4
WHERE t4.f2 = t3.f2 AND t4.f2 = t.f1 ORDER BY f;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 Using where; Using filesort
-1 PRIMARY t4 ref f2 f2 4 t.f1 1 Using index
-1 PRIMARY t3 ref f2 f2 4 t.f1 2 Using index
+1 PRIMARY t4 index f2 f2 9 NULL 2 Using where; Using index; Using temporary; Using filesort
+1 PRIMARY <derived2> ref key1 key1 4 test.t4.f2 1
+1 PRIMARY t3 ref f2 f2 4 test.t4.f2 1 Using index
2 DERIVED t2 system NULL NULL NULL NULL 1 Using temporary
2 DERIVED t1 ref f2 f2 4 const 2 Using where
SELECT t.f1 AS f
@@ -1276,7 +1335,7 @@ EXPLAIN
SELECT * FROM t1 AS t JOIN v1 AS v WHERE t.a = v.b AND t.b = v.b;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t ALL NULL NULL NULL NULL 3 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t.a 2
+1 PRIMARY <derived2> ref key0 key0 5 test.t.a 1
2 DERIVED t1 ALL NULL NULL NULL NULL 3
SELECT * FROM t1 AS t JOIN v1 AS v WHERE t.a = v.b AND t.b = v.b;
a b a b
@@ -1582,7 +1641,7 @@ EXPLAIN
SELECT a FROM t1 WHERE (a,b) IN (SELECT * FROM v1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
-1 PRIMARY <derived3> ref key0 key0 10 test.t1.a,test.t1.b 2 FirstMatch(t1)
+1 PRIMARY <derived3> ref key0 key0 10 test.t1.a,test.t1.b 1 FirstMatch(t1)
3 DERIVED t2 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort
SELECT * FROM v2;
a b
@@ -1602,7 +1661,7 @@ EXPLAIN
SELECT a FROM t1 WHERE (a,b) IN (SELECT * FROM v2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
-1 PRIMARY <derived3> ref key0 key0 10 test.t1.a,test.t1.b 1 FirstMatch(t1)
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 10 test.t1.a,test.t1.b 1
3 DERIVED t2 ALL NULL NULL NULL NULL 6
4 UNION t3 ALL NULL NULL NULL NULL 4
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
@@ -1881,14 +1940,14 @@ WHERE (t2.a ,t1.b) NOT IN (SELECT DISTINCT c,a FROM t3 t);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY t unique_subquery PRIMARY,c PRIMARY 4 func 1 Using where
+2 DEPENDENT SUBQUERY t index_subquery PRIMARY,c c 8 func,func 1 Using index; Using where
EXPLAIN
SELECT * FROM t1 , t2
WHERE (t2.a ,t1.b) NOT IN (SELECT DISTINCT c,a FROM (SELECT * FROM t3) t);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,c PRIMARY 4 func 1 Using where
+2 DEPENDENT SUBQUERY t3 index_subquery PRIMARY,c c 8 func,func 1 Using index; Using where
SELECT * FROM t1 , t2
WHERE (t2.a ,t1.b) NOT IN (SELECT DISTINCT c,a FROM (SELECT * FROM t3) t);
b a
@@ -1917,7 +1976,7 @@ WHERE t2.c = v1.c AND t2.c = v1.b AND v1.b = t3.c);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 system NULL NULL NULL NULL 1
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where
-1 PRIMARY <derived3> ALL NULL NULL NULL NULL 3 Using where; Start temporary; End temporary
+1 PRIMARY <derived3> ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t3)
3 DERIVED t1 ALL NULL NULL NULL NULL 3 Using where
SELECT * FROM t3
WHERE t3.b IN (SELECT v1.b FROM v1, t2
@@ -1931,8 +1990,8 @@ WHERE t3.b IN (SELECT v1.b FROM v1, t2
WHERE t2.c = v1.c AND t2.c = v1.b AND v1.b = t3.c);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 system NULL NULL NULL NULL 1
-1 PRIMARY <derived3> ref key1 key1 8 const,const 0 Start temporary
-1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where
+1 PRIMARY <derived3> ref key1 key1 8 const,const 0 FirstMatch(t3)
3 DERIVED t1 ALL NULL NULL NULL NULL 3 Using where
SELECT * FROM t3
WHERE t3.b IN (SELECT v1.b FROM v1, t2
@@ -1955,7 +2014,7 @@ EXPLAIN
SELECT * FROM t1 WHERE t1.b IN (SELECT v2.a FROM v2 WHERE v2.b = t1.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
-1 PRIMARY <derived3> ref key0 key0 10 test.t1.b,test.t1.a 2 FirstMatch(t1)
+1 PRIMARY <derived3> ref key0 key0 10 test.t1.b,test.t1.a 1 FirstMatch(t1)
3 DERIVED t2 ALL NULL NULL NULL NULL 2
SELECT * FROM t1 WHERE t1.b IN (SELECT v2.a FROM v2 WHERE v2.b = t1.a);
a b
@@ -2009,7 +2068,7 @@ EXPLAIN
SELECT v1.a FROM v1,v2 WHERE v2.b = v1.b ORDER BY 1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 Using where; Using filesort
-1 PRIMARY <derived3> ref key0 key0 4 v1.b 2
+1 PRIMARY <derived3> ref key0 key0 4 v1.b 1
3 DERIVED t2 ALL NULL NULL NULL NULL 5 Using temporary; Using filesort
2 DERIVED t1 ALL NULL NULL NULL NULL 3 Using temporary; Using filesort
DROP VIEW v1,v2;
@@ -2370,7 +2429,7 @@ GROUP BY TABLE_SCHEMA) AS UNIQUES
ON ( COLUMNS.TABLE_SCHEMA = UNIQUES.TABLE_SCHEMA);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY COLUMNS ALL NULL NULL NULL NULL NULL Open_frm_only; Scanned all databases
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY <derived2> ref key0 key0 194 information_schema.COLUMNS.TABLE_SCHEMA 10
2 DERIVED STATISTICS ALL NULL NULL NULL NULL NULL Open_frm_only; Scanned all databases; Using filesort
SELECT COUNT(*) > 0
FROM INFORMATION_SCHEMA.COLUMNS
@@ -2439,10 +2498,14 @@ CREATE TABLE t2 (a int, INDEX(a));
INSERT INTO t2 VALUES (1), (2);
INSERT INTO t1 SELECT a FROM (SELECT a FROM test.t1) AS s1 NATURAL JOIN
t2 AS s2;
+INSERT INTO t1 SELECT a FROM (SELECT a FROM test.t1) AS s1 NATURAL JOIN
+t2 AS s2;
SELECT * FROM t1;
a
1
1
+1
+1
DELETE FROM t1;
INSERT INTO t1 VALUES (1);
PREPARE stmt FROM "
@@ -2596,7 +2659,7 @@ EXPLAIN EXTENDED
SELECT v1.c1, v1.c2 FROM v1, t2 WHERE v1.c1=t2.c1 AND v1.c2=t2.c2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.c2 2 100.00 Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t2.c2 1 100.00 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 5 100.00
Warnings:
Note 1003 /* select#1 */ select `v1`.`c1` AS `c1`,`v1`.`c2` AS `c2` from `test`.`v1` join `test`.`t2` where `v1`.`c1` = `test`.`t2`.`c1` and `v1`.`c2` = `test`.`t2`.`c2`
@@ -2609,7 +2672,7 @@ SELECT t2.c1, t2.c2 FROM (SELECT c1 g, MAX(c2) m FROM t1 GROUP BY c1) t, t2
WHERE t.g=t2.c1 AND t.m=t2.c2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.c2 2 100.00 Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t2.c2 1 100.00 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 5 100.00 Using temporary; Using filesort
Warnings:
Note 1003 /* select#1 */ select `test`.`t2`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2` from (/* select#2 */ select `test`.`t1`.`c1` AS `g`,max(`test`.`t1`.`c2`) AS `m` from `test`.`t1` group by `test`.`t1`.`c1`) `t` join `test`.`t2` where `t`.`g` = `test`.`t2`.`c1` and `t`.`m` = `test`.`t2`.`c2`
@@ -2940,7 +3003,7 @@ GROUP BY mp.pla_id) d
ON d.matintnum=m2.matintnum;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY m2 ALL NULL NULL NULL NULL 9
-1 PRIMARY <derived2> ref key0 key0 7 test.m2.matintnum 2
+1 PRIMARY <derived2> ref key0 key0 7 test.m2.matintnum 1
2 DERIVED mp ALL NULL NULL NULL NULL 9 Using temporary; Using filesort
2 DERIVED m1 eq_ref PRIMARY PRIMARY 3 test.mp.mat_id 1
prepare stmt1 from
@@ -3074,8 +3137,8 @@ EXPLAIN EXTENDED
SELECT * FROM t1 LEFT JOIN v2 ON t1.id=v2.order_pk;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 100.00 Using index
-1 PRIMARY <derived2> ref key0 key0 5 test.t1.id 2 100.00
-2 DERIVED t1 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index; Using filesort
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.id 1 100.00
+2 LATERAL DERIVED t1 eq_ref PRIMARY PRIMARY 4 test.t1.id 1 100.00 Using where; Using index
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`v2`.`order_pk` AS `order_pk` from `test`.`t1` left join `test`.`v2` on(`v2`.`order_pk` = `test`.`t1`.`id`) where 1
SELECT * FROM t1 LEFT JOIN v3 ON t1.id=v3.order_pk;
@@ -3088,8 +3151,8 @@ EXPLAIN EXTENDED
SELECT * FROM t1 LEFT JOIN v3 ON t1.id=v3.order_pk;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 100.00 Using index
-1 PRIMARY <derived2> ref key0 key0 5 test.t1.id 2 100.00
-2 DERIVED t1 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index; Using filesort
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.id 1 100.00
+2 LATERAL DERIVED t1 eq_ref PRIMARY PRIMARY 4 test.t1.id 1 100.00 Using where; Using index
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`v3`.`order_pk` AS `order_pk` from `test`.`t1` left join `test`.`v3` on(`v3`.`order_pk` = `test`.`t1`.`id`) where 1
DROP VIEW v1,v2,v3;
diff --git a/mysql-test/main/derived_view.test b/mysql-test/main/derived_view.test
index 0f2c8d14..1cfc0cbf 100644
--- a/mysql-test/main/derived_view.test
+++ b/mysql-test/main/derived_view.test
@@ -124,6 +124,7 @@ show status like 'Handler_read%';
--enable_ps2_protocol
explain extended select * from v1 join v4 on f1=f2;
+--source include/explain-no-costs.inc
explain format=json select * from v1 join v4 on f1=f2;
select * from v1 join v4 on f1=f2;
@@ -148,6 +149,7 @@ select * from (select * from
--echo materialized derived in materialized derived
explain extended select * from (select * from
(select * from t1 where f1 < 7 group by f1) tt where f1 > 2 group by f1) zz;
+--source include/explain-no-costs.inc
explain format=json select * from (select * from
(select * from t1 where f1 < 7 group by f1) tt where f1 > 2 group by f1) zz;
select * from (select * from
@@ -159,6 +161,7 @@ explain extended select * from
join
(select * from (select * from t1 where f1 < 7 group by f1) tt where f1 > 2) z
on x.f1 = z.f1;
+--source include/explain-no-costs.inc
explain format=json select * from
(select * from (select * from t1 where f1 < 7 group by f1) tt where f1 > 2) x
join
@@ -202,6 +205,7 @@ join
(select * from
(select * from t1 where f1 < 7 group by f1) tt where f1 > 2 group by f1) z
on x.f1 = z.f1;
+--source include/explain-no-costs.inc
explain format=json select * from
(select * from
(select * from t1 where f1 < 7 group by f1) tt where f1 > 2 group by f1) x
@@ -226,6 +230,7 @@ select * from (select * from v4 group by 1) tt;
--echo materialized view in merged derived
explain extended
select * from ( select * from v1 where f1 < 7) tt;
+--source include/explain-no-costs.inc
explain format=json
select * from ( select * from v1 where f1 < 7) tt;
select * from ( select * from v1 where f1 < 7) tt;
@@ -242,6 +247,7 @@ select * from (select * from v7 group by 1) tt;
--echo join of above two
explain extended select * from v6 join v7 on f2=f1;
+--source include/explain-no-costs.inc
explain format=json select * from v6 join v7 on f2=f1;
select * from v6 join v7 on f2=f1;
@@ -1427,6 +1433,8 @@ INSERT INTO t2 VALUES (1), (2);
INSERT INTO t1 SELECT a FROM (SELECT a FROM test.t1) AS s1 NATURAL JOIN
t2 AS s2;
+INSERT INTO t1 SELECT a FROM (SELECT a FROM test.t1) AS s1 NATURAL JOIN
+t2 AS s2;
SELECT * FROM t1;
DELETE FROM t1;
diff --git a/mysql-test/main/desc_index_min_max.result b/mysql-test/main/desc_index_min_max.result
new file mode 100644
index 00000000..5698ddbe
--- /dev/null
+++ b/mysql-test/main/desc_index_min_max.result
@@ -0,0 +1,179 @@
+#
+# MDEV-27576 Use DESC indexes for MIN/MAX optimization
+#
+create or replace table t1 (a int, key(a desc)) engine=innodb;
+insert into t1 select seq * 2 from seq_1_to_100 order by rand(1);
+explain select max(a) from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select max(a) from t1;
+max(a)
+200
+explain select min(a) from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select min(a) from t1;
+min(a)
+2
+explain select max(a) from t1 where a < 100;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select max(a) from t1 where a < 100;
+max(a)
+98
+explain select min(a) from t1 where a > 100;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select min(a) from t1 where a > 100;
+min(a)
+102
+explain select max(a) from t1 where a <= 100;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select max(a) from t1 where a <= 100;
+max(a)
+100
+explain select min(a) from t1 where a >= 100;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select min(a) from t1 where a >= 100;
+min(a)
+100
+explain select max(a) from t1 where a <= 99;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select max(a) from t1 where a <= 99;
+max(a)
+98
+explain select min(a) from t1 where a >= 99;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select min(a) from t1 where a >= 99;
+min(a)
+100
+explain select max(a) from t1 where a > 100;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select max(a) from t1 where a > 100;
+max(a)
+200
+explain select max(a) from t1 where a > 1000;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row
+select max(a) from t1 where a > 1000;
+max(a)
+NULL
+explain select min(a) from t1 where a < 100;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select min(a) from t1 where a < 100;
+min(a)
+2
+explain select min(a) from t1 where a < 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row
+select min(a) from t1 where a < 0;
+min(a)
+NULL
+explain select max(a) from t1 where a >= 100;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select max(a) from t1 where a >= 100;
+max(a)
+200
+explain select max(a) from t1 where a >= 1000;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row
+select max(a) from t1 where a >= 1000;
+max(a)
+NULL
+explain select min(a) from t1 where a <= 100;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select min(a) from t1 where a <= 100;
+min(a)
+2
+explain select min(a) from t1 where a <= 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max row
+select min(a) from t1 where a <= 0;
+min(a)
+NULL
+explain select max(a) from t1 where a >= 99;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select max(a) from t1 where a >= 99;
+max(a)
+200
+explain select min(a) from t1 where a <= 99;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select min(a) from t1 where a <= 99;
+min(a)
+2
+explain select max(200 - a) from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 5 NULL 100 Using index
+select max(200 - a) from t1;
+max(200 - a)
+198
+explain select min(200 - a) from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 5 NULL 100 Using index
+select min(200 - a) from t1;
+min(200 - a)
+0
+create or replace table t1 (a int, b int, key(a desc, b asc)) engine=innodb;
+insert into t1 select seq * 2, seq * 2 from seq_1_to_100 order by rand(1);
+explain select max(a) from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select max(a) from t1;
+max(a)
+200
+explain select min(a) from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select min(a) from t1;
+min(a)
+2
+create or replace table t1 (a int, b int, key(a asc), key (b desc)) engine=innodb;
+insert into t1 select seq * 2, seq * 2 from seq_1_to_100 order by rand(1);
+explain select max(b) from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select max(b) from t1;
+max(b)
+200
+explain select min(b) from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select min(b) from t1;
+min(b)
+2
+create or replace table t1 (a int, b int, key (b desc)) engine=innodb;
+insert into t1 select seq * 2, seq * 2 from seq_1_to_100 order by rand(1);
+explain select max(b) from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select max(b) from t1;
+max(b)
+200
+explain select min(b) from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+select min(b) from t1;
+min(b)
+2
+CREATE OR REPLACE TABLE t1 (a FLOAT, KEY (a DESC));
+INSERT INTO t1 VALUES (0.1234),(0.6789);
+explain SELECT MAX(a) FROM t1 WHERE a <= 0.6789;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+SELECT MAX(a) FROM t1 WHERE a <= 0.6789;
+MAX(a)
+0.6789
+drop table t1;
+#
+# end of test 11.4
+#
diff --git a/mysql-test/main/desc_index_min_max.test b/mysql-test/main/desc_index_min_max.test
new file mode 100644
index 00000000..7df261cd
--- /dev/null
+++ b/mysql-test/main/desc_index_min_max.test
@@ -0,0 +1,167 @@
+--echo #
+--echo # MDEV-27576 Use DESC indexes for MIN/MAX optimization
+--echo #
+--source include/have_sequence.inc
+--source include/have_innodb.inc
+
+create or replace table t1 (a int, key(a desc)) engine=innodb;
+insert into t1 select seq * 2 from seq_1_to_100 order by rand(1);
+
+let $query=
+select max(a) from t1;
+eval explain $query;
+eval $query;
+
+let $query=
+select min(a) from t1;
+eval explain $query;
+eval $query;
+
+let $query=
+select max(a) from t1 where a < 100;
+eval explain $query;
+eval $query;
+
+let $query=
+select min(a) from t1 where a > 100;
+eval explain $query;
+eval $query;
+
+let $query=
+select max(a) from t1 where a <= 100;
+eval explain $query;
+eval $query;
+
+let $query=
+select min(a) from t1 where a >= 100;
+eval explain $query;
+eval $query;
+
+let $query=
+select max(a) from t1 where a <= 99;
+eval explain $query;
+eval $query;
+
+let $query=
+select min(a) from t1 where a >= 99;
+eval explain $query;
+eval $query;
+
+# the other side
+
+let $query=
+select max(a) from t1 where a > 100;
+eval explain $query;
+eval $query;
+
+let $query=
+select max(a) from t1 where a > 1000;
+eval explain $query;
+eval $query;
+
+let $query=
+select min(a) from t1 where a < 100;
+eval explain $query;
+eval $query;
+
+let $query=
+select min(a) from t1 where a < 0;
+eval explain $query;
+eval $query;
+
+let $query=
+select max(a) from t1 where a >= 100;
+eval explain $query;
+eval $query;
+
+let $query=
+select max(a) from t1 where a >= 1000;
+eval explain $query;
+eval $query;
+
+let $query=
+select min(a) from t1 where a <= 100;
+eval explain $query;
+eval $query;
+
+let $query=
+select min(a) from t1 where a <= 0;
+eval explain $query;
+eval $query;
+
+let $query=
+select max(a) from t1 where a >= 99;
+eval explain $query;
+eval $query;
+
+let $query=
+select min(a) from t1 where a <= 99;
+eval explain $query;
+eval $query;
+
+# double reversion
+let $query=
+select max(200 - a) from t1;
+replace_result 101 100;
+eval explain $query;
+eval $query;
+
+let $query=
+select min(200 - a) from t1;
+replace_result 101 100;
+eval explain $query;
+eval $query;
+
+# more complex key situations
+create or replace table t1 (a int, b int, key(a desc, b asc)) engine=innodb;
+insert into t1 select seq * 2, seq * 2 from seq_1_to_100 order by rand(1);
+
+let $query=
+select max(a) from t1;
+eval explain $query;
+eval $query;
+
+let $query=
+select min(a) from t1;
+eval explain $query;
+eval $query;
+
+create or replace table t1 (a int, b int, key(a asc), key (b desc)) engine=innodb;
+insert into t1 select seq * 2, seq * 2 from seq_1_to_100 order by rand(1);
+
+let $query=
+select max(b) from t1;
+eval explain $query;
+eval $query;
+
+let $query=
+select min(b) from t1;
+eval explain $query;
+eval $query;
+
+create or replace table t1 (a int, b int, key (b desc)) engine=innodb;
+insert into t1 select seq * 2, seq * 2 from seq_1_to_100 order by rand(1);
+
+let $query=
+select max(b) from t1;
+eval explain $query;
+eval $query;
+
+let $query=
+select min(b) from t1;
+eval explain $query;
+eval $query;
+
+# float example in the comment
+CREATE OR REPLACE TABLE t1 (a FLOAT, KEY (a DESC));
+INSERT INTO t1 VALUES (0.1234),(0.6789);
+let $query=
+SELECT MAX(a) FROM t1 WHERE a <= 0.6789;
+eval explain $query;
+eval $query;
+
+# Cleanup
+drop table t1;
+--echo #
+--echo # end of test 11.4
+--echo #
diff --git a/mysql-test/main/desc_index_range.result b/mysql-test/main/desc_index_range.result
index 6b1f2e31..1dc17702 100644
--- a/mysql-test/main/desc_index_range.result
+++ b/mysql-test/main/desc_index_range.result
@@ -194,7 +194,7 @@ test.t1 analyze status OK
# Must use ROR-intersect:
explain select * from t1 where b = 255 AND a IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index_merge a,b b,a 5,5 NULL 1 Using intersect(b,a); Using where; Using index
+1 SIMPLE t1 ref a,b b 5 const 2 Using where
select * from t1 where b = 255 AND a IS NULL;
pk a b
10000 NULL 255
diff --git a/mysql-test/main/disabled.def b/mysql-test/main/disabled.def
index 8ba5b271..a3890636 100644
--- a/mysql-test/main/disabled.def
+++ b/mysql-test/main/disabled.def
@@ -10,7 +10,6 @@
#
##############################################################################
tablespace : disabled in MariaDB (no TABLESPACE table attribute)
-events_time_zone : Test is not predictable as it depends on precise timing.
read_many_rows_innodb : Bug#11748886 2010-11-15 mattiasj report already exists
mysql_embedded : Bug#12561297 2011-05-14 Anitha Dependent on PB2 changes - eventum#41836
#show_explain : Psergey: random timeout in range-checked-for-each record query.
diff --git a/mysql-test/main/distinct.result b/mysql-test/main/distinct.result
index ec925383..1ed52eb8 100644
--- a/mysql-test/main/distinct.result
+++ b/mysql-test/main/distinct.result
@@ -173,9 +173,9 @@ INSERT INTO t2 values (1),(2),(3);
INSERT INTO t3 VALUES (1,'1'),(2,'2'),(1,'1'),(2,'2');
explain SELECT distinct t3.a FROM t3,t2,t1 WHERE t3.a=t1.b AND t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 index a a 4 NULL 5 Using index; Using temporary
-1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1 Using where
-1 SIMPLE t3 ref a a 5 test.t1.b 2 Using index
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 4 Using where; Using temporary
+1 SIMPLE t3 ref a a 5 test.t1.b 1 Using index
+1 SIMPLE t2 ref a a 4 test.t1.a 1 Using index; Distinct
SELECT distinct t3.a FROM t3,t2,t1 WHERE t3.a=t1.b AND t1.a=t2.a;
a
1
@@ -522,8 +522,8 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN SELECT DISTINCT t1_1.a, t1_1.b FROM t1 t1_1, t1 t1_2
WHERE t1_1.a = t1_2.a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1_1 ALL PRIMARY NULL NULL NULL 3 Using temporary
-1 SIMPLE t1_2 eq_ref PRIMARY PRIMARY 4 test.t1_1.a 1 Using index; Distinct
+1 SIMPLE t1_2 index PRIMARY PRIMARY 4 NULL 3 Using index; Using temporary
+1 SIMPLE t1_1 eq_ref PRIMARY PRIMARY 4 test.t1_2.a 1
EXPLAIN SELECT a FROM t1 GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL 3 Using index
@@ -538,10 +538,10 @@ PRIMARY KEY (a,b));
INSERT INTO t2 VALUES (1,1,1,50), (1,2,3,40), (2,1,3,4);
EXPLAIN SELECT DISTINCT a FROM t2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range NULL PRIMARY 4 NULL 4 Using index for group-by
+1 SIMPLE t2 range NULL PRIMARY 4 NULL 3 Using index for group-by
EXPLAIN SELECT DISTINCT a,a FROM t2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range NULL PRIMARY 4 NULL 4 Using index for group-by
+1 SIMPLE t2 range NULL PRIMARY 4 NULL 3 Using index for group-by
EXPLAIN SELECT DISTINCT b,a FROM t2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL PRIMARY 8 NULL 3 Using index
@@ -754,9 +754,6 @@ INSERT INTO t1(a, b, c) VALUES (1, 1, 1),
(1, 2, 1),
(1, 2, 2),
(1, 2, 3);
-EXPLAIN SELECT DISTINCT a, b, d, c FROM t1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL PRIMARY 16 NULL 7 Using index for group-by; Using temporary
SELECT DISTINCT a, b, d, c FROM t1;
a b d c
1 1 0 1
@@ -765,6 +762,13 @@ a b d c
1 2 0 1
1 2 0 2
1 2 0 3
+EXPLAIN SELECT DISTINCT a, b, d, c FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 16 NULL 6 Using index
+INSERT INTO t1 SELECT seq/10,seq/10,seq/10,seq/10,seq from seq_1_to_100;
+EXPLAIN SELECT DISTINCT a, b, d, c FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL PRIMARY 16 NULL 10 Using index for group-by; Using temporary
DROP TABLE t1;
#
# Bug #46159: simple query that never returns
@@ -1171,8 +1175,7 @@ a
explain select distinct a from t1 where t1.a=1 and t1.a in (select a+0 from t2 where t2.b in (1,2)) limit 10,10;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 Using index; Using temporary
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 10 Using where
+1 PRIMARY t2 ALL NULL NULL NULL NULL 10 Using where; FirstMatch(t1)
select distinct a from t1 where t1.a=1 and t1.a in (select a+0 from t2 where t2.b in (1,2)) limit 10,10;
a
select distinct a from t1 where t1.a=1 and t1.a in (select a+0 from t2 where t2.b in (1,2)) limit 0,1;
diff --git a/mysql-test/main/distinct.test b/mysql-test/main/distinct.test
index 06589495..fd0d4fdf 100644
--- a/mysql-test/main/distinct.test
+++ b/mysql-test/main/distinct.test
@@ -579,9 +579,10 @@ INSERT INTO t1(a, b, c) VALUES (1, 1, 1),
(1, 2, 2),
(1, 2, 3);
-EXPLAIN SELECT DISTINCT a, b, d, c FROM t1;
-
SELECT DISTINCT a, b, d, c FROM t1;
+EXPLAIN SELECT DISTINCT a, b, d, c FROM t1;
+INSERT INTO t1 SELECT seq/10,seq/10,seq/10,seq/10,seq from seq_1_to_100;
+EXPLAIN SELECT DISTINCT a, b, d, c FROM t1;
DROP TABLE t1;
diff --git a/mysql-test/main/except.result b/mysql-test/main/except.result
index 01d13f8c..40a77fcd 100644
--- a/mysql-test/main/except.result
+++ b/mysql-test/main/except.result
@@ -37,12 +37,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "REPLACED",
"filtered": 100
}
}
@@ -53,12 +56,15 @@ EXPLAIN
"query_block": {
"select_id": 2,
"operation": "EXCEPT",
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "REPLACED",
"filtered": 100
}
}
@@ -85,6 +91,7 @@ ANALYZE
{
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -92,9 +99,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -109,6 +118,7 @@ ANALYZE
"query_block": {
"select_id": 2,
"operation": "EXCEPT",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -116,9 +126,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -141,6 +153,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -148,9 +161,11 @@ ANALYZE
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 1,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
@@ -166,6 +181,7 @@ ANALYZE
{
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -173,9 +189,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -190,6 +208,7 @@ ANALYZE
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -197,9 +216,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -285,12 +306,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "REPLACED",
"filtered": 100
}
},
@@ -299,7 +323,9 @@ EXPLAIN
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 2,
"rows": 2,
+ "cost": "REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -314,12 +340,15 @@ EXPLAIN
"query_block": {
"select_id": 2,
"operation": "EXCEPT",
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "REPLACED",
"filtered": 100
}
},
@@ -328,7 +357,9 @@ EXPLAIN
"table": {
"table_name": "t4",
"access_type": "ALL",
+ "loops": 2,
"rows": 2,
+ "cost": "REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -359,6 +390,7 @@ ANALYZE
{
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -366,9 +398,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -381,9 +415,11 @@ ANALYZE
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 2,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -407,6 +443,7 @@ ANALYZE
"query_block": {
"select_id": 2,
"operation": "EXCEPT",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -414,9 +451,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -429,9 +468,11 @@ ANALYZE
"table": {
"table_name": "t4",
"access_type": "ALL",
+ "loops": 2,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -464,6 +505,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -471,9 +513,11 @@ ANALYZE
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 4,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
@@ -489,6 +533,7 @@ ANALYZE
{
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -496,9 +541,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -511,9 +558,11 @@ ANALYZE
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 2,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -537,6 +586,7 @@ ANALYZE
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -544,9 +594,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -559,9 +611,11 @@ ANALYZE
"table": {
"table_name": "t4",
"access_type": "ALL",
+ "loops": 2,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
diff --git a/mysql-test/main/except.test b/mysql-test/main/except.test
index 090826ce..d253b288 100644
--- a/mysql-test/main/except.test
+++ b/mysql-test/main/except.test
@@ -11,6 +11,7 @@ insert into t2 values (2,2),(3,3);
EXPLAIN (select a,b from t1) except (select c,d from t2);
EXPLAIN extended (select a,b from t1) except (select c,d from t2);
EXPLAIN extended select * from ((select a,b from t1) except (select c,d from t2)) a;
+--source include/analyze-format.inc
EXPLAIN format=json (select a,b from t1) except (select c,d from t2);
--source include/analyze-format.inc
@@ -43,6 +44,7 @@ insert into t4 values (4,4),(7,7);
EXPLAIN (select a,b,e,f from t1,t3) except (select c,d,g,h from t2,t4);
EXPLAIN (select a,b,e,f from t1,t3) except (select c,d,g,h from t2,t4);
EXPLAIN extended select * from ((select a,b,e,f from t1,t3) except (select c,d,g,h from t2,t4)) a;
+--source include/analyze-format.inc
EXPLAIN format=json (select a,b,e,f from t1,t3) except (select c,d,g,h from t2,t4);
--source include/analyze-format.inc
diff --git a/mysql-test/main/except_all.result b/mysql-test/main/except_all.result
index 26d28088..5806a491 100644
--- a/mysql-test/main/except_all.result
+++ b/mysql-test/main/except_all.result
@@ -65,12 +65,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -81,12 +84,15 @@ EXPLAIN
"query_block": {
"select_id": 2,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -120,6 +126,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -127,9 +134,11 @@ ANALYZE
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 7,
"r_rows": 4,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
@@ -145,6 +154,7 @@ ANALYZE
{
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -152,9 +162,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 7,
"r_rows": 7,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -169,6 +181,7 @@ ANALYZE
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -176,9 +189,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 7,
"r_rows": 7,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -206,6 +221,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -213,9 +229,11 @@ ANALYZE
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 7,
"r_rows": 4,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
@@ -231,6 +249,7 @@ ANALYZE
{
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -238,9 +257,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 7,
"r_rows": 7,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -255,6 +276,7 @@ ANALYZE
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -262,9 +284,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 7,
"r_rows": 7,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -391,12 +415,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
@@ -407,12 +434,15 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -421,7 +451,9 @@ EXPLAIN
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 3,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -436,12 +468,15 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -450,7 +485,9 @@ EXPLAIN
"table": {
"table_name": "t4",
"access_type": "ALL",
+ "loops": 2,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -486,6 +523,7 @@ ANALYZE
{
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -493,9 +531,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -508,9 +548,11 @@ ANALYZE
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 3,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -534,6 +576,7 @@ ANALYZE
"query_block": {
"select_id": 2,
"operation": "EXCEPT",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -541,9 +584,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -556,9 +601,11 @@ ANALYZE
"table": {
"table_name": "t4",
"access_type": "ALL",
+ "loops": 2,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -590,6 +637,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -597,9 +645,11 @@ ANALYZE
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 9,
"r_rows": 7,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
@@ -615,6 +665,7 @@ ANALYZE
{
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -622,9 +673,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -637,9 +690,11 @@ ANALYZE
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 3,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -663,6 +718,7 @@ ANALYZE
"query_block": {
"select_id": 3,
"operation": "EXCEPT",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -670,9 +726,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -685,9 +743,11 @@ ANALYZE
"table": {
"table_name": "t4",
"access_type": "ALL",
+ "loops": 2,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
diff --git a/mysql-test/main/except_all.test b/mysql-test/main/except_all.test
index f873b220..9f788f52 100644
--- a/mysql-test/main/except_all.test
+++ b/mysql-test/main/except_all.test
@@ -16,6 +16,7 @@ select * from t1 except all select * from t1 union all select * from t1 union al
select * from (select * from t1 except all select * from t2) q1 except all select * from (select * from t1 except all select * from t2) q2;
EXPLAIN select * from t1 except all select * from t2;
+--source include/explain-no-costs.inc
EXPLAIN format=json select * from t1 except all select * from t2;
EXPLAIN extended (select * from t1) except all (select * from t2);
EXPLAIN extended select * from ((select * from t1) except all (select * from t2)) a;
@@ -53,6 +54,7 @@ select * from ((select a,b,e,f from t1,t3) except all (select c,d,g,h from t2,t4
EXPLAIN (select a,b,e,f from t1,t3) except all (select c,d,g,h from t2,t4);
EXPLAIN select * from ((select a,b,e,f from t1,t3) except all (select c,d,g,h from t2,t4)) t;
EXPLAIN extended select * from ((select a,b,e,f from t1,t3) except all (select c,d,g,h from t2,t4)) t;
+--source include/explain-no-costs.inc
EXPLAIN format=json select * from ((select a,b,e,f from t1,t3) except all (select c,d,g,h from t2,t4)) t;
--source include/analyze-format.inc
@@ -96,4 +98,4 @@ INSERT INTO t VALUES (1),(2);
SELECT * FROM t WHERE i != ANY ( SELECT 3 EXCEPT ALL SELECT 3 );
-drop table t; \ No newline at end of file
+drop table t;
diff --git a/mysql-test/main/explain.result b/mysql-test/main/explain.result
index 75d46110..6e2dc0a5 100644
--- a/mysql-test/main/explain.result
+++ b/mysql-test/main/explain.result
@@ -325,7 +325,7 @@ DROP TABLE t1;
# Bug#56814 Explain + subselect + fulltext crashes server
#
CREATE TABLE t1(f1 VARCHAR(6) NOT NULL,
-FULLTEXT KEY(f1),UNIQUE(f1));
+FULLTEXT KEY `fulltext` (f1), UNIQUE `unique` (f1));
INSERT INTO t1 VALUES ('test');
EXPLAIN SELECT 1 FROM t1
WHERE 1 > ALL((SELECT t1.f1 FROM t1 JOIN t1 a ON (MATCH(t1.f1) AGAINST (""))
@@ -333,7 +333,7 @@ WHERE t1.f1 GROUP BY t1.f1));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
2 SUBQUERY a system NULL NULL NULL NULL 1
-2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where
+2 SUBQUERY t1 fulltext unique,fulltext fulltext 0 1 Using where
PREPARE stmt FROM
'EXPLAIN SELECT 1 FROM t1
WHERE 1 > ALL((SELECT t1.f1 FROM t1 RIGHT OUTER JOIN t1 a
@@ -343,12 +343,12 @@ EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
2 SUBQUERY a system NULL NULL NULL NULL 1
-2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where
+2 SUBQUERY t1 fulltext unique,fulltext fulltext 0 1 Using where
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
2 SUBQUERY a system NULL NULL NULL NULL 1
-2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where
+2 SUBQUERY t1 fulltext unique,fulltext fulltext 0 1 Using where
DEALLOCATE PREPARE stmt;
PREPARE stmt FROM
'EXPLAIN SELECT 1 FROM t1
@@ -359,12 +359,13 @@ EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
2 SUBQUERY a system NULL NULL NULL NULL 1
-2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where
+2 SUBQUERY t1 fulltext unique,fulltext fulltext 0 1 Using where
+INSERT into t1 values('test1'),('test2'),('test3'),('test4'),('test5');
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 system NULL NULL NULL NULL 1
-2 SUBQUERY a system NULL NULL NULL NULL 1
-2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where
+1 PRIMARY t1 index NULL unique 8 NULL 6 Using index
+2 SUBQUERY t1 fulltext unique,fulltext fulltext 0 1 Using where
+2 SUBQUERY a index NULL unique 8 NULL 6 Using index
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
End of 5.1 tests.
diff --git a/mysql-test/main/explain.test b/mysql-test/main/explain.test
index 5269fccf..4bcdb54e 100644
--- a/mysql-test/main/explain.test
+++ b/mysql-test/main/explain.test
@@ -254,7 +254,7 @@ DROP TABLE t1;
--echo #
CREATE TABLE t1(f1 VARCHAR(6) NOT NULL,
-FULLTEXT KEY(f1),UNIQUE(f1));
+FULLTEXT KEY `fulltext` (f1), UNIQUE `unique` (f1));
INSERT INTO t1 VALUES ('test');
EXPLAIN SELECT 1 FROM t1
@@ -279,6 +279,7 @@ PREPARE stmt FROM
WHERE t1.f1 GROUP BY t1.f1))';
EXECUTE stmt;
+INSERT into t1 values('test1'),('test2'),('test3'),('test4'),('test5');
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
diff --git a/mysql-test/main/explain_innodb.result b/mysql-test/main/explain_innodb.result
index ffd62c66..de5a986d 100644
--- a/mysql-test/main/explain_innodb.result
+++ b/mysql-test/main/explain_innodb.result
@@ -15,7 +15,7 @@ explain
SELECT * FROM (SELECT id FROM t1 GROUP BY id) dt WHERE 1=0;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
-2 DERIVED t1 range NULL id 53 NULL 2 Using index for group-by
+2 DERIVED t1 range NULL id 53 NULL 1 Using index for group-by
SET GLOBAL slow_query_log = @sql_tmp;
drop table t1;
#
diff --git a/mysql-test/main/explain_json.result b/mysql-test/main/explain_json.result
index 8eb7e5d5..cd55f7dd 100644
--- a/mysql-test/main/explain_json.result
+++ b/mysql-test/main/explain_json.result
@@ -6,12 +6,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -33,12 +36,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t0.a < 3"
}
@@ -59,12 +65,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t0.a is not null"
}
@@ -78,7 +87,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t0.a"],
+ "loops": 10,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -93,6 +104,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -102,7 +114,9 @@ EXPLAIN
"key": "a1",
"key_length": "5",
"used_key_parts": ["a1"],
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t2.a1 < 5"
}
@@ -115,6 +129,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -138,7 +153,9 @@ EXPLAIN
}
]
},
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a1 = 1 or t2.b1 = 2"
}
@@ -151,6 +168,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -174,7 +192,9 @@ EXPLAIN
}
]
},
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a1 = 1 or t2.b1 = 2 and t2.b2 = 3"
}
@@ -188,6 +208,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -211,7 +232,9 @@ EXPLAIN
}
]
},
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a1 = 1 and t2.a2 = 1 or t2.b1 = 2 and t2.b2 = 1"
}
@@ -225,12 +248,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t0.a is not null"
}
@@ -244,7 +270,9 @@ EXPLAIN
"key_length": "10",
"used_key_parts": ["b1", "b2"],
"ref": ["test.t0.a", "const"],
+ "loops": 10,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -266,12 +294,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "A",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -282,12 +313,15 @@ EXPLAIN
"query_block": {
"select_id": 2,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "B",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -307,12 +341,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "A",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -323,12 +360,15 @@ EXPLAIN
"query_block": {
"select_id": 2,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "B",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -349,12 +389,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -365,12 +408,15 @@ EXPLAIN
"state": "uninitialized",
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = t0.a"
}
@@ -389,12 +435,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t0.a > (subquery#2) or t0.a < 3"
}
@@ -406,12 +455,15 @@ EXPLAIN
"state": "uninitialized",
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = t0.a"
}
@@ -435,12 +487,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "tbl1",
"access_type": "ALL",
+ "loops": 1,
"rows": 100,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "tbl1.b < 3"
}
@@ -450,7 +505,9 @@ EXPLAIN
"table": {
"table_name": "tbl2",
"access_type": "ALL",
+ "loops": 100,
"rows": 100,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "tbl2.b < 5"
},
@@ -538,12 +595,15 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -566,17 +626,21 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "tbl.cnt > 0",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "cnt > 0",
"filesort": {
"sort_key": "t1.a",
@@ -586,7 +650,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -607,12 +673,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "tbl2",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "tbl2.a is not null"
}
@@ -626,12 +695,15 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["cnt"],
"ref": ["test.tbl2.a"],
- "rows": 2,
+ "loops": 10,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "tbl1.cnt = tbl2.a",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -640,7 +712,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -663,12 +737,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a is not null"
}
@@ -682,19 +759,24 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["max(a)"],
"ref": ["test.t1.a"],
+ "loops": 10,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -713,18 +795,20 @@ EXPLAIN
create table t2 like t1;
insert into t2 select * from t1;
explain format=json
-select * from t1,t2 where t1.a in ( select a from t0);
+select * from t1,t2 where t1.a in ( select seq+0 from seq_1_to_100);
EXPLAIN
{
"query_block": {
"select_id": 1,
- "const_condition": "1",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -734,11 +818,12 @@ EXPLAIN
"access_type": "eq_ref",
"possible_keys": ["distinct_key"],
"key": "distinct_key",
- "key_length": "4",
- "used_key_parts": ["a"],
+ "key_length": "8",
+ "used_key_parts": ["seq+0"],
"ref": ["func"],
"rows": 1,
"filtered": 100,
+ "attached_condition": "t1.a = seq_1_to_100.seq + 0",
"materialized": {
"unique": 1,
"query_block": {
@@ -746,10 +831,16 @@ EXPLAIN
"nested_loop": [
{
"table": {
- "table_name": "t0",
- "access_type": "ALL",
- "rows": 10,
- "filtered": 100
+ "table_name": "seq_1_to_100",
+ "access_type": "index",
+ "key": "PRIMARY",
+ "key_length": "8",
+ "used_key_parts": ["seq"],
+ "loops": 1,
+ "rows": 100,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "using_index": true
}
}
]
@@ -762,11 +853,13 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 10,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
- "buffer_size": "1Kb",
+ "buffer_size": "19Kb",
"join_type": "BNL"
}
}
@@ -787,12 +880,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -801,8 +897,10 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 10,
"rows": 10,
- "filtered": 100,
+ "cost": "COST_REPLACED",
+ "filtered": 10,
"first_match": "t2"
},
"buffer_type": "flat",
@@ -830,12 +928,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -846,8 +947,10 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 10,
"rows": 10,
- "filtered": 100
+ "cost": "COST_REPLACED",
+ "filtered": 10
},
"buffer_type": "flat",
"buffer_size": "206",
@@ -874,6 +977,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -883,7 +987,9 @@ EXPLAIN
"key": "a",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t1.a < 3",
"mrr_type": "Rowid-ordered scan"
@@ -900,12 +1006,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "tbl1",
"access_type": "ALL",
+ "loops": 1,
"rows": 100,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -916,7 +1025,9 @@ EXPLAIN
"table_name": "tbl2",
"access_type": "ALL",
"possible_keys": ["a"],
+ "loops": 100,
"rows": 100,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -930,14 +1041,15 @@ drop table t0;
# MDEV-7265: "Full scan on NULL key", the join case
#
CREATE TABLE t1 (a INT, KEY(a));
-INSERT INTO t1 VALUES (1),(2);
+INSERT INTO t1 VALUES (1),(2),(5),(6),(7);
CREATE TABLE t2 (b INT);
-INSERT INTO t2 VALUES (3),(4);
+INSERT INTO t2 VALUES (3),(4),(9),(10),(11);
EXPLAIN FORMAT=JSON SELECT * FROM t1 AS outer_t1 WHERE a <> ALL ( SELECT a FROM t1, t2 WHERE b <> outer_t1.a );
EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -946,7 +1058,9 @@ EXPLAIN
"key": "a",
"key_length": "5",
"used_key_parts": ["a"],
- "rows": 2,
+ "loops": 1,
+ "rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "!<in_optimizer>(outer_t1.a,<exists>(subquery#2))",
"using_index": true
@@ -957,6 +1071,7 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "trigcond(t1.a is null)",
"nested_loop": [
{
@@ -969,7 +1084,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["func"],
- "rows": 2,
+ "loops": 1,
+ "rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "trigcond(<cache>(outer_t1.a) = t1.a or t1.a is null)",
"using_index": true
@@ -981,7 +1098,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
- "rows": 2,
+ "loops": 3,
+ "rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -1013,13 +1132,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"const_condition": "<not>(<in_optimizer>(20000,<max>(subquery#2) >= 20000))",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1028,12 +1150,15 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "tbl1",
"access_type": "ALL",
+ "loops": 1,
"rows": 100,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -1042,7 +1167,9 @@ EXPLAIN
"table": {
"table_name": "tbl2",
"access_type": "ALL",
+ "loops": 100,
"rows": 100,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -1071,14 +1198,17 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
- "attached_condition": "!<in_optimizer>(t1.a,t1.a in (subquery#2))"
+ "attached_condition": "!<in_optimizer>(t1.a,<exists>(subquery#2))"
}
}
],
@@ -1086,13 +1216,18 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
+ "having_condition": "trigcond(t2.b is null)",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
- "filtered": 100
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "attached_condition": "trigcond(<cache>(t1.a) = t2.b or t2.b is null)"
}
}
]
@@ -1129,6 +1264,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -1137,7 +1273,9 @@ EXPLAIN
"key": "a",
"key_length": "10",
"used_key_parts": ["a", "b"],
+ "loops": 1,
"rows": 101,
+ "cost": "COST_REPLACED",
"filtered": 100,
"using_index_for_group_by": true
}
@@ -1153,6 +1291,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -1163,9 +1302,11 @@ ANALYZE
"key": "a",
"key_length": "10",
"used_key_parts": ["a", "b"],
+ "loops": 1,
"r_loops": 1,
"rows": 101,
"r_rows": 100,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1224,26 +1365,35 @@ analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status Table is already up to date
+select count(*) from t1;
+count(*)
+128
explain select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using where; Using index for group-by
+1 SIMPLE t1 range NULL idx_t1_2 147 NULL 17 Using where; Using index for group-by
explain select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL idx_t1_1 163 NULL 65 Using where; Using index for group-by
+1 SIMPLE t1 index NULL idx_t1_1 163 NULL 128 Using where; Using index
+explain select count(distinct a1,a2,b) from t1 where a1 >= "" and (a2 >= 'b') and (b = 'a');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 147 NULL 17 Using where; Using index for group-by
explain format=json select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a');
EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "range",
- "key": "idx_t1_1",
+ "key": "idx_t1_2",
"key_length": "147",
"used_key_parts": ["a1", "a2", "b"],
+ "loops": 1,
"rows": 17,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = 'a' and t1.a2 >= 'b'",
"using_index_for_group_by": true
@@ -1257,17 +1407,46 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
- "access_type": "range",
+ "access_type": "index",
"key": "idx_t1_1",
"key_length": "163",
"used_key_parts": ["a1", "a2", "b", "c"],
- "rows": 65,
- "filtered": 100,
+ "loops": 1,
+ "rows": 128,
+ "cost": "COST_REPLACED",
+ "filtered": 0.198364258,
"attached_condition": "t1.b = 'a' and t1.c = 'i121' and t1.a2 >= 'b'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+explain format=json select count(distinct a1,a2,b) from t1 where a1 >= "" and (a2 >= 'b') and (b = 'a');
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": "COST_REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "range",
+ "possible_keys": ["idx_t1_0", "idx_t1_1", "idx_t1_2"],
+ "key": "idx_t1_2",
+ "key_length": "147",
+ "used_key_parts": ["a1", "a2", "b"],
+ "loops": 1,
+ "rows": 17,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "attached_condition": "t1.b = 'a' and t1.a1 >= '' and t1.a2 >= 'b'",
"using_index_for_group_by": true
}
}
@@ -1285,12 +1464,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = _latin1'\xDF'"
}
@@ -1309,12 +1491,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(case when convert(t1.a using utf8mb3) = <cache>(_utf8mb3'a' collate utf8mb3_bin) then NULL else t1.a end)"
}
@@ -1342,6 +1527,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "TOP > t2.a",
"filesort": {
"sort_key": "t2.a",
@@ -1351,7 +1537,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 256,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1366,6 +1554,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t2.a",
"temporary_table": {
@@ -1374,7 +1563,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 256,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1400,6 +1591,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t2.a",
"temporary_table": {
@@ -1408,7 +1600,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 256,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1469,7 +1663,7 @@ insert into t2 values (1),(2);
explain
select * from t1 left join t2 on t2.pk > 10 and t2.pk < 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 const PRIMARY NULL NULL NULL 1 Impossible ON condition
+1 SIMPLE t2 const PRIMARY NULL NULL NULL 0 Impossible ON condition
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
explain format=json
select * from t1 left join t2 on t2.pk > 10 and t2.pk < 0;
@@ -1477,6 +1671,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"const_condition": "1",
"nested_loop": [
{
@@ -1484,8 +1679,8 @@ EXPLAIN
"table_name": "t2",
"access_type": "const",
"possible_keys": ["PRIMARY"],
- "rows": 1,
- "filtered": 100,
+ "rows": 0,
+ "filtered": 0,
"impossible_on_condition": true
}
},
@@ -1493,7 +1688,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1509,6 +1706,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"const_condition": "1",
@@ -1519,10 +1717,10 @@ ANALYZE
"access_type": "const",
"possible_keys": ["PRIMARY"],
"r_loops": 0,
- "rows": 1,
+ "rows": 0,
"r_rows": null,
"r_engine_stats": REPLACED,
- "filtered": 100,
+ "filtered": 0,
"r_filtered": null,
"impossible_on_condition": true
}
@@ -1531,9 +1729,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1556,12 +1756,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -1574,7 +1777,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["pk"],
"ref": ["test.t1.a"],
+ "loops": 2,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "trigcond(t2.pk is null) and trigcond(trigcond(t1.a is not null))",
"using_index": true,
@@ -1593,6 +1798,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -1600,9 +1806,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1619,9 +1827,11 @@ ANALYZE
"key_length": "4",
"used_key_parts": ["pk"],
"ref": ["test.t1.a"],
+ "loops": 2,
"r_loops": 2,
"rows": 1,
"r_rows": 1,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1647,13 +1857,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a is not null"
}
@@ -1667,7 +1880,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["pk"],
"ref": ["test.t1.a"],
+ "loops": 2,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"using_index": true,
"distinct": true
@@ -1686,6 +1901,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"temporary_table": {
@@ -1694,9 +1910,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1714,9 +1932,11 @@ ANALYZE
"key_length": "4",
"used_key_parts": ["pk"],
"ref": ["test.t1.a"],
+ "loops": 2,
"r_loops": 2,
"rows": 1,
"r_rows": 1,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1755,12 +1975,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.a is not null"
}
@@ -1775,7 +1998,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t3.a"],
+ "loops": 10,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition_bka": "t4.b + 1 <= t3.b + 1"
},
@@ -1797,6 +2022,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -1804,9 +2030,11 @@ ANALYZE
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1825,9 +2053,11 @@ ANALYZE
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t3.a"],
+ "loops": 10,
"r_loops": 1,
"rows": 1,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1865,12 +2095,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1881,13 +2114,16 @@ EXPLAIN
"state": "uninitialized",
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"outer_ref_condition": "t0.a < 5",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b < t0.a"
}
@@ -1910,6 +2146,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"read_sorted_file": {
@@ -1918,7 +2155,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1932,6 +2171,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"read_sorted_file": {
@@ -1940,7 +2180,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1954,6 +2196,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"read_sorted_file": {
@@ -1962,7 +2205,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1984,12 +2229,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -2000,7 +2248,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 2,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -2014,8 +2264,10 @@ EXPLAIN
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 4,
"rows": 2,
- "filtered": 100
+ "cost": "COST_REPLACED",
+ "filtered": 25
},
"buffer_type": "incremental",
"buffer_size": "109",
diff --git a/mysql-test/main/explain_json.test b/mysql-test/main/explain_json.test
index 17e2da47..6403fdef 100644
--- a/mysql-test/main/explain_json.test
+++ b/mysql-test/main/explain_json.test
@@ -2,6 +2,7 @@
# EXPLAIN FORMAT=JSON tests. These are tests developed for MariaDB.
#
--source include/default_optimizer_switch.inc
+--source include/have_sequence.inc
--disable_warnings
drop table if exists t0,t1,t2;
@@ -10,10 +11,13 @@ drop table if exists t0,t1,t2;
create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--source include/explain-no-costs.inc
explain format=json select * from t0;
+--source include/explain-no-costs.inc
explain format=json select * from t0 where 1>2;
+--source include/explain-no-costs.inc
explain format=json select * from t0 where a<3;
--echo # Try a basic join
@@ -25,22 +29,28 @@ select
'filler'
from t0 a, t0 b, t0 c;
+--source include/explain-no-costs.inc
explain format=json select * from t0,t1 where t1.a=t0.a;
--echo # Try range and index_merge
create table t2 (a1 int, a2 int, b1 int, b2 int, key(a1,a2), key(b1,b2));
insert into t2 select a,a,a,a from t1;
+--source include/explain-no-costs.inc
explain format=json select * from t2 where a1<5;
+--source include/explain-no-costs.inc
explain format=json select * from t2 where a1=1 or b1=2;
+--source include/explain-no-costs.inc
explain format=json select * from t2 where a1=1 or (b1=2 and b2=3);
+--source include/explain-no-costs.inc
explain format=json select * from t2 where (a1=1 and a2=1) or
(b1=2 and b2=1);
--echo # Try ref access on two key components
+--source include/explain-no-costs.inc
explain format=json select * from t0,t2 where t2.b1=t0.a and t2.b2=4;
drop table t1,t2;
@@ -48,7 +58,9 @@ drop table t1,t2;
--echo #
--echo # Try a UNION
--echo #
+--source include/explain-no-costs.inc
explain format=json select * from t0 A union select * from t0 B;
+--source include/explain-no-costs.inc
explain format=json select * from t0 A union all select * from t0 B;
--echo #
@@ -56,8 +68,10 @@ explain format=json select * from t0 A union all select * from t0 B;
--echo #
create table t1 (a int, b int);
insert into t1 select a,a from t0;
+--source include/explain-no-costs.inc
explain format=json select a, a > (select max(b) from t1 where t1.b=t0.a) from t0;
+--source include/explain-no-costs.inc
explain format=json
select * from t0 where
a > (select max(b) from t1 where t1.b=t0.a) or a < 3 ;
@@ -70,6 +84,7 @@ drop table t1;
create table t1 (a int, b int);
insert into t1 select tbl1.a+10*tbl2.a, tbl1.a+10*tbl2.a from t0 tbl1, t0 tbl2;
+--source include/explain-no-costs.inc
explain format=json
select * from t1 tbl1, t1 tbl2 where tbl1.a=tbl2.a and tbl1.b < 3 and tbl2.b < 5;
@@ -78,16 +93,22 @@ drop table t1;
--echo #
--echo # Single-table UPDATE/DELETE, INSERT
--echo #
+--source include/explain-no-costs.inc
explain format=json delete from t0;
+--source include/explain-no-costs.inc
explain format=json delete from t0 where 1 > 2;
+--source include/explain-no-costs.inc
explain format=json delete from t0 where a < 3;
+--source include/explain-no-costs.inc
explain format=json update t0 set a=3 where a in (2,3,4);
+--source include/explain-no-costs.inc
explain format=json insert into t0 values (1);
create table t1 like t0;
+--source include/explain-no-costs.inc
explain format=json insert into t1 values ((select max(a) from t0));
drop table t1;
@@ -97,10 +118,12 @@ drop table t1;
--echo #
create table t1 (a int, b int);
insert into t1 select a,a from t0;
+--source include/explain-no-costs.inc
explain format=json
select * from (select a, count(*) as cnt from t1 group by a) as tbl
where cnt>0;
+--source include/explain-no-costs.inc
explain format=json
select * from (select a, count(*) as cnt from t1 group by a) as tbl1, t1 as
tbl2 where cnt=tbl2.a;
@@ -108,6 +131,7 @@ tbl2 where cnt=tbl2.a;
--echo #
--echo # Non-merged semi-join (aka JTBM)
--echo #
+--source include/explain-no-costs.inc
explain format=json
select * from t1 where a in (select max(a) from t1 group by b);
@@ -116,14 +140,16 @@ select * from t1 where a in (select max(a) from t1 group by b);
--echo #
create table t2 like t1;
insert into t2 select * from t1;
+--source include/explain-no-costs.inc
explain format=json
-select * from t1,t2 where t1.a in ( select a from t0);
+select * from t1,t2 where t1.a in ( select seq+0 from seq_1_to_100);
--echo #
--echo # First-Match
--echo #
explain
select * from t2 where t2.a in ( select a from t1 where t1.b=t2.b);
+--source include/explain-no-costs.inc
explain format=json
select * from t2 where t2.a in ( select a from t1 where t1.b=t2.b);
@@ -134,6 +160,7 @@ set @tmp= @@optimizer_switch;
set optimizer_switch='firstmatch=off';
explain
select * from t2 where t2.a in ( select a from t1 where t1.b=t2.b);
+--source include/explain-no-costs.inc
explain format=json
select * from t2 where t2.a in ( select a from t1 where t1.b=t2.b);
set optimizer_switch=@tmp;
@@ -148,10 +175,12 @@ insert into t1 select tbl1.a+10*tbl2.a, 12345 from t0 tbl1, t0 tbl2;
set @tmp= @@optimizer_switch;
set optimizer_switch='mrr=on,mrr_sort_keys=on';
+--source include/explain-no-costs.inc
explain format=json select * from t1 where a < 3;
--echo # 'Range checked for each record'
set optimizer_switch=@tmp;
+--source include/explain-no-costs.inc
explain format=json
select * from t1 tbl1, t1 tbl2 where tbl2.a < tbl1.b;
@@ -163,11 +192,12 @@ drop table t0;
--echo #
CREATE TABLE t1 (a INT, KEY(a));
-INSERT INTO t1 VALUES (1),(2);
+INSERT INTO t1 VALUES (1),(2),(5),(6),(7);
CREATE TABLE t2 (b INT);
-INSERT INTO t2 VALUES (3),(4);
+INSERT INTO t2 VALUES (3),(4),(9),(10),(11);
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON SELECT * FROM t1 AS outer_t1 WHERE a <> ALL ( SELECT a FROM t1, t2 WHERE b <> outer_t1.a );
DROP TABLE t1,t2;
@@ -181,6 +211,7 @@ insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1(a int, b int);
insert into t1 select tbl1.a+10*tbl2.a, 1234 from t0 tbl1, t0 tbl2;
+--source include/explain-no-costs.inc
explain format=json
select * from t0
where
@@ -199,6 +230,7 @@ INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (3),(4);
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE a <> ALL ( SELECT b FROM t2 );
DROP TABLE t1, t2;
@@ -220,6 +252,7 @@ insert into t2 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 (a int, b int, c int, d int, key(a,b,c));
insert into t1 select A.a, B.a, C.a, D.a from t2 A, t2 B, t2 C, t2 D;
explain select count(distinct b) from t1 group by a;
+--source include/explain-no-costs.inc
explain format=json select count(distinct b) from t1 group by a;
--source include/analyze-format.inc
analyze format=json select count(distinct b) from t1 group by a;
@@ -271,13 +304,20 @@ create index idx_t1_0 on t1 (a1);
create index idx_t1_1 on t1 (a1,a2,b,c);
create index idx_t1_2 on t1 (a1,a2,b);
analyze table t1;
+select count(*) from t1;
explain select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a');
explain select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
+explain select count(distinct a1,a2,b) from t1 where a1 >= "" and (a2 >= 'b') and (b = 'a');
+--source include/explain-no-costs.inc
explain format=json select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a');
+
+--source include/explain-no-costs.inc
explain format=json select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
+--source include/explain-no-costs.inc
+explain format=json select count(distinct a1,a2,b) from t1 where a1 >= "" and (a2 >= 'b') and (b = 'a');
drop table t1;
--echo #
@@ -285,6 +325,7 @@ drop table t1;
--echo #
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
INSERT INTO t1 VALUES ('a'),('b');
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE a=_latin1 0xDF;
DROP TABLE t1;
@@ -293,6 +334,7 @@ DROP TABLE t1;
--echo #
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
INSERT INTO t1 VALUES ('a'),('A');
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE NULLIF(a,_utf8'a' COLLATE utf8_bin);
DROP TABLE t1;
@@ -310,12 +352,16 @@ create table t2 (
);
insert into t2 select A.a*1000 + B.a, A.a*1000 + B.a from t0 A, t1 B;
--echo # normal HAVING
+--source include/explain-no-costs.inc
explain format=json select a, max(b) as TOP from t2 group by a having TOP > a;
--echo # HAVING is always TRUE (not printed)
+--source include/explain-no-costs.inc
explain format=json select a, max(b) as TOP from t2 group by a having 1<>2;
--echo # HAVING is always FALSE (intercepted by message)
+--source include/explain-no-costs.inc
explain format=json select a, max(b) as TOP from t2 group by a having 1=2;
--echo # HAVING is absent
+--source include/explain-no-costs.inc
explain format=json select a, max(b) as TOP from t2 group by a;
drop table t0, t1, t2;
@@ -327,6 +373,7 @@ drop table t0, t1, t2;
create table t1 (i int) engine=myisam;
explain
select * from t1;
+--source include/explain-no-costs.inc
explain format=json
select * from t1;
--source include/analyze-format.inc
@@ -343,6 +390,7 @@ insert into t2 values (1),(2);
explain
select * from t1 left join t2 on t2.pk > 10 and t2.pk < 0;
+--source include/explain-no-costs.inc
explain format=json
select * from t1 left join t2 on t2.pk > 10 and t2.pk < 0;
--source include/analyze-format.inc
@@ -352,6 +400,7 @@ select * from t1 left join t2 on t2.pk > 10 and t2.pk < 0;
--echo # Check ET_NOT_EXISTS:
explain
select * from t1 left join t2 on t2.pk=t1.a where t2.pk is null;
+--source include/explain-no-costs.inc
explain format=json
select * from t1 left join t2 on t2.pk=t1.a where t2.pk is null;
--source include/analyze-format.inc
@@ -361,6 +410,7 @@ select * from t1 left join t2 on t2.pk=t1.a where t2.pk is null;
--echo # Check ET_DISTINCT
explain
select distinct t1.a from t1 join t2 on t2.pk=t1.a;
+--source include/explain-no-costs.inc
explain format=json
select distinct t1.a from t1 join t2 on t2.pk=t1.a;
--source include/analyze-format.inc
@@ -387,6 +437,7 @@ set optimizer_switch='mrr=on';
set join_cache_level=6;
explain
select * from t3,t4 where t3.a=t4.a and (t4.b+1 <= t3.b+1);
+--source include/explain-no-costs.inc
explain format=json
select * from t3,t4 where t3.a=t4.a and (t4.b+1 <= t3.b+1);
--source include/analyze-format.inc
@@ -405,6 +456,7 @@ insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 (a int, b int);
insert into t1 select a,a from t0;
+--source include/explain-no-costs.inc
explain format=json
select a, (select max(a) from t1 where t0.a<5 and t1.b<t0.a) from t0;
drop table t0,t1;
@@ -415,8 +467,11 @@ drop table t0,t1;
create table t1 (a int, b int);
insert into t1 values (1,2),(3,4),(2,3);
+--source include/explain-no-costs.inc
explain format=json select * from t1 order by a, b desc;
+--source include/explain-no-costs.inc
explain format=json select * from t1 order by a desc, b desc;
+--source include/explain-no-costs.inc
explain format=json select * from t1 order by a desc, b ;
drop table t1;
@@ -426,6 +481,7 @@ drop table t1;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
+--source include/explain-no-costs.inc
explain FORMAT=JSON
SELECT * FROM t1 t0
WHERE t0.a IN (SELECT t2.a FROM t1 t2 WHERE t0.a IN (SELECT t3.a FROM t1 t3));
@@ -443,4 +499,4 @@ INSERT INTO t2 VALUES
('00:13:41',8),('00:13:42',9);
SET optimizer_trace = 'enabled=on';
SELECT * FROM t1 WHERE a IN ( SELECT b FROM t2 INNER JOIN t1 ON (a = pk) );
-DROP TABLE t1, t2; \ No newline at end of file
+DROP TABLE t1, t2;
diff --git a/mysql-test/main/explain_json_format_partitions.result b/mysql-test/main/explain_json_format_partitions.result
index d33d7441..6cdac94f 100644
--- a/mysql-test/main/explain_json_format_partitions.result
+++ b/mysql-test/main/explain_json_format_partitions.result
@@ -12,13 +12,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"partitions": ["p0"],
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a in (2,3,4)"
}
@@ -34,6 +37,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -42,9 +46,11 @@ ANALYZE
"table_name": "t1",
"partitions": ["p0"],
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
diff --git a/mysql-test/main/explain_json_format_partitions.test b/mysql-test/main/explain_json_format_partitions.test
index 4c7d3f16..17972838 100644
--- a/mysql-test/main/explain_json_format_partitions.test
+++ b/mysql-test/main/explain_json_format_partitions.test
@@ -7,6 +7,7 @@ create table t1 (
) partition by key(a);
insert into t1 select a from t2;
explain partitions select * from t1 where a in (2,3,4);
+--source include/explain-no-costs.inc
explain format=json select * from t1 where a in (2,3,4);
--source include/analyze-format.inc
analyze format=json select * from t1 where a in (2,3,4);
diff --git a/mysql-test/main/explain_json_innodb.result b/mysql-test/main/explain_json_innodb.result
index 871c0d6a..d59b8aac 100644
--- a/mysql-test/main/explain_json_innodb.result
+++ b/mysql-test/main/explain_json_innodb.result
@@ -16,12 +16,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -30,12 +33,15 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "tbl_alias1",
"access_type": "ALL",
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "tbl_alias1.column_name_2 is not null and tbl_alias1.column_name_1 is not null"
}
@@ -52,10 +58,11 @@ EXPLAIN
"test.tbl_alias1.column_name_2",
"test.tbl_alias1.column_name_1"
],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
- "attached_condition": "tbl_alias2.c = tbl_alias1.column_name_2",
- "using_index": true
+ "attached_condition": "tbl_alias2.c = tbl_alias1.column_name_2"
}
}
]
diff --git a/mysql-test/main/explain_json_innodb.test b/mysql-test/main/explain_json_innodb.test
index f70df5d5..68e5ab81 100644
--- a/mysql-test/main/explain_json_innodb.test
+++ b/mysql-test/main/explain_json_innodb.test
@@ -20,6 +20,7 @@ INSERT INTO t2 VALUES (3,'United States');
CREATE TABLE t3 (b INT, c VARCHAR(3), PRIMARY KEY (c,b)) ENGINE=InnoDB;
INSERT INTO t3 VALUES (4,'USA'),(5,'CAN');
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON SELECT * FROM t1 WHERE 0 < ALL (
SELECT tbl_alias1.column_name_1 FROM t2 AS tbl_alias1, t3 AS tbl_alias2
WHERE tbl_alias2.b = tbl_alias1.column_name_1 AND tbl_alias2.c = tbl_alias1.column_name_2
diff --git a/mysql-test/main/explain_non_select.result b/mysql-test/main/explain_non_select.result
index 3101887a..ca8aa246 100644
--- a/mysql-test/main/explain_non_select.result
+++ b/mysql-test/main/explain_non_select.result
@@ -145,7 +145,7 @@ DROP TABLE t1;
create table t1 (i int);
explain partitions update t1 set i = 3;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 0
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
create table t2 (a int, b int) partition by hash(a) partitions 5;
insert into t2 values (0,0),(1,1),(2,2),(3,3),(4,4);
explain partitions update t2 set b=3 where a in (3,4);
@@ -163,7 +163,7 @@ explain extended delete from t2 where a in (3,4);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 delete from `test`.`t2` where `test`.`t2`.`a` in (3,4)
+Note 1003 delete from `test`.`t2` using dual where `test`.`t2`.`a` in (3,4)
drop table t1,t2;
#
# Check the special case where partition pruning removed all partitions
@@ -289,9 +289,9 @@ insert into t3 values (7), (5), (7), (3);
explain extended delete from t1 where a in (select pk from t2);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
-2 DEPENDENT SUBQUERY t2 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index
+1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index
Warnings:
-Note 1003 /* select#1 */ delete from `test`.`t1` where <in_optimizer>(`test`.`t1`.`a`,<exists>(<primary_index_lookup>(<cache>(`test`.`t1`.`a`) in t2 on PRIMARY)))
+Note 1003 delete from `test`.`t1` using `test`.`t2` where `test`.`t2`.`pk` = `test`.`t1`.`a`
delete from t1 where a in (select pk from t2);
select * from t1;
a
@@ -300,9 +300,9 @@ a
explain extended delete from t1 where a in (select a from t3);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
-2 DEPENDENT SUBQUERY t3 index_subquery a a 5 func 2 100.00 Using index
+1 PRIMARY t3 ref a a 5 test.t1.a 1 100.00 Using index; FirstMatch(t1)
Warnings:
-Note 1003 /* select#1 */ delete from `test`.`t1` where <in_optimizer>(`test`.`t1`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`a`) in t3 on a)))
+Note 1003 delete from `test`.`t1` using (`test`.`t3`) where `test`.`t3`.`a` = `test`.`t1`.`a`
delete from t1 where a in (select a from t3);
select * from t1;
a
diff --git a/mysql-test/main/features.result b/mysql-test/main/features.result
index 0da2e5fe..f4caba6d 100644
--- a/mysql-test/main/features.result
+++ b/mysql-test/main/features.result
@@ -11,6 +11,8 @@ Feature_dynamic_columns 0
Feature_fulltext 0
Feature_gis 0
Feature_insert_returning 0
+Feature_into_outfile 0
+Feature_into_variable 0
Feature_invisible_columns 0
Feature_json 0
Feature_locale 0
@@ -187,3 +189,23 @@ drop table t1;
show status like "feature_insert_returning";
Variable_name Value
Feature_insert_returning 1
+#
+# Feature into outfile/variables
+#
+create table t1(id1 int);
+insert into t1 values (1),(2);
+select * into outfile '../../tmp/features_outfile.1' from t1;
+select * from t1 into outfile '../../tmp/features_outfile.2';
+select id1 INTO @x from t1 where id1=1;
+select * from t1 where id1=1 into @y;
+select * from t1 where id1=@x;
+id1
+1
+select @x=@y;
+@x=@y
+1
+drop table t1;
+show status like "feature_into_%";
+Variable_name Value
+Feature_into_outfile 4
+Feature_into_variable 2
diff --git a/mysql-test/main/features.test b/mysql-test/main/features.test
index 054d8f32..c0d15109 100644
--- a/mysql-test/main/features.test
+++ b/mysql-test/main/features.test
@@ -150,3 +150,21 @@ create table t1(id1 int);
insert into t1 values (1),(2) returning *;
drop table t1;
show status like "feature_insert_returning";
+
+--echo #
+--echo # Feature into outfile/variables
+--echo #
+create table t1(id1 int);
+insert into t1 values (1),(2);
+--disable_ps2_protocol
+select * into outfile '../../tmp/features_outfile.1' from t1;
+select * from t1 into outfile '../../tmp/features_outfile.2';
+--enable_ps2_protocol
+select id1 INTO @x from t1 where id1=1;
+select * from t1 where id1=1 into @y;
+select * from t1 where id1=@x;
+select @x=@y;
+drop table t1;
+--remove_file $MYSQLTEST_VARDIR/tmp/features_outfile.1
+--remove_file $MYSQLTEST_VARDIR/tmp/features_outfile.2
+show status like "feature_into_%";
diff --git a/mysql-test/main/fetch_first.result b/mysql-test/main/fetch_first.result
index df182381..74ac8cc1 100644
--- a/mysql-test/main/fetch_first.result
+++ b/mysql-test/main/fetch_first.result
@@ -435,14 +435,61 @@ id first_name last_name score
7 Bob Trasc 9
2 John Doe 6
6 John Elton 8.1
+analyze FORMAT=JSON
select * from t1
-order by first_name, last_name
+order by first_name, last_name, score
+offset 2 rows
+fetch first 3 rows only;
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "read_sorted_file": {
+ "r_rows": 5,
+ "filesort": {
+ "sort_key": "t1.first_name, t1.last_name, t1.score",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "r_limit": 5,
+ "r_used_priority_queue": true,
+ "r_output_rows": 6,
+ "r_sort_mode": "sort_key,addon_fields",
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 8,
+ "r_rows": 8,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 100,
+ "r_filtered": 100
+ }
+ }
+ }
+ }
+ ]
+ }
+}
+select * from t1
+order by first_name, last_name, score
offset 2 rows
fetch first 3 rows only;
id first_name last_name score
2 John Doe 6
6 John Elton 8.1
-5 John Smith 7
+4 John Smith 6
select * from t1
order by first_name, last_name
offset 2 rows
@@ -454,7 +501,7 @@ id first_name last_name score
4 John Smith 6
5 John Smith 7
select * from t1
-order by first_name, last_name
+order by first_name, last_name, score
offset 3 rows
fetch first 3 rows only;
id first_name last_name score
@@ -791,6 +838,14 @@ fetch first 2 rows with ties;
first_name last_name
Alice Fowler
Bob Trasc
+explain select first_name, last_name
+from t1
+where first_name != 'John'
+group by first_name, last_name
+order by first_name
+fetch first 2 rows with ties;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range t1_name t1_name 206 NULL 3 Using where; Using index for group-by
select first_name, last_name
from t1
where first_name != 'John'
@@ -815,7 +870,7 @@ select * from temp_table
order by first_name, last_name;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 Using filesort
-2 DERIVED t1 range t1_name t1_name 103 NULL 3 Using where; Using index
+2 DERIVED t1 range t1_name t1_name 206 NULL 3 Using where; Using index for group-by
with temp_table as (
select first_name, last_name
from t1
@@ -1007,12 +1062,12 @@ id first_name last_name score
3 John Smith 6
select * from t1 order by first_name desc fetch first 3 rows with ties;
id first_name last_name score
-8 Silvia Ganush 10
-2 John Doe 6
-3 John Smith 6
-4 John Smith 6
-5 John Smith 7
-6 John Elton 8.1
+# Silvia # #
+# John # #
+# John # #
+# John # #
+# John # #
+# John # #
(select * from t1 order by 1 fetch first 3 rows with ties)
intersect
(select * from t1 order by first_name desc fetch first 3 rows with ties)
@@ -1399,7 +1454,7 @@ a b
3 zzz
EXPLAIN SELECT DISTINCT a, b FROM t1 ORDER BY a FETCH FIRST 3 ROWS WITH TIES;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary; Using filesort
+1 SIMPLE t1 index NULL a 5 NULL 3 Using temporary
SELECT DISTINCT a, b FROM t1 ORDER BY a FETCH FIRST 3 ROWS WITH TIES;
a b
2 foo
diff --git a/mysql-test/main/fetch_first.test b/mysql-test/main/fetch_first.test
index 242807f4..a6e52c06 100644
--- a/mysql-test/main/fetch_first.test
+++ b/mysql-test/main/fetch_first.test
@@ -349,8 +349,15 @@ order by first_name, last_name
offset 1 rows
fetch first 3 rows with ties;
+--source include/analyze-format.inc
+analyze FORMAT=JSON
select * from t1
-order by first_name, last_name
+order by first_name, last_name, score
+offset 2 rows
+fetch first 3 rows only;
+
+select * from t1
+order by first_name, last_name, score
offset 2 rows
fetch first 3 rows only;
@@ -360,7 +367,7 @@ offset 2 rows
fetch first 3 rows with ties;
select * from t1
-order by first_name, last_name
+order by first_name, last_name, score
offset 3 rows
fetch first 3 rows only;
@@ -614,7 +621,12 @@ where first_name != 'John'
order by first_name
fetch first 2 rows with ties;
-
+explain select first_name, last_name
+from t1
+where first_name != 'John'
+group by first_name, last_name
+order by first_name
+fetch first 2 rows with ties;
select first_name, last_name
from t1
@@ -769,6 +781,7 @@ fetch first 1 row with ties;
--echo # Test union-like operator with multiple fetch first clauses.
--echo #
select * from t1 order by 1 fetch first 3 rows with ties;
+--replace_column 1 # 3 # 4 #
select * from t1 order by first_name desc fetch first 3 rows with ties;
--sorted_result
diff --git a/mysql-test/main/filesort_debug.result b/mysql-test/main/filesort_debug.result
index 4aa40592..2d7d8151 100644
--- a/mysql-test/main/filesort_debug.result
+++ b/mysql-test/main/filesort_debug.result
@@ -1,5 +1,5 @@
call mtr.add_suppression("Sort aborted.*");
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
#
# Bug#36022 please log more information about "Sort aborted" queries
#
@@ -63,6 +63,7 @@ c27 TEXT,
c28 TEXT,
primary key (pk)
);
+insert into t1 (pk) values (1),(2),(3);
CALL mtr.add_suppression("Out of sort memory");
DELETE IGNORE FROM t1 ORDER BY c26,c7,c23,c4,c25,c5,c20,
c19,c21,c8,c1,c27,c28,c3,c9,c22,c24,c6,c2,pk LIMIT 2;
diff --git a/mysql-test/main/filesort_debug.test b/mysql-test/main/filesort_debug.test
index a8833617..8f0fba09 100644
--- a/mysql-test/main/filesort_debug.test
+++ b/mysql-test/main/filesort_debug.test
@@ -4,7 +4,7 @@
call mtr.add_suppression("Sort aborted.*");
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
--echo #
--echo # Bug#36022 please log more information about "Sort aborted" queries
@@ -86,6 +86,8 @@ CREATE TABLE t1 (
primary key (pk)
);
+insert into t1 (pk) values (1),(2),(3);
+
CALL mtr.add_suppression("Out of sort memory");
--error ER_OUT_OF_SORTMEMORY
diff --git a/mysql-test/main/flush-innodb.result b/mysql-test/main/flush-innodb.result
index 2c886e4f..5df79e4c 100644
--- a/mysql-test/main/flush-innodb.result
+++ b/mysql-test/main/flush-innodb.result
@@ -8,9 +8,6 @@ DROP TABLE t1;
# WL#6168: FLUSH TABLES ... FOR EXPORT -- parser
#
-# Requires innodb_file_per_table
-SET @old_innodb_file_per_table= @@GLOBAL.innodb_file_per_table;
-SET GLOBAL innodb_file_per_table= 1;
# new "EXPORT" keyword is a valid user variable name:
SET @export = 10;
# new "EXPORT" keyword is a valid SP parameter name:
@@ -300,6 +297,4 @@ DROP TABLE t1;
connection con1;
disconnect con1;
connection default;
-# Reset innodb_file_per_table
-SET GLOBAL innodb_file_per_table= @old_innodb_file_per_table;
# End of 5.6 tests
diff --git a/mysql-test/main/flush-innodb.test b/mysql-test/main/flush-innodb.test
index 7665ae5e..fcb06083 100644
--- a/mysql-test/main/flush-innodb.test
+++ b/mysql-test/main/flush-innodb.test
@@ -18,10 +18,6 @@ DROP TABLE t1;
--echo #
--echo
---echo # Requires innodb_file_per_table
-SET @old_innodb_file_per_table= @@GLOBAL.innodb_file_per_table;
-SET GLOBAL innodb_file_per_table= 1;
-
--echo # new "EXPORT" keyword is a valid user variable name:
SET @export = 10;
@@ -432,7 +428,4 @@ DROP TABLE t1;
--source include/wait_until_disconnected.inc
--connection default
---echo # Reset innodb_file_per_table
-SET GLOBAL innodb_file_per_table= @old_innodb_file_per_table;
-
--echo # End of 5.6 tests
diff --git a/mysql-test/main/merge-big.result b/mysql-test/main/flush_corruption.result
index bd188d7a..bd188d7a 100644
--- a/mysql-test/main/merge-big.result
+++ b/mysql-test/main/flush_corruption.result
diff --git a/mysql-test/main/merge-big.test b/mysql-test/main/flush_corruption.test
index 873161a3..424aa97d 100644
--- a/mysql-test/main/merge-big.test
+++ b/mysql-test/main/flush_corruption.test
@@ -1,5 +1,5 @@
#
-# Test of MERGE tables with multisession and many waits.
+# Test of MyISAM tables with multisession and many waits.
#
# This test takes rather long time so let us run it only in --big-test mode
--source include/big_test.inc
diff --git a/mysql-test/main/fulltext.result b/mysql-test/main/fulltext.result
index 233dd549..4c879c01 100644
--- a/mysql-test/main/fulltext.result
+++ b/mysql-test/main/fulltext.result
@@ -594,6 +594,9 @@ CREATE TABLE t2 (a int, b2 char(10), FULLTEXT KEY b2 (b2));
INSERT INTO t2 VALUES (1,'Scargill');
CREATE TABLE t3 (a int, b int);
INSERT INTO t3 VALUES (1,1), (2,1);
+SELECT * FROM t2 where MATCH(b2) AGAINST('scargill' IN BOOLEAN MODE);
+a b2
+1 Scargill
# t2 should use full text index
EXPLAIN
SELECT count(*) FROM t1 WHERE
@@ -603,8 +606,8 @@ WHERE t3.a=t1.a AND MATCH(b2) AGAINST('scargill' IN BOOLEAN MODE)
);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
-2 MATERIALIZED t2 fulltext b2 b2 0 1 Using where
-2 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 fulltext b2 b2 0 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where
# should return 0
SELECT count(*) FROM t1 WHERE
not exists(
diff --git a/mysql-test/main/fulltext.test b/mysql-test/main/fulltext.test
index 09d24190..acc016b0 100644
--- a/mysql-test/main/fulltext.test
+++ b/mysql-test/main/fulltext.test
@@ -547,6 +547,8 @@ INSERT INTO t2 VALUES (1,'Scargill');
CREATE TABLE t3 (a int, b int);
INSERT INTO t3 VALUES (1,1), (2,1);
+SELECT * FROM t2 where MATCH(b2) AGAINST('scargill' IN BOOLEAN MODE);
+
--echo # t2 should use full text index
EXPLAIN
SELECT count(*) FROM t1 WHERE
diff --git a/mysql-test/main/func_des_encrypt.result b/mysql-test/main/func_des_encrypt.result
index 9ce577a5..e24f6b32 100644
--- a/mysql-test/main/func_des_encrypt.result
+++ b/mysql-test/main/func_des_encrypt.result
@@ -2,7 +2,7 @@ select des_encrypt('hello');
des_encrypt('hello')
€Ö2nV“Ø}
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
#
# Bug #11643: des_encrypt() causes server to die
#
@@ -10,7 +10,7 @@ CREATE TABLE t1 (des VARBINARY(200) NOT NULL DEFAULT '') ENGINE=MyISAM;
INSERT INTO t1 VALUES ('1234'), ('12345'), ('123456'), ('1234567');
UPDATE t1 SET des=DES_ENCRYPT('1234');
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
SELECT LENGTH(des) FROM t1;
LENGTH(des)
9
@@ -24,7 +24,7 @@ DES_DECRYPT(des)
1234
1234
Warnings:
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
SELECT
LENGTH(DES_ENCRYPT('1234')),
LENGTH(DES_ENCRYPT('12345')),
@@ -33,10 +33,10 @@ LENGTH(DES_ENCRYPT('1234567'));
LENGTH(DES_ENCRYPT('1234')) LENGTH(DES_ENCRYPT('12345')) LENGTH(DES_ENCRYPT('123456')) LENGTH(DES_ENCRYPT('1234567'))
9 9 9 9
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
SELECT
DES_DECRYPT(DES_ENCRYPT('1234')),
DES_DECRYPT(DES_ENCRYPT('12345')),
@@ -45,14 +45,14 @@ DES_DECRYPT(DES_ENCRYPT('1234567'));
DES_DECRYPT(DES_ENCRYPT('1234')) DES_DECRYPT(DES_ENCRYPT('12345')) DES_DECRYPT(DES_ENCRYPT('123456')) DES_DECRYPT(DES_ENCRYPT('1234567'))
1234 12345 123456 1234567
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
DROP TABLE t1;
End of 5.0 tests
#
@@ -85,7 +85,7 @@ j 000000000009
j NULL
NULL NULL
Warnings:
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
DROP TABLE t1;
CREATE TABLE t1 (a INT);
INSERT t1 VALUES (1),(2);
@@ -94,19 +94,8 @@ CHAR_LENGTH(a) DES_DECRYPT(a)
1 ¢
1 ¢
Warnings:
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
DROP TABLE t1;
#
# End of 10.5 tests
#
-#
-# MDEV-27104 deprecate DES_ENCRYPT/DECRYPT functions
-#
-# just show how to disable deprecation note
-set sql_notes=0;
-select hex(des_encrypt('a'));
-hex(des_encrypt('a'))
-80E4DE4136BA6CD7F3
-#
-# End of 10.10 tests
-#
diff --git a/mysql-test/main/func_des_encrypt.test b/mysql-test/main/func_des_encrypt.test
index 884fad54..20e2196f 100644
--- a/mysql-test/main/func_des_encrypt.test
+++ b/mysql-test/main/func_des_encrypt.test
@@ -62,14 +62,3 @@ DROP TABLE t1;
--echo #
--echo # End of 10.5 tests
--echo #
-
---echo #
---echo # MDEV-27104 deprecate DES_ENCRYPT/DECRYPT functions
---echo #
---echo # just show how to disable deprecation note
-set sql_notes=0;
-select hex(des_encrypt('a'));
-
---echo #
---echo # End of 10.10 tests
---echo #
diff --git a/mysql-test/main/func_encrypt.result b/mysql-test/main/func_encrypt.result
index 4570ff31..08e86578 100644
--- a/mysql-test/main/func_encrypt.result
+++ b/mysql-test/main/func_encrypt.result
@@ -2,124 +2,124 @@ drop table if exists t1;
create table t1 (x blob);
insert into t1 values (des_encrypt('The quick red fox jumped over the lazy brown dog','The quick red fox jumped over the lazy brown dog'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('a','The quick red fox jumped over the lazy brown dog'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('The quick red fox jumped over the lazy brown dog','a'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('ab','The quick red fox jumped over the lazy brown dog'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('The quick red fox jumped over the lazy brown dog','ab'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('abc','The quick red fox jumped over the lazy brown dog'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('The quick red fox jumped over the lazy brown dog','abc'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('abcd','The quick red fox jumped over the lazy brown dog'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('The quick red fox jumped over the lazy brown dog','abcd'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('abcde','The quick red fox jumped over the lazy brown dog'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('The quick red fox jumped over the lazy brown dog','abcde'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('abcdef','The quick red fox jumped over the lazy brown dog'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('The quick red fox jumped over the lazy brown dog','abcdef'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('abcdefg','The quick red fox jumped over the lazy brown dog'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('The quick red fox jumped over the lazy brown dog','abcdefg'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('abcdefgh','The quick red fox jumped over the lazy brown dog'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('The quick red fox jumped over the lazy brown dog','abcdefgh'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('abcdefghi','The quick red fox jumped over the lazy brown dog'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('The quick red fox jumped over the lazy brown dog','abcdefghi'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('abcdefghij','The quick red fox jumped over the lazy brown dog'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('The quick red fox jumped over the lazy brown dog','abcdefghij'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('abcdefghijk','The quick red fox jumped over the lazy brown dog'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('The quick red fox jumped over the lazy brown dog','abcdefghijk'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('The quick red fox jumped over the lazy brown dog','sabakala'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('quick red fox jumped over the lazy brown dog','sabakala'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('red fox jumped over the lazy brown dog','sabakala'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('fox jumped over the lazy brown dog','sabakala'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('jumped over the lazy brown dog','sabakala'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('over the lazy brown dog','sabakala'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('the lazy brown dog','sabakala'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('lazy brown dog','sabakala'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('brown dog','sabakala'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('dog','sabakala'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('dog!','sabakala'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('dog!!','sabakala'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('dog!!!','sabakala'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('dog!!!!','sabakala'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('dog!!!!!','sabakala'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('jumped over the lazy brown dog','sabakala'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
insert into t1 values (des_encrypt('jumped over the lazy brown dog','sabakala'));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
select hex(x), hex(des_decrypt(x,'sabakala')) from t1;
hex(x) hex(des_decrypt(x,'sabakala'))
FFA185A4656D113445E31D7A5B31BB57671A4CA9E21E63FE5D9C801E0CC7AA6190C13E269C2AE8D8060D3FB3FEA94FEC7FB006B9DCAC3E3E41 NULL
@@ -163,7 +163,7 @@ FF9723312D26D9E6DA01D01A784A64DB9D 646F672121212121
FF8333F3DD21E4488F967E03DD12394813A49F72848BB49473D3CB1C8A1AACF220 6A756D706564206F76657220746865206C617A792062726F776E20646F67
FF8333F3DD21E4488F967E03DD12394813A49F72848BB49473D3CB1C8A1AACF220 6A756D706564206F76657220746865206C617A792062726F776E20646F67
Warnings:
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
select des_decrypt(x,'sabakala') as s from t1 having s like '%dog%';
s
The quick red fox jumped over the lazy brown dog
@@ -184,120 +184,120 @@ dog!!!!!
jumped over the lazy brown dog
jumped over the lazy brown dog
Warnings:
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
drop table t1;
select hex(des_encrypt("hello")),des_decrypt(des_encrypt("hello"));
hex(des_encrypt("hello")) des_decrypt(des_encrypt("hello"))
85D6DC8859F9759BBB hello
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
select des_decrypt(des_encrypt("hello",4));
des_decrypt(des_encrypt("hello",4))
hello
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
select des_decrypt(des_encrypt("hello",'test'),'test');
des_decrypt(des_encrypt("hello",'test'),'test')
hello
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
select hex(des_encrypt("hello")),hex(des_encrypt("hello",5)),hex(des_encrypt("hello",'default_password'));
hex(des_encrypt("hello")) hex(des_encrypt("hello",5)) hex(des_encrypt("hello",'default_password'))
85D6DC8859F9759BBB 85D6DC8859F9759BBB FFD6DC8859F9759BBB
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
select des_decrypt(des_encrypt("hello"),'default_password');
des_decrypt(des_encrypt("hello"),'default_password')
hello
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
select des_decrypt(des_encrypt("hello",4),'password4');
des_decrypt(des_encrypt("hello",4),'password4')
hello
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
select des_encrypt("hello",10);
des_encrypt("hello",10)
NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
Warning 1108 Incorrect parameters to procedure 'des_encrypt'
select des_encrypt(NULL);
des_encrypt(NULL)
NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
select des_encrypt(NULL, 10);
des_encrypt(NULL, 10)
NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
select des_encrypt(NULL, NULL);
des_encrypt(NULL, NULL)
NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
select des_encrypt(10, NULL);
des_encrypt(10, NULL)
NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
Warning 1108 Incorrect parameters to procedure 'des_encrypt'
select des_encrypt("hello", NULL);
des_encrypt("hello", NULL)
NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
Warning 1108 Incorrect parameters to procedure 'des_encrypt'
select des_decrypt("hello",10);
des_decrypt("hello",10)
hello
Warnings:
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
select des_decrypt(NULL);
des_decrypt(NULL)
NULL
Warnings:
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
select des_decrypt(NULL, 10);
des_decrypt(NULL, 10)
NULL
Warnings:
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
select des_decrypt(NULL, NULL);
des_decrypt(NULL, NULL)
NULL
Warnings:
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
select des_decrypt(10, NULL);
des_decrypt(10, NULL)
10
Warnings:
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
select des_decrypt("hello", NULL);
des_decrypt("hello", NULL)
hello
Warnings:
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
SET @a=des_decrypt(des_encrypt("hello"));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
flush des_key_file;
select @a = des_decrypt(des_encrypt("hello"));
@a = des_decrypt(des_encrypt("hello"))
1
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
select hex("hello");
hex("hello")
68656C6C6F
@@ -305,23 +305,23 @@ select hex(des_decrypt(des_encrypt("hello",4),'password2'));
hex(des_decrypt(des_encrypt("hello",4),'password2'))
NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
select hex(des_decrypt(des_encrypt("hello","hidden")));
hex(des_decrypt(des_encrypt("hello","hidden")))
NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
Warning 1108 Incorrect parameters to procedure 'des_decrypt'
explain extended select des_decrypt(des_encrypt("hello",4),'password2'), des_decrypt(des_encrypt("hello","hidden"));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
Note 1003 select des_decrypt(des_encrypt('hello',4),'password2') AS `des_decrypt(des_encrypt("hello",4),'password2')`,des_decrypt(des_encrypt('hello','hidden')) AS `des_decrypt(des_encrypt("hello","hidden"))`
#
# Start of 10.1 tests
@@ -336,7 +336,7 @@ SELECT * FROM t1 WHERE a=1 AND DES_ENCRYPT('test',a)=_latin1 'abc' COLLATE latin
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 1 and des_encrypt('test',`test`.`t1`.`a`) = 'abc'
DROP TABLE t1;
#
@@ -354,8 +354,8 @@ b BLOB DEFAULT DES_ENCRYPT(a, 'passwd'),
c TEXT DEFAULT DES_DECRYPT(b, 'passwd')
);
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/main/func_encrypt_nossl.result b/mysql-test/main/func_encrypt_nossl.result
index 7afc9fa6..274db05f 100644
--- a/mysql-test/main/func_encrypt_nossl.result
+++ b/mysql-test/main/func_encrypt_nossl.result
@@ -2,87 +2,87 @@ select des_encrypt("test", 'akeystr');
des_encrypt("test", 'akeystr')
NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
Warning 1289 The 'des_encrypt' feature is disabled; you need MariaDB built with 'openssl des cipher (HAVE_des)' to have it working
select des_encrypt("test", 1);
des_encrypt("test", 1)
NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
Warning 1289 The 'des_encrypt' feature is disabled; you need MariaDB built with 'openssl des cipher (HAVE_des)' to have it working
select des_encrypt("test", 9);
des_encrypt("test", 9)
NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
Warning 1289 The 'des_encrypt' feature is disabled; you need MariaDB built with 'openssl des cipher (HAVE_des)' to have it working
select des_encrypt("test", 100);
des_encrypt("test", 100)
NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
Warning 1289 The 'des_encrypt' feature is disabled; you need MariaDB built with 'openssl des cipher (HAVE_des)' to have it working
select des_encrypt("test", NULL);
des_encrypt("test", NULL)
NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
Warning 1289 The 'des_encrypt' feature is disabled; you need MariaDB built with 'openssl des cipher (HAVE_des)' to have it working
select des_encrypt(NULL, NULL);
des_encrypt(NULL, NULL)
NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
Warning 1289 The 'des_encrypt' feature is disabled; you need MariaDB built with 'openssl des cipher (HAVE_des)' to have it working
select des_decrypt("test", 'anotherkeystr');
des_decrypt("test", 'anotherkeystr')
NULL
Warnings:
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
Warning 1289 The 'des_decrypt' feature is disabled; you need MariaDB built with 'openssl des cipher (HAVE_des)' to have it working
select des_decrypt(1, 1);
des_decrypt(1, 1)
NULL
Warnings:
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
Warning 1289 The 'des_decrypt' feature is disabled; you need MariaDB built with 'openssl des cipher (HAVE_des)' to have it working
select des_decrypt(des_encrypt("test", 'thekey'));
des_decrypt(des_encrypt("test", 'thekey'))
NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
Warning 1289 The 'des_decrypt' feature is disabled; you need MariaDB built with 'openssl des cipher (HAVE_des)' to have it working
select hex(des_encrypt("hello")),des_decrypt(des_encrypt("hello"));
hex(des_encrypt("hello")) des_decrypt(des_encrypt("hello"))
NULL NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
Warning 1289 The 'des_encrypt' feature is disabled; you need MariaDB built with 'openssl des cipher (HAVE_des)' to have it working
Warning 1289 The 'des_decrypt' feature is disabled; you need MariaDB built with 'openssl des cipher (HAVE_des)' to have it working
select des_decrypt(des_encrypt("hello",4));
des_decrypt(des_encrypt("hello",4))
NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
Warning 1289 The 'des_decrypt' feature is disabled; you need MariaDB built with 'openssl des cipher (HAVE_des)' to have it working
select des_decrypt(des_encrypt("hello",'test'),'test');
des_decrypt(des_encrypt("hello",'test'),'test')
NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
Warning 1289 The 'des_decrypt' feature is disabled; you need MariaDB built with 'openssl des cipher (HAVE_des)' to have it working
select hex(des_encrypt("hello")),hex(des_encrypt("hello",5)),hex(des_encrypt("hello",'default_password'));
hex(des_encrypt("hello")) hex(des_encrypt("hello",5)) hex(des_encrypt("hello",'default_password'))
NULL NULL NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
Warning 1289 The 'des_encrypt' feature is disabled; you need MariaDB built with 'openssl des cipher (HAVE_des)' to have it working
Warning 1289 The 'des_encrypt' feature is disabled; you need MariaDB built with 'openssl des cipher (HAVE_des)' to have it working
Warning 1289 The 'des_encrypt' feature is disabled; you need MariaDB built with 'openssl des cipher (HAVE_des)' to have it working
@@ -90,28 +90,28 @@ select des_decrypt(des_encrypt("hello"),'default_password');
des_decrypt(des_encrypt("hello"),'default_password')
NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
Warning 1289 The 'des_decrypt' feature is disabled; you need MariaDB built with 'openssl des cipher (HAVE_des)' to have it working
select des_decrypt(des_encrypt("hello",4),'password4');
des_decrypt(des_encrypt("hello",4),'password4')
NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
Warning 1289 The 'des_decrypt' feature is disabled; you need MariaDB built with 'openssl des cipher (HAVE_des)' to have it working
SET @a=des_decrypt(des_encrypt("hello"));
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
Warning 1289 The 'des_decrypt' feature is disabled; you need MariaDB built with 'openssl des cipher (HAVE_des)' to have it working
flush des_key_file;
select @a = des_decrypt(des_encrypt("hello"));
@a = des_decrypt(des_encrypt("hello"))
NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
select hex("hello");
hex("hello")
68656C6C6F
@@ -119,13 +119,13 @@ select hex(des_decrypt(des_encrypt("hello",4),'password2'));
hex(des_decrypt(des_encrypt("hello",4),'password2'))
NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
Warning 1289 The 'des_decrypt' feature is disabled; you need MariaDB built with 'openssl des cipher (HAVE_des)' to have it working
select hex(des_decrypt(des_encrypt("hello","hidden")));
hex(des_decrypt(des_encrypt("hello","hidden")))
NULL
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
Warning 1289 The 'des_decrypt' feature is disabled; you need MariaDB built with 'openssl des cipher (HAVE_des)' to have it working
diff --git a/mysql-test/main/func_encrypt_ucs2.result b/mysql-test/main/func_encrypt_ucs2.result
index ab04c3b4..0aed95c3 100644
--- a/mysql-test/main/func_encrypt_ucs2.result
+++ b/mysql-test/main/func_encrypt_ucs2.result
@@ -5,21 +5,21 @@ SELECT CHAR_LENGTH(DES_ENCRYPT(0, CHAR('1' USING ucs2)));
CHAR_LENGTH(DES_ENCRYPT(0, CHAR('1' USING ucs2)))
9
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
SELECT CONVERT(DES_ENCRYPT(0, CHAR('1' USING ucs2)),UNSIGNED);
CONVERT(DES_ENCRYPT(0, CHAR('1' USING ucs2)),UNSIGNED)
0
Warnings:
-Note 1287 'des_encrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_encrypt' is deprecated and will be removed in a future release
Warning 1292 Truncated incorrect INTEGER value: '\xFFT\xDCiK\x92j\xE6\xFC'
SELECT CHAR_LENGTH(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' USING ucs2))) as a;
a
4
Warnings:
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
SELECT CONVERT(DES_DECRYPT(0xFF0DC9FC9537CA75F4, CHAR('1' using ucs2)), UNSIGNED) as a;
a
0
Warnings:
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
Warning 1292 Truncated incorrect INTEGER value: 'test'
diff --git a/mysql-test/main/func_format.result b/mysql-test/main/func_format.result
new file mode 100644
index 00000000..322f64c1
--- /dev/null
+++ b/mysql-test/main/func_format.result
@@ -0,0 +1,213 @@
+# MDEV-19629: Implement MySQL 8.0 native functions: format_bytes(), format_pico_time() and ps_thread_id()
+#
+# Tests for the Performance Schema native function format_pico_time()
+#
+
+SELECT format_pico_time(NULL);
+format_pico_time(NULL)
+NULL
+
+SELECT format_pico_time(0);
+format_pico_time(0)
+ 0 ps
+
+SELECT format_pico_time(1);
+format_pico_time(1)
+ 1 ps
+
+SELECT format_pico_time(999);
+format_pico_time(999)
+999 ps
+
+SELECT format_pico_time(1000);
+format_pico_time(1000)
+1.00 ns
+
+SELECT format_pico_time(1001);
+format_pico_time(1001)
+1.00 ns
+
+SELECT format_pico_time(999999);
+format_pico_time(999999)
+1000.00 ns
+
+SELECT format_pico_time(1000000);
+format_pico_time(1000000)
+1.00 us
+
+SELECT format_pico_time(1000001);
+format_pico_time(1000001)
+1.00 us
+
+SELECT format_pico_time(1010000);
+format_pico_time(1010000)
+1.01 us
+
+SELECT format_pico_time(987654321);
+format_pico_time(987654321)
+987.65 us
+
+SELECT format_pico_time(1000000000);
+format_pico_time(1000000000)
+1.00 ms
+
+SELECT format_pico_time(999876000000);
+format_pico_time(999876000000)
+999.88 ms
+
+SELECT format_pico_time(999999999999);
+format_pico_time(999999999999)
+1000.00 ms
+
+SELECT format_pico_time(1000000000000);
+format_pico_time(1000000000000)
+1.00 s
+
+SELECT format_pico_time(59000000000000);
+format_pico_time(59000000000000)
+59.00 s
+
+SELECT format_pico_time(60000000000000);
+format_pico_time(60000000000000)
+1.00 min
+
+SELECT format_pico_time(3549000000000000);
+format_pico_time(3549000000000000)
+59.15 min
+
+SELECT format_pico_time(3599000000000000);
+format_pico_time(3599000000000000)
+59.98 min
+
+SELECT format_pico_time(3600000000000000);
+format_pico_time(3600000000000000)
+1.00 h
+
+SELECT format_pico_time(power(2, 63));
+format_pico_time(power(2, 63))
+106.75 d
+
+SELECT format_pico_time((power(2, 63) - 1) * 2 + 1);
+format_pico_time((power(2, 63) - 1) * 2 + 1)
+213.50 d
+
+SELECT format_pico_time(36000000.495523);
+format_pico_time(36000000.495523)
+36.00 us
+
+SELECT format_pico_time(1000 * pow(10,12) * 86400);
+format_pico_time(1000 * pow(10,12) * 86400)
+1000.00 d
+
+SELECT format_pico_time(86400000000000000000);
+format_pico_time(86400000000000000000)
+1000.00 d
+
+SELECT format_pico_time(86400000000000000000+5000);
+format_pico_time(86400000000000000000+5000)
+1000.00 d
+
+## Negative values are ok
+SELECT format_pico_time(1010000 * -1);
+format_pico_time(1010000 * -1)
+-1.01 us
+
+## Force exponent
+SELECT format_pico_time(8650000000000000000099);
+format_pico_time(8650000000000000000099)
+1.00e+05 d
+
+SELECT format_pico_time(-8650000000000000000099);
+format_pico_time(-8650000000000000000099)
+-1.00e+05 d
+
+SELECT format_pico_time(8640000000000000000099 * 2);
+format_pico_time(8640000000000000000099 * 2)
+2.00e+05 d
+
+
+## Text input
+SELECT format_pico_time("foo");
+format_pico_time("foo")
+ 0 ps
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'foo'
+
+SELECT format_pico_time("");
+format_pico_time("")
+ 0 ps
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: ''
+
+SELECT format_pico_time("118059162071741143500099");
+format_pico_time("118059162071741143500099")
+1.37e+06 d
+
+SELECT format_pico_time("-118059162071741143500099");
+format_pico_time("-118059162071741143500099")
+-1.37e+06 d
+
+## Recognizes up to first non-numeric
+SELECT format_pico_time("40000 * 2000");
+format_pico_time("40000 * 2000")
+40.00 ns
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '40000 * 2000'
+
+SELECT format_pico_time("40000 foo 2000");
+format_pico_time("40000 foo 2000")
+40.00 ns
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: '40000 foo 2000'
+## Aggregate functions
+USE test;
+
+CREATE TABLE timer_waits (id VARCHAR(10), wait BIGINT UNSIGNED DEFAULT NULL) DEFAULT CHARSET = utf8mb4;
+
+INSERT INTO timer_waits VALUES ('1 sec', 1000000000000);
+INSERT INTO timer_waits VALUES ('1 min', 60000000000000);
+INSERT INTO timer_waits VALUES ('1 hour', 3600000000000000);
+INSERT INTO timer_waits VALUES ('1 day', 86400000000000000);
+INSERT INTO timer_waits VALUES ('100 days', 8640000000000000000);
+
+SELECT id, format_pico_time(wait), wait FROM timer_waits;
+id format_pico_time(wait) wait
+1 sec 1.00 s 1000000000000
+1 min 1.00 min 60000000000000
+1 hour 1.00 h 3600000000000000
+1 day 1.00 d 86400000000000000
+100 days 100.00 d 8640000000000000000
+
+SELECT sum(wait), format_pico_time(sum(wait)) FROM timer_waits;
+sum(wait) format_pico_time(sum(wait))
+8730061000000000000 101.04 d
+
+SELECT avg(wait), format_pico_time(avg(wait)) FROM timer_waits;
+avg(wait) format_pico_time(avg(wait))
+1746012200000000000.0000 20.21 d
+
+SELECT min(wait), format_pico_time(min(wait)) FROM timer_waits;
+min(wait) format_pico_time(min(wait))
+1000000000000 1.00 s
+
+SELECT max(wait), format_pico_time(max(wait)) FROM timer_waits;
+max(wait) format_pico_time(max(wait))
+8640000000000000000 100.00 d
+
+DROP TABLE timer_waits;
+## Using Scientific Notation
+SELECT format_pico_time(3e9);
+format_pico_time(3e9)
+3.00 ms
+
+SELECT format_pico_time(4e6);
+format_pico_time(4e6)
+4.00 us
+
+SELECT format_pico_time(5e3);
+format_pico_time(5e3)
+5.00 ns
+
+SELECT format_pico_time(6e2);
+format_pico_time(6e2)
+600 ps
diff --git a/mysql-test/main/func_format.test b/mysql-test/main/func_format.test
new file mode 100644
index 00000000..a175d3ed
--- /dev/null
+++ b/mysql-test/main/func_format.test
@@ -0,0 +1,120 @@
+# Testcases for PFS functions are backported from MySQL
+
+--echo # MDEV-19629: Implement MySQL 8.0 native functions: format_bytes(), format_pico_time() and ps_thread_id()
+--echo #
+--echo # Tests for the Performance Schema native function format_pico_time()
+--echo #
+--echo
+
+SELECT format_pico_time(NULL);
+--echo
+SELECT format_pico_time(0);
+--echo
+SELECT format_pico_time(1);
+--echo
+SELECT format_pico_time(999);
+--echo
+SELECT format_pico_time(1000);
+--echo
+SELECT format_pico_time(1001);
+--echo
+SELECT format_pico_time(999999);
+--echo
+SELECT format_pico_time(1000000);
+--echo
+SELECT format_pico_time(1000001);
+--echo
+SELECT format_pico_time(1010000);
+--echo
+SELECT format_pico_time(987654321);
+--echo
+SELECT format_pico_time(1000000000);
+--echo
+SELECT format_pico_time(999876000000);
+--echo
+SELECT format_pico_time(999999999999);
+--echo
+SELECT format_pico_time(1000000000000);
+--echo
+SELECT format_pico_time(59000000000000);
+--echo
+SELECT format_pico_time(60000000000000);
+--echo
+SELECT format_pico_time(3549000000000000);
+--echo
+SELECT format_pico_time(3599000000000000);
+--echo
+SELECT format_pico_time(3600000000000000);
+--echo
+SELECT format_pico_time(power(2, 63));
+--echo
+SELECT format_pico_time((power(2, 63) - 1) * 2 + 1);
+--echo
+SELECT format_pico_time(36000000.495523);
+--echo
+SELECT format_pico_time(1000 * pow(10,12) * 86400);
+--echo
+SELECT format_pico_time(86400000000000000000);
+--echo
+SELECT format_pico_time(86400000000000000000+5000);
+
+--echo
+--echo ## Negative values are ok
+SELECT format_pico_time(1010000 * -1);
+
+--echo
+--echo ## Force exponent
+SELECT format_pico_time(8650000000000000000099);
+--echo
+SELECT format_pico_time(-8650000000000000000099);
+--echo
+SELECT format_pico_time(8640000000000000000099 * 2);
+--echo
+
+--echo
+--echo ## Text input
+SELECT format_pico_time("foo");
+--echo
+SELECT format_pico_time("");
+--echo
+SELECT format_pico_time("118059162071741143500099");
+--echo
+SELECT format_pico_time("-118059162071741143500099");
+--echo
+--echo ## Recognizes up to first non-numeric
+SELECT format_pico_time("40000 * 2000");
+--echo
+SELECT format_pico_time("40000 foo 2000");
+
+--echo ## Aggregate functions
+USE test;
+--echo
+CREATE TABLE timer_waits (id VARCHAR(10), wait BIGINT UNSIGNED DEFAULT NULL) DEFAULT CHARSET = utf8mb4;
+--echo
+# Max BIGINT unsigned is 18 446 744 073 709 551 615
+INSERT INTO timer_waits VALUES ('1 sec', 1000000000000);
+INSERT INTO timer_waits VALUES ('1 min', 60000000000000);
+INSERT INTO timer_waits VALUES ('1 hour', 3600000000000000);
+INSERT INTO timer_waits VALUES ('1 day', 86400000000000000);
+INSERT INTO timer_waits VALUES ('100 days', 8640000000000000000);
+--echo
+SELECT id, format_pico_time(wait), wait FROM timer_waits;
+--echo
+SELECT sum(wait), format_pico_time(sum(wait)) FROM timer_waits;
+--echo
+SELECT avg(wait), format_pico_time(avg(wait)) FROM timer_waits;
+--echo
+SELECT min(wait), format_pico_time(min(wait)) FROM timer_waits;
+--echo
+SELECT max(wait), format_pico_time(max(wait)) FROM timer_waits;
+--echo
+DROP TABLE timer_waits;
+
+--echo ## Using Scientific Notation
+SELECT format_pico_time(3e9);
+--echo
+SELECT format_pico_time(4e6);
+--echo
+SELECT format_pico_time(5e3);
+--echo
+SELECT format_pico_time(6e2);
diff --git a/mysql-test/main/func_group.result b/mysql-test/main/func_group.result
index 27845af7..6e58b4fc 100644
--- a/mysql-test/main/func_group.result
+++ b/mysql-test/main/func_group.result
@@ -1532,7 +1532,7 @@ DROP TABLE t1;
#
create table t1 (f1 year(2), f2 year(4), f3 date, f4 datetime);
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values
(98,1998,19980101,"1998-01-01 00:00:00"),
(00,2000,20000101,"2000-01-01 00:00:01"),
@@ -1815,7 +1815,7 @@ CREATE TABLE t1(f1 YEAR(4));
INSERT INTO t1 VALUES (0000),(2001);
(SELECT MAX(f1) FROM t1) UNION (SELECT MAX(f1) FROM t1);
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def MAX(f1) MAX(f1) 13 4 4 Y 32864 0 63
+def MAX(f1) MAX(f1) 13 4 4 Y 49248 0 63
MAX(f1)
2001
DROP TABLE t1;
@@ -1851,9 +1851,8 @@ NULL
EXPLAIN EXTENDED
SELECT MAX(a) FROM t1 WHERE (1,2) IN (SELECT a,b FROM t2 WHERE b<5) and a<10;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1 100.00
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 20.00 Using where; FirstMatch
1 PRIMARY t1 range a a 4 NULL 3 100.00 Using where; Using index; Using join buffer (flat, BNL join)
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where
Warnings:
Note 1003 select max(`test`.`t1`.`a`) AS `MAX(a)` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`a` = 1 and `test`.`t2`.`b` = 2 and `test`.`t1`.`a` < 10
SELECT MAX(a) FROM t1 WHERE (1,2) IN (SELECT a,b FROM t2 WHERE b<5) and a<10;
diff --git a/mysql-test/main/func_group_innodb.result b/mysql-test/main/func_group_innodb.result
index f5a823e4..9f69f424 100644
--- a/mysql-test/main/func_group_innodb.result
+++ b/mysql-test/main/func_group_innodb.result
@@ -246,12 +246,12 @@ INSERT INTO t1(a, b, c) VALUES
('', 'a', 1), ('', 'a', 1), ('', 'a', 2), ('', 'a', 2), ('', 'a', 3),
('', 'a', 3), ('', 'a', 4), ('', 'a', 4), ('', 'a', 5), ('', 'a', 5);
ANALYZE TABLE t1;
-SELECT MIN(c) FROM t1 GROUP BY b;
-MIN(c)
-0
EXPLAIN SELECT MIN(c) FROM t1 GROUP BY b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range NULL b 263 NULL 2 Using index for group-by
+SELECT MIN(c) FROM t1 GROUP BY b;
+MIN(c)
+0
DROP TABLE t1;
#
# MDEV-17589: Stack-buffer-overflow with indexed varchar (utf8) field
diff --git a/mysql-test/main/func_group_innodb.test b/mysql-test/main/func_group_innodb.test
index b1f9a28b..ca6b0838 100644
--- a/mysql-test/main/func_group_innodb.test
+++ b/mysql-test/main/func_group_innodb.test
@@ -199,8 +199,8 @@ INSERT INTO t1(a, b, c) VALUES
ANALYZE TABLE t1;
-- enable_result_log
-SELECT MIN(c) FROM t1 GROUP BY b;
EXPLAIN SELECT MIN(c) FROM t1 GROUP BY b;
+SELECT MIN(c) FROM t1 GROUP BY b;
DROP TABLE t1;
diff --git a/mysql-test/main/func_hybrid_type.result b/mysql-test/main/func_hybrid_type.result
index e6c08dab..1773f05a 100644
--- a/mysql-test/main/func_hybrid_type.result
+++ b/mysql-test/main/func_hybrid_type.result
@@ -3880,6 +3880,8 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1;
SET old_mode=ZERO_DATE_TIME_CAST;
+Warnings:
+Warning 1287 'ZERO_DATE_TIME_CAST' is deprecated and will be removed in a future release
CREATE TABLE t1 AS SELECT LEAST(CURRENT_DATE,CURRENT_TIME) AS c1;
Warnings:
Warning 1292 Incorrect datetime value: '0000-00-00 10:20:30'
@@ -4012,6 +4014,8 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1;
SET old_mode=ZERO_DATE_TIME_CAST;
+Warnings:
+Warning 1287 'ZERO_DATE_TIME_CAST' is deprecated and will be removed in a future release
CREATE TABLE t1 AS SELECT LEAST(CURRENT_DATE,CURRENT_TIME) AS c1;
Warnings:
Warning 1292 Incorrect datetime value: '0000-00-00 10:20:30'
diff --git a/mysql-test/main/func_json.result b/mysql-test/main/func_json.result
index 268a721a..fec066a1 100644
--- a/mysql-test/main/func_json.result
+++ b/mysql-test/main/func_json.result
@@ -671,8 +671,8 @@ DROP TABLE t1;
SELECT JSON_EXTRACT( '{"foo":"bar"}', '$[*].*' );
JSON_EXTRACT( '{"foo":"bar"}', '$[*].*' )
NULL
-SELECT JSON_EXTRACT( '{"foo":"bar"}', '$[*]' );
-JSON_EXTRACT( '{"foo":"bar"}', '$[*]' )
+SELECT JSON_EXTRACT( '{"foo":"bar"}', '$[*]');
+JSON_EXTRACT( '{"foo":"bar"}', '$[*]')
NULL
select JSON_EXTRACT('{"name":"value"}', '$.name') = 'value' as ex;
ex
@@ -2616,3 +2616,2575 @@ SET @@collation_connection= @save_collation_connection;
#
# End of 10.9 Test
#
+#
+# MDEV-32007: JSON_VALUE and JSON_EXTRACT doesn't handle dash (-)
+# as first character in key
+#
+CREATE TEMPORARY TABLE IF NOT EXISTS jsonTest AS
+SELECT '{ "-1234" : "something",
+ "12-34" : "else",
+ "1234-" : "and",
+ "1234" : "match" }' AS 'message';
+SELECT JSON_SEARCH(message, 'one', 'something') AS t1_path,
+JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'something'))) AS t1_result,
+JSON_SEARCH(message, 'one', 'else') AS t2_path,
+JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'else'))) AS t2_result,
+JSON_SEARCH(message, 'one', 'and') AS t3_path,
+JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'and'))) AS t3_result,
+JSON_SEARCH(message, 'one', 'match') AS t4_path,
+JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'match'))) AS t4_result
+FROM jsonTest;
+t1_path t1_result t2_path t2_result t3_path t3_result t4_path t4_result
+"$.-1234" something "$.12-34" else "$.1234-" and "$.1234" match
+# End of 11.0 test
+#
+# MDEV-27128: Implement JSON Schema Validation FUNCTION
+#
+# Checking annotations
+SET @schema_number= '{
+ "title" : "This is title 1",
+ "description":"this is description 1",
+ "$comment":"This is comment 1",
+ "type":"number",
+ "deprecated":true,
+ "readOnly":true,
+ "writeOnly":false,
+ "example":[2],
+ "default":4,
+ "$schema": "https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.9.5"
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_number, '"string1"');
+JSON_SCHEMA_VALID(@schema_number, '"string1"')
+0
+SELECT JSON_SCHEMA_VALID(@schema_number, '2');
+JSON_SCHEMA_VALID(@schema_number, '2')
+1
+# Checking empty schema with empty json document
+SET @schema= '{}';
+SELECT JSON_SCHEMA_VALID(@schema, '');
+JSON_SCHEMA_VALID(@schema, '')
+1
+SELECT JSON_SCHEMA_VALID(@schema, '{}');
+JSON_SCHEMA_VALID(@schema, '{}')
+1
+SELECT JSON_SCHEMA_VALID(@schema, '[]');
+JSON_SCHEMA_VALID(@schema, '[]')
+1
+SELECT JSON_SCHEMA_VALID(@schema, 'null');
+JSON_SCHEMA_VALID(@schema, 'null')
+1
+SELECT JSON_SCHEMA_VALID(@schema, 'true');
+JSON_SCHEMA_VALID(@schema, 'true')
+1
+SELECT JSON_SCHEMA_VALID(@schema, 'false');
+JSON_SCHEMA_VALID(@schema, 'false')
+1
+# Checking scalar against json schema
+# Checking boolean and null
+SET @schema_true= '{ "type": "boolean"}';
+SELECT JSON_SCHEMA_VALID(@schema_true, 'true');
+JSON_SCHEMA_VALID(@schema_true, 'true')
+1
+SELECT JSON_SCHEMA_VALID(@schema_true, 'false');
+JSON_SCHEMA_VALID(@schema_true, 'false')
+1
+SELECT JSON_SCHEMA_VALID(@schema_true, 'null');
+JSON_SCHEMA_VALID(@schema_true, 'null')
+0
+SET @schema_true= '{ "type": "boolean",
+ "const":"false"}';
+SELECT JSON_SCHEMA_VALID(@schema_true, 'true');
+JSON_SCHEMA_VALID(@schema_true, 'true')
+0
+SET @schema_true= '{ "type": "boolean",
+ "enum":[true, null, false]}';
+SELECT JSON_SCHEMA_VALID(@schema_true, 'true');
+JSON_SCHEMA_VALID(@schema_true, 'true')
+1
+SET @schema_true= '{ "type": "boolean",
+ "enum": [null, false]}';
+SELECT JSON_SCHEMA_VALID(@schema_true, 'true');
+JSON_SCHEMA_VALID(@schema_true, 'true')
+0
+SET @schema_true= '{ "type": "boolean",
+ "enum": [null, true]}';
+SELECT JSON_SCHEMA_VALID(@schema_true, 'true');
+JSON_SCHEMA_VALID(@schema_true, 'true')
+1
+SET @schema_true= '{ "type": "boolean",
+ "const":"false"}';
+SELECT JSON_SCHEMA_VALID(@schema_true, 'true');
+JSON_SCHEMA_VALID(@schema_true, 'true')
+0
+# Type can be more than one
+SET @schema= '
+ {
+ "type":["string", "number","array"]
+ }';
+SELECT JSON_SCHEMA_VALID(@schema, '{"key1":"val1"}');
+JSON_SCHEMA_VALID(@schema, '{"key1":"val1"}')
+0
+SELECT JSON_SCHEMA_VALID(@schema, '"abc"');
+JSON_SCHEMA_VALID(@schema, '"abc"')
+1
+SELECT JSON_SCHEMA_VALID(@schema, '3.14');
+JSON_SCHEMA_VALID(@schema, '3.14')
+1
+# Checking number
+SET @schema_number= '{
+ "maximum":7,
+ "minimum": 3,
+ "multipleOf":3
+}';
+SELECT JSON_SCHEMA_VALID(@schema_number, '2');
+JSON_SCHEMA_VALID(@schema_number, '2')
+0
+SET @schema_number= '{
+ "type": "number",
+ "maximum":13,
+ "minimum": 4,
+ "multipleOf":3,
+ "exclusiveMaximum": 9,
+ "exclusiveMinimum":4
+}';
+SELECT JSON_SCHEMA_VALID(@schema_number, '2');
+JSON_SCHEMA_VALID(@schema_number, '2')
+0
+SELECT JSON_SCHEMA_VALID(@schema_number, '6');
+JSON_SCHEMA_VALID(@schema_number, '6')
+1
+SELECT JSON_SCHEMA_VALID(@schema_number, '9');
+JSON_SCHEMA_VALID(@schema_number, '9')
+0
+SELECT JSON_SCHEMA_VALID(@schema_number, '5');
+JSON_SCHEMA_VALID(@schema_number, '5')
+0
+SET @schema_number= '{
+ "type": "number",
+ "maximum":100,
+ "minimum": 0,
+ "enum": [1, 2, "3", [4, 5, 6], {"key1":"val1"}]
+}';
+SELECT JSON_SCHEMA_VALID(@schema_number, 1);
+JSON_SCHEMA_VALID(@schema_number, 1)
+1
+SELECT JSON_SCHEMA_VALID(@schema_number, 3);
+JSON_SCHEMA_VALID(@schema_number, 3)
+0
+SET @schema_number= '{
+ "type":"number",
+ "maximum":10,
+ "const":2
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_number, '3');
+JSON_SCHEMA_VALID(@schema_number, '3')
+0
+SELECT JSON_SCHEMA_VALID(@schema_number, '2');
+JSON_SCHEMA_VALID(@schema_number, '2')
+1
+# Checking string
+# checking format keyword. (not validating for now)
+SET @schema_string= '{
+ "type": "string",
+ "format":"date-time"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_date-time"');
+JSON_SCHEMA_VALID(@schema_string, '"not_date-time"')
+1
+SET @schema_string= '{
+ "type": "string",
+ "format":"date"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_date"');
+JSON_SCHEMA_VALID(@schema_string, '"not_date"')
+1
+SET @schema_string= '{
+ "type": "string",
+ "format":"time"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_time"');
+JSON_SCHEMA_VALID(@schema_string, '"not_time"')
+1
+SET @schema_string= '{
+ "type": "string",
+ "format":"duration"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_duration"');
+JSON_SCHEMA_VALID(@schema_string, '"not_duration"')
+1
+SET @schema_string= '{
+ "type": "string",
+ "format":"email"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_email"');
+JSON_SCHEMA_VALID(@schema_string, '"not_email"')
+1
+SET @schema_string= '{
+ "type": "string",
+ "format":"idn-email"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_idn-email"');
+JSON_SCHEMA_VALID(@schema_string, '"not_idn-email"')
+1
+SET @schema_string= '{
+ "type": "string",
+ "format":"hostname"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_hostname"');
+JSON_SCHEMA_VALID(@schema_string, '"not_hostname"')
+1
+SET @schema_string= '{
+ "type": "string",
+ "format":"idn-hostname"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_idn-hostname"');
+JSON_SCHEMA_VALID(@schema_string, '"not_idn-hostname"')
+1
+SET @schema_string= '{
+ "type": "string",
+ "format":"ipv4"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_ipv4"');
+JSON_SCHEMA_VALID(@schema_string, '"not_ipv4"')
+1
+SET @schema_string= '{
+ "type": "string",
+ "format":"ipv6"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_ipv6"');
+JSON_SCHEMA_VALID(@schema_string, '"not_ipv6"')
+1
+SET @schema_string= '{
+ "type": "string",
+ "format":"uri"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_uri"');
+JSON_SCHEMA_VALID(@schema_string, '"not_uri"')
+1
+SET @schema_string= '{
+ "type": "string",
+ "format":"uri-reference"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_uri-reference"');
+JSON_SCHEMA_VALID(@schema_string, '"not_uri-reference"')
+1
+SET @schema_string= '{
+ "type": "string",
+ "format":"iri"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_iri"');
+JSON_SCHEMA_VALID(@schema_string, '"not_iri"')
+1
+SET @schema_string= '{
+ "type": "string",
+ "format":"iri-reference"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_iri-reference"');
+JSON_SCHEMA_VALID(@schema_string, '"not_iri-reference"')
+1
+SET @schema_string= '{
+ "type": "string",
+ "format":"uuid"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_uuid"');
+JSON_SCHEMA_VALID(@schema_string, '"not_uuid"')
+1
+SET @schema_string= '{
+ "type": "string",
+ "format":"json-pointer"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_json-pointer"');
+JSON_SCHEMA_VALID(@schema_string, '"not_json-pointer"')
+1
+SET @schema_string= '{
+ "type": "string",
+ "format":"relative-json-pointer"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_relative-json-pointer"');
+JSON_SCHEMA_VALID(@schema_string, '"not_relative-json-pointer"')
+1
+SET @schema_string= '{
+ "type": "string",
+ "format":"regex"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_regex"');
+JSON_SCHEMA_VALID(@schema_string, '"not_regex"')
+1
+# Validating other string keywords
+SET @schema_string= '{
+ "type": "string",
+ "maxLength":7,
+ "minLength": 4
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"foobar"');
+JSON_SCHEMA_VALID(@schema_string, '"foobar"')
+1
+SET @schema_string= '{
+ "type": "string",
+ "maxLength": 10,
+ "minLength": 8
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"foobar"');
+JSON_SCHEMA_VALID(@schema_string, '"foobar"')
+0
+SELECT JSON_SCHEMA_VALID(@schema_string, '"foobar123"');
+JSON_SCHEMA_VALID(@schema_string, '"foobar123"')
+1
+SET @schema_string= '{
+ "type": "string",
+ "maxLength": 10,
+ "minLength": 3,
+ "const": "foobar"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"foobar123"');
+JSON_SCHEMA_VALID(@schema_string, '"foobar123"')
+0
+SET @schema_string= '{
+ "type": "string",
+ "enum": ["red", "green", "blue"]
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"green"');
+JSON_SCHEMA_VALID(@schema_string, '"green"')
+1
+SELECT JSON_SCHEMA_VALID(@schema_string, '"orange"');
+JSON_SCHEMA_VALID(@schema_string, '"orange"')
+0
+SET @string_schema= '{
+ "type":"string",
+ "pattern":"ab+c"
+ }';
+SELECT JSON_SCHEMA_VALID(@string_schema, '"abc"');
+JSON_SCHEMA_VALID(@string_schema, '"abc"')
+1
+# Validating non-scalar
+# Validating array
+SET @schema_array= '{"type":"array"}';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, {"key1":"val1"}]');
+JSON_SCHEMA_VALID(@schema_array, '[1, 2, {"key1":"val1"}]')
+1
+SET @schema_array= '{"type":"array",
+ "maxItems": 4,
+ "minItems": 2}';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, {"key1":"val1"}]');
+JSON_SCHEMA_VALID(@schema_array, '[1, 2, {"key1":"val1"}]')
+1
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, false, null, "foobar"]');
+JSON_SCHEMA_VALID(@schema_array, '[1, 2, false, null, "foobar"]')
+0
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1]');
+JSON_SCHEMA_VALID(@schema_array, '[1]')
+0
+SET @schema_array= '{"maxItems": 4,
+ "minItems": 2}';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, {"key1":"val1"}]');
+JSON_SCHEMA_VALID(@schema_array, '[1, 2, {"key1":"val1"}]')
+1
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, false, null, "foobar"]');
+JSON_SCHEMA_VALID(@schema_array, '[1, 2, false, null, "foobar"]')
+0
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2]');
+JSON_SCHEMA_VALID(@schema_array, '[1, 2]')
+1
+SET @schema_array= '{
+ "type":"array",
+ "items": {"type":"number"},
+ "maxItems": 4,
+ "minItems": 2}';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, 3]');
+JSON_SCHEMA_VALID(@schema_array, '[1, 2, 3]')
+1
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, "foobar"]');
+JSON_SCHEMA_VALID(@schema_array, '[1, 2, "foobar"]')
+0
+SET @schema_array= '{"type":"array",
+ "maxItems": 4,
+ "minItems": 2,
+ "const": [1, 2, 3, 4]}';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, 3, "foobar"]');
+JSON_SCHEMA_VALID(@schema_array, '[1, 2, 3, "foobar"]')
+0
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, 3, 4]');
+JSON_SCHEMA_VALID(@schema_array, '[1, 2, 3, 4]')
+1
+SET @schema_array= '{"type":"array",
+ "enum":[[1,2,3], [4,5,6], [7,8,9]]}';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[4,5,6]');
+JSON_SCHEMA_VALID(@schema_array, '[4,5,6]')
+1
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1,5,7]');
+JSON_SCHEMA_VALID(@schema_array, '[1,5,7]')
+0
+SET @schema_array= '{
+ "type": "array",
+ "uniqueItems":true
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, 3, 2.0]');
+JSON_SCHEMA_VALID(@schema_array, '[1, 2, 3, 2.0]')
+0
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, 3, 4.0]');
+JSON_SCHEMA_VALID(@schema_array, '[1, 2, 3, 4.0]')
+1
+SET @schema_array= '{
+ "type": "array",
+ "contains": {
+ "type": "number"
+ },
+ "minContains": 2,
+ "maxContains": 3
+}';
+SELECT JSON_SCHEMA_VALID(@schema_array, '["string1", "string2", "string3", 1, 2, 3, 4]');
+JSON_SCHEMA_VALID(@schema_array, '["string1", "string2", "string3", 1, 2, 3, 4]')
+0
+SELECT JSON_SCHEMA_VALID(@schema_array, '["string1", "string2", "string3", 1, 2, 3]');
+JSON_SCHEMA_VALID(@schema_array, '["string1", "string2", "string3", 1, 2, 3]')
+1
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ]
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1",2]');
+JSON_SCHEMA_VALID(@schema_array, '[5, "string1",2]')
+1
+SELECT JSON_SCHEMA_VALID(@schema_array, '[2, "string1",2]');
+JSON_SCHEMA_VALID(@schema_array, '[2, "string1",2]')
+0
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "items":true
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1",2]');
+JSON_SCHEMA_VALID(@schema_array, '[5, "string1",2]')
+1
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "items":false
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1",2]');
+JSON_SCHEMA_VALID(@schema_array, '[5, "string1",2]')
+0
+# Checking objects
+SET @schema_object= '{"type":"object",
+ "properties":
+ {
+ "number1":{
+ "type":"number",
+ "maximum":12,
+ "minimum":1
+ },
+ "string1": {
+ "type":"string",
+ "maxLength":10,
+ "minLength": 4
+ },
+ "array1": {"type":"array",
+ "maxItems": 4,
+ "minItems": 2}
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_object, '{"number1":10, "string1":"foobar","array1":[1,2,3]}');
+JSON_SCHEMA_VALID(@schema_object, '{"number1":10, "string1":"foobar","array1":[1,2,3]}')
+1
+SELECT JSON_SCHEMA_VALID(@schema_object, '{"number1":10, "string1":"foobar","array1":[1,2,3,4,5]}');
+JSON_SCHEMA_VALID(@schema_object, '{"number1":10, "string1":"foobar","array1":[1,2,3,4,5]}')
+0
+SET @schema_obj= '{
+ "type": "object",
+ "properties": {
+ "number1":{"type":"number"},
+ "string1":{"type":"string"},
+ "array1":{"type":"array"}
+ },
+ "dependentRequired": {
+ "number1":["string1"]
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_obj, '{"array1":[1,2,3], "number1":2, "string1":"abc"}');
+JSON_SCHEMA_VALID(@schema_obj, '{"array1":[1,2,3], "number1":2, "string1":"abc"}')
+1
+SELECT JSON_SCHEMA_VALID(@schema_obj, '{"array1":[1,2,3], "number1":2}');
+JSON_SCHEMA_VALID(@schema_obj, '{"array1":[1,2,3], "number1":2}')
+0
+SET @schema_obj= '{"type":"object",
+ "properties":
+ {
+ "number1":{
+ "type":"number",
+ "maximum":12,
+ "minimum":1
+ },
+ "key1" : {
+ "type":"object",
+ "properties": {
+ "key2" :{
+ "type":"string"
+ }
+ }
+ }
+ },
+ "enum": [{"number1":3, "key1":{"key2":"string1"}}, {"number1":5, "key1":{"key2":"string3"}}, {"number1":7, "key1":{"key2":"string5"}}]
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_obj, '{"number1":5, "key1":{"key2":1}}');
+JSON_SCHEMA_VALID(@schema_obj, '{"number1":5, "key1":{"key2":1}}')
+0
+SELECT JSON_SCHEMA_VALID(@schema_obj, '{"number1":5, "key1":{"key2":"string1"}}');
+JSON_SCHEMA_VALID(@schema_obj, '{"number1":5, "key1":{"key2":"string1"}}')
+0
+SELECT JSON_SCHEMA_VALID(@schema_obj, '{"number1":5, "key1":{"key2":"string7"}}');
+JSON_SCHEMA_VALID(@schema_obj, '{"number1":5, "key1":{"key2":"string7"}}')
+0
+SET @schema_obj= '{"type":"object",
+ "properties":
+ {
+ "number1":{
+ "type":"number",
+ "maximum":12,
+ "minimum":1
+ },
+ "obj1" : {
+ "type":"object",
+ "properties": {
+ "obj1_1":{
+ "type":"string"
+ },
+ "obj1_2": {
+ "type":"array"
+ }
+ }
+ },
+ "obj2" : {
+ "type":"object",
+ "properties" : {
+ "obj2_1":{
+ "type":"number"
+ }
+ }
+ }
+ },
+ "required":["number1", "obj2"]
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_obj,'{"number1":5, "obj1":{"obj1_1":"string1", "obj1_2":[1, 2, 3]}}');
+JSON_SCHEMA_VALID(@schema_obj,'{"number1":5, "obj1":{"obj1_1":"string1", "obj1_2":[1, 2, 3]}}')
+0
+SELECT JSON_SCHEMA_VALID(@schema_obj,'{"number1":5, "obj1":{"obj1_1":"string1", "obj1_2":[1, 2, 3]}, "obj2":{"obj2_1":7}}');
+JSON_SCHEMA_VALID(@schema_obj,'{"number1":5, "obj1":{"obj1_1":"string1", "obj1_2":[1, 2, 3]}, "obj2":{"obj2_1":7}}')
+1
+SET @schema_obj= '{"type":"object",
+ "properties":
+ {
+ "number1":{
+ "type":"number",
+ "maximum":12,
+ "minimum":1
+ },
+ "obj1" : {
+ "type":"object",
+ "properties": {
+ "obj1_1":{
+ "type":"string"
+ },
+ "obj1_2": {
+ "type":"array"
+ }
+ }
+ },
+ "obj2" : {
+ "type":"object",
+ "properties" : {
+ "obj2_1":{
+ "type":"number"
+ }
+ }
+ }
+ },
+ "required":["number1", "obj2"],
+ "const": {"number1":5, "obj1":{"obj1_1":"string1", "obj1_2":[1, 2, 3]}, "obj2":{"obj2_1":7}}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_obj,'{"number1":5, "obj1":{"obj1_1":"string1", "obj1_2":[1, 2, 3]}, "obj2":{"obj2_1":7}}');
+JSON_SCHEMA_VALID(@schema_obj,'{"number1":5, "obj1":{"obj1_1":"string1", "obj1_2":[1, 2, 3]}, "obj2":{"obj2_1":7}}')
+1
+SELECT JSON_SCHEMA_VALID(@schema_obj,'{"number1":5, "obj1":{"obj1_1":"string1", "obj1_2":[1, 2, 3]}}');
+JSON_SCHEMA_VALID(@schema_obj,'{"number1":5, "obj1":{"obj1_1":"string1", "obj1_2":[1, 2, 3]}}')
+0
+SET @schema_obj= '{"type":"object",
+ "properties":
+ {
+ "number1":{
+ "type":"number",
+ "maximum":12,
+ "minimum":1
+ },
+ "obj1" : {
+ "type":"object",
+ "properties": {
+ "obj1_1":{
+ "type":"string"
+ },
+ "obj1_2": {
+ "type":"array"
+ }
+ }
+ },
+ "obj2" : {
+ "type":"object",
+ "properties" : {
+ "obj2_1":{
+ "type":"number"
+ }
+ }
+ }
+ },
+ "maxProperties": 5,
+ "minProperties":2
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_obj,'{"number1":5, "obj1":{"obj1_1":"string1", "obj1_2":[1, 2, 3]}, "obj2":{"obj2_1":7}}');
+JSON_SCHEMA_VALID(@schema_obj,'{"number1":5, "obj1":{"obj1_1":"string1", "obj1_2":[1, 2, 3]}, "obj2":{"obj2_1":7}}')
+1
+SELECT JSON_SCHEMA_VALID(@schema_obj,'{"number1":1, "number2":2, "number3":3, "number4":4, "number5":5, "number6":6}');
+JSON_SCHEMA_VALID(@schema_obj,'{"number1":1, "number2":2, "number3":3, "number4":4, "number5":5, "number6":6}')
+0
+SET @schema_obj= '{"type":"object",
+ "properties":
+ {
+ "number1":{
+ "type":"number",
+ "maximum":12,
+ "minimum":1
+ },
+ "obj1" : {
+ "type":"object",
+ "properties": {
+ "obj1_1":{
+ "type":"string"
+ },
+ "obj1_2": {
+ "type":"array"
+ }
+ }
+ }
+ },
+ "maxProperties": 3,
+ "minProperties":1,
+ "additionalProperties":false
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_obj,'{"number1":5, "obj1":{"obj1_1":"string1", "obj1_2":[1, 2, 3]}, "obj2":"string2"}');
+JSON_SCHEMA_VALID(@schema_obj,'{"number1":5, "obj1":{"obj1_1":"string1", "obj1_2":[1, 2, 3]}, "obj2":"string2"}')
+0
+# Demonstrating that irrelavent keywords for a type and irrelavent type
+# are ignored, and none of the keywords are mandatory, including "type".
+SET @schema_properties= '{
+ "properties" : {
+ "number1":{ "maximum":10 },
+ "string1" : { "maxLength": 3}
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_properties, '{ "number1":25, "string1":"ab" }');
+JSON_SCHEMA_VALID(@schema_properties, '{ "number1":25, "string1":"ab" }')
+0
+SELECT JSON_SCHEMA_VALID(@schema_properties, '{ "number1":10, "string1":"ab" }');
+JSON_SCHEMA_VALID(@schema_properties, '{ "number1":10, "string1":"ab" }')
+1
+SET @schema_properties= '{
+ "properties" : {
+ "number1":{ "maximum":10 },
+ "string1" : { "maxLength": 3},
+ "obj1" : {
+ "properties":{
+ "number2": {"minimum":8},
+ "array2": {"uniqueItems":true}
+ }
+ }
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_properties, '{ "number1":2, "string1":"ab", "obj1":{"number2":2, "array2":[1,2,3]} }');
+JSON_SCHEMA_VALID(@schema_properties, '{ "number1":2, "string1":"ab", "obj1":{"number2":2, "array2":[1,2,3]} }')
+0
+SELECT JSON_SCHEMA_VALID(@schema_properties, '{ "number1":2, "string1":"ab", "obj1":{"number2":10, "array2":[1,2,3]} }');
+JSON_SCHEMA_VALID(@schema_properties, '{ "number1":2, "string1":"ab", "obj1":{"number2":10, "array2":[1,2,3]} }')
+1
+SELECT JSON_SCHEMA_VALID(@schema_properties, '{ "number1":2, "string1":"ab", "obj1":{"array2":[1,2,3]} }');
+JSON_SCHEMA_VALID(@schema_properties, '{ "number1":2, "string1":"ab", "obj1":{"array2":[1,2,3]} }')
+1
+SELECT JSON_SCHEMA_VALID(@schema_properties, '{ "number1":2, "string1":"ab", "obj1":{"number2":10, "array2":[1,2,3,2]} }');
+JSON_SCHEMA_VALID(@schema_properties, '{ "number1":2, "string1":"ab", "obj1":{"number2":10, "array2":[1,2,3,2]} }')
+0
+SET @schema_num= '{
+ "maximum":10,
+ "minimum":2
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_num, '5');
+JSON_SCHEMA_VALID(@schema_num, '5')
+1
+SELECT JSON_SCHEMA_VALID(@schema_num, '"abc"');
+JSON_SCHEMA_VALID(@schema_num, '"abc"')
+1
+SET @schema_str= '{
+ "maxLength":5,
+ "minLength":2,
+ "pattern":"a+bc"
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_str, '"abc"');
+JSON_SCHEMA_VALID(@schema_str, '"abc"')
+1
+SELECT JSON_SCHEMA_VALID(@schema_str, '"abcadef"');
+JSON_SCHEMA_VALID(@schema_str, '"abcadef"')
+0
+SELECT JSON_SCHEMA_VALID(@schema_str, '"bc"');
+JSON_SCHEMA_VALID(@schema_str, '"bc"')
+0
+SET @schema_arr= '{
+ "uniqueItems":true,
+ "items":{"type":"string"},
+ "maximum":10
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_arr,'["abc", "bcd", "cde"]');
+JSON_SCHEMA_VALID(@schema_arr,'["abc", "bcd", "cde"]')
+1
+SELECT JSON_SCHEMA_VALID(@schema_arr,'["abc", "bcd", "abc"]');
+JSON_SCHEMA_VALID(@schema_arr,'["abc", "bcd", "abc"]')
+0
+SELECT JSON_SCHEMA_VALID(@schema_arr,'["abc", "bcd", 1]');
+JSON_SCHEMA_VALID(@schema_arr,'["abc", "bcd", 1]')
+0
+SET @schema_const1= '{"const":2}';
+SELECT JSON_SCHEMA_VALID(@schema_const1, '2');
+JSON_SCHEMA_VALID(@schema_const1, '2')
+1
+SELECT JSON_SCHEMA_VALID(@schema_const1, '"abc"');
+JSON_SCHEMA_VALID(@schema_const1, '"abc"')
+0
+SET @schema_const2= '{"const":true}';
+SELECT JSON_SCHEMA_VALID(@schema_const2,'true');
+JSON_SCHEMA_VALID(@schema_const2,'true')
+1
+SELECT JSON_SCHEMA_VALID(@schema_const2,'false');
+JSON_SCHEMA_VALID(@schema_const2,'false')
+0
+SET @schema_enum='{"enum":[1,2,3,"abc", [4,5,6]]}';
+SELECT JSON_SCHEMA_VALID(@schema_enum,'[4,5,6]');
+JSON_SCHEMA_VALID(@schema_enum,'[4,5,6]')
+1
+SELECT JSON_SCHEMA_VALID(@schema_enum,'4');
+JSON_SCHEMA_VALID(@schema_enum,'4')
+0
+SELECT JSON_SCHEMA_VALID(@schema_enum,'"abc"');
+JSON_SCHEMA_VALID(@schema_enum,'"abc"')
+1
+SET @schema_required='{"required":["num1","str1", "arr1"]}';
+SELECT JSON_SCHEMA_VALID(@schema_required,'{"num1":1, "str1":"abc", "arr1":[1,2,3]}');
+JSON_SCHEMA_VALID(@schema_required,'{"num1":1, "str1":"abc", "arr1":[1,2,3]}')
+1
+SELECT JSON_SCHEMA_VALID(@schema_required,'{"num1":1, "arr1":[1,2,3]}');
+JSON_SCHEMA_VALID(@schema_required,'{"num1":1, "arr1":[1,2,3]}')
+0
+SELECT JSON_SCHEMA_VALID(@schema_required,'"abcd"');
+JSON_SCHEMA_VALID(@schema_required,'"abcd"')
+1
+SET @schema_dep_required='{
+ "dependentRequired": {
+ "num1":["num2","num3"],
+ "str1":["str2","str3"]
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_dep_required,'{"num1":1, "num2":"abc", "num3":[1,2,3]}');
+JSON_SCHEMA_VALID(@schema_dep_required,'{"num1":1, "num2":"abc", "num3":[1,2,3]}')
+1
+SELECT JSON_SCHEMA_VALID(@schema_dep_required,'{"num1":1, "num2":"abc", "num3":[1,2,3], "str1":"abcd"}');
+JSON_SCHEMA_VALID(@schema_dep_required,'{"num1":1, "num2":"abc", "num3":[1,2,3], "str1":"abcd"}')
+0
+SELECT JSON_SCHEMA_VALID(@schema_dep_required,'{"num1":1, "num2":"abc", "num3":[1,2,3], "arr1":[1,2,3]}');
+JSON_SCHEMA_VALID(@schema_dep_required,'{"num1":1, "num2":"abc", "num3":[1,2,3], "arr1":[1,2,3]}')
+1
+# Checking syntax error
+SET @invalid_schema= '{"type":"object"
+ "properties":{
+ "number1": {"type":"number"},
+ "obj2": {"type":"object",
+ "properties": {
+ "key1": {"type":"number"}
+ }
+ }
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@invalid_schema, '{"number1":3, "obj2":{"key1":3}}');
+JSON_SCHEMA_VALID(@invalid_schema, '{"number1":3, "obj2":{"key1":3}}')
+NULL
+Warnings:
+Warning 4038 Syntax error in JSON text in argument 1 to function 'json_schema_valid' at position 45
+SET @invalid_json= '{"type":"array",
+ "maxItems": 4,
+ "minItems": 2,
+ "const": [1, 2, 3, 4]}';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, 3, 4');
+JSON_SCHEMA_VALID(@schema_array, '[1, 2, 3, 4')
+0
+SET @schema_string= '{
+ "type": "string",
+ "maxLength":-2
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"abcxyz"');
+ERROR HY000: Invalid value for keyword maxLength
+SET @schema_number= '{
+ "type": "number",
+ "multipleOf":-3
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_number, '3');
+ERROR HY000: Invalid value for keyword multipleOf
+SET @schema_object= '{
+ "type": "object",
+ "properties":{"num1":{"type":"number"}},
+ "required":{}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_object, '{"num1":2}');
+ERROR HY000: Invalid value for keyword required
+SET @schema_string= '{
+ "type": "string",
+ "maxLength":-10
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"str1"');
+ERROR HY000: Invalid value for keyword maxLength
+SET @schema_number= '{"type":"numberz"}';
+SELECT JSON_SCHEMA_VALID(@schema_number, '"string1"');
+ERROR HY000: Invalid value for keyword type
+# Using JSON_SCHEMA_VALID() as a constraint validation to insert into table
+CREATE TABLE str_table (val_str JSON CHECK(JSON_SCHEMA_VALID('{
+ "type":"string",
+ "maxLength":5,
+ "minLength":2,
+ "enum":["ab", "cd", "abc", "def", "abcdef"]
+ }', val_str)));
+CREATE TABLE num_table(val_num JSON CHECK(JSON_SCHEMA_VALID('{
+ "type":"number",
+ "minimum":10,
+ "maximum":30,
+ "exclusiveMinimum":11,
+ "exclusiveMaximum":29,
+ "multipleOf":5,
+ "const":15
+ }', val_num)));
+CREATE TABLE true_table(val_true JSON CHECK(JSON_SCHEMA_VALID('{
+ "type":"boolean",
+ "enum":[true, false, null]
+ }', val_true)));
+CREATE TABLE false_table (val_false JSON CHECK(JSON_SCHEMA_VALID('{
+ "type":"boolean"
+ }', val_false)));
+CREATE TABLE null_table (val_null JSON CHECK(JSON_SCHEMA_VALID('{
+ "type":"null"
+ }', val_null)));
+CREATE TABLE arr_table (val_arr JSON CHECK(JSON_SCHEMA_VALID('{
+ "type":"array",
+ "uniqueItems":true,
+ "maxItems":5,
+ "minItems":1,
+ "items":true,
+ "prefixItems":[{"type":"number"}]
+ }', val_arr)));
+CREATE TABLE obj_table(val_obj JSON CHECK(JSON_SCHEMA_VALID('{
+ "type":"object",
+ "properties": {
+ "number1":{
+ "type":"number",
+ "maximum":5,
+ "const":4
+ },
+ "string1":{
+ "type":"string",
+ "maxLength":5,
+ "minLength":3
+ },
+ "object1":{
+ "type":"object",
+ "properties":{
+ "key1": {"type":"string"},
+ "key2":{"type":"array"},
+ "key3":{"type":"number", "minimum":3}
+ },
+ "dependentRequired": { "key1":["key3"] }
+ }
+ },
+ "required":["number1","object1"]
+ }', val_obj)));
+INSERT INTO str_table VALUES ('"ab"'), ('"cd"'), ('"abc"'), ('"def"');
+INSERT INTO str_table VALUES ('"feb"');
+ERROR 23000: CONSTRAINT `str_table.val_str` failed for `test`.`str_table`
+INSERT INTO str_table VALUES('"abcdef"');
+ERROR 23000: CONSTRAINT `str_table.val_str` failed for `test`.`str_table`
+INSERT INTO str_table VALUES('"fedcba"');
+ERROR 23000: CONSTRAINT `str_table.val_str` failed for `test`.`str_table`
+SELECT * FROM str_table;
+val_str
+"ab"
+"cd"
+"abc"
+"def"
+INSERT INTO num_table values('15');
+INSERT INTO num_table values('25');
+ERROR 23000: CONSTRAINT `num_table.val_num` failed for `test`.`num_table`
+SELECT * FROM num_table;
+val_num
+15
+INSERT INTO true_table VALUES ('true');
+SELECT * FROM true_table;
+val_true
+true
+INSERT INTO false_table VALUES('false');
+SELECT * FROM false_table;
+val_false
+false
+INSERT INTO arr_table VALUES ('[10, 2, "abc"]');
+INSERT INTO arr_table VALUES('[100]');
+INSERT INTO arr_table VALUES ('["str1", 2, "abc", 2.0]');
+ERROR 23000: CONSTRAINT `arr_table.val_arr` failed for `test`.`arr_table`
+SELECT * FROM arr_table;
+val_arr
+[10, 2, "abc"]
+[100]
+INSERT INTO obj_table VALUES('{"number1":4, "string1":"abcd", "object1":{"key1":"val1", "key2":[1,2,3, "string1"], "key3":4}}');
+INSERT INTO obj_table VALUES('{"number1":3, "string1":"abcd", "object1":{"key1":"val1", "key2":[1,2,3, "string1"], "key3":4}}');
+ERROR 23000: CONSTRAINT `obj_table.val_obj` failed for `test`.`obj_table`
+INSERT INTO obj_table VALUES('{"number1":3, "string1":"abcd"}');
+ERROR 23000: CONSTRAINT `obj_table.val_obj` failed for `test`.`obj_table`
+INSERT INTO obj_table VALUES('{"number1":3, "string1":"abcd", "object1":{"key1":"val1", "key2":[1,2,3, "string1"]}');
+ERROR 23000: CONSTRAINT `obj_table.val_obj` failed for `test`.`obj_table`
+SELECT * FROM obj_table;
+val_obj
+{"number1":4, "string1":"abcd", "object1":{"key1":"val1", "key2":[1,2,3, "string1"], "key3":4}}
+DROP TABLE str_table, num_table, true_table, false_table, null_table, arr_table, obj_table;
+# array validation
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "additionalItems" : {"type":"number"},
+ "unevaluatedItems": {"type":"string"},
+ "items":{"type":"array"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", [1,2], "2", "string"]');
+JSON_SCHEMA_VALID(@schema_array, '[5, "string1", [1,2], "2", "string"]')
+0
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", "2", "string"]');
+JSON_SCHEMA_VALID(@schema_array, '[5, "string1", "2", "string"]')
+0
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", [1,2], [1,2]]');
+JSON_SCHEMA_VALID(@schema_array, '[5, "string1", [1,2], [1,2]]')
+1
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "additionalItems" : {"type":"number"},
+ "unevaluatedItems": {"type":"string"},
+ "items": true
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", [1,2], "2", "string"]');
+JSON_SCHEMA_VALID(@schema_array, '[5, "string1", [1,2], "2", "string"]')
+1
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "additionalItems" : {"type":"number"},
+ "unevaluatedItems": {"type":"string"},
+ "items": false
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", [1,2], "2", "string"]');
+JSON_SCHEMA_VALID(@schema_array, '[5, "string1", [1,2], "2", "string"]')
+0
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "additionalItems" : {"type":"number"},
+ "unevaluatedItems": {"type":"string"},
+ "items": [{"type":"string"}]
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", [1,2], "2", "string"]');
+ERROR HY000: Invalid value for keyword items
+# Removing items
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "additionalItems" : {"type":"number"},
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", [1,2], "2", "string"]');
+JSON_SCHEMA_VALID(@schema_array, '[5, "string1", [1,2], "2", "string"]')
+0
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", 1, 2, 3]');
+JSON_SCHEMA_VALID(@schema_array, '[5, "string1", 1, 2, 3]')
+1
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "additionalItems" : true,
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", 1, 2, 3]');
+JSON_SCHEMA_VALID(@schema_array, '[5, "string1", 1, 2, 3]')
+1
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "additionalItems" : false,
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", 1, 2, 3]');
+JSON_SCHEMA_VALID(@schema_array, '[5, "string1", 1, 2, 3]')
+0
+# Using items in place of additionalItems
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "items" : false,
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", 1, 2, 3]');
+JSON_SCHEMA_VALID(@schema_array, '[5, "string1", 1, 2, 3]')
+0
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "items" : true,
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", 1, 2, 3]');
+JSON_SCHEMA_VALID(@schema_array, '[5, "string1", 1, 2, 3]')
+1
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "items" : {"type":"number"},
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", 1, 2, 3]');
+JSON_SCHEMA_VALID(@schema_array, '[5, "string1", 1, 2, 3]')
+1
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "items" : {"type":"number"},
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", "string2", "string3"]');
+JSON_SCHEMA_VALID(@schema_array, '[5, "string1", "string2", "string3"]')
+0
+# Removing items and additionalItems both
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "unevaluatedItems": {"type":"number"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", "string2", "string3"]');
+JSON_SCHEMA_VALID(@schema_array, '[5, "string1", "string2", "string3"]')
+0
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", 1, 2]');
+JSON_SCHEMA_VALID(@schema_array, '[5, "string1", 1, 2]')
+1
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "unevaluatedItems": true
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", "string2", "string3"]');
+JSON_SCHEMA_VALID(@schema_array, '[5, "string1", "string2", "string3"]')
+1
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "unevaluatedItems": false
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", "string2", "string3"]');
+JSON_SCHEMA_VALID(@schema_array, '[5, "string1", "string2", "string3"]')
+0
+# Removing items, additionalItems, unevaluatedItems
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ]
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", "string2", "string3"]');
+JSON_SCHEMA_VALID(@schema_array, '[5, "string1", "string2", "string3"]')
+1
+# Removing prefixItems
+SET @schema_array= '{
+ "type": "array",
+ "items": { "type": "number", "maximum": 10, "minimum":3},
+ "additionalItems" : {"type":"number"},
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, 6,"2", "string"]');
+JSON_SCHEMA_VALID(@schema_array, '[5, 6,"2", "string"]')
+0
+SET @schema_array= '{
+ "type": "array",
+ "items": { "type": "number", "maximum": 10, "minimum":3},
+ "additionalItems" : {"type":"string"},
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, 6,"2", "string"]');
+JSON_SCHEMA_VALID(@schema_array, '[5, 6,"2", "string"]')
+0
+SET @schema_array= '{
+ "type": "array",
+ "items": true,
+ "additionalItems" : {"type":"string"},
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, 6,"2", "string"]');
+JSON_SCHEMA_VALID(@schema_array, '[5, 6,"2", "string"]')
+1
+SET @schema_array= '{
+ "type": "array",
+ "items": false,
+ "additionalItems" : {"type":"string"},
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, 6,"2", "string"]');
+JSON_SCHEMA_VALID(@schema_array, '[5, 6,"2", "string"]')
+0
+SELECT JSON_SCHEMA_VALID(@schema_array, '[]');
+JSON_SCHEMA_VALID(@schema_array, '[]')
+1
+# Removing prefixItems and additionalItems
+SET @schema_array= '{
+ "type": "array",
+ "items": {"type":"string"},
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '["str1", "str2", 2]');
+JSON_SCHEMA_VALID(@schema_array, '["str1", "str2", 2]')
+0
+SELECT JSON_SCHEMA_VALID(@schema_array, '["str1", "str2"]');
+JSON_SCHEMA_VALID(@schema_array, '["str1", "str2"]')
+1
+SET @schema_array= '{
+ "type": "array",
+ "items": {"type":"string"},
+ "unevaluatedItems": {"type":"number"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '["str1", "str2", 2]');
+JSON_SCHEMA_VALID(@schema_array, '["str1", "str2", 2]')
+0
+# removing prefixItems, additionalItems and unevaluatedItems
+SET @schema_array= '{
+ "type": "array",
+ "items": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '["str1", "str2", 2]');
+JSON_SCHEMA_VALID(@schema_array, '["str1", "str2", 2]')
+0
+SELECT JSON_SCHEMA_VALID(@schema_array, '["str1", "str2"]');
+JSON_SCHEMA_VALID(@schema_array, '["str1", "str2"]')
+1
+# Checking that additionalItems alone has no effect on schema without items/prefixItems
+# regardless existence of unevaluatedItems
+SET @schema_array= '{
+ "type": "array",
+ "additionalItems": {"type":"string"},
+ "unevaluatedItems": {"type":"number"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '["str1", "str2", 1]');
+JSON_SCHEMA_VALID(@schema_array, '["str1", "str2", 1]')
+1
+SET @schema_array= '{
+ "type": "array",
+ "additionalItems": true,
+ "unevaluatedItems": {"type":"number"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '["str1", "str2", 1]');
+JSON_SCHEMA_VALID(@schema_array, '["str1", "str2", 1]')
+1
+SET @schema_array= '{
+ "type": "array",
+ "additionalItems": false,
+ "unevaluatedItems": {"type":"number"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '["str1", "str2", 1]');
+JSON_SCHEMA_VALID(@schema_array, '["str1", "str2", 1]')
+1
+# checking that unevaluatedItems alone can have effect on schema validation
+SET @schema_array= '{
+ "type": "array",
+ "unevaluatedItems": {"type":"number"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1]');
+JSON_SCHEMA_VALID(@schema_array, '[1]')
+1
+SET @schema_array= '{
+ "type": "array",
+ "unevaluatedItems": {"type":"number"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, "str1"]');
+JSON_SCHEMA_VALID(@schema_array, '[1, "str1"]')
+0
+SET @schema_array= '{
+ "type": "array",
+ "unevaluatedItems": false
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, "str1"]');
+JSON_SCHEMA_VALID(@schema_array, '[1, "str1"]')
+0
+SELECT JSON_SCHEMA_VALID(@schema_array, '[]');
+JSON_SCHEMA_VALID(@schema_array, '[]')
+1
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1,2,3]');
+JSON_SCHEMA_VALID(@schema_array, '[1,2,3]')
+0
+# Object validation
+SET @property_names= '{
+ "PropertyNames":{
+ "pattern": "^I_"
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@property_names, '{"I_int1":3, "O_ob1":{"key1":"val1"}}');
+JSON_SCHEMA_VALID(@property_names, '{"I_int1":3, "O_ob1":{"key1":"val1"}}')
+0
+SELECT JSON_SCHEMA_VALID(@property_names, '{"I_int1":3, "I_ob1":{"key1":"val1"}}');
+JSON_SCHEMA_VALID(@property_names, '{"I_int1":3, "I_ob1":{"key1":"val1"}}')
+1
+# checking that when a match is found in properties or patternProperties, it must validate and
+# validation result affects the schema. If key is not found in properties or patternProperties, and
+# additionalProperties exists, it must validate regardless of existence or value for unevaluatedProperties
+# and the result of validation with additionalProperties affects result of whole schema
+SET @object_schema= '{
+ "type":"object",
+ "properties": {
+ "key1":{"type":"string"},
+ "key2":{"type":"number", "maximum":50}
+ },
+ "patternProperties": {
+ "^I_": {"type":"number", "maximum":100},
+ "^S_" : {"type":"string", "maxLength":4}
+ },
+ "additionalProperties":{
+ "type":"array",
+ "maxItems":5
+ },
+ "unevaluatedProperties":{"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}')
+1
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": [1,2,3], "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": [1,2,3], "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}')
+0
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":[1,2,3], "S_":"abc", "some_prop1":[1,2,3]}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":[1,2,3], "S_":"abc", "some_prop1":[1,2,3]}')
+0
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":"string1"}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":"string1"}')
+0
+# removing patternProperties to check that validation falls back on additionalProperties and
+# existence of unevaluatedProperties still does not change anything because of existence of additional
+# properties
+SET @object_schema= '{
+ "type":"object",
+ "properties": {
+ "key1":{"type":"string"},
+ "key2":{"type":"number", "maximum":50}
+ },
+ "additionalProperties":{
+ "type":"array",
+ "maxItems":5
+ },
+ "unevaluatedProperties":{"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}')
+0
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":[1,2,3], "S_":[1,2,3], "some_prop1":[1,2,3]}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":[1,2,3], "S_":[1,2,3], "some_prop1":[1,2,3]}')
+1
+# Remvoing additionalProperties to check that validation falls back on unevaluatedProperties
+SET @object_schema= '{
+ "type":"object",
+ "properties": {
+ "key1":{"type":"string"},
+ "key2":{"type":"number", "maximum":50}
+ },
+ "patternProperties": {
+ "^I_": {"type":"number", "maximum":100},
+ "^S_" : {"type":"string", "maxLength":4}
+ },
+ "unevaluatedProperties":{"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":10, "S_":"abc", "some_prop1":[1,2,3]}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":10, "S_":"abc", "some_prop1":[1,2,3]}')
+0
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":10, "S_":"abc", "some_prop1":"str"}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":10, "S_":"abc", "some_prop1":"str"}')
+1
+# Removing unevaluatedProperties has no effect on result when additionalProperties is present
+SET @object_schema= '{
+ "type":"object",
+ "properties": {
+ "key1":{"type":"string"},
+ "key2":{"type":"number", "maximum":50}
+ },
+ "patternProperties": {
+ "^I_": {"type":"number", "maximum":100},
+ "^S_" : {"type":"string", "maxLength":4}
+ },
+ "additionalProperties":{
+ "type":"array",
+ "maxItems":5
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}')
+1
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":"str1"}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":"str1"}')
+0
+SET @object_schema= '{
+ "type":"object",
+ "properties": {
+ "key1":{"type":"string"},
+ "key2":{"type":"number", "maximum":50}
+ },
+ "patternProperties": {
+ "^I_": {"type":"number", "maximum":100},
+ "^S_" : {"type":"string", "maxLength":4}
+ },
+ "additionalProperties": false
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}')
+0
+SET @object_schema= '{
+ "type":"object",
+ "properties": {
+ "key1":{"type":"string"},
+ "key2":{"type":"number", "maximum":50}
+ },
+ "patternProperties": {
+ "^I_": {"type":"number", "maximum":100},
+ "^S_" : {"type":"string", "maxLength":4}
+ },
+ "additionalProperties": true
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}')
+1
+# Checking that in absence of additionalProperties, validation falls back on evaluatedProperties
+SET @object_schema= '{
+ "type":"object",
+ "properties": {
+ "key1":{"type":"string"},
+ "key2":{"type":"number", "maximum":50}
+ },
+ "patternProperties": {
+ "^I_": {"type":"number", "maximum":100},
+ "^S_" : {"type":"string", "maxLength":4}
+ },
+ "unevaluatedProperties":{"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 3, "I_int":20, "S_":"abc", "some_prop1":"str1"}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 3, "I_int":20, "S_":"abc", "some_prop1":"str1"}')
+1
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 3, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 3, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}')
+0
+SET @object_schema= '{
+ "type":"object",
+ "properties": {
+ "key1":{"type":"string"},
+ "key2":{"type":"number", "maximum":50}
+ },
+ "unevaluatedProperties":{"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 3, "I_int":"str2", "S_":"abc", "some_prop1":[1,2,3]}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 3, "I_int":"str2", "S_":"abc", "some_prop1":[1,2,3]}')
+0
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 3, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 3, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}')
+0
+# Properties to check if patternProperties get evaluated but keys not found in patternProperties get evaluated against
+# additionalProperties regardless of existence of unevaluatedProperperties
+SET @object_schema= '{
+ "type":"object",
+ "patternProperties": {
+ "^I_": {"type":"number", "maximum":100},
+ "^S_" : {"type":"string", "maxLength":4}
+ },
+ "additionalProperties":{
+ "type":"array",
+ "maxItems":5
+ },
+ "unevaluatedProperties":{"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}')
+0
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":[1, 2, 3], "key2": [1, 2, 3], "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":[1, 2, 3], "key2": [1, 2, 3], "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}')
+1
+SET @object_schema= '{
+ "type":"object",
+ "patternProperties": {
+ "^I_": {"type":"number", "maximum":100},
+ "^S_" : {"type":"string", "maxLength":4}
+ },
+ "additionalProperties":{
+ "type":"array",
+ "maxItems":5
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}')
+0
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":[1, 2, 3], "key2": [1, 2, 3], "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":[1, 2, 3], "key2": [1, 2, 3], "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}')
+1
+# Checking that in absence of additionalProperties and properties, the keys not found in patternProperties are
+# evaluated against unevaluatedProperties
+SET @object_schema= '{
+ "type":"object",
+ "patternProperties": {
+ "^I_": {"type":"number", "maximum":100},
+ "^S_" : {"type":"string", "maxLength":4}
+ },
+ "unevaluatedProperties":{"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}')
+0
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": "str2", "I_int":20, "S_":"abc", "some_prop1":"str1"}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": "str2", "I_int":20, "S_":"abc", "some_prop1":"str1"}')
+1
+# checking that in absence of properties, additionalProperties and unevaluatedPropoerties, the keys that are
+# not found are considered validated.
+SET @object_schema= '{
+ "type":"object",
+ "patternProperties": {
+ "^I_": {"type":"number", "maximum":100},
+ "^S_" : {"type":"string", "maxLength":4}
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}')
+1
+# checking that additionalProperties are evaluated in absence of patternProperties and properties, regardless
+# of presence of unevaluatedProperties
+SET @object_schema= '{
+ "type":"object",
+ "additionalProperties":{
+ "type":"array",
+ "maxItems":5
+ },
+ "unevaluatedProperties":{"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}')
+0
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":[1,2,3], "key2": [1,2,3], "I_int":[1,2,3], "S_":[1,2,3], "some_prop1":[1,2,3]}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":[1,2,3], "key2": [1,2,3], "I_int":[1,2,3], "S_":[1,2,3], "some_prop1":[1,2,3]}')
+1
+SET @object_schema= '{
+ "type":"object",
+ "additionalProperties":{
+ "type":"array",
+ "maxItems":5
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}')
+0
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":[1,2,3], "key2": [1,2,3], "I_int":[1,2,3], "S_":[1,2,3], "some_prop1":[1,2,3]}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":[1,2,3], "key2": [1,2,3], "I_int":[1,2,3], "S_":[1,2,3], "some_prop1":[1,2,3]}')
+1
+# Checking that in absence of properties, patternProperties and additionalProperties, validation falls back on unevaluatedProperties
+SET @object_schema= '{
+ "type":"object",
+ "unevaluatedProperties":{"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": "str1", "I_int":"str2", "S_":"abc", "some_prop1":"str3"}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": "str1", "I_int":"str2", "S_":"abc", "some_prop1":"str3"}')
+1
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":[1,2,3], "key2": [1,2,3], "I_int":[1,2,3], "S_":[1,2,3], "some_prop1":[1,2,3]}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":[1,2,3], "key2": [1,2,3], "I_int":[1,2,3], "S_":[1,2,3], "some_prop1":[1,2,3]}')
+0
+SET @object_schema= '{
+ "type":"object",
+ "unevaluatedProperties": false
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": "str1", "I_int":"str2", "S_":"abc", "some_prop1":"str3"}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": "str1", "I_int":"str2", "S_":"abc", "some_prop1":"str3"}')
+0
+SELECT JSON_SCHEMA_VALID(@object_schema, '{}');
+JSON_SCHEMA_VALID(@object_schema, '{}')
+1
+SET @object_schema= '{
+ "type":"object",
+ "unevaluatedProperties": true
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": "str1", "I_int":"str2", "S_":"abc", "some_prop1":"str3"}');
+JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": "str1", "I_int":"str2", "S_":"abc", "some_prop1":"str3"}')
+1
+SELECT JSON_SCHEMA_VALID(@object_schema, '{}');
+JSON_SCHEMA_VALID(@object_schema, '{}')
+1
+SET @json_schema_dependent_schemas='{
+ "type": "object",
+ "properties": {
+ "str1": { "type": "string" },
+ "num1": { "type": "number" }
+ },
+
+ "required": ["str1"],
+
+ "dependentSchemas": {
+ "num1": {
+ "properties": {
+ "str2": { "type": "string" }
+ },
+ "required": ["str2"]
+ }
+ }
+}';
+SELECT JSON_SCHEMA_VALID(@json_schema_dependent_schemas, '{ "str1": "str", "num1":4}');
+JSON_SCHEMA_VALID(@json_schema_dependent_schemas, '{ "str1": "str", "num1":4}')
+0
+SELECT JSON_SCHEMA_VALID(@json_schema_dependent_schemas, '{ "str1": "str"}');
+JSON_SCHEMA_VALID(@json_schema_dependent_schemas, '{ "str1": "str"}')
+1
+# Validating logic
+SET @not_schema= '{
+ "not":{
+ "maximum": 4
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@not_schema, '{"I_int1":3, "O_ob1":{"key1":"val1"}}');
+JSON_SCHEMA_VALID(@not_schema, '{"I_int1":3, "O_ob1":{"key1":"val1"}}')
+0
+SELECT JSON_SCHEMA_VALID(@not_schema, '3');
+JSON_SCHEMA_VALID(@not_schema, '3')
+0
+SELECT JSON_SCHEMA_VALID(@not_schema, '10');
+JSON_SCHEMA_VALID(@not_schema, '10')
+1
+SET @not_schema= '{
+ "not":{
+ "properties": {
+ "num1" : {"type":"number", "maximum":5},
+ "string1" : { "maxLength": 3}
+ }
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@not_schema, '{"num1":10, "string2":"abcd"}');
+JSON_SCHEMA_VALID(@not_schema, '{"num1":10, "string2":"abcd"}')
+1
+SELECT JSON_SCHEMA_VALID(@not_schema, '{"num1":2, "string2":"abcd"}');
+JSON_SCHEMA_VALID(@not_schema, '{"num1":2, "string2":"abcd"}')
+0
+SET @any_of_schema= '{
+ "anyOf":[{
+ "properties": {
+ "num1" : {"type":"number", "maximum":5},
+ "string1" : { "maxLength": 3}
+ }
+ },
+ {
+ "properties":{
+ "num1" : {"type":"number", "maximum": 1},
+ "string1" : { "maxLength":5}
+ }
+ }
+ ]
+ }';
+SELECT JSON_SCHEMA_VALID(@any_of_schema, '{"num1":2, "string1":"abcd"}');
+JSON_SCHEMA_VALID(@any_of_schema, '{"num1":2, "string1":"abcd"}')
+0
+SELECT JSON_SCHEMA_VALID(@any_of_schema, '{"num1":2, "string1":"abc"}');
+JSON_SCHEMA_VALID(@any_of_schema, '{"num1":2, "string1":"abc"}')
+1
+SET @any_of_schema= '{
+ "anyOf": [
+ {"type":"number", "maximum":5},
+ {"type":"string"}
+ ]
+ }';
+SELECT JSON_SCHEMA_VALID(@any_of_schema, '2');
+JSON_SCHEMA_VALID(@any_of_schema, '2')
+1
+SELECT JSON_SCHEMA_VALID(@any_of_schema, '6');
+JSON_SCHEMA_VALID(@any_of_schema, '6')
+0
+SELECT JSON_SCHEMA_VALID(@any_of_schema, '[1, 2, 3]');
+JSON_SCHEMA_VALID(@any_of_schema, '[1, 2, 3]')
+0
+SET @one_of_schema= '{
+ "oneOf":[{
+ "properties": {
+ "num1" : {"type":"number", "maximum":5},
+ "string1" : { "maxLength": 3}
+ }
+ },
+ {
+ "properties":{
+ "num1" : {"type":"number", "maximum": 1},
+ "string1" : { "maxLength":5}
+ }
+ }
+ ]
+ }';
+SELECT JSON_SCHEMA_VALID(@one_of_schema, '{"num1":2, "string1":"abcd"}');
+JSON_SCHEMA_VALID(@one_of_schema, '{"num1":2, "string1":"abcd"}')
+0
+SELECT JSON_SCHEMA_VALID(@one_of_schema, '{"num1":2, "string1":"abc"}');
+JSON_SCHEMA_VALID(@one_of_schema, '{"num1":2, "string1":"abc"}')
+1
+SET @one_of_schema= '{
+ "oneOf": [
+ {"type":"number", "maximum":5},
+ {"type":"number", "maximum":3}
+ ]
+ }';
+SELECT JSON_SCHEMA_VALID(@one_of_schema, '2');
+JSON_SCHEMA_VALID(@one_of_schema, '2')
+0
+SELECT JSON_SCHEMA_VALID(@one_of_schema, '4');
+JSON_SCHEMA_VALID(@one_of_schema, '4')
+1
+SET @all_of_schema= '{
+ "allOf":[{
+ "properties": {
+ "num1" : {"type":"number", "maximum":5},
+ "string1" : { "maxLength": 3}
+ }
+ },
+ {
+ "properties":{
+ "num1" : {"type":"number", "maximum": 1},
+ "string1" : { "maxLength":5}
+ }
+ }
+ ]
+ }';
+SELECT JSON_SCHEMA_VALID(@all_of_schema, '{"num1":2, "string1":"abcd"}');
+JSON_SCHEMA_VALID(@all_of_schema, '{"num1":2, "string1":"abcd"}')
+0
+SET @all_of_schema= '{
+ "allOf":[
+ {
+ "properties":{
+ "num1": {"type":"number"},
+ "string1": {"type":"string"}
+ }
+ },
+ {
+ "properties":{
+ "num1": {"maximum":10},
+ "string1": {"maxLength":5}
+ }
+ }
+ ]
+ }';
+SELECT JSON_SCHEMA_VALID(@all_of_schema, '{"num1":5, "string1":"abc"}');
+JSON_SCHEMA_VALID(@all_of_schema, '{"num1":5, "string1":"abc"}')
+1
+SELECT JSON_SCHEMA_VALID(@all_of_schema, '{"num1":5, "string1":"foobar"}');
+JSON_SCHEMA_VALID(@all_of_schema, '{"num1":5, "string1":"foobar"}')
+0
+SET @condition_schema= '{
+ "if" : {"maximum":30, "multipleOf":3},
+ "then":{"minimum":5},
+ "else":{"minimum":10}
+ }';
+SELECT JSON_SCHEMA_VALID(@condition_schema, '6');
+JSON_SCHEMA_VALID(@condition_schema, '6')
+1
+SELECT JSON_SCHEMA_VALID(@condition_schema, '4');
+JSON_SCHEMA_VALID(@condition_schema, '4')
+0
+SELECT JSON_SCHEMA_VALID(@condition_schema, '13');
+JSON_SCHEMA_VALID(@condition_schema, '13')
+1
+SET @condition_schema= '{
+ "if" : {"maximum":30, "multipleOf":3}
+ }';
+SELECT JSON_SCHEMA_VALID(@condition_schema, '6');
+JSON_SCHEMA_VALID(@condition_schema, '6')
+1
+SELECT JSON_SCHEMA_VALID(@condition_schema, '7');
+JSON_SCHEMA_VALID(@condition_schema, '7')
+1
+SET @condition_schema= '{
+ "then":{"minimum":5},
+ "else":{"minimum":10}
+ }';
+SELECT JSON_SCHEMA_VALID(@condition_schema, '4');
+JSON_SCHEMA_VALID(@condition_schema, '4')
+1
+SELECT JSON_SCHEMA_VALID(@condition_schema, '11');
+JSON_SCHEMA_VALID(@condition_schema, '11')
+1
+# Checking unevaluatedProperperties with logical properties
+SET @all_of_unevaluated='{
+ "allOf": [
+ {
+ "type": "object",
+ "properties": {
+ "street_address": { "type": "string" },
+ "city": { "type": "string" },
+ "state": { "type": "string" }
+ },
+ "required": ["street_address", "city", "state"]
+ }
+ ],
+
+ "properties": {
+ "type": { "enum": ["residential", "business"] }
+ },
+ "required": ["type"],
+ "unevaluatedProperties": false
+}';
+SELECT JSON_SCHEMA_VALID(@all_of_unevaluated, '{
+ "street_address": "1600 Pennsylvania Avenue NW",
+ "city": "Washington",
+ "state": "DC",
+ "type": "business"
+}');
+JSON_SCHEMA_VALID(@all_of_unevaluated, '{
+ "street_address": "1600 Pennsylvania Avenue NW",
+ "city": "Washington",
+ "state": "DC",
+ "type": "business"
+}')
+1
+SET @all_of_unevaluated='{
+ "allOf": [
+ {
+ "type": "object",
+ "properties": {
+ "street_address": { "type": "string" },
+ "city": { "type": "string" },
+ "state": { "type": "string" }
+ },
+ "required": ["street_address", "city", "state"]
+ }
+ ],
+
+ "unevaluatedProperties": {"type":"number"}
+}';
+SELECT JSON_SCHEMA_VALID(@all_of_unevaluated, '{
+ "street_address": "1600 Pennsylvania Avenue NW",
+ "city": "Washington",
+ "state": "DC",
+ "type": "business"
+}');
+JSON_SCHEMA_VALID(@all_of_unevaluated, '{
+ "street_address": "1600 Pennsylvania Avenue NW",
+ "city": "Washington",
+ "state": "DC",
+ "type": "business"
+}')
+0
+SET @any_of_unevaluated='{
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "street_address": { "type": "string" },
+ "city": { "type": "string" },
+ "state": { "type": "string" }
+ },
+ "required": ["street_address", "city", "state"]
+ }
+ ],
+
+ "unevaluatedProperties": {"type":"number"}
+}';
+SELECT JSON_SCHEMA_VALID(@any_of_unevaluated, '{
+ "street_address": "1600 Pennsylvania Avenue NW",
+ "city": "Washington",
+ "state": "DC",
+ "type": "business"
+}');
+JSON_SCHEMA_VALID(@any_of_unevaluated, '{
+ "street_address": "1600 Pennsylvania Avenue NW",
+ "city": "Washington",
+ "state": "DC",
+ "type": "business"
+}')
+0
+SET @all_of_unevaluated='{
+ "allOf": [
+ {
+ "type": "array"
+ },
+ {
+ "maxItems":10
+ },
+ {
+ "prefixItems": [ {"type":"number"}, {"type":"string"}],
+ "additionalItems":{"type":"array"}
+ }
+ ],
+
+ "unevaluatedItems": {"type":"number"}
+}';
+SELECT JSON_SCHEMA_VALID(@all_of_unevaluated, '[1, "str", 2]');
+JSON_SCHEMA_VALID(@all_of_unevaluated, '[1, "str", 2]')
+0
+SET @all_of_unevaluated='{
+ "anyOf": [
+ {
+ "type": "array"
+ },
+ {
+ "maxItems":10
+ },
+ {
+ "prefixItems": [ {"type":"number"}, {"type":"string"}],
+ "additionalItems":{"type":"array"}
+ }
+ ],
+
+ "unevaluatedItems": {"type":"number"}
+}';
+SELECT JSON_SCHEMA_VALID(@all_of_unevaluated, '[1, "str", 2]');
+JSON_SCHEMA_VALID(@all_of_unevaluated, '[1, "str", 2]')
+1
+SET @all_of_unevaluated='{
+ "oneOf": [
+ {
+ "type": "array"
+ },
+ {
+ "maxItems":10
+ },
+ {
+ "prefixItems": [ {"type":"number"}, {"type":"string"}],
+ "additionalItems":{"type":"array"}
+ }
+ ],
+
+ "unevaluatedItems": {"type":"number"}
+}';
+SELECT JSON_SCHEMA_VALID(@all_of_unevaluated, '[1, "str", 2]');
+JSON_SCHEMA_VALID(@all_of_unevaluated, '[1, "str", 2]')
+0
+# Media string
+SET @schema_media_string= '{
+ "type": "string",
+ "contentMediaType": "text/html"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_media_string, '"str1"');
+JSON_SCHEMA_VALID(@schema_media_string, '"str1"')
+1
+SET @schema_reference= '{"$ref": "http://example.com/custom-email-validator.json#"}';
+SELECT JSON_SCHEMA_VALID(@schema_reference, '{}');
+ERROR HY000: $ref keyword is not supported
+SET @schema_reference= '{"$id": "http://example.com/custom-email-validator.json#"}';
+SELECT JSON_SCHEMA_VALID(@schema_reference, '{}');
+ERROR HY000: $id keyword is not supported
+SET @schema_reference= '{"$anchor": "http://example.com/custom-email-validator.json#"}';
+SELECT JSON_SCHEMA_VALID(@schema_reference, '{}');
+ERROR HY000: $anchor keyword is not supported
+SET @schema_reference= '{"$defs": "http://example.com/custom-email-validator.json#"}';
+SELECT JSON_SCHEMA_VALID(@schema_reference, '{}');
+ERROR HY000: $defs keyword is not supported
+#
+# MDEV-30795: JSON_SCHEMA_VALID bugs mentioned in comment
+#
+SET @schema= '{
+ "type":"array",
+ "uniqueItems":true
+ }';
+SELECT JSON_SCHEMA_VALID(@schema, '[null, null]');
+JSON_SCHEMA_VALID(@schema, '[null, null]')
+0
+SET @schema_max_items= '{"maxItems":-1}';
+SELECT JSON_SCHEMA_VALID(@schema_max_items, '[]');
+ERROR HY000: Invalid value for keyword maxItems
+SET @schema_min_items= '{"minItems":-1}';
+SELECT JSON_SCHEMA_VALID(@schema_min_items, '[]');
+ERROR HY000: Invalid value for keyword maxLength
+SET @schema_max_properties= '{"maxProperties":-1}';
+SELECT JSON_SCHEMA_VALID(@schema_max_properties, '{}');
+ERROR HY000: Invalid value for keyword maxProperties
+SET @schema_min_properties= '{"minProperties":-1}';
+SELECT JSON_SCHEMA_VALID(@schema_min_properties, '{}');
+ERROR HY000: Invalid value for keyword minProperties
+SET @schema_multiple_of= '{"multipleOf":-1}';
+SELECT JSON_SCHEMA_VALID(@schema_multiple_of, '2');
+ERROR HY000: Invalid value for keyword multipleOf
+SET @schema_max_contains= '{"maxContains":-1}';
+SELECT JSON_SCHEMA_VALID(@schema_max_contains, '[]');
+ERROR HY000: Invalid value for keyword maxContains
+SET @schema_min_contains= '{"minContains":-1}';
+SELECT JSON_SCHEMA_VALID(@schema_min_contains, '[]');
+ERROR HY000: Invalid value for keyword minContains
+SET @schema_required='{"type":"object","required":[1,"str1", "str1"]}';
+SELECT JSON_SCHEMA_VALID(@schema_required,'{"num1":1, "str1":"abc", "arr1":[1,2,3]}');
+ERROR HY000: Invalid value for keyword required
+#
+# MDEV-30977: Additional key values are not validating properly when using
+# unevaluatedProperties with properties declared in subschemas
+#
+SET @unevaluatedProperties_schema= '{
+ "allOf": [
+ {
+ "type": "object",
+ "properties": {
+ "name": { "type": "string" }
+ }
+ }
+ ],
+ "properties": {
+ "type": { "enum": ["residential", "business"] }
+ },
+ "required": ["type"],
+ "unevaluatedProperties": false
+}';
+SELECT JSON_SCHEMA_VALID(@unevaluatedProperties_schema, '{"name": "joe", "type": "business", "dummy" : "hello" }');
+JSON_SCHEMA_VALID(@unevaluatedProperties_schema, '{"name": "joe", "type": "business", "dummy" : "hello" }')
+0
+#
+# MDEV-30995: JSON_SCHEMA_VALID is not validating case sensitive when using regex
+#
+SET @schema_pattern='{
+ "type": "string",
+ "pattern": "[A-Z]"
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_pattern, '"a"');
+JSON_SCHEMA_VALID(@schema_pattern, '"a"')
+0
+SET @schema_property_names='{
+ "PropertyNames":{
+ "pattern": "^I_"
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_property_names, '{"I_num":4}');
+JSON_SCHEMA_VALID(@schema_property_names, '{"I_num":4}')
+1
+SELECT JSON_SCHEMA_VALID(@schema_property_names, '{"i_num":4}');
+JSON_SCHEMA_VALID(@schema_property_names, '{"i_num":4}')
+0
+SET @schema_pattern_properties= '{
+ "patternProperties": {
+ "^I_": {"type":"number", "maximum":100},
+ "^S_" : {"type":"string", "maxLength":4}
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_pattern_properties, '{"I_": 50}');
+JSON_SCHEMA_VALID(@schema_pattern_properties, '{"I_": 50}')
+1
+SELECT JSON_SCHEMA_VALID(@schema_pattern_properties, '{"I_": 150}');
+JSON_SCHEMA_VALID(@schema_pattern_properties, '{"I_": 150}')
+0
+SELECT JSON_SCHEMA_VALID(@schema_pattern_properties, '{"i_": 50}');
+JSON_SCHEMA_VALID(@schema_pattern_properties, '{"i_": 50}')
+1
+SELECT JSON_SCHEMA_VALID(@schema_pattern_properties, '{"i_": 150}');
+JSON_SCHEMA_VALID(@schema_pattern_properties, '{"i_": 150}')
+1
+#
+# MDEV-30690: Server crashed on function JSON_SCHEMA_VALID with incorrect input json schema
+#
+SET @schema = '{""}';
+SELECT JSON_SCHEMA_VALID(@schema, '1');
+JSON_SCHEMA_VALID(@schema, '1')
+NULL
+Warnings:
+Warning 4037 Unexpected end of JSON text in argument 1 to function 'json_schema_valid'
+SET @schema = '{
+ "type": "string",
+ "format"
+ }';
+SELECT JSON_SCHEMA_VALID(@schema, '1');
+JSON_SCHEMA_VALID(@schema, '1')
+NULL
+Warnings:
+Warning 4037 Unexpected end of JSON text in argument 1 to function 'json_schema_valid'
+SET @invalid_schema= '{"type":"object"
+ "properties":{
+ "number1": {"type":"number"},
+ "obj2": {"type":"object",
+ "properties": {
+ "key1": {"type":"number"}
+ }
+ }
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@invalid_schema, '{"number1":3, "obj2":{"key1":3}}');
+JSON_SCHEMA_VALID(@invalid_schema, '{"number1":3, "obj2":{"key1":3}}')
+NULL
+Warnings:
+Warning 4038 Syntax error in JSON text in argument 1 to function 'json_schema_valid' at position 45
+#
+# MDEV-30703: JSON_SCHEMA_VALID : Enum array must have at least one value
+#
+SET @schema = '{
+ "type":"array",
+ "enum": []
+ }';
+SELECT JSON_SCHEMA_VALID(@schema, '2');
+ERROR HY000: Invalid value for keyword enum
+SET @schema = '{
+ "type":"number",
+ "enum": [2, 2]
+ }';
+SELECT JSON_SCHEMA_VALID(@schema, '2');
+ERROR HY000: Invalid value for keyword enum
+#
+# MDEV-30704: JSON_SCHEMA_VALID: multipleOf must be greater than zero
+#
+SET @schema = '{
+ "multipleOf": 0
+ }';
+SELECT JSON_SCHEMA_VALID(@schema, '2');
+ERROR HY000: Invalid value for keyword multipleOf
+SET @schema= '{ "maxLength" : -3}';
+SELECT JSON_SCHEMA_VALID(@schema, '2');
+ERROR HY000: Invalid value for keyword maxLength
+SET @schema= '{ "minLength" : -3}';
+SELECT JSON_SCHEMA_VALID(@schema, '2');
+ERROR HY000: Invalid value for keyword minLength
+SET @schema= '{ "maxProperties" : -3}';
+SELECT JSON_SCHEMA_VALID(@schema, '2');
+ERROR HY000: Invalid value for keyword maxProperties
+SET @schema= '{ "minProperties" : -3}';
+SELECT JSON_SCHEMA_VALID(@schema, '2');
+ERROR HY000: Invalid value for keyword minProperties
+SET @schema= '{ "maxItems" : -3}';
+SELECT JSON_SCHEMA_VALID(@schema, '2');
+ERROR HY000: Invalid value for keyword maxItems
+SET @schema= '{ "minItems" : -3}';
+SELECT JSON_SCHEMA_VALID(@schema, '2');
+ERROR HY000: Invalid value for keyword maxLength
+SET @schema= '{ "items" : ["str1"]}';
+SELECT JSON_SCHEMA_VALID(@schema, '[]');
+ERROR HY000: Invalid value for keyword items
+#
+# MDEV-30705: JSON_SCHEMA_VALID: schema with multipleOf for big value always return 1
+#
+SET @schema = '{
+ "multipleOf": 2
+ }';
+SELECT JSON_SCHEMA_VALID(@schema, '9007900000000001');
+JSON_SCHEMA_VALID(@schema, '9007900000000001')
+0
+SELECT JSON_SCHEMA_VALID(@schema, '9007900000000060');
+JSON_SCHEMA_VALID(@schema, '9007900000000060')
+1
+SELECT JSON_SCHEMA_VALID(@schema, '9007900000000061');
+JSON_SCHEMA_VALID(@schema, '9007900000000061')
+0
+#
+# MDEV-31032: UBSAN|downcast of address X which does not point to an object of type
+# Item_string' in sql/json_schema.cc
+#
+SET @old_sql_mode= @@sql_mode;
+SET @schema='{ "type":"object","patternProperties": { "^I_": {"type":"number"},"^S_" : {"type":"string"} } }';
+SET SESSION sql_mode='empty_string_is_null';
+SELECT JSON_SCHEMA_VALID (@schema,'{"key1":"val0","key2":0,"I_int":0,"S_":"abc","prop0":"str0"}');
+JSON_SCHEMA_VALID (@schema,'{"key1":"val0","key2":0,"I_int":0,"S_":"abc","prop0":"str0"}')
+1
+SET @@sql_mode= @old_sql_mode;
+SET @property_names='{ "PropertyNames":{ "pattern": "^I_" } }';
+SET GLOBAL sql_mode=17179869183;
+SET @@sql_mode=DEFAULT;
+SELECT JSON_SCHEMA_VALID(@property_names, '{"I_int1":3, "I_ob1":{"key1":"val1"}}');
+JSON_SCHEMA_VALID(@property_names, '{"I_int1":3, "I_ob1":{"key1":"val1"}}')
+1
+SET @@sql_mode= @old_sql_mode;
+set global sql_mode=default;
+#
+# MDEV-30287: JSON_SCHEMA_VALID returns incorrect result for type=number
+#
+SET @schema= '{"type":"number"}';
+SELECT JSON_SCHEMA_VALID(@schema, '3.14');
+JSON_SCHEMA_VALID(@schema, '3.14')
+1
+SELECT JSON_SCHEMA_VALID(@schema, '0zzzz');
+JSON_SCHEMA_VALID(@schema, '0zzzz')
+0
+Warnings:
+Warning 4038 Syntax error in JSON text in argument 2 to function 'json_schema_valid' at position 2
+SELECT JSON_SCHEMA_VALID(@schema, '-#');
+JSON_SCHEMA_VALID(@schema, '-#')
+0
+Warnings:
+Warning 4038 Syntax error in JSON text in argument 2 to function 'json_schema_valid' at position 2
+#
+# MDEV-30689: JSON_SCHEMA_VALID for type=array return 1 for any string that starts with '['
+#
+SET @schema_array= '{"type":"array"}';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[');
+JSON_SCHEMA_VALID(@schema_array, '[')
+0
+Warnings:
+Warning 4037 Unexpected end of JSON text in argument 2 to function 'json_schema_valid'
+SELECT JSON_SCHEMA_VALID(repeat('[', 100000), json_object());
+JSON_SCHEMA_VALID(repeat('[', 100000), json_object())
+NULL
+Warnings:
+Warning 4040 Limit of 32 on JSON nested structures depth is reached in argument 1 to function 'json_schema_valid' at position 32
+SELECT JSON_SCHEMA_VALID(json_object(), repeat('[', 10000000));
+JSON_SCHEMA_VALID(json_object(), repeat('[', 10000000))
+0
+Warnings:
+Warning 4040 Limit of 32 on JSON nested structures depth is reached in argument 2 to function 'json_schema_valid' at position 32
+#
+# MDEV-30677: Incorrect result for "SELECT JSON_SCHEMA_VALID('{}', NULL)"
+#
+SELECT JSON_SCHEMA_VALID('{}', NULL);
+JSON_SCHEMA_VALID('{}', NULL)
+NULL
+SELECT JSON_SCHEMA_VALID(NULL, '{}');
+JSON_SCHEMA_VALID(NULL, '{}')
+NULL
+SELECT JSON_SCHEMA_VALID(NULL, NULL);
+JSON_SCHEMA_VALID(NULL, NULL)
+NULL
+#
+# MDEV-31599: Assertion `0' failed in Item_param::can_return_value from Item::val_json,
+# UBSAN: member access within null pointer of type 'struct String' in
+# sql/item_jsonfunc.cc
+#
+PREPARE s FROM 'SELECT JSON_SCHEMA_VALID (?,''{}'') FROM DUAL';
+ERROR HY000: Variable schema is not supported.
+#
+# MDEV-33015: Server crashes upon JSON_SCHEMA_VALID reading NULL from a user variable
+#
+SET @a= NULL;
+SELECT JSON_SCHEMA_VALID(@a,'{}');
+JSON_SCHEMA_VALID(@a,'{}')
+NULL
+# End of 11.1 test
+# Beginning of 11.2
+#
+# MDEV-30145: JSON_TABLE: allow to retrieve the key when iterating on JSON objects
+#
+# Checking json table with NULL and empty json doc
+SELECT jt.*
+FROM JSON_TABLE(
+NULL, '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+k v id
+# With Empty and NULL
+SELECT JSON_KEY_VALUE(NULL, '$.a');
+JSON_KEY_VALUE(NULL, '$.a')
+NULL
+SELECT JSON_KEY_VALUE('', '$.a');
+JSON_KEY_VALUE('', '$.a')
+NULL
+SELECT JSON_KEY_VALUE('[1,2,3]', '');
+JSON_KEY_VALUE('[1,2,3]', '')
+NULL
+SELECT JSON_KEY_VALUE('[1,2,3]', NULL);
+JSON_KEY_VALUE('[1,2,3]', NULL)
+NULL
+# With scalars
+SELECT JSON_KEY_VALUE('2', '$');
+JSON_KEY_VALUE('2', '$')
+NULL
+SELECT jt.*
+FROM JSON_TABLE(
+JSON_KEY_VALUE('2', '$'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+k v id
+SELECT JSON_KEY_VALUE('"some_string"', '$');
+JSON_KEY_VALUE('"some_string"', '$')
+NULL
+SELECT jt.*
+FROM JSON_TABLE(
+JSON_KEY_VALUE('"some_string"', '$'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+k v id
+SELECT JSON_KEY_VALUE('"some_string"', '$.a');
+JSON_KEY_VALUE('"some_string"', '$.a')
+NULL
+SELECT jt.*
+FROM JSON_TABLE(
+JSON_KEY_VALUE('"some_string"', '$.a'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+k v id
+SELECT JSON_KEY_VALUE('"some_string"', '$[0]');
+JSON_KEY_VALUE('"some_string"', '$[0]')
+NULL
+SELECT jt.*
+FROM JSON_TABLE(
+JSON_KEY_VALUE('"some_string"', '$[0]'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+k v id
+SELECT JSON_KEY_VALUE('false', '$[0]');
+JSON_KEY_VALUE('false', '$[0]')
+NULL
+SELECT jt.*
+FROM JSON_TABLE(
+JSON_KEY_VALUE('false', '$[0]'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+k v id
+# With non-scalar
+# With array
+SELECT JSON_KEY_VALUE('[]', '[0]');
+JSON_KEY_VALUE('[]', '[0]')
+NULL
+SELECT JSON_KEY_VALUE('[1, 2, 3]', '$[0]');
+JSON_KEY_VALUE('[1, 2, 3]', '$[0]')
+NULL
+SELECT jt.*
+FROM JSON_TABLE(
+JSON_KEY_VALUE('[1, 2, 3]', '$[0]'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+k v id
+SELECT JSON_KEY_VALUE('[[1, 2, 3], 2, 3]', '$[0]');
+JSON_KEY_VALUE('[[1, 2, 3], 2, 3]', '$[0]')
+NULL
+SELECT jt.*
+FROM JSON_TABLE(
+JSON_KEY_VALUE('[[1, 2, 3], 2, 3]', '$[0]'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+k v id
+SELECT JSON_KEY_VALUE('[[1, 2, 3], 2, 3]', '$[0].a');
+JSON_KEY_VALUE('[[1, 2, 3], 2, 3]', '$[0].a')
+NULL
+SELECT jt.*
+FROM JSON_TABLE(
+JSON_KEY_VALUE('[[1, 2, 3], 2, 3]', '$[0].a'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+k v id
+SELECT JSON_KEY_VALUE('[[1, 2, 3], 2, 3]', '$[0][1]');
+JSON_KEY_VALUE('[[1, 2, 3], 2, 3]', '$[0][1]')
+NULL
+SELECT jt.*
+FROM JSON_TABLE(
+JSON_KEY_VALUE('[[1, 2, 3], 2, 3]', '$[0][1]'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+k v id
+SELECT JSON_KEY_VALUE('[[1, {"key1":"val1", "key2":"val2"}, 3], 2, 3]',
+'$[0][1]') as exp;
+exp
+[{"key": "key1", "value": "val1"}, {"key": "key2", "value": "val2"}]
+SELECT jt.*
+FROM JSON_TABLE(
+JSON_KEY_VALUE('[[1, {"key1":"val1", "key2":"val2"}, 3], 2, 3]', '$[0][1]'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+k v id
+key1 val1 1
+key2 val2 2
+SELECT JSON_KEY_VALUE('[[1, {"key1":"val1", "key2":"val2"}, 3], 2, 3]',
+'$[0][1].key1') as exp;
+exp
+NULL
+SELECT jt.*
+FROM JSON_TABLE(
+JSON_KEY_VALUE('[[1, {"key1":"val1", "key2":"val2"}, 3], 2, 3]', '$[0][1].key1'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+k v id
+SELECT JSON_KEY_VALUE('[[1, [{"key1":"val1", "key2":"val2"}], 3], 2, 3]',
+'$[0][1]') as exp;
+exp
+NULL
+SELECT jt.*
+FROM JSON_TABLE(
+JSON_KEY_VALUE('[[1, [{"key1":"val1", "key2":"val2"}], 3], 2, 3]', '$[0][1]'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+k v id
+SELECT JSON_KEY_VALUE('[[1, [{"key1":"val1", "key2":"val2"}], 3], 2, 3]',
+'$[0][1][0]') as exp;
+exp
+[{"key": "key1", "value": "val1"}, {"key": "key2", "value": "val2"}]
+SELECT jt.*
+FROM JSON_TABLE(
+JSON_KEY_VALUE('[[1, [{"key1":"val1", "key2":"val2"}], 3], 2, 3]', '$[0][1][0]'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+k v id
+key1 val1 1
+key2 val2 2
+# With object
+SELECT JSON_KEY_VALUE('{}', '$.key1');
+JSON_KEY_VALUE('{}', '$.key1')
+NULL
+SELECT JSON_KEY_VALUE('{"key1":"val1", "key2":"val2"}', '$') as exp;
+exp
+[{"key": "key1", "value": "val1"}, {"key": "key2", "value": "val2"}]
+SELECT jt.*
+FROM JSON_TABLE(
+JSON_KEY_VALUE('{"key1":"val1", "key2":"val2"}', '$'), '$[*]'
+ COLUMNS (k VARCHAR(11) PATH '$.key', v VARCHAR(5) PATH '$.value', id FOR ORDINALITY)) AS jt;
+k v id
+key1 val1 1
+key2 val2 2
+SELECT JSON_KEY_VALUE('{"key1":"val1", "key2":"val2"}', '$.key1') as exp;
+exp
+NULL
+SELECT jt.*
+FROM JSON_TABLE(
+JSON_KEY_VALUE('{"key1":"val1", "key2":"val2"}', '$.key1'), '$[*]'
+ COLUMNS (k VARCHAR(11) PATH '$.key', v VARCHAR(5) PATH '$.value', id FOR ORDINALITY)) AS jt;
+k v id
+SELECT JSON_KEY_VALUE('{"key1":{"a":1, "b":2}, "key2":"val2"}', '$.key1') as exp;
+exp
+[{"key": "a", "value": 1}, {"key": "b", "value": 2}]
+SELECT jt.*
+FROM JSON_TABLE(
+JSON_KEY_VALUE('{"key1":{"a":1, "b":2}, "key2":"val2"}', '$.key1'), '$[*]'
+ COLUMNS (k VARCHAR(11) PATH '$.key', v VARCHAR(5) PATH '$.value', id FOR ORDINALITY)) AS jt;
+k v id
+a 1 1
+b 2 2
+SELECT JSON_KEY_VALUE('{"key1":{"a":1, "b": [1,2,3, {"some_key":"some_val", "c":3}]}, "key2":"val2"}', '$.key1.b[3]') as exp;
+exp
+[{"key": "some_key", "value": "some_val"}, {"key": "c", "value": 3}]
+SELECT jt.*
+FROM JSON_TABLE(
+JSON_KEY_VALUE('{"key1":{"a":1, "b": [1,2,3, {"some_key":"some_val", "c":3}]}, "key2":"val2"}', '$.key1.b[3]'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+k v id
+some_key some_val 1
+c 3 2
+SELECT JSON_KEY_VALUE('{"key1":{"a":1, "b": [1,2,3, {"some_key":"some_val", "c":3}]}, "key2":"val2"}', '$.key1.b[0]') as exp;
+exp
+NULL
+SELECT jt.*
+FROM JSON_TABLE(
+JSON_KEY_VALUE('{"key1":{"a":1, "b": [1,2,3, {"some_key":"some_val", "c":3}]}, "key2":"val2"}', '$.key1.b[0]'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+k v id
+# End of 11.2 test
+#
+# Beginning of 11.2 tests
+#
+# MDEV-26182: Implement json_array_intersect()
+#
+# JSON_ARRAY_INTERSECT()
+# Scalar as elements
+SET @json1= '[1,2,3]';
+SET @json2= '[1,2,3]';
+SELECT json_array_intersect(@json1, @json2);
+json_array_intersect(@json1, @json2)
+[1, 2, 3]
+SET @json1= '[1,2,3]';
+SET @json2= '[1,2,4]';
+SELECT json_array_intersect(@json1, @json2);
+json_array_intersect(@json1, @json2)
+[1, 2]
+SET @json1= '["abc","def","ghi"]';
+SET @json2= '["xyz", "abc", "tuv"]';
+SELECT json_array_intersect(@json1, @json2);
+json_array_intersect(@json1, @json2)
+["abc"]
+SET @obj1= '[true]';
+SET @obj2= '[false, "true"]';
+select json_array_intersect(@obj1, @obj2);
+json_array_intersect(@obj1, @obj2)
+NULL
+SET @obj1= '[true]';
+SET @obj2= '[false, true]';
+select json_array_intersect(@obj1, @obj2);
+json_array_intersect(@obj1, @obj2)
+[true]
+SET @obj1= '[null, true]';
+SET @obj2= '[false, null]';
+select json_array_intersect(@obj1, @obj2);
+json_array_intersect(@obj1, @obj2)
+[null]
+# array as elements
+SET @json1= '[6,6,6]';
+SET @json2= '[[1,2,3],[4,5,6],[1,3,2]]';
+SELECT json_array_intersect(@json1, @json2);
+json_array_intersect(@json1, @json2)
+NULL
+SET @json1= '[[1,2,3],[4,5,6],[1,3,2]]';
+SET @json2= '[[1,2,3],[4,5,6],[1,3,2]]';
+SELECT json_array_intersect(@json1, @json2);
+json_array_intersect(@json1, @json2)
+[[1, 2, 3], [4, 5, 6], [1, 3, 2]]
+SET @json1= '[[1,2,3],[4,5,6],[1,3,2]]';
+SET @json2= '[[1,2,3],[4,5,6],[1,4,2]]';
+SELECT json_array_intersect(@json1, @json2);
+json_array_intersect(@json1, @json2)
+[[1, 2, 3], [4, 5, 6]]
+# object as elements
+SET @json1 = '[{"k1":"v1","k2":"v2"},{"k2":"v2"}]';
+SET @json2 = '[{"kkey1":"vvalue1"},{"k2":"v2","k1":"v1"}]';
+SELECT json_array_intersect(@json1, @json2);
+json_array_intersect(@json1, @json2)
+[{"k2": "v2", "k1": "v1"}]
+SET @json1 = '[{"k1":"v1","k2":"v2"},{"k2":"v2","k1":"v1"}]';
+SET @json2 = '[{"k1":"v1","k2":"v2"},{"k1":"v1","k2":"v2"}]';
+SELECT json_array_intersect(@json1, @json2);
+json_array_intersect(@json1, @json2)
+[{"k1": "v1", "k2": "v2"}, {"k1": "v1", "k2": "v2"}]
+# multi type elements
+SET @obj1= '[1,2,3, "abc", "xyz", {"key1":"val1"}, {"key2":"val2"}, [1,2,3]]';
+SET @obj2= '[3.0, 4, 5, "abc", {"key1":"val1"}, [3,2,1]]';
+select json_array_intersect(@obj1, @obj2);
+json_array_intersect(@obj1, @obj2)
+[3.0, "abc", {"key1": "val1"}]
+SET @obj1= '[1, 2, 3, "abc", "xyz", {"key1": {"key2" : [1,2,3] } }, [4,5,6] ]';
+SET @obj2= '[3.0, 4, 5, "abc", {"key1": {"key2" : [3,2,1]} }, {"key1": {"key2" : [1,2,3] } }, [4,5,6], [6,5,4] ]';
+select json_array_intersect(@obj1, @obj2);
+json_array_intersect(@obj1, @obj2)
+[3.0, "abc", {"key1": {"key2": [1, 2, 3]}}, [4, 5, 6]]
+# Checking duplicates
+SET @obj1= '[1, 2, 3, 3, 3.0, "abc", true, true, {"key1":"val1"}]';
+SET @obj2= '[3.0, 3, 5, "abc", "abc", true, {"key2":"val2"}, {"key1":"val1"}, {"key1":"val2"}]';
+select json_array_intersect(@obj1, @obj2);
+json_array_intersect(@obj1, @obj2)
+[3.0, 3, "abc", true, {"key1": "val1"}]
+# Checking Syntax error for JSON_ARRAY_INTERSECT()
+SET @obj1= '[1, 2, 3, 3, 3.0, "abc", true, true, {"key1":"val1" ]';
+SET @obj2= '[3.0, 3, 5, "abc", "abc", true, {"key2":"val2"}, {"key1":"val1"}, {"key1":"val2"}]';
+select json_array_intersect(@obj1, @obj2);
+json_array_intersect(@obj1, @obj2)
+NULL
+Warnings:
+Warning 4038 Syntax error in JSON text in argument 1 to function 'json_array_intersect' at position 53
+# Checking incorrect type for input
+SET @obj1= '{"key1": "val1"}';
+SET @arr1= '[ 1, 2, 3 ]';
+SET @num1= '2';
+SET @str1= '"abc"';
+SET @bool1= 'true';
+select json_array_intersect(@obj1, @arr1);
+json_array_intersect(@obj1, @arr1)
+NULL
+select json_array_intersect(@arr1, @obj1);
+json_array_intersect(@arr1, @obj1)
+NULL
+select json_array_intersect(@arr1, @num1);
+json_array_intersect(@arr1, @num1)
+NULL
+select json_array_intersect(@num1, @bool1);
+json_array_intersect(@num1, @bool1)
+NULL
+# JSON_OBJECT_FILTER_KEYS()
+SET @obj1= '{ "a": 1, "b": 2, "c": 3}';
+SET @obj2= '{"b" : 10, "c": 20, "d": 30}';
+SELECT JSON_OBJECT_FILTER_KEYS (@obj1, json_array_intersect(json_keys(@obj1), json_keys(@obj2)));
+JSON_OBJECT_FILTER_KEYS (@obj1, json_array_intersect(json_keys(@obj1), json_keys(@obj2)))
+{"b": 2, "c": 3}
+SET @obj1= '{ "a": 1, "b": {"key1": {"key2":"val2"}}, "c": [1, 2, 3] }';
+SET @obj2= '{"b" : 10, "c": 20, "d": 30}';
+SELECT JSON_OBJECT_FILTER_KEYS (@obj1, json_array_intersect(json_keys(@obj1), json_keys(@obj2)));
+JSON_OBJECT_FILTER_KEYS (@obj1, json_array_intersect(json_keys(@obj1), json_keys(@obj2)))
+{"b": {"key1": {"key2": "val2"}}, "c": [1, 2, 3]}
+SET @obj1= '{ "a": 1, "b": {"key1": {"key2":"val2"}}, "c": [1, 2, 3] }';
+SET @arr2='["x", "y", "z"]';
+SELECT JSON_OBJECT_FILTER_KEYS(@obj1, @arr2);
+JSON_OBJECT_FILTER_KEYS(@obj1, @arr2)
+NULL
+SET @obj1= '{ "a": 1, "b": {"key1": {"key2":"val2"}}, "c": [1, 2, 3] }';
+SET @arr2='["key2", "key1", "b"]';
+SELECT JSON_OBJECT_FILTER_KEYS(@obj1, @arr1);
+JSON_OBJECT_FILTER_KEYS(@obj1, @arr1)
+NULL
+# Incorrect type in input returns NULL
+SELECT JSON_OBJECT_FILTER_KEYS(@obj1, @obj1);
+JSON_OBJECT_FILTER_KEYS(@obj1, @obj1)
+NULL
+SELECT JSON_OBJECT_FILTER_KEYS(@arr1, @arr1);
+JSON_OBJECT_FILTER_KEYS(@arr1, @arr1)
+NULL
+SET @obj1= '{ "a": 1, "b": {"key1": {"key2":"val2"}}, "c": [1, 2, 3] }';
+SET @scalar1='2';
+SELECT JSON_OBJECT_FILTER_KEYS(@obj1, @scalar1);
+JSON_OBJECT_FILTER_KEYS(@obj1, @scalar1)
+NULL
+# Checking syntax error
+SET @obj1= '{ "a": 1, "b": 2, "c": 3}';
+SET @obj2= '{"b" : 10, "c": 20, "d" 30}';
+SELECT JSON_OBJECT_FILTER_KEYS (@obj1, json_array_intersect(json_keys(@obj1), json_keys(@obj2)));
+JSON_OBJECT_FILTER_KEYS (@obj1, json_array_intersect(json_keys(@obj1), json_keys(@obj2)))
+NULL
+Warnings:
+Warning 4038 Syntax error in JSON text in argument 1 to function 'json_keys' at position 25
+SET @obj1= '{ "a": 1, "b": {"key1": {"key2":"val2"}}, "c": [1, 2, 3] }';
+SET @arr2= '[ "key2", "key1", "b" ';
+SELECT JSON_OBJECT_FILTER_KEYS(@obj1, @arr1);
+JSON_OBJECT_FILTER_KEYS(@obj1, @arr1)
+NULL
+# JSON_OBJECT_TO_ARRAY()
+SET @obj1= '{ "a": [1, 2, 3], "b": { "key1":"val1", "key2": {"key3":"val3"} }, "c": 3, "d" : 1, "e": "xyz", "f": true, "g" : null}';
+SELECT JSON_OBJECT_TO_ARRAY(@obj1);
+JSON_OBJECT_TO_ARRAY(@obj1)
+[["a", [1, 2, 3]], ["b", {"key1": "val1", "key2": {"key3": "val3"}}], ["c", 3], ["d", 1], ["e", "xyz"], ["f", true], ["g", null]]
+SET @obj1= '{ "a": [1, 2, 3], "b": { "key1":"val1", "key2": [1, 2, 3] }, "c": 3, "d" : 1, "e": "xyz", "f": true, "g" : null}';
+SELECT JSON_OBJECT_TO_ARRAY(@obj1);
+JSON_OBJECT_TO_ARRAY(@obj1)
+[["a", [1, 2, 3]], ["b", {"key1": "val1", "key2": [1, 2, 3]}], ["c", 3], ["d", 1], ["e", "xyz"], ["f", true], ["g", null]]
+# Checking syntax error
+SET @obj1= '{ "a": [1, 2, 3], "b": "key1": "val1", "key2": {"key3":"val3"} }, "c": 3, "d" : 1, "e": "xyz", "f": true, "g" : null}';
+SELECT JSON_OBJECT_TO_ARRAY(@obj1);
+JSON_OBJECT_TO_ARRAY(@obj1)
+NULL
+Warnings:
+Warning 4038 Syntax error in JSON text in argument 1 to function 'json_object_to_array' at position 30
+Checking incorrect type in argument
+SET @arr1= '[1, 2, 3]';
+SELECT JSON_OBJECT_TO_ARRAY(@arr1);
+JSON_OBJECT_TO_ARRAY(@arr1)
+NULL
+#
+# MDEV-31411: JSON_ARRAY_INTERSECT/JSON_OBJECT_FILTER_KEYS should fetch
+# data from a table similar to other JSON functions
+#
+CREATE TABLE t1 (
+c1 longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(c1)),
+c2 longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`c2`))
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
+INSERT INTO t1 VALUES('[1,2,3]', '[2, 3, 4]'), ('[2 ,3, 4]', '[4, 5, 6]');
+SELECT JSON_ARRAY_INTERSECT(c1, c2) FROM t1;
+JSON_ARRAY_INTERSECT(c1, c2)
+[2, 3]
+[4]
+DROP TABLE t1;
+#
+# End of 11.2 Test
+#
diff --git a/mysql-test/main/func_json.test b/mysql-test/main/func_json.test
index 54d7d73d..050e54f2 100644
--- a/mysql-test/main/func_json.test
+++ b/mysql-test/main/func_json.test
@@ -1,3 +1,5 @@
+--source include/have_innodb.inc
+
select json_valid('[1, 2]');
select json_valid('"string"}');
select json_valid('{"key1":1, "key2":[2,3]}');
@@ -324,7 +326,7 @@ DROP TABLE t1;
# MDEV-12324 Wrong result (phantom array value) on JSON_EXTRACT.
#
SELECT JSON_EXTRACT( '{"foo":"bar"}', '$[*].*' );
-SELECT JSON_EXTRACT( '{"foo":"bar"}', '$[*]' );
+SELECT JSON_EXTRACT( '{"foo":"bar"}', '$[*]');
#
# MDEV-12604 Comparison of JSON_EXTRACT result differs with Mysql.
@@ -1867,3 +1869,2209 @@ SET @@collation_connection= @save_collation_connection;
--echo #
--echo # End of 10.9 Test
--echo #
+
+--echo #
+--echo # MDEV-32007: JSON_VALUE and JSON_EXTRACT doesn't handle dash (-)
+--echo # as first character in key
+--echo #
+
+CREATE TEMPORARY TABLE IF NOT EXISTS jsonTest AS
+ SELECT '{ "-1234" : "something",
+ "12-34" : "else",
+ "1234-" : "and",
+ "1234" : "match" }' AS 'message';
+
+SELECT JSON_SEARCH(message, 'one', 'something') AS t1_path,
+ JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'something'))) AS t1_result,
+ JSON_SEARCH(message, 'one', 'else') AS t2_path,
+ JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'else'))) AS t2_result,
+ JSON_SEARCH(message, 'one', 'and') AS t3_path,
+ JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'and'))) AS t3_result,
+ JSON_SEARCH(message, 'one', 'match') AS t4_path,
+ JSON_VALUE(message, JSON_UNQUOTE(JSON_SEARCH(message, 'one', 'match'))) AS t4_result
+FROM jsonTest;
+
+--echo # End of 11.0 test
+
+--echo #
+--echo # MDEV-27128: Implement JSON Schema Validation FUNCTION
+--echo #
+
+--echo # Checking annotations
+
+SET @schema_number= '{
+ "title" : "This is title 1",
+ "description":"this is description 1",
+ "$comment":"This is comment 1",
+ "type":"number",
+ "deprecated":true,
+ "readOnly":true,
+ "writeOnly":false,
+ "example":[2],
+ "default":4,
+ "$schema": "https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.9.5"
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_number, '"string1"');
+SELECT JSON_SCHEMA_VALID(@schema_number, '2');
+
+--echo # Checking empty schema with empty json document
+
+SET @schema= '{}';
+
+SELECT JSON_SCHEMA_VALID(@schema, '');
+SELECT JSON_SCHEMA_VALID(@schema, '{}');
+SELECT JSON_SCHEMA_VALID(@schema, '[]');
+SELECT JSON_SCHEMA_VALID(@schema, 'null');
+SELECT JSON_SCHEMA_VALID(@schema, 'true');
+SELECT JSON_SCHEMA_VALID(@schema, 'false');
+
+--echo # Checking scalar against json schema
+
+--echo # Checking boolean and null
+
+SET @schema_true= '{ "type": "boolean"}';
+SELECT JSON_SCHEMA_VALID(@schema_true, 'true');
+SELECT JSON_SCHEMA_VALID(@schema_true, 'false');
+SELECT JSON_SCHEMA_VALID(@schema_true, 'null');
+
+SET @schema_true= '{ "type": "boolean",
+ "const":"false"}';
+SELECT JSON_SCHEMA_VALID(@schema_true, 'true');
+SET @schema_true= '{ "type": "boolean",
+ "enum":[true, null, false]}';
+SELECT JSON_SCHEMA_VALID(@schema_true, 'true');
+SET @schema_true= '{ "type": "boolean",
+ "enum": [null, false]}';
+SELECT JSON_SCHEMA_VALID(@schema_true, 'true');
+SET @schema_true= '{ "type": "boolean",
+ "enum": [null, true]}';
+SELECT JSON_SCHEMA_VALID(@schema_true, 'true');
+SET @schema_true= '{ "type": "boolean",
+ "const":"false"}';
+SELECT JSON_SCHEMA_VALID(@schema_true, 'true');
+
+--echo # Type can be more than one
+
+SET @schema= '
+ {
+ "type":["string", "number","array"]
+ }';
+SELECT JSON_SCHEMA_VALID(@schema, '{"key1":"val1"}');
+SELECT JSON_SCHEMA_VALID(@schema, '"abc"');
+SELECT JSON_SCHEMA_VALID(@schema, '3.14');
+
+--echo # Checking number
+
+SET @schema_number= '{
+ "maximum":7,
+ "minimum": 3,
+ "multipleOf":3
+}';
+SELECT JSON_SCHEMA_VALID(@schema_number, '2');
+
+SET @schema_number= '{
+ "type": "number",
+ "maximum":13,
+ "minimum": 4,
+ "multipleOf":3,
+ "exclusiveMaximum": 9,
+ "exclusiveMinimum":4
+}';
+
+SELECT JSON_SCHEMA_VALID(@schema_number, '2');
+SELECT JSON_SCHEMA_VALID(@schema_number, '6');
+SELECT JSON_SCHEMA_VALID(@schema_number, '9');
+SELECT JSON_SCHEMA_VALID(@schema_number, '5');
+
+SET @schema_number= '{
+ "type": "number",
+ "maximum":100,
+ "minimum": 0,
+ "enum": [1, 2, "3", [4, 5, 6], {"key1":"val1"}]
+}';
+SELECT JSON_SCHEMA_VALID(@schema_number, 1);
+SELECT JSON_SCHEMA_VALID(@schema_number, 3);
+
+SET @schema_number= '{
+ "type":"number",
+ "maximum":10,
+ "const":2
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_number, '3');
+SELECT JSON_SCHEMA_VALID(@schema_number, '2');
+
+--echo # Checking string
+
+--echo # checking format keyword. (not validating for now)
+
+SET @schema_string= '{
+ "type": "string",
+ "format":"date-time"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_date-time"');
+SET @schema_string= '{
+ "type": "string",
+ "format":"date"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_date"');
+SET @schema_string= '{
+ "type": "string",
+ "format":"time"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_time"');
+SET @schema_string= '{
+ "type": "string",
+ "format":"duration"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_duration"');
+SET @schema_string= '{
+ "type": "string",
+ "format":"email"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_email"');
+SET @schema_string= '{
+ "type": "string",
+ "format":"idn-email"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_idn-email"');
+SET @schema_string= '{
+ "type": "string",
+ "format":"hostname"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_hostname"');
+SET @schema_string= '{
+ "type": "string",
+ "format":"idn-hostname"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_idn-hostname"');
+SET @schema_string= '{
+ "type": "string",
+ "format":"ipv4"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_ipv4"');
+SET @schema_string= '{
+ "type": "string",
+ "format":"ipv6"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_ipv6"');
+SET @schema_string= '{
+ "type": "string",
+ "format":"uri"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_uri"');
+SET @schema_string= '{
+ "type": "string",
+ "format":"uri-reference"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_uri-reference"');
+SET @schema_string= '{
+ "type": "string",
+ "format":"iri"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_iri"');
+SET @schema_string= '{
+ "type": "string",
+ "format":"iri-reference"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_iri-reference"');
+SET @schema_string= '{
+ "type": "string",
+ "format":"uuid"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_uuid"');
+SET @schema_string= '{
+ "type": "string",
+ "format":"json-pointer"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_json-pointer"');
+SET @schema_string= '{
+ "type": "string",
+ "format":"relative-json-pointer"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_relative-json-pointer"');
+SET @schema_string= '{
+ "type": "string",
+ "format":"regex"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"not_regex"');
+
+--echo # Validating other string keywords
+
+SET @schema_string= '{
+ "type": "string",
+ "maxLength":7,
+ "minLength": 4
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"foobar"');
+
+SET @schema_string= '{
+ "type": "string",
+ "maxLength": 10,
+ "minLength": 8
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"foobar"');
+SELECT JSON_SCHEMA_VALID(@schema_string, '"foobar123"');
+
+SET @schema_string= '{
+ "type": "string",
+ "maxLength": 10,
+ "minLength": 3,
+ "const": "foobar"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"foobar123"');
+
+SET @schema_string= '{
+ "type": "string",
+ "enum": ["red", "green", "blue"]
+}';
+SELECT JSON_SCHEMA_VALID(@schema_string, '"green"');
+SELECT JSON_SCHEMA_VALID(@schema_string, '"orange"');
+
+SET @string_schema= '{
+ "type":"string",
+ "pattern":"ab+c"
+ }';
+SELECT JSON_SCHEMA_VALID(@string_schema, '"abc"');
+
+--echo # Validating non-scalar
+
+--echo # Validating array
+
+SET @schema_array= '{"type":"array"}';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, {"key1":"val1"}]');
+
+
+SET @schema_array= '{"type":"array",
+ "maxItems": 4,
+ "minItems": 2}';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, {"key1":"val1"}]');
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, false, null, "foobar"]');
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1]');
+SET @schema_array= '{"maxItems": 4,
+ "minItems": 2}';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, {"key1":"val1"}]');
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, false, null, "foobar"]');
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2]');
+
+SET @schema_array= '{
+ "type":"array",
+ "items": {"type":"number"},
+ "maxItems": 4,
+ "minItems": 2}';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, 3]');
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, "foobar"]');
+
+SET @schema_array= '{"type":"array",
+ "maxItems": 4,
+ "minItems": 2,
+ "const": [1, 2, 3, 4]}';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, 3, "foobar"]');
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, 3, 4]');
+
+SET @schema_array= '{"type":"array",
+ "enum":[[1,2,3], [4,5,6], [7,8,9]]}';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[4,5,6]');
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1,5,7]');
+
+SET @schema_array= '{
+ "type": "array",
+ "uniqueItems":true
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, 3, 2.0]');
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, 3, 4.0]');
+
+SET @schema_array= '{
+ "type": "array",
+ "contains": {
+ "type": "number"
+ },
+ "minContains": 2,
+ "maxContains": 3
+}';
+SELECT JSON_SCHEMA_VALID(@schema_array, '["string1", "string2", "string3", 1, 2, 3, 4]');
+SELECT JSON_SCHEMA_VALID(@schema_array, '["string1", "string2", "string3", 1, 2, 3]');
+
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ]
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1",2]');
+SELECT JSON_SCHEMA_VALID(@schema_array, '[2, "string1",2]');
+
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "items":true
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1",2]');
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "items":false
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1",2]');
+
+--echo # Checking objects
+
+SET @schema_object= '{"type":"object",
+ "properties":
+ {
+ "number1":{
+ "type":"number",
+ "maximum":12,
+ "minimum":1
+ },
+ "string1": {
+ "type":"string",
+ "maxLength":10,
+ "minLength": 4
+ },
+ "array1": {"type":"array",
+ "maxItems": 4,
+ "minItems": 2}
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_object, '{"number1":10, "string1":"foobar","array1":[1,2,3]}');
+SELECT JSON_SCHEMA_VALID(@schema_object, '{"number1":10, "string1":"foobar","array1":[1,2,3,4,5]}');
+
+SET @schema_obj= '{
+ "type": "object",
+ "properties": {
+ "number1":{"type":"number"},
+ "string1":{"type":"string"},
+ "array1":{"type":"array"}
+ },
+ "dependentRequired": {
+ "number1":["string1"]
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_obj, '{"array1":[1,2,3], "number1":2, "string1":"abc"}');
+SELECT JSON_SCHEMA_VALID(@schema_obj, '{"array1":[1,2,3], "number1":2}');
+
+SET @schema_obj= '{"type":"object",
+ "properties":
+ {
+ "number1":{
+ "type":"number",
+ "maximum":12,
+ "minimum":1
+ },
+ "key1" : {
+ "type":"object",
+ "properties": {
+ "key2" :{
+ "type":"string"
+ }
+ }
+ }
+ },
+ "enum": [{"number1":3, "key1":{"key2":"string1"}}, {"number1":5, "key1":{"key2":"string3"}}, {"number1":7, "key1":{"key2":"string5"}}]
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_obj, '{"number1":5, "key1":{"key2":1}}');
+SELECT JSON_SCHEMA_VALID(@schema_obj, '{"number1":5, "key1":{"key2":"string1"}}');
+SELECT JSON_SCHEMA_VALID(@schema_obj, '{"number1":5, "key1":{"key2":"string7"}}');
+
+SET @schema_obj= '{"type":"object",
+ "properties":
+ {
+ "number1":{
+ "type":"number",
+ "maximum":12,
+ "minimum":1
+ },
+ "obj1" : {
+ "type":"object",
+ "properties": {
+ "obj1_1":{
+ "type":"string"
+ },
+ "obj1_2": {
+ "type":"array"
+ }
+ }
+ },
+ "obj2" : {
+ "type":"object",
+ "properties" : {
+ "obj2_1":{
+ "type":"number"
+ }
+ }
+ }
+ },
+ "required":["number1", "obj2"]
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_obj,'{"number1":5, "obj1":{"obj1_1":"string1", "obj1_2":[1, 2, 3]}}');
+SELECT JSON_SCHEMA_VALID(@schema_obj,'{"number1":5, "obj1":{"obj1_1":"string1", "obj1_2":[1, 2, 3]}, "obj2":{"obj2_1":7}}');
+
+SET @schema_obj= '{"type":"object",
+ "properties":
+ {
+ "number1":{
+ "type":"number",
+ "maximum":12,
+ "minimum":1
+ },
+ "obj1" : {
+ "type":"object",
+ "properties": {
+ "obj1_1":{
+ "type":"string"
+ },
+ "obj1_2": {
+ "type":"array"
+ }
+ }
+ },
+ "obj2" : {
+ "type":"object",
+ "properties" : {
+ "obj2_1":{
+ "type":"number"
+ }
+ }
+ }
+ },
+ "required":["number1", "obj2"],
+ "const": {"number1":5, "obj1":{"obj1_1":"string1", "obj1_2":[1, 2, 3]}, "obj2":{"obj2_1":7}}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_obj,'{"number1":5, "obj1":{"obj1_1":"string1", "obj1_2":[1, 2, 3]}, "obj2":{"obj2_1":7}}');
+SELECT JSON_SCHEMA_VALID(@schema_obj,'{"number1":5, "obj1":{"obj1_1":"string1", "obj1_2":[1, 2, 3]}}');
+
+SET @schema_obj= '{"type":"object",
+ "properties":
+ {
+ "number1":{
+ "type":"number",
+ "maximum":12,
+ "minimum":1
+ },
+ "obj1" : {
+ "type":"object",
+ "properties": {
+ "obj1_1":{
+ "type":"string"
+ },
+ "obj1_2": {
+ "type":"array"
+ }
+ }
+ },
+ "obj2" : {
+ "type":"object",
+ "properties" : {
+ "obj2_1":{
+ "type":"number"
+ }
+ }
+ }
+ },
+ "maxProperties": 5,
+ "minProperties":2
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_obj,'{"number1":5, "obj1":{"obj1_1":"string1", "obj1_2":[1, 2, 3]}, "obj2":{"obj2_1":7}}');
+SELECT JSON_SCHEMA_VALID(@schema_obj,'{"number1":1, "number2":2, "number3":3, "number4":4, "number5":5, "number6":6}');
+
+SET @schema_obj= '{"type":"object",
+ "properties":
+ {
+ "number1":{
+ "type":"number",
+ "maximum":12,
+ "minimum":1
+ },
+ "obj1" : {
+ "type":"object",
+ "properties": {
+ "obj1_1":{
+ "type":"string"
+ },
+ "obj1_2": {
+ "type":"array"
+ }
+ }
+ }
+ },
+ "maxProperties": 3,
+ "minProperties":1,
+ "additionalProperties":false
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_obj,'{"number1":5, "obj1":{"obj1_1":"string1", "obj1_2":[1, 2, 3]}, "obj2":"string2"}');
+
+--echo # Demonstrating that irrelavent keywords for a type and irrelavent type
+--echo # are ignored, and none of the keywords are mandatory, including "type".
+
+SET @schema_properties= '{
+ "properties" : {
+ "number1":{ "maximum":10 },
+ "string1" : { "maxLength": 3}
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_properties, '{ "number1":25, "string1":"ab" }');
+SELECT JSON_SCHEMA_VALID(@schema_properties, '{ "number1":10, "string1":"ab" }');
+
+SET @schema_properties= '{
+ "properties" : {
+ "number1":{ "maximum":10 },
+ "string1" : { "maxLength": 3},
+ "obj1" : {
+ "properties":{
+ "number2": {"minimum":8},
+ "array2": {"uniqueItems":true}
+ }
+ }
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_properties, '{ "number1":2, "string1":"ab", "obj1":{"number2":2, "array2":[1,2,3]} }');
+SELECT JSON_SCHEMA_VALID(@schema_properties, '{ "number1":2, "string1":"ab", "obj1":{"number2":10, "array2":[1,2,3]} }');
+SELECT JSON_SCHEMA_VALID(@schema_properties, '{ "number1":2, "string1":"ab", "obj1":{"array2":[1,2,3]} }');
+SELECT JSON_SCHEMA_VALID(@schema_properties, '{ "number1":2, "string1":"ab", "obj1":{"number2":10, "array2":[1,2,3,2]} }');
+
+SET @schema_num= '{
+ "maximum":10,
+ "minimum":2
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_num, '5');
+SELECT JSON_SCHEMA_VALID(@schema_num, '"abc"');
+
+SET @schema_str= '{
+ "maxLength":5,
+ "minLength":2,
+ "pattern":"a+bc"
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_str, '"abc"');
+SELECT JSON_SCHEMA_VALID(@schema_str, '"abcadef"');
+SELECT JSON_SCHEMA_VALID(@schema_str, '"bc"');
+
+SET @schema_arr= '{
+ "uniqueItems":true,
+ "items":{"type":"string"},
+ "maximum":10
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_arr,'["abc", "bcd", "cde"]');
+SELECT JSON_SCHEMA_VALID(@schema_arr,'["abc", "bcd", "abc"]');
+SELECT JSON_SCHEMA_VALID(@schema_arr,'["abc", "bcd", 1]');
+
+SET @schema_const1= '{"const":2}';
+SELECT JSON_SCHEMA_VALID(@schema_const1, '2');
+SELECT JSON_SCHEMA_VALID(@schema_const1, '"abc"');
+
+SET @schema_const2= '{"const":true}';
+SELECT JSON_SCHEMA_VALID(@schema_const2,'true');
+SELECT JSON_SCHEMA_VALID(@schema_const2,'false');
+
+SET @schema_enum='{"enum":[1,2,3,"abc", [4,5,6]]}';
+SELECT JSON_SCHEMA_VALID(@schema_enum,'[4,5,6]');
+SELECT JSON_SCHEMA_VALID(@schema_enum,'4');
+SELECT JSON_SCHEMA_VALID(@schema_enum,'"abc"');
+
+SET @schema_required='{"required":["num1","str1", "arr1"]}';
+SELECT JSON_SCHEMA_VALID(@schema_required,'{"num1":1, "str1":"abc", "arr1":[1,2,3]}');
+SELECT JSON_SCHEMA_VALID(@schema_required,'{"num1":1, "arr1":[1,2,3]}');
+SELECT JSON_SCHEMA_VALID(@schema_required,'"abcd"');
+
+SET @schema_dep_required='{
+ "dependentRequired": {
+ "num1":["num2","num3"],
+ "str1":["str2","str3"]
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_dep_required,'{"num1":1, "num2":"abc", "num3":[1,2,3]}');
+SELECT JSON_SCHEMA_VALID(@schema_dep_required,'{"num1":1, "num2":"abc", "num3":[1,2,3], "str1":"abcd"}');
+SELECT JSON_SCHEMA_VALID(@schema_dep_required,'{"num1":1, "num2":"abc", "num3":[1,2,3], "arr1":[1,2,3]}');
+
+--echo # Checking syntax error
+SET @invalid_schema= '{"type":"object"
+ "properties":{
+ "number1": {"type":"number"},
+ "obj2": {"type":"object",
+ "properties": {
+ "key1": {"type":"number"}
+ }
+ }
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@invalid_schema, '{"number1":3, "obj2":{"key1":3}}');
+
+SET @invalid_json= '{"type":"array",
+ "maxItems": 4,
+ "minItems": 2,
+ "const": [1, 2, 3, 4]}';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, 3, 4');
+
+SET @schema_string= '{
+ "type": "string",
+ "maxLength":-2
+ }';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema_string, '"abcxyz"');
+
+SET @schema_number= '{
+ "type": "number",
+ "multipleOf":-3
+ }';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema_number, '3');
+
+SET @schema_object= '{
+ "type": "object",
+ "properties":{"num1":{"type":"number"}},
+ "required":{}
+ }';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema_object, '{"num1":2}');
+
+SET @schema_string= '{
+ "type": "string",
+ "maxLength":-10
+ }';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema_string, '"str1"');
+
+SET @schema_number= '{"type":"numberz"}';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema_number, '"string1"');
+
+--echo # Using JSON_SCHEMA_VALID() as a constraint validation to insert into table
+
+CREATE TABLE str_table (val_str JSON CHECK(JSON_SCHEMA_VALID('{
+ "type":"string",
+ "maxLength":5,
+ "minLength":2,
+ "enum":["ab", "cd", "abc", "def", "abcdef"]
+ }', val_str)));
+CREATE TABLE num_table(val_num JSON CHECK(JSON_SCHEMA_VALID('{
+ "type":"number",
+ "minimum":10,
+ "maximum":30,
+ "exclusiveMinimum":11,
+ "exclusiveMaximum":29,
+ "multipleOf":5,
+ "const":15
+ }', val_num)));
+CREATE TABLE true_table(val_true JSON CHECK(JSON_SCHEMA_VALID('{
+ "type":"boolean",
+ "enum":[true, false, null]
+ }', val_true)));
+CREATE TABLE false_table (val_false JSON CHECK(JSON_SCHEMA_VALID('{
+ "type":"boolean"
+ }', val_false)));
+CREATE TABLE null_table (val_null JSON CHECK(JSON_SCHEMA_VALID('{
+ "type":"null"
+ }', val_null)));
+CREATE TABLE arr_table (val_arr JSON CHECK(JSON_SCHEMA_VALID('{
+ "type":"array",
+ "uniqueItems":true,
+ "maxItems":5,
+ "minItems":1,
+ "items":true,
+ "prefixItems":[{"type":"number"}]
+ }', val_arr)));
+CREATE TABLE obj_table(val_obj JSON CHECK(JSON_SCHEMA_VALID('{
+ "type":"object",
+ "properties": {
+ "number1":{
+ "type":"number",
+ "maximum":5,
+ "const":4
+ },
+ "string1":{
+ "type":"string",
+ "maxLength":5,
+ "minLength":3
+ },
+ "object1":{
+ "type":"object",
+ "properties":{
+ "key1": {"type":"string"},
+ "key2":{"type":"array"},
+ "key3":{"type":"number", "minimum":3}
+ },
+ "dependentRequired": { "key1":["key3"] }
+ }
+ },
+ "required":["number1","object1"]
+ }', val_obj)));
+
+INSERT INTO str_table VALUES ('"ab"'), ('"cd"'), ('"abc"'), ('"def"');
+--error ER_CONSTRAINT_FAILED
+INSERT INTO str_table VALUES ('"feb"');
+--error ER_CONSTRAINT_FAILED
+INSERT INTO str_table VALUES('"abcdef"');
+--error ER_CONSTRAINT_FAILED
+INSERT INTO str_table VALUES('"fedcba"');
+SELECT * FROM str_table;
+
+
+INSERT INTO num_table values('15');
+--error ER_CONSTRAINT_FAILED
+INSERT INTO num_table values('25');
+SELECT * FROM num_table;
+
+INSERT INTO true_table VALUES ('true');
+SELECT * FROM true_table;
+
+INSERT INTO false_table VALUES('false');
+SELECT * FROM false_table;
+
+INSERT INTO arr_table VALUES ('[10, 2, "abc"]');
+INSERT INTO arr_table VALUES('[100]');
+--error ER_CONSTRAINT_FAILED
+INSERT INTO arr_table VALUES ('["str1", 2, "abc", 2.0]');
+SELECT * FROM arr_table;
+
+INSERT INTO obj_table VALUES('{"number1":4, "string1":"abcd", "object1":{"key1":"val1", "key2":[1,2,3, "string1"], "key3":4}}');
+--error ER_CONSTRAINT_FAILED
+INSERT INTO obj_table VALUES('{"number1":3, "string1":"abcd", "object1":{"key1":"val1", "key2":[1,2,3, "string1"], "key3":4}}');
+--error ER_CONSTRAINT_FAILED
+INSERT INTO obj_table VALUES('{"number1":3, "string1":"abcd"}');
+--error ER_CONSTRAINT_FAILED
+INSERT INTO obj_table VALUES('{"number1":3, "string1":"abcd", "object1":{"key1":"val1", "key2":[1,2,3, "string1"]}');
+SELECT * FROM obj_table;
+
+DROP TABLE str_table, num_table, true_table, false_table, null_table, arr_table, obj_table;
+
+--echo # array validation
+
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "additionalItems" : {"type":"number"},
+ "unevaluatedItems": {"type":"string"},
+ "items":{"type":"array"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", [1,2], "2", "string"]');
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", "2", "string"]');
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", [1,2], [1,2]]');
+
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "additionalItems" : {"type":"number"},
+ "unevaluatedItems": {"type":"string"},
+ "items": true
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", [1,2], "2", "string"]');
+
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "additionalItems" : {"type":"number"},
+ "unevaluatedItems": {"type":"string"},
+ "items": false
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", [1,2], "2", "string"]');
+
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "additionalItems" : {"type":"number"},
+ "unevaluatedItems": {"type":"string"},
+ "items": [{"type":"string"}]
+ }';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", [1,2], "2", "string"]');
+
+--echo # Removing items
+
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "additionalItems" : {"type":"number"},
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", [1,2], "2", "string"]');
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", 1, 2, 3]');
+
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "additionalItems" : true,
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", 1, 2, 3]');
+
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "additionalItems" : false,
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", 1, 2, 3]');
+
+--echo # Using items in place of additionalItems
+
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "items" : false,
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", 1, 2, 3]');
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "items" : true,
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", 1, 2, 3]');
+
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "items" : {"type":"number"},
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", 1, 2, 3]');
+
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "items" : {"type":"number"},
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", "string2", "string3"]');
+
+--echo # Removing items and additionalItems both
+
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "unevaluatedItems": {"type":"number"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", "string2", "string3"]');
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", 1, 2]');
+
+
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "unevaluatedItems": true
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", "string2", "string3"]');
+
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ],
+ "unevaluatedItems": false
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", "string2", "string3"]');
+
+--echo # Removing items, additionalItems, unevaluatedItems
+
+SET @schema_array= '{
+ "type": "array",
+ "prefixItems": [
+ { "type": "number", "maximum": 10, "minimum":3},
+ { "type": "string" }
+ ]
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, "string1", "string2", "string3"]');
+
+
+--echo # Removing prefixItems
+
+
+SET @schema_array= '{
+ "type": "array",
+ "items": { "type": "number", "maximum": 10, "minimum":3},
+ "additionalItems" : {"type":"number"},
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, 6,"2", "string"]');
+
+
+SET @schema_array= '{
+ "type": "array",
+ "items": { "type": "number", "maximum": 10, "minimum":3},
+ "additionalItems" : {"type":"string"},
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, 6,"2", "string"]');
+
+SET @schema_array= '{
+ "type": "array",
+ "items": true,
+ "additionalItems" : {"type":"string"},
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, 6,"2", "string"]');
+
+SET @schema_array= '{
+ "type": "array",
+ "items": false,
+ "additionalItems" : {"type":"string"},
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[5, 6,"2", "string"]');
+SELECT JSON_SCHEMA_VALID(@schema_array, '[]');
+
+--echo # Removing prefixItems and additionalItems
+
+SET @schema_array= '{
+ "type": "array",
+ "items": {"type":"string"},
+ "unevaluatedItems": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '["str1", "str2", 2]');
+SELECT JSON_SCHEMA_VALID(@schema_array, '["str1", "str2"]');
+
+SET @schema_array= '{
+ "type": "array",
+ "items": {"type":"string"},
+ "unevaluatedItems": {"type":"number"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '["str1", "str2", 2]');
+
+--echo # removing prefixItems, additionalItems and unevaluatedItems
+
+SET @schema_array= '{
+ "type": "array",
+ "items": {"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '["str1", "str2", 2]');
+SELECT JSON_SCHEMA_VALID(@schema_array, '["str1", "str2"]');
+
+--echo # Checking that additionalItems alone has no effect on schema without items/prefixItems
+--echo # regardless existence of unevaluatedItems
+
+SET @schema_array= '{
+ "type": "array",
+ "additionalItems": {"type":"string"},
+ "unevaluatedItems": {"type":"number"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '["str1", "str2", 1]');
+
+SET @schema_array= '{
+ "type": "array",
+ "additionalItems": true,
+ "unevaluatedItems": {"type":"number"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '["str1", "str2", 1]');
+
+SET @schema_array= '{
+ "type": "array",
+ "additionalItems": false,
+ "unevaluatedItems": {"type":"number"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '["str1", "str2", 1]');
+
+
+--echo # checking that unevaluatedItems alone can have effect on schema validation
+
+SET @schema_array= '{
+ "type": "array",
+ "unevaluatedItems": {"type":"number"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1]');
+
+SET @schema_array= '{
+ "type": "array",
+ "unevaluatedItems": {"type":"number"}
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, "str1"]');
+
+SET @schema_array= '{
+ "type": "array",
+ "unevaluatedItems": false
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, "str1"]');
+SELECT JSON_SCHEMA_VALID(@schema_array, '[]');
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1,2,3]');
+
+
+--echo # Object validation
+
+SET @property_names= '{
+ "PropertyNames":{
+ "pattern": "^I_"
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@property_names, '{"I_int1":3, "O_ob1":{"key1":"val1"}}');
+SELECT JSON_SCHEMA_VALID(@property_names, '{"I_int1":3, "I_ob1":{"key1":"val1"}}');
+
+--echo # checking that when a match is found in properties or patternProperties, it must validate and
+--echo # validation result affects the schema. If key is not found in properties or patternProperties, and
+--echo # additionalProperties exists, it must validate regardless of existence or value for unevaluatedProperties
+--echo # and the result of validation with additionalProperties affects result of whole schema
+
+SET @object_schema= '{
+ "type":"object",
+ "properties": {
+ "key1":{"type":"string"},
+ "key2":{"type":"number", "maximum":50}
+ },
+ "patternProperties": {
+ "^I_": {"type":"number", "maximum":100},
+ "^S_" : {"type":"string", "maxLength":4}
+ },
+ "additionalProperties":{
+ "type":"array",
+ "maxItems":5
+ },
+ "unevaluatedProperties":{"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": [1,2,3], "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":[1,2,3], "S_":"abc", "some_prop1":[1,2,3]}');
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":"string1"}');
+
+--echo # removing patternProperties to check that validation falls back on additionalProperties and
+--echo # existence of unevaluatedProperties still does not change anything because of existence of additional
+--echo # properties
+
+
+SET @object_schema= '{
+ "type":"object",
+ "properties": {
+ "key1":{"type":"string"},
+ "key2":{"type":"number", "maximum":50}
+ },
+ "additionalProperties":{
+ "type":"array",
+ "maxItems":5
+ },
+ "unevaluatedProperties":{"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":[1,2,3], "S_":[1,2,3], "some_prop1":[1,2,3]}');
+
+--echo # Remvoing additionalProperties to check that validation falls back on unevaluatedProperties
+
+SET @object_schema= '{
+ "type":"object",
+ "properties": {
+ "key1":{"type":"string"},
+ "key2":{"type":"number", "maximum":50}
+ },
+ "patternProperties": {
+ "^I_": {"type":"number", "maximum":100},
+ "^S_" : {"type":"string", "maxLength":4}
+ },
+ "unevaluatedProperties":{"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":10, "S_":"abc", "some_prop1":[1,2,3]}');
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":10, "S_":"abc", "some_prop1":"str"}');
+
+--echo # Removing unevaluatedProperties has no effect on result when additionalProperties is present
+
+SET @object_schema= '{
+ "type":"object",
+ "properties": {
+ "key1":{"type":"string"},
+ "key2":{"type":"number", "maximum":50}
+ },
+ "patternProperties": {
+ "^I_": {"type":"number", "maximum":100},
+ "^S_" : {"type":"string", "maxLength":4}
+ },
+ "additionalProperties":{
+ "type":"array",
+ "maxItems":5
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":"str1"}');
+
+SET @object_schema= '{
+ "type":"object",
+ "properties": {
+ "key1":{"type":"string"},
+ "key2":{"type":"number", "maximum":50}
+ },
+ "patternProperties": {
+ "^I_": {"type":"number", "maximum":100},
+ "^S_" : {"type":"string", "maxLength":4}
+ },
+ "additionalProperties": false
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+
+SET @object_schema= '{
+ "type":"object",
+ "properties": {
+ "key1":{"type":"string"},
+ "key2":{"type":"number", "maximum":50}
+ },
+ "patternProperties": {
+ "^I_": {"type":"number", "maximum":100},
+ "^S_" : {"type":"string", "maxLength":4}
+ },
+ "additionalProperties": true
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+
+
+--echo # Checking that in absence of additionalProperties, validation falls back on evaluatedProperties
+
+SET @object_schema= '{
+ "type":"object",
+ "properties": {
+ "key1":{"type":"string"},
+ "key2":{"type":"number", "maximum":50}
+ },
+ "patternProperties": {
+ "^I_": {"type":"number", "maximum":100},
+ "^S_" : {"type":"string", "maxLength":4}
+ },
+ "unevaluatedProperties":{"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 3, "I_int":20, "S_":"abc", "some_prop1":"str1"}');
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 3, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+
+SET @object_schema= '{
+ "type":"object",
+ "properties": {
+ "key1":{"type":"string"},
+ "key2":{"type":"number", "maximum":50}
+ },
+ "unevaluatedProperties":{"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 3, "I_int":"str2", "S_":"abc", "some_prop1":[1,2,3]}');
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 3, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+
+--echo # Properties to check if patternProperties get evaluated but keys not found in patternProperties get evaluated against
+--echo # additionalProperties regardless of existence of unevaluatedProperperties
+
+SET @object_schema= '{
+ "type":"object",
+ "patternProperties": {
+ "^I_": {"type":"number", "maximum":100},
+ "^S_" : {"type":"string", "maxLength":4}
+ },
+ "additionalProperties":{
+ "type":"array",
+ "maxItems":5
+ },
+ "unevaluatedProperties":{"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":[1, 2, 3], "key2": [1, 2, 3], "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+
+SET @object_schema= '{
+ "type":"object",
+ "patternProperties": {
+ "^I_": {"type":"number", "maximum":100},
+ "^S_" : {"type":"string", "maxLength":4}
+ },
+ "additionalProperties":{
+ "type":"array",
+ "maxItems":5
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":[1, 2, 3], "key2": [1, 2, 3], "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+
+--echo # Checking that in absence of additionalProperties and properties, the keys not found in patternProperties are
+--echo # evaluated against unevaluatedProperties
+SET @object_schema= '{
+ "type":"object",
+ "patternProperties": {
+ "^I_": {"type":"number", "maximum":100},
+ "^S_" : {"type":"string", "maxLength":4}
+ },
+ "unevaluatedProperties":{"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": "str2", "I_int":20, "S_":"abc", "some_prop1":"str1"}');
+
+--echo # checking that in absence of properties, additionalProperties and unevaluatedPropoerties, the keys that are
+--echo # not found are considered validated.
+
+SET @object_schema= '{
+ "type":"object",
+ "patternProperties": {
+ "^I_": {"type":"number", "maximum":100},
+ "^S_" : {"type":"string", "maxLength":4}
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+
+--echo # checking that additionalProperties are evaluated in absence of patternProperties and properties, regardless
+--echo # of presence of unevaluatedProperties
+
+SET @object_schema= '{
+ "type":"object",
+ "additionalProperties":{
+ "type":"array",
+ "maxItems":5
+ },
+ "unevaluatedProperties":{"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":[1,2,3], "key2": [1,2,3], "I_int":[1,2,3], "S_":[1,2,3], "some_prop1":[1,2,3]}');
+
+SET @object_schema= '{
+ "type":"object",
+ "additionalProperties":{
+ "type":"array",
+ "maxItems":5
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": 10, "I_int":20, "S_":"abc", "some_prop1":[1,2,3]}');
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":[1,2,3], "key2": [1,2,3], "I_int":[1,2,3], "S_":[1,2,3], "some_prop1":[1,2,3]}');
+
+--echo # Checking that in absence of properties, patternProperties and additionalProperties, validation falls back on unevaluatedProperties
+
+SET @object_schema= '{
+ "type":"object",
+ "unevaluatedProperties":{"type":"string"}
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": "str1", "I_int":"str2", "S_":"abc", "some_prop1":"str3"}');
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":[1,2,3], "key2": [1,2,3], "I_int":[1,2,3], "S_":[1,2,3], "some_prop1":[1,2,3]}');
+
+SET @object_schema= '{
+ "type":"object",
+ "unevaluatedProperties": false
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": "str1", "I_int":"str2", "S_":"abc", "some_prop1":"str3"}');
+SELECT JSON_SCHEMA_VALID(@object_schema, '{}');
+
+SET @object_schema= '{
+ "type":"object",
+ "unevaluatedProperties": true
+ }';
+SELECT JSON_SCHEMA_VALID(@object_schema, '{"key1":"val1", "key2": "str1", "I_int":"str2", "S_":"abc", "some_prop1":"str3"}');
+SELECT JSON_SCHEMA_VALID(@object_schema, '{}');
+
+SET @json_schema_dependent_schemas='{
+ "type": "object",
+ "properties": {
+ "str1": { "type": "string" },
+ "num1": { "type": "number" }
+ },
+
+ "required": ["str1"],
+
+ "dependentSchemas": {
+ "num1": {
+ "properties": {
+ "str2": { "type": "string" }
+ },
+ "required": ["str2"]
+ }
+ }
+}';
+SELECT JSON_SCHEMA_VALID(@json_schema_dependent_schemas, '{ "str1": "str", "num1":4}');
+SELECT JSON_SCHEMA_VALID(@json_schema_dependent_schemas, '{ "str1": "str"}');
+
+--echo # Validating logic
+
+SET @not_schema= '{
+ "not":{
+ "maximum": 4
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@not_schema, '{"I_int1":3, "O_ob1":{"key1":"val1"}}');
+SELECT JSON_SCHEMA_VALID(@not_schema, '3');
+SELECT JSON_SCHEMA_VALID(@not_schema, '10');
+
+SET @not_schema= '{
+ "not":{
+ "properties": {
+ "num1" : {"type":"number", "maximum":5},
+ "string1" : { "maxLength": 3}
+ }
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@not_schema, '{"num1":10, "string2":"abcd"}');
+SELECT JSON_SCHEMA_VALID(@not_schema, '{"num1":2, "string2":"abcd"}');
+
+SET @any_of_schema= '{
+ "anyOf":[{
+ "properties": {
+ "num1" : {"type":"number", "maximum":5},
+ "string1" : { "maxLength": 3}
+ }
+ },
+ {
+ "properties":{
+ "num1" : {"type":"number", "maximum": 1},
+ "string1" : { "maxLength":5}
+ }
+ }
+ ]
+ }';
+SELECT JSON_SCHEMA_VALID(@any_of_schema, '{"num1":2, "string1":"abcd"}');
+SELECT JSON_SCHEMA_VALID(@any_of_schema, '{"num1":2, "string1":"abc"}');
+
+SET @any_of_schema= '{
+ "anyOf": [
+ {"type":"number", "maximum":5},
+ {"type":"string"}
+ ]
+ }';
+SELECT JSON_SCHEMA_VALID(@any_of_schema, '2');
+SELECT JSON_SCHEMA_VALID(@any_of_schema, '6');
+SELECT JSON_SCHEMA_VALID(@any_of_schema, '[1, 2, 3]');
+
+SET @one_of_schema= '{
+ "oneOf":[{
+ "properties": {
+ "num1" : {"type":"number", "maximum":5},
+ "string1" : { "maxLength": 3}
+ }
+ },
+ {
+ "properties":{
+ "num1" : {"type":"number", "maximum": 1},
+ "string1" : { "maxLength":5}
+ }
+ }
+ ]
+ }';
+SELECT JSON_SCHEMA_VALID(@one_of_schema, '{"num1":2, "string1":"abcd"}');
+SELECT JSON_SCHEMA_VALID(@one_of_schema, '{"num1":2, "string1":"abc"}');
+
+SET @one_of_schema= '{
+ "oneOf": [
+ {"type":"number", "maximum":5},
+ {"type":"number", "maximum":3}
+ ]
+ }';
+SELECT JSON_SCHEMA_VALID(@one_of_schema, '2');
+SELECT JSON_SCHEMA_VALID(@one_of_schema, '4');
+
+SET @all_of_schema= '{
+ "allOf":[{
+ "properties": {
+ "num1" : {"type":"number", "maximum":5},
+ "string1" : { "maxLength": 3}
+ }
+ },
+ {
+ "properties":{
+ "num1" : {"type":"number", "maximum": 1},
+ "string1" : { "maxLength":5}
+ }
+ }
+ ]
+ }';
+SELECT JSON_SCHEMA_VALID(@all_of_schema, '{"num1":2, "string1":"abcd"}');
+
+SET @all_of_schema= '{
+ "allOf":[
+ {
+ "properties":{
+ "num1": {"type":"number"},
+ "string1": {"type":"string"}
+ }
+ },
+ {
+ "properties":{
+ "num1": {"maximum":10},
+ "string1": {"maxLength":5}
+ }
+ }
+ ]
+ }';
+SELECT JSON_SCHEMA_VALID(@all_of_schema, '{"num1":5, "string1":"abc"}');
+SELECT JSON_SCHEMA_VALID(@all_of_schema, '{"num1":5, "string1":"foobar"}');
+
+SET @condition_schema= '{
+ "if" : {"maximum":30, "multipleOf":3},
+ "then":{"minimum":5},
+ "else":{"minimum":10}
+ }';
+SELECT JSON_SCHEMA_VALID(@condition_schema, '6');
+SELECT JSON_SCHEMA_VALID(@condition_schema, '4');
+SELECT JSON_SCHEMA_VALID(@condition_schema, '13');
+
+SET @condition_schema= '{
+ "if" : {"maximum":30, "multipleOf":3}
+ }';
+SELECT JSON_SCHEMA_VALID(@condition_schema, '6');
+SELECT JSON_SCHEMA_VALID(@condition_schema, '7');
+
+SET @condition_schema= '{
+ "then":{"minimum":5},
+ "else":{"minimum":10}
+ }';
+SELECT JSON_SCHEMA_VALID(@condition_schema, '4');
+SELECT JSON_SCHEMA_VALID(@condition_schema, '11');
+
+--echo # Checking unevaluatedProperperties with logical properties
+
+SET @all_of_unevaluated='{
+ "allOf": [
+ {
+ "type": "object",
+ "properties": {
+ "street_address": { "type": "string" },
+ "city": { "type": "string" },
+ "state": { "type": "string" }
+ },
+ "required": ["street_address", "city", "state"]
+ }
+ ],
+
+ "properties": {
+ "type": { "enum": ["residential", "business"] }
+ },
+ "required": ["type"],
+ "unevaluatedProperties": false
+}';
+SELECT JSON_SCHEMA_VALID(@all_of_unevaluated, '{
+ "street_address": "1600 Pennsylvania Avenue NW",
+ "city": "Washington",
+ "state": "DC",
+ "type": "business"
+}');
+
+SET @all_of_unevaluated='{
+ "allOf": [
+ {
+ "type": "object",
+ "properties": {
+ "street_address": { "type": "string" },
+ "city": { "type": "string" },
+ "state": { "type": "string" }
+ },
+ "required": ["street_address", "city", "state"]
+ }
+ ],
+
+ "unevaluatedProperties": {"type":"number"}
+}';
+SELECT JSON_SCHEMA_VALID(@all_of_unevaluated, '{
+ "street_address": "1600 Pennsylvania Avenue NW",
+ "city": "Washington",
+ "state": "DC",
+ "type": "business"
+}');
+
+SET @any_of_unevaluated='{
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "street_address": { "type": "string" },
+ "city": { "type": "string" },
+ "state": { "type": "string" }
+ },
+ "required": ["street_address", "city", "state"]
+ }
+ ],
+
+ "unevaluatedProperties": {"type":"number"}
+}';
+SELECT JSON_SCHEMA_VALID(@any_of_unevaluated, '{
+ "street_address": "1600 Pennsylvania Avenue NW",
+ "city": "Washington",
+ "state": "DC",
+ "type": "business"
+}');
+
+SET @all_of_unevaluated='{
+ "allOf": [
+ {
+ "type": "array"
+ },
+ {
+ "maxItems":10
+ },
+ {
+ "prefixItems": [ {"type":"number"}, {"type":"string"}],
+ "additionalItems":{"type":"array"}
+ }
+ ],
+
+ "unevaluatedItems": {"type":"number"}
+}';
+SELECT JSON_SCHEMA_VALID(@all_of_unevaluated, '[1, "str", 2]');
+
+SET @all_of_unevaluated='{
+ "anyOf": [
+ {
+ "type": "array"
+ },
+ {
+ "maxItems":10
+ },
+ {
+ "prefixItems": [ {"type":"number"}, {"type":"string"}],
+ "additionalItems":{"type":"array"}
+ }
+ ],
+
+ "unevaluatedItems": {"type":"number"}
+}';
+SELECT JSON_SCHEMA_VALID(@all_of_unevaluated, '[1, "str", 2]');
+
+SET @all_of_unevaluated='{
+ "oneOf": [
+ {
+ "type": "array"
+ },
+ {
+ "maxItems":10
+ },
+ {
+ "prefixItems": [ {"type":"number"}, {"type":"string"}],
+ "additionalItems":{"type":"array"}
+ }
+ ],
+
+ "unevaluatedItems": {"type":"number"}
+}';
+SELECT JSON_SCHEMA_VALID(@all_of_unevaluated, '[1, "str", 2]');
+
+--echo # Media string
+
+SET @schema_media_string= '{
+ "type": "string",
+ "contentMediaType": "text/html"
+}';
+SELECT JSON_SCHEMA_VALID(@schema_media_string, '"str1"');
+
+SET @schema_reference= '{"$ref": "http://example.com/custom-email-validator.json#"}';
+--error ER_JSON_SCHEMA_KEYWORD_UNSUPPORTED
+SELECT JSON_SCHEMA_VALID(@schema_reference, '{}');
+
+SET @schema_reference= '{"$id": "http://example.com/custom-email-validator.json#"}';
+--error ER_JSON_SCHEMA_KEYWORD_UNSUPPORTED
+SELECT JSON_SCHEMA_VALID(@schema_reference, '{}');
+
+SET @schema_reference= '{"$anchor": "http://example.com/custom-email-validator.json#"}';
+--error ER_JSON_SCHEMA_KEYWORD_UNSUPPORTED
+SELECT JSON_SCHEMA_VALID(@schema_reference, '{}');
+
+SET @schema_reference= '{"$defs": "http://example.com/custom-email-validator.json#"}';
+--error ER_JSON_SCHEMA_KEYWORD_UNSUPPORTED
+SELECT JSON_SCHEMA_VALID(@schema_reference, '{}');
+
+
+
+--echo #
+--echo # MDEV-30795: JSON_SCHEMA_VALID bugs mentioned in comment
+--echo #
+SET @schema= '{
+ "type":"array",
+ "uniqueItems":true
+ }';
+SELECT JSON_SCHEMA_VALID(@schema, '[null, null]');
+
+SET @schema_max_items= '{"maxItems":-1}';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema_max_items, '[]');
+
+SET @schema_min_items= '{"minItems":-1}';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema_min_items, '[]');
+
+SET @schema_max_properties= '{"maxProperties":-1}';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema_max_properties, '{}');
+
+SET @schema_min_properties= '{"minProperties":-1}';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema_min_properties, '{}');
+
+SET @schema_multiple_of= '{"multipleOf":-1}';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema_multiple_of, '2');
+
+SET @schema_max_contains= '{"maxContains":-1}';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema_max_contains, '[]');
+
+SET @schema_min_contains= '{"minContains":-1}';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema_min_contains, '[]');
+
+SET @schema_required='{"type":"object","required":[1,"str1", "str1"]}';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema_required,'{"num1":1, "str1":"abc", "arr1":[1,2,3]}');
+
+--echo #
+--echo # MDEV-30977: Additional key values are not validating properly when using
+--echo # unevaluatedProperties with properties declared in subschemas
+--echo #
+
+SET @unevaluatedProperties_schema= '{
+ "allOf": [
+ {
+ "type": "object",
+ "properties": {
+ "name": { "type": "string" }
+ }
+ }
+ ],
+ "properties": {
+ "type": { "enum": ["residential", "business"] }
+ },
+ "required": ["type"],
+ "unevaluatedProperties": false
+}';
+SELECT JSON_SCHEMA_VALID(@unevaluatedProperties_schema, '{"name": "joe", "type": "business", "dummy" : "hello" }');
+
+--echo #
+--echo # MDEV-30995: JSON_SCHEMA_VALID is not validating case sensitive when using regex
+--echo #
+
+SET @schema_pattern='{
+ "type": "string",
+ "pattern": "[A-Z]"
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_pattern, '"a"');
+
+SET @schema_property_names='{
+ "PropertyNames":{
+ "pattern": "^I_"
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_property_names, '{"I_num":4}');
+SELECT JSON_SCHEMA_VALID(@schema_property_names, '{"i_num":4}');
+
+SET @schema_pattern_properties= '{
+ "patternProperties": {
+ "^I_": {"type":"number", "maximum":100},
+ "^S_" : {"type":"string", "maxLength":4}
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@schema_pattern_properties, '{"I_": 50}');
+SELECT JSON_SCHEMA_VALID(@schema_pattern_properties, '{"I_": 150}');
+SELECT JSON_SCHEMA_VALID(@schema_pattern_properties, '{"i_": 50}');
+SELECT JSON_SCHEMA_VALID(@schema_pattern_properties, '{"i_": 150}');
+
+--echo #
+--echo # MDEV-30690: Server crashed on function JSON_SCHEMA_VALID with incorrect input json schema
+--echo #
+
+SET @schema = '{""}';
+SELECT JSON_SCHEMA_VALID(@schema, '1');
+
+SET @schema = '{
+ "type": "string",
+ "format"
+ }';
+SELECT JSON_SCHEMA_VALID(@schema, '1');
+
+SET @invalid_schema= '{"type":"object"
+ "properties":{
+ "number1": {"type":"number"},
+ "obj2": {"type":"object",
+ "properties": {
+ "key1": {"type":"number"}
+ }
+ }
+ }
+ }';
+SELECT JSON_SCHEMA_VALID(@invalid_schema, '{"number1":3, "obj2":{"key1":3}}');
+
+--echo #
+--echo # MDEV-30703: JSON_SCHEMA_VALID : Enum array must have at least one value
+--echo #
+
+SET @schema = '{
+ "type":"array",
+ "enum": []
+ }';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema, '2');
+
+SET @schema = '{
+ "type":"number",
+ "enum": [2, 2]
+ }';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema, '2');
+
+
+--echo #
+--echo # MDEV-30704: JSON_SCHEMA_VALID: multipleOf must be greater than zero
+--echo #
+
+SET @schema = '{
+ "multipleOf": 0
+ }';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema, '2');
+
+SET @schema= '{ "maxLength" : -3}';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema, '2');
+
+SET @schema= '{ "minLength" : -3}';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema, '2');
+
+SET @schema= '{ "maxProperties" : -3}';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema, '2');
+
+SET @schema= '{ "minProperties" : -3}';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema, '2');
+
+SET @schema= '{ "maxItems" : -3}';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema, '2');
+
+SET @schema= '{ "minItems" : -3}';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema, '2');
+
+SET @schema= '{ "items" : ["str1"]}';
+--error ER_JSON_INVALID_VALUE_FOR_KEYWORD
+SELECT JSON_SCHEMA_VALID(@schema, '[]');
+
+
+--echo #
+--echo # MDEV-30705: JSON_SCHEMA_VALID: schema with multipleOf for big value always return 1
+--echo #
+SET @schema = '{
+ "multipleOf": 2
+ }';
+SELECT JSON_SCHEMA_VALID(@schema, '9007900000000001');
+SELECT JSON_SCHEMA_VALID(@schema, '9007900000000060');
+SELECT JSON_SCHEMA_VALID(@schema, '9007900000000061');
+
+--echo #
+--echo # MDEV-31032: UBSAN|downcast of address X which does not point to an object of type
+--echo # Item_string' in sql/json_schema.cc
+--echo #
+
+SET @old_sql_mode= @@sql_mode;
+
+SET @schema='{ "type":"object","patternProperties": { "^I_": {"type":"number"},"^S_" : {"type":"string"} } }';
+SET SESSION sql_mode='empty_string_is_null';
+SELECT JSON_SCHEMA_VALID (@schema,'{"key1":"val0","key2":0,"I_int":0,"S_":"abc","prop0":"str0"}');
+
+SET @@sql_mode= @old_sql_mode;
+
+SET @property_names='{ "PropertyNames":{ "pattern": "^I_" } }';
+SET GLOBAL sql_mode=17179869183;
+SET @@sql_mode=DEFAULT;
+SELECT JSON_SCHEMA_VALID(@property_names, '{"I_int1":3, "I_ob1":{"key1":"val1"}}');
+
+SET @@sql_mode= @old_sql_mode;
+set global sql_mode=default;
+
+--echo #
+--echo # MDEV-30287: JSON_SCHEMA_VALID returns incorrect result for type=number
+--echo #
+
+SET @schema= '{"type":"number"}';
+
+SELECT JSON_SCHEMA_VALID(@schema, '3.14');
+SELECT JSON_SCHEMA_VALID(@schema, '0zzzz');
+SELECT JSON_SCHEMA_VALID(@schema, '-#');
+
+--echo #
+--echo # MDEV-30689: JSON_SCHEMA_VALID for type=array return 1 for any string that starts with '['
+--echo #
+
+
+SET @schema_array= '{"type":"array"}';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[');
+
+--disable_view_protocol
+SELECT JSON_SCHEMA_VALID(repeat('[', 100000), json_object());
+--enable_view_protocol
+
+SELECT JSON_SCHEMA_VALID(json_object(), repeat('[', 10000000));
+
+--echo #
+--echo # MDEV-30677: Incorrect result for "SELECT JSON_SCHEMA_VALID('{}', NULL)"
+--echo #
+SELECT JSON_SCHEMA_VALID('{}', NULL);
+SELECT JSON_SCHEMA_VALID(NULL, '{}');
+SELECT JSON_SCHEMA_VALID(NULL, NULL);
+
+--echo #
+--echo # MDEV-31599: Assertion `0' failed in Item_param::can_return_value from Item::val_json,
+--echo # UBSAN: member access within null pointer of type 'struct String' in
+--echo # sql/item_jsonfunc.cc
+--echo #
+
+--error ER_JSON_NO_VARIABLE_SCHEMA
+PREPARE s FROM 'SELECT JSON_SCHEMA_VALID (?,''{}'') FROM DUAL';
+
+--echo #
+--echo # MDEV-33015: Server crashes upon JSON_SCHEMA_VALID reading NULL from a user variable
+--echo #
+
+SET @a= NULL;
+SELECT JSON_SCHEMA_VALID(@a,'{}');
+
+
+--echo # End of 11.1 test
+
+--echo # Beginning of 11.2
+
+--echo #
+--echo # MDEV-30145: JSON_TABLE: allow to retrieve the key when iterating on JSON objects
+--echo #
+
+--echo # Checking json table with NULL and empty json doc
+
+SELECT jt.*
+FROM JSON_TABLE(
+ NULL, '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+
+--echo # With Empty and NULL
+
+SELECT JSON_KEY_VALUE(NULL, '$.a');
+SELECT JSON_KEY_VALUE('', '$.a');
+SELECT JSON_KEY_VALUE('[1,2,3]', '');
+SELECT JSON_KEY_VALUE('[1,2,3]', NULL);
+
+--echo # With scalars
+
+SELECT JSON_KEY_VALUE('2', '$');
+SELECT jt.*
+FROM JSON_TABLE(
+ JSON_KEY_VALUE('2', '$'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+
+SELECT JSON_KEY_VALUE('"some_string"', '$');
+SELECT jt.*
+FROM JSON_TABLE(
+ JSON_KEY_VALUE('"some_string"', '$'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+
+SELECT JSON_KEY_VALUE('"some_string"', '$.a');
+SELECT jt.*
+FROM JSON_TABLE(
+ JSON_KEY_VALUE('"some_string"', '$.a'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+
+SELECT JSON_KEY_VALUE('"some_string"', '$[0]');
+SELECT jt.*
+FROM JSON_TABLE(
+ JSON_KEY_VALUE('"some_string"', '$[0]'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+
+SELECT JSON_KEY_VALUE('false', '$[0]');
+SELECT jt.*
+FROM JSON_TABLE(
+ JSON_KEY_VALUE('false', '$[0]'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+
+--echo # With non-scalar
+
+--echo # With array
+
+SELECT JSON_KEY_VALUE('[]', '[0]');
+
+
+SELECT JSON_KEY_VALUE('[1, 2, 3]', '$[0]');
+SELECT jt.*
+FROM JSON_TABLE(
+ JSON_KEY_VALUE('[1, 2, 3]', '$[0]'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+
+SELECT JSON_KEY_VALUE('[[1, 2, 3], 2, 3]', '$[0]');
+SELECT jt.*
+FROM JSON_TABLE(
+ JSON_KEY_VALUE('[[1, 2, 3], 2, 3]', '$[0]'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+
+SELECT JSON_KEY_VALUE('[[1, 2, 3], 2, 3]', '$[0].a');
+SELECT jt.*
+FROM JSON_TABLE(
+ JSON_KEY_VALUE('[[1, 2, 3], 2, 3]', '$[0].a'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+
+SELECT JSON_KEY_VALUE('[[1, 2, 3], 2, 3]', '$[0][1]');
+SELECT jt.*
+FROM JSON_TABLE(
+ JSON_KEY_VALUE('[[1, 2, 3], 2, 3]', '$[0][1]'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+
+SELECT JSON_KEY_VALUE('[[1, {"key1":"val1", "key2":"val2"}, 3], 2, 3]',
+'$[0][1]') as exp;
+SELECT jt.*
+FROM JSON_TABLE(
+ JSON_KEY_VALUE('[[1, {"key1":"val1", "key2":"val2"}, 3], 2, 3]', '$[0][1]'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+
+SELECT JSON_KEY_VALUE('[[1, {"key1":"val1", "key2":"val2"}, 3], 2, 3]',
+'$[0][1].key1') as exp;
+SELECT jt.*
+FROM JSON_TABLE(
+ JSON_KEY_VALUE('[[1, {"key1":"val1", "key2":"val2"}, 3], 2, 3]', '$[0][1].key1'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+
+SELECT JSON_KEY_VALUE('[[1, [{"key1":"val1", "key2":"val2"}], 3], 2, 3]',
+'$[0][1]') as exp;
+SELECT jt.*
+FROM JSON_TABLE(
+ JSON_KEY_VALUE('[[1, [{"key1":"val1", "key2":"val2"}], 3], 2, 3]', '$[0][1]'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+
+SELECT JSON_KEY_VALUE('[[1, [{"key1":"val1", "key2":"val2"}], 3], 2, 3]',
+'$[0][1][0]') as exp;
+SELECT jt.*
+FROM JSON_TABLE(
+ JSON_KEY_VALUE('[[1, [{"key1":"val1", "key2":"val2"}], 3], 2, 3]', '$[0][1][0]'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+
+--echo # With object
+
+SELECT JSON_KEY_VALUE('{}', '$.key1');
+
+#enable after MDEV-32454 fix
+--disable_view_protocol
+SELECT JSON_KEY_VALUE('{"key1":"val1", "key2":"val2"}', '$') as exp;
+--enable_view_protocol
+SELECT jt.*
+FROM JSON_TABLE(
+ JSON_KEY_VALUE('{"key1":"val1", "key2":"val2"}', '$'), '$[*]'
+ COLUMNS (k VARCHAR(11) PATH '$.key', v VARCHAR(5) PATH '$.value', id FOR ORDINALITY)) AS jt;
+
+SELECT JSON_KEY_VALUE('{"key1":"val1", "key2":"val2"}', '$.key1') as exp;
+SELECT jt.*
+FROM JSON_TABLE(
+ JSON_KEY_VALUE('{"key1":"val1", "key2":"val2"}', '$.key1'), '$[*]'
+ COLUMNS (k VARCHAR(11) PATH '$.key', v VARCHAR(5) PATH '$.value', id FOR ORDINALITY)) AS jt;
+
+SELECT JSON_KEY_VALUE('{"key1":{"a":1, "b":2}, "key2":"val2"}', '$.key1') as exp;
+SELECT jt.*
+FROM JSON_TABLE(
+ JSON_KEY_VALUE('{"key1":{"a":1, "b":2}, "key2":"val2"}', '$.key1'), '$[*]'
+ COLUMNS (k VARCHAR(11) PATH '$.key', v VARCHAR(5) PATH '$.value', id FOR ORDINALITY)) AS jt;
+
+SELECT JSON_KEY_VALUE('{"key1":{"a":1, "b": [1,2,3, {"some_key":"some_val", "c":3}]}, "key2":"val2"}', '$.key1.b[3]') as exp;
+SELECT jt.*
+FROM JSON_TABLE(
+ JSON_KEY_VALUE('{"key1":{"a":1, "b": [1,2,3, {"some_key":"some_val", "c":3}]}, "key2":"val2"}', '$.key1.b[3]'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+
+SELECT JSON_KEY_VALUE('{"key1":{"a":1, "b": [1,2,3, {"some_key":"some_val", "c":3}]}, "key2":"val2"}', '$.key1.b[0]') as exp;
+SELECT jt.*
+FROM JSON_TABLE(
+ JSON_KEY_VALUE('{"key1":{"a":1, "b": [1,2,3, {"some_key":"some_val", "c":3}]}, "key2":"val2"}', '$.key1.b[0]'), '$[*]'
+ COLUMNS (k VARCHAR(20) PATH '$.key', v VARCHAR(20) PATH '$.value', id FOR ORDINALITY)) AS jt;
+
+--echo # End of 11.2 test
+
+--echo #
+--echo # Beginning of 11.2 tests
+--echo #
+--echo # MDEV-26182: Implement json_array_intersect()
+--echo #
+
+
+
+--echo # JSON_ARRAY_INTERSECT()
+
+--echo # Scalar as elements
+
+SET @json1= '[1,2,3]';
+SET @json2= '[1,2,3]';
+SELECT json_array_intersect(@json1, @json2);
+
+SET @json1= '[1,2,3]';
+SET @json2= '[1,2,4]';
+SELECT json_array_intersect(@json1, @json2);
+
+SET @json1= '["abc","def","ghi"]';
+SET @json2= '["xyz", "abc", "tuv"]';
+SELECT json_array_intersect(@json1, @json2);
+
+SET @obj1= '[true]';
+SET @obj2= '[false, "true"]';
+select json_array_intersect(@obj1, @obj2);
+
+SET @obj1= '[true]';
+SET @obj2= '[false, true]';
+select json_array_intersect(@obj1, @obj2);
+
+SET @obj1= '[null, true]';
+SET @obj2= '[false, null]';
+select json_array_intersect(@obj1, @obj2);
+
+
+--echo # array as elements
+
+SET @json1= '[6,6,6]';
+SET @json2= '[[1,2,3],[4,5,6],[1,3,2]]';
+SELECT json_array_intersect(@json1, @json2);
+
+SET @json1= '[[1,2,3],[4,5,6],[1,3,2]]';
+SET @json2= '[[1,2,3],[4,5,6],[1,3,2]]';
+SELECT json_array_intersect(@json1, @json2);
+
+SET @json1= '[[1,2,3],[4,5,6],[1,3,2]]';
+SET @json2= '[[1,2,3],[4,5,6],[1,4,2]]';
+SELECT json_array_intersect(@json1, @json2);
+
+--echo # object as elements
+
+SET @json1 = '[{"k1":"v1","k2":"v2"},{"k2":"v2"}]';
+SET @json2 = '[{"kkey1":"vvalue1"},{"k2":"v2","k1":"v1"}]';
+SELECT json_array_intersect(@json1, @json2);
+
+SET @json1 = '[{"k1":"v1","k2":"v2"},{"k2":"v2","k1":"v1"}]';
+SET @json2 = '[{"k1":"v1","k2":"v2"},{"k1":"v1","k2":"v2"}]';
+SELECT json_array_intersect(@json1, @json2);
+
+--echo # multi type elements
+
+SET @obj1= '[1,2,3, "abc", "xyz", {"key1":"val1"}, {"key2":"val2"}, [1,2,3]]';
+SET @obj2= '[3.0, 4, 5, "abc", {"key1":"val1"}, [3,2,1]]';
+select json_array_intersect(@obj1, @obj2);
+
+SET @obj1= '[1, 2, 3, "abc", "xyz", {"key1": {"key2" : [1,2,3] } }, [4,5,6] ]';
+SET @obj2= '[3.0, 4, 5, "abc", {"key1": {"key2" : [3,2,1]} }, {"key1": {"key2" : [1,2,3] } }, [4,5,6], [6,5,4] ]';
+select json_array_intersect(@obj1, @obj2);
+
+--echo # Checking duplicates
+
+SET @obj1= '[1, 2, 3, 3, 3.0, "abc", true, true, {"key1":"val1"}]';
+SET @obj2= '[3.0, 3, 5, "abc", "abc", true, {"key2":"val2"}, {"key1":"val1"}, {"key1":"val2"}]';
+select json_array_intersect(@obj1, @obj2);
+
+
+--echo # Checking Syntax error for JSON_ARRAY_INTERSECT()
+SET @obj1= '[1, 2, 3, 3, 3.0, "abc", true, true, {"key1":"val1" ]';
+SET @obj2= '[3.0, 3, 5, "abc", "abc", true, {"key2":"val2"}, {"key1":"val1"}, {"key1":"val2"}]';
+select json_array_intersect(@obj1, @obj2);
+
+--echo # Checking incorrect type for input
+SET @obj1= '{"key1": "val1"}';
+SET @arr1= '[ 1, 2, 3 ]';
+SET @num1= '2';
+SET @str1= '"abc"';
+SET @bool1= 'true';
+select json_array_intersect(@obj1, @arr1);
+select json_array_intersect(@arr1, @obj1);
+select json_array_intersect(@arr1, @num1);
+select json_array_intersect(@num1, @bool1);
+
+
+
+--echo # JSON_OBJECT_FILTER_KEYS()
+
+SET @obj1= '{ "a": 1, "b": 2, "c": 3}';
+SET @obj2= '{"b" : 10, "c": 20, "d": 30}';
+SELECT JSON_OBJECT_FILTER_KEYS (@obj1, json_array_intersect(json_keys(@obj1), json_keys(@obj2)));
+
+SET @obj1= '{ "a": 1, "b": {"key1": {"key2":"val2"}}, "c": [1, 2, 3] }';
+SET @obj2= '{"b" : 10, "c": 20, "d": 30}';
+SELECT JSON_OBJECT_FILTER_KEYS (@obj1, json_array_intersect(json_keys(@obj1), json_keys(@obj2)));
+
+
+SET @obj1= '{ "a": 1, "b": {"key1": {"key2":"val2"}}, "c": [1, 2, 3] }';
+SET @arr2='["x", "y", "z"]';
+SELECT JSON_OBJECT_FILTER_KEYS(@obj1, @arr2);
+
+
+SET @obj1= '{ "a": 1, "b": {"key1": {"key2":"val2"}}, "c": [1, 2, 3] }';
+SET @arr2='["key2", "key1", "b"]';
+SELECT JSON_OBJECT_FILTER_KEYS(@obj1, @arr1);
+
+--echo # Incorrect type in input returns NULL
+
+SELECT JSON_OBJECT_FILTER_KEYS(@obj1, @obj1);
+SELECT JSON_OBJECT_FILTER_KEYS(@arr1, @arr1);
+
+SET @obj1= '{ "a": 1, "b": {"key1": {"key2":"val2"}}, "c": [1, 2, 3] }';
+SET @scalar1='2';
+SELECT JSON_OBJECT_FILTER_KEYS(@obj1, @scalar1);
+
+--echo # Checking syntax error
+
+SET @obj1= '{ "a": 1, "b": 2, "c": 3}';
+SET @obj2= '{"b" : 10, "c": 20, "d" 30}';
+SELECT JSON_OBJECT_FILTER_KEYS (@obj1, json_array_intersect(json_keys(@obj1), json_keys(@obj2)));
+
+SET @obj1= '{ "a": 1, "b": {"key1": {"key2":"val2"}}, "c": [1, 2, 3] }';
+SET @arr2= '[ "key2", "key1", "b" ';
+SELECT JSON_OBJECT_FILTER_KEYS(@obj1, @arr1);
+
+
+
+--echo # JSON_OBJECT_TO_ARRAY()
+
+SET @obj1= '{ "a": [1, 2, 3], "b": { "key1":"val1", "key2": {"key3":"val3"} }, "c": 3, "d" : 1, "e": "xyz", "f": true, "g" : null}';
+SELECT JSON_OBJECT_TO_ARRAY(@obj1);
+
+SET @obj1= '{ "a": [1, 2, 3], "b": { "key1":"val1", "key2": [1, 2, 3] }, "c": 3, "d" : 1, "e": "xyz", "f": true, "g" : null}';
+SELECT JSON_OBJECT_TO_ARRAY(@obj1);
+
+--echo # Checking syntax error
+
+SET @obj1= '{ "a": [1, 2, 3], "b": "key1": "val1", "key2": {"key3":"val3"} }, "c": 3, "d" : 1, "e": "xyz", "f": true, "g" : null}';
+SELECT JSON_OBJECT_TO_ARRAY(@obj1);
+
+--echo Checking incorrect type in argument
+
+SET @arr1= '[1, 2, 3]';
+SELECT JSON_OBJECT_TO_ARRAY(@arr1);
+
+
+--echo #
+--echo # MDEV-31411: JSON_ARRAY_INTERSECT/JSON_OBJECT_FILTER_KEYS should fetch
+--echo # data from a table similar to other JSON functions
+--echo #
+
+CREATE TABLE t1 (
+ c1 longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(c1)),
+ c2 longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`c2`))
+ ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;
+
+INSERT INTO t1 VALUES('[1,2,3]', '[2, 3, 4]'), ('[2 ,3, 4]', '[4, 5, 6]');
+
+SELECT JSON_ARRAY_INTERSECT(c1, c2) FROM t1;
+
+DROP TABLE t1;
+
+
+--echo #
+--echo # End of 11.2 Test
+--echo #
diff --git a/mysql-test/main/func_kdf,old.rdiff b/mysql-test/main/func_kdf,old.rdiff
new file mode 100644
index 00000000..18c9dde0
--- /dev/null
+++ b/mysql-test/main/func_kdf,old.rdiff
@@ -0,0 +1,64 @@
+--- main/func_kdf.result
++++ main/func_kdf.reject
+@@ -21,10 +21,14 @@
+ 48565B49B42FBF88537AFA1D4C0FA2C6
+ select hex(kdf('foo', 'bar', 'info', 'hkdf'));
+ hex(kdf('foo', 'bar', 'info', 'hkdf'))
+-710583081D40A55F0B573A76E02D8975
++NULL
++Warnings:
++Warning 1235 This version of MariaDB doesn't yet support 'kdf(..., 'hkdf')'
+ select hex(kdf('foo', 'bar', 'infa', 'hkdf'));
+ hex(kdf('foo', 'bar', 'infa', 'hkdf'))
+-612875F859CFB4EE0DFEFF9F2A18E836
++NULL
++Warnings:
++Warning 1235 This version of MariaDB doesn't yet support 'kdf(..., 'hkdf')'
+ select hex(kdf('foo', 'bar', 'info', 'pbkdf2_hmac'));
+ hex(kdf('foo', 'bar', 'info', 'pbkdf2_hmac'))
+ NULL
+@@ -55,7 +59,9 @@
+ NULL
+ select hex(kdf('foo', 'bar', NULL, 'hkdf'));
+ hex(kdf('foo', 'bar', NULL, 'hkdf'))
+-4AFD0088E56CAF7CB5C94F6C101D58D5
++NULL
++Warnings:
++Warning 1235 This version of MariaDB doesn't yet support 'kdf(..., 'hkdf')'
+ select hex(kdf('foo', 'bar', NULL, 'pbkdf2_hmac'));
+ hex(kdf('foo', 'bar', NULL, 'pbkdf2_hmac'))
+ NULL
+@@ -81,10 +87,14 @@
+ set @@block_encryption_mode='aes-192-cbc';
+ select hex(kdf('foo', 'bar', 'info', 'hkdf'));
+ hex(kdf('foo', 'bar', 'info', 'hkdf'))
+-710583081D40A55F0B573A76E02D8975AA11A4595954C0A1
++NULL
++Warnings:
++Warning 1235 This version of MariaDB doesn't yet support 'kdf(..., 'hkdf')'
+ select hex(kdf('foo', 'bar', 'info', 'hkdf', 256));
+ hex(kdf('foo', 'bar', 'info', 'hkdf', 256))
+-710583081D40A55F0B573A76E02D8975AA11A4595954C0A1487D6D33ABAB93C3
++NULL
++Warnings:
++Warning 1235 This version of MariaDB doesn't yet support 'kdf(..., 'hkdf')'
+ select hex(kdf('foo', 'bar', 2000, 'pbkdf2_hmac'));
+ hex(kdf('foo', 'bar', 2000, 'pbkdf2_hmac'))
+ 430D4780B57254EF39EE13CE53DB381A552151AA62A9FA92
+@@ -110,10 +120,14 @@
+ Warning 3047 Invalid argument error: 0 in function kdf.
+ select length(kdf('foo', 'bar', 'info', 'hkdf', 32768));
+ length(kdf('foo', 'bar', 'info', 'hkdf', 32768))
+-4096
++NULL
++Warnings:
++Warning 1235 This version of MariaDB doesn't yet support 'kdf(..., 'hkdf')'
+ select length(kdf('foo', 'bar', 'info', 'hkdf', 65536));
+ length(kdf('foo', 'bar', 'info', 'hkdf', 65536))
+-8192
++NULL
++Warnings:
++Warning 1235 This version of MariaDB doesn't yet support 'kdf(..., 'hkdf')'
+ select length(kdf('foo', 'bar', 'info', 'hkdf', 65537));
+ length(kdf('foo', 'bar', 'info', 'hkdf', 65537))
+ NULL
diff --git a/mysql-test/main/func_kdf.combinations b/mysql-test/main/func_kdf.combinations
new file mode 100644
index 00000000..2adc8879
--- /dev/null
+++ b/mysql-test/main/func_kdf.combinations
@@ -0,0 +1,4 @@
+[new]
+
+[old]
+# remove when no longer building with OpenSSL 1.0
diff --git a/mysql-test/main/func_kdf.result b/mysql-test/main/func_kdf.result
new file mode 100644
index 00000000..fda8c058
--- /dev/null
+++ b/mysql-test/main/func_kdf.result
@@ -0,0 +1,163 @@
+#
+# MDEV-31474 KDF() function
+#
+select hex(kdf('foo', 'bar'));
+hex(kdf('foo', 'bar'))
+76BA6DEC5C3F6A60704D730A2A4BAA1C
+select hex(kdf('foo', 'bar'));
+hex(kdf('foo', 'bar'))
+76BA6DEC5C3F6A60704D730A2A4BAA1C
+select hex(kdf('faa', 'bar'));
+hex(kdf('faa', 'bar'))
+62A8C6FD3E6FDA7ECE6D37CF1C95E3CC
+select hex(kdf('foo', 'bor'));
+hex(kdf('foo', 'bor'))
+F0FE3B0884C9733A520EC8C2EE711137
+select hex(kdf('foo', 'bar', 10));
+hex(kdf('foo', 'bar', 10))
+1D25A9E01C2078FF10DECEC874B3F21E
+select hex(kdf('foo', 'bar', 11));
+hex(kdf('foo', 'bar', 11))
+48565B49B42FBF88537AFA1D4C0FA2C6
+select hex(kdf('foo', 'bar', 'info', 'hkdf'));
+hex(kdf('foo', 'bar', 'info', 'hkdf'))
+710583081D40A55F0B573A76E02D8975
+select hex(kdf('foo', 'bar', 'infa', 'hkdf'));
+hex(kdf('foo', 'bar', 'infa', 'hkdf'))
+612875F859CFB4EE0DFEFF9F2A18E836
+select hex(kdf('foo', 'bar', 'info', 'pbkdf2_hmac'));
+hex(kdf('foo', 'bar', 'info', 'pbkdf2_hmac'))
+NULL
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'info'
+Warning 3047 Invalid argument error: 0 in function kdf.
+select hex(kdf('foo', 'bar', -1, 'pbkdf2_hmac'));
+hex(kdf('foo', 'bar', -1, 'pbkdf2_hmac'))
+NULL
+Warnings:
+Warning 3047 Invalid argument error: -1 in function kdf.
+select hex(kdf('foo', 'bar', 0, 'pbkdf2_hmac'));
+hex(kdf('foo', 'bar', 0, 'pbkdf2_hmac'))
+NULL
+Warnings:
+Warning 3047 Invalid argument error: 0 in function kdf.
+select hex(kdf('foo', 'bar', 1, 'pbkdf2_hmac'));
+hex(kdf('foo', 'bar', 1, 'pbkdf2_hmac'))
+DB658012DC3E52AEC1F4933C280B6E10
+select hex(kdf('foo', 'bar', 10, 'pbkdf2_hmac'));
+hex(kdf('foo', 'bar', 10, 'pbkdf2_hmac'))
+1D25A9E01C2078FF10DECEC874B3F21E
+select hex(kdf(NULL, 'bar'));
+hex(kdf(NULL, 'bar'))
+NULL
+select hex(kdf('foo', NULL));
+hex(kdf('foo', NULL))
+NULL
+select hex(kdf('foo', 'bar', NULL, 'hkdf'));
+hex(kdf('foo', 'bar', NULL, 'hkdf'))
+4AFD0088E56CAF7CB5C94F6C101D58D5
+select hex(kdf('foo', 'bar', NULL, 'pbkdf2_hmac'));
+hex(kdf('foo', 'bar', NULL, 'pbkdf2_hmac'))
+NULL
+select hex(kdf('foo', 'bar', 2000, NULL));
+hex(kdf('foo', 'bar', 2000, NULL))
+NULL
+select hex(kdf('foo', 'bar', 2000, 'foo'));
+hex(kdf('foo', 'bar', 2000, 'foo'))
+NULL
+Warnings:
+Warning 3047 Invalid argument error: 'foo' in function kdf.
+select hex(kdf('foo', 'bar', 2000, '\n\n\n\0!!!'));
+hex(kdf('foo', 'bar', 2000, '\n\n\n\0!!!'))
+NULL
+Warnings:
+Warning 3047 Invalid argument error: '
+
+
+\0000!!!' in function kdf.
+select hex(kdf('foo', 'bar', 1000, 'pbkdf2_hmac', NULL));
+hex(kdf('foo', 'bar', 1000, 'pbkdf2_hmac', NULL))
+NULL
+select hex(kdf('foo', 'bar', 1000, 'pbkdf2_hmac', -8));
+hex(kdf('foo', 'bar', 1000, 'pbkdf2_hmac', -8))
+NULL
+Warnings:
+Warning 3047 Invalid argument error: -8 in function kdf.
+select hex(kdf('foo', 'bar', 1000, 'pbkdf2_hmac', 10));
+hex(kdf('foo', 'bar', 1000, 'pbkdf2_hmac', 10))
+NULL
+Warnings:
+Warning 3047 Invalid argument error: 10 in function kdf.
+select hex(kdf('foo', 'bar', 1000, 'pbkdf2_hmac', 16));
+hex(kdf('foo', 'bar', 1000, 'pbkdf2_hmac', 16))
+76BA
+set @@block_encryption_mode='aes-192-cbc';
+select hex(kdf('foo', 'bar', 'info', 'hkdf'));
+hex(kdf('foo', 'bar', 'info', 'hkdf'))
+710583081D40A55F0B573A76E02D8975AA11A4595954C0A1
+select hex(kdf('foo', 'bar', 'info', 'hkdf', 256));
+hex(kdf('foo', 'bar', 'info', 'hkdf', 256))
+710583081D40A55F0B573A76E02D8975AA11A4595954C0A1487D6D33ABAB93C3
+select hex(kdf('foo', 'bar', 2000, 'pbkdf2_hmac'));
+hex(kdf('foo', 'bar', 2000, 'pbkdf2_hmac'))
+430D4780B57254EF39EE13CE53DB381A552151AA62A9FA92
+select hex(kdf('foo', 'bar', 2000, 'pbkdf2_hmac', 256));
+hex(kdf('foo', 'bar', 2000, 'pbkdf2_hmac', 256))
+430D4780B57254EF39EE13CE53DB381A552151AA62A9FA922B9949DF270AE10C
+set @key=kdf('password', 'salt', 2048);
+select hex(aes_encrypt('secret', @key, '1234123412341234'));
+hex(aes_encrypt('secret', @key, '1234123412341234'))
+9EED553CDDEE426D5635EF559E015ECA
+select aes_decrypt(x'9EED553CDDEE426D5635EF559E015ECA', @key, '1234123412341234');
+aes_decrypt(x'9EED553CDDEE426D5635EF559E015ECA', @key, '1234123412341234')
+secret
+select length(kdf('foo', 'bar', 'info', 'hkdf', -1));
+length(kdf('foo', 'bar', 'info', 'hkdf', -1))
+NULL
+Warnings:
+Warning 3047 Invalid argument error: -1 in function kdf.
+select length(kdf('foo', 'bar', 'info', 'hkdf', 0));
+length(kdf('foo', 'bar', 'info', 'hkdf', 0))
+NULL
+Warnings:
+Warning 3047 Invalid argument error: 0 in function kdf.
+select length(kdf('foo', 'bar', 'info', 'hkdf', 32768));
+length(kdf('foo', 'bar', 'info', 'hkdf', 32768))
+4096
+select length(kdf('foo', 'bar', 'info', 'hkdf', 65536));
+length(kdf('foo', 'bar', 'info', 'hkdf', 65536))
+8192
+select length(kdf('foo', 'bar', 'info', 'hkdf', 65537));
+length(kdf('foo', 'bar', 'info', 'hkdf', 65537))
+NULL
+Warnings:
+Warning 3047 Invalid argument error: 65537 in function kdf.
+select length(kdf('foo', 'bar', 100, 'pbkdf2_hmac', -1));
+length(kdf('foo', 'bar', 100, 'pbkdf2_hmac', -1))
+NULL
+Warnings:
+Warning 3047 Invalid argument error: -1 in function kdf.
+select length(kdf('foo', 'bar', 100, 'pbkdf2_hmac', 0));
+length(kdf('foo', 'bar', 100, 'pbkdf2_hmac', 0))
+NULL
+Warnings:
+Warning 3047 Invalid argument error: 0 in function kdf.
+select length(kdf('foo', 'bar', 100, 'pbkdf2_hmac', 32768));
+length(kdf('foo', 'bar', 100, 'pbkdf2_hmac', 32768))
+4096
+select length(kdf('foo', 'bar', 100, 'pbkdf2_hmac', 65536));
+length(kdf('foo', 'bar', 100, 'pbkdf2_hmac', 65536))
+8192
+select length(kdf('foo', 'bar', 100, 'pbkdf2_hmac', 65537));
+length(kdf('foo', 'bar', 100, 'pbkdf2_hmac', 65537))
+NULL
+Warnings:
+Warning 3047 Invalid argument error: 65537 in function kdf.
+#
+# MDEV-33659 Test kdf() without parameters
+#
+select kdf();
+ERROR 42000: Incorrect parameter count in the call to native function 'kdf'
+#
+# End of 11.3 tests
+#
diff --git a/mysql-test/main/func_kdf.test b/mysql-test/main/func_kdf.test
new file mode 100644
index 00000000..01f53da3
--- /dev/null
+++ b/mysql-test/main/func_kdf.test
@@ -0,0 +1,64 @@
+--echo #
+--echo # MDEV-31474 KDF() function
+--echo #
+select hex(kdf('foo', 'bar'));
+select hex(kdf('foo', 'bar')); # same result every time
+select hex(kdf('faa', 'bar'));
+select hex(kdf('foo', 'bor'));
+
+select hex(kdf('foo', 'bar', 10));
+select hex(kdf('foo', 'bar', 11));
+
+select hex(kdf('foo', 'bar', 'info', 'hkdf'));
+select hex(kdf('foo', 'bar', 'infa', 'hkdf'));
+select hex(kdf('foo', 'bar', 'info', 'pbkdf2_hmac'));
+select hex(kdf('foo', 'bar', -1, 'pbkdf2_hmac'));
+select hex(kdf('foo', 'bar', 0, 'pbkdf2_hmac'));
+select hex(kdf('foo', 'bar', 1, 'pbkdf2_hmac'));
+select hex(kdf('foo', 'bar', 10, 'pbkdf2_hmac'));
+
+select hex(kdf(NULL, 'bar'));
+select hex(kdf('foo', NULL));
+select hex(kdf('foo', 'bar', NULL, 'hkdf'));
+select hex(kdf('foo', 'bar', NULL, 'pbkdf2_hmac'));
+select hex(kdf('foo', 'bar', 2000, NULL));
+select hex(kdf('foo', 'bar', 2000, 'foo'));
+select hex(kdf('foo', 'bar', 2000, '\n\n\n\0!!!'));
+select hex(kdf('foo', 'bar', 1000, 'pbkdf2_hmac', NULL));
+select hex(kdf('foo', 'bar', 1000, 'pbkdf2_hmac', -8));
+select hex(kdf('foo', 'bar', 1000, 'pbkdf2_hmac', 10));
+select hex(kdf('foo', 'bar', 1000, 'pbkdf2_hmac', 16));
+
+set @@block_encryption_mode='aes-192-cbc';
+select hex(kdf('foo', 'bar', 'info', 'hkdf'));
+select hex(kdf('foo', 'bar', 'info', 'hkdf', 256));
+select hex(kdf('foo', 'bar', 2000, 'pbkdf2_hmac'));
+select hex(kdf('foo', 'bar', 2000, 'pbkdf2_hmac', 256));
+
+set @key=kdf('password', 'salt', 2048);
+select hex(aes_encrypt('secret', @key, '1234123412341234'));
+select aes_decrypt(x'9EED553CDDEE426D5635EF559E015ECA', @key, '1234123412341234');
+
+select length(kdf('foo', 'bar', 'info', 'hkdf', -1));
+select length(kdf('foo', 'bar', 'info', 'hkdf', 0));
+select length(kdf('foo', 'bar', 'info', 'hkdf', 32768));
+select length(kdf('foo', 'bar', 'info', 'hkdf', 65536));
+select length(kdf('foo', 'bar', 'info', 'hkdf', 65537));
+
+select length(kdf('foo', 'bar', 100, 'pbkdf2_hmac', -1));
+select length(kdf('foo', 'bar', 100, 'pbkdf2_hmac', 0));
+select length(kdf('foo', 'bar', 100, 'pbkdf2_hmac', 32768));
+select length(kdf('foo', 'bar', 100, 'pbkdf2_hmac', 65536));
+select length(kdf('foo', 'bar', 100, 'pbkdf2_hmac', 65537));
+
+--echo #
+--echo # MDEV-33659 Test kdf() without parameters
+--echo #
+
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select kdf();
+
+--echo #
+--echo # End of 11.3 tests
+--echo #
+
diff --git a/mysql-test/main/func_str.result b/mysql-test/main/func_str.result
index 20817dba..59595dff 100644
--- a/mysql-test/main/func_str.result
+++ b/mysql-test/main/func_str.result
@@ -971,17 +971,17 @@ explain extended select length('\n\t\r\b\0\_\%\\');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 select octet_length('\n \r\0008\0\\_\\%\\') AS `length('\n\t\r\b\0\_\%\\')`
+Note 1003 select octet_length('\n\t\r\b\0\\_\\%\\') AS `length('\n\t\r\b\0\_\%\\')`
explain extended select bit_length('\n\t\r\b\0\_\%\\');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 select bit_length('\n \r\0008\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`
+Note 1003 select bit_length('\n\t\r\b\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`
explain extended select bit_length('\n\t\r\b\0\_\%\\');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 select bit_length('\n \r\0008\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`
+Note 1003 select bit_length('\n\t\r\b\0\\_\\%\\') AS `bit_length('\n\t\r\b\0\_\%\\')`
explain extended select concat('monty',' was here ','again');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
@@ -1078,8 +1078,8 @@ lpad(12345, 5, "#")
SELECT conv(71, 10, 36), conv('1Z', 36, 10);
conv(71, 10, 36) conv('1Z', 36, 10)
1Z 71
-SELECT conv(71, 10, 37), conv('1Z', 37, 10), conv(0,1,10),conv(0,0,10), conv(0,-1,10);
-conv(71, 10, 37) conv('1Z', 37, 10) conv(0,1,10) conv(0,0,10) conv(0,-1,10)
+SELECT conv(71, 10, 63), conv('1Z', 63, 10), conv(0,1,10),conv(0,0,10), conv(0,-1,10);
+conv(71, 10, 63) conv('1Z', 63, 10) conv(0,1,10) conv(0,0,10) conv(0,-1,10)
NULL NULL NULL NULL NULL
create table t1 (id int(1), str varchar(10)) DEFAULT CHARSET=utf8;
insert into t1 values (1,'aaaaaaaaaa'), (2,'bbbbbbbbbb');
@@ -5521,3 +5521,145 @@ SET sql_mode=DEFAULT;
#
# End of 10.11 tests
#
+#
+# MDEV-9069 extend AES_ENCRYPT() and AES_DECRYPT() to support IV and the algorithm
+#
+select aes_encrypt('foo', 'bar', '1234') = aes_encrypt('foo', 'bar') `expected 1`;
+expected 1
+1
+select aes_encrypt('foo', 'bar', NULL, 'aes-128-ecb') = aes_encrypt('foo', 'bar') `expected 1`;
+expected 1
+1
+select aes_encrypt(1);
+ERROR 42000: Incorrect parameter count in the call to native function 'aes_encrypt'
+select aes_encrypt(1,2,3,4,5);
+ERROR 42000: Incorrect parameter count in the call to native function 'aes_encrypt'
+select aes_encrypt('foo', 'bar', '0123', 'something');
+aes_encrypt('foo', 'bar', '0123', 'something')
+NULL
+select aes_encrypt('foo', 'bar', '0123', 'aes-111-ecb');
+aes_encrypt('foo', 'bar', '0123', 'aes-111-ecb')
+NULL
+select aes_encrypt('foo', 'bar', '0123', 'aes-128-bar');
+aes_encrypt('foo', 'bar', '0123', 'aes-128-bar')
+NULL
+select aes_encrypt('foo', 'bar', '0123', 'aes-128-cbc');
+aes_encrypt('foo', 'bar', '0123', 'aes-128-cbc')
+NULL
+select hex(aes_encrypt('foo', 'bar', '0123456789abcdef', 'aes-256-cbc')) `x`;
+x
+42A3EB91E6DFC40A900D278F99E0726E
+select aes_decrypt(x'42A3EB91E6DFC40A900D278F99E0726E', 'bar', '0123456789abcdef###', 'AES-256-CBC') `expected foo`;
+expected foo
+foo
+select hex(aes_encrypt('foo', 'bar', '0123456789abcdef', 'aes-128-ctr')) `x`;
+x
+C57C4B
+select aes_decrypt(x'C57C4B', 'bar', '0123456789abcdef', 'aes-128-ctr') `expected foo`;
+expected foo
+foo
+set @@block_encryption_mode='aes-128-ctr';
+select aes_decrypt(x'C57C4B', 'bar', '0123456789abcdef');
+aes_decrypt(x'C57C4B', 'bar', '0123456789abcdef')
+foo
+set @@block_encryption_mode='aes-192-cbc';
+select hex(aes_encrypt('foo', 'bar'));
+hex(aes_encrypt('foo', 'bar'))
+NULL
+select hex(aes_encrypt('foo', 'bar', 'abcdefghabcdefgh'));
+hex(aes_encrypt('foo', 'bar', 'abcdefghabcdefgh'))
+9E6F76516B4DE68FED7A77632FC0913D
+select aes_decrypt(x'9E6F76516B4DE68FED7A77632FC0913D', 'bar', 'abcdefghabcdefgh') `expected foo`;
+expected foo
+foo
+select aes_decrypt(x'00000000000000011111111111111111', 'bar', 'abcdefghabcdefgh') `expected NULL`;
+expected NULL
+NULL
+select aes_decrypt(x'9E6F76516B4DE68FED7A77632FC0913D', 'bar', '0000000011111111') `expected NULL`;
+expected NULL
+NULL
+select aes_decrypt(x'9E6F76516B4DE68FED7A77632FC0913D', 'bar', 'abcdefghabcdefgh', 'aes-128-ecb') `expected NULL`;
+expected NULL
+NULL
+select hex(aes_decrypt(x'9E6F76516B4DE68FED7A77632FC0913D', 'bar', 'abcdefghabcdefgh', 'aes-128-ctr')) `expected garbage`;
+expected garbage
+98D7BC3151620F384B0A953686AF37C9
+set @@block_encryption_mode=default;
+#
+# MDEV-31633 Assertion `!item->null_value' failed in Type_handler::Item_send_str
+#
+select aes_encrypt(a,a) is null from (values('a'),(NULL),('b')) x;
+aes_encrypt(a,a) is null
+0
+1
+0
+#
+# MDEV-33659: Server crashed at Create_func_aes_decrypt::create_native
+#
+select aes_encrypt();
+ERROR 42000: Incorrect parameter count in the call to native function 'aes_encrypt'
+select aes_decrypt();
+ERROR 42000: Incorrect parameter count in the call to native function 'aes_decrypt'
+#
+# End of 11.2 tests
+#
+#
+# MDEV-30879 Add conversion to based 62 for CONV function
+#
+SELECT CONV('1z', 62, 10);
+CONV('1z', 62, 10)
+123
+SELECT CONV('1Z', 62, 10);
+CONV('1Z', 62, 10)
+97
+SELECT CONV('-1Z', 62, 10);
+CONV('-1Z', 62, 10)
+18446744073709551519
+SELECT CONV('-1Z', -62, 10);
+CONV('-1Z', -62, 10)
+18446744073709551519
+SELECT CONV('-1Z', 62, -10);
+CONV('-1Z', 62, -10)
+-97
+SELECT CONV('-1Z', -62, -10);
+CONV('-1Z', -62, -10)
+-97
+SELECT CONV('AzL8n0Y58m7', 62, 10);
+CONV('AzL8n0Y58m7', 62, 10)
+9223372036854775807
+SELECT CONV('LygHa16AHYE', 62, 10);
+CONV('LygHa16AHYE', 62, 10)
+18446744073709551614
+SELECT CONV('LygHa16AHYF', 62, 10);
+CONV('LygHa16AHYF', 62, 10)
+18446744073709551615
+SELECT CONV('LygHa16AHZ0', 62, 10);
+CONV('LygHa16AHZ0', 62, 10)
+18446744073709551615
+SELECT CONV('-AzL8n0Y58m7', -62, -10);
+CONV('-AzL8n0Y58m7', -62, -10)
+-9223372036854775807
+SELECT CONV('-AzL8n0Y58m8', -62, -10);
+CONV('-AzL8n0Y58m8', -62, -10)
+-9223372036854775808
+SELECT CONV('-AzL8n0Y58m9', -62, -10);
+CONV('-AzL8n0Y58m9', -62, -10)
+-9223372036854775808
+SELECT CONV('-LygHa16AHZ0', -62, -10);
+CONV('-LygHa16AHZ0', -62, -10)
+-9223372036854775808
+SELECT CONV('LygHa16AHYF', 63, 10);
+CONV('LygHa16AHYF', 63, 10)
+NULL
+SELECT CONV(18446744073709551615, 10, 63);
+CONV(18446744073709551615, 10, 63)
+NULL
+SELECT CONV(18446744073709551615, 10, 62);
+CONV(18446744073709551615, 10, 62)
+LygHa16AHYF
+SELECT CONV(-9223372036854775808, -10, -62);
+CONV(-9223372036854775808, -10, -62)
+-AzL8n0Y58m8
+#
+# End of 11.4 tests
+#
diff --git a/mysql-test/main/func_str.test b/mysql-test/main/func_str.test
index b34623d9..163b65d5 100644
--- a/mysql-test/main/func_str.test
+++ b/mysql-test/main/func_str.test
@@ -570,7 +570,7 @@ SELECT lpad(12345, 5, "#");
#
SELECT conv(71, 10, 36), conv('1Z', 36, 10);
-SELECT conv(71, 10, 37), conv('1Z', 37, 10), conv(0,1,10),conv(0,0,10), conv(0,-1,10);
+SELECT conv(71, 10, 63), conv('1Z', 63, 10), conv(0,1,10),conv(0,0,10), conv(0,-1,10);
#
# Bug in SUBSTRING when mixed with CONCAT and ORDER BY (Bug #3089)
@@ -2479,3 +2479,95 @@ SET sql_mode=DEFAULT;
--echo #
--echo # End of 10.11 tests
--echo #
+
+--echo #
+--echo # MDEV-9069 extend AES_ENCRYPT() and AES_DECRYPT() to support IV and the algorithm
+--echo #
+select aes_encrypt('foo', 'bar', '1234') = aes_encrypt('foo', 'bar') `expected 1`;
+select aes_encrypt('foo', 'bar', NULL, 'aes-128-ecb') = aes_encrypt('foo', 'bar') `expected 1`;
+
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select aes_encrypt(1);
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select aes_encrypt(1,2,3,4,5);
+select aes_encrypt('foo', 'bar', '0123', 'something');
+select aes_encrypt('foo', 'bar', '0123', 'aes-111-ecb');
+select aes_encrypt('foo', 'bar', '0123', 'aes-128-bar');
+select aes_encrypt('foo', 'bar', '0123', 'aes-128-cbc');
+select hex(aes_encrypt('foo', 'bar', '0123456789abcdef', 'aes-256-cbc')) `x`;
+select aes_decrypt(x'42A3EB91E6DFC40A900D278F99E0726E', 'bar', '0123456789abcdef###', 'AES-256-CBC') `expected foo`;
+select hex(aes_encrypt('foo', 'bar', '0123456789abcdef', 'aes-128-ctr')) `x`;
+select aes_decrypt(x'C57C4B', 'bar', '0123456789abcdef', 'aes-128-ctr') `expected foo`;
+
+set @@block_encryption_mode='aes-128-ctr';
+select aes_decrypt(x'C57C4B', 'bar', '0123456789abcdef');
+set @@block_encryption_mode='aes-192-cbc';
+select hex(aes_encrypt('foo', 'bar'));
+select hex(aes_encrypt('foo', 'bar', 'abcdefghabcdefgh'));
+select aes_decrypt(x'9E6F76516B4DE68FED7A77632FC0913D', 'bar', 'abcdefghabcdefgh') `expected foo`;
+
+# wrong key
+select aes_decrypt(x'00000000000000011111111111111111', 'bar', 'abcdefghabcdefgh') `expected NULL`;
+# wrong iv
+select aes_decrypt(x'9E6F76516B4DE68FED7A77632FC0913D', 'bar', '0000000011111111') `expected NULL`;
+# wrong alg
+select aes_decrypt(x'9E6F76516B4DE68FED7A77632FC0913D', 'bar', 'abcdefghabcdefgh', 'aes-128-ecb') `expected NULL`;
+# but ctr doesn't use padding, so:
+select hex(aes_decrypt(x'9E6F76516B4DE68FED7A77632FC0913D', 'bar', 'abcdefghabcdefgh', 'aes-128-ctr')) `expected garbage`;
+
+set @@block_encryption_mode=default;
+
+--echo #
+--echo # MDEV-31633 Assertion `!item->null_value' failed in Type_handler::Item_send_str
+--echo #
+select aes_encrypt(a,a) is null from (values('a'),(NULL),('b')) x;
+
+--echo #
+--echo # MDEV-33659: Server crashed at Create_func_aes_decrypt::create_native
+--echo #
+
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select aes_encrypt();
+--error ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT
+select aes_decrypt();
+
+--echo #
+--echo # End of 11.2 tests
+--echo #
+
+--echo #
+--echo # MDEV-30879 Add conversion to based 62 for CONV function
+--echo #
+
+SELECT CONV('1z', 62, 10);
+SELECT CONV('1Z', 62, 10);
+
+SELECT CONV('-1Z', 62, 10);
+SELECT CONV('-1Z', -62, 10);
+SELECT CONV('-1Z', 62, -10);
+SELECT CONV('-1Z', -62, -10);
+
+# Check limits
+SELECT CONV('AzL8n0Y58m7', 62, 10);
+SELECT CONV('LygHa16AHYE', 62, 10);
+SELECT CONV('LygHa16AHYF', 62, 10);
+
+# Overflow doesn't appear to warn, but does overflow
+SELECT CONV('LygHa16AHZ0', 62, 10);
+
+SELECT CONV('-AzL8n0Y58m7', -62, -10);
+SELECT CONV('-AzL8n0Y58m8', -62, -10);
+SELECT CONV('-AzL8n0Y58m9', -62, -10);
+SELECT CONV('-LygHa16AHZ0', -62, -10);
+
+# Should NULL
+SELECT CONV('LygHa16AHYF', 63, 10);
+SELECT CONV(18446744073709551615, 10, 63);
+
+# Test 10 -> 62
+SELECT CONV(18446744073709551615, 10, 62);
+SELECT CONV(-9223372036854775808, -10, -62);
+
+--echo #
+--echo # End of 11.4 tests
+--echo #
diff --git a/mysql-test/main/func_time.result b/mysql-test/main/func_time.result
index bf7d9748..c3acc114 100644
--- a/mysql-test/main/func_time.result
+++ b/mysql-test/main/func_time.result
@@ -3804,21 +3804,13 @@ SET @sav_slow_query_log= @@session.slow_query_log;
SET @@session.slow_query_log= ON;
SELECT current_timestamp(6),fn_sleep_before_now() INTO @ts_cur, @ts_func;
SELECT a FROM t_ts LIMIT 1 into @ts_func;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
SELECT a FROM t_trig LIMIT 1 into @ts_trig;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
DELETE FROM t_ts;
DELETE FROM t_trig;
SET @@session.slow_query_log= OFF;
SELECT current_timestamp(6),fn_sleep_before_now() INTO @ts_cur, @func_ts;
SELECT a FROM t_ts LIMIT 1 into @ts_func;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
SELECT a FROM t_trig LIMIT 1 into @ts_trig;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
SET @@session.slow_query_log= @sav_slow_query_log;
DROP FUNCTION fn_sleep_before_now;
DROP TRIGGER trg_insert_t_ts;
diff --git a/mysql-test/main/gis-alter_table_online.result b/mysql-test/main/gis-alter_table.result
index 80e40416..80e40416 100644
--- a/mysql-test/main/gis-alter_table_online.result
+++ b/mysql-test/main/gis-alter_table.result
diff --git a/mysql-test/main/gis-alter_table_online.test b/mysql-test/main/gis-alter_table.test
index be6d2137..be6d2137 100644
--- a/mysql-test/main/gis-alter_table_online.test
+++ b/mysql-test/main/gis-alter_table.test
diff --git a/mysql-test/main/grant.result b/mysql-test/main/grant.result
index 031ebbc9..f141fa94 100644
--- a/mysql-test/main/grant.result
+++ b/mysql-test/main/grant.result
@@ -225,7 +225,7 @@ revoke LOCK TABLES, ALTER on mysqltest.* from mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, CREATE TEMPORARY TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `mysqltest`.* TO `mysqltest_1`@`localhost` WITH GRANT OPTION
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, CREATE TEMPORARY TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY, SHOW CREATE ROUTINE ON `mysqltest`.* TO `mysqltest_1`@`localhost` WITH GRANT OPTION
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
delete from mysql.user where user='mysqltest_1';
flush privileges;
@@ -630,7 +630,7 @@ Select Tables To retrieve rows from table
Show databases Server Admin To see all databases with SHOW DATABASES
Show view Tables To see views with SHOW CREATE VIEW
Shutdown Server Admin To shut down the server
-Super Server Admin To use KILL thread, SET GLOBAL, CHANGE MASTER, etc.
+Super Server Admin To set few server variables
Trigger Tables To use triggers
Create tablespace Server Admin To create/alter/drop tablespaces
Update Tables To update existing rows
@@ -639,6 +639,7 @@ Federated admin Server To execute the CREATE SERVER, ALTER SERVER, DROP SERVER s
Connection admin Server To bypass connection limits and kill other users' connections
Read_only admin Server To perform write operations even if @@read_only=ON
Usage Server Admin No privileges - allow connect only
+Show Create Routine Databases,Functions,Procedures To allow SHOW CREATE PROCEDURE/FUNCTION/PACKAGE
connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connection root;
create database mysqltest;
@@ -776,7 +777,7 @@ flush privileges;
use test;
set @user123="non-existent";
select * from mysql.db where user=@user123;
-Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Execute_priv Event_priv Trigger_priv Delete_history_priv
+Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Execute_priv Event_priv Trigger_priv Delete_history_priv Show_create_routine_priv
set names koi8r;
create database ÂÄ;
grant select on ÂÄ.* to root@localhost;
@@ -1472,8 +1473,6 @@ declare tmp varchar(30);
select col1 from test limit 1 into tmp;
return '1';
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create view v1 as select test.* from test where test.col1=test_function();
grant update (col1) on v1 to 'greg'@'localhost';
drop user 'greg'@'localhost';
@@ -2663,9 +2662,9 @@ create database mysqltest_db1;
create user mysqltest_u1;
# Both GRANT statements below should fail with the same error.
grant execute on function mysqltest_db1.f1 to mysqltest_u1;
-ERROR 42000: FUNCTION or PROCEDURE f1 does not exist
+ERROR 42000: FUNCTION f1 does not exist
grant execute on procedure mysqltest_db1.p1 to mysqltest_u1;
-ERROR 42000: FUNCTION or PROCEDURE p1 does not exist
+ERROR 42000: PROCEDURE p1 does not exist
# Let us show that GRANT behaviour for routines is consistent
# with GRANT behaviour for tables. Attempt to grant privilege
# on non-existent table also results in an error.
@@ -2848,11 +2847,11 @@ CREATE USER ten2;
GRANT ALL ON *.* TO ten2;
SHOW GRANTS FOR ten2;
Grants for ten2@%
-GRANT ALL PRIVILEGES ON *.* TO `ten2`@`%`
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `ten2`@`%`
FLUSH PRIVILEGES;
SHOW GRANTS FOR ten2;
Grants for ten2@%
-GRANT ALL PRIVILEGES ON *.* TO `ten2`@`%`
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `ten2`@`%`
DROP USER ten2;
# switching back from mysql.user to mysql.global_priv
#
diff --git a/mysql-test/main/grant2.result b/mysql-test/main/grant2.result
index 6ba7ddf1..ebf83272 100644
--- a/mysql-test/main/grant2.result
+++ b/mysql-test/main/grant2.result
@@ -161,7 +161,7 @@ connection con10;
set sql_log_off = 1;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
set sql_log_bin = 0;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
disconnect con10;
connection default;
delete from mysql.user where user like 'mysqltest\_1';
@@ -452,8 +452,6 @@ INSERT INTO t2 VALUES (1);
DROP FUNCTION IF EXISTS f2;
CREATE FUNCTION f2 () RETURNS INT
BEGIN DECLARE v INT; SELECT s1 FROM t2 INTO v; RETURN v; END//
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
SELECT f2();
f2()
1
diff --git a/mysql-test/main/grant5.result b/mysql-test/main/grant5.result
index 76a5f537..1297b7e9 100644
--- a/mysql-test/main/grant5.result
+++ b/mysql-test/main/grant5.result
@@ -260,10 +260,13 @@ connect con1,localhost,foo,,db;
create temporary table tmp (a int, key(a));
show tables;
Tables_in_db
+tmp
show full tables;
Tables_in_db Table_type
+tmp TEMPORARY TABLE
show table status;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
+tmp MyISAM 10 Fixed 0 0 X X X X X X X X latin1_swedish_ci NULL X Y
show index in tmp;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
tmp 1 a 1 a A NULL NULL NULL YES BTREE NO
@@ -275,7 +278,7 @@ Field Type Collation Null Key Default Extra Privileges Comment
a int(11) NULL YES MUL NULL select,insert,update,references
# we don't expect to show temporary tables in information_schema.columns
select * from information_schema.columns where table_schema='db';
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
disconnect con1;
connect con1,localhost,bar,,db;
show full columns in tmp;
diff --git a/mysql-test/main/grant5.test b/mysql-test/main/grant5.test
index 49e0ab1a..5a092884 100644
--- a/mysql-test/main/grant5.test
+++ b/mysql-test/main/grant5.test
@@ -225,6 +225,7 @@ grant create temporary tables on db.* to bar@localhost;
create temporary table tmp (a int, key(a));
show tables;
show full tables;
+--replace_column 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X 19 X
show table status;
show index in tmp;
show columns in tmp;
diff --git a/mysql-test/main/grant_binlog_replay.result b/mysql-test/main/grant_binlog_replay.result
index 2c71e70e..ea5e14b5 100644
--- a/mysql-test/main/grant_binlog_replay.result
+++ b/mysql-test/main/grant_binlog_replay.result
@@ -5,15 +5,15 @@
# MDEV-21975 Add BINLOG REPLAY privilege and bind new privileges to gtid_seq_no, preudo_thread_id, server_id, gtid_domain_id
#
#
-# Test that binlog replay statements are not allowed without BINLOG REPLAY or SUPER
+# Test that binlog replay statements are not allowed without BINLOG REPLAY
#
CREATE USER user1@localhost IDENTIFIED BY '';
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG REPLAY, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG REPLAY ON *.* FROM user1@localhost;
connect con1,localhost,user1,,;
connection con1;
BINLOG '';
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG REPLAY privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG REPLAY privilege(s) for this operation
disconnect con1;
connection default;
DROP USER user1@localhost;
@@ -33,20 +33,5 @@ disconnect con1;
connection default;
DROP USER user1@localhost;
#
-# Test that binlog replay statements are allowed with SUPER
-#
-CREATE USER user1@localhost IDENTIFIED BY '';
-GRANT SUPER ON *.* TO user1@localhost;
-SHOW GRANTS FOR user1@localhost;
-Grants for user1@localhost
-GRANT SUPER ON *.* TO `user1`@`localhost`
-connect con1,localhost,user1,,;
-connection con1;
-BINLOG '';
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use
-disconnect con1;
-connection default;
-DROP USER user1@localhost;
-#
# End of 10.5 tests
#
diff --git a/mysql-test/main/grant_binlog_replay.test b/mysql-test/main/grant_binlog_replay.test
index a3078e50..3fd157df 100644
--- a/mysql-test/main/grant_binlog_replay.test
+++ b/mysql-test/main/grant_binlog_replay.test
@@ -9,12 +9,12 @@
--echo #
--echo #
---echo # Test that binlog replay statements are not allowed without BINLOG REPLAY or SUPER
+--echo # Test that binlog replay statements are not allowed without BINLOG REPLAY
--echo #
CREATE USER user1@localhost IDENTIFIED BY '';
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG REPLAY, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG REPLAY ON *.* FROM user1@localhost;
connect (con1,localhost,user1,,);
connection con1;
@@ -25,7 +25,6 @@ disconnect con1;
connection default;
DROP USER user1@localhost;
-
--echo #
--echo # Test that binlog replay statements are allowed with BINLOG REPLAY
--echo #
@@ -46,28 +45,6 @@ disconnect con1;
connection default;
DROP USER user1@localhost;
-
---echo #
---echo # Test that binlog replay statements are allowed with SUPER
---echo #
-
-CREATE USER user1@localhost IDENTIFIED BY '';
-GRANT SUPER ON *.* TO user1@localhost;
-SHOW GRANTS FOR user1@localhost;
-
-connect (con1,localhost,user1,,);
-connection con1;
---error ER_BAD_SLAVE
-# The below fails with a syntax error.
-# This is fine. It's only important that it does not fail on "access denied".
---error ER_SYNTAX_ERROR
-BINLOG '';
---enable_result_log
-disconnect con1;
-
-connection default;
-DROP USER user1@localhost;
-
--echo #
--echo # End of 10.5 tests
--echo #
diff --git a/mysql-test/main/grant_kill.result b/mysql-test/main/grant_kill.result
index e1243a39..39a7e8fd 100644
--- a/mysql-test/main/grant_kill.result
+++ b/mysql-test/main/grant_kill.result
@@ -5,13 +5,13 @@
# MDEV-21743 Split up SUPER privilege to smaller privileges
#
#
-# Test that KILL is not allowed without CONNECTION ADMIN or SUPER
+# Test that KILL is not allowed without CONNECTION ADMIN
#
CREATE USER foo@localhost;
GRANT SELECT ON *.* TO foo@localhost;
CREATE USER bar@localhost;
GRANT ALL PRIVILEGES ON *.* TO bar@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM bar@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM bar@localhost;
connect foo,localhost,foo,,;
connect bar,localhost,bar,,;
SELECT user FROM information_schema.processlist ORDER BY user;
@@ -47,25 +47,5 @@ disconnect bar;
DROP USER foo@localhost;
DROP USER bar@localhost;
#
-# Test that KILL is allowed with SUPER
-#
-CREATE USER foo@localhost;
-GRANT SELECT ON *.* TO foo@localhost;
-CREATE USER bar@localhost;
-GRANT PROCESS, SUPER ON *.* TO bar@localhost;
-connect foo,localhost,foo,,;
-connect bar,localhost,bar,,;
-SELECT user FROM information_schema.processlist ORDER BY user;
-user
-bar
-foo
-root
-KILL ID;
-connection default;
-disconnect foo;
-disconnect bar;
-DROP USER foo@localhost;
-DROP USER bar@localhost;
-#
# End of 10.5 tests
#
diff --git a/mysql-test/main/grant_kill.test b/mysql-test/main/grant_kill.test
index 75a25743..4cd7a84d 100644
--- a/mysql-test/main/grant_kill.test
+++ b/mysql-test/main/grant_kill.test
@@ -12,14 +12,14 @@
--let $count_sessions=1
--echo #
---echo # Test that KILL is not allowed without CONNECTION ADMIN or SUPER
+--echo # Test that KILL is not allowed without CONNECTION ADMIN
--echo #
CREATE USER foo@localhost;
GRANT SELECT ON *.* TO foo@localhost;
CREATE USER bar@localhost;
GRANT ALL PRIVILEGES ON *.* TO bar@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM bar@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM bar@localhost;
--connect (foo,localhost,foo,,)
let $id=`(SELECT id FROM INFORMATION_SCHEMA.PROCESSLIST WHERE user='foo')`;
--connect (bar,localhost,bar,,)
@@ -59,31 +59,6 @@ let $wait_condition=
DROP USER foo@localhost;
DROP USER bar@localhost;
---echo #
---echo # Test that KILL is allowed with SUPER
---echo #
-
-CREATE USER foo@localhost;
-GRANT SELECT ON *.* TO foo@localhost;
-CREATE USER bar@localhost;
-GRANT PROCESS, SUPER ON *.* TO bar@localhost;
---connect (foo,localhost,foo,,)
-let $id=`(SELECT id FROM INFORMATION_SCHEMA.PROCESSLIST WHERE user='foo')`;
---connect (bar,localhost,bar,,)
-SELECT user FROM information_schema.processlist ORDER BY user;
---replace_result $id ID
---eval KILL $id
---connection default
-let $wait_condition=
- select count(*) = 0 from information_schema.processlist
- where user = "foo";
---source include/wait_condition.inc
---disconnect foo
---disconnect bar
---source include/wait_until_count_sessions.inc
-DROP USER foo@localhost;
-DROP USER bar@localhost;
-
--enable_service_connection
--echo #
diff --git a/mysql-test/main/grant_server.result b/mysql-test/main/grant_server.result
index 37b5f67b..b8094f4b 100644
--- a/mysql-test/main/grant_server.result
+++ b/mysql-test/main/grant_server.result
@@ -12,11 +12,11 @@ connection con1;
CREATE SERVER IF NOT EXISTS server_1
FOREIGN DATA WRAPPER mysql
OPTIONS (USER 'mysqltest_1', HOST 'localhost', DATABASE 'test2');
-ERROR 42000: Access denied; you need (at least one of) the SUPER, FEDERATED ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the FEDERATED ADMIN privilege(s) for this operation
ALTER SERVER server_1 OPTIONS(HOST 'Server.Example.Org');
-ERROR 42000: Access denied; you need (at least one of) the SUPER, FEDERATED ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the FEDERATED ADMIN privilege(s) for this operation
DROP SERVER server_1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, FEDERATED ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the FEDERATED ADMIN privilege(s) for this operation
disconnect con1;
connection default;
DROP USER user1@localhost;
@@ -39,7 +39,8 @@ disconnect con1;
connection default;
DROP USER user1@localhost;
#
-# Test that SERVER DDL statements are allowed with SUPER
+# Test that SERVER DDL statements are not allowed with SUPER
+# but only with FEDERATED ADMIN
#
CREATE USER user1@localhost IDENTIFIED BY '';
GRANT SUPER ON *.* TO user1@localhost;
@@ -51,6 +52,15 @@ connection con1;
CREATE SERVER IF NOT EXISTS server_1
FOREIGN DATA WRAPPER mysql
OPTIONS (USER 'mysqltest_1', HOST 'localhost', DATABASE 'test2');
+ERROR 42000: Access denied; you need (at least one of) the FEDERATED ADMIN privilege(s) for this operation
+disconnect con1;
+connection default;
+REVOKE SUPER ON *.* FROM user1@localhost;
+GRANT FEDERATED ADMIN ON *.* TO user1@localhost;
+connect con1,localhost,user1,,;
+CREATE SERVER IF NOT EXISTS server_1
+FOREIGN DATA WRAPPER mysql
+OPTIONS (USER 'mysqltest_1', HOST 'localhost', DATABASE 'test2');
ALTER SERVER server_1 OPTIONS(HOST 'Server.Example.Org');
DROP SERVER server_1;
disconnect con1;
diff --git a/mysql-test/main/grant_server.test b/mysql-test/main/grant_server.test
index 58c6b4e9..f4b61135 100644
--- a/mysql-test/main/grant_server.test
+++ b/mysql-test/main/grant_server.test
@@ -27,7 +27,6 @@ disconnect con1;
connection default;
DROP USER user1@localhost;
-
--echo #
--echo # Test that SERVER DDL statements are allowed with FEDERATED ADMIN
--echo #
@@ -48,9 +47,9 @@ disconnect con1;
connection default;
DROP USER user1@localhost;
-
--echo #
---echo # Test that SERVER DDL statements are allowed with SUPER
+--echo # Test that SERVER DDL statements are not allowed with SUPER
+--echo # but only with FEDERATED ADMIN
--echo #
CREATE USER user1@localhost IDENTIFIED BY '';
@@ -59,6 +58,15 @@ SHOW GRANTS FOR user1@localhost;
connect (con1,localhost,user1,,);
connection con1;
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+CREATE SERVER IF NOT EXISTS server_1
+ FOREIGN DATA WRAPPER mysql
+ OPTIONS (USER 'mysqltest_1', HOST 'localhost', DATABASE 'test2');
+disconnect con1;
+connection default;
+REVOKE SUPER ON *.* FROM user1@localhost;
+GRANT FEDERATED ADMIN ON *.* TO user1@localhost;
+connect (con1,localhost,user1,,);
CREATE SERVER IF NOT EXISTS server_1
FOREIGN DATA WRAPPER mysql
OPTIONS (USER 'mysqltest_1', HOST 'localhost', DATABASE 'test2');
@@ -69,7 +77,6 @@ disconnect con1;
connection default;
DROP USER user1@localhost;
-
--echo #
--echo # End of 10.5 tests
--echo #
diff --git a/mysql-test/main/grant_slave_admin.result b/mysql-test/main/grant_slave_admin.result
index 0f1f2c99..66fc02e9 100644
--- a/mysql-test/main/grant_slave_admin.result
+++ b/mysql-test/main/grant_slave_admin.result
@@ -5,19 +5,19 @@
# MDEV-21743 Split up SUPER privilege to smaller privileges
#
#
-# Test that slave admin statements are not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that slave admin statements are not allowed without REPLICATION SLAVE ADMIN
#
CREATE USER user1@localhost IDENTIFIED BY '';
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect con1,localhost,user1,,;
connection con1;
START SLAVE;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
CHANGE MASTER TO MASTER_HOST='127.0.0.1';
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
STOP SLAVE;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
disconnect con1;
connection default;
DROP USER user1@localhost;
@@ -41,24 +41,5 @@ disconnect con1;
connection default;
DROP USER user1@localhost;
#
-# Test that slave admin statements are allowed with SUPER
-#
-CREATE USER user1@localhost IDENTIFIED BY '';
-GRANT SUPER ON *.* TO user1@localhost;
-SHOW GRANTS FOR user1@localhost;
-Grants for user1@localhost
-GRANT SUPER ON *.* TO `user1`@`localhost`
-connect con1,localhost,user1,,;
-connection con1;
-START SLAVE;
-ERROR HY000: Misconfigured slave: MASTER_HOST was not set; Fix in config file or with CHANGE MASTER TO
-CHANGE MASTER TO MASTER_USER='root';
-STOP SLAVE;
-Warnings:
-Note 1255 Slave already has been stopped
-disconnect con1;
-connection default;
-DROP USER user1@localhost;
-#
# End of 10.5 tests
#
diff --git a/mysql-test/main/grant_slave_admin.test b/mysql-test/main/grant_slave_admin.test
index d73c31e0..f4099975 100644
--- a/mysql-test/main/grant_slave_admin.test
+++ b/mysql-test/main/grant_slave_admin.test
@@ -9,12 +9,12 @@
--echo #
--echo #
---echo # Test that slave admin statements are not allowed without REPLICATION SLAVE ADMIN or SUPER
+--echo # Test that slave admin statements are not allowed without REPLICATION SLAVE ADMIN
--echo #
CREATE USER user1@localhost IDENTIFIED BY '';
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect (con1,localhost,user1,,);
connection con1;
@@ -29,7 +29,6 @@ disconnect con1;
connection default;
DROP USER user1@localhost;
-
--echo #
--echo # Test that slave admin statements are allowed with REPLICATION SLAVE ADMIN
--echo #
@@ -49,26 +48,6 @@ disconnect con1;
connection default;
DROP USER user1@localhost;
-
---echo #
---echo # Test that slave admin statements are allowed with SUPER
---echo #
-
-CREATE USER user1@localhost IDENTIFIED BY '';
-GRANT SUPER ON *.* TO user1@localhost;
-SHOW GRANTS FOR user1@localhost;
-
-connect (con1,localhost,user1,,);
-connection con1;
---error ER_BAD_SLAVE
-START SLAVE;
-CHANGE MASTER TO MASTER_USER='root';
-STOP SLAVE;
-disconnect con1;
-
-connection default;
-DROP USER user1@localhost;
-
--echo #
--echo # End of 10.5 tests
--echo #
diff --git a/mysql-test/main/grant_slave_monitor.result b/mysql-test/main/grant_slave_monitor.result
index 68df7900..61c4ca30 100644
--- a/mysql-test/main/grant_slave_monitor.result
+++ b/mysql-test/main/grant_slave_monitor.result
@@ -1,19 +1,18 @@
CREATE USER user1@localhost IDENTIFIED BY '';
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE SLAVE MONITOR, SUPER ON *.* FROM user1@localhost;
+REVOKE SLAVE MONITOR ON *.* FROM user1@localhost;
FLUSH PRIVILEGES;
connect con1,localhost,user1,,;
connection con1;
SHOW GRANTS;
Grants for user1@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY ON *.* TO `user1`@`localhost`
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SHOW CREATE ROUTINE ON *.* TO `user1`@`localhost`
#
# Verify that having REPLICATION SLAVE ADMIN doesn't allow SHOW SLAVE STATUS
-# Expected error: Access denied; you need (at least one of) the SUPER, SLAVE
-# MONITOR privilege(s) for this operation
+# Expected error: Access denied; you need (at least one of) the SLAVE MONITOR privilege(s) for this operation
#
SHOW SLAVE STATUS;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, SLAVE MONITOR privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the SLAVE MONITOR privilege(s) for this operation
#
# Verify that having REPLICATION SLAVE ADMIN doesn't allow SHOW RELAYLOG EVENTS
# Expected error: Access denied; you need (at least one of) the REPLICA MONITOR
@@ -32,28 +31,13 @@ connect con1,localhost,user1,,;
connection con1;
SHOW GRANTS;
Grants for user1@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `user1`@`localhost`
+GRANT ALL PRIVILEGES ON *.* TO `user1`@`localhost`
SHOW SLAVE STATUS;
SHOW RELAYLOG EVENTS;
disconnect con1;
connection default;
DROP USER user1@localhost;
#
-# SHOW SLAVE STATUS command is allowed with SUPER privilege
-#
-CREATE USER user1@localhost IDENTIFIED BY '';
-GRANT SUPER ON *.* TO user1@localhost;
-connect con1,localhost,user1,,;
-SHOW SLAVE STATUS;
-#
-# SHOW RELAYLOG EVENTS is not allowed with SUPER privilege, it requires SLAVE MONITOR
-#
-SHOW RELAYLOG EVENTS;
-ERROR 42000: Access denied; you need (at least one of) the SLAVE MONITOR privilege(s) for this operation
-disconnect con1;
-connection default;
-DROP USER user1@localhost;
-#
# MDEV-25030 Upgrade to 10.5.9 breaks root's ability to grant
#
insert mysql.global_priv values ('bar', 'foo7', '{"access":274877906943,"version_id":100507,"plugin":"mysql_native_password","authentication_string":""}'),
@@ -65,10 +49,10 @@ Grants for foo7@bar
GRANT ALL PRIVILEGES ON *.* TO `foo7`@`bar` WITH GRANT OPTION
show grants for foo8@bar;
Grants for foo8@bar
-GRANT ALL PRIVILEGES ON *.* TO `foo8`@`bar` WITH GRANT OPTION
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `foo8`@`bar` WITH GRANT OPTION
show grants for foo9@bar;
Grants for foo9@bar
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY ON *.* TO `foo9`@`bar` WITH GRANT OPTION
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `foo9`@`bar` WITH GRANT OPTION
drop user foo7@bar, foo8@bar, foo9@bar;
#
# End of 10.5 tests
diff --git a/mysql-test/main/grant_slave_monitor.test b/mysql-test/main/grant_slave_monitor.test
index af4399b7..b5e65ef2 100644
--- a/mysql-test/main/grant_slave_monitor.test
+++ b/mysql-test/main/grant_slave_monitor.test
@@ -7,14 +7,12 @@
# ==== Implementation ====
#
# Step1: GRANT ALL privileges for a new user 'user1' and then REVOKE
-# SLAVE MONITOR and SUPER privileges.
+# SLAVE MONITOR privileges.
# Step2: Execute SHOW SLAVE STAUTS/SHOW RELAYLOG EVENTS commands and expect
# ER_SPECIFIC_ACCESS_DENIED_ERROR. This also verifies that REPLICATION
# SLAVE ADMIN privilege is not required for these two commands.
# Step3: GRANT SLAVE MONITOR privilege and observe that both commands are
# allowd to execute.
-# Step4: GRANT SUPER privilege and observe that only SHOW SLAVE STATUS command
-# is allowed.
#
# ==== References ====
#
@@ -27,7 +25,7 @@
CREATE USER user1@localhost IDENTIFIED BY '';
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE SLAVE MONITOR, SUPER ON *.* FROM user1@localhost;
+REVOKE SLAVE MONITOR ON *.* FROM user1@localhost;
FLUSH PRIVILEGES;
--connect(con1,localhost,user1,,)
@@ -36,8 +34,7 @@ SHOW GRANTS;
--echo #
--echo # Verify that having REPLICATION SLAVE ADMIN doesn't allow SHOW SLAVE STATUS
---echo # Expected error: Access denied; you need (at least one of) the SUPER, SLAVE
---echo # MONITOR privilege(s) for this operation
+--echo # Expected error: Access denied; you need (at least one of) the SLAVE MONITOR privilege(s) for this operation
--echo #
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SHOW SLAVE STATUS;
@@ -77,30 +74,6 @@ SHOW RELAYLOG EVENTS;
DROP USER user1@localhost;
--echo #
---echo # SHOW SLAVE STATUS command is allowed with SUPER privilege
---echo #
-CREATE USER user1@localhost IDENTIFIED BY '';
-GRANT SUPER ON *.* TO user1@localhost;
-
---connect(con1,localhost,user1,,)
---disable_result_log
-SHOW SLAVE STATUS;
---enable_result_log
-
---echo #
---echo # SHOW RELAYLOG EVENTS is not allowed with SUPER privilege, it requires SLAVE MONITOR
---echo #
-
---disable_ps_protocol
---error ER_SPECIFIC_ACCESS_DENIED_ERROR
-SHOW RELAYLOG EVENTS;
---enable_ps_protocol
---disconnect con1
-
---connection default
-DROP USER user1@localhost;
-
---echo #
--echo # MDEV-25030 Upgrade to 10.5.9 breaks root's ability to grant
--echo #
insert mysql.global_priv values ('bar', 'foo7', '{"access":274877906943,"version_id":100507,"plugin":"mysql_native_password","authentication_string":""}'),
diff --git a/mysql-test/main/greedy_optimizer.result b/mysql-test/main/greedy_optimizer.result
index 55812cb6..5ff3bd62 100644
--- a/mysql-test/main/greedy_optimizer.result
+++ b/mysql-test/main/greedy_optimizer.result
@@ -127,7 +127,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 1693.637037
+Last_query_cost 4.284314
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
@@ -139,55 +139,55 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 1693.637037
+Last_query_cost 4.284314
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
+1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 844.037037
+Last_query_cost 0.602062
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
+1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 844.037037
+Last_query_cost 0.602062
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
+1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 844.037037
+Last_query_cost 0.621783
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where
-1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
+1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
+1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 844.037037
+Last_query_cost 0.621783
set optimizer_prune_level=0;
select @@optimizer_prune_level;
@@optimizer_prune_level
@@ -207,7 +207,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 1371.437037
+Last_query_cost 2.998640
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
@@ -219,87 +219,87 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 1371.437037
+Last_query_cost 2.998640
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using join buffer (flat, BNL join)
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 362.618727
+Last_query_cost 0.602062
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using join buffer (flat, BNL join)
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 362.618727
+Last_query_cost 0.602062
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 362.618727
+Last_query_cost 0.621783
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 362.618727
+Last_query_cost 0.621783
set optimizer_search_depth=1;
select @@optimizer_search_depth;
@@optimizer_search_depth
1
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+1 SIMPLE t7 index PRIMARY PRIMARY 4 NULL 21 Using index
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 1693.637037
+Last_query_cost 42.599713
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+1 SIMPLE t7 index PRIMARY PRIMARY 4 NULL 21 Using index
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 1693.637037
+Last_query_cost 42.599713
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
+1 SIMPLE t3 index PRIMARY PRIMARY 4 NULL 9 Using index
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
@@ -307,19 +307,19 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 844.037037
+Last_query_cost 14.817907
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where
+1 SIMPLE t3 index PRIMARY PRIMARY 4 NULL 9 Using index
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 844.037037
+Last_query_cost 14.817907
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where
@@ -331,7 +331,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 844.037037
+Last_query_cost 1.698747
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where
@@ -343,7 +343,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 844.037037
+Last_query_cost 1.698747
set optimizer_search_depth=62;
select @@optimizer_search_depth;
@@optimizer_search_depth
@@ -359,7 +359,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 1371.437037
+Last_query_cost 2.998640
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
@@ -371,55 +371,55 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 1371.437037
+Last_query_cost 2.998640
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using join buffer (flat, BNL join)
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 362.618727
+Last_query_cost 0.602062
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using join buffer (flat, BNL join)
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 362.618727
+Last_query_cost 0.602062
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 362.618727
+Last_query_cost 0.621783
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
-1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
+1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 362.618727
+Last_query_cost 0.621783
set optimizer_prune_level=2;
select @@optimizer_prune_level;
@@optimizer_prune_level
@@ -439,7 +439,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 1693.637037
+Last_query_cost 4.284314
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
@@ -451,87 +451,87 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 1693.637037
+Last_query_cost 4.284314
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
+1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 844.037037
+Last_query_cost 0.602062
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where
-1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
+1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 844.037037
+Last_query_cost 0.602062
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
+1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 844.037037
+Last_query_cost 0.621783
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where
-1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
+1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 844.037037
+Last_query_cost 0.621783
set optimizer_search_depth=1;
select @@optimizer_search_depth;
@@optimizer_search_depth
1
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+1 SIMPLE t7 index PRIMARY PRIMARY 4 NULL 21 Using index
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 1693.637037
+Last_query_cost 42.599713
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+1 SIMPLE t7 index PRIMARY PRIMARY 4 NULL 21 Using index
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 1693.637037
+Last_query_cost 42.599713
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
+1 SIMPLE t3 index PRIMARY PRIMARY 4 NULL 9 Using index
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
@@ -539,19 +539,19 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 844.037037
+Last_query_cost 14.817907
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where
+1 SIMPLE t3 index PRIMARY PRIMARY 4 NULL 9 Using index
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 844.037037
+Last_query_cost 14.817907
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where
@@ -563,7 +563,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 844.037037
+Last_query_cost 1.698747
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where
@@ -575,7 +575,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 844.037037
+Last_query_cost 1.698747
set optimizer_search_depth=62;
select @@optimizer_search_depth;
@@optimizer_search_depth
@@ -591,7 +591,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 1693.637037
+Last_query_cost 4.284314
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
@@ -603,55 +603,55 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 1693.637037
+Last_query_cost 4.284314
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
+1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 844.037037
+Last_query_cost 0.602062
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where
-1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
+1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using index
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using index
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using index
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 844.037037
+Last_query_cost 0.602062
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
+1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 844.037037
+Last_query_cost 0.621783
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where
-1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where
+1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.c21 1 Using where
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.c12 1 Using where
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t1.c14 1 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t1.c16 1 Using where
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 844.037037
+Last_query_cost 0.621783
drop table t1,t2,t3,t4,t5,t6,t7;
CREATE TABLE t1 (a int, b int, d int, i int);
INSERT INTO t1 VALUES (1,1,1,1);
@@ -802,6 +802,9 @@ WHERE t100.K=t10.I
AND t10000.K=t10.I;
COUNT(*)
9
+#####
+# Expect all variants of EQ joining t100 & t10000 with T10
+# to have same cost # handler_reads:
flush status;
EXPLAIN SELECT COUNT(*) FROM t10,t100,t10000
WHERE t100.K=t10.I
@@ -909,6 +912,12 @@ AND t10000.K=t10.K;
COUNT(*)
9
### NOTE: Handler_reads: 31, expected: 30 ###
+#####
+## EQ_REF Should be executed before table scan(ALL)
+## - Independent of #records in table being EQ_REF-joined
+#####
+#####
+# Expect: Join EQ_REF(t100) before ALL(t10000)
flush status;
EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t100,t10000
WHERE t100.K=t10.I
@@ -948,6 +957,8 @@ WHERE t100.K=t10.I
AND t10000.I=t10.I;
COUNT(*)
9000
+#####
+# Expect: Join EQ_REF(t10000) before ALL(t100) (star-join)
flush status;
EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000,t100
WHERE t100.I=t10.I
@@ -1183,6 +1194,9 @@ AND t10000.I=t10.I;
COUNT(*)
9000
### NOTE: Handler_reads: 9030, expected: 9045 ###
+#####
+## EQ_REF & REF join two instances of t10000 with t10:
+#####
flush status;
EXPLAIN SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000 x,t10000 y
WHERE x.k=t10.i;
@@ -2902,7 +2916,7 @@ EXPLAIN SELECT COUNT(*) FROM t1 AS x JOIN t1 ON t1.K=x.I JOIN t2 ON t2.K=x.I JOI
DROP TABLE t100, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20, t21, t22, t23, t24, t25, t26, t27, t28, t29, t30, t31, t32, t33, t34, t35, t36, t37, t38, t39, t40, t41, t42, t43, t44, t45, t46, t47, t48, t49, t50, t51, t52, t53, t54, t55, t56, t57, t58, t59, t60, t61;
show status like "optimizer%";
Variable_name Value
-Optimizer_join_prefixes_check_calls 57916
+Optimizer_join_prefixes_check_calls 63164
SET OPTIMIZER_SEARCH_DEPTH = DEFAULT;
#
# Bug found when testing greedy optimizer tests
@@ -2917,8 +2931,8 @@ explain SELECT * FROM t1 AS alias1
WHERE alias1.col_varchar_key IN (SELECT COUNT(*) FROM t1 AS SQ3_alias2 JOIN t1 AS SQ3_alias3 ON (SQ3_alias3.col_varchar_key = SQ3_alias2.col_varchar_key AND SQ3_alias3.pk = SQ3_alias2.pk));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias1 index NULL col_varchar_key 20 NULL 2 Using where; Using index
-2 DEPENDENT SUBQUERY SQ3_alias2 index PRIMARY,col_varchar_key col_varchar_key 20 NULL 2 Using index
-2 DEPENDENT SUBQUERY SQ3_alias3 eq_ref PRIMARY,col_varchar_key PRIMARY 4 test.SQ3_alias2.pk 1 Using where
+2 DEPENDENT SUBQUERY SQ3_alias2 index PRIMARY,col_varchar_key col_varchar_key 20 NULL 2 Using where; Using index
+2 DEPENDENT SUBQUERY SQ3_alias3 ref PRIMARY,col_varchar_key col_varchar_key 11 test.SQ3_alias2.col_varchar_key 1 Using where; Using index
drop table t1;
#
# This triggered an assert failure while testing
diff --git a/mysql-test/main/greedy_optimizer.test b/mysql-test/main/greedy_optimizer.test
index 2a830c70..8e90a91d 100644
--- a/mysql-test/main/greedy_optimizer.test
+++ b/mysql-test/main/greedy_optimizer.test
@@ -441,9 +441,9 @@ WHERE t100.K=t10.I
AND t10000.K=t10.I;
--source include/check_qep.inc
-#####
-# Expect all variants of EQ joining t100 & t10000 with T10
-# to have same cost # handler_reads:
+--echo #####
+--echo # Expect all variants of EQ joining t100 & t10000 with T10
+--echo # to have same cost # handler_reads:
let $query=
SELECT COUNT(*) FROM t10,t100,t10000
WHERE t100.K=t10.I
@@ -493,12 +493,12 @@ WHERE t100.K=t10.I
--source include/check_qep.inc
-#####
-## EQ_REF Should be executed before table scan(ALL)
-## - Independent of #records in table being EQ_REF-joined
-#####
-#####
-# Expect: Join EQ_REF(t100) before ALL(t10000)
+--echo #####
+--echo ## EQ_REF Should be executed before table scan(ALL)
+--echo ## - Independent of #records in table being EQ_REF-joined
+--echo #####
+--echo #####
+--echo # Expect: Join EQ_REF(t100) before ALL(t10000)
let $query=
SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t100,t10000
WHERE t100.K=t10.I
@@ -517,8 +517,8 @@ WHERE t100.K=t10.I
AND t10000.I=t10.I;
--source include/check_qep.inc
-#####
-# Expect: Join EQ_REF(t10000) before ALL(t100) (star-join)
+--echo #####
+--echo # Expect: Join EQ_REF(t10000) before ALL(t100) (star-join)
let $query=
SELECT STRAIGHT_JOIN COUNT(*) FROM t10,t10000,t100
WHERE t100.I=t10.I
@@ -654,9 +654,9 @@ WHERE t100.K=t10.I
--source include/check_qep.inc
-#####
-## EQ_REF & REF join two instances of t10000 with t10:
-#####
+--echo #####
+--echo ## EQ_REF & REF join two instances of t10000 with t10:
+--echo #####
#####
## Expect this QEP, cost & #handler_read
diff --git a/mysql-test/main/group_by.result b/mysql-test/main/group_by.result
index b7bbab6d..79102ffa 100644
--- a/mysql-test/main/group_by.result
+++ b/mysql-test/main/group_by.result
@@ -552,12 +552,12 @@ a b
3 1
explain select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL a NULL NULL NULL 4 Using temporary; Using filesort
-1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort
+1 SIMPLE t2 ref a a 4 test.t1.a 1
explain select t1.a,t2.b from t1,t2 where t1.a=t2.a group by t1.a,t2.b ORDER BY NULL;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL a NULL NULL NULL 4 Using temporary
-1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary
+1 SIMPLE t2 ref a a 4 test.t1.a 1
drop table t1,t2;
SET @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity,@@optimizer_switch=@save_optimizer_switch;
create table t1 (a int, b int);
@@ -890,7 +890,8 @@ Level Code Message
drop table t1, t2;
CREATE TABLE t1 (a tinyint(3), b varchar(255), PRIMARY KEY (a));
INSERT INTO t1 VALUES (1,'-----'), (6,'Allemagne'), (17,'Autriche'),
-(25,'Belgique'), (54,'Danemark'), (62,'Espagne'), (68,'France');
+(25,'Belgique'), (54,'Danemark'), (62,'Espagne'), (68,'France'),
+(100,"No land"), (101,"No land");
CREATE TABLE t2 (a tinyint(3), b tinyint(3), PRIMARY KEY (a), KEY b (b));
INSERT INTO t2 VALUES (1,1), (2,1), (6,6), (18,17), (15,25), (16,25),
(17,25), (10,54), (5,62),(3,68);
@@ -1350,7 +1351,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY,i2 PRIMARY 4 NULL 1 Using where; Using index
EXPLAIN SELECT a FROM t1 WHERE a < 2 GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range PRIMARY,i2 PRIMARY 4 NULL 1 Using where; Using index
+1 SIMPLE t1 range PRIMARY,i2 i2 4 NULL 1 Using where; Using index for group-by
EXPLAIN SELECT a FROM t1 IGNORE INDEX (PRIMARY,i2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 144
@@ -1576,7 +1577,7 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN SELECT a FROM t1 FORCE INDEX FOR JOIN (i2)
FORCE INDEX FOR GROUP BY (i2) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL i2 4 NULL 145 Using index for group-by
+1 SIMPLE t1 index NULL i2 9 NULL 144 Using index
EXPLAIN SELECT a FROM t1 USE INDEX () IGNORE INDEX (i2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 144
@@ -1699,7 +1700,7 @@ NULL 1
1 2
EXPLAIN SELECT a from t2 GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range NULL a 5 NULL 7 Using index for group-by
+1 SIMPLE t2 range NULL a 5 NULL 6 Using index for group-by
SELECT a from t2 GROUP BY a;
a
NULL
@@ -1712,6 +1713,18 @@ b
NULL
1
2
+insert into t2 SELECT NULL, NULL from seq_1_to_10;
+EXPLAIN SELECT b from t2 GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 5 NULL 9 Using index for group-by
+# Expect: Using index for group-by
+analyze table t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status Engine-independent statistics collected
+test.t2 analyze status OK
+EXPLAIN SELECT b from t2 GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 5 NULL 6 Using index for group-by
DROP TABLE t1;
DROP TABLE t2;
CREATE TABLE t1 ( a INT, b INT );
@@ -1957,8 +1970,8 @@ SELECT a, AVG(t1.b),
FROM t1 GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL a 10 NULL 9 Using index
-3 DEPENDENT SUBQUERY t12 ref a a 10 func,func 2 Using index condition
-2 DEPENDENT SUBQUERY t11 ref a a 10 func,func 2 Using index condition
+3 DEPENDENT SUBQUERY t12 ref a a 10 func,func 1 Using index condition
+2 DEPENDENT SUBQUERY t11 ref a a 10 func,func 1 Using index condition
SELECT a, AVG(t1.b),
(SELECT t11.c FROM t1 t11 WHERE t11.a = t1.a AND t11.b = AVG(t1.b)) AS t11c,
(SELECT t12.c FROM t1 t12 WHERE t12.a = t1.a AND t12.b = AVG(t1.b)) AS t12c
@@ -2450,7 +2463,7 @@ test.t1 analyze status OK
EXPLAIN SELECT SQL_BUFFER_RESULT MIN(a), b FROM t1 WHERE t1.b = 'a' GROUP BY b;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range b b 9 NULL 2 Using where; Using index for group-by; Using temporary
+1 SIMPLE t1 range b b 9 NULL 1 Using where; Using index for group-by; Using temporary
SELECT SQL_BUFFER_RESULT MIN(a), b FROM t1 WHERE t1.b = 'a' GROUP BY b;
MIN(a) b
@@ -2458,7 +2471,7 @@ MIN(a) b
EXPLAIN SELECT MIN(a), b FROM t1 WHERE t1.b = 'a' GROUP BY b;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range b b 9 NULL 2 Using where; Using index for group-by
+1 SIMPLE t1 range b b 9 NULL 1 Using where; Using index for group-by
SELECT MIN(a), b FROM t1 WHERE t1.b = 'a' GROUP BY b;
MIN(a) b
@@ -2987,3 +3000,34 @@ drop table t20, t21, t22;
#
# End of 10.3 tests
#
+#
+# Test new group_min_max optimization
+#
+create table t1 (a int, b int, c int, key(a,b,c));
+insert into t1 select mod(seq,23),mod(seq,13), mod(seq,5) from seq_1_to_10000;
+explain select a from t1 where a in (1,2,3) group by a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 5 NULL 3 Using where; Using index for group-by
+explain select a from t1 where a in (1,2,3) or a = 22 group by a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 5 NULL 4 Using where; Using index for group-by
+explain select a from t1 where a in (1,2,3) and a < 3 group by a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 5 NULL 2 Using where; Using index for group-by
+explain select a,b from t1 where (a) in (1,2,3) and b in (5,6,7) group by a,b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 10 NULL 9 Using where; Using index for group-by
+explain select a,b from t1 where (a,b) in ((1,1),(2,2),(3,3)) group by a,b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 10 NULL 3 Using where; Using index for group-by
+explain select a,b,c from t1 where (a,b) in ((1,1),(2,2),(3,3)) and c=3 group by a,b,c;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 15 NULL 3 Using where; Using index for group-by
+# Will not use index for group-by
+explain select a from t1 where a in (1,2,3) and b>1 group by a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 10 NULL 983 Using where; Using index
+explain select a from t1 where a in (1,2,3) and c=1 group by a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 5 NULL 1161 Using where; Using index
+drop table t1;
diff --git a/mysql-test/main/group_by.test b/mysql-test/main/group_by.test
index 340a6473..784ba57b 100644
--- a/mysql-test/main/group_by.test
+++ b/mysql-test/main/group_by.test
@@ -1,3 +1,5 @@
+--source include/have_sequence.inc
+
# Initialise
--disable_warnings
drop table if exists t1,t2,t3;
@@ -720,7 +722,8 @@ drop table t1, t2;
CREATE TABLE t1 (a tinyint(3), b varchar(255), PRIMARY KEY (a));
INSERT INTO t1 VALUES (1,'-----'), (6,'Allemagne'), (17,'Autriche'),
- (25,'Belgique'), (54,'Danemark'), (62,'Espagne'), (68,'France');
+ (25,'Belgique'), (54,'Danemark'), (62,'Espagne'), (68,'France'),
+ (100,"No land"), (101,"No land");
CREATE TABLE t2 (a tinyint(3), b tinyint(3), PRIMARY KEY (a), KEY b (b));
@@ -1169,6 +1172,13 @@ SELECT a from t2 GROUP BY a;
EXPLAIN SELECT b from t2 GROUP BY b;
SELECT b from t2 GROUP BY b;
+# Show that we are using 'range' when there is more NULL rows in the table
+insert into t2 SELECT NULL, NULL from seq_1_to_10;
+EXPLAIN SELECT b from t2 GROUP BY a;
+--echo # Expect: Using index for group-by
+analyze table t2;
+EXPLAIN SELECT b from t2 GROUP BY a;
+
DROP TABLE t1;
DROP TABLE t2;
@@ -2135,3 +2145,22 @@ drop table t20, t21, t22;
--echo #
--echo # End of 10.3 tests
--echo #
+
+--echo #
+--echo # Test new group_min_max optimization
+--echo #
+
+create table t1 (a int, b int, c int, key(a,b,c));
+insert into t1 select mod(seq,23),mod(seq,13), mod(seq,5) from seq_1_to_10000;
+
+explain select a from t1 where a in (1,2,3) group by a;
+explain select a from t1 where a in (1,2,3) or a = 22 group by a;
+explain select a from t1 where a in (1,2,3) and a < 3 group by a;
+explain select a,b from t1 where (a) in (1,2,3) and b in (5,6,7) group by a,b;
+explain select a,b from t1 where (a,b) in ((1,1),(2,2),(3,3)) group by a,b;
+explain select a,b,c from t1 where (a,b) in ((1,1),(2,2),(3,3)) and c=3 group by a,b,c;
+
+--echo # Will not use index for group-by
+explain select a from t1 where a in (1,2,3) and b>1 group by a;
+explain select a from t1 where a in (1,2,3) and c=1 group by a;
+drop table t1;
diff --git a/mysql-test/main/group_min_max.result b/mysql-test/main/group_min_max.result
index 452088f3..d8844fce 100644
--- a/mysql-test/main/group_min_max.result
+++ b/mysql-test/main/group_min_max.result
@@ -2230,10 +2230,10 @@ a
BB
EXPLAIN SELECT a FROM t1 WHERE a='AA' GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref PRIMARY PRIMARY 7 const 4 Using where; Using index
+1 SIMPLE t1 range PRIMARY PRIMARY 7 NULL 1 Using where; Using index for group-by
EXPLAIN SELECT a FROM t1 WHERE a='BB' GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref PRIMARY PRIMARY 7 const 1 Using where; Using index
+1 SIMPLE t1 range PRIMARY PRIMARY 7 NULL 1 Using where; Using index for group-by
SELECT DISTINCT a FROM t1 WHERE a='BB';
a
BB
@@ -2353,6 +2353,9 @@ t1;
id2 id3 id5 id4 id3 id6 id5 id1
1 1 1 1 1 1 1 1
DROP TABLE t1,t2,t3,t4,t5,t6;
+#
+# Bug#22342: No results returned for query using max and group by
+#
CREATE TABLE t1 (a int, b int, KEY (a,b), KEY b (b));
INSERT INTO t1 VALUES
(1,1),(1,2),(1,0),(1,3),
@@ -2361,20 +2364,31 @@ ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
+CREATE TABLE t2 (a int, b int, c int, PRIMARY KEY (a,b,c));
+INSERT INTO t2 SELECT a,b,b FROM t1;
explain SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range a,b a 10 NULL 2 Using where; Using index for group-by
+1 SIMPLE t1 range a,b a 10 NULL 1 Using where; Using index for group-by
+insert into t1 select 1,seq from seq_1_to_100;
+explain SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a,b a 10 NULL 1 Using where; Using index for group-by
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a,b a 10 NULL 1 Using where; Using index for group-by
SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a;
MAX(b) a
1 1
SELECT MIN(b), a FROM t1 WHERE b > 1 AND a = 1 GROUP BY a;
MIN(b) a
2 1
-CREATE TABLE t2 (a int, b int, c int, PRIMARY KEY (a,b,c));
-INSERT INTO t2 SELECT a,b,b FROM t1;
explain SELECT MIN(c) FROM t2 WHERE b = 2 and a = 1 and c > 1 GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range PRIMARY PRIMARY 12 NULL 1 Using where; Using index
+1 SIMPLE t2 range PRIMARY PRIMARY 12 NULL 1 Using where; Using index for group-by
SELECT MIN(c) FROM t2 WHERE b = 2 and a = 1 and c > 1 GROUP BY a;
MIN(c)
2
@@ -2446,7 +2460,7 @@ EXPLAIN SELECT (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) x
FROM t1 AS t1_outer;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1_outer index NULL a 10 NULL 15 Using index
-2 SUBQUERY t1 range a a 5 NULL 5 Using where; Using index
+2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index for group-by
EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE EXISTS
(SELECT max(b) FROM t1 GROUP BY a HAVING a < 2);
id select_type table type possible_keys key key_len ref rows Extra
@@ -2456,31 +2470,31 @@ EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE
(SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
-2 SUBQUERY t1 range a a 5 NULL 5 Using where; Using index
+2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index for group-by
EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE
a IN (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1_outer index a a 10 NULL 15 Using where; Using index
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 test.t1_outer.a 1
-2 MATERIALIZED t1 range a a 5 NULL 5 Using where; Using index
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2
+1 PRIMARY t1_outer ref a a 5 <subquery2>.max(b) 3 Using index
+2 MATERIALIZED t1 range a a 5 NULL 2 Using where; Using index for group-by
EXPLAIN SELECT 1 FROM t1 AS t1_outer GROUP BY a HAVING
a > (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1_outer range NULL a 5 NULL 6 Using index for group-by
-2 SUBQUERY t1 range a a 5 NULL 5 Using where; Using index
+2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index for group-by
EXPLAIN SELECT 1 FROM t1 AS t1_outer1 JOIN t1 AS t1_outer2
ON t1_outer1.a = (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2)
AND t1_outer1.b = t1_outer2.b;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1_outer1 ref a a 5 const 1 Using where; Using index
1 PRIMARY t1_outer2 index NULL a 10 NULL 15 Using where; Using index; Using join buffer (flat, BNL join)
-2 SUBQUERY t1 range a a 5 NULL 5 Using where; Using index
+2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index for group-by
EXPLAIN SELECT (SELECT (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) x
FROM t1 AS t1_outer) x2 FROM t1 AS t1_outer2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1_outer2 index NULL a 10 NULL 15 Using index
2 SUBQUERY t1_outer index NULL a 10 NULL 15 Using index
-3 SUBQUERY t1 range a a 5 NULL 5 Using where; Using index
+3 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index for group-by
CREATE TABLE t3 LIKE t1;
FLUSH STATUS;
INSERT INTO t3 SELECT a,MAX(b) FROM t1 GROUP BY a;
@@ -2664,7 +2678,7 @@ a b
3 13
explain extended select sql_buffer_result a, max(b)+1 from t1 where a = 0 group by a;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 range a,index a 5 NULL 3 100.00 Using where; Using index for group-by; Using temporary
+1 SIMPLE t1 range a,index a 5 NULL 1 100.00 Using where; Using index for group-by; Using temporary
Warnings:
Note 1003 select sql_buffer_result `test`.`t1`.`a` AS `a`,max(`test`.`t1`.`b`) + 1 AS `max(b)+1` from `test`.`t1` where `test`.`t1`.`a` = 0 group by `test`.`t1`.`a`
drop table t1;
@@ -3567,7 +3581,7 @@ a c COUNT(DISTINCT c, a, b)
EXPLAIN SELECT COUNT(DISTINCT c, a, b) FROM t2
WHERE a > 5 AND b BETWEEN 10 AND 20 GROUP BY a, b, c;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range a a 5 NULL 1 Using where; Using index
+1 SIMPLE t2 range a a 15 NULL 1 Using where; Using index for group-by
SELECT COUNT(DISTINCT c, a, b) FROM t2
WHERE a > 5 AND b BETWEEN 10 AND 20 GROUP BY a, b, c;
COUNT(DISTINCT c, a, b)
@@ -3659,14 +3673,34 @@ KEY (f1,f2)
) ;
insert into t1 values(1,'A'),(1 , 'B'), (1, 'C'), (2, 'A'),
(3, 'A'), (3, 'B'), (3, 'C'), (3, 'D');
+explain SELECT f1, COUNT(DISTINCT f2) FROM t1 GROUP BY f1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL f1 5 NULL 8 Using index for group-by
SELECT f1, COUNT(DISTINCT f2) FROM t1 GROUP BY f1;
f1 COUNT(DISTINCT f2)
1 3
2 1
3 4
+insert into t1 select seq/10,char(64+mod(seq,4)) from seq_1_to_100;
+explain SELECT f1, COUNT(DISTINCT f2) FROM t1 GROUP BY f1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL f1 5 NULL 10 Using index for group-by
+SELECT f1, COUNT(DISTINCT f2) FROM t1 GROUP BY f1;
+f1 COUNT(DISTINCT f2)
+0 4
+1 4
+2 4
+3 5
+4 4
+5 4
+6 4
+7 4
+8 4
+9 4
+10 4
explain SELECT f1, COUNT(DISTINCT f2) FROM t1 GROUP BY f1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL f1 5 NULL 9 Using index for group-by
+1 SIMPLE t1 range NULL f1 5 NULL 10 Using index for group-by
drop table t1;
# End of test#50539.
#
@@ -4063,7 +4097,7 @@ where t1.PARENT_ID = 1
and t1.PARENT_ID = t2.PARENT_ID
and t2.CHILD_FIELD = "ZZZZ";
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index
+1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where
select
t1.PARENT_ID,
@@ -4243,7 +4277,7 @@ where t1.PARENT_ID = 1
and t1.PARENT_ID = t2.PARENT_ID
and t2.CHILD_FIELD = "ZZZZ";
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index
+1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where
select
t1.PARENT_ID,
@@ -4335,7 +4369,7 @@ CREATE TABLE t1 (p int NOT NULL, a int NOT NULL, PRIMARY KEY (p,a));
insert into t1 select 2,seq from seq_0_to_1000;
EXPLAIN select MIN(a) from t1 where p = 2 group by p;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 10 Using where; Using index for group-by
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 1 Using where; Using index for group-by
SELECT MIN(a) from t1 where p = 2 group by p;
MIN(a)
0
diff --git a/mysql-test/main/group_min_max.test b/mysql-test/main/group_min_max.test
index 68ec1497..764b0702 100644
--- a/mysql-test/main/group_min_max.test
+++ b/mysql-test/main/group_min_max.test
@@ -7,7 +7,7 @@
--source include/default_optimizer_switch.inc
--source include/have_sequence.inc
--source include/have_innodb.inc
---source include/have_sequence.inc
+
#
# TODO:
# Add queries with:
@@ -900,23 +900,27 @@ t1;
DROP TABLE t1,t2,t3,t4,t5,t6;
-#
-# Bug#22342: No results returned for query using max and group by
-#
+--echo #
+--echo # Bug#22342: No results returned for query using max and group by
+--echo #
CREATE TABLE t1 (a int, b int, KEY (a,b), KEY b (b));
INSERT INTO t1 VALUES
(1,1),(1,2),(1,0),(1,3),
(1,-1),(1,-2),(1,-3),(1,-4);
ANALYZE TABLE t1;
+CREATE TABLE t2 (a int, b int, c int, PRIMARY KEY (a,b,c));
+INSERT INTO t2 SELECT a,b,b FROM t1;
explain SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a;
+insert into t1 select 1,seq from seq_1_to_100;
+explain SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a;
+analyze table t1;
+explain SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a;
+
SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a;
SELECT MIN(b), a FROM t1 WHERE b > 1 AND a = 1 GROUP BY a;
-CREATE TABLE t2 (a int, b int, c int, PRIMARY KEY (a,b,c));
-INSERT INTO t2 SELECT a,b,b FROM t1;
explain SELECT MIN(c) FROM t2 WHERE b = 2 and a = 1 and c > 1 GROUP BY a;
SELECT MIN(c) FROM t2 WHERE b = 2 and a = 1 and c > 1 GROUP BY a;
-
DROP TABLE t1,t2;
#
@@ -1390,6 +1394,7 @@ SELECT a, c, COUNT(DISTINCT c, a, b) FROM t2 GROUP BY a, b, c;
EXPLAIN SELECT COUNT(DISTINCT c, a, b) FROM t2
WHERE a > 5 AND b BETWEEN 10 AND 20 GROUP BY a, b, c;
+
SELECT COUNT(DISTINCT c, a, b) FROM t2
WHERE a > 5 AND b BETWEEN 10 AND 20 GROUP BY a, b, c;
@@ -1441,10 +1446,12 @@ CREATE TABLE t1 (
) ;
insert into t1 values(1,'A'),(1 , 'B'), (1, 'C'), (2, 'A'),
(3, 'A'), (3, 'B'), (3, 'C'), (3, 'D');
-
+explain SELECT f1, COUNT(DISTINCT f2) FROM t1 GROUP BY f1;
+SELECT f1, COUNT(DISTINCT f2) FROM t1 GROUP BY f1;
+insert into t1 select seq/10,char(64+mod(seq,4)) from seq_1_to_100;
+explain SELECT f1, COUNT(DISTINCT f2) FROM t1 GROUP BY f1;
SELECT f1, COUNT(DISTINCT f2) FROM t1 GROUP BY f1;
explain SELECT f1, COUNT(DISTINCT f2) FROM t1 GROUP BY f1;
-
drop table t1;
--echo # End of test#50539.
diff --git a/mysql-test/main/group_min_max_innodb.result b/mysql-test/main/group_min_max_innodb.result
index 27656374..c14fed88 100644
--- a/mysql-test/main/group_min_max_innodb.result
+++ b/mysql-test/main/group_min_max_innodb.result
@@ -73,10 +73,10 @@ insert into t1 values ( 1,"e"),(2,"a"),( 3,"c"),(4,"d");
alter table t1 drop primary key, add primary key (f2, f1);
explain select distinct f1 a, f1 b from t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 5 NULL 4 Using index; Using temporary
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary
explain select distinct f1, f2 from t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 5 NULL 4 Using index
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4
drop table t1;
create table t1(pk int primary key) engine=innodb;
create view v1 as select pk from t1 where pk < 20;
@@ -108,7 +108,7 @@ CREATE TABLE t1 (a CHAR(1), b CHAR(1), PRIMARY KEY (a,b)) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('a', 'b'), ('c', 'd');
EXPLAIN SELECT COUNT(DISTINCT a) FROM t1 WHERE b = 'b';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 2 NULL 2 Using where; Using index
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
SELECT COUNT(DISTINCT a) FROM t1 WHERE b = 'b';
COUNT(DISTINCT a)
1
@@ -118,7 +118,7 @@ ENGINE=InnoDB;
INSERT INTO t1 VALUES ('a', 'b'), ('c', 'd');
EXPLAIN SELECT COUNT(DISTINCT a) FROM t1 WHERE b = 'b';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL a 2 NULL 2 Using where; Using index
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
SELECT COUNT(DISTINCT a) FROM t1 WHERE b = 'b';
COUNT(DISTINCT a)
1
@@ -162,7 +162,7 @@ ANALYZE TABLE t2;
EXPLAIN SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' AND i2 = 17) OR ( c1 = 'F')
GROUP BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range k1 k1 5 NULL 31 Using where; Using index
+1 SIMPLE t1 range k1 k1 5 NULL 31 Using where
SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' AND i2 = 17) OR ( c1 = 'F')
GROUP BY c1;
c1 max(i2)
@@ -171,7 +171,7 @@ F 30
EXPLAIN SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' OR ( c1 = 'F' AND i2 = 17))
GROUP BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range k1 k1 5 NULL 31 Using where; Using index
+1 SIMPLE t1 range k1 k1 5 NULL 31 Using where
SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' OR ( c1 = 'F' AND i2 = 17))
GROUP BY c1;
c1 max(i2)
@@ -180,7 +180,7 @@ F 17
EXPLAIN SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' OR c1 = 'F' ) AND ( i2 = 17 )
GROUP BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range k1 k1 5 NULL 1 Using where; Using index for group-by
+1 SIMPLE t1 range k1 k1 5 NULL 2 Using where
SELECT c1, max(i2) FROM t1 WHERE (c1 = 'C' OR c1 = 'F' ) AND ( i2 = 17 )
GROUP BY c1;
c1 max(i2)
@@ -190,7 +190,7 @@ EXPLAIN SELECT c1, max(i2) FROM t1
WHERE ((c1 = 'C' AND (i2 = 40 OR i2 = 30)) OR ( c1 = 'F' AND (i2 = 40 )))
GROUP BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range k1 k1 5 NULL 3 Using where; Using index
+1 SIMPLE t1 range k1 k1 5 NULL 3 Using where
SELECT c1, max(i2) FROM t1
WHERE ((c1 = 'C' AND (i2 = 40 OR i2 = 30)) OR ( c1 = 'F' AND (i2 = 40 )))
GROUP BY c1;
@@ -200,7 +200,7 @@ EXPLAIN SELECT c1, i1, max(i2) FROM t2
WHERE (c1 = 'C' OR ( c1 = 'F' AND i1 < 35)) AND ( i2 = 17 )
GROUP BY c1,i1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range k2 k2 9 NULL 60 Using where; Using index for group-by
+1 SIMPLE t2 range k2 k2 5 NULL 60 Using where
SELECT c1, i1, max(i2) FROM t2
WHERE (c1 = 'C' OR ( c1 = 'F' AND i1 < 35)) AND ( i2 = 17 )
GROUP BY c1,i1;
@@ -211,7 +211,7 @@ EXPLAIN SELECT c1, i1, max(i2) FROM t2
WHERE (((c1 = 'C' AND i1 < 40) OR ( c1 = 'F' AND i1 < 35)) AND ( i2 = 17 ))
GROUP BY c1,i1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range k2 k2 9 NULL 60 Using where; Using index for group-by
+1 SIMPLE t2 range k2 k2 5 NULL 60 Using where
SELECT c1, i1, max(i2) FROM t2
WHERE (((c1 = 'C' AND i1 < 40) OR ( c1 = 'F' AND i1 < 35)) AND ( i2 = 17 ))
GROUP BY c1,i1;
@@ -222,7 +222,7 @@ EXPLAIN SELECT c1, i1, max(i2) FROM t2
WHERE ((c1 = 'C' AND i1 < 40) OR ( c1 = 'F' AND i1 < 35) OR ( i2 = 17 ))
GROUP BY c1,i1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 index k2 k2 9 NULL 180 Using where; Using index
+1 SIMPLE t2 index k2 k2 9 NULL 180 Using where
SELECT c1, i1, max(i2) FROM t2
WHERE ((c1 = 'C' AND i1 < 40) OR ( c1 = 'F' AND i1 < 35) OR ( i2 = 17 ))
GROUP BY c1,i1;
@@ -317,6 +317,7 @@ INSERT INTO t1 VALUES
CREATE TABLE t2 (a varchar(4), b varchar(50), PRIMARY KEY (b,a), KEY (a)) ENGINE=InnoDB;
INSERT INTO t2 VALUES
('BERM','African Methodist Episcopal'),('AUS','Anglican'),('BERM','Anglican'),('BS','Anglican'),('BS','Baptist'),('BS','Methodist');
+ANALYZE TABLE t1,t2 PERSISTENT FOR ALL;
EXPLAIN SELECT t1.a
FROM (SELECT a FROM t2 GROUP BY a ORDER BY COUNT(DISTINCT b) LIMIT 1) dt
JOIN t1 ON dt.a=t1.b;
diff --git a/mysql-test/main/group_min_max_innodb.test b/mysql-test/main/group_min_max_innodb.test
index 33a3a888..419c53db 100644
--- a/mysql-test/main/group_min_max_innodb.test
+++ b/mysql-test/main/group_min_max_innodb.test
@@ -262,6 +262,9 @@ INSERT INTO t1 VALUES
CREATE TABLE t2 (a varchar(4), b varchar(50), PRIMARY KEY (b,a), KEY (a)) ENGINE=InnoDB;
INSERT INTO t2 VALUES
('BERM','African Methodist Episcopal'),('AUS','Anglican'),('BERM','Anglican'),('BS','Anglican'),('BS','Baptist'),('BS','Methodist');
+-- disable_result_log
+ANALYZE TABLE t1,t2 PERSISTENT FOR ALL;
+-- enable_result_log
let query=
SELECT t1.a
diff --git a/mysql-test/main/having_cond_pushdown.result b/mysql-test/main/having_cond_pushdown.result
index 7ebf9945..e49503a7 100644
--- a/mysql-test/main/having_cond_pushdown.result
+++ b/mysql-test/main/having_cond_pushdown.result
@@ -34,6 +34,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -42,7 +43,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 2"
}
@@ -60,6 +63,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -68,7 +72,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 2"
}
@@ -105,12 +111,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 2"
}
@@ -126,12 +135,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 2"
}
@@ -168,6 +180,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -176,7 +189,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1 and t1.a < 4"
}
@@ -194,6 +209,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -202,7 +218,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1 and t1.a < 4"
}
@@ -243,6 +261,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -251,7 +270,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1 or t1.a = 3"
}
@@ -271,6 +292,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -279,7 +301,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1 or t1.a = 3"
}
@@ -319,6 +343,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.a > 2 and max(t1.b) > 13 or t1.a < 3 and min(t1.c) > 1",
"filesort": {
"sort_key": "t1.a",
@@ -328,7 +353,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 2 or t1.a < 3"
}
@@ -347,6 +374,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.a > 2 and max(t1.b) > 13 or t1.a < 3 and min(t1.c) > 1",
"filesort": {
"sort_key": "t1.a",
@@ -356,7 +384,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 2 or t1.a < 3"
}
@@ -393,6 +423,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "max(t1.a) < 3",
"filesort": {
"sort_key": "t1.a",
@@ -402,7 +433,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1"
}
@@ -421,6 +454,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "max(t1.a) < 3",
"filesort": {
"sort_key": "t1.a",
@@ -430,7 +464,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1"
}
@@ -466,6 +502,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "max(t1.b) > 13",
"filesort": {
"sort_key": "t1.a",
@@ -475,7 +512,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1"
}
@@ -494,6 +533,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "max(t1.b) > 13",
"filesort": {
"sort_key": "t1.a",
@@ -503,7 +543,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1"
}
@@ -539,13 +581,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "max(t1.a) = 3",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 3"
}
@@ -562,13 +607,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "max(t1.a) = 3",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 3"
}
@@ -602,13 +650,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "max(t1.b) > 12",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 2"
}
@@ -625,13 +676,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "max(t1.b) > 12",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 2"
}
@@ -665,6 +719,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "max(t1.b) = 13",
"filesort": {
"sort_key": "t1.a",
@@ -674,7 +729,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1"
}
@@ -693,6 +750,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "max(t1.b) = 13",
"filesort": {
"sort_key": "t1.a",
@@ -702,7 +760,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1"
}
@@ -740,6 +800,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "min(t1.c) < 3",
"filesort": {
"sort_key": "t1.a",
@@ -749,7 +810,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1"
}
@@ -768,6 +831,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "min(t1.c) < 3",
"filesort": {
"sort_key": "t1.a",
@@ -777,7 +841,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1"
}
@@ -813,13 +879,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "max(t1.b) = 13 and min(t1.c) = 2",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 2"
}
@@ -836,13 +905,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "max(t1.b) = 13 and min(t1.c) = 2",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 2"
}
@@ -877,6 +949,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.a = test.f1()",
"filesort": {
"sort_key": "t1.a",
@@ -886,7 +959,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1"
}
@@ -905,6 +980,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.a = test.f1()",
"filesort": {
"sort_key": "t1.a",
@@ -914,7 +990,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1"
}
@@ -948,7 +1026,7 @@ GROUP BY v1.a
HAVING (v1.a>1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 4 Using where; Using temporary; Using filesort
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.x 2
+1 PRIMARY <derived2> ref key0 key0 5 test.t2.x 1
2 DERIVED t1 ALL NULL NULL NULL NULL 5 Using where; Using temporary; Using filesort
explain format=json SELECT v1.a
FROM t2,v1
@@ -959,6 +1037,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "v1.a",
"temporary_table": {
@@ -967,7 +1046,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.x > 1 and t2.x is not null"
}
@@ -981,11 +1062,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.x"],
- "rows": 2,
+ "loops": 4,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -994,7 +1078,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1"
}
@@ -1019,6 +1105,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "v1.a",
"temporary_table": {
@@ -1027,7 +1114,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.x > 1 and t2.x is not null"
}
@@ -1041,11 +1130,14 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.x"],
- "rows": 2,
+ "loops": 4,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -1054,7 +1146,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1"
}
@@ -1095,7 +1189,7 @@ GROUP BY v1.c
HAVING (v1.c>2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 4 Using where; Using temporary; Using filesort
-1 PRIMARY <derived2> ref key0 key0 5 test.t2.x 2 Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t2.x 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 5 Using temporary; Using filesort
explain format=json SELECT v1.a,v1.c
FROM t2,v1
@@ -1106,6 +1200,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "v1.c",
"temporary_table": {
@@ -1114,7 +1209,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.x is not null"
}
@@ -1128,12 +1225,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.x"],
- "rows": 2,
+ "loops": 4,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c > 2",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "t1.c > 2",
"filesort": {
"sort_key": "t1.a",
@@ -1143,7 +1243,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1167,6 +1269,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "v1.c",
"temporary_table": {
@@ -1175,7 +1278,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.x is not null"
}
@@ -1189,12 +1294,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.x"],
- "rows": 2,
+ "loops": 4,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v1.c > 2",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "t1.c > 2",
"filesort": {
"sort_key": "t1.a",
@@ -1204,7 +1312,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1256,6 +1366,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -1264,7 +1375,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1 and t1.a is not null and t1.b is not null"
}
@@ -1278,19 +1391,24 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["x", "MAX(t2.y)"],
"ref": ["test.t1.a", "test.t1.b"],
+ "loops": 5,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.x < 5 and t2.x > 1"
}
@@ -1315,6 +1433,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -1323,7 +1442,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1 and t1.a is not null and t1.b is not null"
}
@@ -1337,19 +1458,24 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["x", "MAX(t2.y)"],
"ref": ["test.t1.a", "test.t1.b"],
+ "loops": 5,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.x < 5 and t2.x > 1"
}
@@ -1399,6 +1525,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.b",
"temporary_table": {
@@ -1407,7 +1534,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b < 14 and t1.a is not null and t1.b is not null"
}
@@ -1421,12 +1550,15 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["x", "MAX(t2.y)"],
"ref": ["test.t1.a", "test.t1.b"],
+ "loops": 5,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "`MAX(t2.y)` < 14",
"temporary_table": {
"nested_loop": [
@@ -1434,7 +1566,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.x < 5"
}
@@ -1459,6 +1593,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.b",
"temporary_table": {
@@ -1467,7 +1602,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b < 14 and t1.a is not null and t1.b is not null"
}
@@ -1481,12 +1618,15 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["x", "MAX(t2.y)"],
"ref": ["test.t1.a", "test.t1.b"],
+ "loops": 5,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "`MAX(t2.y)` < 14",
"temporary_table": {
"nested_loop": [
@@ -1494,7 +1634,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.x < 5"
}
@@ -1538,6 +1680,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.c = 2",
"filesort": {
"sort_key": "t1.a",
@@ -1547,7 +1690,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1"
}
@@ -1565,6 +1710,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.c = 2",
"filesort": {
"sort_key": "t1.a",
@@ -1574,7 +1720,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1"
}
@@ -1610,13 +1758,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.a = 2 and t1.c = 2",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = 13"
}
@@ -1633,13 +1784,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.a = 2 and t1.c = 2",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = 13"
}
@@ -1674,6 +1828,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -1682,7 +1837,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c = t1.a and t1.a > 1"
}
@@ -1699,6 +1856,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -1707,7 +1865,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c = t1.a and t1.a > 1"
}
@@ -1743,12 +1903,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 2 and t1.c = 2"
}
@@ -1764,12 +1927,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 2 and t1.c = 2"
}
@@ -1803,6 +1969,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.c = t1.a and t1.a > 1 or t1.a < 3 and t1.c > 3",
"filesort": {
"sort_key": "t1.a",
@@ -1812,7 +1979,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c = t1.a and t1.a > 1 or t1.a < 3"
}
@@ -1831,6 +2000,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.c = t1.a and t1.a > 1 or t1.a < 3 and t1.c > 3",
"filesort": {
"sort_key": "t1.a",
@@ -1840,7 +2010,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c = t1.a and t1.a > 1 or t1.a < 3"
}
@@ -1883,6 +2055,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -1891,7 +2064,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c = t1.a and t1.a < 3"
}
@@ -1909,6 +2084,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -1917,7 +2093,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c = t1.a and t1.a < 3"
}
@@ -1958,6 +2136,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -1966,7 +2145,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c = t1.a and t1.a > 1 and t1.a < 3"
}
@@ -1984,6 +2165,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -1992,7 +2174,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c = t1.a and t1.a > 1 and t1.a < 3"
}
@@ -2032,6 +2216,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.a > 1 and max(t1.c) < 3 or t1.c < 4",
"filesort": {
"sort_key": "t1.a",
@@ -2041,7 +2226,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c = t1.a and (t1.a > 1 or t1.a < 4) and t1.a < 2"
}
@@ -2060,6 +2247,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.a > 1 and max(t1.c) < 3 or t1.c < 4",
"filesort": {
"sort_key": "t1.a",
@@ -2069,7 +2257,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c = t1.a and (t1.a > 1 or t1.a < 4) and t1.a < 2"
}
@@ -2112,6 +2302,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.a > 1 and max(t1.c) < 3 or t1.c < 4",
"filesort": {
"sort_key": "t1.a",
@@ -2121,7 +2312,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c = t1.a and (t1.a > 1 or t1.a < 4)"
}
@@ -2140,6 +2333,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.a > 1 and max(t1.c) < 3 or t1.c < 4",
"filesort": {
"sort_key": "t1.a",
@@ -2149,7 +2343,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c = t1.a and (t1.a > 1 or t1.a < 4)"
}
@@ -2208,6 +2404,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.b = 13 and max(t1.c) > 2",
"filesort": {
"sort_key": "t1.a",
@@ -2217,7 +2414,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -2234,6 +2433,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.b = 13 and max(t1.c) > 2",
"filesort": {
"sort_key": "t1.a",
@@ -2243,7 +2443,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -2281,6 +2483,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a, t1.b",
"temporary_table": {
@@ -2289,7 +2492,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a = 1 or t1.b > 10) and t1.b < 14"
}
@@ -2307,6 +2512,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a, t1.b",
"temporary_table": {
@@ -2315,7 +2521,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a = 1 or t1.b > 10) and t1.b < 14"
}
@@ -2355,6 +2563,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a, t1.b",
"temporary_table": {
@@ -2363,7 +2572,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a = 1 or t1.b > 10) and (t1.b < 14 or t1.b > 15)"
}
@@ -2381,6 +2592,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a, t1.b",
"temporary_table": {
@@ -2389,7 +2601,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a = 1 or t1.b > 10) and (t1.b < 14 or t1.b > 15)"
}
@@ -2428,6 +2642,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a, t1.b",
"temporary_table": {
@@ -2436,7 +2651,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a = 1 or t1.b > 10) and (t1.b < 14 or t1.a = 2 and t1.b > 15)"
}
@@ -2454,6 +2671,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a, t1.b",
"temporary_table": {
@@ -2462,7 +2680,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a = 1 or t1.b > 10) and (t1.b < 14 or t1.a = 2 and t1.b > 15)"
}
@@ -2503,6 +2723,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a, t1.b",
"temporary_table": {
@@ -2511,7 +2732,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 2 or t1.b = 13 and t1.a > 2"
}
@@ -2529,6 +2752,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a, t1.b",
"temporary_table": {
@@ -2537,7 +2761,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 2 or t1.b = 13 and t1.a > 2"
}
@@ -2575,6 +2801,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a, t1.b",
"temporary_table": {
@@ -2583,7 +2810,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = 14 and t1.a < 2 or t1.b = 13 and t1.a > 2"
}
@@ -2601,6 +2830,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a, t1.b",
"temporary_table": {
@@ -2609,7 +2839,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = 14 and t1.a < 2 or t1.b = 13 and t1.a > 2"
}
@@ -2649,6 +2881,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a, t1.b",
"temporary_table": {
@@ -2657,7 +2890,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = 14 and t1.a < 2 or t1.a > 2 and (t1.b = 13 or t1.b = 14)"
}
@@ -2675,6 +2910,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a, t1.b",
"temporary_table": {
@@ -2683,7 +2919,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = 14 and t1.a < 2 or t1.a > 2 and (t1.b = 13 or t1.b = 14)"
}
@@ -2719,6 +2957,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.a < 2 and max(t1.c) = 2 or max(t1.c) > 2 and (t1.a = 1 or t1.a = 2)",
"filesort": {
"sort_key": "t1.a",
@@ -2728,7 +2967,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 2 or t1.a = 1 or t1.a = 2"
}
@@ -2747,6 +2988,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.a < 2 and max(t1.c) = 2 or max(t1.c) > 2 and (t1.a = 1 or t1.a = 2)",
"filesort": {
"sort_key": "t1.a",
@@ -2756,7 +2998,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 2 or t1.a = 1 or t1.a = 2"
}
@@ -2794,6 +3038,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.a = 2 and max(t1.c) = 2 or max(t1.c) > 2 and (t1.a = 1 or t1.a = 2)",
"filesort": {
"sort_key": "t1.a",
@@ -2803,7 +3048,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 2 or t1.a = 1 or t1.a = 2"
}
@@ -2822,6 +3069,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.a = 2 and max(t1.c) = 2 or max(t1.c) > 2 and (t1.a = 1 or t1.a = 2)",
"filesort": {
"sort_key": "t1.a",
@@ -2831,7 +3079,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 2 or t1.a = 1 or t1.a = 2"
}
@@ -2868,13 +3118,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "max(t1.c) = 3",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1"
}
@@ -2891,13 +3144,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "max(t1.c) = 3",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1"
}
@@ -2932,13 +3188,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "max(t1.b = 14)",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.c = 3"
}
@@ -2955,13 +3214,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "max(t1.b) = 14",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.c = 3"
}
@@ -2995,13 +3257,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "max(t1.b = 14)",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.c = 1"
}
@@ -3018,13 +3283,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "max(t1.b) = 14",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.c = 1"
}
@@ -3068,6 +3336,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -3076,7 +3345,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 2 and t1.a < 3"
}
@@ -3094,6 +3365,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -3102,7 +3374,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 2 and t1.a < 3"
}
@@ -3143,12 +3417,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 3 and t1.b > 2"
}
@@ -3164,12 +3441,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 3 and t1.b > 2"
}
@@ -3208,6 +3488,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -3216,7 +3497,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = 14 and t1.a < 3"
}
@@ -3234,6 +3517,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -3242,7 +3526,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = 14 and t1.a < 3"
}
@@ -3283,12 +3569,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.b = 14"
}
@@ -3304,12 +3593,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = 14 and t1.a = 1"
}
@@ -3395,12 +3687,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.c = 1"
}
@@ -3416,12 +3711,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c = 1 and t1.a = 1"
}
@@ -3462,6 +3760,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -3470,7 +3769,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c > 0 and t1.c < 3 and t1.a > 1"
}
@@ -3488,6 +3789,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -3496,7 +3798,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c > 0 and t1.c < 3 and t1.a > 1"
}
@@ -3537,12 +3841,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.c > 0 and t1.c < 3"
}
@@ -3558,12 +3865,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.c > 0 and t1.c < 3"
}
@@ -3602,13 +3912,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"const_condition": "1",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.c < 3"
}
@@ -3624,12 +3937,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.c < 3"
}
@@ -3713,12 +4029,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.b = 2 and t3.d = 1 and t3.a = 1"
}
@@ -3734,12 +4053,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.b = 2 and t3.d = 1 and t3.a = 1"
}
@@ -3778,6 +4100,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -3786,7 +4109,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a > 1 or t1.c < 3) and t1.a < 2"
}
@@ -3804,6 +4129,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -3812,7 +4138,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a > 1 or t1.c < 3) and t1.a < 2"
}
@@ -3901,6 +4229,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -3909,7 +4238,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1 and t1.a < 4 and t1.a > 0"
}
@@ -3927,6 +4258,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -3935,7 +4267,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1 and t1.a < 4 and t1.a > 0"
}
@@ -3976,13 +4310,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"const_condition": "1 and 1",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1"
}
@@ -3998,12 +4335,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1"
}
@@ -4044,6 +4384,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -4052,7 +4393,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1 and (t1.a < 4 or t1.a > 0)"
}
@@ -4070,6 +4413,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -4078,7 +4422,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1 and (t1.a < 4 or t1.a > 0)"
}
@@ -4119,13 +4465,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"const_condition": "1",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1"
}
@@ -4141,12 +4490,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1"
}
@@ -4187,6 +4539,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.c > 1",
"filesort": {
"sort_key": "t1.a",
@@ -4196,7 +4549,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1 and t1.c < 3 and t1.a < 4"
}
@@ -4216,6 +4571,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.c > 1",
"filesort": {
"sort_key": "t1.a",
@@ -4225,7 +4581,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1 and t1.c < 3 and t1.a < 4"
}
@@ -4263,6 +4621,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"const_condition": "1",
"filesort": {
"sort_key": "t1.c",
@@ -4272,7 +4631,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.c < 3 and t1.c > 1"
}
@@ -4291,6 +4652,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.c",
"temporary_table": {
@@ -4299,7 +4661,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.c < 3 and t1.c > 1"
}
@@ -4339,13 +4703,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"const_condition": "1 and 1",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.c = 3"
}
@@ -4362,12 +4729,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.c = 3"
}
@@ -4405,13 +4775,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t3.d > 0",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.a = 1 and t3.d = 1 and t3.b = 2"
}
@@ -4429,13 +4802,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t3.d > 0",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.a = 1 and t3.d = 1 and t3.b = 2"
}
@@ -4473,13 +4849,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"const_condition": "1",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.a = 1 and t3.d = 1 and t3.b = 2"
}
@@ -4496,12 +4875,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.a = 1 and t3.d = 1 and t3.b = 2"
}
@@ -4542,6 +4924,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.c > 1",
"filesort": {
"sort_key": "t1.a",
@@ -4551,7 +4934,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a > 1 or t1.c < 3) and t1.a < 4"
}
@@ -4571,6 +4956,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "t1.c > 1",
"filesort": {
"sort_key": "t1.a",
@@ -4580,7 +4966,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a > 1 or t1.c < 3) and t1.a < 4"
}
@@ -4624,6 +5012,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a, t1.c",
"temporary_table": {
@@ -4632,7 +5021,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a > 1 or t1.c < 3) and t1.a < 4 and t1.c > 1"
}
@@ -4651,6 +5042,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a, t1.c",
"temporary_table": {
@@ -4659,7 +5051,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a > 1 or t1.c < 3) and t1.a < 4 and t1.c > 1"
}
@@ -4703,6 +5097,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a, t1.c",
"temporary_table": {
@@ -4711,7 +5106,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a = 1 or t1.a = 3) and (t1.a = 4 or t1.c > 1)"
}
@@ -4730,6 +5127,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a, t1.c",
"temporary_table": {
@@ -4738,7 +5136,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a = 1 or t1.a = 3) and (t1.a = 4 or t1.c > 1)"
}
@@ -4779,12 +5179,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.c = 1"
}
@@ -4800,12 +5203,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.c = 1"
}
@@ -4844,12 +5250,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.c = 1"
}
@@ -4866,12 +5275,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.c = 1"
}
@@ -5051,6 +5463,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t3.a",
"temporary_table": {
@@ -5059,7 +5472,9 @@ EXPLAIN
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.d = t3.a and t3.a > 1 and (t3.c = 3 or t3.c < 2) and (t3.a = 1 or t3.a > 1)"
}
@@ -5078,6 +5493,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t3.a",
"temporary_table": {
@@ -5086,7 +5502,9 @@ EXPLAIN
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.d = t3.a and t3.a > 1 and (t3.c = 3 or t3.c < 2) and (t3.a = 1 or t3.a > 1)"
}
@@ -5125,6 +5543,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t3.a",
"temporary_table": {
@@ -5133,7 +5552,9 @@ EXPLAIN
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.d = t3.a and t3.a > 1 and (t3.c = 3 or t3.c < 2) and (t3.c = t3.a and t3.c < 15 or t3.a > 1)"
}
@@ -5152,6 +5573,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t3.a",
"temporary_table": {
@@ -5160,7 +5582,9 @@ EXPLAIN
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.d = t3.a and t3.a > 1 and (t3.c = 3 or t3.c < 2) and (t3.c = t3.a and t3.a < 15 or t3.a > 1)"
}
@@ -5240,6 +5664,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.d1",
"temporary_table": {
@@ -5248,7 +5673,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.d1 between <cache>(inet_aton('1978-04-27')) and <cache>('2018-08-26')"
}
@@ -5282,6 +5709,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.d1",
"temporary_table": {
@@ -5290,7 +5718,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.d1 not between <cache>(0) and <cache>(exp(0))"
}
@@ -5357,6 +5787,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"temporary_table": {
@@ -5365,7 +5796,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 8 or t1.a = (subquery#2)"
}
@@ -5375,12 +5808,15 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -5401,6 +5837,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a, t1.b",
"temporary_table": {
@@ -5409,7 +5846,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a = 8 or t1.a = (subquery#2)) and t1.b < 20"
}
@@ -5419,12 +5858,15 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -5445,6 +5887,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "sum(t1.b) > 20",
"filesort": {
"sort_key": "t1.a",
@@ -5454,7 +5897,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 8 or t1.a = (subquery#2)"
}
@@ -5464,12 +5909,15 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -5490,12 +5938,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = (subquery#2)"
}
@@ -5505,12 +5956,15 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
diff --git a/mysql-test/main/having_cond_pushdown.test b/mysql-test/main/having_cond_pushdown.test
index 99e4a597..be186995 100644
--- a/mysql-test/main/having_cond_pushdown.test
+++ b/mysql-test/main/having_cond_pushdown.test
@@ -23,12 +23,14 @@ HAVING (t1.a>2);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b)
FROM t1
WHERE (t1.a>2)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # conjunctive subformula : using equality
@@ -40,12 +42,14 @@ HAVING (t1.a=2);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b)
FROM t1
WHERE (t1.a=2)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # extracted AND formula
@@ -57,12 +61,14 @@ HAVING (t1.a>1) AND (t1.a<4);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b)
FROM t1
WHERE (t1.a>1) AND (t1.a<4)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # extracted OR formula
@@ -75,6 +81,7 @@ eval $no_pushdown $query;
eval $query;
--enable_prepare_warnings
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
--disable_prepare_warnings
let $query=
@@ -83,6 +90,7 @@ FROM t1
WHERE (t1.a>1) OR (a IN (SELECT 3))
GROUP BY t1.a;
--enable_prepare_warnings
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--disable_prepare_warnings
@@ -94,6 +102,7 @@ HAVING ((t1.a>2) AND (MAX(t1.b)>13)) OR ((t1.a<3) AND (MIN(t1.c)>1));
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
@@ -101,6 +110,7 @@ FROM t1
WHERE (t1.a>2) OR (t1.a<3)
GROUP BY t1.a
HAVING ((t1.a>2) AND (MAX(t1.b)>13)) OR ((t1.a<3) AND (MIN(t1.c)>1));
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # conjunctive subformula : no aggregation formula pushdown
@@ -112,6 +122,7 @@ HAVING (t1.a>1) AND (MAX(t1.a)<3);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b)
@@ -119,6 +130,7 @@ FROM t1
WHERE (t1.a>1)
GROUP BY t1.a
HAVING (MAX(t1.a)<3);
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -129,6 +141,7 @@ HAVING (t1.a>1) AND (MAX(t1.b)>13);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b)
@@ -136,6 +149,7 @@ FROM t1
WHERE (t1.a>1)
GROUP BY t1.a
HAVING (MAX(t1.b)>13);
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -146,6 +160,7 @@ HAVING (t1.a=3) AND (MAX(t1.a)=3);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b)
@@ -153,6 +168,7 @@ FROM t1
WHERE (t1.a=3)
GROUP BY t1.a
HAVING (MAX(t1.a)=3);
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -163,6 +179,7 @@ HAVING (t1.a=2) AND (MAX(t1.b)>12);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b)
@@ -170,6 +187,7 @@ FROM t1
WHERE (t1.a=2)
GROUP BY t1.a
HAVING (MAX(t1.b)>12);
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -180,6 +198,7 @@ HAVING (t1.a>1) AND (MAX(t1.b)=13);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b)
@@ -187,6 +206,7 @@ FROM t1
WHERE (t1.a>1)
GROUP BY t1.a
HAVING (MAX(t1.b)=13);
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -197,6 +217,7 @@ HAVING (t1.a>1) AND (MIN(t1.c)<3);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MIN(t1.c)
@@ -204,6 +225,7 @@ FROM t1
WHERE (t1.a>1)
GROUP BY t1.a
HAVING (MIN(t1.c)<3);
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -214,6 +236,7 @@ HAVING (t1.a=2) AND (MAX(t1.b)=13) AND (MIN(t1.c)=2);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MIN(t1.c)
@@ -221,6 +244,7 @@ FROM t1
WHERE (t1.a=2)
GROUP BY t1.a
HAVING (MAX(t1.b)=13) AND (MIN(t1.c)=2);
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # conjunctive subformula : no stored function pushdown
@@ -232,6 +256,7 @@ HAVING (t1.a>1) AND (a=test.f1());
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b)
@@ -239,6 +264,7 @@ FROM t1
WHERE (t1.a>1)
GROUP BY t1.a
HAVING (a=test.f1());
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # conjunctive subformula : pushdown into derived table WHERE clause
@@ -251,12 +277,14 @@ HAVING (v1.a>1);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT v1.a
FROM t2,v1
WHERE (t2.x=v1.a) AND (v1.a>1)
GROUP BY v1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # conjunctive subformula : pushdown into derived table HAVING clause
@@ -269,12 +297,14 @@ HAVING (v1.c>2);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT v1.a,v1.c
FROM t2,v1
WHERE (t2.x=v1.a) AND (v1.c>2)
GROUP BY v1.c;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # conjunctive subformula : pushdown into materialized IN subquery
@@ -288,6 +318,7 @@ HAVING (t1.a>1);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT * FROM t1
@@ -295,6 +326,7 @@ WHERE
(t1.a>1) AND
(t1.a,t1.b) IN (SELECT t2.x,MAX(t2.y) FROM t2 WHERE t2.x<5 GROUP BY t2.x)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # conjunctive subformula : pushdown into materialized IN subquery
@@ -308,6 +340,7 @@ HAVING (t1.b<14);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT * FROM t1
@@ -315,6 +348,7 @@ WHERE
(t1.b<14) AND
(t1.a,t1.b) IN (SELECT t2.x,MAX(t2.y) FROM t2 WHERE t2.x<5 GROUP BY t2.x)
GROUP BY t1.b;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # non-standard allowed queries
@@ -327,12 +361,14 @@ HAVING (t1.c=2) AND (t1.a>1);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c FROM t1
WHERE (t1.a>1)
GROUP BY t1.a
HAVING (t1.c=2);
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -343,6 +379,7 @@ HAVING (t1.a=2) AND (t1.b=13) AND (t1.c=2);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT MAX(t1.a),t1.a,t1.b,t1.c
@@ -350,6 +387,7 @@ FROM t1
WHERE (t1.b=13)
GROUP BY t1.b
HAVING (t1.a=2) AND (t1.c=2);
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # extracted AND formula : using equalities
@@ -361,11 +399,13 @@ HAVING (t1.a=t1.c) AND (t1.c>1);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b) FROM t1
WHERE (t1.a=t1.c) AND (t1.a>1)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -376,12 +416,14 @@ HAVING (t1.a=t1.c) AND (t1.c=2);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
FROM t1
WHERE (t1.a=t1.c) AND (t1.a=2)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -392,6 +434,7 @@ HAVING ((t1.a=t1.c) AND (t1.a>1)) OR ((t1.a<3) AND (t1.c>3));
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
@@ -399,6 +442,7 @@ FROM t1
WHERE ((t1.a=t1.c) AND (t1.a>1)) OR (t1.a<3)
GROUP BY t1.a
HAVING ((t1.a=t1.c) AND (t1.a>1)) OR ((t1.a<3) AND (t1.c>3));
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # conjuctive subformula : pushdown using WHERE multiple equalities
@@ -411,12 +455,14 @@ HAVING (t1.c<3);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
FROM t1
WHERE (t1.a=t1.c) AND (t1.c<3)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # extracted AND-formula : pushdown using WHERE multiple equalities
@@ -429,12 +475,14 @@ HAVING (t1.a>1) AND (t1.c<3);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
FROM t1
WHERE (t1.a=t1.c) AND (t1.a>1) AND (t1.c<3)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -446,6 +494,7 @@ HAVING (((t1.a>1) AND (MAX(t1.c)<3)) OR (t1.c<4)) AND (t1.a<2);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
@@ -453,6 +502,7 @@ FROM t1
WHERE (t1.a=t1.c) AND (((t1.a>1) OR (t1.c<4)) AND (t1.a<2))
GROUP BY t1.a
HAVING ((t1.a>1) AND (MAX(t1.c)<3)) OR (t1.c<4);
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # extracted OR-formula : pushdown using WHERE multiple equalities
@@ -465,6 +515,7 @@ HAVING ((t1.a>1) AND (MAX(t1.c)<3)) OR (t1.c<4);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
@@ -472,6 +523,7 @@ FROM t1
WHERE (t1.a=t1.c) AND ((t1.a>1) OR (t1.c<4))
GROUP BY t1.a
HAVING ((t1.a>1) AND (MAX(t1.c)<3)) OR (t1.c<4);
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
DROP TABLE t1,t2;
@@ -510,12 +562,14 @@ HAVING t1.b = 13 AND MAX(t1.c) > 2;
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,t1.b,MAX(t1.c)
FROM t1
GROUP BY t1.a
HAVING t1.b = 13 AND MAX(t1.c) > 2;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # extracted AND formula
@@ -527,12 +581,14 @@ HAVING (t1.a = 1 OR t1.b > 10) AND (t1.b < 14);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,t1.b,MAX(t1.c)
FROM t1
WHERE (t1.a = 1 OR t1.b > 10) AND (t1.b < 14)
GROUP BY t1.a,t1.b;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -543,12 +599,14 @@ HAVING (t1.a = 1 OR t1.b > 10) AND (t1.b < 14 OR t1.b > 15);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,t1.b,MAX(t1.c)
FROM t1
WHERE (t1.a = 1 OR t1.b > 10) AND (t1.b < 14 OR t1.b > 15)
GROUP BY t1.a,t1.b;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # extracted AND formula : equality in the inner AND formula
@@ -560,12 +618,14 @@ HAVING (t1.a = 1 OR t1.b > 10) AND (t1.b < 14 OR (t1.b > 15 AND t1.a = 2));
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,t1.b,MAX(t1.c)
FROM t1
WHERE (t1.a = 1 OR t1.b > 10) AND (t1.b < 14 OR (t1.b > 15 AND t1.a = 2))
GROUP BY t1.a,t1.b;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # extracted OR formula
@@ -577,12 +637,14 @@ HAVING (t1.a < 2) OR (t1.b = 13 AND t1.a > 2);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,t1.b,MAX(t1.c)
FROM t1
WHERE (t1.a < 2) OR (t1.b = 13 AND t1.a > 2)
GROUP BY t1.a,t1.b;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -593,12 +655,14 @@ HAVING (t1.a < 2 AND t1.b = 14) OR (t1.a > 2 AND t1.b = 13);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,t1.b,MAX(t1.c)
FROM t1
WHERE (t1.a < 2 AND t1.b = 14) OR (t1.a > 2 AND t1.b = 13)
GROUP BY t1.a,t1.b;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -609,12 +673,14 @@ HAVING (t1.a < 2 AND t1.b = 14) OR (t1.a > 2 AND (t1.b = 13 OR t1.b = 14));
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,t1.b,MAX(t1.c)
FROM t1
WHERE (t1.a < 2 AND t1.b = 14) OR (t1.a > 2 AND (t1.b = 13 OR t1.b = 14))
GROUP BY t1.a,t1.b;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -625,6 +691,7 @@ HAVING (t1.a < 2 AND MAX(t1.c) = 2) OR (MAX(t1.c) > 2 AND (t1.a = 1 OR t1.a = 2)
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,t1.b,MAX(t1.c)
@@ -632,6 +699,7 @@ FROM t1
WHERE (t1.a < 2) OR (t1.a = 1 OR t1.a = 2)
GROUP BY t1.a
HAVING (t1.a < 2 AND MAX(t1.c) = 2) OR (MAX(t1.c) > 2 AND (t1.a = 1 OR t1.a = 2));
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -642,6 +710,7 @@ HAVING (t1.a = 2 AND MAX(t1.c) = 2) OR (MAX(t1.c) > 2 AND (t1.a = 1 OR t1.a = 2)
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,t1.b,MAX(t1.c)
@@ -649,6 +718,7 @@ FROM t1
WHERE (t1.a = 2) OR (t1.a = 1 OR t1.a = 2)
GROUP BY t1.a
HAVING (t1.a = 2 AND MAX(t1.c) = 2) OR (MAX(t1.c) > 2 AND (t1.a = 1 OR t1.a = 2));
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # conjunctive subformula : equality pushdown
@@ -660,6 +730,7 @@ HAVING (t1.a = 1) AND (MAX(t1.c) = 3);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,t1.b,MAX(t1.c)
@@ -667,6 +738,7 @@ FROM t1
WHERE (t1.a = 1)
GROUP BY t1.a
HAVING (MAX(t1.c) = 3);
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # conjunctive subformula : equalities pushdown
@@ -678,6 +750,7 @@ HAVING (t1.a = 1) AND (t1.c = 3) AND MAX(t1.b = 14);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,t1.b,MAX(t1.c)
@@ -685,6 +758,7 @@ FROM t1
WHERE (t1.a = 1) AND (t1.c = 3)
GROUP BY t1.a,t1.c
HAVING (MAX(t1.b) = 14);
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # conjunctive subformula : multiple equality consists of
@@ -697,6 +771,7 @@ HAVING (t1.a = 1) AND (t1.c = 1) AND MAX(t1.b = 14);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,t1.b,MAX(t1.c)
@@ -704,6 +779,7 @@ FROM t1
WHERE (t1.a = 1) AND (t1.c = 1)
GROUP BY t1.a,t1.c
HAVING (MAX(t1.b) = 14);
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo #
@@ -720,12 +796,14 @@ HAVING (t1.a < 3);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,t1.b,MAX(t1.c)
FROM t1
WHERE (t1.b > 2) AND (t1.a < 3)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # equality : inequality in WHERE
@@ -738,12 +816,14 @@ HAVING (t1.a = 3);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,t1.b,MAX(t1.c)
FROM t1
WHERE (t1.b > 2) AND (t1.a = 3)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # inequality : equality in WHERE
@@ -756,12 +836,14 @@ HAVING (t1.a < 3);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,t1.b,MAX(t1.c)
FROM t1
WHERE (t1.b = 14) AND (t1.a < 3)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # equality : equality in WHERE
@@ -774,12 +856,14 @@ HAVING (t1.a = 1);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,t1.b,MAX(t1.c)
FROM t1
WHERE (t1.b = 14) AND (t1.a = 1)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # equality : equality in WHERE, impossible WHERE
@@ -792,12 +876,14 @@ HAVING (t1.a = 1);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.c)
FROM t1
WHERE (t1.a = 3) AND (t1.a = 1)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # equality : equality in WHERE (equal through constant)
@@ -810,12 +896,14 @@ HAVING (t1.a = 1);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
FROM t1
WHERE (t1.c = 1) AND (t1.a = 1)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # inequality : AND formula in WHERE
@@ -828,12 +916,14 @@ HAVING (t1.a > 1);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
FROM t1
WHERE (t1.c > 0) AND (t1.c < 3) AND (t1.a > 1)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # equality : AND formula in WHERE
@@ -846,12 +936,14 @@ HAVING (t1.a = 1);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
FROM t1
WHERE (t1.c > 0) AND (t1.c < 3) AND (t1.a = 1)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # equality : AND formula in WHERE, impossible WHERE
@@ -864,12 +956,14 @@ HAVING (t1.a = 1);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
FROM t1
WHERE (t1.a > 0) AND (t1.c < 3) AND (t1.a = 1)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -881,12 +975,14 @@ HAVING (t1.a = 1);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b)
FROM t1
WHERE (t1.a = 0) AND (t1.a = 3) AND (t1.a = 1)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -898,12 +994,14 @@ HAVING (t3.a = 1);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t3.a,t3.b,MAX(t3.c),t3.d
FROM t3
WHERE (t3.b = 2) AND (t3.d = 1) AND (t3.a = 1)
GROUP BY t3.a,t3.b,t3.d;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # inequality : OR formula in WHERE
@@ -916,12 +1014,14 @@ HAVING (t1.a < 2);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
FROM t1
WHERE ((t1.a > 1) OR (t1.c < 3)) AND (t1.a < 2)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -933,12 +1033,14 @@ HAVING (t1.a = 2);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b)
FROM t1
WHERE ((t1.a = 1) OR (t1.a = 3)) AND (t1.a = 2)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # AND formula : inequality in WHERE
@@ -951,12 +1053,14 @@ HAVING (t1.a < 4) AND (t1.a > 0);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
FROM t1
WHERE (t1.a > 1) AND (t1.a < 4) AND (t1.a > 0)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # AND formula : equality in WHERE
@@ -969,12 +1073,14 @@ HAVING (t1.a < 4) AND (t1.a > 0);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
FROM t1
WHERE (t1.a = 1) AND (t1.a < 4) AND (t1.a > 0)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # OR formula : inequality in WHERE
@@ -987,12 +1093,14 @@ HAVING (t1.a < 4) OR (t1.a > 0);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
FROM t1
WHERE (t1.a > 1) AND ((t1.a < 4) OR (t1.a > 0))
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # OR formula : equality in WHERE
@@ -1005,12 +1113,14 @@ HAVING (t1.a < 4) OR (t1.a > 0);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
FROM t1
WHERE (t1.a = 1) AND ((t1.a < 4) OR (t1.a > 0))
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # AND formula : AND formula in WHERE
@@ -1023,6 +1133,7 @@ HAVING (t1.a < 4) AND (t1.c > 1);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
@@ -1031,6 +1142,7 @@ WHERE ((t1.a > 1) AND (t1.c < 3)) AND
(t1.a < 4)
GROUP BY t1.a
HAVING (t1.c > 1);
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -1042,6 +1154,7 @@ HAVING (t1.a < 4) AND (t1.c > 1);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
@@ -1049,6 +1162,7 @@ FROM t1
WHERE ((t1.a = 1) AND (t1.c < 3)) AND
((t1.a < 4) AND (t1.c > 1))
GROUP BY t1.a,t1.c;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -1060,6 +1174,7 @@ HAVING (t1.a < 4) AND (t1.c > 1);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
@@ -1067,6 +1182,7 @@ FROM t1
WHERE ((t1.a = 1) AND (t1.c = 3)) AND
((t1.a < 4) AND (t1.c > 1))
GROUP BY t1.a,t1.c;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -1078,6 +1194,7 @@ HAVING (t3.b = 2) AND (t3.d > 0);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t3.a,t3.b,MAX(t3.c),t3.d
@@ -1086,6 +1203,7 @@ WHERE (t3.a = 1) AND (t3.d = 1) AND
(t3.b = 2)
GROUP BY t3.a,t3.b
HAVING (t3.d > 0);
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -1097,6 +1215,7 @@ HAVING (t3.b = 2) AND (t3.d > 0);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t3.a,t3.b,MAX(t3.c),t3.d
@@ -1104,6 +1223,7 @@ FROM t3
WHERE (t3.a = 1) AND (t3.d = 1) AND
(t3.b = 2) AND (t3.d > 0)
GROUP BY t3.a,t3.b,t3.d;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # AND formula : OR formula in WHERE
@@ -1116,6 +1236,7 @@ HAVING (t1.a < 4) AND (t1.c > 1);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
@@ -1124,6 +1245,7 @@ WHERE ((t1.a > 1) OR (t1.c < 3)) AND
(t1.a < 4)
GROUP BY t1.a
HAVING (t1.c > 1);
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -1135,6 +1257,7 @@ HAVING (t1.a < 4) AND (t1.c > 1);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
@@ -1142,6 +1265,7 @@ FROM t1
WHERE ((t1.a > 1) OR (t1.c < 3)) AND
(t1.a < 4) AND (t1.c > 1)
GROUP BY t1.a,t1.c;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -1153,6 +1277,7 @@ HAVING (t1.a = 4) OR (t1.c > 1);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
@@ -1160,6 +1285,7 @@ FROM t1
WHERE ((t1.a = 1) OR (t1.a = 3)) AND
((t1.a = 4) OR (t1.c > 1))
GROUP BY t1.a,t1.c;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # equality : pushdown through equality in WHERE
@@ -1172,12 +1298,14 @@ HAVING (t1.c = 1);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
FROM t1
WHERE (t1.a = 1) AND (t1.a = t1.c) AND (t1.c = 1)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # OR formula : pushdown through equality
@@ -1190,6 +1318,7 @@ HAVING (t1.c = 1) OR (t1.c = 2);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
@@ -1197,6 +1326,7 @@ FROM t1
WHERE (t1.a = 1) AND (t1.a = t1.c) AND
((t1.c = 1) OR (t1.c = 2))
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # OR formula : pushdown through equality, impossible WHERE
@@ -1209,6 +1339,7 @@ HAVING (t1.c = 3) OR (t1.c = 2);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
@@ -1216,6 +1347,7 @@ FROM t1
WHERE (t1.a = 1) AND (t1.a = t1.c) AND
((t1.c = 3) OR (t1.c = 2))
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # AND formula : pushdown through equality, impossible WHERE
@@ -1228,6 +1360,7 @@ HAVING (t1.c = 3) AND (t1.a > 2) AND (t1.a = t1.c);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
@@ -1235,6 +1368,7 @@ FROM t1
WHERE (t1.a = 1) AND (t1.c = 3) AND
(t1.a > 2) AND (t1.a = t1.c)
GROUP BY t1.a,t1.c;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
let $query=
@@ -1246,6 +1380,7 @@ HAVING (t1.c = 3) AND (t1.a > 2) AND (t1.a = t1.c);
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t1.a,MAX(t1.b),t1.c
@@ -1253,6 +1388,7 @@ FROM t1
WHERE (t1.a = 1) AND (t1.c = 3) AND
(t1.a > 2) AND (t1.a = t1.c)
GROUP BY t1.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # AND formula with OR subformula : AND condition in WHERE
@@ -1265,6 +1401,7 @@ HAVING (t3.a = t3.d) AND ((t3.d = 1) OR (t3.d > 1));
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t3.a,MAX(t3.c),t3.d
@@ -1272,6 +1409,7 @@ FROM t3
WHERE (t3.a > 1) AND ((t3.c = 3) OR (t3.c < 2)) AND
(t3.a = t3.d) AND ((t3.d = 1) OR (t3.d > 1))
GROUP BY t3.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # AND formula with OR subformula : AND condition in WHERE
@@ -1284,6 +1422,7 @@ HAVING (t3.a = t3.d) AND (((t3.d = t3.c) AND (t3.c < 15)) OR (t3.d > 1));
eval $no_pushdown $query;
eval $query;
eval explain $query;
+--source include/explain-no-costs.inc
eval explain format=json $query;
let $query=
SELECT t3.a,t3.b,MAX(t3.c),t3.d
@@ -1291,6 +1430,7 @@ FROM t3
WHERE (t3.a > 1) AND ((t3.c = 3) OR (t3.c < 2)) AND
(t3.a = t3.d) AND (((t3.d = t3.c) AND (t3.c < 15)) OR (t3.d > 1))
GROUP BY t3.a;
+--source include/explain-no-costs.inc
eval $no_pushdown explain format=json $query;
--echo # prepare statement
@@ -1359,6 +1499,7 @@ select d1 from t1
eval $q1;
eval explain extended $q1;
+--source include/explain-no-costs.inc
eval explain format=json $q1;
delete from t1;
@@ -1371,6 +1512,7 @@ select d1 from t1
eval $q2;
eval explain extended $q2;
+--source include/explain-no-costs.inc
eval explain format=json $q2;
drop table t1;
@@ -1420,6 +1562,7 @@ INSERT INTO t2 VALUES (2),(3);
let $q=
SELECT a FROM t1 GROUP BY a HAVING a = 8 OR a = ( SELECT MIN(c) FROM t2 );
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $q;
eval $q;
@@ -1427,6 +1570,7 @@ let $q=
SELECT a FROM t1 GROUP BY a,b
HAVING ( a = 8 OR a = ( SELECT MIN(c) FROM t2 ) ) and b < 20;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $q;
eval $q;
@@ -1434,12 +1578,14 @@ let $q=
SELECT a FROM t1 GROUP BY a
HAVING ( a = 8 OR a = ( SELECT MIN(c) FROM t2 ) ) and SUM(b) > 20;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $q;
eval $q;
let $q=
SELECT a FROM t1 GROUP BY a HAVING a = ( SELECT MIN(c) FROM t2 );
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $q;
eval $q;
diff --git a/mysql-test/main/ignored_index.result b/mysql-test/main/ignored_index.result
index 03748d48..176ca61d 100644
--- a/mysql-test/main/ignored_index.result
+++ b/mysql-test/main/ignored_index.result
@@ -255,17 +255,15 @@ DROP TABLE t1;
# IGNORED fulltext indexes.
#
CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b));
-INSERT INTO t1 VALUES('Some data', 'for full-text search');
-ANALYZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 analyze status Engine-independent statistics collected
-test.t1 analyze Warning Engine-independent statistics are not collected for column 'b'
-test.t1 analyze status OK
-EXPLAIN SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ("collections");
+INSERT INTO t1 VALUES('Some data', 'for full-text search'),("hello","hello world"),("mars","here I come");
+SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ("search");
+a b
+Some data for full-text search
+EXPLAIN SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ("search");
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 fulltext a a 0 1 Using where
ALTER TABLE t1 ALTER INDEX a IGNORED;
-EXPLAIN SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ("collections");
+SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ("search");
ERROR HY000: Can't find FULLTEXT index matching the column list
DROP TABLE t1;
#
diff --git a/mysql-test/main/ignored_index.test b/mysql-test/main/ignored_index.test
index a3d46fe6..b2fadcd5 100644
--- a/mysql-test/main/ignored_index.test
+++ b/mysql-test/main/ignored_index.test
@@ -222,13 +222,11 @@ DROP TABLE t1;
--echo # IGNORED fulltext indexes.
--echo #
CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b));
-INSERT INTO t1 VALUES('Some data', 'for full-text search');
-ANALYZE TABLE t1;
-
-let $query=
-EXPLAIN SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ("collections");
+INSERT INTO t1 VALUES('Some data', 'for full-text search'),("hello","hello world"),("mars","here I come");
+let $query=SELECT * FROM t1 WHERE MATCH(a, b) AGAINST ("search");
--eval $query
+--eval EXPLAIN $query
ALTER TABLE t1 ALTER INDEX a IGNORED;
--error ER_FT_MATCHING_KEY_NOT_FOUND
diff --git a/mysql-test/main/in_subq_cond_pushdown.result b/mysql-test/main/in_subq_cond_pushdown.result
index f114fc68..d0431852 100644
--- a/mysql-test/main/in_subq_cond_pushdown.result
+++ b/mysql-test/main/in_subq_cond_pushdown.result
@@ -51,12 +51,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c < 25 and t1.a is not null and t1.c is not null"
}
@@ -70,12 +73,15 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["e", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "`MAX(t2.g)` < 25",
"temporary_table": {
"nested_loop": [
@@ -83,7 +89,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5"
}
@@ -150,12 +158,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c > 55 and t1.b < 4 and t1.a is not null and t1.b is not null and t1.c is not null"
}
@@ -169,12 +180,15 @@ EXPLAIN
"key_length": "12",
"used_key_parts": ["e", "f", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.b", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "`MAX(t2.g)` > 55 and t2.f < 4",
"temporary_table": {
"nested_loop": [
@@ -182,7 +196,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5"
}
@@ -251,12 +267,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.c > 60 or t1.c < 25) and t1.a is not null and t1.b is not null and t1.c is not null"
}
@@ -270,12 +289,15 @@ EXPLAIN
"key_length": "12",
"used_key_parts": ["e", "f", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.b", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "`MAX(t2.g)` > 60 or `MAX(t2.g)` < 25",
"temporary_table": {
"nested_loop": [
@@ -283,7 +305,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5"
}
@@ -350,12 +374,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.c > 60 or t1.c < 25) and t1.b > 2 and t1.a is not null and t1.b is not null and t1.c is not null"
}
@@ -369,12 +396,15 @@ EXPLAIN
"key_length": "12",
"used_key_parts": ["e", "f", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.b", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "(`MAX(t2.g)` > 60 or `MAX(t2.g)` < 25) and t2.f > 2",
"temporary_table": {
"nested_loop": [
@@ -382,7 +412,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5"
}
@@ -451,12 +483,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a < 2 or t1.d > 3) and t1.b > 1 and t1.a is not null and t1.b is not null and t1.c is not null"
}
@@ -470,12 +505,15 @@ EXPLAIN
"key_length": "12",
"used_key_parts": ["e", "f", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.b", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "t2.f > 1",
"temporary_table": {
"nested_loop": [
@@ -483,7 +521,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5"
}
@@ -550,12 +590,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c > 20 and t1.a is not null and t1.c is not null"
}
@@ -569,12 +612,15 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["v1_x", "MAX(v1_y)"],
"ref": ["test.t1.a", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "`MAX(v1_y)` > 20",
"temporary_table": {
"nested_loop": [
@@ -582,7 +628,9 @@ EXPLAIN
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 8,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.x > 1 and t3.x <= 3"
}
@@ -650,12 +698,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 8,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.y > 20 and t3.x <= 3 and t3.y is not null"
}
@@ -665,7 +716,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 8,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -683,12 +736,15 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["e", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t3.y"],
+ "loops": 128,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "`MAX(t2.g)` > 20",
"temporary_table": {
"nested_loop": [
@@ -696,7 +752,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5"
}
@@ -765,12 +823,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 2 and t1.a is not null and t1.c is not null"
}
@@ -784,19 +845,24 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["e", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5 and t2.e < 2"
}
@@ -865,12 +931,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 2 and t1.a < 5 and t1.a is not null and t1.c is not null"
}
@@ -884,19 +953,24 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["e", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5 and t2.e > 2 and t2.e < 5"
}
@@ -967,12 +1041,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a < 2 or t1.a >= 4) and t1.a is not null and t1.c is not null"
}
@@ -986,19 +1063,24 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["e", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5 and (t2.e < 2 or t2.e >= 4)"
}
@@ -1065,12 +1147,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a < 2 or t1.a = 5) and t1.b > 3 and t1.a is not null and t1.b is not null and t1.c is not null"
}
@@ -1084,19 +1169,24 @@ EXPLAIN
"key_length": "12",
"used_key_parts": ["e", "f", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.b", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5 and (t2.e < 2 or t2.e = 5) and t2.f > 3"
}
@@ -1163,12 +1253,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a < 2 or t1.a = 5) and t1.b > 3 and t1.a is not null and t1.b is not null and t1.c is not null"
}
@@ -1182,19 +1275,24 @@ EXPLAIN
"key_length": "12",
"used_key_parts": ["e", "f", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.b", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5 and (t2.e < 2 or t2.e = 5) and t2.f > 3"
}
@@ -1261,12 +1359,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.b < 3 or t1.d > 2) and t1.a < 2 and t1.a is not null and t1.b is not null and t1.c is not null"
}
@@ -1280,19 +1381,24 @@ EXPLAIN
"key_length": "12",
"used_key_parts": ["e", "f", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.b", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5 and t2.e < 2"
}
@@ -1359,12 +1465,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a = 1 and t1.d = 1 and t1.c is not null"
}
@@ -1378,18 +1487,23 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["e", "MAX(t2.g)"],
"ref": ["const", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e = 1"
}
@@ -1455,12 +1569,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.d = t1.a and t1.a > 1 and t1.a is not null and t1.c is not null"
}
@@ -1474,19 +1591,24 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["e", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5 and t2.e > 1"
}
@@ -1551,12 +1673,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 3 and t1.a is not null and t1.c is not null"
}
@@ -1570,19 +1695,24 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["v1_x", "MAX(v1_y)"],
"ref": ["test.t1.a", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 8,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.x > 1 and t3.x <= 3 and t3.x < 3"
}
@@ -1652,12 +1782,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 8,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.x < 2 and t3.y > 30 and t3.x <= 3 and t3.x is not null"
}
@@ -1667,7 +1800,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 8,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -1685,19 +1820,24 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["e", "MAX(t2.g)"],
"ref": ["test.t3.x", "test.t1.c"],
+ "loops": 128,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5 and t2.e <= 3"
}
@@ -1765,12 +1905,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.b < 3 or t1.b = 4) and t1.a < 3 and t1.a is not null and t1.b is not null and t1.c is not null"
}
@@ -1784,12 +1927,15 @@ EXPLAIN
"key_length": "12",
"used_key_parts": ["e", "f", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.b", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "t2.f < 3 or t2.f = 4",
"temporary_table": {
"nested_loop": [
@@ -1797,7 +1943,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5 and t2.e < 3"
}
@@ -1864,12 +2012,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a + t1.c > 41 and t1.a is not null and t1.c is not null"
}
@@ -1883,12 +2034,15 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["e", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "t2.e + `MAX(t2.g)` > 41",
"temporary_table": {
"nested_loop": [
@@ -1896,7 +2050,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5"
}
@@ -1965,12 +2121,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c - t1.a < 35 and t1.a is not null and t1.c is not null"
}
@@ -1984,12 +2143,15 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["e", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "`MAX(t2.g)` - t2.e < 35",
"temporary_table": {
"nested_loop": [
@@ -1997,7 +2159,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5"
}
@@ -2064,12 +2228,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c * t1.a > 100 and t1.a is not null and t1.c is not null"
}
@@ -2083,12 +2250,15 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["e", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "`MAX(t2.g)` * t2.e > 100",
"temporary_table": {
"nested_loop": [
@@ -2096,7 +2266,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5"
}
@@ -2167,12 +2339,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c / t1.a > 30 and t1.a is not null and t1.c is not null"
}
@@ -2186,12 +2361,15 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["e", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "`MAX(t2.g)` / t2.e > 30",
"temporary_table": {
"nested_loop": [
@@ -2199,7 +2377,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5"
}
@@ -2266,12 +2446,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c between 50 and 100 and t1.a is not null and t1.c is not null"
}
@@ -2285,12 +2468,15 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["e", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "`MAX(t2.g)` between 50 and 100",
"temporary_table": {
"nested_loop": [
@@ -2298,7 +2484,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5"
}
@@ -2365,12 +2553,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a + t1.b > 5 and t1.a is not null and t1.b is not null and t1.c is not null"
}
@@ -2384,19 +2575,24 @@ EXPLAIN
"key_length": "12",
"used_key_parts": ["e", "f", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.b", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5 and t2.e + t2.f > 5"
}
@@ -2463,12 +2659,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a - t1.b > 0 and t1.a is not null and t1.b is not null and t1.c is not null"
}
@@ -2482,19 +2681,24 @@ EXPLAIN
"key_length": "12",
"used_key_parts": ["e", "f", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.b", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5 and t2.e - t2.f > 0"
}
@@ -2561,12 +2765,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a * t1.b > 6 and t1.a is not null and t1.b is not null and t1.c is not null"
}
@@ -2580,19 +2787,24 @@ EXPLAIN
"key_length": "12",
"used_key_parts": ["e", "f", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.b", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5 and t2.e * t2.f > 6"
}
@@ -2661,12 +2873,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b / t1.a > 2 and t1.a is not null and t1.b is not null and t1.c is not null"
}
@@ -2680,19 +2895,24 @@ EXPLAIN
"key_length": "12",
"used_key_parts": ["e", "f", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.b", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5 and t2.f / t2.e > 2"
}
@@ -2765,12 +2985,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a between 1 and 3 and t1.a is not null and t1.c is not null"
}
@@ -2784,19 +3007,24 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["e", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5 and t2.e between 1 and 3"
}
@@ -2867,12 +3095,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c > 3 and t1.a is not null and t1.b is not null and t1.c is not null"
}
@@ -2886,12 +3117,15 @@ EXPLAIN
"key_length": "12",
"used_key_parts": ["e", "MAX(v2.f)", "max_g"],
"ref": ["test.t1.a", "test.t1.b", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "v2.max_g > 3",
"temporary_table": {
"nested_loop": [
@@ -2899,12 +3133,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.e < 5",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_g > 25",
"filesort": {
"sort_key": "t2.e",
@@ -2914,7 +3151,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5"
}
@@ -2991,12 +3230,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1 and t1.a is not null and t1.b is not null and t1.c is not null"
}
@@ -3010,24 +3252,30 @@ EXPLAIN
"key_length": "12",
"used_key_parts": ["e", "MAX(v2.f)", "max_g"],
"ref": ["test.t1.a", "test.t1.b", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.e < 5 and v2.e > 1",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_g > 25",
"filesort": {
"sort_key": "t2.e",
@@ -3037,7 +3285,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5 and t2.e > 1"
}
@@ -3115,12 +3365,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1 and t1.c < 100 and t1.a is not null and t1.b is not null and t1.c is not null"
}
@@ -3134,12 +3387,15 @@ EXPLAIN
"key_length": "12",
"used_key_parts": ["e", "MAX(v2.f)", "max_g"],
"ref": ["test.t1.a", "test.t1.b", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "v2.max_g < 100",
"temporary_table": {
"nested_loop": [
@@ -3147,12 +3403,15 @@ EXPLAIN
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "v2.e < 5 and v2.e > 1",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_g > 25",
"filesort": {
"sort_key": "t2.e",
@@ -3162,7 +3421,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5 and t2.e > 1"
}
@@ -3263,12 +3524,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1 and t1.a is not null and t1.b is not null and t1.c is not null"
}
@@ -3282,24 +3546,30 @@ EXPLAIN
"key_length": "12",
"used_key_parts": ["e", "MAX(d_tab.f)", "max_g"],
"ref": ["test.t1.a", "test.t1.b", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "d_tab.e < 5 and d_tab.e > 1",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_g > 25 and t2.e < 5 and t2.e > 1",
"filesort": {
"sort_key": "t2.f",
@@ -3309,7 +3579,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -3428,12 +3700,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1 and t1.a is not null and t1.b is not null and t1.c is not null"
}
@@ -3447,24 +3722,30 @@ EXPLAIN
"key_length": "12",
"used_key_parts": ["e", "MAX(d_tab.f)", "max_g"],
"ref": ["test.t1.a", "test.t1.b", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "d_tab.e < 5 and d_tab.e > 1",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_g > 25 and t2.e < 5 and t2.e > 1",
"filesort": {
"sort_key": "t2.f",
@@ -3474,7 +3755,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -3594,12 +3877,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1 and t1.a is not null and t1.b is not null and t1.c is not null"
}
@@ -3613,24 +3899,30 @@ EXPLAIN
"key_length": "12",
"used_key_parts": ["e", "MAX(d_tab.f)", "max_g"],
"ref": ["test.t1.a", "test.t1.b", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "<derived3>",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "d_tab.e < 5 and d_tab.e > 1",
"materialized": {
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "max_g > 25 and t2.e < 5 and t2.e > 1",
"filesort": {
"sort_key": "t2.f",
@@ -3640,7 +3932,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -3718,7 +4012,7 @@ GROUP BY t1.a
WHERE d_tab.a=t3.x AND d_tab.a<5 AND d_tab.max_c<70;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 8 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t3.x 2 Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t3.x 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 16 Using where; Using temporary; Using filesort
2 DERIVED <subquery3> eq_ref distinct_key distinct_key 12 test.t1.a,test.t1.b,test.t1.c 1
3 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary
@@ -3742,12 +4036,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 8,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.x < 5 and t3.x is not null"
}
@@ -3761,12 +4058,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t3.x"],
- "rows": 2,
+ "loops": 8,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "d_tab.max_c < 70",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 70",
"filesort": {
"sort_key": "t1.a",
@@ -3776,7 +4076,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1 and t1.a < 5 and t1.a is not null and t1.b is not null and t1.c is not null"
}
@@ -3790,12 +4092,15 @@ EXPLAIN
"key_length": "12",
"used_key_parts": ["e", "f", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.b", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "t2.f < 5",
"temporary_table": {
"nested_loop": [
@@ -3803,7 +4108,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e > 1 and t2.e < 5"
}
@@ -3903,7 +4210,7 @@ GROUP BY t1.a
WHERE d_tab.a=t3.x AND d_tab.a<5 AND d_tab.max_c<70;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 8 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t3.x 2 Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t3.x 1 Using where
2 DERIVED t1 ALL NULL NULL NULL NULL 16 Using where; Using temporary; Using filesort
2 DERIVED <subquery3> eq_ref distinct_key distinct_key 12 test.t1.a,test.t1.b,test.t1.c 1
3 MATERIALIZED t2 ALL NULL NULL NULL NULL 12 Using where; Using temporary
@@ -3927,12 +4234,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 8,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t3.x < 5 and t3.x is not null"
}
@@ -3946,12 +4256,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t3.x"],
- "rows": 2,
+ "loops": 8,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "d_tab.max_c < 70",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"having_condition": "max_c < 70",
"filesort": {
"sort_key": "t1.a",
@@ -3961,7 +4274,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a > 1 and t1.a < 5 and t1.a is not null and t1.b is not null and t1.c is not null"
}
@@ -3975,12 +4290,15 @@ EXPLAIN
"key_length": "12",
"used_key_parts": ["e", "f", "MAX(t2.g)"],
"ref": ["test.t1.a", "test.t1.b", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"having_condition": "t2.f < 5",
"temporary_table": {
"nested_loop": [
@@ -3988,7 +4306,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e > 1 and t2.e < 5"
}
@@ -4065,12 +4385,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 1 and t1.b is not null and t1.c is not null"
}
@@ -4084,12 +4407,15 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["f", "MAX(t2.g) OVER (PARTITION BY t2.f)"],
"ref": ["test.t1.b", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -4104,7 +4430,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5 and t2.f > 1"
}
@@ -4169,12 +4497,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 16,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b > 1 and t1.b is not null and t1.c is not null"
}
@@ -4191,13 +4522,16 @@ EXPLAIN
"CAST(SUM(t2.g) OVER (PARTITION BY t2.f) AS INT)"
],
"ref": ["test.t1.b", "test.t1.c"],
+ "loops": 16,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.c = `<subquery2>`.`CAST(SUM(t2.g) OVER (PARTITION BY t2.f) AS INT)`",
"materialized": {
"unique": 1,
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -4212,7 +4546,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.e < 5 and t2.f > 1"
}
diff --git a/mysql-test/main/in_subq_cond_pushdown.test b/mysql-test/main/in_subq_cond_pushdown.test
index 7763201c..8a12a2c5 100644
--- a/mysql-test/main/in_subq_cond_pushdown.test
+++ b/mysql-test/main/in_subq_cond_pushdown.test
@@ -42,6 +42,7 @@ WHERE t1.c<25 AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # extracted AND formula : pushing into HAVING
@@ -60,6 +61,7 @@ WHERE t1.c>55 AND t1.b<4 AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # extracted OR formula : pushing into HAVING
@@ -78,6 +80,7 @@ WHERE (t1.c>60 OR t1.c<25) AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # extracted AND-OR formula : pushing into HAVING
@@ -96,6 +99,7 @@ WHERE ((t1.c>60 OR t1.c<25) AND t1.b>2) AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula : pushing into HAVING
@@ -114,6 +118,7 @@ WHERE ((t1.a<2 OR t1.d>3) AND t1.b>1) AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # using view IN subquery defINition : pushing into HAVING
@@ -132,6 +137,7 @@ WHERE t1.c>20 AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # using equality : pushing into WHERE
@@ -150,6 +156,7 @@ WHERE t1.c>20 AND t1.c=v1_y AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula : pushing into WHERE
@@ -168,6 +175,7 @@ WHERE t1.a<2 AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # extracted AND formula : pushing into WHERE
@@ -186,6 +194,7 @@ WHERE t1.a>2 AND t1.a<5 AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # extracted OR formula : pushing into WHERE
@@ -204,6 +213,7 @@ WHERE (t1.a<2 OR t1.a>=4) AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # extracted AND-OR formula : pushing into WHERE
@@ -222,6 +232,7 @@ WHERE ((t1.a<2 OR t1.a=5) AND t1.b>3) AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # extracted AND-OR formula : pushing into WHERE
@@ -240,6 +251,7 @@ WHERE ((t1.a<2 OR t1.a=5) AND t1.b>3) AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula : pushing into WHERE
@@ -258,6 +270,7 @@ WHERE ((t1.b<3 OR t1.d>2) AND t1.a<2) AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # using equalities : pushing into WHERE
@@ -276,6 +289,7 @@ WHERE t1.d=1 AND t1.a=t1.d AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # using equality : pushing into WHERE
@@ -294,6 +308,7 @@ WHERE t1.d>1 AND t1.a=t1.d AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # using view IN subquery definition : pushing into WHERE
@@ -312,6 +327,7 @@ WHERE t1.a<3 AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # using equality : pushing into WHERE
@@ -330,6 +346,7 @@ WHERE t1.a=v1_x AND v1_x<2 AND v1_y>30 AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula : pushing into WHERE
@@ -349,6 +366,7 @@ WHERE ((t1.b<3 OR t1.b=4) AND t1.a<3) AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula using addition : pushing into HAVING
@@ -367,6 +385,7 @@ WHERE (t1.a+t1.c>41) AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula using substitution : pushing into HAVING
@@ -385,6 +404,7 @@ WHERE (t1.c-t1.a<35) AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula using multiplication : pushing into HAVING
@@ -403,6 +423,7 @@ WHERE (t1.c*t1.a>100) AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula using division : pushing into HAVING
@@ -421,6 +442,7 @@ WHERE (t1.c/t1.a>30) AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula using BETWEEN : pushing into HAVING
@@ -439,6 +461,7 @@ WHERE (t1.c BETWEEN 50 AND 100) AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula using addition : pushing into WHERE
@@ -457,6 +480,7 @@ WHERE (t1.a+t1.b > 5) AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula using substitution : pushing into WHERE
@@ -475,6 +499,7 @@ WHERE (t1.a-t1.b > 0) AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula using multiplication : pushing into WHERE
@@ -493,6 +518,7 @@ WHERE (t1.a*t1.b > 6) AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula using division : pushing into WHERE
@@ -511,6 +537,7 @@ WHERE (t1.b/t1.a > 2) AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula using BETWEEN : pushing into WHERE
@@ -529,6 +556,7 @@ WHERE (t1.a BETWEEN 1 AND 3) AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula : pushing into HAVING of the IN subquery
@@ -548,6 +576,7 @@ WHERE t1.c>3 AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula : pushing into WHERE of the IN subquery
@@ -568,6 +597,7 @@ WHERE t1.a>1 AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula : pushing into WHERE and HAVING
@@ -589,6 +619,7 @@ WHERE t1.a>1 AND t1.c<100 AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula : pushing into WHERE of the IN subquery
@@ -615,6 +646,7 @@ WHERE t1.a>1 AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula : pushing into HAVING of the derived table
@@ -640,6 +672,7 @@ WHERE d_tab.a=t3.x AND d_tab.b>2;
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula : pushing into WHERE of the derived table
@@ -665,6 +698,7 @@ WHERE d_tab.a=t3.x AND d_tab.a<5;
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula : pushing into WHERE and HAVING
@@ -692,6 +726,7 @@ WHERE d_tab.a=t3.x AND d_tab.a<5 AND d_tab.max_c<70;
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula : pushing into WHERE of the derived table
@@ -717,6 +752,7 @@ WHERE d_tab.a=t3.x AND d_tab.a<5;
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula : pushing into WHERE
@@ -735,6 +771,7 @@ WHERE (t1.b>1) AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
--echo # conjunctive subformula : pushing into WHERE
@@ -753,6 +790,7 @@ WHERE (t1.b>1) AND
EVAL $no_pushdown $query;
EVAL $query;
EVAL EXPLAIN $query;
+--source include/explain-no-costs.inc
EVAL EXPLAIN FORMAT=JSON $query;
DROP TABLE t1,t2,t3;
diff --git a/mysql-test/main/index_intersect.result b/mysql-test/main/index_intersect.result
index 3ec98216..c6332591 100644
--- a/mysql-test/main/index_intersect.result
+++ b/mysql-test/main/index_intersect.result
@@ -80,7 +80,7 @@ EXPLAIN
SELECT * FROM City
WHERE Name LIKE 'M%' AND Population > 7000000;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City index_merge Population,Name Population,Name 4,35 NULL # Using sort_intersect(Population,Name); Using where
+1 SIMPLE City range Population,Name Population 4 NULL # Using index condition; Using where
SELECT * FROM City USE INDEX ()
WHERE Name LIKE 'C%' AND Population > 1000000;
ID Name Country Population
@@ -335,8 +335,8 @@ ID Name Country Population
SELECT * FROM City
WHERE Name LIKE 'M%' AND Population > 7000000;
ID Name Country Population
-1024 Mumbai (Bombay) IND 10500000
3580 Moscow RUS 8389200
+1024 Mumbai (Bombay) IND 10500000
SELECT COUNT(*) FROM City WHERE Name BETWEEN 'M' AND 'N';
COUNT(*)
301
@@ -355,9 +355,6 @@ COUNT(*)
SELECT COUNT(*) FROM City WHERE Country LIKE 'C%';
COUNT(*)
551
-SELECT COUNT(*) FROM City WHERE Country LIKE 'B%';
-COUNT(*)
-339
SELECT COUNT(*) FROM City WHERE Country LIKE 'J%';
COUNT(*)
256
@@ -370,12 +367,12 @@ EXPLAIN
SELECT * FROM City
WHERE Name BETWEEN 'G' AND 'K' AND Population > 1000000 AND Country LIKE 'J%';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City index_merge Population,Country,Name Population,Country,Name 4,3,35 NULL # Using sort_intersect(Population,Country,Name); Using where
+1 SIMPLE City index_merge Population,Country,Name Population,Country 4,3 NULL # Using sort_intersect(Population,Country); Using where
EXPLAIN
SELECT * FROM City
WHERE Name BETWEEN 'G' AND 'K' AND Population > 500000 AND Country LIKE 'C%';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City index_merge Population,Name,Country Name,Country,Population # NULL # Using sort_intersect(Name,Country,Population); Using where
+1 SIMPLE City index_merge Population,Name,Country Name,Country # NULL # Using sort_intersect(Name,Country); Using where
SELECT * FROM City USE INDEX ()
WHERE Name BETWEEN 'M' AND 'N' AND Population > 1000000 AND Country LIKE 'C%';
ID Name Country Population
@@ -466,17 +463,17 @@ EXPLAIN
SELECT * FROM City
WHERE ID BETWEEN 501 AND 1000 AND Population > 700000 AND Country LIKE 'C%';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City index_merge PRIMARY,Population,Country Population,PRIMARY,Country 4,4,3 NULL # Using sort_intersect(Population,PRIMARY,Country); Using where
+1 SIMPLE City index_merge PRIMARY,Population,Country Population,PRIMARY 4,4 NULL # Using sort_intersect(Population,PRIMARY); Using where
EXPLAIN
SELECT * FROM City
WHERE ID BETWEEN 1 AND 500 AND Population > 700000 AND Country LIKE 'C%';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City index_merge PRIMARY,Population,Country Population,PRIMARY,Country 4,4,3 NULL # Using sort_intersect(Population,PRIMARY,Country); Using where
+1 SIMPLE City index_merge PRIMARY,Population,Country Population,PRIMARY 4,4 NULL # Using sort_intersect(Population,PRIMARY); Using where
EXPLAIN
SELECT * FROM City
WHERE ID BETWEEN 2001 AND 2500 AND Population > 300000 AND Country LIKE 'H%';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City index_merge PRIMARY,Population,Country Country,PRIMARY 3,4 NULL # Using sort_intersect(Country,PRIMARY); Using where
+1 SIMPLE City range PRIMARY,Population,Country Country 3 NULL # Using index condition; Using where
EXPLAIN
SELECT * FROM City
WHERE ID BETWEEN 3701 AND 4000 AND Population > 1000000
@@ -488,7 +485,7 @@ SELECT * FROM City
WHERE ID BETWEEN 3001 AND 4000 AND Population > 600000
AND Country BETWEEN 'S' AND 'Z' ;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range PRIMARY,Population,Country Population 4 NULL # Using index condition; Using where
+1 SIMPLE City index_merge PRIMARY,Population,Country Population,Country 4,3 NULL # Using sort_intersect(Population,Country); Using where
SELECT * FROM City USE INDEX ()
WHERE ID BETWEEN 501 AND 1000 AND Population > 700000 AND Country LIKE 'C%';
ID Name Country Population
@@ -720,13 +717,13 @@ EXPLAIN
SELECT * FROM City
WHERE ID BETWEEN 1 AND 500 AND Population > 700000 AND Country LIKE 'C%';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range PRIMARY,Population,Country Population 4 NULL # Using index condition; Using where
+1 SIMPLE City index_merge PRIMARY,Population,Country Population,PRIMARY 4,4 NULL # Using sort_intersect(Population,PRIMARY); Using where
EXPLAIN
SELECT * FROM City
WHERE ID BETWEEN 3001 AND 4000 AND Population > 600000
AND Country BETWEEN 'S' AND 'Z';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range PRIMARY,Population,Country Population 4 NULL # Using index condition; Using where
+1 SIMPLE City index_merge PRIMARY,Population,Country Population,Country 4,3 NULL # Using sort_intersect(Population,Country); Using where
SELECT * FROM City WHERE
Name LIKE 'C%' AND Population > 1000000;
ID Name Country Population
@@ -966,7 +963,7 @@ EXPLAIN
SELECT * FROM t1
WHERE (f1 < 535 OR f1 > 985) AND ( f4='r' OR f4 LIKE 'a%' ) ;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range PRIMARY,f4 f4 35 NULL # Using index condition; Using where
+1 SIMPLE t1 index_merge PRIMARY,f4 f4,PRIMARY 35,4 NULL # Using sort_intersect(f4,PRIMARY); Using where
SELECT * FROM t1
WHERE (f1 < 535 OR f1 > 985) AND ( f4='r' OR f4 LIKE 'a%' ) ;
f1 f4 f5
diff --git a/mysql-test/main/index_intersect.test b/mysql-test/main/index_intersect.test
index 26937fd5..d6208f67 100644
--- a/mysql-test/main/index_intersect.test
+++ b/mysql-test/main/index_intersect.test
@@ -120,7 +120,6 @@ SELECT COUNT(*) FROM City WHERE Name BETWEEN 'G' AND 'K';
SELECT COUNT(*) FROM City WHERE Population > 1000000;
SELECT COUNT(*) FROM City WHERE Population > 500000;
SELECT COUNT(*) FROM City WHERE Country LIKE 'C%';
-SELECT COUNT(*) FROM City WHERE Country LIKE 'B%';
SELECT COUNT(*) FROM City WHERE Country LIKE 'J%';
diff --git a/mysql-test/main/index_intersect_innodb.result b/mysql-test/main/index_intersect_innodb.result
index 44407dbc..2aba9dc6 100644
--- a/mysql-test/main/index_intersect_innodb.result
+++ b/mysql-test/main/index_intersect_innodb.result
@@ -81,12 +81,12 @@ EXPLAIN
SELECT * FROM City
WHERE Name LIKE 'M%' AND Population > 300000;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Population,Name Name 35 NULL # Using index condition; Using where
+1 SIMPLE City index_merge Population,Name Name,Population 35,4 NULL # Using sort_intersect(Name,Population); Using where
EXPLAIN
SELECT * FROM City
WHERE Name LIKE 'M%' AND Population > 7000000;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City index_merge Population,Name Population,Name 4,35 NULL # Using sort_intersect(Population,Name); Using where
+1 SIMPLE City range Population,Name Population 4 NULL # Using index condition; Using where
SELECT * FROM City USE INDEX ()
WHERE Name LIKE 'C%' AND Population > 1000000;
ID Name Country Population
@@ -341,8 +341,8 @@ ID Name Country Population
SELECT * FROM City
WHERE Name LIKE 'M%' AND Population > 7000000;
ID Name Country Population
-1024 Mumbai (Bombay) IND 10500000
3580 Moscow RUS 8389200
+1024 Mumbai (Bombay) IND 10500000
SELECT COUNT(*) FROM City WHERE Name BETWEEN 'M' AND 'N';
COUNT(*)
301
@@ -361,9 +361,6 @@ COUNT(*)
SELECT COUNT(*) FROM City WHERE Country LIKE 'C%';
COUNT(*)
551
-SELECT COUNT(*) FROM City WHERE Country LIKE 'B%';
-COUNT(*)
-339
SELECT COUNT(*) FROM City WHERE Country LIKE 'J%';
COUNT(*)
256
@@ -371,17 +368,17 @@ EXPLAIN
SELECT * FROM City
WHERE Name BETWEEN 'M' AND 'N' AND Population > 1000000 AND Country LIKE 'C%';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City index_merge Population,Country,Name Population,Name,Country 4,35,3 NULL # Using sort_intersect(Population,Name,Country); Using where
+1 SIMPLE City index_merge Population,Country,Name Population,Name 4,35 NULL # Using sort_intersect(Population,Name); Using where
EXPLAIN
SELECT * FROM City
WHERE Name BETWEEN 'G' AND 'K' AND Population > 1000000 AND Country LIKE 'J%';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City index_merge Population,Country,Name Population,Country,Name 4,3,35 NULL # Using sort_intersect(Population,Country,Name); Using where
+1 SIMPLE City index_merge Population,Country,Name Population,Country 4,3 NULL # Using sort_intersect(Population,Country); Using where
EXPLAIN
SELECT * FROM City
WHERE Name BETWEEN 'G' AND 'K' AND Population > 500000 AND Country LIKE 'C%';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Population,Name,Country Name # NULL # Using index condition; Using where
+1 SIMPLE City index_merge Population,Name,Country Name,Population # NULL # Using sort_intersect(Name,Population); Using where
SELECT * FROM City USE INDEX ()
WHERE Name BETWEEN 'M' AND 'N' AND Population > 1000000 AND Country LIKE 'C%';
ID Name Country Population
@@ -472,29 +469,29 @@ EXPLAIN
SELECT * FROM City
WHERE ID BETWEEN 501 AND 1000 AND Population > 700000 AND Country LIKE 'C%';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Population,Country 4,4,7 NULL # Using sort_intersect(PRIMARY,Population,Country); Using where
+1 SIMPLE City range PRIMARY,Population,Country PRIMARY 4 NULL # Using where
EXPLAIN
SELECT * FROM City
WHERE ID BETWEEN 1 AND 500 AND Population > 700000 AND Country LIKE 'C%';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Population,Country 4,4,7 NULL # Using sort_intersect(PRIMARY,Population,Country); Using where
+1 SIMPLE City range PRIMARY,Population,Country PRIMARY 4 NULL # Using where
EXPLAIN
SELECT * FROM City
WHERE ID BETWEEN 2001 AND 2500 AND Population > 300000 AND Country LIKE 'H%';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Population,Country 4,4,7 NULL # Using sort_intersect(PRIMARY,Population,Country); Using where
+1 SIMPLE City range PRIMARY,Population,Country Country 7 NULL # Using index condition; Using where
EXPLAIN
SELECT * FROM City
WHERE ID BETWEEN 3701 AND 4000 AND Population > 1000000
AND Country BETWEEN 'S' AND 'Z';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Population,Country 4,4,7 NULL # Using sort_intersect(PRIMARY,Population,Country); Using where
+1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Population 4,4 NULL # Using sort_intersect(PRIMARY,Population); Using where
EXPLAIN
SELECT * FROM City
WHERE ID BETWEEN 3001 AND 4000 AND Population > 600000
AND Country BETWEEN 'S' AND 'Z' ;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Population,Country 4,4,7 NULL # Using sort_intersect(PRIMARY,Population,Country); Using where
+1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Population 4,4 NULL # Using sort_intersect(PRIMARY,Population); Using where
SELECT * FROM City USE INDEX ()
WHERE ID BETWEEN 501 AND 1000 AND Population > 700000 AND Country LIKE 'C%';
ID Name Country Population
@@ -711,7 +708,7 @@ EXPLAIN
SELECT * FROM City WHERE
Name LIKE 'M%' AND Population > 1500000;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City index_merge Population,Name Population,Name 4,35 NULL # Using sort_intersect(Population,Name); Using where
+1 SIMPLE City range Population,Name Population 4 NULL # Using index condition; Using where
EXPLAIN
SELECT * FROM City
WHERE Name BETWEEN 'G' AND 'K' AND Population > 1000000 AND Country LIKE 'J%';
@@ -721,12 +718,12 @@ EXPLAIN
SELECT * FROM City
WHERE Name BETWEEN 'G' AND 'J' AND Population > 500000 AND Country LIKE 'C%';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range Population,Country,Name Name 35 NULL # Using index condition; Using where
+1 SIMPLE City index_merge Population,Country,Name Name,Population 35,4 NULL # Using sort_intersect(Name,Population); Using where
EXPLAIN
SELECT * FROM City
WHERE ID BETWEEN 1 AND 500 AND Population > 700000 AND Country LIKE 'C%';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Population,Country 4,4,7 NULL # Using sort_intersect(PRIMARY,Population,Country); Using where
+1 SIMPLE City range PRIMARY,Population,Country PRIMARY 4 NULL # Using where
EXPLAIN
SELECT * FROM City
WHERE ID BETWEEN 3001 AND 4000 AND Population > 600000
diff --git a/mysql-test/main/index_merge_innodb.result b/mysql-test/main/index_merge_innodb.result
index d9be08a0..6f1daf75 100644
--- a/mysql-test/main/index_merge_innodb.result
+++ b/mysql-test/main/index_merge_innodb.result
@@ -582,7 +582,7 @@ set @tmp_index_merge_ror_cpk=@@optimizer_switch;
set optimizer_switch='extended_keys=off';
explain select * from t1 where pk1 < 7500 and key1 = 10;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index_merge PRIMARY,key1 key1,PRIMARY 4,4 NULL ROWS Using intersect(key1,PRIMARY); Using where
+1 SIMPLE t1 ref PRIMARY,key1 key1 4 const ROWS Using index condition
set optimizer_switch=@tmp_index_merge_ror_cpk;
explain select * from t1 where pktail1ok=1 and key1=10;
id select_type table type possible_keys key key_len ref rows Extra
@@ -654,7 +654,7 @@ f1
EXPLAIN SELECT t1.f1 FROM t1
WHERE (SELECT COUNT(*) FROM t2 WHERE t2.f3 = 'h' AND t2.f2 = t1.f1) = 0 AND t1.f1 = 2;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1 Using index
+1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1
2 SUBQUERY t2 index_merge f2,f3 f3,f2 2,5 NULL 1 Using intersect(f3,f2); Using where; Using index
DROP TABLE t1,t2;
#
@@ -827,13 +827,13 @@ INDEX (b)
INSERT INTO t1 SELECT seq, seq, seq from seq_1_to_100;
EXPLAIN SELECT * FROM t1 WHERE a='1' OR b < 5;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index_merge PRIMARY,b b,PRIMARY 5,3074 NULL 5 Using sort_union(b,PRIMARY); Using where
+1 SIMPLE t1 ALL PRIMARY,b NULL NULL NULL 100 Using where
SELECT * FROM t1 WHERE a='1' OR b < 5;
a b c
+1 1 1
2 2 2
3 3 3
4 4 4
-1 1 1
DROP TABLE t1;
SET sort_buffer_size= @save_sort_buffer_size;
disconnect disable_purge;
diff --git a/mysql-test/main/index_merge_myisam.result b/mysql-test/main/index_merge_myisam.result
index 1ecc1ded..5866612c 100644
--- a/mysql-test/main/index_merge_myisam.result
+++ b/mysql-test/main/index_merge_myisam.result
@@ -232,7 +232,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index i1_3,i2_3 i321 12 NULL 1024 Using where; Using index
explain select key7 from t2 where key1 <100 or key2 < 100;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 index_merge i1_3,i2_3 i1_3,i2_3 4,4 NULL 186 Using sort_union(i1_3,i2_3); Using where
+1 SIMPLE t2 ALL i1_3,i2_3 NULL NULL NULL 1024 Using where
create table t4 (
key1a int not null,
key1b int not null,
@@ -405,8 +405,8 @@ from t0 as A straight_join t0 as B
where (A.key1 = 1 and A.key2 = 1 and A.key3 = 1 and A.key4=1 and A.key5=1 and A.key6=1 and A.key7 = 1 or A.key8=1)
and (B.key1 = 1 and B.key2 = 1 and B.key3 = 1 and B.key4=1 and B.key5=1 and B.key6=1 and B.key7 = 1 or B.key8=1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE A index_merge i1,i2,i3,i4,i5,i6,i7?,i8 i2,i3,i4,i5,i6,i7?,i8 X NULL # Using union(intersect(i2,i3,i4,i5,i6,i7?),i8); Using where
-1 SIMPLE B index_merge i1,i2,i3,i4,i5,i6,i7?,i8 i2,i3,i4,i5,i6,i7?,i8 X NULL # Using union(intersect(i2,i3,i4,i5,i6,i7?),i8); Using where; Using join buffer (flat, BNL join)
+1 SIMPLE A ALL i1,i2,i3,i4,i5,i6,i7?,i8 NULL NULL NULL # Using where
+1 SIMPLE B ALL i1,i2,i3,i4,i5,i6,i7?,i8 NULL NULL NULL # Using where; Using join buffer (flat, BNL join)
select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5)
from t0 as A straight_join t0 as B
where (A.key1 = 1 and A.key2 = 1 and A.key3 = 1 and A.key4=1 and A.key5=1 and A.key6=1 and A.key7 = 1 or A.key8=1)
@@ -554,7 +554,7 @@ DROP TABLE t1;
create table t1 (a int);
insert into t1 values (1),(2);
create table t2(a int, b int);
-insert into t2 values (1,1), (2, 1000);
+insert into t2 values (1,1), (2, 1000),(5000,5000);
create table t3 (a int, b int, filler char(100), key(a), key(b));
insert into t3 select 1000, 1000,'filler' from seq_1_to_1000;
insert into t3 values (1,1,'data');
@@ -566,7 +566,7 @@ where t2.a=t1.a and (t3.a=t2.b or t3.b=t2.b or t3.b=t2.b+1));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
2 MATERIALIZED t3 ALL a,b NULL NULL NULL 1002 Range checked for each record (index map: 0x3)
select * from t1
where exists (select 1 from t2, t3
@@ -683,7 +683,7 @@ key1 key2 key3 key4 filler1
-1 -1 100 100 key4-key3
explain select key1,key2,key3 from t1 where key1=100 and key2=100 and key3=100;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index_merge key1,key2,key3 key1,key2,key3 5,5,5 NULL 2 Using intersect(key1,key2,key3); Using where; Using index
+1 SIMPLE t1 index_merge key1,key2,key3 key1,key2 5,5 NULL 77 Using intersect(key1,key2); Using where
select key1,key2,key3 from t1 where key1=100 and key2=100 and key3=100;
key1 key2 key3
100 100 100
@@ -762,7 +762,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge sta_swt12a,sta_swt1a,sta_swt2a,sta_swt21a,st_a,stb_swt1a_2b,stb_swt1b,st_b st_a,st_b 4,4 NULL 3515 Using intersect(st_a,st_b); Using where; Using index
explain select st_a from t1 ignore index (st_a) where st_a=1 and st_b=1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref sta_swt12a,sta_swt1a,sta_swt2a,sta_swt21a,stb_swt1a_2b,stb_swt1b,st_b st_b 4 const 15094 Using where
+1 SIMPLE t1 ALL sta_swt12a,sta_swt1a,sta_swt2a,sta_swt21a,stb_swt1a_2b,stb_swt1b,st_b NULL NULL NULL 64806 Using where
explain select * from t1 where st_a=1 and swt1a=1 and swt2a=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref sta_swt12a,sta_swt1a,sta_swt2a,sta_swt21a,st_a sta_swt21a 12 const,const,const 971
@@ -783,7 +783,7 @@ id select_type table type possible_keys key key_len ref rows Extra
explain select * from t1 ignore index (sta_swt21a, sta_swt12a, stb_swt1a_2b, stb_swt1b)
where st_a=1 and swt1a=1 and swt2a=1 and st_b=1 and swt1b=1 and swt2b=1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index_merge sta_swt1a,sta_swt2a,st_a,st_b sta_swt1a,sta_swt2a,st_b 8,8,4 NULL 223 Using intersect(sta_swt1a,sta_swt2a,st_b); Using where
+1 SIMPLE t1 index_merge sta_swt1a,sta_swt2a,st_a,st_b sta_swt1a,sta_swt2a 8,8 NULL 960 Using intersect(sta_swt1a,sta_swt2a); Using where
explain select * from t1
where st_a=1 and swt1a=1 and swt2a=1 and st_b=1 and swt1b=1;
id select_type table type possible_keys key key_len ref rows Extra
@@ -910,7 +910,7 @@ INSERT INTO t1 (key1, key2, filler)
SELECT seq/4, seq/8, 'filler-data' FROM seq_30_to_0;
explain select pk from t1 where key1 = 1 and key2 = 1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref key1,key2 key1 5 const 4 Using where
+1 SIMPLE t1 index_merge key1,key2 key1,key2 5,4 NULL 1 Using intersect(key1,key2); Using where
select pk from t1 where key2 = 1 and key1 = 1;
pk
26
@@ -1487,7 +1487,7 @@ EXPLAIN SELECT t1.f1 FROM t1
WHERE (SELECT COUNT(*) FROM t2 WHERE t2.f3 = 'h' AND t2.f2 = t1.f1) = 0 AND t1.f1 = 2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system PRIMARY NULL NULL NULL 1
-2 SUBQUERY t2 ref f2,f3 f3 2 const 2 Using index condition; Using where
+2 SUBQUERY t2 index_merge f2,f3 f3,f2 2,5 NULL 1 Using intersect(f3,f2); Using where; Using index
DROP TABLE t1,t2;
create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
diff --git a/mysql-test/main/information_schema-big.result b/mysql-test/main/information_schema-big.result
index 5c519014..ad045129 100644
--- a/mysql-test/main/information_schema-big.result
+++ b/mysql-test/main/information_schema-big.result
@@ -37,8 +37,11 @@ INDEX_STATISTICS TABLE_SCHEMA
KEYWORDS WORD
KEY_CACHES KEY_CACHE_NAME
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
+KEY_PERIOD_USAGE CONSTRAINT_SCHEMA
+OPTIMIZER_COSTS ENGINE
PARAMETERS SPECIFIC_SCHEMA
PARTITIONS TABLE_SCHEMA
+PERIODS TABLE_SCHEMA
PLUGINS PLUGIN_NAME
PROCESSLIST ID
PROFILING QUERY_ID
@@ -97,8 +100,11 @@ INDEX_STATISTICS TABLE_SCHEMA
KEYWORDS WORD
KEY_CACHES KEY_CACHE_NAME
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
+KEY_PERIOD_USAGE CONSTRAINT_SCHEMA
+OPTIMIZER_COSTS ENGINE
PARAMETERS SPECIFIC_SCHEMA
PARTITIONS TABLE_SCHEMA
+PERIODS TABLE_SCHEMA
PLUGINS PLUGIN_NAME
PROCESSLIST ID
PROFILING QUERY_ID
diff --git a/mysql-test/main/information_schema.result b/mysql-test/main/information_schema.result
index 273c1186..599579ef 100644
--- a/mysql-test/main/information_schema.result
+++ b/mysql-test/main/information_schema.result
@@ -71,9 +71,12 @@ INDEX_STATISTICS
KEYWORDS
KEY_CACHES
KEY_COLUMN_USAGE
+KEY_PERIOD_USAGE
+OPTIMIZER_COSTS
OPTIMIZER_TRACE
PARAMETERS
PARTITIONS
+PERIODS
PLUGINS
PROCESSLIST
PROFILING
@@ -233,8 +236,8 @@ Field Type Collation Null Key Default Extra Privileges Comment
c varchar(64) utf8mb3_general_ci NO NULL select,insert,update,references
select * from information_schema.COLUMNS where table_name="t1"
and column_name= "a";
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
-def mysqltest t1 a 1 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
+def mysqltest t1 a 1 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
show columns from mysqltest.t1 where field like "%a%";
Field Type Null Key Default Extra
a int(11) YES NULL
@@ -388,21 +391,32 @@ connect user2,localhost,mysqltest_1,,;
connection user2;
select ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES WHERE ROUTINE_SCHEMA <> 'sys';
ROUTINE_NAME ROUTINE_DEFINITION
-sel2 NULL
-sub1 NULL
+sel2 begin
+select * from t1;
+select * from t2;
+end
+sub1 return i+1
create function sub2(i int) returns int
return i+1;
select ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES WHERE ROUTINE_SCHEMA <> 'sys';
ROUTINE_NAME ROUTINE_DEFINITION
-sel2 NULL
-sub1 NULL
+sel2 begin
+select * from t1;
+select * from t2;
+end
+sub1 return i+1
sub2 return i+1
show create procedure sel2;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
-sel2 NULL latin1 latin1_swedish_ci latin1_swedish_ci
+sel2 CREATE DEFINER=`root`@`localhost` PROCEDURE `sel2`()
+begin
+select * from t1;
+select * from t2;
+end latin1 latin1_swedish_ci latin1_swedish_ci
show create function sub1;
Function sql_mode Create Function character_set_client collation_connection Database Collation
-sub1 NULL latin1 latin1_swedish_ci latin1_swedish_ci
+sub1 CREATE DEFINER=`root`@`localhost` FUNCTION `sub1`(i int) RETURNS int(11)
+return i+1 latin1 latin1_swedish_ci latin1_swedish_ci
show create function sub2;
Function sql_mode Create Function character_set_client collation_connection Database Collation
sub2 CREATE DEFINER=`mysqltest_1`@`localhost` FUNCTION `sub2`(i int) RETURNS int(11)
@@ -500,6 +514,7 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'mysqltest_1'@'localhost' def test EVENT YES
'mysqltest_1'@'localhost' def test TRIGGER YES
'mysqltest_1'@'localhost' def test DELETE HISTORY YES
+'mysqltest_1'@'localhost' def test SHOW CREATE ROUTINE YES
select * from information_schema.TABLE_PRIVILEGES where grantee like '%mysqltest_1%';
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'mysqltest_1'@'localhost' def test t1 SELECT NO
@@ -995,7 +1010,9 @@ COLUMN_PRIVILEGES TABLE_NAME select
FILES TABLE_NAME select
INDEX_STATISTICS TABLE_NAME select
KEY_COLUMN_USAGE TABLE_NAME select
+KEY_PERIOD_USAGE TABLE_NAME select
PARTITIONS TABLE_NAME select
+PERIODS TABLE_NAME select
REFERENTIAL_CONSTRAINTS TABLE_NAME select
STATISTICS TABLE_NAME select
TABLES TABLE_NAME select
@@ -1434,7 +1451,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tables ALL NULL NULL NULL NULL NULL Open_frm_only; Scanned all databases; Using filesort
explain select * from (select table_name from information_schema.tables) as a;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 100
2 DERIVED tables ALL NULL NULL NULL NULL NULL Skip_open_table; Scanned all databases
set optimizer_switch=@tmp_optimizer_switch;
drop view v1;
@@ -1476,6 +1493,7 @@ memory_by_user_by_current_bytes NO
memory_global_by_current_bytes YES
memory_global_total NO
metrics NO
+privileges_by_table_by_level NO
processlist NO
ps_check_lost_instrumentation YES
schema_auto_increment_columns NO
@@ -1748,9 +1766,9 @@ WHERE TABLE_SCHEMA='mysql' and TABLE_NAME= 'db';
TABLE_COLLATION
utf8mb3_bin
select * from information_schema.columns where table_schema = NULL;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
select * from `information_schema`.`COLUMNS` where `TABLE_NAME` = NULL;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
select * from `information_schema`.`KEY_COLUMN_USAGE` where `TABLE_SCHEMA` = NULL;
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
select * from `information_schema`.`KEY_COLUMN_USAGE` where `TABLE_NAME` = NULL;
@@ -2091,7 +2109,7 @@ LEFT JOIN INFORMATION_SCHEMA.COLUMNS
USING (TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME)
WHERE COLUMNS.TABLE_SCHEMA = 'test'
AND COLUMNS.TABLE_NAME = 't1';
-TABLE_SCHEMA TABLE_NAME COLUMN_NAME CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME TABLE_CATALOG ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
+TABLE_SCHEMA TABLE_NAME COLUMN_NAME CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME TABLE_CATALOG ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
#
# A test case for Bug#56540 "Exception (crash) in sql_show.cc
# during rqg_info_schema test on Windows"
@@ -2358,7 +2376,7 @@ SCHEMA_NAME
# Diagnostics_area::sql_errno upon query from I_S with LIMIT ROWS EXAMINED
#
SELECT * FROM INFORMATION_SCHEMA.`COLUMNS` LIMIT ROWS EXAMINED 10;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
Warnings:
Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 10. The query result may be incomplete
#
diff --git a/mysql-test/main/information_schema_all_engines.result b/mysql-test/main/information_schema_all_engines.result
index 23a853e3..f9b5152c 100644
--- a/mysql-test/main/information_schema_all_engines.result
+++ b/mysql-test/main/information_schema_all_engines.result
@@ -42,9 +42,12 @@ INNODB_TRX
KEYWORDS
KEY_CACHES
KEY_COLUMN_USAGE
+KEY_PERIOD_USAGE
+OPTIMIZER_COSTS
OPTIMIZER_TRACE
PARAMETERS
PARTITIONS
+PERIODS
PLUGINS
PROCESSLIST
PROFILING
@@ -123,9 +126,12 @@ INNODB_TRX trx_id
KEYWORDS WORD
KEY_CACHES KEY_CACHE_NAME
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
+KEY_PERIOD_USAGE CONSTRAINT_SCHEMA
+OPTIMIZER_COSTS ENGINE
OPTIMIZER_TRACE QUERY
PARAMETERS SPECIFIC_SCHEMA
PARTITIONS TABLE_SCHEMA
+PERIODS TABLE_SCHEMA
PLUGINS PLUGIN_NAME
PROCESSLIST ID
PROFILING QUERY_ID
@@ -204,9 +210,12 @@ INNODB_TRX trx_id
KEYWORDS WORD
KEY_CACHES KEY_CACHE_NAME
KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
+KEY_PERIOD_USAGE CONSTRAINT_SCHEMA
+OPTIMIZER_COSTS ENGINE
OPTIMIZER_TRACE QUERY
PARAMETERS SPECIFIC_SCHEMA
PARTITIONS TABLE_SCHEMA
+PERIODS TABLE_SCHEMA
PLUGINS PLUGIN_NAME
PROCESSLIST ID
PROFILING QUERY_ID
@@ -289,9 +298,12 @@ INNODB_TABLESPACES_ENCRYPTION information_schema.INNODB_TABLESPACES_ENCRYPTION 1
INNODB_TRX information_schema.INNODB_TRX 1
KEY_CACHES information_schema.KEY_CACHES 1
KEY_COLUMN_USAGE information_schema.KEY_COLUMN_USAGE 1
+KEY_PERIOD_USAGE information_schema.KEY_PERIOD_USAGE 1
+OPTIMIZER_COSTS information_schema.OPTIMIZER_COSTS 1
OPTIMIZER_TRACE information_schema.OPTIMIZER_TRACE 1
PARAMETERS information_schema.PARAMETERS 1
PARTITIONS information_schema.PARTITIONS 1
+PERIODS information_schema.PERIODS 1
PLUGINS information_schema.PLUGINS 1
PROCESSLIST information_schema.PROCESSLIST 1
PROFILING information_schema.PROFILING 1
@@ -359,9 +371,12 @@ Database: information_schema
| KEYWORDS |
| KEY_CACHES |
| KEY_COLUMN_USAGE |
+| KEY_PERIOD_USAGE |
+| OPTIMIZER_COSTS |
| OPTIMIZER_TRACE |
| PARAMETERS |
| PARTITIONS |
+| PERIODS |
| PLUGINS |
| PROCESSLIST |
| PROFILING |
@@ -430,9 +445,12 @@ Database: INFORMATION_SCHEMA
| KEYWORDS |
| KEY_CACHES |
| KEY_COLUMN_USAGE |
+| KEY_PERIOD_USAGE |
+| OPTIMIZER_COSTS |
| OPTIMIZER_TRACE |
| PARAMETERS |
| PARTITIONS |
+| PERIODS |
| PLUGINS |
| PROCESSLIST |
| PROFILING |
@@ -463,5 +481,5 @@ Wildcard: inf_rmation_schema
| information_schema |
SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') GROUP BY TABLE_SCHEMA;
table_schema count(*)
-information_schema 66
+information_schema 69
mysql 31
diff --git a/mysql-test/main/information_schema_db.result b/mysql-test/main/information_schema_db.result
index b3bbdeaa..b14cacc4 100644
--- a/mysql-test/main/information_schema_db.result
+++ b/mysql-test/main/information_schema_db.result
@@ -26,8 +26,6 @@ declare ret_val int;
select max(f1) from t1 into ret_val;
return ret_val;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create view v1 as select f1 from t1 where f1 = func1(f1);
create function func2() returns int return 1;
use mbase;
@@ -107,7 +105,7 @@ grant insert on v1 to testdb_2@localhost;
create view v5 as select f1 from t1;
grant select, show view on v5 to testdb_2@localhost;
create definer=`no_such_user`@`no_such_host` view v6 as select f1 from t1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, SET USER privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the SET USER privilege(s) for this operation
connection default;
use testdb_1;
create view v6 as select f1 from t1;
diff --git a/mysql-test/main/information_schema_parameters.result b/mysql-test/main/information_schema_parameters.result
index 1d00c992..a8f2c187 100644
--- a/mysql-test/main/information_schema_parameters.result
+++ b/mysql-test/main/information_schema_parameters.result
@@ -46,6 +46,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
@@ -68,6 +70,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
@@ -90,6 +94,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
@@ -112,6 +118,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
@@ -134,6 +142,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
@@ -156,6 +166,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
@@ -178,6 +190,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
@@ -200,6 +214,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
@@ -222,6 +238,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
@@ -244,6 +262,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
@@ -266,6 +286,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
@@ -288,6 +310,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
@@ -310,6 +334,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
@@ -332,6 +358,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
@@ -354,6 +382,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME PARAMETERS
@@ -376,6 +406,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
DESCRIBE INFORMATION_SCHEMA.PARAMETERS;
Field Type Null Key Default Extra
SPECIFIC_CATALOG varchar(512) NO NULL
diff --git a/mysql-test/main/information_schema_routines.result b/mysql-test/main/information_schema_routines.result
index b5b43db7..dd2e8d65 100644
--- a/mysql-test/main/information_schema_routines.result
+++ b/mysql-test/main/information_schema_routines.result
@@ -63,6 +63,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -85,6 +87,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -107,6 +111,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -129,6 +135,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -151,6 +159,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -173,6 +183,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -195,6 +207,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -217,6 +231,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -239,6 +255,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -261,6 +279,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -283,6 +303,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -305,6 +327,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -327,6 +351,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -349,6 +375,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -371,6 +399,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -393,6 +423,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -415,6 +447,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -437,6 +471,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -459,6 +495,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -481,6 +519,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -503,6 +543,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -525,6 +567,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -547,6 +591,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -569,6 +615,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -591,6 +639,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -613,6 +663,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -635,6 +687,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -657,6 +711,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -679,6 +735,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -701,6 +759,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA information_schema
TABLE_NAME ROUTINES
@@ -723,6 +783,8 @@ PRIVILEGES #
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
DESCRIBE INFORMATION_SCHEMA.ROUTINES;
Field Type Null Key Default Extra
SPECIFIC_NAME varchar(64) NO NULL
diff --git a/mysql-test/main/information_schema_temp_table.result b/mysql-test/main/information_schema_temp_table.result
new file mode 100644
index 00000000..18a4c0b1
--- /dev/null
+++ b/mysql-test/main/information_schema_temp_table.result
@@ -0,0 +1,321 @@
+#
+# MDEV-12459: The information_schema tables for getting temporary tables
+# info is missing, at least for innodb, there is no
+# INNODB_TEMP_TABLE_INFO
+#
+# -------------------------------
+# Test shadowing of a base table
+# -------------------------------
+create database some_db;
+use some_db;
+# Creating temporary table with the same name shadows the base table
+# in `show create` and by design, should not raise any warning
+create table t(t int);
+create temporary table t(t int);
+show create table t;
+Table Create Table
+t CREATE TEMPORARY TABLE `t` (
+ `t` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+select table_schema, table_name, temporary from information_schema.tables where table_name='t';
+table_schema table_name temporary
+some_db t Y
+some_db t N
+drop table t;
+drop table t;
+use test;
+# ------------------------
+# IS.tables tests
+# ------------------------
+# Create first temporary table
+create temporary table test.t_temp(t int);
+insert into t_temp values (1),(2), (3);
+# Show results
+select table_schema, table_name, temporary from information_schema.tables where table_type='temporary';
+table_schema table_name temporary
+test t_temp Y
+# Create the base table with the same name (both should be visible)
+create table test.t_temp(t int);
+insert into t_temp values (-1),(-2);
+# Show results
+select table_schema, table_name, temporary from information_schema.tables where table_type='temporary';
+table_schema table_name temporary
+test t_temp Y
+create database my_db;
+# Create the temporary table with the same name in new DB
+create temporary table my_db.t_temp (t int);
+insert into my_db.t_temp values (-2),(-1);
+# Show results
+select table_schema, table_name, temporary from information_schema.tables where table_type='temporary'
+ order by table_schema desc, table_name desc, table_type desc;
+table_schema table_name temporary
+test t_temp Y
+my_db t_temp Y
+connect con1,localhost,root,,my_db,,;
+# Create the temporary table with the same name in new connection
+create temporary table t_temp(t int);
+insert into t_temp values (4),(5),(6), (7);
+# Show results
+select table_schema, table_name, temporary from information_schema.tables where table_type='temporary'
+ order by table_schema desc, table_name desc, table_type desc;
+table_schema table_name temporary
+my_db t_temp Y
+connection default;
+# Show results in default connection
+select table_schema, table_name, temporary from information_schema.tables where table_type='temporary'
+ order by table_schema desc, table_name desc, table_type desc;
+table_schema table_name temporary
+test t_temp Y
+my_db t_temp Y
+# Check shadowing and (no)warning with explicit referencing database
+create table some_db.my_t (t int);
+show warnings;
+Level Code Message
+create temporary table some_db.my_t (t int);
+show warnings;
+Level Code Message
+# Show results
+select table_schema, table_name, temporary from information_schema.tables where table_type='temporary'
+ order by table_schema desc, table_name desc, table_type desc;
+table_schema table_name temporary
+test t_temp Y
+some_db my_t Y
+my_db t_temp Y
+use test;
+create table t1 (a int);
+create sequence s1;
+create temporary table t1 (b int);
+create temporary sequence s1;
+create temporary sequence s2;
+select table_schema, table_name, table_type, temporary from information_schema.tables where table_schema = 'test'
+ order by table_schema desc, table_name desc, table_type desc;
+table_schema table_name table_type temporary
+test t_temp TEMPORARY Y
+test t_temp BASE TABLE N
+test t1 TEMPORARY Y
+test t1 BASE TABLE N
+test s2 TEMPORARY SEQUENCE Y
+test s1 TEMPORARY SEQUENCE Y
+test s1 SEQUENCE N
+drop table t1;
+drop table t1;
+drop table s1;
+drop table s1;
+drop table s2;
+drop table some_db.my_t;
+drop table some_db.my_t;
+disconnect con1;
+drop table test.t_temp;
+drop table test.t_temp;
+drop database my_db;
+drop database some_db;
+#
+# MDEV-28332: Alter on temporary table causes ER_TABLE_EXISTS_ERROR note
+#
+create table t (a int);
+create temporary table t (b int);
+alter table t add c int;
+drop temporary table t;
+drop table t;
+#
+# MDEV-28334: SHOW TABLE STATUS shows all temporary tables
+# ignoring database and conditions
+#
+create temporary table test.tmp_in_test (a int);
+create table test.base_in_test (t int);
+create table test.tmp_in_test (t int);
+create temporary table test.tmp_innodb_in_test (a int) engine=InnoDB;
+create database mysqltest;
+use mysqltest;
+show table status;
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
+show table status in mysqltest;
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
+show table status in test;
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
+tmp_innodb_in_test InnoDB 10 Dynamic 0 0 16384 0 0 6291456 NULL # # # latin1_swedish_ci NULL 0 Y
+tmp_in_test MyISAM 10 Fixed 0 0 0 1970324836974591 1024 0 NULL # # # latin1_swedish_ci NULL 17179868160 Y
+base_in_test MyISAM 10 Fixed 0 0 0 1970324836974591 1024 0 NULL # # # latin1_swedish_ci NULL 17179868160 N
+tmp_in_test MyISAM 10 Fixed 0 0 0 1970324836974591 1024 0 NULL # # # latin1_swedish_ci NULL 17179868160 N
+show table status from test;
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
+tmp_innodb_in_test InnoDB 10 Dynamic 0 0 16384 0 0 6291456 NULL # # # latin1_swedish_ci NULL 0 Y
+tmp_in_test MyISAM 10 Fixed 0 0 0 1970324836974591 1024 0 NULL # # # latin1_swedish_ci NULL 17179868160 Y
+base_in_test MyISAM 10 Fixed 0 0 0 1970324836974591 1024 0 NULL # # # latin1_swedish_ci NULL 17179868160 N
+tmp_in_test MyISAM 10 Fixed 0 0 0 1970324836974591 1024 0 NULL # # # latin1_swedish_ci NULL 17179868160 N
+# check that InnoDB temporary table
+# has a NULL value for `Create time` column (MDEV-28333)
+select create_time from information_schema.tables where table_name='tmp_innodb_in_test';
+create_time
+NULL
+show table status like 'nonexisting';
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
+drop database mysqltest;
+drop table test.base_in_test;
+drop table test.tmp_in_test;
+drop table test.tmp_in_test;
+#
+# MDEV-28453: SHOW commands are inconsistent for temporary tables
+#
+create database mysqltest;
+use mysqltest;
+create table t (a int, key(a)) engine=Aria;
+create temporary table t (b int, key(b)) engine=MyISAM;
+create table base_table(t int);
+create temporary table tmp_table (b int, key(b));
+create sequence s1;
+create temporary sequence s1;
+create temporary sequence s2;
+show tables;
+Tables_in_mysqltest
+s2
+s1
+tmp_table
+t
+base_table
+s1
+t
+show full tables;
+Tables_in_mysqltest Table_type
+s2 TEMPORARY SEQUENCE
+s1 TEMPORARY SEQUENCE
+tmp_table TEMPORARY TABLE
+t TEMPORARY TABLE
+base_table BASE TABLE
+s1 SEQUENCE
+t BASE TABLE
+show table status;
+Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
+s2 MyISAM 10 Fixed 1 58 58 16325548649218047 1024 0 NULL # # # latin1_swedish_ci NULL 17179868160 Y
+s1 MyISAM 10 Fixed 1 58 58 16325548649218047 1024 0 NULL # # # latin1_swedish_ci NULL 17179868160 Y
+tmp_table MyISAM 10 Fixed 0 0 0 1970324836974591 1024 0 NULL # # # latin1_swedish_ci NULL 288230376151710720 Y
+t MyISAM 10 Fixed 0 0 0 1970324836974591 1024 0 NULL # # # latin1_swedish_ci NULL 288230376151710720 Y
+base_table MyISAM 10 Fixed 0 0 0 1970324836974591 1024 0 NULL # # # latin1_swedish_ci NULL 17179868160 N
+s1 MyISAM 10 Fixed 1 58 58 16325548649218047 1024 0 NULL # # # latin1_swedish_ci NULL 17179868160 N
+t Aria 10 Page 0 0 8192 17592186011648 8192 0 NULL # # # latin1_swedish_ci NULL transactional=1 9007199254732800 N
+show columns in t;
+Field Type Null Key Default Extra
+b int(11) YES MUL NULL
+show index in t;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
+t 1 b 1 b A NULL NULL NULL YES BTREE NO
+drop database mysqltest;
+use test;
+show full tables;
+Tables_in_test Table_type
+tmp_innodb_in_test TEMPORARY TABLE
+select * from tmp_innodb_in_test, tmp_innodb_in_test x;
+a a
+show full tables;
+Tables_in_test Table_type
+tmp_innodb_in_test TEMPORARY TABLE
+drop temporary tables tmp_innodb_in_test;
+create temporary table foo.t1 (a int);
+select table_schema, table_name from information_schema.tables where table_type='temporary';
+table_schema table_name
+foo t1
+mysqltest tmp_table
+mysqltest t
+my_db t_temp
+drop temporary table foo.t1;
+#
+# MDEV-28351 Assertion `this->file->children_attached' failed in ha_myisammrg::info
+#
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+insert into t1 values (1);
+CREATE TEMPORARY TABLE t2 (a INT) ENGINE=MERGE UNION=(t1);
+CREATE TABLE t3 (a INT) ENGINE=MERGE UNION=(t1);
+SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test';
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT MAX_INDEX_LENGTH TEMPORARY
+def test t1 BASE TABLE MyISAM 10 Fixed 1 7 X X X X NULL X X NULL latin1_swedish_ci NULL X N
+def test t2 TEMPORARY MRG_MyISAM 10 Fixed 0 0 X X X X NULL X X NULL latin1_swedish_ci NULL X Y
+def test t3 BASE TABLE MRG_MyISAM 10 Fixed 1 5 X X X X NULL X X NULL latin1_swedish_ci NULL X N
+DROP TABLE t1,t2,t3;
+#
+# MDEV-31618: Server crashes in
+# process_i_s_table_temporary_tables/get_all_tables
+#
+CREATE TEMPORARY SEQUENCE seq1;
+SHOW FULL TABLES;
+Tables_in_test Table_type
+seq1 TEMPORARY SEQUENCE
+SELECT table_schema, table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_type='temporary sequence';
+table_schema table_name
+test seq1
+mysqltest s2
+mysqltest s1
+ALTER TABLE `seq1` CHANGE `cache_size` cache_size int;
+ERROR HY000: Sequence 'test.seq1' table structure is invalid (cache_size)
+SHOW FULL TABLES;
+Tables_in_test Table_type
+seq1 TEMPORARY SEQUENCE
+SELECT table_schema, table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_type='temporary sequence';
+table_schema table_name
+test seq1
+mysqltest s2
+mysqltest s1
+CREATE OR REPLACE TEMPORARY SEQUENCE seq1;
+SHOW FULL TABLES;
+Tables_in_test Table_type
+seq1 TEMPORARY SEQUENCE
+SELECT table_schema, table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_type='temporary sequence';
+table_schema table_name
+test seq1
+mysqltest s2
+mysqltest s1
+DROP TABLE seq1;
+DROP TABLE mysqltest.s1;
+DROP TABLE mysqltest.s2;
+#
+# MDEV-31618: Server crashes in
+# process_i_s_table_temporary_tables/get_all_tables after alter in rename
+#
+CREATE table seq1 (a bigint, b int);
+CREATE TEMPORARY TABLE tmp LIKE seq1;
+INSERT tmp SELECT * FROM seq1;
+ALTER TABLE tmp RENAME TO seq1;
+ALTER TABLE seq1 CHANGE a b int ;
+Got one of the listed errors
+RENAME TABLE seq1 TO seq1;
+ERROR 42S01: Table 'seq1' already exists
+show full tables;
+Tables_in_test Table_type
+seq1 TEMPORARY TABLE
+seq1 BASE TABLE
+drop table seq1;
+drop table seq1;
+CREATE SEQUENCE seq2;
+CREATE TEMPORARY sequence tmp;
+show full tables;
+Tables_in_test Table_type
+tmp TEMPORARY SEQUENCE
+seq2 SEQUENCE
+ALTER table `tmp` RENAME TO seq1;
+show full tables;
+Tables_in_test Table_type
+seq1 TEMPORARY SEQUENCE
+seq2 SEQUENCE
+ALTER TABLE `seq1` CHANGE `cache_size` cache_size int ;
+ERROR HY000: Sequence 'test.seq1' table structure is invalid (cache_size)
+show full tables;
+Tables_in_test Table_type
+seq1 TEMPORARY SEQUENCE
+seq2 SEQUENCE
+RENAME TABLE seq1 TO seq1;
+ERROR 42S01: Table 'seq1' already exists
+show full tables;
+Tables_in_test Table_type
+seq1 TEMPORARY SEQUENCE
+seq2 SEQUENCE
+RENAME TABLE seq1 TO seq3;
+show full tables;
+Tables_in_test Table_type
+seq3 TEMPORARY SEQUENCE
+seq2 SEQUENCE
+drop table seq2;
+show full tables;
+Tables_in_test Table_type
+seq3 TEMPORARY SEQUENCE
+drop table seq3;
+show full tables;
+Tables_in_test Table_type
diff --git a/mysql-test/main/information_schema_temp_table.test b/mysql-test/main/information_schema_temp_table.test
new file mode 100644
index 00000000..b242b7cf
--- /dev/null
+++ b/mysql-test/main/information_schema_temp_table.test
@@ -0,0 +1,280 @@
+--echo #
+--echo # MDEV-12459: The information_schema tables for getting temporary tables
+--echo # info is missing, at least for innodb, there is no
+--echo # INNODB_TEMP_TABLE_INFO
+--echo #
+
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+--source include/have_innodb.inc
+
+--echo # -------------------------------
+--echo # Test shadowing of a base table
+--echo # -------------------------------
+
+create database some_db;
+use some_db;
+
+--echo # Creating temporary table with the same name shadows the base table
+--echo # in `show create` and by design, should not raise any warning
+create table t(t int);
+create temporary table t(t int);
+show create table t;
+select table_schema, table_name, temporary from information_schema.tables where table_name='t';
+drop table t;
+drop table t;
+use test;
+
+--echo # ------------------------
+--echo # IS.tables tests
+--echo # ------------------------
+
+--echo # Create first temporary table
+create temporary table test.t_temp(t int);
+insert into t_temp values (1),(2), (3);
+
+--echo # Show results
+select table_schema, table_name, temporary from information_schema.tables where table_type='temporary';
+
+--echo # Create the base table with the same name (both should be visible)
+# Create the base table with the same name as temporary table.
+create table test.t_temp(t int);
+insert into t_temp values (-1),(-2);
+
+--echo # Show results
+select table_schema, table_name, temporary from information_schema.tables where table_type='temporary';
+
+create database my_db;
+--echo # Create the temporary table with the same name in new DB
+create temporary table my_db.t_temp (t int);
+insert into my_db.t_temp values (-2),(-1);
+--echo # Show results
+--horizontal_results
+select table_schema, table_name, temporary from information_schema.tables where table_type='temporary'
+ order by table_schema desc, table_name desc, table_type desc;
+
+connect (con1,localhost,root,,my_db,,);
+
+--echo # Create the temporary table with the same name in new connection
+create temporary table t_temp(t int);
+insert into t_temp values (4),(5),(6), (7);
+--echo # Show results
+select table_schema, table_name, temporary from information_schema.tables where table_type='temporary'
+ order by table_schema desc, table_name desc, table_type desc;
+
+connection default;
+
+--echo # Show results in default connection
+select table_schema, table_name, temporary from information_schema.tables where table_type='temporary'
+ order by table_schema desc, table_name desc, table_type desc;
+
+--echo # Check shadowing and (no)warning with explicit referencing database
+create table some_db.my_t (t int);
+show warnings;
+create temporary table some_db.my_t (t int);
+show warnings;
+
+--echo # Show results
+select table_schema, table_name, temporary from information_schema.tables where table_type='temporary'
+ order by table_schema desc, table_name desc, table_type desc;
+
+# Check with sequences
+use test;
+create table t1 (a int);
+create sequence s1;
+create temporary table t1 (b int);
+create temporary sequence s1;
+create temporary sequence s2;
+select table_schema, table_name, table_type, temporary from information_schema.tables where table_schema = 'test'
+ order by table_schema desc, table_name desc, table_type desc;
+
+drop table t1;
+drop table t1;
+drop table s1;
+drop table s1;
+drop table s2;
+
+# First we are removing temporary table and after base table
+drop table some_db.my_t;
+drop table some_db.my_t;
+
+disconnect con1;
+
+# Drop both temporary and "real" table from test.
+drop table test.t_temp;
+drop table test.t_temp;
+
+drop database my_db;
+drop database some_db;
+
+# Wait till all disconnects are completed
+--source include/wait_until_count_sessions.inc
+
+--echo #
+--echo # MDEV-28332: Alter on temporary table causes ER_TABLE_EXISTS_ERROR note
+--echo #
+create table t (a int);
+create temporary table t (b int);
+alter table t add c int;
+
+# Cleanup
+drop temporary table t;
+drop table t;
+
+--echo #
+--echo # MDEV-28334: SHOW TABLE STATUS shows all temporary tables
+--echo # ignoring database and conditions
+--echo #
+
+create temporary table test.tmp_in_test (a int);
+create table test.base_in_test (t int);
+# The base table with the same name as temporary table
+create table test.tmp_in_test (t int);
+# The temporary InnoDB table - CREATE TIME should be NULL, MDEV-28333
+create temporary table test.tmp_innodb_in_test (a int) engine=InnoDB;
+
+create database mysqltest;
+use mysqltest;
+
+# This should show tables from currently used DB
+# no temporary tables created and empty result set should be returned
+show table status;
+
+# The same as before
+show table status in mysqltest;
+
+# The should show all ables from `test` DB
+--replace_column 12 # 13 # 14 #
+--horizontal_results
+show table status in test;
+
+# The same as before
+--replace_column 12 # 13 # 14 #
+--horizontal_results
+show table status from test;
+
+
+--echo # check that InnoDB temporary table
+--echo # has a NULL value for `Create time` column (MDEV-28333)
+select create_time from information_schema.tables where table_name='tmp_innodb_in_test';
+
+# This shouldn't give any results
+show table status like 'nonexisting';
+
+# Cleanup
+drop database mysqltest;
+drop table test.base_in_test;
+# We need first to drop temporary table that shadows the base table
+drop table test.tmp_in_test;
+drop table test.tmp_in_test;
+
+--echo #
+--echo # MDEV-28453: SHOW commands are inconsistent for temporary tables
+--echo #
+create database mysqltest;
+use mysqltest;
+create table t (a int, key(a)) engine=Aria;
+create temporary table t (b int, key(b)) engine=MyISAM;
+create table base_table(t int);
+create temporary table tmp_table (b int, key(b));
+create sequence s1;
+create temporary sequence s1;
+create temporary sequence s2;
+
+# This should show all tables
+show tables;
+# This should show all tables with additional table_type
+show full tables;
+# This is already showing all tables (not related to bug)
+--replace_column 12 # 13 # 14 #
+show table status;
+# This is showing temporary table as expected since it is shadowing base table
+show columns in t;
+# This is showing temporary table as expected since it is shadowing base table
+show index in t;
+
+# Cleanup
+drop database mysqltest;
+use test;
+
+# many instances of the table temp table:
+show full tables;
+select * from tmp_innodb_in_test, tmp_innodb_in_test x;
+show full tables;
+drop temporary tables tmp_innodb_in_test;
+
+# non-existent db
+create temporary table foo.t1 (a int); # yup, that works
+select table_schema, table_name from information_schema.tables where table_type='temporary';
+drop temporary table foo.t1;
+
+--echo #
+--echo # MDEV-28351 Assertion `this->file->children_attached' failed in ha_myisammrg::info
+--echo #
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+insert into t1 values (1);
+CREATE TEMPORARY TABLE t2 (a INT) ENGINE=MERGE UNION=(t1);
+CREATE TABLE t3 (a INT) ENGINE=MERGE UNION=(t1);
+--sorted_result
+--replace_column 10 X 11 X 12 X 13 X 15 X 16 X 22 X
+SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test';
+DROP TABLE t1,t2,t3;
+
+--echo #
+--echo # MDEV-31618: Server crashes in
+--echo # process_i_s_table_temporary_tables/get_all_tables
+--echo #
+
+CREATE TEMPORARY SEQUENCE seq1;
+# Check show temp tables before alter
+SHOW FULL TABLES;
+SELECT table_schema, table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_type='temporary sequence';
+--error 4086
+ALTER TABLE `seq1` CHANGE `cache_size` cache_size int;
+# Check show temp tables after alter
+SHOW FULL TABLES;
+SELECT table_schema, table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_type='temporary sequence';
+
+CREATE OR REPLACE TEMPORARY SEQUENCE seq1;
+# Check show temp tables after create/replace alter
+SHOW FULL TABLES;
+SELECT table_schema, table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_type='temporary sequence';
+DROP TABLE seq1;
+DROP TABLE mysqltest.s1;
+DROP TABLE mysqltest.s2;
+
+--echo #
+--echo # MDEV-31618: Server crashes in
+--echo # process_i_s_table_temporary_tables/get_all_tables after alter in rename
+--echo #
+# Check on temporary tables
+CREATE table seq1 (a bigint, b int);
+CREATE TEMPORARY TABLE tmp LIKE seq1;
+INSERT tmp SELECT * FROM seq1;
+ALTER TABLE tmp RENAME TO seq1;
+--error 4086,1060
+ALTER TABLE seq1 CHANGE a b int ;
+--error 1050
+RENAME TABLE seq1 TO seq1;
+show full tables;
+drop table seq1;
+drop table seq1;
+
+# Check on sequences
+CREATE SEQUENCE seq2;
+CREATE TEMPORARY sequence tmp;
+show full tables;
+ALTER table `tmp` RENAME TO seq1;
+show full tables;
+--error ER_SEQUENCE_INVALID_TABLE_STRUCTURE
+ALTER TABLE `seq1` CHANGE `cache_size` cache_size int ;
+show full tables;
+--error ER_TABLE_EXISTS_ERROR
+RENAME TABLE seq1 TO seq1;
+show full tables;
+RENAME TABLE seq1 TO seq3;
+show full tables;
+drop table seq2;
+show full tables;
+drop table seq3;
+show full tables;
diff --git a/mysql-test/main/innodb_ext_key,off.rdiff b/mysql-test/main/innodb_ext_key,off.rdiff
index f27df1d0..8b24cc9a 100644
--- a/mysql-test/main/innodb_ext_key,off.rdiff
+++ b/mysql-test/main/innodb_ext_key,off.rdiff
@@ -172,7 +172,7 @@
where l_partkey between 1 and 10 group by l_partkey;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE lineitem range i_l_suppkey_partkey,i_l_partkey i_l_partkey 5 NULL # Using where; Using index for group-by
-+1 SIMPLE lineitem range i_l_suppkey_partkey,i_l_partkey i_l_partkey 5 NULL # Using where; Using index
++1 SIMPLE lineitem range i_l_suppkey_partkey,i_l_partkey i_l_suppkey_partkey 5 NULL # Using where; Using index
flush status;
select max(l_orderkey) from lineitem
where l_partkey between 1 and 10 group by l_partkey;
@@ -240,7 +240,7 @@
select straight_join * from t0, part ignore index (primary)
where p_partkey=t0.a and p_size=1;
a p_partkey p_name p_mfgr p_brand p_type p_size p_container p_retailprice p_comment
-@@ -494,7 +494,7 @@
+@@ -495,7 +495,7 @@
select * from t1, t3 where t3.col1=t1.a and t3.col2=t1.a and t3.pk1=t1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where
@@ -249,7 +249,7 @@
drop table t1,t2,t3;
#
# Bug mdev-4340: performance regression with extended_keys=on
-@@ -714,13 +714,13 @@
+@@ -726,13 +726,13 @@
select * from t1 force index(index_date_updated)
where index_date_updated= 10 and index_id < 800;
id select_type table type possible_keys key key_len ref rows Extra
@@ -265,7 +265,7 @@
drop table t0,t1,t2;
#
# MDEV-11196: Error:Run-Time Check Failure #2 - Stack around the variable 'key_buff'
-@@ -768,11 +768,12 @@
+@@ -770,11 +770,12 @@
{
"table": {
"table_name": "t1",
@@ -278,10 +278,10 @@
+ "key_length": "3066",
+ "used_key_parts": ["f2"],
+ "ref": ["const"],
+ "loops": 1,
"rows": 1,
- "filtered": 100,
- "index_condition": "t1.pk1 <= 5 and t1.pk2 <= 5 and t1.f2 = 'abc'",
-@@ -805,8 +806,8 @@
+ "cost": "COST_REPLACED",
+@@ -810,8 +811,8 @@
"access_type": "range",
"possible_keys": ["k1"],
"key": "k1",
@@ -289,6 +289,6 @@
- "used_key_parts": ["pk1", "f2", "pk2"],
+ "key_length": "3007",
+ "used_key_parts": ["pk1", "f2"],
+ "loops": 1,
"rows": 1,
- "filtered": 100,
- "index_condition": "t1.f2 <= 5 and t1.pk2 <= 5 and t1.pk1 = 'abc'",
+ "cost": "COST_REPLACED",
diff --git a/mysql-test/main/innodb_ext_key.result b/mysql-test/main/innodb_ext_key.result
index ba91b57a..35c4e53f 100644
--- a/mysql-test/main/innodb_ext_key.result
+++ b/mysql-test/main/innodb_ext_key.result
@@ -308,7 +308,7 @@ Handler_read_rnd_next 0
# when extended_keys=on
#
create table t0 (a int);
-insert into t0 values (1), (2), (3), (4), (5);
+insert into t0 select seq from seq_1_to_5;
create index i_p_size on part(p_size);
explain
select straight_join * from t0, part ignore index (primary)
@@ -339,8 +339,8 @@ a b
EXPLAIN
SELECT * FROM t1 WHERE 2 IN (SELECT MAX(s1.a) FROM t1 AS s1, t1 AS s2);
id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY <subquery2> const distinct_key distinct_key 4 const 1
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join)
2 MATERIALIZED s1 ALL NULL NULL NULL NULL 2
2 MATERIALIZED s2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join)
DROP TABLE t1;
@@ -381,17 +381,18 @@ INSERT INTO t2 VALUES
(10), (11), (12), (13), (14),
(15), (16), (17), (18), (19), (24);
EXPLAIN
-SELECT a FROM t1 AS t, t2
-WHERE c = a AND b IN (SELECT b FROM t1, t2 WHERE b = t.b);
+SELECT a FROM t1 AS t, t2 as t2_out
+WHERE t2_out.c = t.a AND t.b IN (SELECT b FROM t1, t2 WHERE b = t.b);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t index a,b b 7 NULL 10 Using index
-1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t.a 1 Using index
-1 PRIMARY t1 ref b b 3 test.t.b 2 Using index; Start temporary
+1 PRIMARY t1 index b b 7 NULL 10 Using index; Start temporary
+1 PRIMARY t ref a,b b 3 test.t1.b 2 Using index
1 PRIMARY t2 index NULL PRIMARY 4 NULL 11 Using index; End temporary; Using join buffer (flat, BNL join)
-SELECT a FROM t1 AS t, t2
-WHERE c = a AND b IN (SELECT b FROM t1, t2 WHERE b = t.b);
+1 PRIMARY t2_out eq_ref PRIMARY PRIMARY 4 test.t.a 1 Using index
+SELECT a FROM t1 AS t, t2 as t2_out
+WHERE t2_out.c = t.a AND t.b IN (SELECT b FROM t1, t2 WHERE b = t.b);
a
24
+Last_query_cost 0.120558
DROP TABLE t1,t2;
#
# LP Bug #923236: hash join + extended_keys = on
@@ -645,7 +646,7 @@ a
2
explain select a from t2 where b is null order by a desc limit 2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range b b 9 NULL 3 Using where; Using filesort
+1 SIMPLE t2 index b PRIMARY 8 NULL 2 Using where
select a from t2 where b is null order by a desc limit 2;
a
3
@@ -758,12 +759,13 @@ PRIMARY KEY (pk1,pk2),
KEY(f2)
) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC;
INSERT INTO t1 VALUES (1,2,'2','abc'),(2,3,'3','def');
-explain format= json
+explain format=json
select * from t1 force index(f2) where pk1 <= 5 and pk2 <=5 and f2 = 'abc' and f1 <= '3';
EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -773,7 +775,9 @@ EXPLAIN
"key": "f2",
"key_length": "3070",
"used_key_parts": ["f2", "pk1"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t1.pk1 <= 5 and t1.pk2 <= 5 and t1.f2 = 'abc'",
"attached_condition": "t1.f1 <= '3'"
@@ -792,12 +796,13 @@ PRIMARY KEY (pk1,pk2),
KEY k1(pk1,f2)
) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC;
INSERT INTO t1 VALUES (1,2,'2','abc'),(2,3,'3','def');
-explain format= json
+explain format=json
select * from t1 force index(k1) where f2 <= 5 and pk2 <=5 and pk1 = 'abc' and f1 <= '3';
EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -807,7 +812,9 @@ EXPLAIN
"key": "k1",
"key_length": "3011",
"used_key_parts": ["pk1", "f2", "pk2"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t1.f2 <= 5 and t1.pk2 <= 5 and t1.pk1 = 'abc'",
"attached_condition": "t1.f1 <= '3'"
diff --git a/mysql-test/main/innodb_ext_key.test b/mysql-test/main/innodb_ext_key.test
index 3d3a14c8..d24bb77e 100644
--- a/mysql-test/main/innodb_ext_key.test
+++ b/mysql-test/main/innodb_ext_key.test
@@ -4,6 +4,7 @@
--source include/innodb_prefix_index_cluster_optimization.inc
--source include/no_valgrind_without_big.inc
+--source include/have_sequence.inc
--source include/innodb_stable_estimates.inc
@@ -160,7 +161,7 @@ show /*d*/ status like 'handler_read%';
--echo #
create table t0 (a int);
-insert into t0 values (1), (2), (3), (4), (5);
+insert into t0 select seq from seq_1_to_5;
create index i_p_size on part(p_size);
explain
@@ -244,10 +245,11 @@ INSERT INTO t2 VALUES
(15), (16), (17), (18), (19), (24);
EXPLAIN
-SELECT a FROM t1 AS t, t2
- WHERE c = a AND b IN (SELECT b FROM t1, t2 WHERE b = t.b);
-SELECT a FROM t1 AS t, t2
- WHERE c = a AND b IN (SELECT b FROM t1, t2 WHERE b = t.b);
+SELECT a FROM t1 AS t, t2 as t2_out
+ WHERE t2_out.c = t.a AND t.b IN (SELECT b FROM t1, t2 WHERE b = t.b);
+SELECT a FROM t1 AS t, t2 as t2_out
+ WHERE t2_out.c = t.a AND t.b IN (SELECT b FROM t1, t2 WHERE b = t.b);
+--source include/last_query_cost.inc
DROP TABLE t1,t2;
@@ -618,7 +620,8 @@ CREATE TABLE t1 (
) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC;
INSERT INTO t1 VALUES (1,2,'2','abc'),(2,3,'3','def');
-explain format= json
+--source include/explain-no-costs.inc
+explain format=json
select * from t1 force index(f2) where pk1 <= 5 and pk2 <=5 and f2 = 'abc' and f1 <= '3';
drop table t1;
@@ -631,7 +634,8 @@ PRIMARY KEY (pk1,pk2),
KEY k1(pk1,f2)
) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC;
INSERT INTO t1 VALUES (1,2,'2','abc'),(2,3,'3','def');
-explain format= json
+--source include/explain-no-costs.inc
+explain format=json
select * from t1 force index(k1) where f2 <= 5 and pk2 <=5 and pk1 = 'abc' and f1 <= '3';
drop table t1;
diff --git a/mysql-test/main/innodb_icp.result b/mysql-test/main/innodb_icp.result
index d89f8c2e..e8ed6013 100644
--- a/mysql-test/main/innodb_icp.result
+++ b/mysql-test/main/innodb_icp.result
@@ -443,7 +443,7 @@ WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON it.i=it.i WHERE it.pk-t1.i<10
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where
2 DEPENDENT SUBQUERY it eq_ref PRIMARY PRIMARY 4 func # Using where
-2 DEPENDENT SUBQUERY t2 index NULL PRIMARY 4 NULL # Using index; Using join buffer (flat, BNL join)
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
SELECT * FROM t1
WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON it.i=it.i WHERE it.pk-t1.i<10);
pk i
@@ -461,9 +461,10 @@ c1 INT NOT NULL,
PRIMARY KEY (pk)
);
INSERT INTO t1 VALUES (1,9),(2,7),(3,6),(4,3),(5,1);
+insert into t1 select seq,seq from seq_100_to_110;
EXPLAIN SELECT pk, c1 FROM t1 WHERE (pk<3 or pk>3);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 4 Using where
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 15 Using where
SET SESSION optimizer_switch='index_condition_pushdown=off';
SELECT pk, c1 FROM t1 WHERE (pk<3 or pk>3);
pk c1
@@ -471,6 +472,17 @@ pk c1
2 7
4 3
5 1
+100 100
+101 101
+102 102
+103 103
+104 104
+105 105
+106 106
+107 107
+108 108
+109 109
+110 110
DROP TABLE t1;
set optimizer_switch= @save_optimizer_switch;
#
@@ -688,7 +700,6 @@ DROP TABLE t1;
#
CREATE TABLE t1 (b int NOT NULL, c int, a varchar(1024), PRIMARY KEY (b));
INSERT INTO t1 VALUES (1,4,'Ill');
-insert into t1 select seq+100,5,seq from seq_1_to_100;
CREATE TABLE t2 (a varchar(1024), KEY (a(512)));
INSERT INTO t2 VALUES
('Ill'), ('eckqzsflbzaffti'), ('w'), ('she'), ('gxbwypqtjzwywwer'), ('w');
@@ -828,6 +839,8 @@ test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status OK
SET @save_optimize_switch=@@optimizer_switch;
SET optimizer_switch='materialization=on';
+set @save_optimizer_where_cost=@@optimizer_where_cost;
+set @@optimizer_where_cost=1;
EXPLAIN
SELECT COUNT(*) FROM t1 AS t, t2
WHERE c = g
@@ -851,6 +864,7 @@ OR a = 0 AND h < 'z' );
COUNT(*)
1478
SET optimizer_switch=@save_optimizer_switch;
+set @@optimizer_where_cost=@save_optimizer_where_cost;
DROP TABLE t1,t2;
# check "Handler_pushed" status varuiables
CREATE TABLE t1 (
diff --git a/mysql-test/main/innodb_mysql_lock2.result b/mysql-test/main/innodb_mysql_lock2.result
index ffbe3f8a..a03e1d84 100644
--- a/mysql-test/main/innodb_mysql_lock2.result
+++ b/mysql-test/main/innodb_mysql_lock2.result
@@ -12,8 +12,8 @@
# This test makes sense only in REPEATABLE-READ mode as
# in SERIALIZABLE mode all statements that read data take
# shared lock on them to enforce its semantics.
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
# Prepare playground by creating tables, views,
# routines and triggers used in tests.
@@ -57,8 +57,6 @@ declare j int;
select i from t1 where i = 1 into j;
return j;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create function f2() returns int
begin
declare k int;
@@ -66,8 +64,6 @@ select i from t1 where i = 1 into k;
insert into t2 values (k + 5);
return 0;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create function f3() returns int
begin
return (select i from t1 where i = 3);
@@ -91,16 +87,12 @@ declare k int;
select i from v1 where i = 1 into k;
return k;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create function f7() returns int
begin
declare k int;
select j from v2 where j = 1 into k;
return k;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create function f8() returns int
begin
declare k int;
@@ -108,8 +100,6 @@ select i from v1 where i = 1 into k;
insert into t2 values (k+5);
return k;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create function f9() returns int
begin
update v2 set j=j+10 where j=1;
@@ -139,8 +129,6 @@ create procedure p2(inout p int)
begin
select i from t1 where i = 1 into p;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create function f14() returns int
begin
declare k int;
@@ -160,8 +148,6 @@ declare k int;
select i from t1 where i=1 into k;
set new.l= k+1;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create trigger t4_bu before update on t4 for each row
begin
if (select i from t1 where i=1) then
diff --git a/mysql-test/main/innodb_mysql_lock2.test b/mysql-test/main/innodb_mysql_lock2.test
index 09298a90..b35c23ce 100644
--- a/mysql-test/main/innodb_mysql_lock2.test
+++ b/mysql-test/main/innodb_mysql_lock2.test
@@ -31,7 +31,7 @@ CALL mtr.add_suppression("Unsafe statement written to the binary log using state
--echo # This test makes sense only in REPEATABLE-READ mode as
--echo # in SERIALIZABLE mode all statements that read data take
--echo # shared lock on them to enforce its semantics.
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
--echo # Prepare playground by creating tables, views,
--echo # routines and triggers used in tests.
@@ -833,6 +833,7 @@ insert into t1 values (1), (2), (3), (4), (5);
begin;
--echo # Acquire SR metadata lock on t1.
+--sorted_result
select * from t1;
connection con1;
diff --git a/mysql-test/main/innodb_mysql_sync.result b/mysql-test/main/innodb_mysql_sync.result
index 7fe3bdbb..ef89d8a6 100644
--- a/mysql-test/main/innodb_mysql_sync.result
+++ b/mysql-test/main/innodb_mysql_sync.result
@@ -2,7 +2,6 @@
# Bug 42074 concurrent optimize table and
# alter table = Assertion failed: thd->is_error()
#
-DROP TABLE IF EXISTS t1;
# Create InnoDB table
CREATE TABLE t1 (id INT) engine=innodb;
connect con2, localhost, root;
@@ -451,11 +450,9 @@ ALTER TABLE t1 ENGINE=INNODB;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
#ALTER TABLE FORCE, ALTER TABLE ENGINE and OPTIMIZE TABLE uses
-#table copy when the old_alter_table enabled.
-SET SESSION old_alter_table= TRUE;
+#table copy when the alter_algorithm enabled.
+SET SESSION alter_algorithm= TRUE;
affected rows: 0
-Warnings:
-Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
ALTER TABLE t1 FORCE;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
@@ -478,10 +475,8 @@ test.t1 optimize status OK
affected rows: 2
SET DEBUG_SYNC= 'RESET';
affected rows: 0
-SET SESSION old_alter_table= FALSE;
+SET SESSION alter_algorithm= FALSE;
affected rows: 0
-Warnings:
-Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
#ALTER TABLE FORCE and ALTER TABLE ENGINE uses table copy
#when ALGORITHM COPY is used.
ALTER TABLE t1 FORCE, ALGORITHM= COPY;
diff --git a/mysql-test/main/innodb_mysql_sync.test b/mysql-test/main/innodb_mysql_sync.test
index 466bcb36..2c2fb733 100644
--- a/mysql-test/main/innodb_mysql_sync.test
+++ b/mysql-test/main/innodb_mysql_sync.test
@@ -14,10 +14,6 @@
--echo # alter table = Assertion failed: thd->is_error()
--echo #
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
--echo # Create InnoDB table
CREATE TABLE t1 (id INT) engine=innodb;
connect (con2, localhost, root);
@@ -616,8 +612,8 @@ ALTER TABLE t1 FORCE;
ALTER TABLE t1 ENGINE=INNODB;
--echo #ALTER TABLE FORCE, ALTER TABLE ENGINE and OPTIMIZE TABLE uses
---echo #table copy when the old_alter_table enabled.
-SET SESSION old_alter_table= TRUE;
+--echo #table copy when the alter_algorithm enabled.
+SET SESSION alter_algorithm= TRUE;
ALTER TABLE t1 FORCE;
ALTER TABLE t1 ENGINE= INNODB;
@@ -632,7 +628,7 @@ INSERT INTO t1 VALUES(10, 20);
--connection default
--reap
SET DEBUG_SYNC= 'RESET';
-SET SESSION old_alter_table= FALSE;
+SET SESSION alter_algorithm= FALSE;
--echo #ALTER TABLE FORCE and ALTER TABLE ENGINE uses table copy
--echo #when ALGORITHM COPY is used.
diff --git a/mysql-test/main/insert.result b/mysql-test/main/insert.result
index 586dbbff..484fb8df 100644
--- a/mysql-test/main/insert.result
+++ b/mysql-test/main/insert.result
@@ -710,6 +710,8 @@ insert ignore into t1 values (1,12);
Warnings:
Warning 1062 Duplicate entry '1' for key 'f1'
set @@old_mode="NO_DUP_KEY_WARNINGS_WITH_IGNORE";
+Warnings:
+Warning 1287 'NO_DUP_KEY_WARNINGS_WITH_IGNORE' is deprecated and will be removed in a future release
insert ignore into t1 values (1,12);
insert ignore into t1 values (1,12) on duplicate key update f2=13;
set @@old_mode="";
diff --git a/mysql-test/main/insert_returning.result b/mysql-test/main/insert_returning.result
index b2ed9c90..c58e1c66 100644
--- a/mysql-test/main/insert_returning.result
+++ b/mysql-test/main/insert_returning.result
@@ -683,3 +683,23 @@ INSERT t WITH cte AS (SELECT 1) SELECT * FROM cte RETURNING *;
a
1
DROP TABLE t;
+#
+# MDEV-3953 Add columns for ROWS_EXAMINED, ROWS_SENT, and ROWS_READ to I_S and
+# processlist
+#
+create table t1 (a int primary key, b int);
+flush status;
+insert into t1 values (1,2),(2,4) returning a,b;
+a b
+1 2
+2 4
+insert into t1 select seq,seq from seq_10_to_13 returning a,b;
+a b
+10 10
+11 11
+12 12
+13 13
+show status like "Rows_sent";
+Variable_name Value
+Rows_sent 6
+drop table t1;
diff --git a/mysql-test/main/insert_returning.test b/mysql-test/main/insert_returning.test
index 837d61d2..250ca550 100644
--- a/mysql-test/main/insert_returning.test
+++ b/mysql-test/main/insert_returning.test
@@ -1,3 +1,5 @@
+--source include/have_sequence.inc
+
--echo # Test for INSERT...RETURNING
CREATE TABLE t1(id1 INT PRIMARY KEY AUTO_INCREMENT, val1 VARCHAR(1));
@@ -396,3 +398,15 @@ CREATE TABLE t (a INT);
INSERT t WITH cte AS (SELECT 1) SELECT * FROM cte RETURNING *;
DROP TABLE t;
+
+--echo #
+--echo # MDEV-3953 Add columns for ROWS_EXAMINED, ROWS_SENT, and ROWS_READ to I_S and
+--echo # processlist
+--echo #
+
+create table t1 (a int primary key, b int);
+flush status;
+insert into t1 values (1,2),(2,4) returning a,b;
+insert into t1 select seq,seq from seq_10_to_13 returning a,b;
+show status like "Rows_sent";
+drop table t1;
diff --git a/mysql-test/main/intersect.result b/mysql-test/main/intersect.result
index b81ef645..a71da056 100644
--- a/mysql-test/main/intersect.result
+++ b/mysql-test/main/intersect.result
@@ -51,12 +51,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -67,12 +70,15 @@ EXPLAIN
"query_block": {
"select_id": 2,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -83,12 +89,15 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -115,6 +124,7 @@ ANALYZE
{
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -122,9 +132,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -139,6 +151,7 @@ ANALYZE
"query_block": {
"select_id": 2,
"operation": "INTERSECT",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -146,9 +159,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -163,6 +178,7 @@ ANALYZE
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -170,9 +186,11 @@ ANALYZE
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -195,6 +213,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -202,9 +221,11 @@ ANALYZE
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 3,
"r_rows": 1,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
@@ -220,6 +241,7 @@ ANALYZE
{
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -227,9 +249,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -244,6 +268,7 @@ ANALYZE
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -251,9 +276,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -268,6 +295,7 @@ ANALYZE
"query_block": {
"select_id": 4,
"operation": "INTERSECT",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -275,9 +303,11 @@ ANALYZE
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -352,12 +382,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -368,12 +401,15 @@ EXPLAIN
"query_block": {
"select_id": 2,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -382,7 +418,9 @@ EXPLAIN
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 3,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -413,6 +451,7 @@ ANALYZE
{
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -420,9 +459,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -437,6 +478,7 @@ ANALYZE
"query_block": {
"select_id": 2,
"operation": "INTERSECT",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -444,9 +486,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -459,9 +503,11 @@ ANALYZE
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 3,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -493,6 +539,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -500,9 +547,11 @@ ANALYZE
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 3,
"r_rows": 1,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
@@ -518,6 +567,7 @@ ANALYZE
{
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -525,9 +575,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -542,6 +594,7 @@ ANALYZE
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -549,9 +602,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -564,9 +619,11 @@ ANALYZE
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 3,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
diff --git a/mysql-test/main/intersect.test b/mysql-test/main/intersect.test
index 5e811f1f..30f99b20 100644
--- a/mysql-test/main/intersect.test
+++ b/mysql-test/main/intersect.test
@@ -23,6 +23,7 @@ insert into t3 values (1,1),(2,2),(5,5);
EXPLAIN (select a,b from t1) intersect (select c,d from t2) intersect (select e,f from t3);
EXPLAIN extended (select a,b from t1) intersect (select c,d from t2) intersect (select e,f from t3);
EXPLAIN extended select * from ((select a,b from t1) intersect (select c,d from t2) intersect (select e,f from t3)) a;
+--source include/explain-no-costs.inc
EXPLAIN format=json (select a,b from t1) intersect (select c,d from t2) intersect (select e,f from t3);
--source include/analyze-format.inc
ANALYZE format=json (select a,b from t1) intersect (select c,d from t2) intersect (select e,f from t3);
@@ -43,6 +44,7 @@ EXPLAIN (select a,b from t1) intersect (select c,e from t2,t3);
EXPLAIN extended (select a,b from t1) intersect (select c,e from t2,t3);
EXPLAIN extended select * from ((select a,b from t1) intersect (select c,e from t2,t3)) a;
set @@optimizer_switch='optimize_join_buffer_size=off';
+--source include/explain-no-costs.inc
EXPLAIN format=json (select a,b from t1) intersect (select c,e from t2,t3);
--source include/analyze-format.inc
ANALYZE format=json (select a,b from t1) intersect (select c,e from t2,t3);
diff --git a/mysql-test/main/intersect_all.result b/mysql-test/main/intersect_all.result
index b1afcee2..ad4ade45 100644
--- a/mysql-test/main/intersect_all.result
+++ b/mysql-test/main/intersect_all.result
@@ -63,12 +63,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -79,12 +82,15 @@ EXPLAIN
"query_block": {
"select_id": 2,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -95,12 +101,15 @@ EXPLAIN
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -127,6 +136,7 @@ ANALYZE
{
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -134,9 +144,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 4,
"r_rows": 4,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -151,6 +163,7 @@ ANALYZE
"query_block": {
"select_id": 2,
"operation": "INTERSECT",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -158,9 +171,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 4,
"r_rows": 4,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -175,6 +190,7 @@ ANALYZE
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -182,9 +198,11 @@ ANALYZE
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 4,
"r_rows": 4,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -207,6 +225,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -214,9 +233,11 @@ ANALYZE
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 4,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
@@ -232,6 +253,7 @@ ANALYZE
{
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -239,9 +261,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 4,
"r_rows": 4,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -256,6 +280,7 @@ ANALYZE
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -263,9 +288,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 4,
"r_rows": 4,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -280,6 +307,7 @@ ANALYZE
"query_block": {
"select_id": 4,
"operation": "INTERSECT",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -287,9 +315,11 @@ ANALYZE
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 4,
"r_rows": 4,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -383,12 +413,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 6,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -399,12 +432,15 @@ EXPLAIN
"query_block": {
"select_id": 2,
"operation": "INTERSECT",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -413,7 +449,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 5,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -444,6 +482,7 @@ ANALYZE
{
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -451,9 +490,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 6,
"r_rows": 6,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -468,6 +509,7 @@ ANALYZE
"query_block": {
"select_id": 2,
"operation": "INTERSECT",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -475,9 +517,11 @@ ANALYZE
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 5,
"r_rows": 5,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -490,9 +534,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 5,
"r_loops": 1,
"rows": 7,
"r_rows": 7,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -524,6 +570,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -531,9 +578,11 @@ ANALYZE
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 6,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
@@ -549,6 +598,7 @@ ANALYZE
{
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -556,9 +606,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 6,
"r_rows": 6,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -573,6 +625,7 @@ ANALYZE
"query_block": {
"select_id": 3,
"operation": "INTERSECT",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -580,9 +633,11 @@ ANALYZE
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 5,
"r_rows": 5,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -595,9 +650,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 5,
"r_loops": 1,
"rows": 7,
"r_rows": 7,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
diff --git a/mysql-test/main/intersect_all.test b/mysql-test/main/intersect_all.test
index 5d2b038f..769b2539 100644
--- a/mysql-test/main/intersect_all.test
+++ b/mysql-test/main/intersect_all.test
@@ -22,6 +22,7 @@ insert into t3 values (1,1),(2,2),(5,5),(2,2);
EXPLAIN (select a,b from t1) intersect all (select c,d from t2) intersect all (select e,f from t3);
EXPLAIN extended (select a,b from t1) intersect all (select c,d from t2) intersect all (select e,f from t3);
EXPLAIN extended select * from ((select a,b from t1) intersect all (select c,d from t2) intersect all (select e,f from t3)) a;
+--source include/explain-no-costs.inc
EXPLAIN format=json (select a,b from t1) intersect all (select c,d from t2) intersect all (select e,f from t3);
--source include/analyze-format.inc
ANALYZE format=json (select a,b from t1) intersect all (select c,d from t2) intersect all (select e,f from t3);
@@ -50,6 +51,7 @@ insert into t3 values (2,2);
EXPLAIN (select a,b from t1) intersect all (select c,e from t2,t3);
EXPLAIN extended (select a,b from t1) intersect all (select c,e from t2,t3);
EXPLAIN extended select * from ((select a,b from t1) intersect all (select c,e from t2,t3)) a;
+--source include/explain-no-costs.inc
EXPLAIN format=json (select a,b from t1) intersect all (select c,e from t2,t3);
--source include/analyze-format.inc
ANALYZE format=json (select a,b from t1) intersect all (select c,e from t2,t3);
@@ -325,4 +327,4 @@ select * from t2 where a < 5
intersect all
select * from t3 where a < 5;
-drop table t1,t2,t3; \ No newline at end of file
+drop table t1,t2,t3;
diff --git a/mysql-test/main/invisible_field.result b/mysql-test/main/invisible_field.result
index 7aa88e77..988f8524 100644
--- a/mysql-test/main/invisible_field.result
+++ b/mysql-test/main/invisible_field.result
@@ -559,8 +559,6 @@ DROP TABLE t1;
create or replace table t1 (a int, b int invisible);
insert into t1 values (1),(2);
select * from t1 into outfile 'f';
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
load data infile 'f' into table t1;
select a,b from t1;
a b
@@ -591,8 +589,6 @@ a b
truncate table t1;
insert into t1(a,b) values (1,1),(2,2);
select a,b from t1 into outfile 'a';
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
load data infile 'a' into table t1(a,b);
select a,b from t1;
a b
diff --git a/mysql-test/main/invisible_field_debug.result b/mysql-test/main/invisible_field_debug.result
index 344a0b86..8cc1ee4d 100644
--- a/mysql-test/main/invisible_field_debug.result
+++ b/mysql-test/main/invisible_field_debug.result
@@ -346,7 +346,7 @@ invisible a b
9 7 7
explain select * from t1 where invisible =9;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL invisible NULL NULL NULL 7 Using where
+1 SIMPLE t1 ref invisible invisible 5 const 7
alter table t1 add x int default 3;
select invisible, a ,b from t1;
invisible a b
@@ -368,11 +368,11 @@ drop index invisible on t1;
ERROR 42000: Can't DROP INDEX `invisible`; check that it exists
explain select * from t1 where invisible =9;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL invisible NULL NULL NULL 7 Using where
+1 SIMPLE t1 ref invisible invisible 5 const 7
create index invisible on t1(c);
explain select * from t1 where invisible =9;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL invisible_2 NULL NULL NULL 7 Using where
+1 SIMPLE t1 ref invisible_2 invisible_2 5 const 7
show indexes in t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
t1 1 b 1 b A NULL NULL NULL YES BTREE NO
diff --git a/mysql-test/main/join.result b/mysql-test/main/join.result
index b5789142..b1d7e155 100644
--- a/mysql-test/main/join.result
+++ b/mysql-test/main/join.result
@@ -65,7 +65,7 @@ id id
NULL 75
explain select t1.id,t2.id from t2 left join t1 on t1.id>=74 and t1.id<=0 where t2.id=75 and t1.id is null;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 const PRIMARY NULL NULL NULL 1 Impossible ON condition
+1 SIMPLE t1 const PRIMARY NULL NULL NULL 0 Impossible ON condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where
explain select t1.id, t2.id from t1, t2 where t2.id = t1.id and t1.id <0 and t1.id > 0;
id select_type table type possible_keys key key_len ref rows Extra
@@ -258,7 +258,7 @@ name varchar(255) default NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,'s1'),(2,'s2'),(3,'s3'),(4,'s4'),(5,'s5');
-select t1.*, t2.* from t1, t2 where t2.id=t1.t2_id limit 2;
+select straight_join t1.*, t2.* from t2, t1 where t2.id=t1.t2_id limit 2;
t1_id t2_id type cost_unit min_value max_value t3_id item_id id name
12 5 Percent Cost -1 0 -1 -1 5 s5
14 4 Percent Cost -1 0 -1 -1 4 s4
@@ -883,7 +883,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL a,b NULL NULL NULL 1000 Using where
1 SIMPLE t3 ref b b 5 test.t2.b 1
drop table t1, t2, t3;
-create table t1 (a int);
+create table t1 (a int) engine=myisam;
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t2 (a int, b int, primary key(a));
insert into t2 select @v:=A.a+10*B.a, @v from t1 A, t1 B;
@@ -892,13 +892,17 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 10
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 4.016090
+Last_query_cost 0.011600
select 'The cost of accessing t1 (dont care if it changes' '^';
The cost of accessing t1 (dont care if it changes^
The cost of accessing t1 (dont care if it changes^
select 'vv: Following query must use ALL(t1), eq_ref(A), eq_ref(B): vv' Z;
Z
vv: Following query must use ALL(t1), eq_ref(A), eq_ref(B): vv
+select @@myisam.optimizer_disk_read_ratio;
+@@myisam.optimizer_disk_read_ratio
+0.020000
+set global myisam.optimizer_disk_read_ratio=0;
explain select * from t1, t2 A, t2 B where A.a = t1.a and B.a=A.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where
@@ -906,10 +910,14 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE B eq_ref PRIMARY PRIMARY 4 test.A.b 1
show status like 'Last_query_cost';
Variable_name Value
-Last_query_cost 28.016090
-select '^^: The above should be ~= 20 + cost(select * from t1). Value less than 20 is an error' Z;
+Last_query_cost 0.046590
+select '^^: The above should be ~= 40 + cost(select * from t1). Value less than 40 is an error' Z;
Z
-^^: The above should be ~= 20 + cost(select * from t1). Value less than 20 is an error
+^^: The above should be ~= 40 + cost(select * from t1). Value less than 40 is an error
+set global myisam.optimizer_disk_read_ratio=default;
+select @@myisam.optimizer_disk_read_ratio;
+@@myisam.optimizer_disk_read_ratio
+0.020000
drop table t1, t2;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
CREATE TABLE t2 (c INT PRIMARY KEY, d INT);
@@ -1107,7 +1115,7 @@ ON t4.a = t5.a
ON t1.a = t3.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
-1 SIMPLE t3 ref a a 5 test.t1.a 2 Using where; Using index
+1 SIMPLE t3 ref a a 5 test.t1.a 1 Using where; Using index
1 SIMPLE t4 ALL NULL NULL NULL NULL 0 Using where
1 SIMPLE t5 ALL NULL NULL NULL NULL 0 Using where
1 SIMPLE t6 ALL NULL NULL NULL NULL 0 Using where
@@ -1274,6 +1282,10 @@ test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status OK
+explain SELECT * FROM t1 JOIN t2 ON t1.v = t2.v WHERE t2.v IS NULL ORDER BY 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref ix2 ix2 5 const 2 Using index condition; Using temporary; Using filesort
+1 SIMPLE t1 ref ix1 ix1 5 test.t2.v 1
FLUSH STATUS;
SELECT * FROM t1 JOIN t2 ON t1.v = t2.v WHERE t2.v IS NULL ORDER BY 1;
pk v pk v
@@ -1323,9 +1335,9 @@ FROM t4 JOIN
(t1 JOIN t3 ON t3.ref_t1=t1.c1 JOIN t2 ON t2.ref_t1=t1.c1)
ON t4.ref_t1=t1.c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL NULL NULL NULL NULL 4
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE t4 ALL NULL NULL NULL NULL 4 Using where
+1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t4.ref_t1 1
+1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
EXPLAIN
SELECT *
@@ -1334,9 +1346,9 @@ FROM t4 STRAIGHT_JOIN
ON t4.ref_t1=t1.c1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t4 ALL NULL NULL NULL NULL 4 Using where
-1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t4.ref_t1 1
-1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
drop table t1,t2,t3,t4;
End of 5.2 tests
#
@@ -1474,7 +1486,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE D system PRIMARY NULL NULL NULL 1
1 SIMPLE DSAR system NULL NULL NULL NULL 1
1 SIMPLE DSA ref PRIMARY PRIMARY 4 const 3 Using where; Using index
-1 SIMPLE DT ALL t_id NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE DT ref t_id t_id 2 test.DSA.t_id 1 Using where
SELECT * FROM t5 DU, t1 D, t4 DT, t2 DSA, t3 DSAR
WHERE DU.dog_id=D.dog_id AND D.dog_id=DT.dog_id AND D.birthday=DT.birthday AND
DT.t_id=DSA.t_id AND DT.birthday=DSA.birthday AND DSA.dog_id=DSAR.dog_id;
@@ -1532,9 +1544,9 @@ f
DROP TABLE t;
CREATE TABLE t (i INT);
CALL p;
-ERROR 42S22: Unknown column 't1.f' in 'field list'
+ERROR 42S22: Unknown column 'f' in 'from clause'
CALL p;
-ERROR 42S22: Unknown column 't1.f' in 'field list'
+ERROR 42S22: Unknown column 'f' in 'from clause'
DROP PROCEDURE p;
DROP TABLE t;
CREATE TABLE t1 (a INT, b INT);
@@ -3495,3 +3507,24 @@ a b c
SET OPTIMIZER_USE_CONDITION_SELECTIVITY=@tmp;
DROP TABLE t1,t2;
# End of 10.6 tests
+#
+# MDEV-30256 Wrong result (missing rows) upon join with empty table
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (b INT);
+INSERT INTO t2 VALUES (3),(4);
+CREATE TABLE t3 (c INT PRIMARY KEY);
+EXPLAIN SELECT * FROM t1 LEFT JOIN t2 JOIN t3 ON (t2.b >= t3.c) ON (t1.a < t2.b);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2
+1 SIMPLE t3 index PRIMARY PRIMARY 4 NULL 0 Using index; Using join buffer (flat, BNL join)
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
+SELECT * FROM t1 LEFT JOIN t2 JOIN t3 ON (t2.b >= t3.c) ON (t1.a < t2.b);
+a b c
+1 NULL NULL
+2 NULL NULL
+DROP TABLE t1,t2,t3;
+#
+# End of 11.0 tests
+#
diff --git a/mysql-test/main/join.test b/mysql-test/main/join.test
index a4d34f41..7a8c6a09 100644
--- a/mysql-test/main/join.test
+++ b/mysql-test/main/join.test
@@ -253,7 +253,7 @@ CREATE TABLE t2 (
PRIMARY KEY (id)
) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,'s1'),(2,'s2'),(3,'s3'),(4,'s4'),(5,'s5');
-select t1.*, t2.* from t1, t2 where t2.id=t1.t2_id limit 2;
+select straight_join t1.*, t2.* from t2, t1 where t2.id=t1.t2_id limit 2;
drop table t1,t2;
#
@@ -687,7 +687,7 @@ drop table t1, t2, t3;
# BUG#14940 {Wrong query plan is chosen because of odd results of
# prev_record_reads() function }
-create table t1 (a int);
+create table t1 (a int) engine=myisam;
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t2 (a int, b int, primary key(a));
@@ -699,12 +699,13 @@ select 'The cost of accessing t1 (dont care if it changes' '^';
select 'vv: Following query must use ALL(t1), eq_ref(A), eq_ref(B): vv' Z;
+select @@myisam.optimizer_disk_read_ratio;
+set global myisam.optimizer_disk_read_ratio=0;
explain select * from t1, t2 A, t2 B where A.a = t1.a and B.a=A.b;
show status like 'Last_query_cost';
-select '^^: The above should be ~= 20 + cost(select * from t1). Value less than 20 is an error' Z;
-
-
-
+select '^^: The above should be ~= 40 + cost(select * from t1). Value less than 40 is an error' Z;
+set global myisam.optimizer_disk_read_ratio=default;
+select @@myisam.optimizer_disk_read_ratio;
drop table t1, t2;
#
@@ -959,6 +960,9 @@ INSERT INTO t1 VALUES (3,'b'),(4,NULL),(5,'c'),(6,'cc'),(7,'d'),
(8,'dd'),(9,'e'),(10,'ee');
INSERT INTO t2 VALUES (2,NULL);
ANALYZE TABLE t1,t2;
+# This will ensure that status tables are read now and not part of the later
+# Handler_read% counts
+explain SELECT * FROM t1 JOIN t2 ON t1.v = t2.v WHERE t2.v IS NULL ORDER BY 1;
FLUSH STATUS;
--disable_ps2_protocol
SELECT * FROM t1 JOIN t2 ON t1.v = t2.v WHERE t2.v IS NULL ORDER BY 1;
@@ -1904,3 +1908,20 @@ SELECT * FROM
SET OPTIMIZER_USE_CONDITION_SELECTIVITY=@tmp;
DROP TABLE t1,t2;
--echo # End of 10.6 tests
+
+--echo #
+--echo # MDEV-30256 Wrong result (missing rows) upon join with empty table
+--echo #
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (b INT);
+INSERT INTO t2 VALUES (3),(4);
+CREATE TABLE t3 (c INT PRIMARY KEY);
+EXPLAIN SELECT * FROM t1 LEFT JOIN t2 JOIN t3 ON (t2.b >= t3.c) ON (t1.a < t2.b);
+SELECT * FROM t1 LEFT JOIN t2 JOIN t3 ON (t2.b >= t3.c) ON (t1.a < t2.b);
+DROP TABLE t1,t2,t3;
+
+--echo #
+--echo # End of 11.0 tests
+--echo #
diff --git a/mysql-test/main/join_cache.result b/mysql-test/main/join_cache.result
index 323c4a73..0f29c375 100644
--- a/mysql-test/main/join_cache.result
+++ b/mysql-test/main/join_cache.result
@@ -53,6 +53,7 @@ set join_cache_level=1;
show variables like 'join_cache_level';
Variable_name Value
join_cache_level 1
+# Query 1
EXPLAIN
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
@@ -60,6 +61,7 @@ Country.Name LIKE 'L%' AND City.Population > 100000;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where
1 SIMPLE City ALL NULL NULL NULL NULL 4079 Using where; Using join buffer (flat, BNL join)
+# Query 2
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
@@ -79,6 +81,7 @@ Tripoli Lebanon
Tripoli Libyan Arab Jamahiriya
Vientiane Laos
Vilnius Lithuania
+# Query 3
EXPLAIN
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -91,6 +94,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where
1 SIMPLE CountryLanguage ALL NULL NULL NULL NULL 984 Using where; Using join buffer (flat, BNL join)
1 SIMPLE City ALL NULL NULL NULL NULL 4079 Using where; Using join buffer (flat, BNL join)
+# Query 4
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
WHERE City.Country=Country.Code AND
@@ -131,6 +135,7 @@ set join_cache_level=2;
show variables like 'join_cache_level';
Variable_name Value
join_cache_level 2
+# join_cache_level 2, Query 1
EXPLAIN
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
@@ -138,6 +143,7 @@ Country.Name LIKE 'L%' AND City.Population > 100000;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where
1 SIMPLE City ALL NULL NULL NULL NULL 4079 Using where; Using join buffer (flat, BNL join)
+# join_cache_level 2, Query 2
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
@@ -157,6 +163,7 @@ Tripoli Lebanon
Tripoli Libyan Arab Jamahiriya
Vientiane Laos
Vilnius Lithuania
+# join_cache_level 2, Query 3
EXPLAIN
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -169,6 +176,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where
1 SIMPLE CountryLanguage ALL NULL NULL NULL NULL 984 Using where; Using join buffer (flat, BNL join)
1 SIMPLE City ALL NULL NULL NULL NULL 4079 Using where; Using join buffer (incremental, BNL join)
+# join_cache_level 2, Query 4
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
WHERE City.Country=Country.Code AND
@@ -209,6 +217,7 @@ set join_cache_level=3;
show variables like 'join_cache_level';
Variable_name Value
join_cache_level 3
+# join_cache_level 3, Query 1
EXPLAIN
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
@@ -216,6 +225,7 @@ Country.Name LIKE 'L%' AND City.Population > 100000;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where
1 SIMPLE City hash_ALL NULL #hash#$hj 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join)
+# join_cache_level 3, Query 2
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
@@ -235,6 +245,7 @@ Tripoli Lebanon
Tripoli Libyan Arab Jamahiriya
Vientiane Laos
Vilnius Lithuania
+# join_cache_level 3, Query 3
EXPLAIN
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -247,6 +258,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where
1 SIMPLE CountryLanguage hash_ALL NULL #hash#$hj 3 world.Country.Code 984 Using where; Using join buffer (flat, BNLH join)
1 SIMPLE City hash_ALL NULL #hash#$hj 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join)
+# join_cache_level 3, Query 4
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
WHERE City.Country=Country.Code AND
@@ -287,6 +299,7 @@ set join_cache_level=4;
show variables like 'join_cache_level';
Variable_name Value
join_cache_level 4
+# join_cache_level 4, Query 1
EXPLAIN
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
@@ -294,6 +307,7 @@ Country.Name LIKE 'L%' AND City.Population > 100000;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where
1 SIMPLE City hash_ALL NULL #hash#$hj 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join)
+# join_cache_level 4, Query 2
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
@@ -313,6 +327,7 @@ Tripoli Lebanon
Tripoli Libyan Arab Jamahiriya
Vientiane Laos
Vilnius Lithuania
+# join_cache_level 4, Query 3
EXPLAIN
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -325,6 +340,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where
1 SIMPLE CountryLanguage hash_ALL NULL #hash#$hj 3 world.Country.Code 984 Using where; Using join buffer (flat, BNLH join)
1 SIMPLE City hash_ALL NULL #hash#$hj 3 world.Country.Code 4079 Using where; Using join buffer (incremental, BNLH join)
+# join_cache_level 4, Query 4
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
WHERE City.Country=Country.Code AND
@@ -361,6 +377,7 @@ Ludwigshafen am Rhein Germany German
Lungtan Taiwan Min
L´Hospitalet de Llobregat Spain Spanish
Lázaro Cárdenas Mexico Spanish
+# join_cache_level 4, Query 5
SELECT Country.Name, Country.Population, City.Name, City.Population
FROM Country LEFT JOIN City
ON City.Country=Country.Code AND City.Population > 5000000
@@ -379,6 +396,7 @@ Canada 31147000 NULL NULL
Cuba 11201000 NULL NULL
Côte d?Ivoire 14786000 NULL NULL
Czech Republic 10278100 NULL NULL
+# join_cache_level 4, Query 6
SELECT Country.Name, Country.Population, City.Name, City.Population
FROM Country LEFT JOIN City
ON City.Country=Country.Code AND
@@ -404,6 +422,7 @@ Czech Republic 10278100 NULL NULL
CREATE INDEX City_Population ON City(Population);
CREATE INDEX City_Name ON City(Name);
ANALYZE TABLE City;
+# After Analyze, Query 1
EXPLAIN
SELECT Country.Name, Country.Population, City.Name, City.Population
FROM Country LEFT JOIN City
@@ -412,6 +431,7 @@ WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where
1 SIMPLE City hash_range City_Population #hash#$hj:City_Population 3:4 world.Country.Code 24 Using where; Rowid-ordered scan; Using join buffer (flat, BNLH join)
+# After Analyze, Query 2
SELECT Country.Name, Country.Population, City.Name, City.Population
FROM Country LEFT JOIN City
ON City.Country=Country.Code AND City.Population > 5000000
@@ -430,6 +450,7 @@ Canada 31147000 NULL NULL
Cuba 11201000 NULL NULL
Côte d?Ivoire 14786000 NULL NULL
Czech Republic 10278100 NULL NULL
+# After Analyze, Query 3
EXPLAIN
SELECT Country.Name, Country.Population, City.Name, City.Population
FROM Country LEFT JOIN City
@@ -439,6 +460,7 @@ WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where
1 SIMPLE City hash_index_merge City_Population,City_Name #hash#$hj:City_Population,City_Name 3:4,35 world.Country.Code 96 Using sort_union(City_Population,City_Name); Using where; Using join buffer (flat, BNLH join)
+# After Analyze, Query 4
SELECT Country.Name, Country.Population, City.Name, City.Population
FROM Country LEFT JOIN City
ON City.Country=Country.Code AND
@@ -471,6 +493,7 @@ join_buffer_size 256
show variables like 'join_cache_level';
Variable_name Value
join_cache_level 1
+# join_cache_level 1, Join_buffer_size, Query 1
EXPLAIN
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
@@ -478,6 +501,7 @@ Country.Name LIKE 'L%' AND City.Population > 100000;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where
1 SIMPLE City ALL NULL NULL NULL NULL 4079 Using where; Using join buffer (flat, BNL join)
+# join_cache_level 1, Join_buffer_size, Query 2
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
@@ -497,6 +521,7 @@ Tripoli Lebanon
Tripoli Libyan Arab Jamahiriya
Vientiane Laos
Vilnius Lithuania
+# join_cache_level 1, Join_buffer_size, Query 3
EXPLAIN
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -509,6 +534,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where
1 SIMPLE CountryLanguage ALL NULL NULL NULL NULL 984 Using where; Using join buffer (flat, BNL join)
1 SIMPLE City ALL NULL NULL NULL NULL 4079 Using where; Using join buffer (flat, BNL join)
+# join_cache_level 1, Join_buffer_size, Query 4
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
WHERE City.Country=Country.Code AND
@@ -549,6 +575,7 @@ set join_cache_level=2;
show variables like 'join_cache_level';
Variable_name Value
join_cache_level 2
+# join_cache_level 2, Join_buffer_size, Query 1
EXPLAIN
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
@@ -556,6 +583,7 @@ Country.Name LIKE 'L%' AND City.Population > 100000;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where
1 SIMPLE City ALL NULL NULL NULL NULL 4079 Using where; Using join buffer (flat, BNL join)
+# join_cache_level 2, Join_buffer_size, Query 2
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
@@ -575,6 +603,7 @@ Tripoli Lebanon
Tripoli Libyan Arab Jamahiriya
Vientiane Laos
Vilnius Lithuania
+# join_cache_level 2, Join_buffer_size, Query 3
EXPLAIN
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -587,6 +616,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where
1 SIMPLE CountryLanguage ALL NULL NULL NULL NULL 984 Using where; Using join buffer (flat, BNL join)
1 SIMPLE City ALL NULL NULL NULL NULL 4079 Using where; Using join buffer (incremental, BNL join)
+# join_cache_level 2, Join_buffer_size, Query 4
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
WHERE City.Country=Country.Code AND
@@ -627,6 +657,7 @@ set join_cache_level=3;
show variables like 'join_cache_level';
Variable_name Value
join_cache_level 3
+# join_cache_level 3, Join_buffer_size, Query 1
EXPLAIN
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
@@ -634,6 +665,7 @@ Country.Name LIKE 'L%' AND City.Population > 100000;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where
1 SIMPLE City hash_ALL NULL #hash#$hj 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join)
+# join_cache_level 3, Join_buffer_size, Query 2
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
@@ -653,6 +685,7 @@ Tripoli Lebanon
Tripoli Libyan Arab Jamahiriya
Vientiane Laos
Vilnius Lithuania
+# join_cache_level 3, Join_buffer_size, Query 3
EXPLAIN
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -665,6 +698,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where
1 SIMPLE CountryLanguage hash_ALL NULL #hash#$hj 3 world.Country.Code 984 Using where; Using join buffer (flat, BNLH join)
1 SIMPLE City hash_ALL NULL #hash#$hj 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join)
+# join_cache_level 3, Join_buffer_size, Query 4
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
WHERE City.Country=Country.Code AND
@@ -705,6 +739,7 @@ set join_cache_level=4;
show variables like 'join_cache_level';
Variable_name Value
join_cache_level 4
+# join_cache_level 4, Join_buffer_size, Query 1
EXPLAIN
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
@@ -712,6 +747,7 @@ Country.Name LIKE 'L%' AND City.Population > 100000;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where
1 SIMPLE City hash_ALL NULL #hash#$hj 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join)
+# join_cache_level 4, Join_buffer_size, Query 2
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
@@ -731,6 +767,7 @@ Tripoli Lebanon
Tripoli Libyan Arab Jamahiriya
Vientiane Laos
Vilnius Lithuania
+# join_cache_level 4, Join_buffer_size, Query 3
EXPLAIN
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -743,6 +780,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where
1 SIMPLE CountryLanguage hash_ALL NULL #hash#$hj 3 world.Country.Code 984 Using where; Using join buffer (flat, BNLH join)
1 SIMPLE City hash_ALL NULL #hash#$hj 3 world.Country.Code 4079 Using where; Using join buffer (incremental, BNLH join)
+# join_cache_level 4, Join_buffer_size, Query 4
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
WHERE City.Country=Country.Code AND
@@ -816,6 +854,7 @@ set join_cache_level=3;
show variables like 'join_cache_level';
Variable_name Value
join_cache_level 3
+# Part 2, join_cache_level=3, Query 1
EXPLAIN
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
@@ -823,6 +862,7 @@ Country.Name LIKE 'L%' AND City.Population > 100000;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan
1 SIMPLE City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join)
+# Part 2, join_cache_level=3, Query 2
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
@@ -842,6 +882,7 @@ Tripoli Lebanon
Tripoli Libyan Arab Jamahiriya
Vientiane Laos
Vilnius Lithuania
+# Part 2, join_cache_level=3, Query 3
EXPLAIN
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -854,6 +895,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE City ALL Country NULL NULL NULL 4079 Using where
1 SIMPLE Country hash_ALL PRIMARY #hash#PRIMARY 3 world.City.Country 239 Using where; Using join buffer (flat, BNLH join)
1 SIMPLE CountryLanguage hash_ALL|filter PRIMARY,Percentage #hash#PRIMARY|Percentage 3|4 world.City.Country 984 (19%) Using where; Using join buffer (flat, BNLH join); Using rowid filter
+# Part 2, join_cache_level=3, Query 4
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
WHERE City.Country=Country.Code AND
@@ -890,6 +932,7 @@ Ludwigshafen am Rhein Germany German
Lungtan Taiwan Min
L´Hospitalet de Llobregat Spain Spanish
Lázaro Cárdenas Mexico Spanish
+# Part 2, join_cache_level=3, Query 5
EXPLAIN
SELECT Name FROM City
WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND
@@ -897,6 +940,7 @@ City.Population > 100000;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan
1 PRIMARY City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join)
+# Part 2, join_cache_level=3, Query 6
SELECT Name FROM City
WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND
City.Population > 100000;
@@ -916,6 +960,7 @@ Kaunas
Klaipeda
?iauliai
Panevezys
+# Part 2, join_cache_level=3, Query 7
EXPLAIN
SELECT Country.Name, IF(ISNULL(CountryLanguage.Country), NULL, CountryLanguage.Percentage)
FROM Country LEFT JOIN CountryLanguage ON
@@ -925,6 +970,7 @@ Country.Population > 10000000;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where
1 SIMPLE CountryLanguage hash_ALL PRIMARY #hash#PRIMARY 33 world.Country.Code,const 984 Using where; Using join buffer (flat, BNLH join)
+# Part 2, join_cache_level=3, Query 8
SELECT Country.Name, IF(ISNULL(CountryLanguage.Country), NULL, CountryLanguage.Percentage)
FROM Country LEFT JOIN CountryLanguage ON
(CountryLanguage.Country=Country.Code AND Language='English')
@@ -1016,6 +1062,7 @@ set join_cache_level=4;
show variables like 'join_cache_level';
Variable_name Value
join_cache_level 4
+# Part 2, join_cache_level=4, Query 1
EXPLAIN
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
@@ -1023,6 +1070,7 @@ Country.Name LIKE 'L%' AND City.Population > 100000;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan
1 SIMPLE City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join)
+# Part 2, join_cache_level=4, Query 2
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
@@ -1042,6 +1090,7 @@ Tripoli Lebanon
Tripoli Libyan Arab Jamahiriya
Vientiane Laos
Vilnius Lithuania
+# Part 2, join_cache_level=4, Query 3
EXPLAIN
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -1054,6 +1103,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE City ALL Country NULL NULL NULL 4079 Using where
1 SIMPLE Country hash_ALL PRIMARY #hash#PRIMARY 3 world.City.Country 239 Using where; Using join buffer (flat, BNLH join)
1 SIMPLE CountryLanguage hash_ALL|filter PRIMARY,Percentage #hash#PRIMARY|Percentage 3|4 world.City.Country 984 (19%) Using where; Using join buffer (incremental, BNLH join); Using rowid filter
+# Part 2, join_cache_level=4, Query 4
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
WHERE City.Country=Country.Code AND
@@ -1090,6 +1140,7 @@ Ludwigshafen am Rhein Germany German
Lungtan Taiwan Min
L´Hospitalet de Llobregat Spain Spanish
Lázaro Cárdenas Mexico Spanish
+# Part 2, join_cache_level=4, Query 5
EXPLAIN
SELECT Name FROM City
WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND
@@ -1097,6 +1148,7 @@ City.Population > 100000;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan
1 PRIMARY City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join)
+# Part 2, join_cache_level=4, Query 6
SELECT Name FROM City
WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND
City.Population > 100000;
@@ -1116,6 +1168,7 @@ Kaunas
Klaipeda
?iauliai
Panevezys
+# Part 2, join_cache_level=4, Query 7
EXPLAIN
SELECT Country.Name, IF(ISNULL(CountryLanguage.Country), NULL, CountryLanguage.Percentage)
FROM Country LEFT JOIN CountryLanguage ON
@@ -1125,6 +1178,7 @@ Country.Population > 10000000;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where
1 SIMPLE CountryLanguage hash_ALL PRIMARY #hash#PRIMARY 33 world.Country.Code,const 984 Using where; Using join buffer (flat, BNLH join)
+# Part 2, join_cache_level=4, Query 8
SELECT Country.Name, IF(ISNULL(CountryLanguage.Country), NULL, CountryLanguage.Percentage)
FROM Country LEFT JOIN CountryLanguage ON
(CountryLanguage.Country=Country.Code AND Language='English')
@@ -1209,6 +1263,7 @@ Belarus NULL
Venezuela NULL
Russian Federation NULL
Vietnam NULL
+# Part 2, join_cache_level=4, Query 9
EXPLAIN
SELECT Country.Name, Country.Population, City.Name, City.Population
FROM Country LEFT JOIN City
@@ -1217,6 +1272,7 @@ WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country range Name Name 52 NULL # Using index condition; Using where; Rowid-ordered scan
1 SIMPLE City hash_range Population,Country #hash#Country:Population 3:4 world.Country.Code # Using where; Rowid-ordered scan; Using join buffer (flat, BNLH join)
+# Part 2, join_cache_level=4, Query 10
SELECT Country.Name, Country.Population, City.Name, City.Population
FROM Country LEFT JOIN City
ON City.Country=Country.Code AND City.Population > 5000000
@@ -1236,6 +1292,7 @@ Cuba 11201000 NULL NULL
Côte d?Ivoire 14786000 NULL NULL
Czech Republic 10278100 NULL NULL
CREATE INDEX City_Name ON City(Name);
+# Part 2, join_cache_level=4, City_Name, Query 1
EXPLAIN
SELECT Country.Name, Country.Population, City.Name, City.Population
FROM Country LEFT JOIN City
@@ -1245,6 +1302,7 @@ WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE Country range Name Name 52 NULL 17 Using index condition; Using where; Rowid-ordered scan
1 SIMPLE City hash_index_merge Population,Country,City_Name #hash#Country:Population,City_Name 3:4,35 world.Country.Code 96 Using sort_union(Population,City_Name); Using where; Using join buffer (flat, BNLH join)
+# Part 2, join_cache_level=4, City_Name, Query 2
SELECT Country.Name, Country.Population, City.Name, City.Population
FROM Country LEFT JOIN City
ON City.Country=Country.Code AND
@@ -3067,13 +3125,13 @@ t1.metaid = t2.metaid AND t1.affiliateid = '2';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t6 system PRIMARY NULL NULL NULL 1
1 SIMPLE t5 ref PRIMARY,t5_formattypeid t5_formattypeid 4 const 1
-1 SIMPLE t1 ref t1_affiliateid,t1_metaid t1_affiliateid 4 const 2 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.metaid 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
-1 SIMPLE t7 ref PRIMARY PRIMARY 4 test.t1.metaid 1 Using index
+1 SIMPLE t4 ref PRIMARY,t4_formatclassid,t4_formats_idx t4_formatclassid 4 test.t5.formatclassid 1 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t3 ref t3_metaid,t3_formatid,t3_metaidformatid t3_formatid 4 test.t4.formatid 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t1 ref t1_affiliateid,t1_metaid t1_metaid 4 test.t3.metaid 1 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t3.metaid 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t7 ref PRIMARY PRIMARY 4 test.t3.metaid 1 Using index
1 SIMPLE t8 eq_ref PRIMARY PRIMARY 4 test.t7.artistid 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
-1 SIMPLE t3 ref t3_metaid,t3_formatid,t3_metaidformatid t3_metaidformatid 4 test.t1.metaid 1 Using index condition; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
-1 SIMPLE t4 eq_ref PRIMARY,t4_formatclassid,t4_formats_idx PRIMARY 4 test.t3.formatid 1 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
-1 SIMPLE t9 index PRIMARY,t9_subgenreid,t9_metaid PRIMARY 8 NULL 2 Using where; Using index; Using join buffer (incremental, BNL join)
+1 SIMPLE t9 ref PRIMARY,t9_subgenreid,t9_metaid t9_metaid 4 test.t3.metaid 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
1 SIMPLE t10 eq_ref PRIMARY,t10_genreid PRIMARY 4 test.t9.subgenreid 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
1 SIMPLE t11 eq_ref PRIMARY PRIMARY 4 test.t10.genreid 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
SELECT t1.uniquekey, t1.xml AS affiliateXml,
@@ -3215,7 +3273,7 @@ EXPLAIN
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE t2.b IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
-1 SIMPLE t2 ref i_a i_a 4 test.t1.a 2 Using where; Not exists
+1 SIMPLE t2 ref i_a i_a 4 test.t1.a 1 Using where; Not exists
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE t2.b IS NULL;
a a b
3 NULL NULL
@@ -3226,7 +3284,7 @@ EXPLAIN
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE t2.b IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
-1 SIMPLE t2 ref i_a i_a 4 test.t1.a 2 Using where; Not exists; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t2 ref i_a i_a 4 test.t1.a 1 Using where; Not exists; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE t2.b IS NULL;
a a b
3 NULL NULL
@@ -3253,7 +3311,7 @@ select t1.a, count(t2.p) as count
from t1 left join t2 on t1.a=t2.a and t2.p % 2 = 1 group by t1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL 8 Using index; Using temporary; Using filesort
-1 SIMPLE t2 ref i_a i_a 5 test.t1.a 2 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t2 ref i_a i_a 5 test.t1.a 1 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
select t1.a, count(t2.p) as count
from t1 left join t2 on t1.a=t2.a and t2.p % 2 = 1 group by t1.a;
a count
@@ -3371,8 +3429,8 @@ set join_cache_level=6;
set join_buffer_size=1024;
EXPLAIN SELECT AVG(c) FROM t1,t2 WHERE t1.a=t2.b;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 2050 Using where
-1 SIMPLE t2 ref idx idx 5 test.t1.a 640 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t2 ALL idx NULL NULL NULL 1280 Using where
+1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t2.b 2050 Using where; Using join buffer (flat, BNLH join)
SELECT AVG(c) FROM t1,t2 WHERE t1.a=t2.b;
AVG(c)
5.0000
@@ -4027,7 +4085,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 2
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.carrier 1 Using where
-1 SIMPLE t4 ref carrier_id carrier_id 5 test.t3.id 2 Using index
+1 SIMPLE t4 ref carrier_id carrier_id 5 test.t3.id 1 Using index
SET join_cache_level=@save_join_cache_level;
DROP TABLE t1,t2,t3,t4;
#
@@ -4043,7 +4101,7 @@ set join_cache_level = 5;
explain SELECT t2.a FROM t1 LEFT JOIN t2 ON t2.b = t1.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
-1 SIMPLE t2 ref b b 5 test.t1.b 2 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t2 ref b b 5 test.t1.b 1 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
SELECT t2.a FROM t1 LEFT JOIN t2 ON t2.b = t1.b;
a
NULL
@@ -4052,7 +4110,7 @@ set join_cache_level = 8;
explain SELECT t2.a FROM t1 LEFT JOIN t2 ON t2.b = t1.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
-1 SIMPLE t2 ref b b 5 test.t1.b 2 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan
+1 SIMPLE t2 ref b b 5 test.t1.b 1 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan
SELECT t2.a FROM t1 LEFT JOIN t2 ON t2.b = t1.b;
a
NULL
@@ -4063,7 +4121,7 @@ set join_cache_level = 5;
explain SELECT t2.a FROM t1 LEFT JOIN t2 ON t2.b = t1.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
-1 SIMPLE t2 ref b b 5 test.t1.b 2 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t2 ref b b 5 test.t1.b 1 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
SELECT t2.a FROM t1 LEFT JOIN t2 ON t2.b = t1.b;
a
NULL
@@ -4078,7 +4136,7 @@ set join_cache_level = 5;
explain SELECT t2.a FROM t1 LEFT JOIN t2 ON t2.b = t1.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
-1 SIMPLE t2 ref b b 103 test.t1.b 2 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t2 ref b b 103 test.t1.b 1 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
SELECT t2.a FROM t1 LEFT JOIN t2 ON t2.b = t1.b;
a
NULL
@@ -4087,7 +4145,7 @@ set join_cache_level = 8;
explain SELECT t2.a FROM t1 LEFT JOIN t2 ON t2.b = t1.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
-1 SIMPLE t2 ref b b 103 test.t1.b 2 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan
+1 SIMPLE t2 ref b b 103 test.t1.b 1 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan
SELECT t2.a FROM t1 LEFT JOIN t2 ON t2.b = t1.b;
a
NULL
@@ -4471,7 +4529,7 @@ EXPLAIN
SELECT t2.i FROM t1,t2 WHERE t1.cu = t2.cl ;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 6
-1 SIMPLE t1 ref cu cu 33 func 2 Using where; Using index
+1 SIMPLE t1 ref cu cu 33 func 1 Using where; Using index
SELECT t2.i FROM t1,t2 WHERE t1.cu = t2.cl ;
i
6
@@ -4804,7 +4862,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
-1 SIMPLE t4 ref idx idx 5 test.t1.a1 2 100.00 Using where
+1 SIMPLE t4 ref idx idx 5 test.t1.a1 1 100.00 Using where
1 SIMPLE t5 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a1` AS `a1`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`c2` AS `c2`,`test`.`t2`.`d2` AS `d2`,`test`.`t3`.`pk` AS `pk`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3`,`test`.`t4`.`pk` AS `pk`,`test`.`t4`.`a4` AS `a4`,`test`.`t5`.`pk` AS `pk`,`test`.`t5`.`a5` AS `a5` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`d2` = `test`.`t1`.`pk` and `test`.`t3`.`a3` = `test`.`t2`.`c2`) left join `test`.`t4` on(`test`.`t4`.`a4` = `test`.`t1`.`a1` and `test`.`t1`.`a1` is not null) left join `test`.`t5` on(`test`.`t5`.`a5` = `test`.`t3`.`a3`) where 1
@@ -4826,7 +4884,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t4 ref idx idx 5 test.t1.a1 2 100.00 Using where
+1 SIMPLE t4 ref idx idx 5 test.t1.a1 1 100.00 Using where
1 SIMPLE t5 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a1` AS `a1`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`c2` AS `c2`,`test`.`t2`.`d2` AS `d2`,`test`.`t3`.`pk` AS `pk`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3`,`test`.`t4`.`pk` AS `pk`,`test`.`t4`.`a4` AS `a4`,`test`.`t5`.`pk` AS `pk`,`test`.`t5`.`a5` AS `a5` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`d2` = `test`.`t1`.`pk` and `test`.`t3`.`a3` = `test`.`t2`.`c2`) left join `test`.`t4` on(`test`.`t4`.`a4` = `test`.`t1`.`a1` and `test`.`t1`.`a1` is not null) left join `test`.`t5` on(`test`.`t5`.`a5` = `test`.`t3`.`a3`) where 1
@@ -4848,7 +4906,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
-1 SIMPLE t4 ref idx idx 5 test.t1.a1 2 100.00 Using where
+1 SIMPLE t4 ref idx idx 5 test.t1.a1 1 100.00 Using where
1 SIMPLE t5 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a1` AS `a1`,`test`.`t2`.`pk` AS `pk`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`c2` AS `c2`,`test`.`t2`.`d2` AS `d2`,`test`.`t3`.`pk` AS `pk`,`test`.`t3`.`a3` AS `a3`,`test`.`t3`.`c3` AS `c3`,`test`.`t3`.`d3` AS `d3`,`test`.`t4`.`pk` AS `pk`,`test`.`t4`.`a4` AS `a4`,`test`.`t5`.`pk` AS `pk`,`test`.`t5`.`a5` AS `a5` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`d2` = `test`.`t1`.`pk` and `test`.`t3`.`a3` = `test`.`t2`.`c2`) left join `test`.`t4` on(`test`.`t4`.`a4` = `test`.`t1`.`a1` and `test`.`t1`.`a1` is not null) left join `test`.`t5` on(`test`.`t5`.`a5` = `test`.`t3`.`a3`) where 1
@@ -4969,8 +5027,8 @@ FROM ((t1 LEFT JOIN (t2 JOIN t3 ON t2.a2 = t3.a3) ON t2.b2 = t1.a1)
LEFT JOIN t4 ON t4.a4 <> 0) LEFT JOIN t5 ON t5.a5 = t2.a2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
-1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 1 Using where
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.a2 1 Using index
+1 SIMPLE t3 index PRIMARY PRIMARY 4 NULL 1 Using where; Using index
+1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t3.a3 1 Using where
1 SIMPLE t4 ALL NULL NULL NULL NULL 1 Using where
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t2.a2 1 Using where
SELECT t4.a4, t5.b5
@@ -5054,6 +5112,8 @@ CREATE TABLE t2 (
f3 int(11), f2 varchar(1024), f4 varchar(10), PRIMARY KEY (f3)
);
INSERT INTO t2 VALUES (6,'RPOYT','y'),(10,'JINQE','m');
+INSERT INTO t2 VALUES (100,'Q','q'),(101,'Q','q'),(102,'Q','q'),(103,'Q','q');
+INSERT INTO t2 VALUES (104,'Q','q'),(105,'Q','q'),(106,'Q','q'),(107,'Q','q');
SET SESSION join_cache_level = 1;
SET SESSION optimizer_switch = 'index_condition_pushdown=off';
EXPLAIN
@@ -5093,8 +5153,8 @@ SET SESSION optimizer_switch = 'index_condition_pushdown=off';
EXPLAIN SELECT * FROM t1,t2
WHERE t2.f3 = t1.f2 AND t1.f1 IN (9, 0, 100) ORDER BY t1.f2 LIMIT 1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range f1,f2 f2 13 NULL 10 Using where
-1 SIMPLE t2 ref f3 f3 67 test.t1.f2 2 Using where; Using index
+1 SIMPLE t1 range f1,f2 f1 5 NULL 3 Using where; Rowid-ordered scan; Using filesort
+1 SIMPLE t2 ref f3 f3 67 test.t1.f2 1 Using where; Using index
SELECT * FROM t1,t2
WHERE t2.f3 = t1.f2 AND t1.f1 IN (9, 0 ,100) ORDER BY t1.f2 LIMIT 1;
f1 f2 f3
@@ -5103,8 +5163,8 @@ SET SESSION optimizer_switch = 'index_condition_pushdown=on';
EXPLAIN SELECT * FROM t1,t2
WHERE t2.f3 = t1.f2 AND t1.f1 IN (9, 0 ,100) ORDER BY t1.f2 LIMIT 1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range f1,f2 f2 13 NULL 10 Using where
-1 SIMPLE t2 ref f3 f3 67 test.t1.f2 2 Using where; Using index
+1 SIMPLE t1 range f1,f2 f1 5 NULL 3 Using index condition; Using where; Rowid-ordered scan; Using filesort
+1 SIMPLE t2 ref f3 f3 67 test.t1.f2 1 Using where; Using index
SELECT * FROM t1,t2
WHERE t2.f3 = t1.f2 AND t1.f1 IN (9, 0 ,100) ORDER BY t1.f2 LIMIT 1;
f1 f2 f3
@@ -5205,7 +5265,7 @@ EXPLAIN
SELECT a FROM t1,t2 WHERE t2.v = t1.v ;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where
-1 SIMPLE t2 ref idx idx 4 test.t1.v 2
+1 SIMPLE t2 ref idx idx 4 test.t1.v 1
SELECT a FROM t1,t2 WHERE t2.v = t1.v ;
a
11
@@ -5263,7 +5323,7 @@ EXPLAIN
SELECT * FROM t1 WHERE (t1.b) IN (SELECT c FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where
-1 PRIMARY t2 ref c c 5 test.t1.b 2 Using index; Start temporary; End temporary
+1 PRIMARY t2 ref c c 5 test.t1.b 1 Using index; Start temporary; End temporary
SELECT * FROM t1 WHERE (t1.b) IN (SELECT c FROM t2);
a b
3914 17
@@ -5443,7 +5503,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
1 PRIMARY t3 system NULL NULL NULL NULL 1
1 PRIMARY t2 range a,c a 5 NULL 2 Using index condition; Using where; Using filesort
-1 PRIMARY t4 ref c c 5 test.t2.c 2 Using where; Start temporary; End temporary
+1 PRIMARY t4 ref c c 5 test.t2.c 1 Using where; Start temporary; End temporary
SELECT * FROM t1,t2
WHERE t2.c IN (SELECT c FROM t3,t4 WHERE t4.a < 10) AND
t2.a BETWEEN 4 and 5
@@ -5461,7 +5521,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1 Using temporary; Using filesort
1 PRIMARY t3 system NULL NULL NULL NULL 1
1 PRIMARY t2 range a,c a 5 NULL 2 Using index condition; Using where
-1 PRIMARY t4 ref c c 5 test.t2.c 2 Using where; Start temporary; End temporary
+1 PRIMARY t4 ref c c 5 test.t2.c 1 Using where; Start temporary; End temporary
SELECT * FROM t1,t2
WHERE t2.c IN (SELECT c FROM t3,t4 WHERE t4.a < 10) AND
t2.a BETWEEN 4 and 5
@@ -5480,7 +5540,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1 Using temporary; Using filesort
1 PRIMARY t3 system NULL NULL NULL NULL 1
1 PRIMARY t2 range a,c a 5 NULL 2 Using index condition; Using where
-1 PRIMARY t4 ref c c 5 test.t2.c 2 Using where; Start temporary; End temporary
+1 PRIMARY t4 ref c c 5 test.t2.c 1 Using where; Start temporary; End temporary
SELECT * FROM t1,t2
WHERE t2.c IN (SELECT c FROM t3,t4 WHERE t4.a < 10) AND
t2.a BETWEEN 4 and 5
@@ -5523,7 +5583,7 @@ and t2.uid=t1.fid;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ref uid uid 5 const 4 Using where; Start temporary
1 PRIMARY t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index
-1 PRIMARY t1 ALL uid NULL NULL NULL 11 Using where; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t1 ref uid uid 5 test.t3.fid 1 Using where; End temporary; Using join buffer (flat, BKAH join); Rowid-ordered scan
1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 Using join buffer (flat, BKAH join); Rowid-ordered scan
select name from t2, t1
where t1.uid in (select t4.uid from t4, t3 where t3.uid=1 and t4.uid=t3.fid)
@@ -5917,10 +5977,9 @@ LEFT JOIN t5 ON t4.e1 = t5.e1
LEFT JOIN (SELECT e1 FROM t2 ) AS d ON t4.e1 = d.e1) a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 128 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t4 ALL NULL NULL NULL NULL 128
-2 MATERIALIZED t5 hash_ALL NULL #hash#$hj 5 test.t4.e1 128 Using where; Using join buffer (flat, BNLH join)
-2 MATERIALIZED t2 hash_ALL NULL #hash#$hj 5 test.t4.e1 128 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY t4 hash_ALL NULL #hash#$hj 5 test.t1.i1 128 Using where; Start temporary; Using join buffer (flat, BNLH join)
+1 PRIMARY t5 hash_ALL NULL #hash#$hj 5 test.t4.e1 128 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY t2 hash_ALL NULL #hash#$hj 5 test.t4.e1 128 Using where; End temporary; Using join buffer (incremental, BNLH join)
SELECT * FROM t1
WHERE
i1 < 10 AND
@@ -5975,12 +6034,11 @@ f1 f2
EXPLAIN EXTENDED SELECT * FROM temp
WHERE (f1,f2) IN (SELECT t1.i1, t1.v1 FROM (t2 JOIN t1 ON (t1.v1 = t2.v1)));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 1 100.00
-1 PRIMARY temp hash_ALL NULL #hash#$hj 9 test.t1.i1,test.t1.v1 7 100.00 Using where; Using join buffer (flat, BNLH join)
-2 MATERIALIZED t1 ALL NULL NULL NULL NULL 1 100.00 Using where
-2 MATERIALIZED t2 hash_index v1 #hash#v1:v1 4:9 test.t1.v1 10 33.33 Using index; Using join buffer (flat, BNLH join)
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 100.00 Using where; Start temporary
+1 PRIMARY temp hash_ALL NULL #hash#$hj 9 test.t1.i1,test.t1.v1 7 10.00 Using where; Using join buffer (flat, BNLH join)
+1 PRIMARY t2 hash_index v1 #hash#v1:v1 4:9 test.t1.v1 10 10.00 Using index; End temporary; Using join buffer (incremental, BNLH join)
Warnings:
-Note 1003 select `test`.`temp`.`f1` AS `f1`,`test`.`temp`.`f2` AS `f2` from `test`.`temp` semi join (`test`.`t2` join `test`.`t1`) where `test`.`temp`.`f1` = `test`.`t1`.`i1` and `test`.`t2`.`v1` = `test`.`t1`.`v1` and `test`.`temp`.`f2` = `test`.`t1`.`v1`
+Note 1003 select `test`.`temp`.`f1` AS `f1`,`test`.`temp`.`f2` AS `f2` from `test`.`temp` semi join (`test`.`t2` join `test`.`t1`) where `test`.`temp`.`f1` = `test`.`t1`.`i1` and `test`.`temp`.`f2` = `test`.`t1`.`v1` and `test`.`t2`.`v1` = `test`.`t1`.`v1`
DROP TABLE t1,t2,temp;
set join_cache_level=@save_join_cache_level;
#
@@ -6103,9 +6161,9 @@ b c d e
EXPLAIN SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
-1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t4 index PRIMARY PRIMARY 4 NULL 2 Using where; Using index; Using join buffer (flat, BNL join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t4.e 2 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t3 hash_index d #hash#d:d 5:5 test.t2.c 2 Using where; Using index; Using join buffer (incremental, BNLH join)
-1 SIMPLE t4 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t2.b 2 Using index; Using join buffer (incremental, BNLH join)
SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e;
a b c d e
1 1 2 2 1
@@ -6116,9 +6174,9 @@ EXPLAIN SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b
WHERE e IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
-1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t4 index PRIMARY PRIMARY 4 NULL 2 Using where; Using index; Not exists; Using join buffer (flat, BNL join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t4.e 2 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t3 hash_index d #hash#d:d 5:5 test.t2.c 2 Using where; Using index; Using join buffer (incremental, BNLH join)
-1 SIMPLE t4 hash_index PRIMARY #hash#PRIMARY:PRIMARY 4:4 test.t2.b 2 Using where; Using index; Not exists; Using join buffer (incremental, BNLH join)
SELECT * FROM t1 LEFT JOIN ( ( t2 LEFT JOIN t3 ON c = d ) JOIN t4 ) ON b = e
WHERE e IS NULL;
a b c d e
@@ -6194,6 +6252,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -6203,7 +6262,9 @@ EXPLAIN
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "a.a <= 10",
"using_index": true
@@ -6218,8 +6279,10 @@ EXPLAIN
"key": "kp1",
"key_length": "10",
"used_key_parts": ["kp1", "kp2"],
+ "loops": 10,
"rows": 836,
- "filtered": 76,
+ "cost": "COST_REPLACED",
+ "filtered": 9.090909004,
"index_condition": "b.kp2 <= 10",
"attached_condition": "b.kp2 <= 10 and b.col1 + 1 < 33333"
},
@@ -6349,7 +6412,7 @@ LEFT JOIN t3 ON t2.d = t3.c
LEFT JOIN t4 ON t3.c=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL 10 Using index
-1 SIMPLE t2 ALL b NULL NULL NULL 3 Using where
+1 SIMPLE t2 ref b b 4 test.t1.b 1
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.d 1 Using where; Using index
1 SIMPLE t4 index NULL PRIMARY 4 NULL 3 Using where; Using index
SELECT *
@@ -6378,7 +6441,7 @@ LEFT JOIN t3 ON t2.d = t3.c
LEFT JOIN t4 ON t3.c=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL 10 Using index
-1 SIMPLE t2 ALL b NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 ref b b 4 test.t1.b 1
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.d 1 Using where; Using index
1 SIMPLE t4 index NULL PRIMARY 4 NULL 3 Using where; Using index; Using join buffer (flat, BNL join)
SELECT *
diff --git a/mysql-test/main/join_cache.test b/mysql-test/main/join_cache.test
index 4d13a96c..cfbd5e2d 100644
--- a/mysql-test/main/join_cache.test
+++ b/mysql-test/main/join_cache.test
@@ -6,6 +6,7 @@
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11;
DROP DATABASE IF EXISTS world;
--enable_warnings
+--source include/have_innodb.inc
set @org_optimizer_switch=@@optimizer_switch;
set @save_join_cache_level=@@join_cache_level;
@@ -53,16 +54,19 @@ set join_cache_level=1;
show variables like 'join_cache_level';
+--echo # Query 1
EXPLAIN
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
+--echo # Query 2
--sorted_result
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
+--echo # Query 3
EXPLAIN
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -72,6 +76,7 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
CountryLanguage.Percentage > 50 AND
LENGTH(Language) < LENGTH(City.Name) - 2;
+--echo # Query 4
--sorted_result
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -84,16 +89,19 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
set join_cache_level=2;
show variables like 'join_cache_level';
+--echo # join_cache_level 2, Query 1
EXPLAIN
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
+--echo # join_cache_level 2, Query 2
--sorted_result
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
+--echo # join_cache_level 2, Query 3
EXPLAIN
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -103,6 +111,7 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
CountryLanguage.Percentage > 50 AND
LENGTH(Language) < LENGTH(City.Name) - 2;
+--echo # join_cache_level 2, Query 4
--sorted_result
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -115,16 +124,19 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
set join_cache_level=3;
show variables like 'join_cache_level';
+--echo # join_cache_level 3, Query 1
EXPLAIN
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
+--echo # join_cache_level 3, Query 2
--sorted_result
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
+--echo # join_cache_level 3, Query 3
EXPLAIN
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -134,7 +146,7 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
CountryLanguage.Percentage > 50 AND
LENGTH(Language) < LENGTH(City.Name) - 2;
-
+--echo # join_cache_level 3, Query 4
--sorted_result
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -148,16 +160,19 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
set join_cache_level=4;
show variables like 'join_cache_level';
+--echo # join_cache_level 4, Query 1
EXPLAIN
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
+--echo # join_cache_level 4, Query 2
--sorted_result
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
+--echo # join_cache_level 4, Query 3
EXPLAIN
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -167,6 +182,7 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
CountryLanguage.Percentage > 50 AND
LENGTH(Language) < LENGTH(City.Name) - 2;
+--echo # join_cache_level 4, Query 4
--sorted_result
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -177,11 +193,13 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
LENGTH(Language) < LENGTH(City.Name) - 2;
+--echo # join_cache_level 4, Query 5
SELECT Country.Name, Country.Population, City.Name, City.Population
FROM Country LEFT JOIN City
ON City.Country=Country.Code AND City.Population > 5000000
WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000;
+--echo # join_cache_level 4, Query 6
SELECT Country.Name, Country.Population, City.Name, City.Population
FROM Country LEFT JOIN City
ON City.Country=Country.Code AND
@@ -195,17 +213,20 @@ CREATE INDEX City_Name ON City(Name);
ANALYZE TABLE City;
--enable_result_log
+--echo # After Analyze, Query 1
EXPLAIN
SELECT Country.Name, Country.Population, City.Name, City.Population
FROM Country LEFT JOIN City
ON City.Country=Country.Code AND City.Population > 5000000
WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000;
+--echo # After Analyze, Query 2
SELECT Country.Name, Country.Population, City.Name, City.Population
FROM Country LEFT JOIN City
ON City.Country=Country.Code AND City.Population > 5000000
WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000;
+--echo # After Analyze, Query 3
EXPLAIN
SELECT Country.Name, Country.Population, City.Name, City.Population
FROM Country LEFT JOIN City
@@ -213,6 +234,7 @@ SELECT Country.Name, Country.Population, City.Name, City.Population
(City.Population > 5000000 OR City.Name LIKE 'Za%')
WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000;
+--echo # After Analyze, Query 4
SELECT Country.Name, Country.Population, City.Name, City.Population
FROM Country LEFT JOIN City
ON City.Country=Country.Code AND
@@ -229,16 +251,19 @@ show variables like 'join_buffer_size';
show variables like 'join_cache_level';
+--echo # join_cache_level 1, Join_buffer_size, Query 1
EXPLAIN
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
+--echo # join_cache_level 1, Join_buffer_size, Query 2
--sorted_result
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
+--echo # join_cache_level 1, Join_buffer_size, Query 3
EXPLAIN
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -248,6 +273,7 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
CountryLanguage.Percentage > 50 AND
LENGTH(Language) < LENGTH(City.Name) - 2;
+--echo # join_cache_level 1, Join_buffer_size, Query 4
--sorted_result
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -260,16 +286,19 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
set join_cache_level=2;
show variables like 'join_cache_level';
+--echo # join_cache_level 2, Join_buffer_size, Query 1
EXPLAIN
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
+--echo # join_cache_level 2, Join_buffer_size, Query 2
--sorted_result
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
+--echo # join_cache_level 2, Join_buffer_size, Query 3
EXPLAIN
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -279,6 +308,7 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
CountryLanguage.Percentage > 50 AND
LENGTH(Language) < LENGTH(City.Name) - 2;
+--echo # join_cache_level 2, Join_buffer_size, Query 4
--sorted_result
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -291,16 +321,19 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
set join_cache_level=3;
show variables like 'join_cache_level';
+--echo # join_cache_level 3, Join_buffer_size, Query 1
EXPLAIN
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
+--echo # join_cache_level 3, Join_buffer_size, Query 2
--sorted_result
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
+--echo # join_cache_level 3, Join_buffer_size, Query 3
EXPLAIN
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -310,6 +343,7 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
CountryLanguage.Percentage > 50 AND
LENGTH(Language) < LENGTH(City.Name) - 2;
+--echo # join_cache_level 3, Join_buffer_size, Query 4
--sorted_result
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -322,16 +356,19 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
set join_cache_level=4;
show variables like 'join_cache_level';
+--echo # join_cache_level 4, Join_buffer_size, Query 1
EXPLAIN
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
+--echo # join_cache_level 4, Join_buffer_size, Query 2
--sorted_result
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
+--echo # join_cache_level 4, Join_buffer_size, Query 3
EXPLAIN
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -341,6 +378,7 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
CountryLanguage.Percentage > 50 AND
LENGTH(Language) < LENGTH(City.Name) - 2;
+--echo # join_cache_level 4, Join_buffer_size, Query 4
--sorted_result
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -374,16 +412,19 @@ show variables like 'join_buffer_size';
set join_cache_level=3;
show variables like 'join_cache_level';
+--echo # Part 2, join_cache_level=3, Query 1
EXPLAIN
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
+--echo # Part 2, join_cache_level=3, Query 2
--sorted_result
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
+--echo # Part 2, join_cache_level=3, Query 3
EXPLAIN
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -393,6 +434,7 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
CountryLanguage.Percentage > 50 AND
LENGTH(Language) < LENGTH(City.Name) - 2;
+--echo # Part 2, join_cache_level=3, Query 4
--sorted_result
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -402,15 +444,18 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
CountryLanguage.Percentage > 50 AND
LENGTH(Language) < LENGTH(City.Name) - 2;
+--echo # Part 2, join_cache_level=3, Query 5
EXPLAIN
SELECT Name FROM City
WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND
City.Population > 100000;
+--echo # Part 2, join_cache_level=3, Query 6
SELECT Name FROM City
WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND
City.Population > 100000;
+--echo # Part 2, join_cache_level=3, Query 7
#enable after fix MDEV-27871
--disable_view_protocol
@@ -421,6 +466,7 @@ SELECT Country.Name, IF(ISNULL(CountryLanguage.Country), NULL, CountryLanguage.P
WHERE
Country.Population > 10000000;
+--echo # Part 2, join_cache_level=3, Query 8
SELECT Country.Name, IF(ISNULL(CountryLanguage.Country), NULL, CountryLanguage.Percentage)
FROM Country LEFT JOIN CountryLanguage ON
(CountryLanguage.Country=Country.Code AND Language='English')
@@ -433,16 +479,19 @@ show variables like 'join_buffer_size';
set join_cache_level=4;
show variables like 'join_cache_level';
+--echo # Part 2, join_cache_level=4, Query 1
EXPLAIN
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
+--echo # Part 2, join_cache_level=4, Query 2
--sorted_result
SELECT City.Name, Country.Name FROM City,Country
WHERE City.Country=Country.Code AND
Country.Name LIKE 'L%' AND City.Population > 100000;
+--echo # Part 2, join_cache_level=4, Query 3
EXPLAIN
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -452,6 +501,7 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
CountryLanguage.Percentage > 50 AND
LENGTH(Language) < LENGTH(City.Name) - 2;
+--echo # Part 2, join_cache_level=4, Query 4
--sorted_result
SELECT City.Name, Country.Name, CountryLanguage.Language
FROM City,Country,CountryLanguage
@@ -461,15 +511,18 @@ SELECT City.Name, Country.Name, CountryLanguage.Language
CountryLanguage.Percentage > 50 AND
LENGTH(Language) < LENGTH(City.Name) - 2;
+--echo # Part 2, join_cache_level=4, Query 5
EXPLAIN
SELECT Name FROM City
WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND
City.Population > 100000;
+--echo # Part 2, join_cache_level=4, Query 6
SELECT Name FROM City
WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND
City.Population > 100000;
+--echo # Part 2, join_cache_level=4, Query 7
#enable after fix MDEV-27871
--disable_view_protocol
@@ -480,6 +533,7 @@ SELECT Country.Name, IF(ISNULL(CountryLanguage.Country), NULL, CountryLanguage.P
WHERE
Country.Population > 10000000;
+--echo # Part 2, join_cache_level=4, Query 8
SELECT Country.Name, IF(ISNULL(CountryLanguage.Country), NULL, CountryLanguage.Percentage)
FROM Country LEFT JOIN CountryLanguage ON
(CountryLanguage.Country=Country.Code AND Language='English')
@@ -487,7 +541,7 @@ SELECT Country.Name, IF(ISNULL(CountryLanguage.Country), NULL, CountryLanguage.P
Country.Population > 10000000;
--enable_view_protocol
-
+--echo # Part 2, join_cache_level=4, Query 9
--replace_column 9 #
EXPLAIN
SELECT Country.Name, Country.Population, City.Name, City.Population
@@ -495,6 +549,7 @@ SELECT Country.Name, Country.Population, City.Name, City.Population
ON City.Country=Country.Code AND City.Population > 5000000
WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000;
+--echo # Part 2, join_cache_level=4, Query 10
SELECT Country.Name, Country.Population, City.Name, City.Population
FROM Country LEFT JOIN City
ON City.Country=Country.Code AND City.Population > 5000000
@@ -502,6 +557,7 @@ SELECT Country.Name, Country.Population, City.Name, City.Population
CREATE INDEX City_Name ON City(Name);
+--echo # Part 2, join_cache_level=4, City_Name, Query 1
EXPLAIN
SELECT Country.Name, Country.Population, City.Name, City.Population
FROM Country LEFT JOIN City
@@ -509,6 +565,7 @@ SELECT Country.Name, Country.Population, City.Name, City.Population
(City.Population > 5000000 OR City.Name LIKE 'Za%')
WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000;
+--echo # Part 2, join_cache_level=4, City_Name, Query 2
SELECT Country.Name, Country.Population, City.Name, City.Population
FROM Country LEFT JOIN City
ON City.Country=Country.Code AND
@@ -3209,6 +3266,8 @@ CREATE TABLE t2 (
f3 int(11), f2 varchar(1024), f4 varchar(10), PRIMARY KEY (f3)
);
INSERT INTO t2 VALUES (6,'RPOYT','y'),(10,'JINQE','m');
+INSERT INTO t2 VALUES (100,'Q','q'),(101,'Q','q'),(102,'Q','q'),(103,'Q','q');
+INSERT INTO t2 VALUES (104,'Q','q'),(105,'Q','q'),(106,'Q','q'),(107,'Q','q');
SET SESSION join_cache_level = 1;
@@ -3811,8 +3870,6 @@ drop table t0,t1,t2;
--echo # of LEFT JOIN operations when using join buffer
--echo #
---source include/have_innodb.inc
-
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
col1 varchar(255) NOT NULL DEFAULT '',
@@ -4194,6 +4251,7 @@ analyze table t3;
--echo # The following must have "B.col1 + 1 < 33333" attached to table B
--echo # and not to the block-nl-join node:
+--source include/explain-no-costs.inc
explain format=json
select *
from t1 a, t3 b
diff --git a/mysql-test/main/join_cache_cardinality.result b/mysql-test/main/join_cache_cardinality.result
index df7f29d7..de6b99f4 100644
--- a/mysql-test/main/join_cache_cardinality.result
+++ b/mysql-test/main/join_cache_cardinality.result
@@ -86,7 +86,7 @@ JS
"avg_frequency": 3.9216
}
],
- "rows": 3.9216
+ "rows": 0.568632
}
]
# Despite available selectivity:
diff --git a/mysql-test/main/join_cache_debug.result b/mysql-test/main/join_cache_debug.result
index eb2a4295..0f66550f 100644
--- a/mysql-test/main/join_cache_debug.result
+++ b/mysql-test/main/join_cache_debug.result
@@ -39,6 +39,7 @@ JSON
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"const_condition": "1",
@@ -47,9 +48,11 @@ JSON
"table": {
"table_name": "t1_t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10000,
"r_rows": 10000,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -66,9 +69,12 @@ JSON
"key_length": "4",
"used_key_parts": ["c"],
"ref": ["test.t1_t2.t2_d"],
+ "loops": 10000,
"r_loops": 10000,
+ "r_table_loops": 3,
"rows": 1,
"r_rows": 0.0003,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -86,9 +92,11 @@ JSON
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["c"],
+ "loops": 10000,
"r_loops": 1,
"rows": 3000,
"r_rows": 3000,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
diff --git a/mysql-test/main/join_nested.result b/mysql-test/main/join_nested.result
index fdfc5a2e..7eaaf85e 100644
--- a/mysql-test/main/join_nested.result
+++ b/mysql-test/main/join_nested.result
@@ -695,21 +695,21 @@ t0.b=t1.b AND
(t9.a=1);
a b a b a b a b a b a b a b a b a b a b
1 2 2 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 1
-1 2 3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL 1 1
-1 2 3 2 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL 1 1
-1 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 1
-1 2 3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL 1 1
-1 2 3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL 1 1
-1 2 3 2 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL 1 1
1 2 2 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 2
-1 2 3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL 1 2
1 2 3 2 4 2 1 2 3 2 2 2 6 2 2 2 0 2 1 2
+1 2 3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL 1 1
+1 2 3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL 1 2
+1 2 3 2 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL 1 1
1 2 3 2 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL 1 2
-1 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 2
1 2 3 2 4 2 1 2 4 2 2 2 6 2 2 2 0 2 1 2
+1 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 1
+1 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 2
+1 2 3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL 1 1
1 2 3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL 1 2
-1 2 3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL 1 2
1 2 3 2 5 3 NULL NULL NULL NULL 2 2 6 2 2 2 0 2 1 2
+1 2 3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL 1 1
+1 2 3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL 1 2
+1 2 3 2 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL 1 1
1 2 3 2 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL 1 2
SELECT t1.a,t1.b
FROM t1;
@@ -855,7 +855,7 @@ ON t3.a=1 AND t3.b=t2.b AND t2.b=t4.b AND t2.a>0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00
1 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join)
-1 SIMPLE t2 ref idx_b idx_b 5 test.t3.b 2 100.00 Using where
+1 SIMPLE t2 ref idx_b idx_b 5 test.t3.b 1 100.00 Using where
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t3` join `test`.`t4` left join (`test`.`t1` join `test`.`t2`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t3`.`b` and `test`.`t2`.`b` = `test`.`t3`.`b` and `test`.`t2`.`a` > 0 and `test`.`t3`.`b` is not null) where 1
@@ -969,10 +969,10 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where
1 SIMPLE t8 ALL NULL NULL NULL NULL 2 100.00 Using where
1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where
+1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 1 100.00 Using where
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
-1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`a` > 0 and `test`.`t4`.`a` > 0 and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`a` > 0)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t4`.`b` = `test`.`t3`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t8`.`b` = `test`.`t9`.`b` or `test`.`t8`.`c` is null)
+Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`a` > 0 and `test`.`t4`.`a` > 0 and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`a` > 0)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t3`.`b` = `test`.`t4`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t8`.`b` = `test`.`t9`.`b` or `test`.`t8`.`c` is null)
INSERT INTO t8 VALUES (-3,12,0), (-1,14,0), (-5,15,0), (-1,11,0), (-4,13,0);
CREATE INDEX idx_b ON t8(b);
EXPLAIN EXTENDED
@@ -1017,12 +1017,12 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t5 ALL idx_b NULL NULL NULL 7 100.00 Using where
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where
+1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 1 100.00 Using where
1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where
+1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 1 100.00 Using where
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
-1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`a` > 0 and `test`.`t4`.`a` > 0 and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t8`.`a` >= 0 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`a` > 0)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t4`.`b` = `test`.`t3`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t8`.`b` = `test`.`t9`.`b` or `test`.`t8`.`c` is null)
+Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`a` > 0 and `test`.`t4`.`a` > 0 and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t8`.`a` >= 0 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`a` > 0)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t3`.`b` = `test`.`t4`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t8`.`b` = `test`.`t9`.`b` or `test`.`t8`.`c` is null)
INSERT INTO t1 VALUES (-1,133,0), (-2,12,0), (-3,11,0), (-5,15,0);
CREATE INDEX idx_b ON t1(b);
CREATE INDEX idx_a ON t0(a);
@@ -1062,18 +1062,18 @@ t0.b=t1.b AND
(t8.b=t9.b OR t8.c IS NULL) AND
(t9.a=1);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t0 ref idx_a idx_a 5 const 2 100.00
+1 SIMPLE t0 ref idx_a idx_a 5 const 2 100.00 Using where
+1 SIMPLE t1 ref idx_b idx_b 5 test.t0.b 1 100.00
1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE t1 ALL idx_b NULL NULL NULL 7 100.00 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t5 ALL idx_b NULL NULL NULL 7 100.00 Using where
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00 Using where
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where
+1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 1 100.00 Using where
1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where
+1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 1 100.00 Using where
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where
-1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2 and `test`.`t1`.`a` > 0) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t4`.`b` = `test`.`t3`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t8`.`b` = `test`.`t9`.`b` or `test`.`t8`.`c` is null)
+Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2 and `test`.`t1`.`a` > 0) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t3`.`b` = `test`.`t4`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t8`.`b` = `test`.`t9`.`b` or `test`.`t8`.`c` is null)
SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
FROM t0,t1
@@ -1210,12 +1210,12 @@ EXPLAIN SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON c < 3 and b = c;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL a 5 NULL 21 Using index
1 SIMPLE t2 range b b 5 NULL 3 Using where; Using index
-1 SIMPLE t3 ref c c 5 test.t2.b 2 Using index
+1 SIMPLE t3 ref c c 5 test.t2.b 1 Using index
EXPLAIN SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL a 5 NULL 21 Using index
1 SIMPLE t2 range b b 5 NULL 3 Using where; Using index
-1 SIMPLE t3 ref c c 5 test.t2.b 2 Using index
+1 SIMPLE t3 ref c c 5 test.t2.b 1 Using index
SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
a b c
NULL 0 0
@@ -1284,8 +1284,8 @@ NULL 2 2
DELETE FROM t3;
EXPLAIN SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t3 const c NULL NULL NULL 1 Impossible ON condition
-1 SIMPLE t2 const b NULL NULL NULL 1 Impossible ON condition
+1 SIMPLE t3 const c NULL NULL NULL 0 Impossible ON condition
+1 SIMPLE t2 const b NULL NULL NULL 0 Impossible ON condition
1 SIMPLE t1 index NULL a 5 NULL 21 Using index
SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
a b c
@@ -1743,10 +1743,10 @@ LEFT JOIN
ON t4.carrier = t1.carrier;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index package_id package_id 5 NULL 45 Using where; Using index
+1 SIMPLE t3 ref package_id package_id 5 test.t2.package_id 1 Using index
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.package_id 1
1 SIMPLE t4 eq_ref PRIMARY,id PRIMARY 2 test.t1.carrier 1 Using where
1 SIMPLE t5 ref carrier_id carrier_id 5 test.t4.id 22 Using index
-1 SIMPLE t3 ref package_id package_id 5 test.t2.package_id 1 Using index
SELECT COUNT(*)
FROM ((t2 JOIN t1 ON t2.package_id = t1.id)
JOIN t3 ON t3.package_id = t1.id)
diff --git a/mysql-test/main/join_nested.test b/mysql-test/main/join_nested.test
index ed1fe4c9..ee89c91e 100644
--- a/mysql-test/main/join_nested.test
+++ b/mysql-test/main/join_nested.test
@@ -364,6 +364,7 @@ SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
SELECT t9.a,t9.b
FROM t9;
+--sorted_result
SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
FROM t0,t1
diff --git a/mysql-test/main/join_nested_jcl6.result b/mysql-test/main/join_nested_jcl6.result
index 451accd7..3c292484 100644
--- a/mysql-test/main/join_nested_jcl6.result
+++ b/mysql-test/main/join_nested_jcl6.result
@@ -61,8 +61,8 @@ LEFT JOIN
ON t2.b=t4.b;
a b a b a b
4 2 1 2 3 2
-4 2 2 2 3 2
4 2 1 2 4 2
+4 2 2 2 3 2
4 2 2 2 4 2
3 3 NULL NULL NULL NULL
5 3 NULL NULL NULL NULL
@@ -85,8 +85,8 @@ ON t2.b=t4.b
WHERE t3.a=1 OR t3.c IS NULL;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00
-1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 10.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) where `test`.`t3`.`a` = 1 or `test`.`t3`.`c` is null
SELECT t2.a,t2.b,t3.a,t3.b,t4.a,t4.b
@@ -139,16 +139,16 @@ LEFT JOIN
ON t2.b=t4.b;
a b a b a b a b
4 2 1 2 3 2 3 1
-4 2 2 2 3 2 3 1
4 2 1 2 4 2 3 1
+4 2 2 2 3 2 3 1
4 2 2 2 4 2 3 1
4 2 1 2 3 2 2 2
-4 2 2 2 3 2 2 2
4 2 1 2 4 2 2 2
+4 2 2 2 3 2 2 2
4 2 2 2 4 2 2 2
4 2 1 2 3 2 3 3
-4 2 2 2 3 2 3 3
4 2 1 2 4 2 3 3
+4 2 2 2 3 2 3 3
4 2 2 2 4 2 3 3
3 3 NULL NULL NULL NULL NULL NULL
5 3 NULL NULL NULL NULL NULL NULL
@@ -161,8 +161,8 @@ ON t2.b=t4.b
WHERE t3.a>1 OR t3.c IS NULL;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00
-1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 10.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (incremental, BNL join)
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b` from `test`.`t2` left join (`test`.`t3` join `test`.`t4` join `test`.`t5`) on(`test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) where `test`.`t3`.`a` > 1 or `test`.`t3`.`c` is null
@@ -191,8 +191,8 @@ WHERE (t3.a>1 OR t3.c IS NULL) AND
(t5.a<3 OR t5.c IS NULL);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00
-1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 10.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b` from `test`.`t2` left join (`test`.`t3` join `test`.`t4` join `test`.`t5`) on(`test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) where (`test`.`t3`.`a` > 1 or `test`.`t3`.`c` is null) and (`test`.`t5`.`a` < 3 or `test`.`t5`.`c` is null)
@@ -242,7 +242,7 @@ ON t7.b=t8.b AND t6.b < 10;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t7 ALL NULL NULL NULL NULL 2 100.00
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join)
-1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t7.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t7.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
Warnings:
Note 1003 select `test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b` from `test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t7`.`b` and `test`.`t6`.`b` < 10 and `test`.`t7`.`b` is not null) where 1
SELECT t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
@@ -556,14 +556,14 @@ t0.b=t1.b AND
(t2.a >= 4 OR t2.c IS NULL);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 10.00 Using where; Using join buffer (flat, BNLH join)
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (incremental, BNL join)
-1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
Warnings:
Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null)
SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
@@ -651,17 +651,17 @@ t0.b=t1.b AND
(t9.a=1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 10.00 Using where; Using join buffer (flat, BNLH join)
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
Warnings:
-Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t4`.`b` = `test`.`t3`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t9`.`b` = `test`.`t8`.`b` or `test`.`t8`.`c` is null)
+Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t3`.`b` = `test`.`t4`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t9`.`b` = `test`.`t8`.`b` or `test`.`t8`.`c` is null)
SELECT t9.a,t9.b
FROM t9;
a b
@@ -703,23 +703,23 @@ t0.b=t1.b AND
(t8.b=t9.b OR t8.c IS NULL) AND
(t9.a=1);
a b a b a b a b a b a b a b a b a b a b
-1 2 3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL 1 1
-1 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 1
+1 2 2 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 1
+1 2 2 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 2
1 2 3 2 4 2 1 2 3 2 2 2 6 2 2 2 0 2 1 2
-1 2 3 2 4 2 1 2 4 2 2 2 6 2 2 2 0 2 1 2
+1 2 3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL 1 1
1 2 3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL 1 2
-1 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 2
1 2 3 2 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL 1 1
-1 2 3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL 1 1
1 2 3 2 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL 1 2
+1 2 3 2 4 2 1 2 4 2 2 2 6 2 2 2 0 2 1 2
+1 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 1
+1 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 2
+1 2 3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL 1 1
1 2 3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL 1 2
-1 2 3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL 1 1
1 2 3 2 5 3 NULL NULL NULL NULL 2 2 6 2 2 2 0 2 1 2
+1 2 3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL 1 1
1 2 3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL 1 2
1 2 3 2 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL 1 1
1 2 3 2 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL 1 2
-1 2 2 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 1
-1 2 2 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 2
SELECT t1.a,t1.b
FROM t1;
a b
@@ -849,8 +849,8 @@ WHERE t1.a <= 2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join)
+1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t1` join `test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) where `test`.`t1`.`a` <= 2
INSERT INTO t2 VALUES (-1,9,0), (-3,10,0), (-2,8,0), (-4,11,0), (-5,15,0);
@@ -864,7 +864,7 @@ ON t3.a=1 AND t3.b=t2.b AND t2.b=t4.b AND t2.a>0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00
1 SIMPLE t4 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join)
-1 SIMPLE t2 ref idx_b idx_b 5 test.t3.b 2 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t2 ref idx_b idx_b 5 test.t3.b 1 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (incremental, BNL join)
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b` from `test`.`t3` join `test`.`t4` left join (`test`.`t1` join `test`.`t2`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t3`.`b` and `test`.`t2`.`b` = `test`.`t3`.`b` and `test`.`t2`.`a` > 0 and `test`.`t3`.`b` is not null) where 1
@@ -919,17 +919,17 @@ t0.b=t1.b AND
(t9.a=1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 10.00 Using where; Using join buffer (flat, BNLH join)
1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
Warnings:
-Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`a` > 0 and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t4`.`b` = `test`.`t3`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t9`.`b` = `test`.`t8`.`b` or `test`.`t8`.`c` is null)
+Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`a` > 0 and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t3`.`b` = `test`.`t4`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t9`.`b` = `test`.`t8`.`b` or `test`.`t8`.`c` is null)
INSERT INTO t4 VALUES (-3,12,0), (-4,13,0), (-1,11,0), (-3,11,0), (-5,15,0);
INSERT INTO t5 VALUES (-3,11,0), (-2,12,0), (-3,13,0), (-4,12,0);
CREATE INDEX idx_b ON t4(b);
@@ -971,17 +971,17 @@ t0.b=t1.b AND
(t9.a=1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 10.00 Using where; Using join buffer (flat, BNLH join)
1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
1 SIMPLE t5 ALL idx_b NULL NULL NULL 7 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 1 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
Warnings:
-Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`a` > 0 and `test`.`t4`.`a` > 0 and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`a` > 0 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t4`.`b` = `test`.`t3`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t8`.`b` = `test`.`t9`.`b` or `test`.`t8`.`c` is null)
+Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`a` > 0 and `test`.`t4`.`a` > 0 and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`a` > 0 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t3`.`b` = `test`.`t4`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t8`.`b` = `test`.`t9`.`b` or `test`.`t8`.`c` is null)
INSERT INTO t8 VALUES (-3,12,0), (-1,14,0), (-5,15,0), (-1,11,0), (-4,13,0);
CREATE INDEX idx_b ON t8(b);
EXPLAIN EXTENDED
@@ -1021,17 +1021,17 @@ t0.b=t1.b AND
(t9.a=1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 10.00 Using where; Using join buffer (flat, BNLH join)
1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
1 SIMPLE t5 ALL idx_b NULL NULL NULL 7 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 1 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 1 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
Warnings:
-Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`a` > 0 and `test`.`t4`.`a` > 0 and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t8`.`a` >= 0 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`a` > 0 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t4`.`b` = `test`.`t3`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t8`.`b` = `test`.`t9`.`b` or `test`.`t8`.`c` is null)
+Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`a` > 0 and `test`.`t4`.`a` > 0 and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t8`.`a` >= 0 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`a` > 0 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t3`.`b` = `test`.`t4`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t8`.`b` = `test`.`t9`.`b` or `test`.`t8`.`c` is null)
INSERT INTO t1 VALUES (-1,133,0), (-2,12,0), (-3,11,0), (-5,15,0);
CREATE INDEX idx_b ON t1(b);
CREATE INDEX idx_a ON t0(a);
@@ -1071,18 +1071,18 @@ t0.b=t1.b AND
(t8.b=t9.b OR t8.c IS NULL) AND
(t9.a=1);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t0 ref idx_a idx_a 5 const 2 100.00
-1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE t1 ALL idx_b NULL NULL NULL 7 100.00 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE t0 ref idx_a idx_a 5 const 2 100.00 Using where
+1 SIMPLE t1 ref idx_b idx_b 5 test.t0.b 1 100.00 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
1 SIMPLE t5 ALL idx_b NULL NULL NULL 7 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 10.00 Using where; Using join buffer (incremental, BNLH join)
1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t8 ref idx_b idx_b 5 test.t5.b 1 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 1 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
-1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
Warnings:
-Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2 and `test`.`t1`.`a` > 0) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t4`.`b` = `test`.`t3`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t8`.`b` = `test`.`t9`.`b` or `test`.`t8`.`c` is null)
+Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2 and `test`.`t1`.`a` > 0) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t3`.`b` = `test`.`t4`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t8`.`b` = `test`.`t9`.`b` or `test`.`t8`.`c` is null)
SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b,
t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b
FROM t0,t1
@@ -1219,12 +1219,12 @@ EXPLAIN SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON c < 3 and b = c;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL a 5 NULL 21 Using index
1 SIMPLE t2 range b b 5 NULL 3 Using where; Using index
-1 SIMPLE t3 ref c c 5 test.t2.b 2 Using index
+1 SIMPLE t3 ref c c 5 test.t2.b 1 Using index
EXPLAIN SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL a 5 NULL 21 Using index
1 SIMPLE t2 range b b 5 NULL 3 Using where; Using index
-1 SIMPLE t3 ref c c 5 test.t2.b 2 Using index
+1 SIMPLE t3 ref c c 5 test.t2.b 1 Using index
SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
a b c
NULL 0 0
@@ -1293,8 +1293,8 @@ NULL 2 2
DELETE FROM t3;
EXPLAIN SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t3 const c NULL NULL NULL 1 Impossible ON condition
-1 SIMPLE t2 const b NULL NULL NULL 1 Impossible ON condition
+1 SIMPLE t3 const c NULL NULL NULL 0 Impossible ON condition
+1 SIMPLE t2 const b NULL NULL NULL 0 Impossible ON condition
1 SIMPLE t1 index NULL a 5 NULL 21 Using index
SELECT a, b, c FROM t1 LEFT JOIN (t2, t3) ON b < 3 and b = c;
a b c
@@ -1752,10 +1752,10 @@ LEFT JOIN
ON t4.carrier = t1.carrier;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index package_id package_id 5 NULL 45 Using where; Using index
+1 SIMPLE t3 ref package_id package_id 5 test.t2.package_id 1 Using index
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.package_id 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
1 SIMPLE t4 eq_ref PRIMARY,id PRIMARY 2 test.t1.carrier 1 Using where
1 SIMPLE t5 ref carrier_id carrier_id 5 test.t4.id 22 Using index
-1 SIMPLE t3 ref package_id package_id 5 test.t2.package_id 1 Using index
SELECT COUNT(*)
FROM ((t2 JOIN t1 ON t2.package_id = t1.id)
JOIN t3 ON t3.package_id = t1.id)
@@ -1848,8 +1848,8 @@ ON t1.a=t2.a
WHERE t3.a IS NULL;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
-1 SIMPLE t2 hash_ALL NULL #hash#$hj 4 test.t1.a 1 100.00 Using where; Using join buffer (flat, BNLH join)
-1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 test.t1.a 1 100.00 Using where; Not exists; Using join buffer (incremental, BNLH join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 4 test.t1.a 1 10.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 test.t1.a 1 10.00 Using where; Not exists; Using join buffer (incremental, BNLH join)
1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t3.a 0 0.00 Using where; Using join buffer (incremental, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`b` AS `b` from `test`.`t1` left join (`test`.`t2` left join `test`.`t3` on(`test`.`t3`.`b` = `test`.`t1`.`a`) left join `test`.`t4` on(`test`.`t4`.`b` = `test`.`t3`.`a` and `test`.`t3`.`a` is not null)) on(`test`.`t2`.`a` = `test`.`t1`.`a`) where `test`.`t3`.`a` is null
@@ -2085,9 +2085,9 @@ ON t6.b >= 2 AND t5.b=t7.b AND
(t8.a > 0 OR t8.c IS NULL) AND t6.a>0 AND t7.a>0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t5 ALL NULL NULL NULL NULL 3
-1 SIMPLE t7 range PRIMARY,b_i PRIMARY 4 NULL 2 Using where; Rowid-ordered scan; Using join buffer (flat, BNL join)
-1 SIMPLE t6 range|filter PRIMARY,b_i PRIMARY|b_i 4|5 NULL 3 (86%) Using where; Rowid-ordered scan; Using join buffer (incremental, BNL join); Using rowid filter
-1 SIMPLE t8 ref b_i b_i 5 test.t5.b 2 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t7 ref|filter PRIMARY,b_i b_i|PRIMARY 5|4 test.t5.b 1 (29%) Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan; Using rowid filter
+1 SIMPLE t6 range PRIMARY,b_i PRIMARY 4 NULL 3 Using where; Rowid-ordered scan; Using join buffer (incremental, BNL join)
+1 SIMPLE t8 ref b_i b_i 5 test.t5.b 1 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
SELECT t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
FROM t5
LEFT JOIN
@@ -2120,9 +2120,9 @@ FROM t5 LEFT JOIN
ON (t5.b=t8.b);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t5 ALL NULL NULL NULL NULL 2
-1 SIMPLE t6 ALL NULL NULL NULL NULL 1 Using join buffer (flat, BNL join)
+1 SIMPLE t6 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t7 const PRIMARY PRIMARY 4 const 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
-1 SIMPLE t8 ALL b_i NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE t8 ref b_i b_i 5 test.t5.b 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
SELECT t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
FROM t5 LEFT JOIN
(t6 LEFT JOIN t7 ON t7.a=1, t8)
@@ -2137,9 +2137,9 @@ FROM t5 LEFT JOIN
ON (t5.b=t8.b);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t5 ALL NULL NULL NULL NULL 2
-1 SIMPLE t6 ALL NULL NULL NULL NULL 1 Using join buffer (flat, BNL join)
+1 SIMPLE t6 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t7 ref b_i b_i 5 const 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
-1 SIMPLE t8 ALL b_i NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE t8 ref b_i b_i 5 test.t5.b 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
SELECT t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
FROM t5 LEFT JOIN
(t6 LEFT JOIN t7 ON t7.b=2, t8)
@@ -2154,7 +2154,7 @@ FROM t5 LEFT JOIN
ON (t5.b=t8.b);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t5 ALL NULL NULL NULL NULL 2
-1 SIMPLE t8 ALL b_i NULL NULL NULL 1 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t8 ref b_i b_i 5 test.t5.b 1 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
1 SIMPLE t6 ALL NULL NULL NULL NULL 1 Using join buffer (incremental, BNL join)
1 SIMPLE t7 const PRIMARY PRIMARY 4 const 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
SELECT t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b
diff --git a/mysql-test/main/join_outer.result b/mysql-test/main/join_outer.result
index 4bbc603e..c4ea5bc4 100644
--- a/mysql-test/main/join_outer.result
+++ b/mysql-test/main/join_outer.result
@@ -1230,7 +1230,7 @@ EXPLAIN
SELECT t1.id, a FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.b IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
-1 SIMPLE t2 ref idx idx 4 test.t1.id 2 Using where; Not exists
+1 SIMPLE t2 ref idx idx 4 test.t1.id 1 Using where; Not exists
flush status;
SELECT t1.id, a FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.b IS NULL;
id a
@@ -1430,7 +1430,7 @@ WHERE t1.f1 = 4 AND t2.f1 IS NOT NULL AND t2.f2 IS NOT NULL
GROUP BY t2.f1, t2.f2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system PRIMARY NULL NULL NULL 1
-1 SIMPLE t2 ref PRIMARY PRIMARY 4 const 1 Using where; Using index; Using filesort
+1 SIMPLE t2 ref PRIMARY PRIMARY 4 const 1 Using where; Using index
SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
WHERE t1.f1 = 4 AND t2.f1 IS NOT NULL AND t2.f2 IS NOT NULL
GROUP BY t2.f1, t2.f2;
@@ -1852,7 +1852,7 @@ WHERE t1.f1 = 4 AND t2.f1 IS NOT NULL AND t2.f2 IS NOT NULL
GROUP BY t2.f1, t2.f2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system PRIMARY NULL NULL NULL 1
-1 SIMPLE t2 ref PRIMARY PRIMARY 4 const 1 Using where; Using index; Using filesort
+1 SIMPLE t2 ref PRIMARY PRIMARY 4 const 1 Using where; Using index
SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
WHERE t1.f1 = 4 AND t2.f1 IS NOT NULL AND t2.f2 IS NOT NULL
GROUP BY t2.f1, t2.f2;
@@ -2080,7 +2080,7 @@ WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5
ORDER BY t1.b;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ref idx idx 4 const 2 100.00 Using where
-1 SIMPLE t2 ref c c 5 test.t1.a 2 100.00
+1 SIMPLE t2 ref c c 5 test.t1.a 1 100.00
Warnings:
Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t1`.`b` = 5 order by `test`.`t1`.`b`
SELECT t1.b, t2.c, t2.d FROM t2 JOIN t1 ON t2.c = t1.a
@@ -2097,7 +2097,7 @@ WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5
ORDER BY t1.b;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ref PRIMARY,idx idx 4 const 2 100.00 Using where
-1 SIMPLE t2 ref c c 5 test.t1.a 2 100.00
+1 SIMPLE t2 ref c c 5 test.t1.a 1 100.00
Warnings:
Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t1`.`b` = 5 order by `test`.`t1`.`b`
SELECT t1.b, t2.c, t2.d FROM t2 LEFT JOIN t1 ON t2.c = t1.a
@@ -2260,7 +2260,7 @@ create table t2 (a int, b int, c int, key(b), key(c));
insert into t2 select
@a:=A.a + 10*B.a+100*C.a,
IF(@a<900, NULL, @a),
-IF(@a<500, NULL, @a)
+IF(@a<400, NULL, @a)
from t1 A, t1 B, t1 C;
delete from t1 where a=0;
# Check that there are different #rows of NULLs for b and c, both !=10:
@@ -2269,7 +2269,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ref b b 5 const 780 Using index condition
explain select * from t2 force index (c) where c is null;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ref c c 5 const 393 Using index condition
+1 SIMPLE t2 ref c c 5 const 282 Using index condition
explain select * from t1 left join t2 on t2.b is null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 9
diff --git a/mysql-test/main/join_outer.test b/mysql-test/main/join_outer.test
index 83bb7fde..a9292abd 100644
--- a/mysql-test/main/join_outer.test
+++ b/mysql-test/main/join_outer.test
@@ -1816,7 +1816,7 @@ create table t2 (a int, b int, c int, key(b), key(c));
insert into t2 select
@a:=A.a + 10*B.a+100*C.a,
IF(@a<900, NULL, @a),
- IF(@a<500, NULL, @a)
+ IF(@a<400, NULL, @a)
from t1 A, t1 B, t1 C;
delete from t1 where a=0;
diff --git a/mysql-test/main/join_outer_innodb.result b/mysql-test/main/join_outer_innodb.result
index 809a9805..dbbbe899 100644
--- a/mysql-test/main/join_outer_innodb.result
+++ b/mysql-test/main/join_outer_innodb.result
@@ -435,47 +435,47 @@ left join t16 on t15.o1 = t16.p1
where t1.a10 = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL a4,a6,a5,a7 NULL NULL NULL 3 Using where
-1 SIMPLE t2 ref PRIMARY PRIMARY 4 test.t1.a1 1 Using index
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.b2 1 Using where; Using index
-1 SIMPLE t8 eq_ref PRIMARY PRIMARY 1 test.t1.a4 1 Using index
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t1.a2 1 Using index
+1 SIMPLE t2 ref PRIMARY PRIMARY 4 test.t1.a1 1
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.b2 1 Using where
+1 SIMPLE t10 eq_ref PRIMARY PRIMARY 1 test.t1.a6 1
+1 SIMPLE t8 eq_ref PRIMARY PRIMARY 1 test.t1.a4 1
+1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t1.a2 1
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.d1 1 Using where
-1 SIMPLE t6 eq_ref PRIMARY PRIMARY 4 test.t1.a3 1 Using where; Using index
+1 SIMPLE t6 eq_ref PRIMARY PRIMARY 4 test.t1.a3 1 Using where
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 1 test.t1.a7 1
1 SIMPLE t11 eq_ref PRIMARY PRIMARY 4 test.t1.a5 1
1 SIMPLE t12 eq_ref PRIMARY PRIMARY 4 test.t11.k3 1 Using where
1 SIMPLE l2 eq_ref PRIMARY PRIMARY 4 test.t11.k4 1 Using where
1 SIMPLE t9 ref PRIMARY PRIMARY 1 test.t1.a4 1
-1 SIMPLE t13 ref PRIMARY,m3 m3 8 const,test.t1.a1 1 Using index
-1 SIMPLE l4 eq_ref PRIMARY PRIMARY 4 test.t13.m2 1 Using where; Using index
-1 SIMPLE m2 ref PRIMARY,m3 m3 8 const,test.t1.a1 1 Using index
+1 SIMPLE t13 ref PRIMARY,m3 m3 8 const,test.t1.a1 3 Using index
+1 SIMPLE l4 eq_ref PRIMARY PRIMARY 4 test.t13.m2 1 Using where
+1 SIMPLE m2 ref PRIMARY,m3 m3 8 const,test.t1.a1 3 Using index
1 SIMPLE l3 eq_ref PRIMARY PRIMARY 4 test.m2.m2 1 Using where
1 SIMPLE t14 eq_ref PRIMARY PRIMARY 2 test.t1.a8 1 Using where
-1 SIMPLE t15 eq_ref PRIMARY PRIMARY 2 test.t1.a9 1 Using where; Using index
+1 SIMPLE t15 eq_ref PRIMARY PRIMARY 2 test.t1.a9 1 Using where
1 SIMPLE t16 ref PRIMARY PRIMARY 2 test.t15.o1 1 Using where
-1 SIMPLE t10 ALL PRIMARY NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
explain select * from v1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL a4,a6,a5,a7 NULL NULL NULL 3 Using where
-1 SIMPLE t2 ref PRIMARY PRIMARY 4 test.t1.a1 1 Using index
-1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.b2 1 Using where; Using index
-1 SIMPLE t8 eq_ref PRIMARY PRIMARY 1 test.t1.a4 1 Using index
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t1.a2 1 Using index
+1 SIMPLE t2 ref PRIMARY PRIMARY 4 test.t1.a1 1
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.b2 1 Using where
+1 SIMPLE t10 eq_ref PRIMARY PRIMARY 1 test.t1.a6 1
+1 SIMPLE t8 eq_ref PRIMARY PRIMARY 1 test.t1.a4 1
+1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t1.a2 1
1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.d1 1 Using where
-1 SIMPLE t6 eq_ref PRIMARY PRIMARY 4 test.t1.a3 1 Using where; Using index
+1 SIMPLE t6 eq_ref PRIMARY PRIMARY 4 test.t1.a3 1 Using where
1 SIMPLE t7 eq_ref PRIMARY PRIMARY 1 test.t1.a7 1
1 SIMPLE t11 eq_ref PRIMARY PRIMARY 4 test.t1.a5 1
1 SIMPLE t12 eq_ref PRIMARY PRIMARY 4 test.t11.k3 1 Using where
1 SIMPLE l2 eq_ref PRIMARY PRIMARY 4 test.t11.k4 1 Using where
1 SIMPLE t9 ref PRIMARY PRIMARY 1 test.t1.a4 1
-1 SIMPLE t13 ref PRIMARY,m3 m3 8 const,test.t1.a1 1 Using index
-1 SIMPLE l4 eq_ref PRIMARY PRIMARY 4 test.t13.m2 1 Using where; Using index
-1 SIMPLE m2 ref PRIMARY,m3 m3 8 const,test.t1.a1 1 Using index
+1 SIMPLE t13 ref PRIMARY,m3 m3 8 const,test.t1.a1 3 Using index
+1 SIMPLE l4 eq_ref PRIMARY PRIMARY 4 test.t13.m2 1 Using where
+1 SIMPLE m2 ref PRIMARY,m3 m3 8 const,test.t1.a1 3 Using index
1 SIMPLE l3 eq_ref PRIMARY PRIMARY 4 test.m2.m2 1 Using where
1 SIMPLE t14 eq_ref PRIMARY PRIMARY 2 test.t1.a8 1 Using where
-1 SIMPLE t15 eq_ref PRIMARY PRIMARY 2 test.t1.a9 1 Using where; Using index
+1 SIMPLE t15 eq_ref PRIMARY PRIMARY 2 test.t1.a9 1 Using where
1 SIMPLE t16 ref PRIMARY PRIMARY 2 test.t15.o1 1 Using where
-1 SIMPLE t10 ALL PRIMARY NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
drop view v1;
drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16;
#
diff --git a/mysql-test/main/join_outer_jcl6.result b/mysql-test/main/join_outer_jcl6.result
index c4e02cf0..bdaab88e 100644
--- a/mysql-test/main/join_outer_jcl6.result
+++ b/mysql-test/main/join_outer_jcl6.result
@@ -1237,7 +1237,7 @@ EXPLAIN
SELECT t1.id, a FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.b IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
-1 SIMPLE t2 ref idx idx 4 test.t1.id 2 Using where; Not exists; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t2 ref idx idx 4 test.t1.id 1 Using where; Not exists; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
flush status;
SELECT t1.id, a FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.b IS NULL;
id a
@@ -1437,7 +1437,7 @@ WHERE t1.f1 = 4 AND t2.f1 IS NOT NULL AND t2.f2 IS NOT NULL
GROUP BY t2.f1, t2.f2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system PRIMARY NULL NULL NULL 1
-1 SIMPLE t2 ref PRIMARY PRIMARY 4 const 1 Using where; Using index; Using filesort
+1 SIMPLE t2 ref PRIMARY PRIMARY 4 const 1 Using where; Using index
SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
WHERE t1.f1 = 4 AND t2.f1 IS NOT NULL AND t2.f2 IS NOT NULL
GROUP BY t2.f1, t2.f2;
@@ -1859,7 +1859,7 @@ WHERE t1.f1 = 4 AND t2.f1 IS NOT NULL AND t2.f2 IS NOT NULL
GROUP BY t2.f1, t2.f2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system PRIMARY NULL NULL NULL 1
-1 SIMPLE t2 ref PRIMARY PRIMARY 4 const 1 Using where; Using index; Using filesort
+1 SIMPLE t2 ref PRIMARY PRIMARY 4 const 1 Using where; Using index
SELECT * FROM t1 LEFT JOIN t2 ON t2.f1 = t1.f1
WHERE t1.f1 = 4 AND t2.f1 IS NOT NULL AND t2.f2 IS NOT NULL
GROUP BY t2.f1, t2.f2;
@@ -2087,7 +2087,7 @@ WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5
ORDER BY t1.b;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ref idx idx 4 const 2 100.00 Using where
-1 SIMPLE t2 ref c c 5 test.t1.a 2 100.00 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t2 ref c c 5 test.t1.a 1 100.00 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
Warnings:
Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t1`.`b` = 5 order by `test`.`t1`.`b`
SELECT t1.b, t2.c, t2.d FROM t2 JOIN t1 ON t2.c = t1.a
@@ -2104,7 +2104,7 @@ WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5
ORDER BY t1.b;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ref PRIMARY,idx idx 4 const 2 100.00 Using where
-1 SIMPLE t2 ref c c 5 test.t1.a 2 100.00 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t2 ref c c 5 test.t1.a 1 100.00 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
Warnings:
Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t1`.`b` = 5 order by `test`.`t1`.`b`
SELECT t1.b, t2.c, t2.d FROM t2 LEFT JOIN t1 ON t2.c = t1.a
@@ -2230,8 +2230,8 @@ SELECT * FROM t1 LEFT JOIN t2 LEFT JOIN t3 ON i2 = i3 ON i1 = i3
WHERE d3 IS NULL;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
-1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.i1 2 100.00 Using where; Using join buffer (flat, BNLH join)
-1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 test.t1.i1 2 100.00 Using where; Using join buffer (incremental, BNLH join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.i1 2 10.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 test.t1.i1 2 10.00 Using where; Using join buffer (incremental, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t2`.`i2` AS `i2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`d3` AS `d3` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`i2` = `test`.`t1`.`i1` and `test`.`t3`.`i3` = `test`.`t1`.`i1` and `test`.`t1`.`i1` is not null and `test`.`t1`.`i1` is not null) where `test`.`t3`.`d3` = 0 or `test`.`t3`.`d3` is null
DROP TABLE t1,t2,t3;
@@ -2251,7 +2251,7 @@ WHERE b IN (1,2,3) OR b = d;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where
-1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 const 2 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t3 hash_ALL NULL #hash#$hj 5 const 2 10.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select 10 AS `a`,8 AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t3`.`d` AS `d` from `test`.`t2` left join `test`.`t3` on(`test`.`t3`.`d` = 10 and 10 is not null) where `test`.`t2`.`c` = 8 and `test`.`t3`.`d` = 8
SELECT * FROM t1 INNER JOIN t2 ON c = b LEFT JOIN t3 ON d = a
@@ -2267,7 +2267,7 @@ create table t2 (a int, b int, c int, key(b), key(c));
insert into t2 select
@a:=A.a + 10*B.a+100*C.a,
IF(@a<900, NULL, @a),
-IF(@a<500, NULL, @a)
+IF(@a<400, NULL, @a)
from t1 A, t1 B, t1 C;
delete from t1 where a=0;
# Check that there are different #rows of NULLs for b and c, both !=10:
@@ -2276,7 +2276,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ref b b 5 const 780 Using index condition
explain select * from t2 force index (c) where c is null;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ref c c 5 const 393 Using index condition
+1 SIMPLE t2 ref c c 5 const 282 Using index condition
explain select * from t1 left join t2 on t2.b is null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 9
@@ -2368,7 +2368,7 @@ ON t1.x = t2.x
WHERE IFNULL(t2.x,0)=0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
-1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.x 2 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.x 2 10.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t2`.`x` AS `x`,ifnull(`test`.`t2`.`x`,0) AS `IFNULL(t2.x,0)`,`f`(`test`.`t2`.`x`,0) AS `f(t2.x,0)` from `test`.`t` `t1` left join `test`.`t` `t2` on(`test`.`t2`.`x` = `test`.`t1`.`x` and `test`.`t1`.`x` is not null) where ifnull(`test`.`t2`.`x`,0) = 0
SELECT t1.x, t2.x, IFNULL(t2.x,0), f(t2.x,0)
@@ -2384,7 +2384,7 @@ ON t1.x = t2.x
WHERE f(t2.x,0)=0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
-1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.x 2 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.x 2 10.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t2`.`x` AS `x`,ifnull(`test`.`t2`.`x`,0) AS `IFNULL(t2.x,0)`,`f`(`test`.`t2`.`x`,0) AS `f(t2.x,0)` from `test`.`t` `t1` left join `test`.`t` `t2` on(`test`.`t2`.`x` = `test`.`t1`.`x` and `test`.`t1`.`x` is not null) where `f`(`test`.`t2`.`x`,0) = 0
drop function f;
@@ -2424,7 +2424,7 @@ FROM t1 LEFT OUTER JOIN t2 ON t1.col1 = t2.col2
WHERE IFNULL(t2.col3,0) = 0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
-1 SIMPLE t2 hash_ALL NULL #hash#$hj 17 test.t1.col1 2 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 17 test.t1.col1 2 10.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`col1` AS `col1`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col3` AS `col3` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`col2` = `test`.`t1`.`col1` and `test`.`t1`.`col1` is not null) where ifnull(`test`.`t2`.`col3`,0) = 0
SELECT t1.col1, t2.col1, t2.col3
@@ -2438,7 +2438,7 @@ FROM t1 LEFT OUTER JOIN t2 ON t1.col1 = t2.col2
WHERE f1(t2.col3,0) = 0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
-1 SIMPLE t2 hash_ALL NULL #hash#$hj 17 test.t1.col1 2 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 17 test.t1.col1 2 10.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`col1` AS `col1`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col3` AS `col3` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`col2` = `test`.`t1`.`col1` and `test`.`t1`.`col1` is not null) where `f1`(`test`.`t2`.`col3`,0) = 0
DROP FUNCTION f1;
@@ -2542,7 +2542,7 @@ a b
explain extended select * from t1 left join t2 on a=b where (b > 3) is not true;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
-1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.a 3 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.a 3 10.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`b` = `test`.`t1`.`a` and `test`.`t1`.`a` is not null) where `test`.`t2`.`b` > 3 is not true
select * from t1 left join t2 on a=b where (b > 3) is not false;
@@ -2552,7 +2552,7 @@ a b
explain extended select * from t1 left join t2 on a=b where (b > 3) is not false;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
-1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.a 3 100.00 Using where; Using join buffer (flat, BNLH join)
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 5 test.t1.a 3 10.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`b` = `test`.`t1`.`a` and `test`.`t1`.`a` is not null) where `test`.`t2`.`b` > 3 is not false
drop table t1,t2;
@@ -2783,8 +2783,8 @@ id select_type table type possible_keys key key_len ref rows Extra
explain select * from t1 left join (t3 join t2) on t1.a=t3.b and t3.a<5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 10
-1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE t3 hash_range a #hash#$hj:a 5:5 test.t1.a 5 Using where; Rowid-ordered scan; Using join buffer (incremental, BNLH join)
+1 SIMPLE t3 hash_range a #hash#$hj:a 5:5 test.t1.a 5 Using where; Rowid-ordered scan; Using join buffer (flat, BNLH join)
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using join buffer (incremental, BNL join)
#
# .. part 2: make sure condition selectivity can use the condition too.
#
diff --git a/mysql-test/main/json_debug_nonembedded.result b/mysql-test/main/json_debug_nonembedded.result
index e759cafa..0e7458ed 100644
--- a/mysql-test/main/json_debug_nonembedded.result
+++ b/mysql-test/main/json_debug_nonembedded.result
@@ -7,6 +7,13 @@ SET @json1= '{"key1":"val1"}';
SET @json2= '{"key1":"val1"}';
SELECT JSON_OVERLAPS(@json1, @json2);
ERROR HY000: Thread stack overrun: 'used bytes' used of a 'available' byte stack, and 'X' bytes needed. Consider increasing the thread_stack system variable.
+SET @schema_array= '{
+ "type":"array",
+ "items": {"type":"number"},
+ "maxItems": 4,
+ "minItems": 2}';
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, 3]');
+ERROR HY000: Thread stack overrun: 'used bytes' used of a 'available' byte stack, and 'X' bytes needed. Consider increasing the thread_stack system variable.
SET @@debug_dbug= @saved_dbug;
#
# End of 10.9 test
diff --git a/mysql-test/main/json_debug_nonembedded.test b/mysql-test/main/json_debug_nonembedded.test
index 5813b46e..fb4fe67b 100644
--- a/mysql-test/main/json_debug_nonembedded.test
+++ b/mysql-test/main/json_debug_nonembedded.test
@@ -15,6 +15,15 @@ SET @json2= '{"key1":"val1"}';
--error ER_STACK_OVERRUN_NEED_MORE
SELECT JSON_OVERLAPS(@json1, @json2);
+SET @schema_array= '{
+ "type":"array",
+ "items": {"type":"number"},
+ "maxItems": 4,
+ "minItems": 2}';
+--replace_regex /overrun: [0-9]* bytes used of a [0-9]* byte stack, and [0-9]* bytes needed/overrun: 'used bytes' used of a 'available' byte stack, and 'X' bytes needed/
+--error ER_STACK_OVERRUN_NEED_MORE
+SELECT JSON_SCHEMA_VALID(@schema_array, '[1, 2, 3]');
+
SET @@debug_dbug= @saved_dbug;
--echo #
diff --git a/mysql-test/main/key.result b/mysql-test/main/key.result
index 2e2c8d89..e6bb46af 100644
--- a/mysql-test/main/key.result
+++ b/mysql-test/main/key.result
@@ -231,11 +231,14 @@ numeropost
1
EXPLAIN SELECT numeropost FROM t1 WHERE numreponse='1';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 const numreponse numreponse 4 const 1 Using index
+1 SIMPLE t1 const numreponse numreponse 4 const 1
FLUSH TABLES;
SELECT numeropost FROM t1 WHERE numreponse='1';
numeropost
1
+EXPLAIN SELECT numreponse+0 FROM t1 WHERE numreponse='1';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 const numreponse numreponse 4 const 1 Using index
drop table t1;
create table t1 (c varchar(30) character set utf8, t text character set utf8, unique (c(2)), unique (t(3))) engine=myisam;
show create table t1;
@@ -610,7 +613,7 @@ EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE
(SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
-2 SUBQUERY t1 range a a 5 NULL 5 Using where; Using index
+2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index for group-by
SELECT 1 as RES FROM t1 AS t1_outer WHERE
(SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12;
RES
@@ -628,19 +631,19 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort
SHOW STATUS LIKE 'Last_query_cost';
Variable_name Value
-Last_query_cost 9.212184
+Last_query_cost 0.014784
EXPLAIN SELECT a, SUM( b ) FROM t1 USE INDEX( a ) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort
SHOW STATUS LIKE 'Last_query_cost';
Variable_name Value
-Last_query_cost 9.212184
+Last_query_cost 0.014784
EXPLAIN SELECT a, SUM( b ) FROM t1 FORCE INDEX( a ) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL a 5 NULL 6
SHOW STATUS LIKE 'Last_query_cost';
Variable_name Value
-Last_query_cost 14.199000
+Last_query_cost 0.014784
DROP TABLE t1;
#
# MDEV-21480: Unique key using ref access though eq_ref access can be used
@@ -689,3 +692,42 @@ drop table t1,t2;
#
create table t1 (a int, b int, key(a), key(a desc));
drop table t1;
+# Check some issues with FORCE INDEX and full index scans
+# (Does FORCE INDEX force an index scan)
+#
+create table t1 (a int primary key, b int, c int, d int,
+key k1 (b) using BTREE, key k2 (c,d) using btree) engine=heap;
+insert into t1 select seq as a, seq as b, seq as c, seq as d
+from seq_1_to_100;
+explain select sum(a+b) from t1 force index (k1) where b>0 and a=99;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range k1 k1 5 NULL 100 Using where
+explain select sum(a+b) from t1 force index (k1) where a>0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where
+explain select sum(a+b) from t1 force index (k1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 100
+explain select sum(a+b) from t1 force index for join (k1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 100
+explain select sum(a+b) from t1 force index for order by (k1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 100
+explain select sum(a+b) from t1 force index (k1,k2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 100
+select sum(a+b) from t1 force index (k1);
+sum(a+b)
+10100
+explain select sum(a+b) from t1 force index (primary);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 100
+select sum(a+b) from t1 force index (primary);
+sum(a+b)
+10100
+explain select straight_join sum(a+b) from seq_1_to_10 as s, t1 force index (k2) where t1.a=s.seq;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE s index PRIMARY PRIMARY 8 NULL 10 Using index
+1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where; Using join buffer (flat, BNL join)
+drop table t1;
diff --git a/mysql-test/main/key.test b/mysql-test/main/key.test
index 29e08b88..7ec18ad5 100644
--- a/mysql-test/main/key.test
+++ b/mysql-test/main/key.test
@@ -227,9 +227,12 @@ drop table t1;
CREATE TABLE t1 (numeropost mediumint(8) unsigned NOT NULL default '0', numreponse int(10) unsigned NOT NULL auto_increment, PRIMARY KEY (numeropost,numreponse), UNIQUE KEY numreponse (numreponse));
INSERT INTO t1 (numeropost,numreponse) VALUES ('1','1'),('1','2'),('2','3'),('2','4');
SELECT numeropost FROM t1 WHERE numreponse='1';
+# No 'Using index'
EXPLAIN SELECT numeropost FROM t1 WHERE numreponse='1';
FLUSH TABLES;
SELECT numeropost FROM t1 WHERE numreponse='1';
+# This one will have 'Using index'
+EXPLAIN SELECT numreponse+0 FROM t1 WHERE numreponse='1';
drop table t1;
#
@@ -608,3 +611,23 @@ drop table t1,t2;
--echo #
create table t1 (a int, b int, key(a), key(a desc));
drop table t1;
+
+--echo # Check some issues with FORCE INDEX and full index scans
+--echo # (Does FORCE INDEX force an index scan)
+--echo #
+
+create table t1 (a int primary key, b int, c int, d int,
+key k1 (b) using BTREE, key k2 (c,d) using btree) engine=heap;
+insert into t1 select seq as a, seq as b, seq as c, seq as d
+from seq_1_to_100;
+explain select sum(a+b) from t1 force index (k1) where b>0 and a=99;
+explain select sum(a+b) from t1 force index (k1) where a>0;
+explain select sum(a+b) from t1 force index (k1);
+explain select sum(a+b) from t1 force index for join (k1);
+explain select sum(a+b) from t1 force index for order by (k1);
+explain select sum(a+b) from t1 force index (k1,k2);
+select sum(a+b) from t1 force index (k1);
+explain select sum(a+b) from t1 force index (primary);
+select sum(a+b) from t1 force index (primary);
+explain select straight_join sum(a+b) from seq_1_to_10 as s, t1 force index (k2) where t1.a=s.seq;
+drop table t1;
diff --git a/mysql-test/main/key_cache.result b/mysql-test/main/key_cache.result
index 4a5df2da..0ac03750 100644
--- a/mysql-test/main/key_cache.result
+++ b/mysql-test/main/key_cache.result
@@ -134,7 +134,7 @@ i
explain select count(*) from t1, t2 where t1.p = t2.i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 2 Using index
-1 SIMPLE t2 ref k1 k1 5 test.t1.p 2 Using index
+1 SIMPLE t2 ref k1 k1 5 test.t1.p 1 Using index
select count(*) from t1, t2 where t1.p = t2.i;
count(*)
3
@@ -434,31 +434,31 @@ p i a
3 1 yyyy
4 3 zzzz
update t1 set p=3 where p=1;
-update t2 set i=2 where i=1;
+set statement optimizer_scan_setup_cost=0 for update t2 set i=2 where i=1;
select * from information_schema.session_status where variable_name like 'key_%' and variable_name != 'Key_blocks_unused';
VARIABLE_NAME VARIABLE_VALUE
KEY_BLOCKS_NOT_FLUSHED 0
KEY_BLOCKS_USED 4
KEY_BLOCKS_WARM 0
-KEY_READ_REQUESTS 22
+KEY_READ_REQUESTS 21
KEY_READS 0
KEY_WRITE_REQUESTS 26
KEY_WRITES 6
select variable_value into @key_blocks_unused from information_schema.session_status where variable_name = 'Key_blocks_unused';
select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
-default NULL NULL 2097152 1024 4 # 0 22 0 26 6
+default NULL NULL 2097152 1024 4 # 0 21 0 26 6
small NULL NULL 1048576 1024 1 # 0 1 0 2 1
delete from t2 where a='zzzz';
select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
-default NULL NULL 2097152 1024 4 # 0 29 0 32 9
+default NULL NULL 2097152 1024 4 # 0 28 0 32 9
small NULL NULL 1048576 1024 1 # 0 1 0 2 1
delete from t1;
delete from t2;
select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
-default NULL NULL 2097152 1024 4 # 0 29 0 32 9
+default NULL NULL 2097152 1024 4 # 0 28 0 32 9
small NULL NULL 1048576 1024 1 # 0 1 0 2 1
set global key_cache_segments=2;
select @@key_cache_segments;
@@ -482,13 +482,13 @@ p i a
3 1 yyyy
4 3 zzzz
update t1 set p=3 where p=1;
-update t2 set i=2 where i=1;
+set statement optimizer_scan_setup_cost=0 for update t2 set i=2 where i=1;
select * from information_schema.session_status where variable_name like 'key_%' and variable_name != 'Key_blocks_unused';
VARIABLE_NAME VARIABLE_VALUE
KEY_BLOCKS_NOT_FLUSHED 0
KEY_BLOCKS_USED 4
KEY_BLOCKS_WARM 0
-KEY_READ_REQUESTS 22
+KEY_READ_REQUESTS 21
KEY_READS 0
KEY_WRITE_REQUESTS 26
KEY_WRITES 6
@@ -497,13 +497,13 @@ variable_value < @key_blocks_unused
1
select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
-default 2 NULL 2097152 1024 4 # 0 22 0 26 6
+default 2 NULL 2097152 1024 4 # 0 21 0 26 6
small NULL NULL 1048576 1024 1 # 0 1 0 2 1
delete from t1;
delete from t2;
select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
-default 2 NULL 2097152 1024 4 # 0 22 0 26 6
+default 2 NULL 2097152 1024 4 # 0 21 0 26 6
small NULL NULL 1048576 1024 1 # 0 1 0 2 1
set global key_cache_segments=1;
select @@key_cache_segments;
@@ -527,13 +527,13 @@ p i a
3 1 yyyy
4 3 zzzz
update t1 set p=3 where p=1;
-update t2 set i=2 where i=1;
+set statement optimizer_scan_setup_cost=0 for update t2 set i=2 where i=1;
select * from information_schema.session_status where variable_name like 'key_%' and variable_name != 'Key_blocks_unused';
VARIABLE_NAME VARIABLE_VALUE
KEY_BLOCKS_NOT_FLUSHED 0
KEY_BLOCKS_USED 4
KEY_BLOCKS_WARM 0
-KEY_READ_REQUESTS 22
+KEY_READ_REQUESTS 21
KEY_READS 0
KEY_WRITE_REQUESTS 26
KEY_WRITES 6
@@ -542,13 +542,13 @@ variable_value = @key_blocks_unused
1
select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
-default 1 NULL 2097152 1024 4 # 0 22 0 26 6
+default 1 NULL 2097152 1024 4 # 0 21 0 26 6
small NULL NULL 1048576 1024 1 # 0 1 0 2 1
delete from t1;
delete from t2;
select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
-default 1 NULL 2097152 1024 4 # 0 22 0 26 6
+default 1 NULL 2097152 1024 4 # 0 21 0 26 6
small NULL NULL 1048576 1024 1 # 0 1 0 2 1
flush tables;
flush status;
@@ -583,10 +583,10 @@ p i a
3 1 yyyy
4 3 zzzz
update t1 set p=3 where p=1;
-update t2 set i=2 where i=1;
+set statement optimizer_scan_setup_cost=0 for update t2 set i=2 where i=1;
select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
-default 2 NULL 32768 1024 4 # 0 22 0 26 6
+default 2 NULL 32768 1024 4 # 0 21 0 26 6
small NULL NULL 1048576 1024 1 # 0 0 0 0 0
insert into t1(a) select a from t1;
insert into t1(a) select a from t1;
@@ -606,7 +606,7 @@ insert into t2(i,a) select i,a from t2;
insert into t2(i,a) select i,a from t2;
select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
-default 2 NULL 32768 1024 # # 0 6733 # 3684 103
+default 2 NULL 32768 1024 # # 0 6732 # 3684 103
small NULL NULL 1048576 1024 # # 0 0 # 0 0
select * from t1 where p between 1010 and 1020 ;
p a
@@ -625,12 +625,16 @@ p i a
1020 3 zzzz
select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
-default 2 NULL 32768 1024 # # 0 6750 # 3684 103
+default 2 NULL 32768 1024 # # 0 6749 # 3684 103
small NULL NULL 1048576 1024 # # 0 0 # 0 0
+analyze table t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status Engine-independent statistics collected
+test.t2 analyze status OK
flush tables;
flush status;
update t1 set a='zzzz' where a='qqqq';
-update t2 set i=1 where i=2;
+set statement optimizer_scan_setup_cost=0 for update t2 set i=1 where i=2;
select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3076 18 1552 18
diff --git a/mysql-test/main/key_cache.test b/mysql-test/main/key_cache.test
index 0829719a..4d6c9ed9 100644
--- a/mysql-test/main/key_cache.test
+++ b/mysql-test/main/key_cache.test
@@ -300,7 +300,7 @@ insert into t2 values (1, 1, 'qqqq'), (2, 1, 'pppp'),
select * from t1;
select * from t2;
update t1 set p=3 where p=1;
-update t2 set i=2 where i=1;
+set statement optimizer_scan_setup_cost=0 for update t2 set i=2 where i=1;
select * from information_schema.session_status where variable_name like 'key_%' and variable_name != 'Key_blocks_unused';
select variable_value into @key_blocks_unused from information_schema.session_status where variable_name = 'Key_blocks_unused';
@@ -332,8 +332,7 @@ insert into t2 values (1, 1, 'qqqq'), (2, 1, 'pppp'),
select * from t1;
select * from t2;
update t1 set p=3 where p=1;
-update t2 set i=2 where i=1;
-
+set statement optimizer_scan_setup_cost=0 for update t2 set i=2 where i=1;
select * from information_schema.session_status where variable_name like 'key_%' and variable_name != 'Key_blocks_unused';
select variable_value < @key_blocks_unused from information_schema.session_status where variable_name = 'Key_blocks_unused';
@@ -358,7 +357,7 @@ insert into t2 values (1, 1, 'qqqq'), (2, 1, 'pppp'),
select * from t1;
select * from t2;
update t1 set p=3 where p=1;
-update t2 set i=2 where i=1;
+set statement optimizer_scan_setup_cost=0 for update t2 set i=2 where i=1;
select * from information_schema.session_status where variable_name like 'key_%' and variable_name != 'Key_blocks_unused';
select variable_value = @key_blocks_unused from information_schema.session_status where variable_name = 'Key_blocks_unused';
@@ -390,7 +389,7 @@ insert into t2 values (1, 1, 'qqqq'), (2, 1, 'pppp'),
select * from t1;
select * from t2;
update t1 set p=3 where p=1;
-update t2 set i=2 where i=1;
+set statement optimizer_scan_setup_cost=0 for update t2 set i=2 where i=1;
--replace_column 7 #
select * from information_schema.key_caches where segment_number is null;
@@ -423,9 +422,10 @@ select * from t2 where p between 1010 and 1020 ;
--replace_column 6 # 7 # 10 #
select * from information_schema.key_caches where segment_number is null;
+analyze table t2;
flush tables; flush status;
update t1 set a='zzzz' where a='qqqq';
-update t2 set i=1 where i=2;
+set statement optimizer_scan_setup_cost=0 for update t2 set i=1 where i=2;
--replace_column 6 # 7 #
select * from information_schema.key_caches where segment_number is null;
diff --git a/mysql-test/main/key_diff.result b/mysql-test/main/key_diff.result
index af928fcb..f419be55 100644
--- a/mysql-test/main/key_diff.result
+++ b/mysql-test/main/key_diff.result
@@ -36,7 +36,7 @@ a a a a
explain select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL a NULL NULL NULL 5
-1 SIMPLE t2 ALL b NULL NULL NULL 5 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 ref b b 4 test.t1.a 1 Using index condition
select t1.*,t2.* from t1,t1 as t2 where t1.A=t2.B order by binary t1.a,t2.a;
a b a b
A B a a
diff --git a/mysql-test/main/limit_rows_examined.result b/mysql-test/main/limit_rows_examined.result
index 50b542fa..565c82c3 100644
--- a/mysql-test/main/limit_rows_examined.result
+++ b/mysql-test/main/limit_rows_examined.result
@@ -211,45 +211,42 @@ explain
select * from t1
where c1 IN (select * from t2 where c2 > ' ' LIMIT ROWS EXAMINED 11);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 2 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 4 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
+1 PRIMARY t2 ALL NULL NULL NULL NULL 4 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
select * from t1
where c1 IN (select * from t2 where c2 > ' ' LIMIT ROWS EXAMINED 11);
c1
bb
-Warnings:
-Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 11. The query result may be incomplete
+cc
+dd
explain
select * from t1
where c1 IN (select * from t2 where c2 > ' ')
LIMIT ROWS EXAMINED 11;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 2 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 4 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
+1 PRIMARY t2 ALL NULL NULL NULL NULL 4 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
select * from t1
where c1 IN (select * from t2 where c2 > ' ')
LIMIT ROWS EXAMINED 11;
c1
bb
-Warnings:
-Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 11. The query result may be incomplete
+cc
+dd
explain
select * from t1
where c1 IN (select * from t2 where c2 > ' ' LIMIT ROWS EXAMINED 0)
LIMIT ROWS EXAMINED 11;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 2 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 4 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
+1 PRIMARY t2 ALL NULL NULL NULL NULL 4 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
select * from t1
where c1 IN (select * from t2 where c2 > ' ' LIMIT ROWS EXAMINED 0)
LIMIT ROWS EXAMINED 11;
c1
bb
-Warnings:
-Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 11. The query result may be incomplete
+cc
+dd
explain
select * from t1i
where c1 IN (select * from t2i where c2 > ' ')
@@ -416,24 +413,22 @@ c1
bb
cc
dd
-select * from v1 LIMIT ROWS EXAMINED 17;
+select * from v1 LIMIT ROWS EXAMINED 10;
c1
bb
cc
dd
-Warnings:
-Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 17. The query result may be incomplete
-select * from v1 LIMIT ROWS EXAMINED 16;
+select * from v1 LIMIT ROWS EXAMINED 8;
c1
bb
cc
+dd
Warnings:
-Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 16. The query result may be incomplete
-select * from v1 LIMIT ROWS EXAMINED 11;
+Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 8. The query result may be incomplete
+select * from v1 LIMIT ROWS EXAMINED 3;
c1
-bb
Warnings:
-Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 11. The query result may be incomplete
+Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 3. The query result may be incomplete
drop view v1;
explain
select *
@@ -441,17 +436,16 @@ from (select * from t1
where c1 IN (select * from t2 where c2 > ' ' LIMIT ROWS EXAMINED 0)) as tmp
LIMIT ROWS EXAMINED 11;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4
-1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 2 func 1
-3 MATERIALIZED t2 ALL NULL NULL NULL NULL 4 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
+1 PRIMARY t2 ALL NULL NULL NULL NULL 4 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
select *
from (select * from t1
where c1 IN (select * from t2 where c2 > ' ' LIMIT ROWS EXAMINED 0)) as tmp
LIMIT ROWS EXAMINED 11;
c1
bb
-Warnings:
-Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 11. The query result may be incomplete
+cc
+dd
=========================================================================
Aggregation
=========================================================================
diff --git a/mysql-test/main/limit_rows_examined.test b/mysql-test/main/limit_rows_examined.test
index 16831a0c..a6c66a58 100644
--- a/mysql-test/main/limit_rows_examined.test
+++ b/mysql-test/main/limit_rows_examined.test
@@ -277,9 +277,9 @@ create view v1 as
select * from t1 where c1 IN (select * from t2 where c2 > ' ');
select * from v1;
-select * from v1 LIMIT ROWS EXAMINED 17;
-select * from v1 LIMIT ROWS EXAMINED 16;
-select * from v1 LIMIT ROWS EXAMINED 11;
+select * from v1 LIMIT ROWS EXAMINED 10;
+select * from v1 LIMIT ROWS EXAMINED 8;
+select * from v1 LIMIT ROWS EXAMINED 3;
drop view v1;
diff --git a/mysql-test/main/locale.result b/mysql-test/main/locale.result
index b1d41709..71707c60 100644
--- a/mysql-test/main/locale.result
+++ b/mysql-test/main/locale.result
@@ -1,5 +1,3 @@
-DROP TABLE IF EXISTS t1;
-Start of 5.4 tests
#
# WL#4642 Greek locale for DAYNAME, MONTHNAME, DATE_FORMAT
#
@@ -50,11 +48,7 @@ DROP TABLE t1;
# Bug#46633 Obsolete Serbian locale name
#
SET lc_messages=sr_YU;
-Warnings:
-Warning 1287 'sr_YU' ist veraltet. Bitte benutzen Sie 'sr_RS'
-SHOW VARIABLES LIKE 'lc_messages';
-Variable_name Value
-lc_messages sr_RS
+ERROR HY000: Unbekannte Locale: 'sr_YU'
SET lc_messages=sr_RS;
SHOW VARIABLES LIKE 'lc_messages';
Variable_name Value
@@ -324,6 +318,13 @@ SELECT x;
ERROR 42S22: უცნáƒáƒ‘ი სვეტი 'x' 'field list'-ში
SET lc_messages=DEFAULT;
#
+# Add Swahili error messages and locale
+#
+SET lc_messages=sw_KE;
+SELECT x;
+ERROR 42S22: Safu wima isiyojulikana 'x' katika 'field list'
+SET lc_messages=DEFAULT;
+#
# MDEV-30997 SIGSEGV in __strlen_avx2 | make_date_time | Item_func_date_format::val_str
#
SET lc_messages=en_US;
diff --git a/mysql-test/main/locale.test b/mysql-test/main/locale.test
index c99f2cb3..a0224fe0 100644
--- a/mysql-test/main/locale.test
+++ b/mysql-test/main/locale.test
@@ -1,9 +1,3 @@
---disable_warnings
-DROP TABLE IF EXISTS t1;
---enable_warnings
-
---echo Start of 5.4 tests
-
--echo #
--echo # WL#4642 Greek locale for DAYNAME, MONTHNAME, DATE_FORMAT
--echo #
@@ -34,8 +28,8 @@ DROP TABLE t1;
--echo #
--echo # Bug#46633 Obsolete Serbian locale name
--echo #
+--error ER_UNKNOWN_LOCALE
SET lc_messages=sr_YU;
-SHOW VARIABLES LIKE 'lc_messages';
SET lc_messages=sr_RS;
SHOW VARIABLES LIKE 'lc_messages';
SET lc_time_names=sr_RS;
@@ -209,6 +203,17 @@ SET lc_messages=DEFAULT;
--echo #
+--echo # Add Swahili error messages and locale
+--echo #
+
+SET lc_messages=sw_KE;
+--error ER_BAD_FIELD_ERROR
+SELECT x;
+
+SET lc_messages=DEFAULT;
+
+
+--echo #
--echo # MDEV-30997 SIGSEGV in __strlen_avx2 | make_date_time | Item_func_date_format::val_str
--echo #
diff --git a/mysql-test/main/lock_multi_bug38499.result b/mysql-test/main/lock_multi_bug38499.result
index 521ea010..de552ca0 100644
--- a/mysql-test/main/lock_multi_bug38499.result
+++ b/mysql-test/main/lock_multi_bug38499.result
@@ -17,7 +17,7 @@ INSERT INTO t2 VALUES (1, 1), (2, 2), (3, 3), (4, 4);
connection default;
# 1.2.2. PS mode
connection default;
-ALTER TABLE t1 ADD COLUMN a INT;
+ALTER TABLE t1 ADD COLUMN a INT, LOCK=SHARED;
# 2. test UNIONs
# 2.1. test altering of columns that multiupdate doesn't use
# 2.1.1. normal mode
diff --git a/mysql-test/main/lock_multi_bug38499.test b/mysql-test/main/lock_multi_bug38499.test
index c489712e..9122b453 100644
--- a/mysql-test/main/lock_multi_bug38499.test
+++ b/mysql-test/main/lock_multi_bug38499.test
@@ -36,8 +36,8 @@ while ($i) {
send UPDATE t1, (SELECT 1 FROM t2 t1i) d SET a = 0 WHERE 1=0;
--connection locker
- ALTER TABLE t1 ADD COLUMN (c INT);
- ALTER TABLE t1 DROP COLUMN c;
+ ALTER TABLE t1 ADD COLUMN (c INT), LOCK=SHARED;
+ ALTER TABLE t1 DROP COLUMN c, LOCK=SHARED;
--connection writer
--reap
@@ -56,8 +56,8 @@ while ($i) {
--send EXECUTE stmt
--connection locker
- ALTER TABLE t1 ADD COLUMN (c INT);
- ALTER TABLE t1 DROP COLUMN c;
+ ALTER TABLE t1 ADD COLUMN (c INT), LOCK=SHARED;
+ ALTER TABLE t1 DROP COLUMN c, LOCK=SHARED;
--connection writer
--reap
@@ -76,7 +76,7 @@ while ($i) {
--connection locker
--error 0,ER_DUP_FIELDNAME
- ALTER TABLE t1 ADD COLUMN a int(11) unsigned default NULL;
+ ALTER TABLE t1 ADD COLUMN a int(11) unsigned default NULL, LOCK=SHARED;
UPDATE t1 SET a=b;
--connection writer
@@ -84,7 +84,7 @@ while ($i) {
--connection locker
--error 0,ER_CANT_DROP_FIELD_OR_KEY
- ALTER TABLE t1 DROP COLUMN a;
+ ALTER TABLE t1 DROP COLUMN a, LOCK=SHARED;
--connection writer
--error 0,ER_BAD_FIELD_ERROR # unknown column error
@@ -101,7 +101,7 @@ while ($i) {
--connection locker
--error 0,ER_DUP_FIELDNAME
- ALTER TABLE t1 ADD COLUMN a INT;
+ ALTER TABLE t1 ADD COLUMN a INT, LOCK=SHARED;
UPDATE t1 SET a=b;
--connection writer
@@ -110,7 +110,7 @@ while ($i) {
--connection locker
--error 0,ER_CANT_DROP_FIELD_OR_KEY
- ALTER TABLE t1 DROP COLUMN a;
+ ALTER TABLE t1 DROP COLUMN a, LOCK=SHARED;
--connection writer
--error 0,ER_BAD_FIELD_ERROR # Unknown column 'a' in 'field list'
@@ -118,7 +118,7 @@ while ($i) {
}
--enable_query_log
--connection default
-ALTER TABLE t1 ADD COLUMN a INT;
+ALTER TABLE t1 ADD COLUMN a INT, LOCK=SHARED;
--echo # 2. test UNIONs
--echo # 2.1. test altering of columns that multiupdate doesn't use
@@ -133,8 +133,8 @@ while ($i) {
send UPDATE t1, ((SELECT 1 FROM t1 t1i) UNION (SELECT 2 FROM t1 t1ii)) e SET a = 0 WHERE 1=0;
--connection locker
- ALTER TABLE t1 ADD COLUMN (c INT);
- ALTER TABLE t1 DROP COLUMN c;
+ ALTER TABLE t1 ADD COLUMN (c INT), LOCK=SHARED;
+ ALTER TABLE t1 DROP COLUMN c, LOCK=SHARED;
--connection writer
--reap
@@ -153,8 +153,8 @@ while ($i) {
--send EXECUTE stmt
--connection locker
- ALTER TABLE t1 ADD COLUMN (c INT);
- ALTER TABLE t1 DROP COLUMN c;
+ ALTER TABLE t1 ADD COLUMN (c INT), LOCK=SHARED;
+ ALTER TABLE t1 DROP COLUMN c, LOCK=SHARED;
--connection writer
--reap
@@ -173,7 +173,7 @@ while ($i) {
--connection locker
--error 0,ER_DUP_FIELDNAME
- ALTER TABLE t1 ADD COLUMN a int(11) unsigned default NULL;
+ ALTER TABLE t1 ADD COLUMN a int(11) unsigned default NULL, LOCK=SHARED;
UPDATE t1 SET a=b;
--connection writer
@@ -181,7 +181,7 @@ while ($i) {
--connection locker
--error 0,ER_CANT_DROP_FIELD_OR_KEY
- ALTER TABLE t1 DROP COLUMN a;
+ ALTER TABLE t1 DROP COLUMN a, LOCK=SHARED;
--connection writer
--error 0,ER_BAD_FIELD_ERROR # Unknown column 'a' in 'field list'
@@ -198,7 +198,7 @@ while ($i) {
--connection locker
--error 0,ER_DUP_FIELDNAME
- ALTER TABLE t1 ADD COLUMN a INT;
+ ALTER TABLE t1 ADD COLUMN a INT, LOCK=SHARED;
UPDATE t1 SET a=b;
--connection writer
@@ -207,7 +207,7 @@ while ($i) {
--connection locker
--error 0,ER_CANT_DROP_FIELD_OR_KEY
- ALTER TABLE t1 DROP COLUMN a;
+ ALTER TABLE t1 DROP COLUMN a, LOCK=SHARED;
--connection writer
--error 0,ER_BAD_FIELD_ERROR # Unknown column 'a' in 'field list'
diff --git a/mysql-test/main/lock_multi_bug38691.test b/mysql-test/main/lock_multi_bug38691.test
index 9760c1a8..62ff3a5b 100644
--- a/mysql-test/main/lock_multi_bug38691.test
+++ b/mysql-test/main/lock_multi_bug38691.test
@@ -48,8 +48,8 @@ while ($i) {
SET a = NULL WHERE t1.b <> t2.b;
--connection locker
- ALTER TABLE t2 ADD COLUMN (c INT);
- ALTER TABLE t2 DROP COLUMN c;
+ ALTER TABLE t2 ADD COLUMN (c INT), LOCK=SHARED;
+ ALTER TABLE t2 DROP COLUMN c, LOCK=SHARED;
--connection writer
--reap
@@ -69,8 +69,8 @@ while ($i) {
--send EXECUTE stmt
--connection locker
- ALTER TABLE t2 ADD COLUMN (c INT);
- ALTER TABLE t2 DROP COLUMN c;
+ ALTER TABLE t2 ADD COLUMN (c INT), LOCK=SHARED;
+ ALTER TABLE t2 DROP COLUMN c, LOCK=SHARED;
--connection writer
--reap
@@ -91,7 +91,7 @@ while ($i) {
--connection locker
--error 0,ER_DUP_FIELDNAME
- ALTER TABLE t2 ADD COLUMN a int(11) unsigned default NULL;
+ ALTER TABLE t2 ADD COLUMN a int(11) unsigned default NULL, LOCK=SHARED;
UPDATE t2 SET a=b;
--connection writer
@@ -99,7 +99,7 @@ while ($i) {
--connection locker
--error 0,ER_CANT_DROP_FIELD_OR_KEY
- ALTER TABLE t2 DROP COLUMN a;
+ ALTER TABLE t2 DROP COLUMN a, LOCK=SHARED;
--connection writer
--error 0,ER_BAD_FIELD_ERROR
@@ -116,7 +116,7 @@ while ($i) {
--connection locker
--error 0,ER_DUP_FIELDNAME
- ALTER TABLE t2 ADD COLUMN a int(11) unsigned default NULL;
+ ALTER TABLE t2 ADD COLUMN a int(11) unsigned default NULL, LOCK=SHARED;
UPDATE t2 SET a=b;
--connection writer
@@ -125,7 +125,7 @@ while ($i) {
--connection locker
--error 0,ER_CANT_DROP_FIELD_OR_KEY
- ALTER TABLE t2 DROP COLUMN a;
+ ALTER TABLE t2 DROP COLUMN a, LOCK=SHARED;
--connection writer
--error 0,ER_BAD_FIELD_ERROR
diff --git a/mysql-test/main/lock_sync-master.opt b/mysql-test/main/lock_sync-master.opt
index a6700b8d..96f0ce3f 100644
--- a/mysql-test/main/lock_sync-master.opt
+++ b/mysql-test/main/lock_sync-master.opt
@@ -1,2 +1 @@
--default-storage-engine=MyISAM
---innodb-defragment=0
diff --git a/mysql-test/main/lock_sync.result b/mysql-test/main/lock_sync.result
index 6e665b35..69958811 100644
--- a/mysql-test/main/lock_sync.result
+++ b/mysql-test/main/lock_sync.result
@@ -45,8 +45,6 @@ declare j int;
select i from t1 where i = 1 into j;
return j;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create function f2() returns int
begin
declare k int;
@@ -54,8 +52,6 @@ select i from t1 where i = 1 into k;
insert into t2 values (k + 5);
return 0;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create function f3() returns int
begin
return (select i from t1 where i = 3);
@@ -79,16 +75,12 @@ declare k int;
select i from v1 where i = 1 into k;
return k;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create function f7() returns int
begin
declare k int;
select j from v2 where j = 1 into k;
return k;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create function f8() returns int
begin
declare k int;
@@ -96,8 +88,6 @@ select i from v1 where i = 1 into k;
insert into t2 values (k+5);
return k;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create function f9() returns int
begin
update v2 set j=j+10 where j=1;
@@ -127,8 +117,6 @@ create procedure p2(inout p int)
begin
select i from t1 where i = 1 into p;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create function f14() returns int
begin
declare k int;
@@ -156,8 +144,6 @@ select i from t1 where i = 1 into j;
call p3;
return 1;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create procedure p3()
begin
create temporary table if not exists temp1 (a int);
@@ -170,8 +156,6 @@ declare k int;
select i from t1 where i=1 into k;
set new.l= k+1;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create trigger t4_bu before update on t4 for each row
begin
if (select i from t1 where i=1) then
diff --git a/mysql-test/main/lock_sync.test b/mysql-test/main/lock_sync.test
index 998c6529..844d00d3 100644
--- a/mysql-test/main/lock_sync.test
+++ b/mysql-test/main/lock_sync.test
@@ -1084,7 +1084,7 @@ DROP TABLES t1, t2;
--echo # MDEV-28567 Assertion `0' in open_tables upon function-related operation
--echo #
# To get MDL trace run this case like this:
-# mtr --mysqld=--debug=d,mdl,query:i:o,/tmp/mdl.log ...
+# mtr --mysqld=--debug-dbug=d,mdl,query:i:o,/tmp/mdl.log ...
# Cleanup trace like this:
# sed -i -re '/(mysql|performance_schema|sys|mtr)\// d; /MDL_BACKUP_|MDL_INTENTION_/ d; /\/(t2|tr1|tr2)/ d' /tmp/mdl.log
diff --git a/mysql-test/main/locking_clause.result b/mysql-test/main/locking_clause.result
index d2ebfe47..8cfdfb91 100644
--- a/mysql-test/main/locking_clause.result
+++ b/mysql-test/main/locking_clause.result
@@ -149,16 +149,8 @@ DROP USER test2@localhost;
# MYSQL 8
#
SELECT 1 FROM DUAL LIMIT 1 INTO @var FOR UPDATE;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
SELECT 1 FROM DUAL LIMIT 1 FOR UPDATE INTO @var;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
SELECT 1 FROM DUAL LIMIT 1 INTO @var FOR UPDATE INTO @var;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO @var' at line 1
SELECT 1 UNION SELECT 1 FOR UPDATE INTO @var;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
SELECT 1 UNION SELECT 1 INTO @var FOR UPDATE;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
diff --git a/mysql-test/main/log_slow_debug.result b/mysql-test/main/log_slow_debug.result
index bc934c04..be825584 100644
--- a/mysql-test/main/log_slow_debug.result
+++ b/mysql-test/main/log_slow_debug.result
@@ -6,6 +6,8 @@ SET @@GLOBAL.log_output='TABLE';
FLUSH SLOW LOGS;
SET @@GLOBAL.slow_query_log=ON;
SET @@GLOBAL.log_slow_admin_statements=ON;
+Warnings:
+Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead
SET @saved_dbug = @@debug_dbug;
SET SESSION debug_dbug="+d,simulate_slow_query";
CREATE PROCEDURE show_slow_log()
@@ -19,6 +21,8 @@ $$
# Expect all admin statements in the slow log (ON,DEFAULT)
#
SET @@SESSION.log_slow_admin_statements=ON;
+Warnings:
+Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead
SET log_slow_filter=DEFAULT;
TRUNCATE TABLE mysql.slow_log;
CREATE TABLE t1 (a INT);
@@ -66,6 +70,8 @@ sql_text
# Expect all admin statements in the slow log (ON,admin)
#
SET @@SESSION.log_slow_admin_statements=ON;
+Warnings:
+Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead
SET log_slow_filter=admin;
TRUNCATE TABLE mysql.slow_log;
CREATE TABLE t1 (a INT);
@@ -100,6 +106,8 @@ sql_text
# Expect none of admin DDL statements in the slow log (ON,filesort)
#
SET @@SESSION.log_slow_admin_statements=ON;
+Warnings:
+Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead
SET log_slow_filter=filesort;
TRUNCATE TABLE mysql.slow_log;
CREATE TABLE t1 (a INT);
@@ -127,6 +135,8 @@ sql_text
# Expect none of admin statements in the slow log (OFF,DEFAULT)
#
SET @@SESSION.log_slow_admin_statements=OFF;
+Warnings:
+Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead
SET log_slow_filter=DEFAULT;
TRUNCATE TABLE mysql.slow_log;
CREATE TABLE t1 (a INT);
@@ -171,7 +181,11 @@ sql_text
# prevent enabling globally suppressed logging by setting the session variable to ON.
#
SET @@GLOBAL.log_slow_admin_statements=OFF;
+Warnings:
+Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead
SET @@SESSION.log_slow_admin_statements=ON;
+Warnings:
+Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead
SET log_slow_filter=DEFAULT;
TRUNCATE TABLE mysql.slow_log;
CREATE TABLE t1 (a INT);
@@ -311,4 +325,6 @@ TRUNCATE mysql.slow_log;
SET @@global.slow_query_log= @org_slow_query_log;
SET @@global.log_output= @org_log_output;
SET @@global.log_slow_admin_statements= @org_log_slow_admin_statements;
+Warnings:
+Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead
DROP PROCEDURE show_slow_log;
diff --git a/mysql-test/main/log_state.result b/mysql-test/main/log_state.result
index 5e7aac81..18c8da70 100644
--- a/mysql-test/main/log_state.result
+++ b/mysql-test/main/log_state.result
@@ -243,7 +243,7 @@ rows_examined sql_text
4 UPDATE t1 SET a=a+sleep(.02) WHERE a>2
8 UPDATE t1 SET a=a+sleep(.02) ORDER BY a DESC
1 UPDATE t2 set b=b+sleep(.02) limit 1
-4 UPDATE t1 SET a=a+sleep(.02) WHERE a in (SELECT b from t2)
+6 UPDATE t1 SET a=a+sleep(.02) WHERE a in (SELECT b from t2)
6 DELETE FROM t1 WHERE a=a+sleep(.02) ORDER BY a LIMIT 2
disconnect con2;
connection default;
diff --git a/mysql-test/main/log_tables_upgrade.result b/mysql-test/main/log_tables_upgrade.result
index 1f8f4782..2d36e4fb 100644
--- a/mysql-test/main/log_tables_upgrade.result
+++ b/mysql-test/main/log_tables_upgrade.result
@@ -68,6 +68,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
diff --git a/mysql-test/main/log_tables_upgrade.test b/mysql-test/main/log_tables_upgrade.test
index 36802fb3..0b69c062 100644
--- a/mysql-test/main/log_tables_upgrade.test
+++ b/mysql-test/main/log_tables_upgrade.test
@@ -24,5 +24,5 @@ RENAME TABLE test.bug49823 TO general_log;
DROP TABLE general_log;
RENAME TABLE renamed_general_log TO general_log;
SET GLOBAL general_log = @saved_general_log;
-remove_file $MYSQLD_DATADIR/mysql_upgrade_info;
+remove_file $MYSQLD_DATADIR/mariadb_upgrade_info;
USE test;
diff --git a/mysql-test/main/long_unique.result b/mysql-test/main/long_unique.result
index 7f8110a2..664c9e82 100644
--- a/mysql-test/main/long_unique.result
+++ b/mysql-test/main/long_unique.result
@@ -1195,20 +1195,20 @@ ERROR 42S22: Unknown column 'DB_ROW_HASH_1' in 'IN/ALL/ANY subquery'
select DB_ROW_HASH_1, DB_ROW_HASH_2 from t1,t2 where DB_ROW_HASH_1 in (select DB_ROW_HASH_1 from t2);
DB_ROW_HASH_1 DB_ROW_HASH_2
11 1
-22 2
-33 3
-44 4
11 1
-22 2
-33 3
-44 4
11 1
-22 2
-33 3
-44 4
11 1
22 2
+22 2
+22 2
+22 2
+33 3
+33 3
33 3
+33 3
+44 4
+44 4
+44 4
44 4
select * from t2 where DB_ROW_HASH_1 in (select DB_ROW_HASH_1 from t1);
DB_ROW_HASH_1 DB_ROW_HASH_2
diff --git a/mysql-test/main/long_unique.test b/mysql-test/main/long_unique.test
index fa49b6a5..3203675a 100644
--- a/mysql-test/main/long_unique.test
+++ b/mysql-test/main/long_unique.test
@@ -389,6 +389,7 @@ select DB_ROW_HASH_1, DB_ROW_HASH_2 from t1;
select DB_ROW_HASH_1, DB_ROW_HASH_2 from t1,t2;
--error ER_BAD_FIELD_ERROR
select * from t1 where DB_ROW_HASH_1 in (select DB_ROW_HASH_1 from t2);
+--sorted_result
select DB_ROW_HASH_1, DB_ROW_HASH_2 from t1,t2 where DB_ROW_HASH_1 in (select DB_ROW_HASH_1 from t2);
select * from t2 where DB_ROW_HASH_1 in (select DB_ROW_HASH_1 from t1);
--error ER_BAD_FIELD_ERROR
diff --git a/mysql-test/main/lowercase_fs_off.result b/mysql-test/main/lowercase_fs_off.result
index f59470ae..40e608fa 100644
--- a/mysql-test/main/lowercase_fs_off.result
+++ b/mysql-test/main/lowercase_fs_off.result
@@ -159,6 +159,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
@@ -271,3 +272,26 @@ CREATE TABLE t1 (a Mariadb_schema.date);
ERROR HY000: Unknown data type: 'Mariadb_schema.date'
CREATE TABLE t1 (a mariadb_schema.date);
DROP TABLE t1;
+# End of 10.3 tests
+#
+# MDEV-32973 SHOW TABLES LIKE shows temporary tables with non-matching names
+#
+create temporary table t1 (a int);
+create temporary table t2 (a int);
+create temporary table T1 (a int);
+show tables like 't1';
+Tables_in_test (t1)
+t1
+select table_name from information_schema.tables where table_schema='test'
+ and table_name='t1';
+table_name
+t1
+show tables like '_1';
+Tables_in_test (_1)
+T1
+t1
+show tables like 't%';
+Tables_in_test (t%)
+t2
+t1
+# End of 11.2 tests
diff --git a/mysql-test/main/lowercase_fs_off.test b/mysql-test/main/lowercase_fs_off.test
index ab46d2ac..4bff916d 100644
--- a/mysql-test/main/lowercase_fs_off.test
+++ b/mysql-test/main/lowercase_fs_off.test
@@ -128,7 +128,7 @@ show triggers like '%T1%';
drop table t1;
let $datadir= `select @@datadir`;
-remove_file $datadir/mysql_upgrade_info;
+remove_file $datadir/mariadb_upgrade_info;
set GLOBAL sql_mode=default;
@@ -146,3 +146,19 @@ CREATE TABLE t1 (a Mariadb_schema.date);
CREATE TABLE t1 (a mariadb_schema.date);
DROP TABLE t1;
+
+--echo # End of 10.3 tests
+
+--echo #
+--echo # MDEV-32973 SHOW TABLES LIKE shows temporary tables with non-matching names
+--echo #
+create temporary table t1 (a int);
+create temporary table t2 (a int);
+create temporary table T1 (a int);
+show tables like 't1';
+select table_name from information_schema.tables where table_schema='test'
+ and table_name='t1';
+show tables like '_1';
+show tables like 't%';
+
+--echo # End of 11.2 tests
diff --git a/mysql-test/main/lowercase_table.result b/mysql-test/main/lowercase_table.result
index 49468793..ff0d0f81 100644
--- a/mysql-test/main/lowercase_table.result
+++ b/mysql-test/main/lowercase_table.result
@@ -164,3 +164,30 @@ delete from mysql.proc where name = '';
#
# End of 10.3 tests
#
+#
+# Start of 11.3 tests
+#
+#
+# MDEV-31948 Add class DBNameBuffer, split check_db_name() into stages
+#
+SET NAMES utf8;
+SET @mb3char= _utf8 0xEFBFAD;
+EXECUTE IMMEDIATE CONCAT('use `', REPEAT(@mb3char, 64), '`');
+ERROR 42000: Unknown database 'ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­'
+EXECUTE IMMEDIATE CONCAT('use `#mysql50#', REPEAT(@mb3char, 64), '`');
+ERROR 42000: Unknown database '#mysql50#ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­'
+EXECUTE IMMEDIATE CONCAT('SHOW CREATE DATABASE `', REPEAT(@mb3char, 64), '`');
+ERROR 42000: Unknown database 'ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­'
+EXECUTE IMMEDIATE CONCAT('SHOW CREATE DATABASE `#mysql50#', REPEAT(@mb3char, 64), '`');
+ERROR 42000: Unknown database '#mysql50#ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­'
+EXECUTE IMMEDIATE CONCAT('use `', REPEAT(@mb3char, 65), '`');
+ERROR 42000: Incorrect database name 'ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­...'
+EXECUTE IMMEDIATE CONCAT('use `#mysql50#', REPEAT(@mb3char, 65), '`');
+ERROR 42000: Incorrect database name '#mysql50#ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­...'
+EXECUTE IMMEDIATE CONCAT('SHOW CREATE DATABASE `', REPEAT(@mb3char, 65), '`');
+ERROR 42000: Incorrect database name 'ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­...'
+EXECUTE IMMEDIATE CONCAT('SHOW CREATE DATABASE `#mysql50#', REPEAT(@mb3char, 65), '`');
+ERROR 42000: Incorrect database name '#mysql50#ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­ï¿­...'
+#
+# End of 11.3 tests
+#
diff --git a/mysql-test/main/lowercase_table.test b/mysql-test/main/lowercase_table.test
index 8d493fff..24998906 100644
--- a/mysql-test/main/lowercase_table.test
+++ b/mysql-test/main/lowercase_table.test
@@ -142,3 +142,43 @@ delete from mysql.proc where name = '';
--echo #
--echo # End of 10.3 tests
--echo #
+
+--echo #
+--echo # Start of 11.3 tests
+--echo #
+
+--echo #
+--echo # MDEV-31948 Add class DBNameBuffer, split check_db_name() into stages
+--echo #
+
+SET NAMES utf8;
+
+# U+FFED HALFWIDTH BLACK SQUARE
+SET @mb3char= _utf8 0xEFBFAD;
+
+# Database names fitting into the NAME_CHAR_LEN characters limit
+
+--error ER_BAD_DB_ERROR
+EXECUTE IMMEDIATE CONCAT('use `', REPEAT(@mb3char, 64), '`');
+--error ER_BAD_DB_ERROR
+EXECUTE IMMEDIATE CONCAT('use `#mysql50#', REPEAT(@mb3char, 64), '`');
+--error ER_BAD_DB_ERROR
+EXECUTE IMMEDIATE CONCAT('SHOW CREATE DATABASE `', REPEAT(@mb3char, 64), '`');
+--error ER_BAD_DB_ERROR
+EXECUTE IMMEDIATE CONCAT('SHOW CREATE DATABASE `#mysql50#', REPEAT(@mb3char, 64), '`');
+
+
+# Database names longer than NAME_CHAR_LEN characters
+
+--error ER_WRONG_DB_NAME
+EXECUTE IMMEDIATE CONCAT('use `', REPEAT(@mb3char, 65), '`');
+--error ER_WRONG_DB_NAME
+EXECUTE IMMEDIATE CONCAT('use `#mysql50#', REPEAT(@mb3char, 65), '`');
+--error ER_WRONG_DB_NAME
+EXECUTE IMMEDIATE CONCAT('SHOW CREATE DATABASE `', REPEAT(@mb3char, 65), '`');
+--error ER_WRONG_DB_NAME
+EXECUTE IMMEDIATE CONCAT('SHOW CREATE DATABASE `#mysql50#', REPEAT(@mb3char, 65), '`');
+
+--echo #
+--echo # End of 11.3 tests
+--echo #
diff --git a/mysql-test/main/lowercase_table2.result b/mysql-test/main/lowercase_table2.result
index 3a4c46eb..e062edd0 100644
--- a/mysql-test/main/lowercase_table2.result
+++ b/mysql-test/main/lowercase_table2.result
@@ -377,3 +377,81 @@ SHOW CREATE DATABASE db1;
Database Create Database
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci */
DROP DATABASE Db1;
+USE test;
+# End of 10.4 tests
+#
+# MDEV-32973 SHOW TABLES LIKE shows temporary tables with non-matching names
+#
+create temporary table t2 (a int);
+create temporary table T1 (a int);
+show tables;
+Tables_in_test
+t1
+t2
+show tables like 't1';
+Tables_in_test (t1)
+t1
+show tables like 'T1';
+Tables_in_test (T1)
+t1
+select table_name from information_schema.tables where table_schema='test'
+ and table_name='t1';
+table_name
+t1
+select table_name from information_schema.tables where table_schema='test'
+ and table_name='T1';
+table_name
+t1
+show tables like '_1';
+Tables_in_test (_1)
+t1
+show tables like 't%';
+Tables_in_test (t%)
+t1
+t2
+# End of 11.2 tests
+#
+# MDEV-32026 lowercase_table2.test failures in 11.3
+#
+CREATE DATABASE Db1;
+SHOW CREATE DATABASE Db1;
+Database Create Database
+Db1 CREATE DATABASE `Db1` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */
+USE Db1;
+SELECT DATABASE();
+DATABASE()
+Db1
+DROP DATABASE Db1;
+CREATE DATABASE Db1;
+CREATE FUNCTION Db1.f1() RETURNS INT RETURN 10;
+CREATE FUNCTION db1.f2() RETURNS INT RETURN 10;
+SELECT db, name FROM mysql.proc WHERE name LIKE '^f[12]';
+db name
+SELECT Db1.f1();
+Db1.f1()
+10
+SELECT db1.f2();
+db1.f2()
+10
+DROP DATABASE Db1;
+#
+# MDEV-32025 Crashes in MDL_key::mdl_key_init with lower-case-table-names=2
+#
+CREATE DATABASE `#mysql50#D+b1`;
+ALTER DATABASE `#mysql50#D+b1` UPGRADE DATA DIRECTORY NAME;
+SHOW CREATE DATABASE `D+b1`;
+Database Create Database
+D+b1 CREATE DATABASE `D+b1` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */
+SHOW CREATE DATABASE `d+b1`;
+Database Create Database
+d+b1 CREATE DATABASE `d+b1` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */
+DROP DATABASE `D+b1`;
+CREATE DATABASE Db1;
+ALTER DATABASE Db1 DEFAULT CHARACTER SET utf8;
+SHOW CREATE DATABASE Db1;
+Database Create Database
+Db1 CREATE DATABASE `Db1` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci */
+SHOW CREATE DATABASE db1;
+Database Create Database
+db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci */
+DROP DATABASE Db1;
diff --git a/mysql-test/main/lowercase_table2.test b/mysql-test/main/lowercase_table2.test
index 5d595e96..99ba73fe 100644
--- a/mysql-test/main/lowercase_table2.test
+++ b/mysql-test/main/lowercase_table2.test
@@ -328,3 +328,59 @@ ALTER DATABASE Db1 DEFAULT CHARACTER SET utf8;
SHOW CREATE DATABASE Db1;
SHOW CREATE DATABASE db1;
DROP DATABASE Db1;
+USE test;
+
+--echo # End of 10.4 tests
+
+--echo #
+--echo # MDEV-32973 SHOW TABLES LIKE shows temporary tables with non-matching names
+--echo #
+# temp tables don't preserve the letter case despite lower-case-table-names=2
+create temporary table t2 (a int);
+create temporary table T1 (a int);
+show tables;
+show tables like 't1';
+show tables like 'T1';
+select table_name from information_schema.tables where table_schema='test'
+ and table_name='t1';
+select table_name from information_schema.tables where table_schema='test'
+ and table_name='T1';
+show tables like '_1';
+show tables like 't%';
+
+--echo # End of 11.2 tests
+
+--echo #
+--echo # MDEV-32026 lowercase_table2.test failures in 11.3
+--echo #
+
+CREATE DATABASE Db1;
+SHOW CREATE DATABASE Db1;
+USE Db1;
+SELECT DATABASE();
+DROP DATABASE Db1;
+
+CREATE DATABASE Db1;
+CREATE FUNCTION Db1.f1() RETURNS INT RETURN 10;
+CREATE FUNCTION db1.f2() RETURNS INT RETURN 10;
+SELECT db, name FROM mysql.proc WHERE name LIKE '^f[12]';
+SELECT Db1.f1();
+SELECT db1.f2();
+DROP DATABASE Db1;
+
+
+--echo #
+--echo # MDEV-32025 Crashes in MDL_key::mdl_key_init with lower-case-table-names=2
+--echo #
+
+CREATE DATABASE `#mysql50#D+b1`;
+ALTER DATABASE `#mysql50#D+b1` UPGRADE DATA DIRECTORY NAME;
+SHOW CREATE DATABASE `D+b1`;
+SHOW CREATE DATABASE `d+b1`;
+DROP DATABASE `D+b1`;
+
+CREATE DATABASE Db1;
+ALTER DATABASE Db1 DEFAULT CHARACTER SET utf8;
+SHOW CREATE DATABASE Db1;
+SHOW CREATE DATABASE db1;
+DROP DATABASE Db1;
diff --git a/mysql-test/main/lowercase_table4.result b/mysql-test/main/lowercase_table4.result
index 72c2e9eb..11c5ff2b 100644..100755
--- a/mysql-test/main/lowercase_table4.result
+++ b/mysql-test/main/lowercase_table4.result
@@ -30,7 +30,7 @@ Create Table CREATE TABLE `Table2` (
PRIMARY KEY (`c1`),
KEY `fk1` (`c2`),
CONSTRAINT `fk1` FOREIGN KEY (`c2`) REFERENCES `Table1` (`c1`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS WHERE CONSTRAINT_SCHEMA='test';
CONSTRAINT_CATALOG def
CONSTRAINT_SCHEMA test
@@ -75,7 +75,7 @@ Create Table CREATE TABLE `Product_Order` (
KEY `Customer_Id` (`Customer_Id`),
CONSTRAINT `product_order_ibfk_1` FOREIGN KEY (`Product_Category`, `Product_Id`) REFERENCES `Product` (`Category`, `Id`) ON UPDATE CASCADE,
CONSTRAINT `product_order_ibfk_2` FOREIGN KEY (`Customer_Id`) REFERENCES `Customer` (`Id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
SHOW CREATE TABLE Product;
Table Product
Create Table CREATE TABLE `Product` (
@@ -83,13 +83,13 @@ Create Table CREATE TABLE `Product` (
`Id` int(11) NOT NULL,
`Price` decimal(10,0) DEFAULT NULL,
PRIMARY KEY (`Category`,`Id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
SHOW CREATE TABLE Customer;
Table Customer
Create Table CREATE TABLE `Customer` (
`Id` int(11) NOT NULL,
PRIMARY KEY (`Id`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS WHERE CONSTRAINT_SCHEMA='test';
CONSTRAINT_CATALOG def
CONSTRAINT_SCHEMA test
diff --git a/mysql-test/main/lowercase_table_grant.result b/mysql-test/main/lowercase_table_grant.result
index 45b6ab04..0d84eb15 100644
--- a/mysql-test/main/lowercase_table_grant.result
+++ b/mysql-test/main/lowercase_table_grant.result
@@ -7,8 +7,8 @@ Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
GRANT ALL PRIVILEGES ON `mysqltest`.* TO `mysqltest_1`@`localhost`
select * from db where user = 'mysqltest_1';
-Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Execute_priv Event_priv Trigger_priv Delete_history_priv
-localhost mysqltest mysqltest_1 Y Y Y Y Y Y N Y Y Y Y Y Y Y Y Y Y Y Y Y
+Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Execute_priv Event_priv Trigger_priv Delete_history_priv Show_create_routine_priv
+localhost mysqltest mysqltest_1 Y Y Y Y Y Y N Y Y Y Y Y Y Y Y Y Y Y Y Y Y
update db set db = 'MYSQLtest' where db = 'mysqltest' and user = 'mysqltest_1' and host = 'localhost';
flush privileges;
show grants for mysqltest_1@localhost;
@@ -16,8 +16,8 @@ Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
GRANT ALL PRIVILEGES ON `mysqltest`.* TO `mysqltest_1`@`localhost`
select * from db where user = 'mysqltest_1';
-Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Execute_priv Event_priv Trigger_priv Delete_history_priv
-localhost MYSQLtest mysqltest_1 Y Y Y Y Y Y N Y Y Y Y Y Y Y Y Y Y Y Y Y
+Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Execute_priv Event_priv Trigger_priv Delete_history_priv Show_create_routine_priv
+localhost MYSQLtest mysqltest_1 Y Y Y Y Y Y N Y Y Y Y Y Y Y Y Y Y Y Y Y Y
delete from db where db = 'MYSQLtest' and user = 'mysqltest_1' and host = 'localhost';
flush privileges;
drop user mysqltest_1@localhost;
diff --git a/mysql-test/main/mariadb-dump-debug.result b/mysql-test/main/mariadb-dump-debug.result
new file mode 100644
index 00000000..a02e224e
--- /dev/null
+++ b/mysql-test/main/mariadb-dump-debug.result
@@ -0,0 +1,4 @@
+set @save_debug_dbug=@@global.debug_dbug;
+set global debug_dbug='+d,select_export_kill';
+mariadb-dump: Couldn't execute async query 'SELECT /*!40001 SQL_NO_CACHE */ `Host`, `User`, `Priv` INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/global_priv.txt' /*!50138 CHARACTER SET binary */ FROM `mysql`.`global_priv`' (Query execution was interrupted)
+set global debug_dbug=@save_debug_dbug;
diff --git a/mysql-test/main/mariadb-dump-debug.test b/mysql-test/main/mariadb-dump-debug.test
new file mode 100644
index 00000000..a762a072
--- /dev/null
+++ b/mysql-test/main/mariadb-dump-debug.test
@@ -0,0 +1,15 @@
+--source include/have_debug.inc
+--source include/not_embedded.inc
+# need to dump "mysql" schema
+--source include/have_innodb.inc
+
+# inject error on SELECT INTO OUTFILE
+set @save_debug_dbug=@@global.debug_dbug;
+set global debug_dbug='+d,select_export_kill';
+# This one succeeds
+--replace_result .\exe '' $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--error 2
+--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ --parallel=2 mysql global_priv 2>&1
+
+set global debug_dbug=@save_debug_dbug;
+
diff --git a/mysql-test/main/mdev-25830.result b/mysql-test/main/mdev-25830.result
index e62d1ff3..6de3e583 100644
--- a/mysql-test/main/mdev-25830.result
+++ b/mysql-test/main/mdev-25830.result
@@ -25,8 +25,8 @@ ORDER BY sysapproval_approver0.`order`
LIMIT 0, 50 ;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE task2 range PRIMARY,sys_class_name_2,sys_domain_path PRIMARY 96 NULL 1 0.00 100.00 100.00 Using where; Using temporary; Using filesort
-1 SIMPLE task1 ref PRIMARY,task_parent,sys_class_name_2,sys_domain_path task_parent 99 test.task2.sys_id 1 NULL 100.00 NULL Using index condition; Using where
-1 SIMPLE sysapproval_approver0 ref sysapproval_approver_ref5,sys_domain_path,sysapproval_approver_CHG1975376 sysapproval_approver_ref5 99 test.task1.sys_id 1 NULL 100.00 NULL Using index condition; Using where
+1 SIMPLE task1 ref PRIMARY,task_parent,sys_class_name_2,sys_domain_path task_parent 99 test.task2.sys_id 2 NULL 100.00 NULL Using index condition; Using where
+1 SIMPLE sysapproval_approver0 ref sysapproval_approver_ref5,sys_domain_path,sysapproval_approver_CHG1975376 sysapproval_approver_ref5 99 test.task1.sys_id 3 NULL 100.00 NULL Using index condition; Using where
set optimizer_use_condition_selectivity=4;
analyze SELECT sysapproval_approver0.`sys_id`
FROM ((sysapproval_approver sysapproval_approver0
@@ -47,9 +47,9 @@ WHERE task2.`sys_id` LIKE '8e7792a7dbfffb00fff8a345ca961934%'
ORDER BY sysapproval_approver0.`order`
LIMIT 0, 50 ;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
-1 SIMPLE task2 range PRIMARY,sys_class_name_2,sys_domain_path PRIMARY 96 NULL 1 0.00 98.00 100.00 Using where; Using temporary; Using filesort
-1 SIMPLE task1 ref PRIMARY,task_parent,sys_class_name_2,sys_domain_path task_parent 99 test.task2.sys_id 1 NULL 100.00 NULL Using index condition; Using where
-1 SIMPLE sysapproval_approver0 ref sysapproval_approver_ref5,sys_domain_path,sysapproval_approver_CHG1975376 sysapproval_approver_ref5 99 test.task1.sys_id 1 NULL 100.00 NULL Using index condition; Using where
+1 SIMPLE task2 range PRIMARY,sys_class_name_2,sys_domain_path PRIMARY 96 NULL 1 0.00 100.00 100.00 Using where; Using temporary; Using filesort
+1 SIMPLE task1 ref PRIMARY,task_parent,sys_class_name_2,sys_domain_path task_parent 99 test.task2.sys_id 2 NULL 100.00 NULL Using index condition; Using where
+1 SIMPLE sysapproval_approver0 ref sysapproval_approver_ref5,sys_domain_path,sysapproval_approver_CHG1975376 sysapproval_approver_ref5 99 test.task1.sys_id 3 NULL 100.00 NULL Using index condition; Using where
drop table sysapproval_approver,task;
set global innodb_stats_persistent= @innodb_stats_persistent_save;
set global innodb_stats_persistent_sample_pages=
diff --git a/mysql-test/main/mdl_sync.result b/mysql-test/main/mdl_sync.result
index c6b80c50..bece98a6 100644
--- a/mysql-test/main/mdl_sync.result
+++ b/mysql-test/main/mdl_sync.result
@@ -954,7 +954,7 @@ insert into t1 values (1);
connection default;
# Add pending SNW lock.
# Sending:
-alter table t1 add primary key (c1);;
+alter table t1 add primary key (c1), lock=shared;;
#
connection mdl_con1;
# Check that ALTER TABLE is waiting with pending SNW lock.
@@ -1964,7 +1964,7 @@ create table t1 (i int);
# Ensure that ALTER waits once it has acquired SNW lock.
set debug_sync='alter_table_copy_after_lock_upgrade SIGNAL parked1 WAIT_FOR go1';
# Sending:
-alter table t1 add column j int;
+alter table t1 add column j int, lock=shared;
#
connection deadlock_con1;
# Wait till ALTER acquires SNW lock and stops.
@@ -2330,7 +2330,7 @@ c1 c2 c3
#
connection con46273;
set debug_sync='alter_table_copy_after_lock_upgrade SIGNAL alter_table_locked WAIT_FOR alter_go';
-alter table t1 add column e int, rename to t2;;
+alter table t1 add column e int, rename to t2, lock=shared;;
#
connection default;
set debug_sync='now WAIT_FOR alter_table_locked';
@@ -2591,7 +2591,7 @@ connection default;
# table lock and get blocked on sync point.
set debug_sync= 'alter_table_copy_after_lock_upgrade SIGNAL parked WAIT_FOR go';
# Sending:
-alter table t1 add column j int;
+alter table t1 add column j int, lock=shared;
connection con1;
# Wait until ALTER TABLE gets blocked on a sync point.
set debug_sync= 'now WAIT_FOR parked';
diff --git a/mysql-test/main/mdl_sync.test b/mysql-test/main/mdl_sync.test
index 29d95460..aa3bd60e 100644
--- a/mysql-test/main/mdl_sync.test
+++ b/mysql-test/main/mdl_sync.test
@@ -1196,14 +1196,14 @@ insert into t1 values (1);
connection default;
--echo # Add pending SNW lock.
--echo # Sending:
---send alter table t1 add primary key (c1);
+--send alter table t1 add primary key (c1), lock=shared;
--echo #
connection mdl_con1;
--echo # Check that ALTER TABLE is waiting with pending SNW lock.
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = "Waiting for table metadata lock" and
- info = "alter table t1 add primary key (c1)";
+ info = "alter table t1 add primary key (c1), lock=shared";
--source include/wait_condition.inc
--echo # Check that S, SH and SR locks are compatible with pending SNW
handler t1 open t;
@@ -2431,7 +2431,7 @@ create table t1 (i int);
--echo # Ensure that ALTER waits once it has acquired SNW lock.
set debug_sync='alter_table_copy_after_lock_upgrade SIGNAL parked1 WAIT_FOR go1';
--echo # Sending:
---send alter table t1 add column j int
+--send alter table t1 add column j int, lock=shared
--echo #
connection deadlock_con1;
@@ -2986,7 +2986,7 @@ select * from t1 where c2 = 3;
--echo #
connection con46273;
set debug_sync='alter_table_copy_after_lock_upgrade SIGNAL alter_table_locked WAIT_FOR alter_go';
---send alter table t1 add column e int, rename to t2;
+--send alter table t1 add column e int, rename to t2, lock=shared;
--echo #
connection default;
@@ -3341,7 +3341,7 @@ connection default;
--echo # table lock and get blocked on sync point.
set debug_sync= 'alter_table_copy_after_lock_upgrade SIGNAL parked WAIT_FOR go';
--echo # Sending:
---send alter table t1 add column j int
+--send alter table t1 add column j int, lock=shared
connection con1;
--echo # Wait until ALTER TABLE gets blocked on a sync point.
diff --git a/mysql-test/main/metadata.result b/mysql-test/main/metadata.result
index 1dfe856d..3bd9dde4 100644
--- a/mysql-test/main/metadata.result
+++ b/mysql-test/main/metadata.result
@@ -146,7 +146,7 @@ id data data
2 female no
select t1.id from t1 union select t2.id from t2;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def id id 246 4 1 Y 32768 0 63
+def id id 246 4 1 Y 49152 0 63
id
1
2
@@ -157,7 +157,7 @@ insert into t1 values (2,'two');
set @arg00=1 ;
select @arg00 FROM t1 where a=1 union distinct select 1 FROM t1 where a=1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @arg00 @arg00 8 20 1 Y 32768 0 63
+def @arg00 @arg00 8 20 1 Y 49152 0 63
@arg00
1
select * from (select @arg00) aaa;
@@ -167,12 +167,12 @@ def aaa @arg00 @arg00 8 20 1 Y 32768 0 63
1
select 1 union select 1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def 1 1 3 1 1 N 32769 0 63
+def 1 1 3 1 1 N 49153 0 63
1
1
select * from (select 1 union select 1) aaa;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def aaa 1 1 3 1 1 N 32769 0 63
+def aaa 1 1 3 1 1 N 49153 0 63
1
1
drop table t1;
diff --git a/mysql-test/main/mix2_myisam.result b/mysql-test/main/mix2_myisam.result
index 842d5bcf..1044704c 100644
--- a/mysql-test/main/mix2_myisam.result
+++ b/mysql-test/main/mix2_myisam.result
@@ -905,8 +905,8 @@ drop table t1,t2;
create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=MyISAM;
BEGIN;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
-SELECT @@tx_isolation,@@global.tx_isolation;
-@@tx_isolation @@global.tx_isolation
+SELECT @@transaction_isolation,@@global.transaction_isolation;
+@@transaction_isolation @@global.transaction_isolation
SERIALIZABLE REPEATABLE-READ
insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David');
select id, code, name from t1 order by id;
diff --git a/mysql-test/main/mrr_derived_crash_4610.result b/mysql-test/main/mrr_derived_crash_4610.result
index 3e38a0d4..d7800e8a 100644
--- a/mysql-test/main/mrr_derived_crash_4610.result
+++ b/mysql-test/main/mrr_derived_crash_4610.result
@@ -7,7 +7,7 @@ explain select 1 from
(select f2, f3, val, count(id) from t4 join t2 left join t3 on 0) top
join t1 on f1 = f3 where f3 = 'aaaa' order by val;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 const PRIMARY PRIMARY 12 const 1 Using index
+1 PRIMARY t1 const PRIMARY PRIMARY 12 const 1
1 PRIMARY <derived2> ref key0 key0 13 const 0 Using where; Using filesort
2 DERIVED t4 ALL NULL NULL NULL NULL 1
2 DERIVED t2 ALL NULL NULL NULL NULL 1 Using join buffer (flat, BNL join)
diff --git a/mysql-test/main/multi_update.result b/mysql-test/main/multi_update.result
index 5d62e153..1a87ec16 100644
--- a/mysql-test/main/multi_update.result
+++ b/mysql-test/main/multi_update.result
@@ -441,12 +441,10 @@ create table t1 (col1 int);
create table t2 (col1 int);
update t1,t2 set t1.col1 = (select max(col1) from t1) where t1.col1 = t2.col1;
delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2.col1;
-ERROR HY000: Table 't1' is specified twice, both as a target for 'DELETE' and as a separate source for data
drop table t1,t2;
create table t1(a int);
create table t2(a int);
delete from t1,t2 using t1,t2 where t1.a=(select a from t1);
-ERROR HY000: Table 't1' is specified twice, both as a target for 'DELETE' and as a separate source for data
drop table t1, t2;
create table t1 (a int, b int);
insert into t1 values (1, 2), (2, 3), (3, 4);
@@ -1304,27 +1302,24 @@ t1.c1 > 1 and
exists (select 'X' from t2 where t2.c1 = t1.c1 and t2.c2 > 4);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL idx NULL NULL NULL 8 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+1 PRIMARY t2 range idx idx 5 NULL 3 Using index condition; Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
1 PRIMARY t3 ref idx idx 5 test.t1.c2 3
-2 MATERIALIZED t2 range idx idx 5 NULL 3 Using index condition; Using where
explain delete from t1 using t1,t3
where t1.c2 = t3.c2 and
t1.c1 > 1 and
exists (select 'X' from t2 where t2.c1 = t1.c1 and t2.c2 > 4);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL idx NULL NULL NULL 8 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+1 PRIMARY t2 range idx idx 5 NULL 3 Using where; FirstMatch(t1)
1 PRIMARY t3 ref idx idx 5 test.t1.c2 3 Using index
-2 MATERIALIZED t2 range idx idx 5 NULL 3 Using where
explain update t1,t3 set t1.c1 = t1.c1+10
where t1.c2 = t3.c2 and
t1.c1 > 1 and
exists (select 'X' from t2 where t2.c1 = t1.c1 and t2.c2 > 4);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL idx NULL NULL NULL 8 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+1 PRIMARY t2 range idx idx 5 NULL 3 Using where; FirstMatch(t1)
1 PRIMARY t3 ref idx idx 5 test.t1.c2 3 Using index
-2 MATERIALIZED t2 range idx idx 5 NULL 3 Using where
create table t as select * from t1;
select * from t1,t3
where t1.c2 = t3.c2 and
@@ -1389,3 +1384,279 @@ c1 c2 c3
12 5 8
drop table t1,t2,t3,t;
# End of 10.4 tests
+#
+# MDEV-31150: 2nd execution of multi-update with
+# mergeable derived table in WHERE
+#
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (3),(7),(1),(3);
+CREATE TABLE t2 (b int);
+INSERT INTO t2 VALUES (3),(4),(1);
+CREATE TABLE t3 (c int);
+INSERT INTO t3 VALUES (3),(4),(1),(5),(1);
+CREATE PROCEDURE restore_t1()
+BEGIN
+DELETE FROM t1;
+INSERT INTO t1 VALUES (3),(7),(1),(3);
+END|
+SELECT * FROM t1;
+a
+3
+7
+1
+3
+EXPLAIN UPDATE t1,t3 SET a = NULL
+WHERE a=c AND a IN (SELECT * FROM (SELECT b FROM t2) dt);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1)
+1 PRIMARY t3 ALL NULL NULL NULL NULL 5 Using where
+UPDATE t1,t3 SET a = NULL
+WHERE a=c AND a IN (SELECT * FROM (SELECT b FROM t2) dt);
+SELECT * FROM t1;
+a
+NULL
+7
+NULL
+NULL
+CALL restore_t1();
+PREPARE stmt FROM "UPDATE t1,t3 SET a = NULL
+WHERE a=c AND a IN (SELECT * FROM (SELECT b FROM t2) dt)";
+EXECUTE stmt;
+SELECT * FROM t1;
+a
+NULL
+7
+NULL
+NULL
+CALL restore_t1();
+EXECUTE stmt;
+SELECT * FROM t1;
+a
+NULL
+7
+NULL
+NULL
+CALL restore_t1();
+DEALLOCATE PREPARE stmt;
+CREATE PROCEDURE p1() UPDATE t1,t3 SET a = NULL
+WHERE a=c AND a IN (SELECT * FROM (SELECT b FROM t2) dt);
+SELECT * FROM t1;
+a
+3
+7
+1
+3
+CALL p1();
+SELECT * FROM t1;
+a
+NULL
+7
+NULL
+NULL
+CALL restore_t1();
+CALL p1();
+SELECT * FROM t1;
+a
+NULL
+7
+NULL
+NULL
+CALL restore_t1();
+DROP procedure p1;
+SELECT * FROM t1;
+a
+3
+7
+1
+3
+EXPLAIN UPDATE t1,t3 SET a = NULL
+WHERE a=c AND a IN (WITH cte AS (SELECT b FROM t2) SELECT * FROM cte);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1)
+1 PRIMARY t3 ALL NULL NULL NULL NULL 5 Using where
+UPDATE t1,t3 SET a = NULL
+WHERE a=c AND a IN (WITH cte AS (SELECT b FROM t2) SELECT * FROM cte);
+SELECT * FROM t1;
+a
+NULL
+7
+NULL
+NULL
+CALL restore_t1();
+PREPARE stmt FROM "UPDATE t1,t3 SET a = NULL
+WHERE a=c AND a IN (WITH cte AS (SELECT b FROM t2) SELECT * FROM cte)";
+EXECUTE stmt;
+SELECT * FROM t1;
+a
+NULL
+7
+NULL
+NULL
+CALL restore_t1();
+EXECUTE stmt;
+SELECT * FROM t1;
+a
+NULL
+7
+NULL
+NULL
+CALL restore_t1();
+DEALLOCATE PREPARE stmt;
+CREATE PROCEDURE p1() UPDATE t1,t3 SET a = NULL
+WHERE a=c AND a IN (WITH cte AS (SELECT b FROM t2) SELECT * FROM cte);
+SELECT * FROM t1;
+a
+3
+7
+1
+3
+CALL p1();
+SELECT * FROM t1;
+a
+NULL
+7
+NULL
+NULL
+CALL restore_t1();
+CALL p1();
+SELECT * FROM t1;
+a
+NULL
+7
+NULL
+NULL
+CALL restore_t1();
+DROP procedure p1;
+SELECT * FROM t1;
+a
+3
+7
+1
+3
+EXPLAIN UPDATE t1 SET a = NULL
+WHERE a IN (SELECT * FROM (SELECT b FROM t2) dt);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1)
+UPDATE t1 SET a = NULL
+WHERE a IN (SELECT * FROM (SELECT b FROM t2) dt);
+SELECT * FROM t1;
+a
+NULL
+7
+NULL
+NULL
+CALL restore_t1();
+PREPARE stmt FROM "UPDATE t1 SET a = NULL
+WHERE a IN (SELECT * FROM (SELECT b FROM t2) dt)";
+EXECUTE stmt;
+SELECT * FROM t1;
+a
+NULL
+7
+NULL
+NULL
+CALL restore_t1();
+EXECUTE stmt;
+SELECT * FROM t1;
+a
+NULL
+7
+NULL
+NULL
+CALL restore_t1();
+DEALLOCATE PREPARE stmt;
+CREATE PROCEDURE p1() UPDATE t1 SET a = NULL
+WHERE a IN (SELECT * FROM (SELECT b FROM t2) dt);
+SELECT * FROM t1;
+a
+3
+7
+1
+3
+CALL p1();
+SELECT * FROM t1;
+a
+NULL
+7
+NULL
+NULL
+CALL restore_t1();
+CALL p1();
+SELECT * FROM t1;
+a
+NULL
+7
+NULL
+NULL
+CALL restore_t1();
+DROP procedure p1;
+SELECT * FROM t1;
+a
+3
+7
+1
+3
+EXPLAIN UPDATE t1 SET a = NULL
+WHERE a IN (WITH cte AS (SELECT b FROM t2) SELECT * FROM cte);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1)
+UPDATE t1 SET a = NULL
+WHERE a IN (WITH cte AS (SELECT b FROM t2) SELECT * FROM cte);
+SELECT * FROM t1;
+a
+NULL
+7
+NULL
+NULL
+CALL restore_t1();
+PREPARE stmt FROM "UPDATE t1 SET a = NULL
+WHERE a IN (WITH cte AS (SELECT b FROM t2) SELECT * FROM cte)";
+EXECUTE stmt;
+SELECT * FROM t1;
+a
+NULL
+7
+NULL
+NULL
+CALL restore_t1();
+EXECUTE stmt;
+SELECT * FROM t1;
+a
+NULL
+7
+NULL
+NULL
+CALL restore_t1();
+DEALLOCATE PREPARE stmt;
+CREATE PROCEDURE p1() UPDATE t1 SET a = NULL
+WHERE a IN (WITH cte AS (SELECT b FROM t2) SELECT * FROM cte);
+SELECT * FROM t1;
+a
+3
+7
+1
+3
+CALL p1();
+SELECT * FROM t1;
+a
+NULL
+7
+NULL
+NULL
+CALL restore_t1();
+CALL p1();
+SELECT * FROM t1;
+a
+NULL
+7
+NULL
+NULL
+CALL restore_t1();
+DROP procedure p1;
+DROP TABLE t1,t2,t3;
+DROP PROCEDURE restore_t1;
+# End of 11.1 tests
diff --git a/mysql-test/main/multi_update.test b/mysql-test/main/multi_update.test
index 329394e8..c6247a21 100644
--- a/mysql-test/main/multi_update.test
+++ b/mysql-test/main/multi_update.test
@@ -391,7 +391,6 @@ drop table t1, t2, t3;
create table t1 (col1 int);
create table t2 (col1 int);
update t1,t2 set t1.col1 = (select max(col1) from t1) where t1.col1 = t2.col1;
--- error ER_UPDATE_TABLE_USED
delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2.col1;
drop table t1,t2;
@@ -400,7 +399,6 @@ drop table t1,t2;
#
create table t1(a int);
create table t2(a int);
---error ER_UPDATE_TABLE_USED
delete from t1,t2 using t1,t2 where t1.a=(select a from t1);
drop table t1, t2;
# End of 4.1 tests
@@ -1121,12 +1119,15 @@ INSERT INTO t1 (part,a,b) VALUES (0,0,0),(1,1,1),(2,2,2);
INSERT INTO t2 (part,a,b) VALUES (0,0,0),(1,1,1),(2,2,2);
--echo # Expecting partition "Current"
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON UPDATE t2 JOIN t1 USING(a) SET t2.part=3 WHERE t2.part=0 AND t1.part=0;
--echo # Expecting partition "Relevant"
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON UPDATE t2 JOIN t1 USING(a) SET t2.part=2 WHERE t2.part=1 AND t1.part=1;
--echo # Expecting partition "Archive"
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON UPDATE t2 JOIN t1 USING(a) SET t2.part=3 WHERE t2.part=2 AND t1.part=2;
DROP TABLES t1, t2;
@@ -1200,3 +1201,140 @@ select * from t1;
drop table t1,t2,t3,t;
--echo # End of 10.4 tests
+
+--echo #
+--echo # MDEV-31150: 2nd execution of multi-update with
+--echo # mergeable derived table in WHERE
+--echo #
+
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (3),(7),(1),(3);
+CREATE TABLE t2 (b int);
+INSERT INTO t2 VALUES (3),(4),(1);
+CREATE TABLE t3 (c int);
+INSERT INTO t3 VALUES (3),(4),(1),(5),(1);
+
+--delimiter |
+CREATE PROCEDURE restore_t1()
+BEGIN
+DELETE FROM t1;
+INSERT INTO t1 VALUES (3),(7),(1),(3);
+END|
+--delimiter ;
+
+let $q1=
+UPDATE t1,t3 SET a = NULL
+ WHERE a=c AND a IN (SELECT * FROM (SELECT b FROM t2) dt);
+
+SELECT * FROM t1;
+eval EXPLAIN $q1;
+eval $q1;
+SELECT * FROM t1;
+CALL restore_t1();
+eval PREPARE stmt FROM "$q1";
+EXECUTE stmt;
+SELECT * FROM t1;
+CALL restore_t1();
+EXECUTE stmt;
+SELECT * FROM t1;
+CALL restore_t1();
+DEALLOCATE PREPARE stmt;
+
+eval CREATE PROCEDURE p1() $q1;
+SELECT * FROM t1;
+CALL p1();
+SELECT * FROM t1;
+CALL restore_t1();
+CALL p1();
+SELECT * FROM t1;
+CALL restore_t1();
+DROP procedure p1;
+
+let $q2=
+UPDATE t1,t3 SET a = NULL
+ WHERE a=c AND a IN (WITH cte AS (SELECT b FROM t2) SELECT * FROM cte);
+
+SELECT * FROM t1;
+eval EXPLAIN $q2;
+eval $q2;
+SELECT * FROM t1;
+CALL restore_t1();
+eval PREPARE stmt FROM "$q2";
+EXECUTE stmt;
+SELECT * FROM t1;
+CALL restore_t1();
+EXECUTE stmt;
+SELECT * FROM t1;
+CALL restore_t1();
+DEALLOCATE PREPARE stmt;
+
+eval CREATE PROCEDURE p1() $q2;
+SELECT * FROM t1;
+CALL p1();
+SELECT * FROM t1;
+CALL restore_t1();
+CALL p1();
+SELECT * FROM t1;
+CALL restore_t1();
+DROP procedure p1;
+
+let $q3=
+UPDATE t1 SET a = NULL
+ WHERE a IN (SELECT * FROM (SELECT b FROM t2) dt);
+
+SELECT * FROM t1;
+eval EXPLAIN $q3;
+eval $q3;
+SELECT * FROM t1;
+CALL restore_t1();
+eval PREPARE stmt FROM "$q3";
+EXECUTE stmt;
+SELECT * FROM t1;
+CALL restore_t1();
+EXECUTE stmt;
+SELECT * FROM t1;
+CALL restore_t1();
+DEALLOCATE PREPARE stmt;
+
+eval CREATE PROCEDURE p1() $q3;
+SELECT * FROM t1;
+CALL p1();
+SELECT * FROM t1;
+CALL restore_t1();
+CALL p1();
+SELECT * FROM t1;
+CALL restore_t1();
+DROP procedure p1;
+
+let $q4=
+UPDATE t1 SET a = NULL
+ WHERE a IN (WITH cte AS (SELECT b FROM t2) SELECT * FROM cte);
+
+SELECT * FROM t1;
+eval EXPLAIN $q4;
+eval $q4;
+SELECT * FROM t1;
+CALL restore_t1();
+eval PREPARE stmt FROM "$q4";
+EXECUTE stmt;
+SELECT * FROM t1;
+CALL restore_t1();
+EXECUTE stmt;
+SELECT * FROM t1;
+CALL restore_t1();
+DEALLOCATE PREPARE stmt;
+
+eval CREATE PROCEDURE p1() $q4;
+SELECT * FROM t1;
+CALL p1();
+SELECT * FROM t1;
+CALL restore_t1();
+CALL p1();
+SELECT * FROM t1;
+CALL restore_t1();
+DROP procedure p1;
+
+DROP TABLE t1,t2,t3;
+DROP PROCEDURE restore_t1;
+
+--echo # End of 11.1 tests
diff --git a/mysql-test/main/multi_update_big.test b/mysql-test/main/multi_update_big.test
index d6fec704..d8a464f9 100644
--- a/mysql-test/main/multi_update_big.test
+++ b/mysql-test/main/multi_update_big.test
@@ -8,7 +8,7 @@
#
# If we are running with
# - Valgrind -> $VALGRIND_TEST <> 0
-# - debug tracing -> @@session.debug LIKE '%trace%'
+# - debug tracing -> @@session.debug_dbug LIKE '%trace%'
# the resource consumption (storage space needed, runtime) will be extreme.
# Therefore we require that the option "--big-test" is also set.
#
@@ -16,12 +16,12 @@
let $need_big= 0;
--disable_query_log
--error 0,ER_UNKNOWN_SYSTEM_VARIABLE
-SET @aux = @@session.debug;
+SET @aux = @@session.debug_dbug;
if (!$mysql_errno)
{
- # We have returncode 0 = the server system variable @@session.debug exists.
+ # We have returncode 0 = the server system variable @@session.debug_dbug exists.
# But we only need "--big-test" in case of tracing.
- if (`SELECT @@session.debug LIKE '%trace%'`)
+ if (`SELECT @@session.debug_dbug LIKE '%trace%'`)
{
let $need_big= 1;
}
diff --git a/mysql-test/main/myisam.result b/mysql-test/main/myisam.result
index 7d930f1a..dbe9a32a 100644
--- a/mysql-test/main/myisam.result
+++ b/mysql-test/main/myisam.result
@@ -347,11 +347,11 @@ t1 1 c_2 2 a A 5 NULL NULL BTREE NO
explain select * from t1,t2 where t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL a NULL NULL NULL 2
-1 SIMPLE t1 ALL a NULL NULL NULL 5 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 ref a a 4 test.t2.a 3
explain select * from t1,t2 force index(a) where t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL a NULL NULL NULL 2
-1 SIMPLE t1 ALL a NULL NULL NULL 5 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 ref a a 4 test.t2.a 3
explain select * from t1 force index(a),t2 force index(a) where t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL a NULL NULL NULL 2
@@ -387,10 +387,10 @@ t1 1 c_2 2 a A 5 NULL NULL BTREE NO
explain select * from t1,t2 force index(c) where t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 2
-1 SIMPLE t1 ALL a NULL NULL NULL 5 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 ref a a 4 test.t2.a 3
explain select * from t1 where a=0 or a=2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL a NULL NULL NULL 5 Using where
+1 SIMPLE t1 range a a 4 NULL 5 Using index condition
explain select * from t1 force index (a) where a=0 or a=2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 4 NULL 5 Using index condition
@@ -643,6 +643,13 @@ id select_type table type possible_keys key key_len ref rows Extra
select count(*) from t1 where a is null;
count(*)
2
+insert into t1 values (1,''), (2,'');
+explain select count(*) from t1 where a is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref idx idx 4 const 2 Using where
+set statement optimizer_scan_setup_cost= 0 for explain select count(*) from t1 where a is null;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL idx NULL NULL NULL 4 Using where
drop table t1;
create table t1 (c1 int, c2 varchar(4) not null default '',
key(c2(3))) default charset=utf8;
@@ -2531,6 +2538,7 @@ DROP TABLE t1, t2, t3;
#
# BUG#51307 - widespread corruption with partitions and insert...select
#
+call mtr.add_suppression("Enabling keys got errno 12 on test.t1, retrying");
CREATE TABLE t1(a CHAR(255), KEY(a));
SELECT * FROM t1, t1 AS a1;
a a
@@ -2806,3 +2814,44 @@ drop table t;
#
# End of 10.8 tests
#
+CREATE TABLE t1 (pk INT, a INT, PRIMARY KEY(pk), KEY(a)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,NULL),(2,NULL),(3,1),(4,5);
+SET @save_optimizer_switch= @@optimizer_switch;
+SET optimizer_switch='index_merge_sort_intersection=on';
+SELECT pk FROM t1 WHERE pk > 2 AND a IS NULL;
+pk
+SET @@optimizer_switch= @save_optimizer_switch;
+drop table t1;
+#
+# MDEV-30104 Server crashes in handler_rowid_filter_check upon ANALYZE TABLE
+#
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (b INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1),(2);
+CREATE TABLE t3 (c INT) ENGINE=MyISAM;
+INSERT INTO t3 VALUES (1),(2);
+CREATE TABLE t4 (pk INT, f CHAR(8), PRIMARY KEY(pk), KEY(f)) ENGINE=MyISAM;
+INSERT INTO t4 VALUES (1,'o'),(2,'x');
+ANALYZE TABLE t1, t2, t3, t4 PERSISTENT FOR ALL;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+test.t2 analyze status Engine-independent statistics collected
+test.t2 analyze status OK
+test.t3 analyze status Engine-independent statistics collected
+test.t3 analyze status OK
+test.t4 analyze status Engine-independent statistics collected
+test.t4 analyze status OK
+SELECT * FROM t1 LEFT JOIN (t2 JOIN t3 ON 1) ON 2 IN (SELECT pk FROM t4 WHERE f < 's');
+a b c
+1 NULL NULL
+2 NULL NULL
+ANALYZE TABLE t4 PERSISTENT FOR ALL;
+Table Op Msg_type Msg_text
+test.t4 analyze status Engine-independent statistics collected
+test.t4 analyze status Table is already up to date
+DROP TABLE t1, t2, t3, t4;
+#
+# End of 11.0 tests
+#
diff --git a/mysql-test/main/myisam.test b/mysql-test/main/myisam.test
index 538603c6..dbb54e71 100644
--- a/mysql-test/main/myisam.test
+++ b/mysql-test/main/myisam.test
@@ -590,6 +590,9 @@ create table t1 ( a tinytext, b char(1), index idx (a(1),b) );
insert into t1 values (null,''), (null,'');
explain select count(*) from t1 where a is null;
select count(*) from t1 where a is null;
+insert into t1 values (1,''), (2,'');
+explain select count(*) from t1 where a is null;
+set statement optimizer_scan_setup_cost= 0 for explain select count(*) from t1 where a is null;
drop table t1;
#
@@ -1673,6 +1676,9 @@ DROP TABLE t1, t2, t3;
--echo #
--echo # BUG#51307 - widespread corruption with partitions and insert...select
--echo #
+
+call mtr.add_suppression("Enabling keys got errno 12 on test.t1, retrying");
+
CREATE TABLE t1(a CHAR(255), KEY(a));
SELECT * FROM t1, t1 AS a1;
SET myisam_sort_buffer_size=4;
@@ -1907,3 +1913,38 @@ drop table t;
--echo #
--echo # End of 10.8 tests
--echo #
+
+CREATE TABLE t1 (pk INT, a INT, PRIMARY KEY(pk), KEY(a)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,NULL),(2,NULL),(3,1),(4,5);
+SET @save_optimizer_switch= @@optimizer_switch;
+SET optimizer_switch='index_merge_sort_intersection=on';
+SELECT pk FROM t1 WHERE pk > 2 AND a IS NULL;
+SET @@optimizer_switch= @save_optimizer_switch;
+drop table t1;
+
+--echo #
+--echo # MDEV-30104 Server crashes in handler_rowid_filter_check upon ANALYZE TABLE
+--echo #
+
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE TABLE t2 (b INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1),(2); # Optional, fails either way
+
+CREATE TABLE t3 (c INT) ENGINE=MyISAM;
+INSERT INTO t3 VALUES (1),(2); # Optional, fails either way
+
+CREATE TABLE t4 (pk INT, f CHAR(8), PRIMARY KEY(pk), KEY(f)) ENGINE=MyISAM;
+INSERT INTO t4 VALUES (1,'o'),(2,'x');
+
+ANALYZE TABLE t1, t2, t3, t4 PERSISTENT FOR ALL; # Optional, fails either way
+SELECT * FROM t1 LEFT JOIN (t2 JOIN t3 ON 1) ON 2 IN (SELECT pk FROM t4 WHERE f < 's');
+
+ANALYZE TABLE t4 PERSISTENT FOR ALL;
+
+DROP TABLE t1, t2, t3, t4;
+
+--echo #
+--echo # End of 11.0 tests
+--echo #
diff --git a/mysql-test/main/myisam_debug.result b/mysql-test/main/myisam_debug.result
index 10208a93..698a4529 100644
--- a/mysql-test/main/myisam_debug.result
+++ b/mysql-test/main/myisam_debug.result
@@ -23,8 +23,6 @@ SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE STATE = 'wait_in_enable_indexes' AND
INFO = "INSERT INTO t1(id) SELECT id FROM t2"
INTO @thread_id;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
KILL QUERY @thread_id;
CHECK TABLE t1;
Table Op Msg_type Msg_text
diff --git a/mysql-test/main/myisam_explain_non_select_all.result b/mysql-test/main/myisam_explain_non_select_all.result
index e28c2a0f..9741d641 100644
--- a/mysql-test/main/myisam_explain_non_select_all.result
+++ b/mysql-test/main/myisam_explain_non_select_all.result
@@ -7,8 +7,6 @@ INSERT INTO t1 VALUES (1), (2), (3);
# query: UPDATE t1 SET a = 10 WHERE a < 10
# select: SELECT * FROM t1 WHERE a < 10
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t1 SET a = 10 WHERE a < 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
@@ -32,8 +30,6 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` <
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 2
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 2
@@ -52,8 +48,6 @@ INSERT INTO t1 VALUES (1), (2), (3);
# query: DELETE FROM t1 WHERE a < 10
# select: SELECT * FROM t1 WHERE a < 10
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t1 WHERE a < 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
@@ -63,7 +57,7 @@ EXPLAIN EXTENDED DELETE FROM t1 WHERE a < 10;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
-Note 1003 delete from `test`.`t1` where `test`.`t1`.`a` < 10
+Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`a` < 10
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 2
@@ -77,8 +71,6 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` <
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 2
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 2
@@ -97,8 +89,6 @@ INSERT INTO t1 VALUES (1), (2), (3);
# query: DELETE FROM t1 USING t1 WHERE a = 1
# select: SELECT * FROM t1 WHERE a = 1
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t1 USING t1 WHERE a = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
@@ -122,8 +112,6 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` =
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 2
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 2
@@ -144,8 +132,6 @@ INSERT INTO t2 VALUES (1), (2), (3);
# query: UPDATE t1, t2 SET t1.a = 10 WHERE t1.a = 1
# select: SELECT * FROM t1, t2 WHERE t1.a = 1
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t1, t2 SET t1.a = 10 WHERE t1.a = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
@@ -172,8 +158,6 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 4
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 4
@@ -194,8 +178,6 @@ INSERT INTO t2 VALUES (1), (2), (3);
# query: UPDATE t1 t11, (SELECT * FROM t2) t12 SET t11.a = 10 WHERE t11.a = 1
# select: SELECT * FROM t1 t11, (SELECT * FROM t2) t12 WHERE t11.a = 1
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t1 t11, (SELECT * FROM t2) t12 SET t11.a = 10 WHERE t11.a = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t11 ALL NULL NULL NULL NULL 3 Using where
@@ -224,8 +206,6 @@ Note 1003 select `test`.`t11`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 4
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 4
@@ -246,46 +226,41 @@ INSERT INTO t2 VALUES (1), (2), (3);
# query: UPDATE t1 SET a = 10 WHERE 1 IN (SELECT 1 FROM t2 WHERE t2.b < 3)
# select: SELECT * FROM t1 WHERE 1 IN (SELECT 1 FROM t2 WHERE t2.b < 3)
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t1 SET a = 10 WHERE 1 IN (SELECT 1 FROM t2 WHERE t2.b < 3);
id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch
1 PRIMARY t1 ALL NULL NULL NULL NULL 3
-2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 Using where
FLUSH STATUS;
FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t1 SET a = 10 WHERE 1 IN (SELECT 1 FROM t2 WHERE t2.b < 3);
id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 33.33 Using where; FirstMatch
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00
-2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
-Note 1003 /* select#1 */ update `test`.`t1` set `test`.`t1`.`a` = 10 where <in_optimizer>(1,<exists>(/* select#2 */ select 1 from `test`.`t2` where `test`.`t2`.`b` < 3 and 1))
+Note 1003 update `test`.`t1` semi join (`test`.`t2`) set `test`.`t1`.`a` = 10 where `test`.`t2`.`b` < 3
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
-Handler_read_rnd_next 1
FLUSH STATUS;
FLUSH TABLES;
EXPLAIN EXTENDED SELECT * FROM t1 WHERE 1 IN (SELECT 1 FROM t2 WHERE t2.b < 3);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 33.33 Using where; FirstMatch
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join)
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` < 3
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 4
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
-Handler_read_key 5
-Handler_read_rnd_next 8
+Handler_read_key 4
+Handler_read_rnd_next 5
# Status of testing query execution:
Variable_name Value
Handler_read_key 4
-Handler_read_rnd_next 5
+Handler_read_rnd 3
+Handler_read_rnd_next 9
Handler_update 3
DROP TABLE t1, t2;
@@ -298,21 +273,19 @@ INSERT INTO t2 VALUES (1), (2), (3);
# query: UPDATE t1 SET a = 10 WHERE a IN (SELECT b FROM t2 WHERE t1.a < 3)
# select: SELECT * FROM t1 WHERE a IN (SELECT b FROM t2 WHERE t1.a < 3)
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t1 SET a = 10 WHERE a IN (SELECT b FROM t2 WHERE t1.a < 3);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where
-2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 Using where
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1)
FLUSH STATUS;
FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t1 SET a = 10 WHERE a IN (SELECT b FROM t2 WHERE t1.a < 3);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
-2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 33.33 Using where; FirstMatch(t1)
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
-Note 1003 /* select#1 */ update `test`.`t1` set `test`.`t1`.`a` = 10 where <in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#2 */ select `test`.`t2`.`b` from `test`.`t2` where `test`.`t1`.`a` < 3 and <cache>(`test`.`t1`.`a`) = `test`.`t2`.`b`))
+Note 1003 update `test`.`t1` semi join (`test`.`t2`) set `test`.`t1`.`a` = 10 where `test`.`t2`.`b` = `test`.`t1`.`a` and `test`.`t1`.`a` < 3
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -321,15 +294,13 @@ FLUSH TABLES;
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (SELECT b FROM t2 WHERE t1.a < 3);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 33.33 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`a` and `test`.`t1`.`a` < 3
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 4
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 4
@@ -341,62 +312,61 @@ Handler_read_rnd_next 7
Handler_update 2
DROP TABLE t1, t2;
-#7
+#7a
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1), (2), (3);
CREATE TABLE t2 (b INT);
-INSERT INTO t2 VALUES (1), (2), (3);
+INSERT INTO t2 VALUES (1), (2), (3), (1000);
+CREATE TABLE t3 like t2;
+insert into t3 select * from t2;
+insert into t3 select seq from seq_1001_to_2000;
#
-# query: UPDATE t1, t2 SET a = 10 WHERE a IN (SELECT b FROM t2 WHERE t2.b < 3)
-# select: SELECT * FROM t1, t2 WHERE a IN (SELECT b FROM t2 WHERE t2.b < 3)
+# query: UPDATE t1, t2 SET a = 10 WHERE a IN (SELECT b FROM t3 WHERE t3.b < 3)
+# select: SELECT * FROM t1, t2 WHERE a IN (SELECT b FROM t3 WHERE t3.b < 3)
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
-EXPLAIN UPDATE t1, t2 SET a = 10 WHERE a IN (SELECT b FROM t2 WHERE t2.b < 3);
+EXPLAIN UPDATE t1, t2 SET a = 10 WHERE a IN (SELECT b FROM t3 WHERE t3.b < 3);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-1 PRIMARY t2 ALL NULL NULL NULL NULL 3
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
+1 PRIMARY t2 ALL NULL NULL NULL NULL 4
+2 MATERIALIZED t3 ALL NULL NULL NULL NULL 1004 Using where
FLUSH STATUS;
FLUSH TABLES;
-EXPLAIN EXTENDED UPDATE t1, t2 SET a = 10 WHERE a IN (SELECT b FROM t2 WHERE t2.b < 3);
+EXPLAIN EXTENDED UPDATE t1, t2 SET a = 10 WHERE a IN (SELECT b FROM t3 WHERE t3.b < 3);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 PRIMARY t2 ALL NULL NULL NULL NULL 4 100.00
+2 MATERIALIZED t3 ALL NULL NULL NULL NULL 1004 100.00 Using where
Warnings:
-Note 1003 update `test`.`t1` semi join (`test`.`t2`) join `test`.`t2` set `test`.`t1`.`a` = 10 where `test`.`t2`.`b` < 3
+Note 1003 update `test`.`t1` semi join (`test`.`t3`) join `test`.`t2` set `test`.`t1`.`a` = 10 where `test`.`t3`.`b` < 3
# Status of EXPLAIN EXTENDED query
Variable_name Value
-Handler_read_key 4
+Handler_read_key 6
FLUSH STATUS;
FLUSH TABLES;
-EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE a IN (SELECT b FROM t2 WHERE t2.b < 3);
+EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE a IN (SELECT b FROM t3 WHERE t3.b < 3);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join)
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 PRIMARY t2 ALL NULL NULL NULL NULL 4 100.00 Using join buffer (flat, BNL join)
+2 MATERIALIZED t3 ALL NULL NULL NULL NULL 1004 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` semi join (`test`.`t2`) join `test`.`t2` where `test`.`t2`.`b` < 3
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` semi join (`test`.`t3`) join `test`.`t2` where `test`.`t3`.`b` < 3
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
-Handler_read_key 4
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
+Handler_read_key 6
# Status of "equivalent" SELECT query execution:
Variable_name Value
-Handler_read_key 7
-Handler_read_rnd_next 12
+Handler_read_key 9
+Handler_read_rnd_next 1014
# Status of testing query execution:
Variable_name Value
-Handler_read_key 7
-Handler_read_rnd_next 16
+Handler_read_key 9
+Handler_read_rnd_next 1019
Handler_update 2
-DROP TABLE t1, t2;
+DROP TABLE t1, t2, t3;
#8
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1), (2), (3);
@@ -406,8 +376,6 @@ INSERT INTO t2 VALUES (1), (2), (3);
# query: UPDATE t1 t11, (SELECT * FROM t2) t12 SET t11.a = t11.a + 10
# select: SELECT * FROM t1 t11, (SELECT * FROM t2) t12
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t1 t11, (SELECT * FROM t2) t12 SET t11.a = t11.a + 10;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t11 ALL NULL NULL NULL NULL 3
@@ -436,8 +404,6 @@ Note 1003 select `test`.`t11`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 4
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 4
@@ -460,8 +426,6 @@ INSERT INTO t2 VALUES (1), (2), (3);
# query: UPDATE t1 t11, (SELECT 1 FROM DUAL) t12 SET t11.a = t11.a + 10
# select: SELECT * FROM t1 t11, (SELECT 1 FROM DUAL) t12
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t1 t11, (SELECT 1 FROM DUAL) t12 SET t11.a = t11.a + 10;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> system NULL NULL NULL NULL 1
@@ -493,8 +457,6 @@ Note 1003 /* select#1 */ select `test`.`t11`.`a` AS `a`,1 AS `1` from `test`.`t1
Variable_name Value
Handler_read_key 2
Handler_read_rnd_next 1
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 2
@@ -516,8 +478,6 @@ INSERT INTO t2 VALUES (1), (2), (3);
# query: UPDATE t1 t11, (SELECT * FROM t2) t12 SET t11.a = 10 WHERE t11.a > 1
# select: SELECT * FROM t1 t11, (SELECT * FROM t2) t12 WHERE t11.a > 1
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t1 t11, (SELECT * FROM t2) t12 SET t11.a = 10 WHERE t11.a > 1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t11 ALL NULL NULL NULL NULL 3 Using where
@@ -546,8 +506,6 @@ Note 1003 select `test`.`t11`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 4
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 4
@@ -566,8 +524,6 @@ INSERT INTO t1 VALUES (1), (2), (3);
# query: DELETE FROM t1 WHERE a > 1 LIMIT 1
# select: SELECT * FROM t1 WHERE a > 1 LIMIT 1
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t1 WHERE a > 1 LIMIT 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
@@ -577,7 +533,7 @@ EXPLAIN EXTENDED DELETE FROM t1 WHERE a > 1 LIMIT 1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
-Note 1003 delete from `test`.`t1` where `test`.`t1`.`a` > 1 limit 1
+Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`a` > 1 limit 1
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 2
@@ -591,8 +547,6 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` >
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 2
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 2
@@ -611,8 +565,6 @@ INSERT INTO t1 VALUES (1), (2), (3);
# query: DELETE FROM t1 WHERE 0
# select: SELECT * FROM t1 WHERE 0
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t1 WHERE 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
@@ -622,7 +574,7 @@ EXPLAIN EXTENDED DELETE FROM t1 WHERE 0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
Warnings:
-Note 1003 delete from `test`.`t1` where 0
+Note 1003 delete from `test`.`t1` using dual where 0
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 2
@@ -636,8 +588,6 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 2
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 2
@@ -653,8 +603,6 @@ INSERT INTO t1 VALUES (1), (2), (3);
# query: DELETE FROM t1 USING t1 WHERE 0
# select: SELECT * FROM t1 WHERE 0
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t1 USING t1 WHERE 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
@@ -678,8 +626,6 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 2
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 2
@@ -695,8 +641,6 @@ INSERT INTO t1 VALUES (3, 3), (7, 7);
# query: DELETE FROM t1 WHERE a = 3
# select: SELECT * FROM t1 WHERE a = 3
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t1 WHERE a = 3;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 1 Using where
@@ -706,7 +650,7 @@ EXPLAIN EXTENDED DELETE FROM t1 WHERE a = 3;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range a a 5 NULL 1 100.00 Using where
Warnings:
-Note 1003 delete from `test`.`t1` where `test`.`t1`.`a` = 3
+Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`a` = 3
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 5
@@ -720,8 +664,6 @@ Note 1003 select 3 AS `a`,3 AS `b` from `test`.`t1` where 1
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 6
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 6
@@ -738,8 +680,6 @@ INSERT INTO t1 VALUES (3, 3), (7, 7);
# query: DELETE FROM t1 WHERE a < 3
# select: SELECT * FROM t1 WHERE a < 3
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t1 WHERE a < 3;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 1 Using where
@@ -749,7 +689,7 @@ EXPLAIN EXTENDED DELETE FROM t1 WHERE a < 3;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range a a 5 NULL 1 100.00 Using where
Warnings:
-Note 1003 delete from `test`.`t1` where `test`.`t1`.`a` < 3
+Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`a` < 3
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 5
@@ -763,8 +703,6 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 5
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 6
@@ -779,8 +717,6 @@ CREATE TABLE t1 ( a int PRIMARY KEY );
# query: DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a
# select: SELECT * FROM t1 WHERE t1.a > 0 ORDER BY t1.a
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
@@ -790,7 +726,7 @@ EXPLAIN EXTENDED DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
Warnings:
-Note 1003 delete from `test`.`t1` where `test`.`t1`.`a` > 0 order by `test`.`t1`.`a`
+Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`a` > 0 order by `test`.`t1`.`a`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 3
@@ -805,8 +741,6 @@ Note 1003 select NULL AS `a` from `test`.`t1` where 0 order by NULL
Variable_name Value
Handler_read_key 3
Handler_read_rnd_next 1
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 3
@@ -820,8 +754,6 @@ INSERT INTO t1 VALUES (1), (2), (3), (-1), (-2), (-3);
# query: DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a
# select: SELECT * FROM t1 WHERE t1.a > 0 ORDER BY t1.a
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 Using where
@@ -831,7 +763,7 @@ EXPLAIN EXTENDED DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 100.00 Using where
Warnings:
-Note 1003 delete from `test`.`t1` where `test`.`t1`.`a` > 0 order by `test`.`t1`.`a`
+Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`a` > 0 order by `test`.`t1`.`a`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 3
@@ -845,8 +777,6 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` >
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 3
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 4
@@ -865,8 +795,6 @@ INSERT INTO t1 VALUES (4),(3),(1),(2);
# query: DELETE FROM t1 WHERE (@a:= a) ORDER BY a LIMIT 1
# select: SELECT * FROM t1 WHERE (@a:= a) ORDER BY a LIMIT 1
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t1 WHERE (@a:= a) ORDER BY a LIMIT 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL 1 Using where
@@ -876,7 +804,7 @@ EXPLAIN EXTENDED DELETE FROM t1 WHERE (@a:= a) ORDER BY a LIMIT 1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL 1 100.00 Using where
Warnings:
-Note 1003 delete from `test`.`t1` where @a:=`test`.`t1`.`a` order by `test`.`t1`.`a` limit 1
+Note 1003 delete from `test`.`t1` using dual where @a:=`test`.`t1`.`a` order by `test`.`t1`.`a` limit 1
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 3
@@ -890,8 +818,6 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where @a:=`test`.`t1`.`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 3
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_first 1
@@ -911,8 +837,6 @@ UPDATE t1 SET a = c, b = c;
# query: DELETE FROM t1 ORDER BY a ASC, b ASC LIMIT 1
# select: SELECT * FROM t1 ORDER BY a ASC, b ASC LIMIT 1
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t1 ORDER BY a ASC, b ASC LIMIT 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using filesort
@@ -922,7 +846,7 @@ EXPLAIN EXTENDED DELETE FROM t1 ORDER BY a ASC, b ASC LIMIT 1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using filesort
Warnings:
-Note 1003 delete from `test`.`t1` order by `test`.`t1`.`a`,`test`.`t1`.`b` limit 1
+Note 1003 delete from `test`.`t1` using dual order by `test`.`t1`.`a`,`test`.`t1`.`b` limit 1
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 7
@@ -936,8 +860,6 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` A
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 7
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 7
@@ -966,8 +888,6 @@ INSERT INTO t3 VALUES (1,1), (2,1), (1,3);
# query: DELETE t1,t2,t3 FROM t1,t2,t3 WHERE a1=a2 AND b2=a3 AND b1=b3
# select: SELECT * FROM t1,t2,t3 WHERE a1=a2 AND b2=a3 AND b1=b3
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE t1,t2,t3 FROM t1,t2,t3 WHERE a1=a2 AND b2=a3 AND b1=b3;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
@@ -997,8 +917,6 @@ Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,`test`.`t2`.`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 13
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 19
@@ -1017,25 +935,23 @@ DROP TABLE t1, t2, t3;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1), (2), (3);
CREATE TABLE t2 (a INT);
-INSERT INTO t2 VALUES (1), (2), (3);
+INSERT INTO t2 VALUES (1), (2), (3), (1000);
#
# query: UPDATE t1 SET a = 10 WHERE a IN (SELECT a FROM t2)
# select: SELECT * FROM t1 WHERE a IN (SELECT a FROM t2)
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t1 SET a = 10 WHERE a IN (SELECT a FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where
-2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3
+1 PRIMARY t2 ALL NULL NULL NULL NULL 4 Using where; FirstMatch(t1)
FLUSH STATUS;
FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t1 SET a = 10 WHERE a IN (SELECT a FROM t2);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
-2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00
+1 PRIMARY t2 ALL NULL NULL NULL NULL 4 25.00 Using where; FirstMatch(t1)
Warnings:
-Note 1003 /* select#1 */ update `test`.`t1` set `test`.`t1`.`a` = 10 where <in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#2 */ select `test`.`t2`.`a` from `test`.`t2` where <cache>(`test`.`t1`.`a`) = `test`.`t2`.`a`))
+Note 1003 update `test`.`t1` semi join (`test`.`t2`) set `test`.`t1`.`a` = 10 where `test`.`t2`.`a` = `test`.`t1`.`a`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -1044,19 +960,16 @@ FLUSH TABLES;
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (SELECT a FROM t2);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00
+1 PRIMARY t2 ALL NULL NULL NULL NULL 4 25.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where 1
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`a` = `test`.`t1`.`a`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 4
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
-Handler_read_key 7
-Handler_read_rnd_next 8
+Handler_read_key 4
+Handler_read_rnd_next 9
# Status of testing query execution:
Variable_name Value
Handler_read_key 4
@@ -1074,8 +987,6 @@ SET @save_optimizer_switch= @@optimizer_switch;
# query: DELETE FROM t1 WHERE a1 IN (SELECT a2 FROM t2 WHERE a2 > 2)
# select: SELECT * FROM t1 WHERE a1 IN (SELECT a2 FROM t2 WHERE a2 > 2)
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t1 WHERE a1 IN (SELECT a2 FROM t2 WHERE a2 > 2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 5 Using where
@@ -1087,7 +998,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where
Warnings:
-Note 1003 /* select#1 */ delete from `test`.`t1` where <in_optimizer>(`test`.`t1`.`a1`,<exists>(/* select#2 */ select `test`.`t2`.`a2` from `test`.`t2` where `test`.`t2`.`a2` > 2 and <cache>(`test`.`t1`.`a1`) = `test`.`t2`.`a2`))
+Note 1003 /* select#1 */ delete from `test`.`t1` using dual where <in_optimizer>(`test`.`t1`.`a1`,<exists>(/* select#2 */ select `test`.`t2`.`a2` from `test`.`t2` where `test`.`t2`.`a2` > 2 and <cache>(`test`.`t1`.`a1`) = `test`.`t2`.`a2`))
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -1102,8 +1013,6 @@ Note 1003 /* select#1 */ select `test`.`t1`.`a1` AS `a1` from `test`.`t1` where
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 4
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 9
@@ -1121,20 +1030,18 @@ INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
# query: DELETE FROM t1 WHERE a1 IN (SELECT a2 FROM t2 WHERE a2 > 2)
# select: SELECT * FROM t1 WHERE a1 IN (SELECT a2 FROM t2 WHERE a2 > 2)
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t1 WHERE a1 IN (SELECT a2 FROM t2 WHERE a2 > 2);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 5 Using where
-2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where; FirstMatch(t1)
FLUSH STATUS;
FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t1 WHERE a1 IN (SELECT a2 FROM t2 WHERE a2 > 2);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
-2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 20.00 Using where; FirstMatch(t1)
Warnings:
-Note 1003 /* select#1 */ delete from `test`.`t1` where <in_optimizer>(`test`.`t1`.`a1`,<exists>(/* select#2 */ select `test`.`t2`.`a2` from `test`.`t2` where `test`.`t2`.`a2` > 2 and <cache>(`test`.`t1`.`a1`) = `test`.`t2`.`a2`))
+Note 1003 delete from `test`.`t1` using (`test`.`t2`) where `test`.`t2`.`a2` > 2 and `test`.`t1`.`a1` = `test`.`t2`.`a2`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -1143,14 +1050,12 @@ FLUSH TABLES;
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a1 IN (SELECT a2 FROM t2 WHERE a2 > 2);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00
-1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 20.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`a1` AS `a1` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`a2` > 2 and `test`.`t1`.`a1` = `test`.`t2`.`a2`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 4
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 4
@@ -1169,8 +1074,6 @@ INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
# query: UPDATE t1 SET i = 10
# select: SELECT * FROM t1
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t1 SET i = 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
@@ -1194,8 +1097,6 @@ Note 1003 select `test`.`t1`.`i` AS `i`,`test`.`t1`.`j` AS `j` from `test`.`t1`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 3
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 3
@@ -1214,8 +1115,6 @@ INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
# query: DELETE FROM t1
# select: SELECT * FROM t1
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL 5 Deleting all rows
@@ -1225,7 +1124,7 @@ EXPLAIN EXTENDED DELETE FROM t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL 5 NULL Deleting all rows
Warnings:
-Note 1003 delete from `test`.`t1`
+Note 1003 delete from `test`.`t1` using dual
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 3
@@ -1239,8 +1138,6 @@ Note 1003 select `test`.`t1`.`i` AS `i`,`test`.`t1`.`j` AS `j` from `test`.`t1`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 3
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 3
@@ -1262,8 +1159,6 @@ INSERT INTO t2 (a, b, c) SELECT t1.i, t1.i, t1.i FROM t1, t1 x1, t1 x2;
# query: DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5
# select: SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL a 15 NULL 5 Using where
@@ -1273,7 +1168,7 @@ EXPLAIN EXTENDED DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index NULL a 15 NULL 5 100.00 Using where
Warnings:
-Note 1003 delete from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5
+Note 1003 delete from `test`.`t2` using dual where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 8
@@ -1287,8 +1182,6 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` A
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 8
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_first 1
@@ -1310,8 +1203,6 @@ CREATE TABLE t2 (i INT);
# query: INSERT INTO t2 SELECT * FROM t1
# select: SELECT * FROM t1
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN INSERT INTO t2 SELECT * FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
@@ -1335,8 +1226,6 @@ Note 1003 select `test`.`t1`.`i` AS `i` from `test`.`t1`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 2
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 2
@@ -1356,8 +1245,6 @@ CREATE TABLE t2 (i INT);
# query: REPLACE INTO t2 SELECT * FROM t1
# select: SELECT * FROM t1
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN REPLACE INTO t2 SELECT * FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
@@ -1381,8 +1268,6 @@ Note 1003 select `test`.`t1`.`i` AS `i` from `test`.`t1`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 2
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 2
@@ -1453,8 +1338,6 @@ INSERT INTO t1 (i) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19),
# query: DELETE FROM t1 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5
# select: SELECT * FROM t1 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t1 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 5 Using where
@@ -1464,7 +1347,7 @@ EXPLAIN EXTENDED DELETE FROM t1 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 5 100.00 Using where
Warnings:
-Note 1003 delete from `test`.`t1` where `test`.`t1`.`i` > 10 and `test`.`t1`.`i` <= 18 order by `test`.`t1`.`i` limit 5
+Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`i` > 10 and `test`.`t1`.`i` <= 18 order by `test`.`t1`.`i` limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -1478,8 +1361,6 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`i` AS `i` from `test`.`t1`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 4
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 5
@@ -1500,8 +1381,6 @@ INSERT INTO t1 (i) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19),
# query: DELETE FROM t1 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5
# select: SELECT * FROM t1 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t1 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 26 Using where; Using filesort
@@ -1516,7 +1395,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` > "10" of type `int`
Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` <= "18" of type `int`
-Note 1003 delete from `test`.`t1` where `test`.`t1`.`i` > 10 and `test`.`t1`.`i` <= 18 order by `test`.`t1`.`i` limit 5
+Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`i` > 10 and `test`.`t1`.`i` <= 18 order by `test`.`t1`.`i` limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -1534,8 +1413,6 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`i` AS `i` from `test`.`t1`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 4
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 4
@@ -1565,8 +1442,6 @@ INSERT INTO t1 (i) VALUES (10),(11),(12),(13),(14),(15),(16),(17),(18),(19),
# query: DELETE FROM t1 WHERE i >= 10 AND i < 18 ORDER BY i LIMIT 5
# select: SELECT * FROM t1 WHERE i >= 10 AND i < 18 ORDER BY i LIMIT 5
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t1 WHERE i >= 10 AND i < 18 ORDER BY i LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 26 Using where; Using filesort
@@ -1581,7 +1456,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` >= "10" of type `int`
Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` < "18" of type `int`
-Note 1003 delete from `test`.`t1` where `test`.`t1`.`i` >= 10 and `test`.`t1`.`i` < 18 order by `test`.`t1`.`i` limit 5
+Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`i` >= 10 and `test`.`t1`.`i` < 18 order by `test`.`t1`.`i` limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -1599,8 +1474,6 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`i` AS `i` from `test`.`t1`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 4
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 4
@@ -1629,18 +1502,16 @@ INSERT INTO t2 (a, b, c) SELECT i, i, i FROM t1;
# query: DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5
# select: SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 26 Using where; Using filesort
+1 SIMPLE t2 index NULL a 15 NULL 5 Using where
FLUSH STATUS;
FLUSH TABLES;
EXPLAIN EXTENDED DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort
+1 SIMPLE t2 index NULL a 15 NULL 5 100.00 Using where
Warnings:
-Note 1003 delete from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5
+Note 1003 delete from `test`.`t2` using dual where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 8
@@ -1648,29 +1519,23 @@ FLUSH STATUS;
FLUSH TABLES;
EXPLAIN EXTENDED SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort
+1 SIMPLE t2 index NULL a 15 NULL 5 100.00 Using where
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 8
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
+Handler_read_first 1
Handler_read_key 8
-Handler_read_rnd_next 27
-Sort_priority_queue_sorts 1
-Sort_rows 1
-Sort_scan 1
+Handler_read_next 26
# Status of testing query execution:
Variable_name Value
Handler_delete 1
+Handler_read_first 1
Handler_read_key 8
-Handler_read_rnd 1
-Handler_read_rnd_next 27
-Sort_rows 1
-Sort_scan 1
+Handler_read_next 26
DROP TABLE t1, t2;
#32
@@ -1685,8 +1550,6 @@ INSERT INTO t2 (a, b, c) SELECT t1.i, t1.i, t1.i FROM t1, t1 x1, t1 x2;
# query: DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5
# select: SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL a 15 NULL 5 Using where
@@ -1696,7 +1559,7 @@ EXPLAIN EXTENDED DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index NULL a 15 NULL 5 100.00 Using where
Warnings:
-Note 1003 delete from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5
+Note 1003 delete from `test`.`t2` using dual where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 8
@@ -1710,8 +1573,6 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` A
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 8
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_first 1
@@ -1736,8 +1597,6 @@ INSERT INTO t2 SELECT i, i, i, i FROM t1;
# query: DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5
# select: SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 26 Using where; Using filesort
@@ -1750,7 +1609,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort
Warnings:
Note 1105 Cannot use key `a` part[1] for lookup: `test`.`t2`.`b` of type `char` = "10" of type `int`
-Note 1003 delete from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5
+Note 1003 delete from `test`.`t2` using dual where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 8
@@ -1765,8 +1624,6 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` A
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 8
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 8
@@ -1796,8 +1653,6 @@ INSERT INTO t2 SELECT i, i, i, i FROM t1;
# query: DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5
# select: SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 26 Using where; Using filesort
@@ -1810,7 +1665,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort
Warnings:
Note 1105 Cannot use key `a` part[1] for lookup: `test`.`t2`.`b` of type `char` = "10" of type `int`
-Note 1003 delete from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5
+Note 1003 delete from `test`.`t2` using dual where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 8
@@ -1825,8 +1680,6 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` A
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 8
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 8
@@ -1857,8 +1710,6 @@ INSERT INTO t2 (key1, key2) SELECT i, i FROM t1;
# query: DELETE FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1
# select: SELECT * FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index_merge key1,key2 key1,key2 5,5 NULL 7 Using sort_union(key1,key2); Using where; Using filesort
@@ -1868,7 +1719,7 @@ EXPLAIN EXTENDED DELETE FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index_merge key1,key2 key1,key2 5,5 NULL 7 100.00 Using sort_union(key1,key2); Using where; Using filesort
Warnings:
-Note 1003 delete from `test`.`t2` where `test`.`t2`.`key1` < 13 or `test`.`t2`.`key2` < 14 order by `test`.`t2`.`key1`
+Note 1003 delete from `test`.`t2` using dual where `test`.`t2`.`key1` < 13 or `test`.`t2`.`key2` < 14 order by `test`.`t2`.`key1`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 6
@@ -1882,8 +1733,6 @@ Note 1003 select `test`.`t2`.`i` AS `i`,`test`.`t2`.`key1` AS `key1`,`test`.`t2`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 6
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 8
@@ -1912,8 +1761,6 @@ INSERT INTO t2 (i) SELECT i FROM t1;
# query: DELETE FROM t2 WHERE i > 10 AND i <= 18 ORDER BY i DESC LIMIT 5
# select: SELECT * FROM t2 WHERE i > 10 AND i <= 18 ORDER BY i DESC LIMIT 5
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t2 WHERE i > 10 AND i <= 18 ORDER BY i DESC LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 5 Using where
@@ -1923,7 +1770,7 @@ EXPLAIN EXTENDED DELETE FROM t2 WHERE i > 10 AND i <= 18 ORDER BY i DESC LIMIT
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 5 100.00 Using where
Warnings:
-Note 1003 delete from `test`.`t2` where `test`.`t2`.`i` > 10 and `test`.`t2`.`i` <= 18 order by `test`.`t2`.`i` desc limit 5
+Note 1003 delete from `test`.`t2` using dual where `test`.`t2`.`i` > 10 and `test`.`t2`.`i` <= 18 order by `test`.`t2`.`i` desc limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -1937,8 +1784,6 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`i` AS `i` from `test`.`t2`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 4
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 5
@@ -1961,8 +1806,6 @@ INSERT INTO t2 SELECT i, i, i FROM t1;
# query: DELETE FROM t2 ORDER BY a, b DESC LIMIT 5
# select: SELECT * FROM t2 ORDER BY a, b DESC LIMIT 5
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t2 ORDER BY a, b DESC LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 26 Using filesort
@@ -1972,7 +1815,7 @@ EXPLAIN EXTENDED DELETE FROM t2 ORDER BY a, b DESC LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using filesort
Warnings:
-Note 1003 delete from `test`.`t2` order by `test`.`t2`.`a`,`test`.`t2`.`b` desc limit 5
+Note 1003 delete from `test`.`t2` using dual order by `test`.`t2`.`a`,`test`.`t2`.`b` desc limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 6
@@ -1986,8 +1829,6 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` A
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 6
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 6
@@ -2017,8 +1858,6 @@ INSERT INTO t2 (a, b) SELECT t1.i, t1.i FROM t1, t1 x1, t1 x2;
# query: DELETE FROM t2 ORDER BY a DESC, b DESC LIMIT 5
# select: SELECT * FROM t2 ORDER BY a DESC, b DESC LIMIT 5
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t2 ORDER BY a DESC, b DESC LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL a 6 NULL 5
@@ -2028,7 +1867,7 @@ EXPLAIN EXTENDED DELETE FROM t2 ORDER BY a DESC, b DESC LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index NULL a 6 NULL 5 100.00
Warnings:
-Note 1003 delete from `test`.`t2` order by `test`.`t2`.`a` desc,`test`.`t2`.`b` desc limit 5
+Note 1003 delete from `test`.`t2` using dual order by `test`.`t2`.`a` desc,`test`.`t2`.`b` desc limit 5
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 6
@@ -2042,8 +1881,6 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` A
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 6
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 6
@@ -2068,8 +1905,6 @@ INSERT INTO t2 (i) SELECT i FROM t1;
# query: UPDATE t2 SET a = 10 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5
# select: SELECT * FROM t2 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t2 SET a = 10 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 5 Using where; Using buffer
@@ -2093,8 +1928,6 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`i` AS `i` from `test`.`t2`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 4
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 5
@@ -2118,8 +1951,6 @@ INSERT INTO t2 (i) SELECT i FROM t1;
# query: UPDATE t2 SET a = 10 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5
# select: SELECT * FROM t2 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t2 SET a = 10 WHERE i > 10 AND i <= 18 ORDER BY i LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 26 Using where; Using filesort
@@ -2152,8 +1983,6 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`i` AS `i` from `test`.`t2`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 4
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 4
@@ -2183,16 +2012,14 @@ INSERT INTO t2 (a, b, c) SELECT i, i, i FROM t1;
# query: UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5
# select: SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 26 Using where; Using filesort
+1 SIMPLE t2 index NULL a 15 NULL 5 Using where; Using buffer
FLUSH STATUS;
FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort
+1 SIMPLE t2 index NULL a 15 NULL 5 100.00 Using where; Using buffer
Warnings:
Note 1003 update `test`.`t2` set `test`.`t2`.`d` = 10 where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5
# Status of EXPLAIN EXTENDED query
@@ -2202,30 +2029,24 @@ FLUSH STATUS;
FLUSH TABLES;
EXPLAIN EXTENDED SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort
+1 SIMPLE t2 index NULL a 15 NULL 5 100.00 Using where
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` where `test`.`t2`.`b` = 10 order by `test`.`t2`.`a`,`test`.`t2`.`c` limit 5
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 8
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
+Handler_read_first 1
Handler_read_key 8
-Handler_read_rnd_next 27
-Sort_priority_queue_sorts 1
-Sort_rows 1
-Sort_scan 1
+Handler_read_next 26
# Status of testing query execution:
Variable_name Value
+Handler_read_first 1
Handler_read_key 8
+Handler_read_next 26
Handler_read_rnd 1
-Handler_read_rnd_next 27
Handler_update 1
-Sort_priority_queue_sorts 1
-Sort_rows 1
-Sort_scan 1
DROP TABLE t1, t2;
#42
@@ -2240,8 +2061,6 @@ INSERT INTO t2 (a, b, c) SELECT t1.i, t1.i, t1.i FROM t1, t1 x1, t1 x2;
# query: UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5
# select: SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL a 15 NULL 5 Using where; Using buffer
@@ -2265,8 +2084,6 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` A
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 8
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_first 1
@@ -2292,8 +2109,6 @@ INSERT INTO t2 SELECT i, i, i, i FROM t1;
# query: UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5
# select: SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 26 Using where; Using filesort
@@ -2321,8 +2136,6 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` A
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 8
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 8
@@ -2352,8 +2165,6 @@ INSERT INTO t2 SELECT i, i, i, i FROM t1;
# query: UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5
# select: SELECT * FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 26 Using where; Using filesort
@@ -2381,8 +2192,6 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` A
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 8
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 8
@@ -2413,8 +2222,6 @@ INSERT INTO t2 (key1, key2) SELECT i, i FROM t1;
# query: UPDATE t2 SET i = 123 WHERE key1 < 13 or key2 < 14 ORDER BY key1
# select: SELECT * FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t2 SET i = 123 WHERE key1 < 13 or key2 < 14 ORDER BY key1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index_merge key1,key2 key1,key2 5,5 NULL 7 Using sort_union(key1,key2); Using where; Using filesort
@@ -2438,8 +2245,6 @@ Note 1003 select `test`.`t2`.`i` AS `i`,`test`.`t2`.`key1` AS `key1`,`test`.`t2`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 6
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 8
@@ -2468,8 +2273,6 @@ INSERT INTO t2 (i) SELECT i FROM t1;
# query: UPDATE t2 SET a = 10 WHERE i > 10 AND i <= 18 ORDER BY i DESC LIMIT 5
# select: SELECT * FROM t2 WHERE i > 10 AND i <= 18 ORDER BY i DESC LIMIT 5
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t2 SET a = 10 WHERE i > 10 AND i <= 18 ORDER BY i DESC LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 5 Using where; Using buffer
@@ -2493,8 +2296,6 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`i` AS `i` from `test`.`t2`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 4
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 5
@@ -2518,8 +2319,6 @@ INSERT INTO t2 SELECT i, i, i FROM t1;
# query: UPDATE t2 SET c = 10 ORDER BY a, b DESC LIMIT 5
# select: SELECT * FROM t2 ORDER BY a, b DESC LIMIT 5
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t2 SET c = 10 ORDER BY a, b DESC LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 26 Using filesort
@@ -2543,8 +2342,6 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` A
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 6
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 6
@@ -2575,8 +2372,6 @@ INSERT INTO t2 (a, b) SELECT t1.i, t1.i FROM t1, t1 x1, t1 x2;
# query: UPDATE t2 SET c = 10 ORDER BY a DESC, b DESC LIMIT 5
# select: SELECT * FROM t2 ORDER BY a DESC, b DESC LIMIT 5
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t2 SET c = 10 ORDER BY a DESC, b DESC LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index NULL a 6 NULL 5 Using buffer
@@ -2600,8 +2395,6 @@ Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` A
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 6
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 6
@@ -2629,8 +2422,6 @@ INSERT INTO t1 VALUES (1,'y',1), (2,'n',2), (3,'y',3), (4,'n',4);
# query: UPDATE t1 SET c2 = 0 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2
# select: SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t1 SET c2 = 0 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c1_idx c1_idx 2 NULL 2 Using where; Using filesort
@@ -2654,8 +2445,6 @@ Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1_idx` AS `c1_idx`,`test
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 6
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 7
@@ -2677,8 +2466,6 @@ Sort_rows 2
# query: DELETE FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2
# select: SELECT * FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c1_idx c1_idx 2 NULL 2 Using where; Using filesort
@@ -2688,7 +2475,7 @@ EXPLAIN EXTENDED DELETE FROM t1 WHERE c1_idx = 'y' ORDER BY pk DESC LIMIT 2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range c1_idx c1_idx 2 NULL 2 100.00 Using where; Using filesort
Warnings:
-Note 1003 delete from `test`.`t1` where `test`.`t1`.`c1_idx` = 'y' order by `test`.`t1`.`pk` desc limit 2
+Note 1003 delete from `test`.`t1` using dual where `test`.`t1`.`c1_idx` = 'y' order by `test`.`t1`.`pk` desc limit 2
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 6
@@ -2702,8 +2489,6 @@ Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1_idx` AS `c1_idx`,`test
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 6
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 7
@@ -2728,8 +2513,6 @@ INSERT INTO t1 VALUES (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(
# query: UPDATE t1 SET a=a+10 WHERE a > 34
# select: SELECT * FROM t1 WHERE a > 34
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t1 SET a=a+10 WHERE a > 34;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using where; Using buffer
@@ -2753,8 +2536,6 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` >
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 3
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 4
@@ -2775,8 +2556,6 @@ INSERT INTO t1 VALUES (1, 1, 10), (2, 2, 20);
# query: UPDATE t1 LEFT JOIN t2 ON t1.c1 = t2.c1 SET t2.c2 = 10
# select: SELECT * FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t1 LEFT JOIN t2 ON t1.c1 = t2.c1 SET t2.c2 = 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 system NULL NULL NULL NULL 0 Const row not found
@@ -2805,8 +2584,6 @@ Note 1003 select `test`.`t1`.`c1` AS `c1`,`test`.`t1`.`c2` AS `c2`,`test`.`t1`.`
Variable_name Value
Handler_read_key 7
Handler_read_rnd_next 1
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 7
@@ -2820,8 +2597,6 @@ Handler_read_rnd_next 4
# query: UPDATE t1 LEFT JOIN t2 ON t1.c1 = t2.c1 SET t2.c2 = 10 WHERE t1.c3 = 10
# select: SELECT * FROM t1 LEFT JOIN t2 ON t1.c1 = t2.c1 WHERE t1.c3 = 10
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t1 LEFT JOIN t2 ON t1.c1 = t2.c1 SET t2.c2 = 10 WHERE t1.c3 = 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 system NULL NULL NULL NULL 0 Const row not found
@@ -2850,8 +2625,6 @@ Note 1003 select `test`.`t1`.`c1` AS `c1`,`test`.`t1`.`c2` AS `c2`,`test`.`t1`.`
Variable_name Value
Handler_read_key 7
Handler_read_rnd_next 1
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 7
@@ -2872,18 +2645,16 @@ INSERT INTO t2 VALUES(1,1),(2,2);
# query: UPDATE t1 SET t1.f2=(SELECT MAX(t2.f4) FROM t2 WHERE t2.f3=t1.f1)
# select: SELECT (SELECT MAX(t2.f4) FROM t2 WHERE t2.f3=t1.f1) FROM t1
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t1 SET t1.f2=(SELECT MAX(t2.f4) FROM t2 WHERE t2.f3=t1.f1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
-2 DEPENDENT SUBQUERY t2 ALL IDX NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 ref IDX IDX 5 test.t1.f1 1
FLUSH STATUS;
FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t1 SET t1.f2=(SELECT MAX(t2.f4) FROM t2 WHERE t2.f3=t1.f1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-2 DEPENDENT SUBQUERY t2 ALL IDX NULL NULL NULL 2 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ref IDX IDX 5 test.t1.f1 1 100.00
Warnings:
Note 1276 Field or reference 'test.t1.f1' of SELECT #2 was resolved in SELECT #1
Note 1003 /* select#1 */ update `test`.`t1` set `test`.`t1`.`f2` = (/* select#2 */ select max(`test`.`t2`.`f4`) from `test`.`t2` where `test`.`t2`.`f3` = `test`.`t1`.`f1`)
@@ -2895,23 +2666,23 @@ FLUSH TABLES;
EXPLAIN EXTENDED SELECT (SELECT MAX(t2.f4) FROM t2 WHERE t2.f3=t1.f1) FROM t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-2 DEPENDENT SUBQUERY t2 ALL IDX NULL NULL NULL 2 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ref IDX IDX 5 test.t1.f1 1 100.00
Warnings:
Note 1276 Field or reference 'test.t1.f1' of SELECT #2 was resolved in SELECT #1
Note 1003 /* select#1 */ select <expr_cache><`test`.`t1`.`f1`>((/* select#2 */ select max(`test`.`t2`.`f4`) from `test`.`t2` where `test`.`t2`.`f3` = `test`.`t1`.`f1`)) AS `(SELECT MAX(t2.f4) FROM t2 WHERE t2.f3=t1.f1)` from `test`.`t1`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 7
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
-Handler_read_key 9
-Handler_read_rnd_next 9
+Handler_read_key 11
+Handler_read_next 2
+Handler_read_rnd_next 3
# Status of testing query execution:
Variable_name Value
-Handler_read_key 7
-Handler_read_rnd_next 9
+Handler_read_key 9
+Handler_read_next 2
+Handler_read_rnd_next 3
Handler_update 2
DROP TABLE t1, t2;
@@ -2934,9 +2705,9 @@ DROP TABLE t1;
#57
CREATE TABLE t1(f1 INT);
EXPLAIN EXTENDED UPDATE t1 SET f2=1 ORDER BY f2;
-ERROR 42S22: Unknown column 'f2' in 'order clause'
+ERROR 42S22: Unknown column 'f2' in 'field list'
UPDATE t1 SET f2=1 ORDER BY f2;
-ERROR 42S22: Unknown column 'f2' in 'order clause'
+ERROR 42S22: Unknown column 'f2' in 'field list'
DROP TABLE t1;
#62
CREATE TABLE t1 (a INT);
@@ -2946,8 +2717,6 @@ CREATE VIEW v1 AS SELECT t11.a, t12.a AS b FROM t1 t11, t1 t12;
# query: UPDATE v1 SET a = 1 WHERE a > 0
# select: SELECT * FROM v1 WHERE a > 0
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE v1 SET a = 1 WHERE a > 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t11 ALL NULL NULL NULL NULL 2 Using where
@@ -2974,8 +2743,6 @@ Note 1003 select `test`.`t11`.`a` AS `a`,`test`.`t12`.`a` AS `b` from `test`.`t1
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 2
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 2
@@ -2991,8 +2758,6 @@ Handler_read_rnd_next 8
# query: UPDATE t1, v1 SET v1.a = 1 WHERE t1.a = v1.a
# select: SELECT * FROM t1, v1 WHERE t1.a = v1.a
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t1, v1 SET v1.a = 1 WHERE t1.a = v1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
@@ -3022,8 +2787,6 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t11`.`a` AS `a`,`test`.`t12`.`a`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 2
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 2
@@ -3046,8 +2809,6 @@ CREATE VIEW v1 (a) AS SELECT a FROM t1;
# query: DELETE FROM v1 WHERE a < 4
# select: SELECT * FROM v1 WHERE a < 4
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE FROM v1 WHERE a < 4;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 Using where
@@ -3057,7 +2818,7 @@ EXPLAIN EXTENDED DELETE FROM v1 WHERE a < 4;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 100.00 Using where
Warnings:
-Note 1003 /* select#1 */ delete from `test`.`t1` where `test`.`t1`.`a` < 4
+Note 1003 /* select#1 */ delete from `test`.`t1` using dual where `v1`.`a` < 4
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 3
@@ -3071,8 +2832,6 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` <
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 3
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_first 1
@@ -3097,8 +2856,6 @@ CREATE VIEW v1 (a,c) AS SELECT a, b+1 FROM t1;
# query: DELETE v1 FROM t2, v1 WHERE t2.x = v1.a
# select: SELECT * FROM t2, v1 WHERE t2.x = v1.a
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE v1 FROM t2, v1 WHERE t2.x = v1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where
@@ -3125,8 +2882,6 @@ Note 1003 select `test`.`t2`.`x` AS `x`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` +
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 6
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 10
@@ -3150,8 +2905,6 @@ CREATE VIEW v1 (a,c) AS SELECT a, b+1 FROM t1;
# query: DELETE v1 FROM t2, v1 WHERE t2.x = v1.a
# select: SELECT * FROM t2, v1 WHERE t2.x = v1.a
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN DELETE v1 FROM t2, v1 WHERE t2.x = v1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 4 Using where
@@ -3178,8 +2931,6 @@ Note 1003 select `test`.`t2`.`x` AS `x`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` +
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 6
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 10
@@ -3240,8 +2991,6 @@ CREATE VIEW v1 (x) AS SELECT b FROM t2;
# query: INSERT INTO v1 SELECT * FROM t1
# select: SELECT * FROM t1
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN INSERT INTO v1 SELECT * FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 Const row not found
@@ -3267,8 +3016,6 @@ Note 1003 select NULL AS `a` from `test`.`t1`
Variable_name Value
Handler_read_key 2
Handler_read_rnd_next 1
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 2
@@ -3295,22 +3042,20 @@ INSERT INTO t2 VALUES (1), (2), (3);
# query: UPDATE t1 SET a = 10 WHERE a IN (SELECT * FROM (SELECT b FROM t2 ORDER BY b LIMIT 2,2) x)
# select: SELECT * FROM t1 WHERE a IN (SELECT * FROM (SELECT b FROM t2 ORDER BY b LIMIT 2,2) x)
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t1 SET a = 10 WHERE a IN (SELECT * FROM (SELECT b FROM t2 ORDER BY b LIMIT 2,2) x);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where
-2 DEPENDENT SUBQUERY <derived3> index_subquery key0 key0 5 func 2
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 5 test.t1.a 1
3 DERIVED t2 ALL NULL NULL NULL NULL 3 Using filesort
FLUSH STATUS;
FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t1 SET a = 10 WHERE a IN (SELECT * FROM (SELECT b FROM t2 ORDER BY b LIMIT 2,2) x);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
-2 DEPENDENT SUBQUERY <derived3> index_subquery key0 key0 5 func 2 100.00
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 5 test.t1.a 1 100.00
3 DERIVED t2 ALL NULL NULL NULL NULL 3 100.00 Using filesort
Warnings:
-Note 1003 /* select#1 */ update `test`.`t1` set `test`.`t1`.`a` = 10 where <in_optimizer>(`test`.`t1`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`a`) in (temporary) on key0)))
+Note 1003 /* select#1 */ update (/* select#3 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`b` limit 2,2) `x` join `test`.`t1` set `test`.`t1`.`a` = 10 where `x`.`b` = `test`.`t1`.`a`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -3319,15 +3064,13 @@ FLUSH TABLES;
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (SELECT * FROM (SELECT b FROM t2 ORDER BY b LIMIT 2,2) x);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 PRIMARY <derived3> ref key0 key0 5 test.t1.a 2 100.00 FirstMatch(t1)
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 5 test.t1.a 1 100.00
3 DERIVED t2 ALL NULL NULL NULL NULL 3 100.00 Using filesort
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join ((/* select#3 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`b` limit 2,2) `x`) where `x`.`b` = `test`.`t1`.`a`
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from (/* select#3 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`b` limit 2,2) `x` join `test`.`t1` where `x`.`b` = `test`.`t1`.`a`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 4
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 7
@@ -3348,12 +3091,10 @@ Sort_scan 1
# query: UPDATE t1, t2 SET a = 10 WHERE a IN (SELECT * FROM (SELECT b FROM t2 ORDER BY b LIMIT 2,2) x)
# select: SELECT * FROM t1, t2 WHERE a IN (SELECT * FROM (SELECT b FROM t2 ORDER BY b LIMIT 2,2) x)
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t1, t2 SET a = 10 WHERE a IN (SELECT * FROM (SELECT b FROM t2 ORDER BY b LIMIT 2,2) x);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where
-1 PRIMARY <derived3> ref key0 key0 5 test.t1.a 2 FirstMatch(t1)
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 5 test.t1.a 1
1 PRIMARY t2 ALL NULL NULL NULL NULL 3
3 DERIVED t2 ALL NULL NULL NULL NULL 3 Using filesort
FLUSH STATUS;
@@ -3361,11 +3102,11 @@ FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t1, t2 SET a = 10 WHERE a IN (SELECT * FROM (SELECT b FROM t2 ORDER BY b LIMIT 2,2) x);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 PRIMARY <derived3> ref key0 key0 5 test.t1.a 2 100.00 FirstMatch(t1)
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 5 test.t1.a 1 100.00
1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00
3 DERIVED t2 ALL NULL NULL NULL NULL 3 100.00 Using filesort
Warnings:
-Note 1003 /* select#1 */ update `test`.`t1` semi join ((/* select#3 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`b` limit 2,2) `x`) join `test`.`t2` set `test`.`t1`.`a` = 10 where `x`.`b` = `test`.`t1`.`a`
+Note 1003 /* select#1 */ update (/* select#3 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`b` limit 2,2) `x` join `test`.`t1` join `test`.`t2` set `test`.`t1`.`a` = 10 where `x`.`b` = `test`.`t1`.`a`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -3374,16 +3115,14 @@ FLUSH TABLES;
EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE a IN (SELECT * FROM (SELECT b FROM t2 ORDER BY b LIMIT 2,2) x);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 PRIMARY <derived3> ref key0 key0 5 test.t1.a 2 100.00 FirstMatch(t1)
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 5 test.t1.a 1 100.00
1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join)
3 DERIVED t2 ALL NULL NULL NULL NULL 3 100.00 Using filesort
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` semi join ((/* select#3 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`b` limit 2,2) `x`) join `test`.`t2` where `x`.`b` = `test`.`t1`.`a`
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from (/* select#3 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`b` limit 2,2) `x` join `test`.`t1` join `test`.`t2` where `x`.`b` = `test`.`t1`.`a`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 4
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 7
@@ -3403,12 +3142,10 @@ Sort_scan 1
# query: UPDATE t1, (SELECT * FROM t2) y SET a = 10 WHERE a IN (SELECT * FROM (SELECT b FROM t2 ORDER BY b LIMIT 2,2) x)
# select: SELECT * FROM t1, (SELECT * FROM t2) y WHERE a IN (SELECT * FROM (SELECT b FROM t2 ORDER BY b LIMIT 2,2) x)
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t1, (SELECT * FROM t2) y SET a = 10 WHERE a IN (SELECT * FROM (SELECT b FROM t2 ORDER BY b LIMIT 2,2) x);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where
-1 PRIMARY <derived4> ref key0 key0 5 test.t1.a 2 FirstMatch(t1)
+1 PRIMARY <derived4> eq_ref distinct_key distinct_key 5 test.t1.a 1
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3
4 DERIVED t2 ALL NULL NULL NULL NULL 3 Using filesort
2 DERIVED t2 ALL NULL NULL NULL NULL 3
@@ -3417,12 +3154,12 @@ FLUSH TABLES;
EXPLAIN EXTENDED UPDATE t1, (SELECT * FROM t2) y SET a = 10 WHERE a IN (SELECT * FROM (SELECT b FROM t2 ORDER BY b LIMIT 2,2) x);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 PRIMARY <derived4> ref key0 key0 5 test.t1.a 2 100.00 FirstMatch(t1)
+1 PRIMARY <derived4> eq_ref distinct_key distinct_key 5 test.t1.a 1 100.00
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 100.00
4 DERIVED t2 ALL NULL NULL NULL NULL 3 100.00 Using filesort
2 DERIVED t2 ALL NULL NULL NULL NULL 3 100.00
Warnings:
-Note 1003 /* select#1 */ update `test`.`t1` semi join ((/* select#4 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`b` limit 2,2) `x`) join (/* select#2 */ select `test`.`t2`.`b` AS `b` from `test`.`t2`) `y` set `test`.`t1`.`a` = 10 where `x`.`b` = `test`.`t1`.`a`
+Note 1003 /* select#1 */ update (/* select#4 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`b` limit 2,2) `x` join `test`.`t1` join (/* select#2 */ select `test`.`t2`.`b` AS `b` from `test`.`t2`) `y` set `test`.`t1`.`a` = 10 where `x`.`b` = `test`.`t1`.`a`
# Status of EXPLAIN EXTENDED query
Variable_name Value
Handler_read_key 4
@@ -3431,16 +3168,14 @@ FLUSH TABLES;
EXPLAIN EXTENDED SELECT * FROM t1, (SELECT * FROM t2) y WHERE a IN (SELECT * FROM (SELECT b FROM t2 ORDER BY b LIMIT 2,2) x);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 PRIMARY <derived4> ref key0 key0 5 test.t1.a 2 100.00 FirstMatch(t1)
+1 PRIMARY <derived4> eq_ref distinct_key distinct_key 5 test.t1.a 1 100.00
1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join)
4 DERIVED t2 ALL NULL NULL NULL NULL 3 100.00 Using filesort
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` semi join ((/* select#4 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`b` limit 2,2) `x`) join `test`.`t2` where `x`.`b` = `test`.`t1`.`a`
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from (/* select#4 */ select `test`.`t2`.`b` AS `b` from `test`.`t2` order by `test`.`t2`.`b` limit 2,2) `x` join `test`.`t1` join `test`.`t2` where `x`.`b` = `test`.`t1`.`a`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 4
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 7
@@ -3470,8 +3205,7 @@ JOIN t1 AS a12 ON a12.c1 = a11.c1
) d1
);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t3 ALL NULL NULL NULL NULL 0 100.00
-2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
Warnings:
Note 1003 /* select#1 */ update `test`.`t3` set `test`.`t3`.`c3` = (/* select#2 */ select count(NULL) from `test`.`t1` `a11` straight_join `test`.`t2` `a21` join `test`.`t1` `a12` where 0)
DROP TABLE t1, t2, t3;
@@ -3492,8 +3226,6 @@ INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
# query: UPDATE t1 SET a=a+1 WHERE a>10
# select: SELECT a t1 FROM t1 WHERE a>10
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t1 SET a=a+1 WHERE a>10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 1 Using where; Using buffer
@@ -3517,8 +3249,6 @@ Note 1003 select `test`.`t1`.`a` AS `t1` from `test`.`t1` where `test`.`t1`.`a`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 3
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 4
@@ -3531,8 +3261,6 @@ Handler_read_key 4
# query: UPDATE t1 SET a=a+1 WHERE a>10 ORDER BY a+20
# select: SELECT a t1 FROM t1 WHERE a>10 ORDER BY a+20
#
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
EXPLAIN UPDATE t1 SET a=a+1 WHERE a>10 ORDER BY a+20;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 1 Using where; Using filesort
@@ -3556,8 +3284,6 @@ Note 1003 select `test`.`t1`.`a` AS `t1` from `test`.`t1` where `test`.`t1`.`a`
# Status of EXPLAIN EXTENDED "equivalent" SELECT query execution
Variable_name Value
Handler_read_key 3
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Status of "equivalent" SELECT query execution:
Variable_name Value
Handler_read_key 4
@@ -3667,7 +3393,7 @@ CALL p10();
DROP PROCEDURE p10;
CALL p9();
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 0
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
DROP PROCEDURE p9;
CALL p8();
DROP PROCEDURE p8;
diff --git a/mysql-test/main/myisam_icp.result b/mysql-test/main/myisam_icp.result
index 3078f8bc..1c06c6d8 100644
--- a/mysql-test/main/myisam_icp.result
+++ b/mysql-test/main/myisam_icp.result
@@ -454,9 +454,10 @@ c1 INT NOT NULL,
PRIMARY KEY (pk)
);
INSERT INTO t1 VALUES (1,9),(2,7),(3,6),(4,3),(5,1);
+insert into t1 select seq,seq from seq_100_to_110;
EXPLAIN SELECT pk, c1 FROM t1 WHERE (pk<3 or pk>3);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 5 Using where
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 16 Using where
SET SESSION optimizer_switch='index_condition_pushdown=off';
SELECT pk, c1 FROM t1 WHERE (pk<3 or pk>3);
pk c1
@@ -464,6 +465,17 @@ pk c1
2 7
4 3
5 1
+100 100
+101 101
+102 102
+103 103
+104 104
+105 105
+106 106
+107 107
+108 108
+109 109
+110 110
DROP TABLE t1;
set optimizer_switch= @save_optimizer_switch;
#
@@ -681,7 +693,6 @@ DROP TABLE t1;
#
CREATE TABLE t1 (b int NOT NULL, c int, a varchar(1024), PRIMARY KEY (b));
INSERT INTO t1 VALUES (1,4,'Ill');
-insert into t1 select seq+100,5,seq from seq_1_to_100;
CREATE TABLE t2 (a varchar(1024), KEY (a(512)));
INSERT INTO t2 VALUES
('Ill'), ('eckqzsflbzaffti'), ('w'), ('she'), ('gxbwypqtjzwywwer'), ('w');
@@ -697,8 +708,8 @@ EXPLAIN
SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0)
HAVING t1.c != 5 ORDER BY t1.c;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL # Using where; Using filesort
-1 SIMPLE t2 ref a a 515 test.t1.a # Using where
+1 SIMPLE t1 system PRIMARY NULL NULL NULL #
+1 SIMPLE t2 ref a a 515 const # Using where
SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0)
HAVING t1.c != 5 ORDER BY t1.c;
b c
@@ -708,8 +719,8 @@ EXPLAIN
SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0)
HAVING t1.c != 5 ORDER BY t1.c;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL # Using where; Using filesort
-1 SIMPLE t2 ref a a 515 test.t1.a # Using where
+1 SIMPLE t1 system PRIMARY NULL NULL NULL #
+1 SIMPLE t2 ref a a 515 const # Using where
SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0)
HAVING t1.c != 5 ORDER BY t1.c;
b c
@@ -821,6 +832,8 @@ test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status Table is already up to date
SET @save_optimize_switch=@@optimizer_switch;
SET optimizer_switch='materialization=on';
+set @save_optimizer_where_cost=@@optimizer_where_cost;
+set @@optimizer_where_cost=1;
EXPLAIN
SELECT COUNT(*) FROM t1 AS t, t2
WHERE c = g
@@ -844,6 +857,7 @@ OR a = 0 AND h < 'z' );
COUNT(*)
1478
SET optimizer_switch=@save_optimizer_switch;
+set @@optimizer_where_cost=@save_optimizer_where_cost;
DROP TABLE t1,t2;
# check "Handler_pushed" status varuiables
CREATE TABLE t1 (
@@ -934,7 +948,7 @@ DROP TABLE t1;
# Bug#870046: ICP for a GROUP BY query
#
CREATE TABLE t1 (a int, b varchar(1), c varchar(1), INDEX idx(b));
-INSERT INTO t1 VALUES (2,'x','x'), (5,'x','y');
+INSERT INTO t1 VALUES (2,'x','x'), (5,'x','y'), (6,'a','b'), (7,'a','b');
SET SESSION optimizer_switch='index_condition_pushdown=off';
EXPLAIN
SELECT a, MIN(c) FROM t1 WHERE b = 'x' AND c > 'x' GROUP BY a;
diff --git a/mysql-test/main/myisam_icp.test b/mysql-test/main/myisam_icp.test
index a115d0f7..7b4ff23b 100644
--- a/mysql-test/main/myisam_icp.test
+++ b/mysql-test/main/myisam_icp.test
@@ -215,7 +215,7 @@ DROP TABLE t1;
--echo #
CREATE TABLE t1 (a int, b varchar(1), c varchar(1), INDEX idx(b));
-INSERT INTO t1 VALUES (2,'x','x'), (5,'x','y');
+INSERT INTO t1 VALUES (2,'x','x'), (5,'x','y'), (6,'a','b'), (7,'a','b');
SET SESSION optimizer_switch='index_condition_pushdown=off';
EXPLAIN
diff --git a/mysql-test/main/myisam_mrr,32bit.rdiff b/mysql-test/main/myisam_mrr,32bit.rdiff
index 746bf48d..eda77abb 100644
--- a/mysql-test/main/myisam_mrr,32bit.rdiff
+++ b/mysql-test/main/myisam_mrr,32bit.rdiff
@@ -1,5 +1,5 @@
---- main/myisam_mrr.result 2019-05-14 15:44:52.232663568 +0530
-+++ main/myisam_mrr.reject 2019-05-14 15:51:37.123563538 +0530
+--- main/myisam_mrr.result
++++ main/myisam_mrr.reject
@@ -617,8 +617,8 @@
show status like 'handler_mrr%';
Variable_name Value
diff --git a/mysql-test/main/myisam_mrr.result b/mysql-test/main/myisam_mrr.result
index b758b2b3..6bf72e68 100644
--- a/mysql-test/main/myisam_mrr.result
+++ b/mysql-test/main/myisam_mrr.result
@@ -517,7 +517,7 @@ table3.col_varchar_key = table2.col_varchar_nokey AND
table3.pk<>0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE table2 ALL col_varchar_key NULL NULL NULL 40 Using where
-1 SIMPLE table3 ref PRIMARY,col_varchar_key col_varchar_key 3 test.table2.col_varchar_key 5 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE table3 ALL PRIMARY,col_varchar_key NULL NULL NULL 40 Using where; Using join buffer (flat, BNL join)
set join_cache_level= @save_join_cache_level;
set join_buffer_size= @save_join_buffer_size;
drop table t1;
@@ -572,8 +572,7 @@ Handler_mrr_rowid_refills 0
create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 (a int, b int, filler char(200), key(a));
-insert into t1
-select A.a+10*B.a+100*C.a+1000*D.a, 123,'filler' from t0 A, t0 B, t0 C, t0 D;
+insert into t1 select seq, 123, 'filler' from seq_0_to_14999;
explain select sum(b) from t1 where a < 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 9 Using index condition; Rowid-ordered scan
diff --git a/mysql-test/main/myisam_mrr.test b/mysql-test/main/myisam_mrr.test
index 66188622..5e497dd3 100644
--- a/mysql-test/main/myisam_mrr.test
+++ b/mysql-test/main/myisam_mrr.test
@@ -1,6 +1,8 @@
#
# MRR/MyISAM tests.
#
+--source include/have_sequence.inc
+
--disable_warnings
drop table if exists t0, t1, t2, t3;
@@ -279,8 +281,7 @@ show status like 'Handler_mrr%';
create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 (a int, b int, filler char(200), key(a));
-insert into t1
-select A.a+10*B.a+100*C.a+1000*D.a, 123,'filler' from t0 A, t0 B, t0 C, t0 D;
+insert into t1 select seq, 123, 'filler' from seq_0_to_14999;
explain select sum(b) from t1 where a < 10;
--echo # This should show one MRR scan and no re-fills:
diff --git a/mysql-test/main/mysql.result b/mysql-test/main/mysql.result
index ac716b46..f25d649d 100644
--- a/mysql-test/main/mysql.result
+++ b/mysql-test/main/mysql.result
@@ -636,7 +636,7 @@ drop table t1;
# MDEV-15538 '-N' Produce html output wrong
#
<TABLE BORDER=1><TR><TD>1</TD></TR></TABLE>
-WARNING: option '--enable-cleartext-plugin' is obsolete.
+WARNING: option --enable-cleartext-plugin is obsolete.
1
1
# End of 10.3 tests
@@ -663,3 +663,30 @@ source
^^^
3
# End of 10.5 tests
+#
+# MDEV-30327 Client crashes in print_last_query_cost
+#
+# End of 11.0 tests
+#
+# show whether server cert was verified
+#
+create user ser@localhost identified by "ass";
+MYSQL --disable-ssl-verify-server-cert -e "\s"
+
+SSL: Cipher in use is XXX, cert is UNKNOWN
+
+
+MYSQL --ssl-verify-server-cert -e "\s"
+
+SSL: Cipher in use is XXX, cert is OK
+
+
+drop user ser@localhost;
+#
+# MDEV-32473 --disable-ssl doesn't disable it
+#
+MYSQL --ssl-verify-server-cert --disable-ssl -e "\s"
+
+SSL: Not in use
+
+
diff --git a/mysql-test/main/mysql.test b/mysql-test/main/mysql.test
index 2f189e70..1bd5b8c0 100644
--- a/mysql-test/main/mysql.test
+++ b/mysql-test/main/mysql.test
@@ -711,7 +711,6 @@ drop table t1;
--echo #
--exec $MYSQL -NHe "select 1 as a"
-
#
# Test obsolete option --enable-cleartext-plugin
# This should proceed with a warning
@@ -758,3 +757,34 @@ source $MYSQL_TMP_DIR/mysql_in;" $MYSQL_TMP_DIR/mysql_in2;
--remove_file $MYSQL_TMP_DIR/mysql_in2
--echo # End of 10.5 tests
+
+--echo #
+--echo # MDEV-30327 Client crashes in print_last_query_cost
+--echo #
+
+--disable_query_log
+--disable_result_log
+--exec $MYSQL --show-query-costs --port=$MASTER_MYPORT -e "show tables in mysql like 'foo'"
+--enable_result_log
+--enable_query_log
+
+--echo # End of 11.0 tests
+
+--echo #
+--echo # show whether server cert was verified
+--echo #
+create user ser@localhost identified by "ass";
+--echo MYSQL --disable-ssl-verify-server-cert -e "\\s"
+--replace_regex /^.[^S].*// /\b[-A-Z_0-9]+,/XXX,/
+--exec $MYSQL -user -pass --disable-ssl-verify-server-cert -e "\\s"
+--echo MYSQL --ssl-verify-server-cert -e "\\s"
+--replace_regex /^.[^S].*// /\b[-A-Z_0-9]+,/XXX,/
+--exec $MYSQL -user -pass --ssl-verify-server-cert -e "\\s"
+drop user ser@localhost;
+
+--echo #
+--echo # MDEV-32473 --disable-ssl doesn't disable it
+--echo #
+--echo MYSQL --ssl-verify-server-cert --disable-ssl -e "\\s"
+--replace_regex /^.[^S].*//
+--exec $MYSQL --ssl-verify-server-cert --disable-ssl -e "\\s"
diff --git a/mysql-test/main/mysql57_virtual.result b/mysql-test/main/mysql57_virtual.result
index 16dd7d55..2b19cd79 100644
--- a/mysql-test/main/mysql57_virtual.result
+++ b/mysql-test/main/mysql57_virtual.result
@@ -13,8 +13,8 @@ select * from mysql57_virtual;
a b c
1 2 4
2 3 5
-alter online table mysql57_virtual comment "I am now a MariaDB table";
-ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED
+alter online table mysql57_virtual comment "I am now a MariaDB table", algorithm=nocopy;
+ERROR 0A000: ALGORITHM=NOCOPY is not supported for this operation. Try ALGORITHM=COPY
alter table mysql57_virtual comment "I am now a MariaDB table";
SHOW CREATE TABLE mysql57_virtual;
Table Create Table
diff --git a/mysql-test/main/mysql57_virtual.test b/mysql-test/main/mysql57_virtual.test
index 3ebdd894..987a8f1a 100644
--- a/mysql-test/main/mysql57_virtual.test
+++ b/mysql-test/main/mysql57_virtual.test
@@ -13,8 +13,8 @@ insert into mysql57_virtual (a) values (1),(2);
select * from mysql57_virtual;
# We can't do online changes, as the MariaDB storage is incompatible with MySQL
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-alter online table mysql57_virtual comment "I am now a MariaDB table";
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+alter online table mysql57_virtual comment "I am now a MariaDB table", algorithm=nocopy;
alter table mysql57_virtual comment "I am now a MariaDB table";
SHOW CREATE TABLE mysql57_virtual;
diff --git a/mysql-test/main/mysql_client_test.result b/mysql-test/main/mysql_client_test.result
index dbd5aaea..59e82d7a 100644
--- a/mysql-test/main/mysql_client_test.result
+++ b/mysql-test/main/mysql_client_test.result
@@ -130,7 +130,7 @@ mysql_stmt_next_result(): 0; field_count: 0
# cat MYSQL_TMP_DIR/test_mdev26145.out.log
# ------------------------------------
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def MAX(a) MAX(a) 3 11 0 Y 32768 0 63
+def MAX(a) MAX(a) 3 11 0 Y 49152 0 63
# ------------------------------------
diff --git a/mysql-test/main/mysql_upgrade-20228.result b/mysql-test/main/mysql_upgrade-20228.result
index cd616c53..96213116 100644
--- a/mysql-test/main/mysql_upgrade-20228.result
+++ b/mysql-test/main/mysql_upgrade-20228.result
@@ -72,6 +72,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
diff --git a/mysql-test/main/mysql_upgrade-20228.test b/mysql-test/main/mysql_upgrade-20228.test
index 32c05fd1..99e8914b 100644
--- a/mysql-test/main/mysql_upgrade-20228.test
+++ b/mysql-test/main/mysql_upgrade-20228.test
@@ -40,8 +40,8 @@ WHERE TABLE_SCHEMA='mysql' AND TABLE_NAME='user';
--echo # Running mysql_upgrade
--exec $MYSQL_UPGRADE --default-character-set=utf8mb4 --force 2>&1
---file_exists $MYSQLD_DATADIR/mysql_upgrade_info
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--file_exists $MYSQLD_DATADIR/mariadb_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
--echo #
--echo # Restoring character_set_client and collation_connection back
diff --git a/mysql-test/main/mysql_upgrade-28915.result b/mysql-test/main/mysql_upgrade-28915.result
index 399cd9cf..8e5ff284 100644
--- a/mysql-test/main/mysql_upgrade-28915.result
+++ b/mysql-test/main/mysql_upgrade-28915.result
@@ -130,6 +130,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
@@ -394,6 +395,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
diff --git a/mysql-test/main/mysql_upgrade-28915.test b/mysql-test/main/mysql_upgrade-28915.test
index 65c8bb36..56554ff0 100644
--- a/mysql-test/main/mysql_upgrade-28915.test
+++ b/mysql-test/main/mysql_upgrade-28915.test
@@ -15,7 +15,7 @@ SHOW CREATE TABLE mysql.event;
--exec $MYSQL_UPGRADE --force 2>&1
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
SHOW CREATE TABLE mysql.proc;
SHOW CREATE TABLE mysql.event;
@@ -64,7 +64,7 @@ SELECT name, body_utf8, body FROM mysql.event;
--echo # mysql_upgrade changes columns from utf8mb4 to utf8mb3
--exec $MYSQL_UPGRADE --force 2>&1
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
--vertical_results
diff --git a/mysql-test/main/mysql_upgrade-6984.result b/mysql-test/main/mysql_upgrade-6984.result
index 4b3e9007..0c5a47c5 100644
--- a/mysql-test/main/mysql_upgrade-6984.result
+++ b/mysql-test/main/mysql_upgrade-6984.result
@@ -1,3 +1,6 @@
+#
+# MDEV-6984 Can't migrate from MySQL 5.6.21 to MariaDB 10
+#
update mysql.global_priv set priv=json_set(priv, '$.plugin', 'mysql_native_password', '$.authentication_string', password('foo')) where user='root';
Phase 1/8: Checking and upgrading mysql database
Processing databases
@@ -72,6 +75,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
@@ -168,5 +172,4 @@ OK
connect con1,localhost,root,foo,,,;
update mysql.global_priv set priv=json_compact(json_remove(priv, '$.plugin', '$.authentication_string')) where user='root';
flush privileges;
-set global event_scheduler=OFF;
# restart
diff --git a/mysql-test/main/mysql_upgrade-6984.test b/mysql-test/main/mysql_upgrade-6984.test
index 034310e0..53b1f180 100644
--- a/mysql-test/main/mysql_upgrade-6984.test
+++ b/mysql-test/main/mysql_upgrade-6984.test
@@ -1,9 +1,9 @@
-#
-# MDEV-6984 Can't migrate from MySQL 5.6.21 to MariaDB 10
-#
--source include/not_embedded.inc
--source include/have_perfschema.inc
+--echo #
+--echo # MDEV-6984 Can't migrate from MySQL 5.6.21 to MariaDB 10
+--echo #
#
# When 'root' account is password protected and MYSQL_UPGRADE doesn't
# know the password (meaning, MYSQL_UPGRADE is run automatically
@@ -14,18 +14,16 @@
update mysql.global_priv set priv=json_set(priv, '$.plugin', 'mysql_native_password', '$.authentication_string', password('foo')) where user='root';
---replace_regex /[^ ]*mysql_upgrade_info/...mysql_upgrade_info/
+--replace_regex /[^ ]*mariadb_upgrade_info/...mariadb_upgrade_info/
--exec $MYSQL_UPGRADE
connect(con1,localhost,root,foo,,,);
update mysql.global_priv set priv=json_compact(json_remove(priv, '$.plugin', '$.authentication_string')) where user='root';
flush privileges;
-# Load event table
-set global event_scheduler=OFF;
let MYSQLD_DATADIR= `select @@datadir`;
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
# --skip-grant-tables state may changed during the test. Need to restart the server
# to restore the --skip-grant-tables state. Otherwise MTR's internal check will fail
diff --git a/mysql-test/main/mysql_upgrade.result b/mysql-test/main/mysql_upgrade.result
index e67a43d5..dd89b55d 100644
--- a/mysql-test/main/mysql_upgrade.result
+++ b/mysql-test/main/mysql_upgrade.result
@@ -57,6 +57,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
@@ -151,8 +152,8 @@ Phase 7/8: uninstalling plugins
Phase 8/8: Running 'FLUSH PRIVILEGES'
OK
Run it again - should say already completed
-This installation of MariaDB is already upgraded to VERSION.There is no need to run mysql_upgrade again for VERSION.
-You can use --force if you still want to run mysql_upgrade
+This installation of MariaDB is already upgraded to VERSION.There is no need to run mariadb-upgrade again for VERSION.
+You can use --force if you still want to run mariadb-upgrade
Force should run it regardless of whether it has been run before
Phase 1/8: Checking and upgrading mysql database
Processing databases
@@ -210,6 +211,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
@@ -362,6 +364,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
@@ -520,6 +523,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
@@ -678,6 +682,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
@@ -839,6 +844,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
@@ -982,7 +988,7 @@ OK
# Bug#11827359 60223: MYSQL_UPGRADE PROBLEM WITH OPTION
# SKIP-WRITE-BINLOG
#
-# Droping the previously created mysql_upgrade_info file..
+# Droping the previously created mariadb_upgrade_info file..
# Running mysql_upgrade with --skip-write-binlog..
Phase 1/8: Checking and upgrading mysql database
Processing databases
@@ -1040,6 +1046,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
@@ -1212,6 +1219,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
@@ -1332,7 +1340,7 @@ length(table_name)
drop table extralongname_extralongname_extralongname_extralongname_ext;
# End of 10.0 tests
set sql_mode=default;
-# Droping the previously created mysql_upgrade_info file..
+# Droping the previously created mariadb_upgrade_info file..
create table test.t1(a int) engine=MyISAM;
# Trying to enforce InnoDB for all tables
SET GLOBAL enforce_storage_engine=InnoDB;
@@ -1392,6 +1400,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
@@ -1614,6 +1623,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
@@ -1794,6 +1804,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
@@ -1912,24 +1923,24 @@ FLUSH PRIVILEGES;
# MDEV-27279: mariadb_upgrade add --check-if-upgrade-is-needed
#
This installation of MariaDB is already upgraded to MariaDB .
-There is no need to run mysql_upgrade again for MariaDB .
+There is no need to run mariadb-upgrade again for MariaDB .
Looking for 'mariadb' as: mariadb
This installation of MariaDB is already upgraded to MariaDB .
-There is no need to run mysql_upgrade again for MariaDB .
+There is no need to run mariadb-upgrade again for MariaDB .
#
# MDEV-27279: mariadb_upgrade check-if-upgrade absence is do it
#
Looking for 'mariadb' as: mariadb
-Empty or non existent ...mysql_upgrade_info. Assuming mysql_upgrade has to be run!
+Empty or non existent ...mariadb_upgrade_info. Assuming mysql_upgrade has to be run!
#
# MDEV-27279: mariadb_upgrade check-if-upgrade with minor version change
#
Looking for 'mariadb' as: mariadb
This installation of MariaDB is already upgraded to MariaDB .
-There is no need to run mysql_upgrade again for MariaDB .
+There is no need to run mariadb-upgrade again for MariaDB .
This installation of MariaDB is already upgraded to MariaDB .
-There is no need to run mysql_upgrade again for MariaDB .
-You can use --force if you still want to run mysql_upgrade
+There is no need to run mariadb-upgrade again for MariaDB .
+You can use --force if you still want to run mariadb-upgrade
#
# MDEV-27279: mariadb_upgrade check-if-upgrade with major version change
#
@@ -2026,6 +2037,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
@@ -2123,7 +2135,7 @@ SET GLOBAL alter_algorithm=DEFAULT;
SHOW GLOBAL VARIABLES LIKE 'alter_algorithm';
Variable_name Value
alter_algorithm DEFAULT
-End of 10.3 tests
+# End of 10.3 tests
# switching from mysql.global_priv to mysql.user
drop view mysql.user_bak;
create user 'user3'@'localhost' identified with mysql_native_password as password('a_password');
@@ -2246,6 +2258,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
@@ -2411,6 +2424,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
@@ -2574,3 +2588,29 @@ mysql.user has data
SELECT COUNT(*) > 0 AS `mysql.user has data` FROM mysql.user;
mysql.user has data
1
+# End of 10.5 tests
+#
+# MDEV-33554 Upgrade from 11.2 to 11.3 changes root's privileges
+#
+alter table mysql.db drop column show_create_routine_priv;
+flush privileges;
+create user foo@bar;
+grant all privileges on mysql.* to foo@bar;
+show grants for foo@bar;
+Grants for foo@bar
+GRANT USAGE ON *.* TO `foo`@`bar`
+GRANT ALL PRIVILEGES ON `mysql`.* TO `foo`@`bar`
+flush privileges;
+show grants for foo@bar;
+Grants for foo@bar
+GRANT USAGE ON *.* TO `foo`@`bar`
+GRANT ALL PRIVILEGES ON `mysql`.* TO `foo`@`bar`
+select show_create_routine_priv from mysql.db where user='foo';
+show_create_routine_priv
+Y
+show grants for foo@bar;
+Grants for foo@bar
+GRANT USAGE ON *.* TO `foo`@`bar`
+GRANT ALL PRIVILEGES ON `mysql`.* TO `foo`@`bar`
+drop user foo@bar;
+# End of 11.3 tests
diff --git a/mysql-test/main/mysql_upgrade.test b/mysql-test/main/mysql_upgrade.test
index 70206213..a17f1869 100644
--- a/mysql-test/main/mysql_upgrade.test
+++ b/mysql-test/main/mysql_upgrade.test
@@ -7,6 +7,19 @@
set sql_mode="";
call mtr.add_suppression("Incorrect definition of table mysql.column_stats:.*");
+
+# It should create a file in the MySQL Servers datadir
+let $MYSQLD_DATADIR= `select @@datadir`;
+
+#
+# MDEV-30498 Rename mysql_upgrade state file to mariadb_upgrade.
+#
+# Ensure that old $MYSQLD_DATADIR/mysql_upgrade_info file is deleted.
+#
+
+write_file $MYSQLD_DATADIR/mysql_upgrade_info;
+EOF
+
#
# Basic test that we can run mysql_upgrde and that it finds the
# expected binaries it uses.
@@ -14,22 +27,22 @@ call mtr.add_suppression("Incorrect definition of table mysql.column_stats:.*");
--echo Run mysql_upgrade once
--exec $MYSQL_UPGRADE --force 2>&1
-# It should have created a file in the MySQL Servers datadir
-let $MYSQLD_DATADIR= `select @@datadir`;
+--error 1
file_exists $MYSQLD_DATADIR/mysql_upgrade_info;
+file_exists $MYSQLD_DATADIR/mariadb_upgrade_info;
--echo Run it again - should say already completed
--replace_regex /upgraded to [^\n].*/upgraded to VERSION./ /again for [^\n]*/again for VERSION./
--exec $MYSQL_UPGRADE 2>&1
# It should have created a file in the MySQL Servers datadir
-file_exists $MYSQLD_DATADIR/mysql_upgrade_info;
+file_exists $MYSQLD_DATADIR/mariadb_upgrade_info;
--echo Force should run it regardless of whether it has been run before
--exec $MYSQL_UPGRADE --force 2>&1
# It should have created a file in the MySQL Servers datadir
-file_exists $MYSQLD_DATADIR/mysql_upgrade_info;
+file_exists $MYSQLD_DATADIR/mariadb_upgrade_info;
#
@@ -123,16 +136,16 @@ DROP USER 'user3'@'%';
let $MYSQLD_DATADIR= `select @@datadir`;
---echo # Droping the previously created mysql_upgrade_info file..
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--echo # Droping the previously created mariadb_upgrade_info file..
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
--echo # Running mysql_upgrade with --skip-write-binlog..
---replace_regex /[^ ]*mysql_upgrade_info/...mysql_upgrade_info/
+--replace_regex /[^ ]*mariadb_upgrade_info/...mariadb_upgrade_info/
--exec $MYSQL_UPGRADE --skip-write-binlog
-# mysql_upgrade must have created mysql_upgrade_info file,
+# mysql_upgrade must have created mariadb_upgrade_info file,
# so the following command should never fail.
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
--echo #
--echo # Bug #21489398: MYSQL_UPGRADE: FATAL ERROR: UPGRADE FAILED - IMPROVE ERROR
@@ -201,8 +214,8 @@ set sql_mode=default;
#
# Enforce storage engine option should not effect mysql_upgrade
#
---echo # Droping the previously created mysql_upgrade_info file..
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--echo # Droping the previously created mariadb_upgrade_info file..
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
create table test.t1(a int) engine=MyISAM;
--echo # Trying to enforce InnoDB for all tables
@@ -215,9 +228,9 @@ SET GLOBAL enforce_storage_engine=InnoDB;
SELECT count(*) FROM information_schema.tables where ENGINE="InnoDB";
SHOW CREATE TABLE test.t1;
DROP TABLE test.t1;
-# mysql_upgrade must have created mysql_upgrade_info file,
+# mysql_upgrade must have created mariadb_upgrade_info file,
# so the following command should never fail.
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
SET GLOBAL enforce_storage_engine=NULL;
--echo # End of 10.1 tests
@@ -300,11 +313,11 @@ FLUSH PRIVILEGES;
--echo # MDEV-27279: mariadb_upgrade check-if-upgrade absence is do it
--echo #
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
---replace_regex /[^ ]*mysql_upgrade_info/...mysql_upgrade_info/
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
+--replace_regex /[^ ]*mariadb_upgrade_info/...mariadb_upgrade_info/
--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed
---replace_regex /'mariadb.* as:[^\n]*/'mariadb' as: mariadb/ /open .* Assuming/open XXX. Assuming/ /[^ ]*mysql_upgrade_info/...mysql_upgrade_info/
+--replace_regex /'mariadb.* as:[^\n]*/'mariadb' as: mariadb/ /open .* Assuming/open XXX. Assuming/ /[^ ]*mariadb_upgrade_info/...mariadb_upgrade_info/
--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --verbose
--echo #
@@ -319,7 +332,7 @@ perl;
my $ver= $ENV{'MYSQL_SERVER_VERSION'} or die "MYSQL_SERVER_VERSION not set";
my $file= $ENV{'DATADIR'} or die "MYSQLD_DATADIR not set";
$ver =~ s/^(\d*)\.(\d*).(\d*)(.*)/$1.$2.0$4/;
- open(FILE, ">$file/mysql_upgrade_info") or die "Failed to open $file";
+ open(FILE, ">$file/mariadb_upgrade_info") or die "Failed to open $file";
print FILE "$ver\n";
close(FILE);
EOF
@@ -331,21 +344,29 @@ EOF
--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --verbose
--replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB /
--exec $MYSQL_UPGRADE
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
--echo #
--echo # MDEV-27279: mariadb_upgrade check-if-upgrade with major version change
--echo #
-# take 2rd number of version and change to 0
-
+# take 2rd number of version and change to 0. If the 2rd number is already 0,
+# change the first number
let DATADIR= $MYSQLD_DATADIR;
perl;
my $ver= $ENV{'MYSQL_SERVER_VERSION'} or die "MYSQL_SERVER_VERSION not set";
my $file= $ENV{'DATADIR'} or die "MYSQLD_DATADIR not set";
- $ver =~ s/^(\d*)\.(\d*).(\d*)(.*)/$1.0.$3$4/;
- open(FILE, ">$file/mysql_upgrade_info") or die "Failed to open $file";
+ open(FILE, ">$file/mariadb_upgrade_info") or die "Failed to open $file";
+ if ($ver =~ m/(\d*)\.0\.(\d*)(.*)/)
+ {
+ my $prev= $1-1;
+ $ver= $prev . '.0.' . $2 . $3;
+ }
+ else
+ {
+ $ver =~ s/^(\d*)\.(\d*)\.(\d*)(.*)/$1.0.$3$4/;
+ }
print FILE "$ver\n";
close(FILE);
EOF
@@ -355,7 +376,7 @@ EOF
--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed
--replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB / /'mariadb.* as:[^\n]*/'mysql' as: mysql/
--exec $MYSQL_UPGRADE --check-if-upgrade-is-needed --verbose
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
drop table mysql.global_priv;
rename table mysql.global_priv_bak to mysql.global_priv;
@@ -376,7 +397,7 @@ alter table mysql.db drop column Delete_history_priv;
--source include/restart_mysqld.inc
--echo Run mysql_upgrade with all privileges on a user
--exec $MYSQL_UPGRADE --force --silent 2>&1
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
flush privileges;
SHOW GRANTS FOR 'user3'@'%';
DROP USER 'user3'@'%';
@@ -395,9 +416,9 @@ SHOW GLOBAL VARIABLES LIKE 'alter_algorithm';
--exec $MYSQL_UPGRADE --force 2>&1
SET GLOBAL alter_algorithm=DEFAULT;
SHOW GLOBAL VARIABLES LIKE 'alter_algorithm';
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
---echo End of 10.3 tests
+--echo # End of 10.3 tests
--source include/switch_to_mysql_user.inc
drop view mysql.user_bak;
@@ -413,7 +434,7 @@ disconnect con1;
connection default;
--echo # mysql_upgrade --force --silent 2>&1
--exec $MYSQL_UPGRADE --force --silent 2>&1
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
show create user user3@localhost;
connect con1,localhost,user3,a_password;
select current_user();
@@ -431,7 +452,7 @@ drop view mysql.user_bak;
drop table mysql.innodb_index_stats, mysql.innodb_table_stats;
--echo # mysql_upgrade --force --silent 2>&1
--exec $MYSQL_UPGRADE --force --silent 2>&1
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
drop table mysql.global_priv;
rename table mysql.global_priv_bak to mysql.global_priv;
@@ -443,7 +464,7 @@ drop view mysql.user_bak;
alter table mysql.user change authentication_string auth_string text collate utf8_bin not null;
--echo # mysql_upgrade --force --silent 2>&1
--exec $MYSQL_UPGRADE --force --silent 2>&1
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
select count(*) from mysql.global_priv;
drop table mysql.global_priv;
rename table mysql.global_priv_bak to mysql.global_priv;
@@ -484,7 +505,7 @@ connection default;
drop table mysql.global_priv;
rename table mysql.global_priv_bak to mysql.global_priv;
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
--echo #
--echo # mariadb-upgrade fails with sql_safe_updates = on
@@ -493,7 +514,7 @@ rename table mysql.global_priv_bak to mysql.global_priv;
set @orig_sql_safe_updates = @@GLOBAL.sql_safe_updates;
set global sql_safe_updates=ON;
--exec $MYSQL_UPGRADE --force 2>&1
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
set global sql_safe_updates=@orig_sql_safe_updates;
--echo #
@@ -505,7 +526,7 @@ INSERT INTO mysql.plugin SELECT 'unix_socket', 'auth_socket.so'
--echo # mariadb-upgrade --force --silent 2>&1
--exec $MYSQL_UPGRADE --force --silent 2>&1
SELECT * FROM mysql.plugin WHERE name='unix_socket';
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
--echo # End of 10.4 tests
@@ -540,3 +561,25 @@ call mtr.add_suppression("Column count of mysql.proc is wrong. Expected 21, foun
--let $old_version= 10.4
--source include/load_dump_and_upgrade.inc
+
+--echo # End of 10.5 tests
+
+--echo #
+--echo # MDEV-33554 Upgrade from 11.2 to 11.3 changes root's privileges
+--echo #
+alter table mysql.db drop column show_create_routine_priv;
+flush privileges;
+create user foo@bar;
+grant all privileges on mysql.* to foo@bar;
+show grants for foo@bar;
+flush privileges;
+show grants for foo@bar;
+
+--exec $MYSQL_UPGRADE --force --silent 2>&1
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
+
+select show_create_routine_priv from mysql.db where user='foo';
+show grants for foo@bar;
+drop user foo@bar;
+
+--echo # End of 11.3 tests
diff --git a/mysql-test/main/mysql_upgrade_file_leak.test b/mysql-test/main/mysql_upgrade_file_leak.test
index 44f17832..7f1a0495 100644
--- a/mysql-test/main/mysql_upgrade_file_leak.test
+++ b/mysql-test/main/mysql_upgrade_file_leak.test
@@ -20,5 +20,5 @@ print "No temporary files found\n";
EOF
let $MYSQLD_DATADIR= `select @@datadir`;
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
--echo End of 10.4 tests
diff --git a/mysql-test/main/mysql_upgrade_mysql_json.result b/mysql-test/main/mysql_upgrade_mysql_json.result
index 2b909594..05d280d9 100644
--- a/mysql-test/main/mysql_upgrade_mysql_json.result
+++ b/mysql-test/main/mysql_upgrade_mysql_json.result
@@ -79,6 +79,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
diff --git a/mysql-test/main/mysql_upgrade_mysql_json.test b/mysql-test/main/mysql_upgrade_mysql_json.test
index 4380b004..8271530a 100644
--- a/mysql-test/main/mysql_upgrade_mysql_json.test
+++ b/mysql-test/main/mysql_upgrade_mysql_json.test
@@ -26,7 +26,7 @@ let $MYSQLD_DATADIR= `select @@datadir`;
show create table mysql_json_test;
--exec $MYSQL_UPGRADE --force 2>&1
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
show create table mysql_json_test;
select * from mysql_json_test;
diff --git a/mysql-test/main/mysql_upgrade_mysql_json_datatype.result b/mysql-test/main/mysql_upgrade_mysql_json_datatype.result
index cb964cb7..2ef12022 100644
--- a/mysql-test/main/mysql_upgrade_mysql_json_datatype.result
+++ b/mysql-test/main/mysql_upgrade_mysql_json_datatype.result
@@ -66,6 +66,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
diff --git a/mysql-test/main/mysql_upgrade_mysql_json_datatype.test b/mysql-test/main/mysql_upgrade_mysql_json_datatype.test
index 13d8ff57..f0f20681 100644
--- a/mysql-test/main/mysql_upgrade_mysql_json_datatype.test
+++ b/mysql-test/main/mysql_upgrade_mysql_json_datatype.test
@@ -58,4 +58,4 @@ drop table tempty;
drop table mysql_json_test;
drop table mysql_json_test_big;
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
diff --git a/mysql-test/main/mysql_upgrade_mysql_json_system_tables.test b/mysql-test/main/mysql_upgrade_mysql_json_system_tables.test
index 6ae3e8dd..2410892a 100644
--- a/mysql-test/main/mysql_upgrade_mysql_json_system_tables.test
+++ b/mysql-test/main/mysql_upgrade_mysql_json_system_tables.test
@@ -33,7 +33,7 @@ SET @old_log_output= @@global.log_output;
SET @@global.general_log = ON;
SET @@global.log_output = "TABLE";
--exec $MYSQL_UPGRADE -s --force 2>&1
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
SET @@global.general_log = @old_general_log;
SET @@global.log_output = @old_log_output;
diff --git a/mysql-test/main/mysql_upgrade_mysql_json_with_plugin_loaded.result b/mysql-test/main/mysql_upgrade_mysql_json_with_plugin_loaded.result
index 7bc2808a..373844db 100644
--- a/mysql-test/main/mysql_upgrade_mysql_json_with_plugin_loaded.result
+++ b/mysql-test/main/mysql_upgrade_mysql_json_with_plugin_loaded.result
@@ -79,6 +79,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
diff --git a/mysql-test/main/mysql_upgrade_mysql_json_with_plugin_loaded.test b/mysql-test/main/mysql_upgrade_mysql_json_with_plugin_loaded.test
index f3e9c2e5..da730ba8 100644
--- a/mysql-test/main/mysql_upgrade_mysql_json_with_plugin_loaded.test
+++ b/mysql-test/main/mysql_upgrade_mysql_json_with_plugin_loaded.test
@@ -26,7 +26,7 @@ let $MYSQLD_DATADIR= `select @@datadir`;
show create table mysql_json_test;
--exec $MYSQL_UPGRADE --force 2>&1
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
show create table mysql_json_test;
show create table mysql_json_test_big;
diff --git a/mysql-test/main/mysql_upgrade_no_innodb.test b/mysql-test/main/mysql_upgrade_no_innodb.test
index 8813a450..bac155f8 100644
--- a/mysql-test/main/mysql_upgrade_no_innodb.test
+++ b/mysql-test/main/mysql_upgrade_no_innodb.test
@@ -3,4 +3,4 @@
--exec $MYSQL_UPGRADE --force --upgrade-system-tables 2>&1
let $MYSQLD_DATADIR= `select @@datadir`;
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
diff --git a/mysql-test/main/mysql_upgrade_noengine.result b/mysql-test/main/mysql_upgrade_noengine.result
index aa3e4b5c..b0ab868b 100644
--- a/mysql-test/main/mysql_upgrade_noengine.result
+++ b/mysql-test/main/mysql_upgrade_noengine.result
@@ -11,7 +11,7 @@ table_name t1
table_type BASE TABLE
engine BLACKHOLE
row_format Fixed
-table_rows 0
+table_rows 2
data_length 0
table_comment
select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test' and table_name='t2';
@@ -155,7 +155,7 @@ table_name t1
table_type BASE TABLE
engine BLACKHOLE
row_format Fixed
-table_rows 0
+table_rows 2
data_length 0
table_comment
select table_catalog, table_schema, table_name, table_type, engine, row_format, table_rows, data_length, table_comment from information_schema.tables where table_schema='test' and table_name='t2';
diff --git a/mysql-test/main/mysql_upgrade_noengine.test b/mysql-test/main/mysql_upgrade_noengine.test
index 3cb811bb..173e367a 100644
--- a/mysql-test/main/mysql_upgrade_noengine.test
+++ b/mysql-test/main/mysql_upgrade_noengine.test
@@ -46,9 +46,9 @@ drop view mysql.user_bak;
# pretend it's an upgrade from 10.0
alter table mysql.user drop column default_role, drop column max_statement_time;
-# but mysql_upgrade_info tells otherwise
-remove_file $datadir/mysql_upgrade_info;
-write_file $datadir/mysql_upgrade_info;
+# but mariadb_upgrade_info tells otherwise
+remove_file $datadir/mariadb_upgrade_info;
+write_file $datadir/mariadb_upgrade_info;
10.1.10-MariaDB
EOF
@@ -64,7 +64,7 @@ source include/switch_to_mysql_user.inc;
drop view mysql.user_bak;
alter table mysql.user drop column default_role, drop column max_statement_time;
-remove_file $datadir/mysql_upgrade_info;
+remove_file $datadir/mariadb_upgrade_info;
--echo # upgrade from 10.0 - engines are enabled
--replace_regex /\d\d\.\d*\.\d*[^ .\n]*/MariaDB /
@@ -74,8 +74,8 @@ select table_catalog, table_schema, table_name, table_type, engine, row_format,
drop table t1, t2;
-remove_file $datadir/mysql_upgrade_info;
-# This is needed as mysql_upgrade can load the plugins
+remove_file $datadir/mariadb_upgrade_info;
+# This is needed as mariadb_upgrade can load the plugins
uninstall plugin blackhole;
uninstall plugin archive;
diff --git a/mysql-test/main/mysql_upgrade_ssl.result b/mysql-test/main/mysql_upgrade_ssl.result
index 990f05b3..bd6dd786 100644
--- a/mysql-test/main/mysql_upgrade_ssl.result
+++ b/mysql-test/main/mysql_upgrade_ssl.result
@@ -57,6 +57,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
diff --git a/mysql-test/main/mysql_upgrade_ssl.test b/mysql-test/main/mysql_upgrade_ssl.test
index daf5fad3..678d429b 100644
--- a/mysql-test/main/mysql_upgrade_ssl.test
+++ b/mysql-test/main/mysql_upgrade_ssl.test
@@ -9,4 +9,4 @@
--echo #
--exec $MYSQL_UPGRADE --skip-verbose --skip-silent --ssl --force 2>&1
--let $datadir= `select @@datadir`
---remove_file $datadir/mysql_upgrade_info
+--remove_file $datadir/mariadb_upgrade_info
diff --git a/mysql-test/main/mysql_upgrade_to_100502.result b/mysql-test/main/mysql_upgrade_to_100502.result
index 7235b16a..54f4d273 100644
--- a/mysql-test/main/mysql_upgrade_to_100502.result
+++ b/mysql-test/main/mysql_upgrade_to_100502.result
@@ -13,12 +13,12 @@ CREATE USER user_super@localhost;
GRANT SUPER ON *.* TO user_super@localhost;
SHOW GRANTS FOR user_super@localhost;
Grants for user_super@localhost
-GRANT SUPER, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, BINLOG ADMIN, BINLOG REPLAY ON *.* TO `user_super`@`localhost`
+GRANT SUPER, BINLOG MONITOR, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `user_super`@`localhost`
CREATE USER user_super_replslave@localhost;
GRANT SUPER, REPLICATION SLAVE ON *.* TO user_super_replslave@localhost;
SHOW GRANTS FOR user_super_replslave@localhost;
Grants for user_super_replslave@localhost
-GRANT SUPER, REPLICATION SLAVE, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `user_super_replslave`@`localhost`
+GRANT SUPER, REPLICATION SLAVE, BINLOG MONITOR, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `user_super_replslave`@`localhost`
#
# MDEV-23610: Slave user can't run "SHOW SLAVE STATUS" anymore after upgrade to 10.5, mysql_upgrade should take of that
#
@@ -30,7 +30,7 @@ CREATE USER user_replsuper@localhost;
GRANT SUPER ON *.* TO user_replsuper@localhost;
SHOW GRANTS FOR user_replsuper@localhost;
Grants for user_replsuper@localhost
-GRANT SUPER, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, BINLOG ADMIN, BINLOG REPLAY ON *.* TO `user_replsuper`@`localhost`
+GRANT SUPER, BINLOG MONITOR, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `user_replsuper`@`localhost`
#
# Users with privilege REPLICATION CLIENT prior to 10.5 should successfully execute
# SHOW SLAVE STATUS command
@@ -62,13 +62,13 @@ GRANT ALL PRIVILEGES ON *.* TO `user_all`@`localhost` WITH GRANT OPTION
#
SHOW GRANTS FOR user_super@localhost;
Grants for user_super@localhost
-GRANT SUPER, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, BINLOG ADMIN, BINLOG REPLAY ON *.* TO `user_super`@`localhost`
+GRANT SUPER, BINLOG MONITOR, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `user_super`@`localhost`
#
# Should automatically get all new 10.5.2 priveleges that were splitted from SUPER, plus REPLICATION MASTER ADMIN
#
SHOW GRANTS FOR user_super_replslave@localhost;
Grants for user_super_replslave@localhost
-GRANT SUPER, REPLICATION SLAVE, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `user_super_replslave`@`localhost`
+GRANT SUPER, REPLICATION SLAVE, BINLOG MONITOR, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `user_super_replslave`@`localhost`
#
# MDEV-23610: Slave user can't run "SHOW SLAVE STATUS" anymore after upgrade to 10.5, mysql_upgrade should take of that
#
diff --git a/mysql-test/main/mysql_upgrade_to_100502.test b/mysql-test/main/mysql_upgrade_to_100502.test
index fc47f0c9..a5bda5b6 100644
--- a/mysql-test/main/mysql_upgrade_to_100502.test
+++ b/mysql-test/main/mysql_upgrade_to_100502.test
@@ -55,7 +55,7 @@ SHOW GRANTS FOR user_replslave@localhost;
--echo # mysql_upgrade --force --silent 2>&1
--exec $MYSQL_UPGRADE --force --silent 2>&1
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
FLUSH PRIVILEGES;
--echo #
diff --git a/mysql-test/main/mysql_upgrade_view.result b/mysql-test/main/mysql_upgrade_view.result
index 21304c15..faa82d6d 100644
--- a/mysql-test/main/mysql_upgrade_view.result
+++ b/mysql-test/main/mysql_upgrade_view.result
@@ -137,6 +137,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
@@ -390,6 +391,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
@@ -618,6 +620,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
diff --git a/mysql-test/main/mysql_upgrade_view.test b/mysql-test/main/mysql_upgrade_view.test
index d3d955e7..4cff5780 100644
--- a/mysql-test/main/mysql_upgrade_view.test
+++ b/mysql-test/main/mysql_upgrade_view.test
@@ -185,6 +185,6 @@ flush tables;
# back to mariadb default
drop table mysql.event;
rename table mysql.ev_bk to mysql.event;
-remove_file $MYSQLD_DATADIR/mysql_upgrade_info;
+remove_file $MYSQLD_DATADIR/mariadb_upgrade_info;
drop view v1,v2,v3;
drop table t1;
diff --git a/mysql-test/main/mysqlbinlog.result b/mysql-test/main/mysqlbinlog.result
index 32afc150..47672462 100644
--- a/mysql-test/main/mysqlbinlog.result
+++ b/mysql-test/main/mysqlbinlog.result
@@ -407,16 +407,26 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-SET TIMESTAMP=1108844556/*!*/;
+use `test`/*!*/;
+SET TIMESTAMP=1140641973/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.system_versioning_insert_history=0/*!*/;
+SET @@session.sql_mode=#/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=latin1,@@session.collation_connection=8,@@session.collation_server=#/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
-BEGIN
+CREATE TABLE t1(c INT)
/*!*/;
-use `test`/*!*/;
-SET TIMESTAMP=1108844555/*!*/;
-insert t1 values (1)
+SET TIMESTAMP=1140641985/*!*/;
+CREATE TABLE t2(s CHAR(200))
+/*!*/;
+SET TIMESTAMP=1140642018/*!*/;
+CREATE TRIGGER trg1 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES(CURRENT_USER())
+/*!*/;
+SET TIMESTAMP=1140642025/*!*/;
+INSERT INTO t1 VALUES(1)
/*!*/;
DELIMITER ;
# End of log file
@@ -427,16 +437,21 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
-SET TIMESTAMP=1108844556/*!*/;
+ROLLBACK/*!*/;
+use `test`/*!*/;
+SET TIMESTAMP=1140642018/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.system_versioning_insert_history=0/*!*/;
+SET @@session.sql_mode=#/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=latin1,@@session.collation_connection=8,@@session.collation_server=#/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
-BEGIN
+CREATE TRIGGER trg1 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES(CURRENT_USER())
/*!*/;
-use `test`/*!*/;
-SET TIMESTAMP=1108844555/*!*/;
-insert t1 values (1)
+SET TIMESTAMP=1140642025/*!*/;
+INSERT INTO t1 VALUES(1)
/*!*/;
DELIMITER ;
# End of log file
@@ -549,6 +564,7 @@ SET @@session.sql_mode=#/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=latin1,@@session.collation_connection=8,@@session.collation_server=#/*!*/;
+SET @@session.character_set_collations=''/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a varchar(64) character set utf8)
@@ -1269,7 +1285,7 @@ DELIMITER ;
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
-mariadb-binlog Ver VER for OS at ARCH
+mariadb-binlog from #.#.#-MariaDB, client #.# for OS (ARCH)
#
# Test --rewrite-db
#
diff --git a/mysql-test/main/mysqlbinlog.test b/mysql-test/main/mysqlbinlog.test
index 22a85393..3d2646f7 100644
--- a/mysql-test/main/mysqlbinlog.test
+++ b/mysql-test/main/mysqlbinlog.test
@@ -123,13 +123,13 @@ select "--- reading stdin --" as "";
--enable_query_log
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/ /@@session.sql_mode=\d+/@@session.sql_mode=#/ /collation_server=\d+/collation_server=#/
---exec $MYSQL_BINLOG --short-form - < $MYSQL_TEST_DIR/std_data/trunc_binlog.000001
+--exec $MYSQL_BINLOG --short-form - < $MYSQL_TEST_DIR/std_data/bug16266.000001
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/ /@@session.sql_mode=\d+/@@session.sql_mode=#/ /collation_server=\d+/collation_server=#/
# postion is constant to correspond to an event in pre-recorded binlog
---let $binlog_start_pos=79
---exec $MYSQL_BINLOG --short-form --start-position=$binlog_start_pos - < $MYSQL_TEST_DIR/std_data/trunc_binlog.000001
+--let $binlog_start_pos=274
+--exec $MYSQL_BINLOG --short-form --start-position=$binlog_start_pos - < $MYSQL_TEST_DIR/std_data/bug16266.000001
drop table t1,t2;
@@ -335,7 +335,7 @@ exec $MYSQL_BINLOG $MYSQL_TEST_DIR/std_data/corrupt-relay-bin.000624 > $MYSQLTES
FLUSH LOGS;
--error 1
---exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000017 >/dev/null 2>/dev/null
+--exec $MYSQL_BINLOG --disable-force-if-open $MYSQLD_DATADIR/master-bin.000017 >/dev/null 2>/dev/null
--exec $MYSQL_BINLOG --force-if-open $MYSQLD_DATADIR/master-bin.000017 >/dev/null 2>/dev/null
--echo Bug#31611 Security risk with BINLOG statement
@@ -608,7 +608,7 @@ eval SET GLOBAL SERVER_ID = $old_server_id;
#
# MDEV-12372 mysqlbinlog --version output is the same on 10.x as on 5.5.x, and contains not only version
#
-replace_regex /.*mariadb-binlog(\.exe)? Ver .* for .* at [-_a-zA-Z0-9]+/mariadb-binlog Ver VER for OS at ARCH/;
+replace_regex /for \S+/for OS/ /\d+/#/ /#[-_A-Za-z0-9]*-MariaDB,/#-MariaDB,/ /\(.*\)/(ARCH)/ /^.*binlog(\.exe)?/mariadb-binlog/;
exec $MYSQL_BINLOG --version;
--echo #
diff --git a/mysql-test/main/mysqlbinlog_row_minimal.result b/mysql-test/main/mysqlbinlog_row_minimal.result
index f8795433..88bfe902 100644
--- a/mysql-test/main/mysqlbinlog_row_minimal.result
+++ b/mysql-test/main/mysqlbinlog_row_minimal.result
@@ -55,11 +55,11 @@ START TRANSACTION
/*!*/;
# at 834
# at 908
-#<date> server id 1 end_log_pos 908 CRC32 XXX Annotate_rows:
+#<date> server id 1 end_log_pos 0 CRC32 XXX Annotate_rows:
#Q> INSERT INTO t1 VALUES (10, 1, 2, 3, 4, 5, 6, 7, "")
-#<date> server id 1 end_log_pos 964 CRC32 XXX Table_map: `test`.`t1` mapped to number num
+#<date> server id 1 end_log_pos 0 CRC32 XXX Table_map: `test`.`t1` mapped to number num
# at 964
-#<date> server id 1 end_log_pos 1033 CRC32 XXX Write_rows: table id 32 flags: STMT_END_F
+#<date> server id 1 end_log_pos 0 CRC32 XXX Write_rows: table id 32 flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
@@ -84,11 +84,11 @@ START TRANSACTION
/*!*/;
# at 1148
# at 1224
-#<date> server id 1 end_log_pos 1224 CRC32 XXX Annotate_rows:
+#<date> server id 1 end_log_pos 0 CRC32 XXX Annotate_rows:
#Q> INSERT INTO t1 VALUES (11, 1, 2, 3, 4, 5, 6, 7, NULL)
-#<date> server id 1 end_log_pos 1280 CRC32 XXX Table_map: `test`.`t1` mapped to number num
+#<date> server id 1 end_log_pos 0 CRC32 XXX Table_map: `test`.`t1` mapped to number num
# at 1280
-#<date> server id 1 end_log_pos 1348 CRC32 XXX Write_rows: table id 32 flags: STMT_END_F
+#<date> server id 1 end_log_pos 0 CRC32 XXX Write_rows: table id 32 flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
### @1=11 /* INT meta=0 nullable=0 is_null=0 */
@@ -113,11 +113,11 @@ START TRANSACTION
/*!*/;
# at 1463
# at 1541
-#<date> server id 1 end_log_pos 1541 CRC32 XXX Annotate_rows:
+#<date> server id 1 end_log_pos 0 CRC32 XXX Annotate_rows:
#Q> INSERT INTO t1 VALUES (12, 1, 2, 3, NULL, 5, 6, 7, "A")
-#<date> server id 1 end_log_pos 1597 CRC32 XXX Table_map: `test`.`t1` mapped to number num
+#<date> server id 1 end_log_pos 0 CRC32 XXX Table_map: `test`.`t1` mapped to number num
# at 1597
-#<date> server id 1 end_log_pos 1664 CRC32 XXX Write_rows: table id 32 flags: STMT_END_F
+#<date> server id 1 end_log_pos 0 CRC32 XXX Write_rows: table id 32 flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
### @1=12 /* INT meta=0 nullable=0 is_null=0 */
@@ -142,11 +142,11 @@ START TRANSACTION
/*!*/;
# at 1779
# at 1854
-#<date> server id 1 end_log_pos 1854 CRC32 XXX Annotate_rows:
+#<date> server id 1 end_log_pos 0 CRC32 XXX Annotate_rows:
#Q> INSERT INTO t1 VALUES (13, 1, 2, 3, 0, 5, 6, 7, "A")
-#<date> server id 1 end_log_pos 1910 CRC32 XXX Table_map: `test`.`t1` mapped to number num
+#<date> server id 1 end_log_pos 0 CRC32 XXX Table_map: `test`.`t1` mapped to number num
# at 1910
-#<date> server id 1 end_log_pos 1980 CRC32 XXX Write_rows: table id 32 flags: STMT_END_F
+#<date> server id 1 end_log_pos 0 CRC32 XXX Write_rows: table id 32 flags: STMT_END_F
### INSERT INTO `test`.`t1`
### SET
### @1=13 /* INT meta=0 nullable=0 is_null=0 */
@@ -171,11 +171,11 @@ START TRANSACTION
/*!*/;
# at 2095
# at 2149
-#<date> server id 1 end_log_pos 2149 CRC32 XXX Annotate_rows:
+#<date> server id 1 end_log_pos 0 CRC32 XXX Annotate_rows:
#Q> INSERT INTO t2 SELECT * FROM t1
-#<date> server id 1 end_log_pos 2205 CRC32 XXX Table_map: `test`.`t2` mapped to number num
+#<date> server id 1 end_log_pos 0 CRC32 XXX Table_map: `test`.`t2` mapped to number num
# at 2205
-#<date> server id 1 end_log_pos 2372 CRC32 XXX Write_rows: table id 33 flags: STMT_END_F
+#<date> server id 1 end_log_pos 0 CRC32 XXX Write_rows: table id 33 flags: STMT_END_F
### INSERT INTO `test`.`t2`
### SET
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
@@ -233,11 +233,11 @@ START TRANSACTION
/*!*/;
# at 2487
# at 2553
-#<date> server id 1 end_log_pos 2553 CRC32 XXX Annotate_rows:
+#<date> server id 1 end_log_pos 0 CRC32 XXX Annotate_rows:
#Q> UPDATE t2 SET f4=5 WHERE f4>0 or f4 is NULL
-#<date> server id 1 end_log_pos 2609 CRC32 XXX Table_map: `test`.`t2` mapped to number num
+#<date> server id 1 end_log_pos 0 CRC32 XXX Table_map: `test`.`t2` mapped to number num
# at 2609
-#<date> server id 1 end_log_pos 2675 CRC32 XXX Update_rows: table id 33 flags: STMT_END_F
+#<date> server id 1 end_log_pos 0 CRC32 XXX Update_rows: table id 33 flags: STMT_END_F
### UPDATE `test`.`t2`
### WHERE
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
@@ -266,11 +266,11 @@ START TRANSACTION
/*!*/;
# at 2790
# at 2827
-#<date> server id 1 end_log_pos 2827 CRC32 XXX Annotate_rows:
+#<date> server id 1 end_log_pos 0 CRC32 XXX Annotate_rows:
#Q> DELETE FROM t1
-#<date> server id 1 end_log_pos 2883 CRC32 XXX Table_map: `test`.`t1` mapped to number num
+#<date> server id 1 end_log_pos 0 CRC32 XXX Table_map: `test`.`t1` mapped to number num
# at 2883
-#<date> server id 1 end_log_pos 2937 CRC32 XXX Delete_rows: table id 32 flags: STMT_END_F
+#<date> server id 1 end_log_pos 0 CRC32 XXX Delete_rows: table id 32 flags: STMT_END_F
### DELETE FROM `test`.`t1`
### WHERE
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
@@ -296,11 +296,11 @@ START TRANSACTION
/*!*/;
# at 3052
# at 3089
-#<date> server id 1 end_log_pos 3089 CRC32 XXX Annotate_rows:
+#<date> server id 1 end_log_pos 0 CRC32 XXX Annotate_rows:
#Q> DELETE FROM t2
-#<date> server id 1 end_log_pos 3145 CRC32 XXX Table_map: `test`.`t2` mapped to number num
+#<date> server id 1 end_log_pos 0 CRC32 XXX Table_map: `test`.`t2` mapped to number num
# at 3145
-#<date> server id 1 end_log_pos 3199 CRC32 XXX Delete_rows: table id 33 flags: STMT_END_F
+#<date> server id 1 end_log_pos 0 CRC32 XXX Delete_rows: table id 33 flags: STMT_END_F
### DELETE FROM `test`.`t2`
### WHERE
### @1=10 /* INT meta=0 nullable=0 is_null=0 */
diff --git a/mysql-test/main/mysqld--help.result b/mysql-test/main/mysqld--help.result
index ebff8143..ee75f586 100644
--- a/mysql-test/main/mysqld--help.result
+++ b/mysql-test/main/mysqld--help.result
@@ -98,9 +98,26 @@ The following specify which files/extra groups are read (specified before remain
involve user-defined functions (i.e. UDFs) or the UUID()
function; for those, row-based binary logging is
automatically used.
+ --binlog-gtid-index Enable the creation of a GTID index for every binlog
+ file, and the use of such index for speeding up GTID
+ lookup in the binlog.
+ (Defaults to on; use --skip-binlog-gtid-index to disable.)
+ --binlog-gtid-index-page-size=#
+ Page size to use for the binlog GTID index.
+ --binlog-gtid-index-span-min=#
+ Control sparseness of the binlog GTID index. If set to N,
+ at most one index record will be added for every N bytes
+ of binlog file written, to reduce the size of the index.
+ Normally does not need tuning.
--binlog-ignore-db=name
Tells the master that updates to the given database
should not be logged to the binary log.
+ --binlog-legacy-event-pos
+ Fill in the end_log_pos field of _all_ events in the
+ binlog, even when doing so costs performance. Can be used
+ in case some old application needs it for backwards
+ compatibility. Setting this option can hurt binlog
+ scalability.
--binlog-optimize-thread-scheduling
Run fast part of group commit in a single thread, to
optimize kernel thread scheduling. On by default. Disable
@@ -116,26 +133,36 @@ The following specify which files/extra groups are read (specified before remain
size if possible. The value has to be a multiple of 256.
--binlog-row-image=name
Controls whether rows should be logged in 'FULL',
- 'NOBLOB' or 'MINIMAL' formats. 'FULL', means that all
- columns in the before and after image are logged.
- 'NOBLOB', means that mysqld avoids logging blob columns
- whenever possible (eg, blob column was not changed or is
- not part of primary key). 'MINIMAL', means that a PK
- equivalent (PK columns or full row if there is no PK in
- the table) is logged in the before image, and only
- changed columns are logged in the after image. (Default:
- FULL).
+ 'FULL_NODUP', 'NOBLOB' or 'MINIMAL' formats. 'FULL',
+ means that all columns in the before and after image are
+ logged. 'FULL_NODUP', means that all columns are logged
+ in before image, but only changed columns or all columns
+ of inserted record are logged in after image, 'NOBLOB',
+ means that mysqld avoids logging blob columns whenever
+ possible (eg, blob column was not changed or is not part
+ of primary key). 'MINIMAL', means that a PK equivalent
+ (PK columns or full row if there is no PK in the table)
+ is logged in the before image, and only changed columns
+ are logged in the after image. (Default: FULL).
--binlog-row-metadata=name
Controls whether metadata is logged using FULL , MINIMAL
format and NO_LOG.FULL causes all metadata to be logged;
MINIMAL means that only metadata actually required by
slave is logged; NO_LOG NO metadata will be
logged.Default: NO_LOG.
+ --binlog-space-limit=#
+ Alias for max_binlog_total_size. Compatibility with
+ Percona server.
--binlog-stmt-cache-size=#
The size of the statement cache for updates to
non-transactional engines for the binary log. If you
often use statements updating a great number of rows, you
can increase this to get more performance.
+ --block-encryption-mode=name
+ Default block encryption mode for AES_ENCRYPT() and
+ AES_DECRYPT() functions. One of: aes-128-ecb, aes-192-ecb,
+ aes-256-ecb, aes-128-cbc, aes-192-cbc, aes-256-cbc,
+ aes-128-ctr, aes-192-ctr, aes-256-ctr
--bootstrap Used by mysql installation scripts.
--bulk-insert-buffer-size=#
Size of tree cache used in bulk insert optimisation. Note
@@ -144,6 +171,8 @@ The following specify which files/extra groups are read (specified before remain
Don't ignore client side character set value sent during
handshake.
(Defaults to on; use --skip-character-set-client-handshake to disable.)
+ --character-set-collations=name
+ Overrides for character set default collations.
--character-set-filesystem=name
Set the filesystem character set.
-C, --character-set-server=name
@@ -192,9 +221,6 @@ The following specify which files/extra groups are read (specified before remain
window on windows.
--core-file Write core on crashes
-h, --datadir=name Path to the database root directory
- --date-format=name The DATE format (ignored)
- --datetime-format=name
- The DATETIME format (ignored)
--deadlock-search-depth-long=#
Long search depth for the two-step deadlock detection
--deadlock-search-depth-short=#
@@ -511,8 +537,8 @@ The following specify which files/extra groups are read (specified before remain
--log-slow-admin-statements
Log slow OPTIMIZE, ANALYZE, ALTER and other
administrative statements to the slow log if it is open.
- Resets or sets the option 'admin' in
- log_slow_disabled_statements
+ Resets or sets the option 'admin' in log_slow_filter.
+ Deprecated, use log_slow_filter without 'admin'.
(Defaults to on; use --skip-log-slow-admin-statements to disable.)
--log-slow-disabled-statements=name
Don't log certain types of statements to slow log. Any
@@ -596,6 +622,11 @@ The following specify which files/extra groups are read (specified before remain
exceeds this value.
--max-binlog-stmt-cache-size=#
Sets the total size of the statement cache
+ --max-binlog-total-size=#
+ Maximum space to use for all binary logs. Extra logs are
+ deleted on server start, log rotation, FLUSH LOGS or when
+ writing to binlog. Default is 0, which means no size
+ restrictions. See also slave_connections_needed_for_purge
--max-connect-errors=#
If there is more than this number of interrupted
connections from a host this host will be blocked from
@@ -646,7 +677,6 @@ The following specify which files/extra groups are read (specified before remain
seconds will be aborted. The argument will be treated as
a decimal value with microsecond precision. A value of 0
(default) means no timeout
- --max-tmp-tables=# Unused, will be removed.
--max-user-connections=#
The maximum number of active connections for a single
user (0 = no limit)
@@ -712,16 +742,12 @@ The following specify which files/extra groups are read (specified before remain
Use 'ALL' to set all combinations.
--old Use compatible behavior from previous MariaDB version.
See also --old-mode
- --old-alter-table[=name]
- Alias for alter_algorithm. Deprecated. Use
- --alter-algorithm instead.. One of: DEFAULT, COPY,
- INPLACE, NOCOPY, INSTANT
--old-mode=name Used to emulate old behavior from earlier MariaDB or
MySQL versions. Any combination of:
NO_DUP_KEY_WARNINGS_WITH_IGNORE, NO_PROGRESS_INFO,
ZERO_DATE_TIME_CAST, UTF8_IS_UTF8MB3,
IGNORE_INDEX_ONLY_FOR_JOIN, COMPAT_5_1_CHECKSUM,
- NO_NULL_COLLATION_IDS
+ NO_NULL_COLLATION_IDS, LOCK_ALTER_TABLE_COPY
Use 'ALL' to set all combinations.
--old-passwords Use old password encryption method (needed for 4.0 and
older clients)
@@ -736,21 +762,34 @@ The following specify which files/extra groups are read (specified before remain
max_connections*5 or max_connections + table_cache*2
(whichever is larger) number of file descriptors
(Automatically configured unless set explicitly)
- --optimizer-adjust-secondary-key-costs=name
- A bit field with the following values:
- adjust_secondary_key_cost = Update secondary key costs
- for ranges to be at least 5x of clustered primary key
- costs. disable_max_seek = Disable 'max_seek optimization'
- for secondary keys and slight adjustment of filter cost.
- disable_forced_index_in_group_by = Disable automatic
- forced index in GROUP BY. This variable will be deleted
- in MariaDB 11.0 as it is not needed with the new 11.0
- optimizer.
- Use 'ALL' to set all combinations.
+ --optimizer-adjust-secondary-key-costs=#
+ Unused, will be removed.
+ --optimizer-disk-read-cost=#
+ Cost of reading a block of IO_SIZE (4096) from a disk (in
+ usec).
+ --optimizer-disk-read-ratio=#
+ Chance that we have to do a disk read to find a row or
+ index entry from the engine cache
+ (cache_misses/total_cache_requests). 0.0 means that
+ everything is cached and 1.0 means that nothing is
+ expected to be in the engine cache.
--optimizer-extra-pruning-depth=#
If the optimizer needs to enumerate join prefix of this
size or larger, then it will try aggressively prune away
the search space.
+ --optimizer-index-block-copy-cost=#
+ Cost of copying a key block from the cache to intern
+ storage as part of an index scan.
+ --optimizer-key-compare-cost=#
+ Cost of checking a key against the end key condition.
+ --optimizer-key-copy-cost=#
+ Cost of finding the next key in the engine and copying it
+ to the SQL layer.
+ --optimizer-key-lookup-cost=#
+ Cost for finding a key based on a key value
+ --optimizer-key-next-find-cost=#
+ Cost of finding the next key and rowid when using
+ filters.
--optimizer-max-sel-arg-weight=#
The maximum weight of the SEL_ARG graph. Set to 0 for no
limit
@@ -765,6 +804,21 @@ The following specify which files/extra groups are read (specified before remain
heuristic, thus perform exhaustive search: 1 - prune
plans based on cost and number of retrieved rows eq_ref:
2 - prune also if we find an eq_ref chain
+ --optimizer-row-copy-cost=#
+ Cost of copying a row from the engine or the join cache
+ to the SQL layer.
+ --optimizer-row-lookup-cost=#
+ Cost of finding a row based on a rowid or a clustered
+ key.
+ --optimizer-row-next-find-cost=#
+ Cost of finding the next row when scanning the table.
+ --optimizer-rowid-compare-cost=#
+ Cost of comparing two rowid's
+ --optimizer-rowid-copy-cost=#
+ Cost of copying a rowid
+ --optimizer-scan-setup-cost=#
+ Extra cost added to TABLE and INDEX scans to get
+ optimizer to prefer index lookups.
--optimizer-search-depth=#
Maximum depth of search performed by the query optimizer.
Values larger than the number of relations in a query
@@ -781,20 +835,19 @@ The following specify which files/extra groups are read (specified before remain
list of option=value pairs, where value is on, off, or
default, and options are: index_merge, index_merge_union,
index_merge_sort_union, index_merge_intersection,
- index_merge_sort_intersection, engine_condition_pushdown,
- index_condition_pushdown, derived_merge,
- derived_with_keys, firstmatch, loosescan, materialization,
- in_to_exists, semijoin, partial_match_rowid_merge,
- partial_match_table_scan, subquery_cache, mrr,
- mrr_cost_based, mrr_sort_keys, outer_join_with_cache,
- semijoin_with_cache, join_cache_incremental,
- join_cache_hashed, join_cache_bka,
+ index_merge_sort_intersection, index_condition_pushdown,
+ derived_merge, derived_with_keys, firstmatch, loosescan,
+ materialization, in_to_exists, semijoin,
+ partial_match_rowid_merge, partial_match_table_scan,
+ subquery_cache, mrr, mrr_cost_based, mrr_sort_keys,
+ outer_join_with_cache, semijoin_with_cache,
+ join_cache_incremental, join_cache_hashed, join_cache_bka,
optimize_join_buffer_size, table_elimination,
extended_keys, exists_to_in, orderby_uses_equalities,
condition_pushdown_for_derived, split_materialized,
condition_pushdown_for_subquery, rowid_filter,
condition_pushdown_from_having, not_null_range_scan,
- hash_join_cardinality, cset_narrowing
+ hash_join_cardinality, cset_narrowing, sargable_casefold
--optimizer-trace=name
Controls tracing of the Optimizer:
optimizer_trace=option=val[,option=val...], where option
@@ -818,6 +871,10 @@ The following specify which files/extra groups are read (specified before remain
the cardinality of a partial join.5 - additionally use
selectivity of certain non-range predicates calculated on
record samples
+ --optimizer-where-cost=#
+ Cost of checking the row against the WHERE clause.
+ Increasing this will have the optimizer to prefer plans
+ with less row combinations.
--performance-schema
Enable the performance schema.
--performance-schema-accounts-size=#
@@ -1055,6 +1112,8 @@ The following specify which files/extra groups are read (specified before remain
--read-rnd-buffer-size=#
When reading rows in sorted order after a sort, the rows
are read through this buffer to avoid a disk seeks
+ --redirect-url=name URL of another server to redirect clients to. Empty
+ string means no redirection
--relay-log=name The location and name to use for relay logs.
--relay-log-index=name
The location and name to use for the file that keeps a
@@ -1245,6 +1304,10 @@ The following specify which files/extra groups are read (specified before remain
--skip-slave-start If set, slave is not autostarted.
--slave-compressed-protocol
Use compression on master/slave protocol
+ --slave-connections-needed-for-purge=#
+ Minimum number of connected slaves required for automatic
+ binary log purge with max_binlog_total_size,
+ binlog_expire_logs_seconds or binlog_expire_logs_days.
--slave-ddl-exec-mode=name
How replication events should be executed. Legal values
are STRICT and IDEMPOTENT (default). In IDEMPOTENT mode,
@@ -1487,7 +1550,6 @@ The following specify which files/extra groups are read (specified before remain
worker thread is stalled, additional worker thread may be
created to handle remaining clients.
--thread-stack=# The stack size for each thread
- --time-format=name The TIME format (ignored)
--tls-version=name TLS protocol version for secure connections.. Any
combination of: TLSv1.0, TLSv1.1, TLSv1.2, TLSv1.3
Use 'ALL' to set all combinations.
@@ -1560,13 +1622,20 @@ binlog-direct-non-transactional-updates FALSE
binlog-expire-logs-seconds 0
binlog-file-cache-size 16384
binlog-format MIXED
+binlog-gtid-index TRUE
+binlog-gtid-index-page-size 4096
+binlog-gtid-index-span-min 65536
+binlog-legacy-event-pos FALSE
binlog-optimize-thread-scheduling TRUE
binlog-row-event-max-size 8192
binlog-row-image FULL
binlog-row-metadata NO_LOG
+binlog-space-limit 0
binlog-stmt-cache-size 32768
+block-encryption-mode aes-128-ecb
bulk-insert-buffer-size 8388608
character-set-client-handshake TRUE
+character-set-collations
character-set-filesystem binary
character-sets-dir MYSQL_CHARSETSDIR/
chroot (No default value)
@@ -1578,8 +1647,6 @@ completion-type NO_CHAIN
concurrent-insert AUTO
console TRUE
core-file TRUE
-date-format %Y-%m-%d
-datetime-format %Y-%m-%d %H:%i:%s
deadlock-search-depth-long 15
deadlock-search-depth-short 4
deadlock-timeout-long 50000000
@@ -1627,7 +1694,7 @@ gtid-pos-auto-engines
gtid-strict-mode FALSE
help TRUE
histogram-size 254
-histogram-type DOUBLE_PREC_HB
+histogram-type JSON_HB
host-cache-size 279
idle-readonly-transaction-timeout 0
idle-transaction-timeout 0
@@ -1691,6 +1758,7 @@ max-allowed-packet 16777216
max-binlog-cache-size 18446744073709547520
max-binlog-size 1073741824
max-binlog-stmt-cache-size 18446744073709547520
+max-binlog-total-size 0
max-connect-errors 100
max-delayed-threads 20
max-digest-length 1024
@@ -1708,7 +1776,6 @@ max-session-mem-used 9223372036854775807
max-sort-length 1024
max-sp-recursion-depth 0
max-statement-time 0
-max-tmp-tables 32
max-user-connections 0
max-write-lock-count 18446744073709551615
memlock FALSE
@@ -1732,21 +1799,34 @@ net-retry-count 10
net-write-timeout 60
note-verbosity basic,explain
old FALSE
-old-alter-table DEFAULT
old-mode UTF8_IS_UTF8MB3
old-passwords FALSE
old-style-user-limits FALSE
-optimizer-adjust-secondary-key-costs
+optimizer-adjust-secondary-key-costs 0
+optimizer-disk-read-cost 10.24
+optimizer-disk-read-ratio 0.02
optimizer-extra-pruning-depth 8
+optimizer-index-block-copy-cost 0.0356
+optimizer-key-compare-cost 0.011361
+optimizer-key-copy-cost 0.015685
+optimizer-key-lookup-cost 0.435777
+optimizer-key-next-find-cost 0.082347
optimizer-max-sel-arg-weight 32000
optimizer-max-sel-args 16000
optimizer-prune-level 2
+optimizer-row-copy-cost 0.060866
+optimizer-row-lookup-cost 0.130839
+optimizer-row-next-find-cost 0.045916
+optimizer-rowid-compare-cost 0.002653
+optimizer-rowid-copy-cost 0.002653
+optimizer-scan-setup-cost 10
optimizer-search-depth 62
optimizer-selectivity-sampling-limit 100
-optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on
+optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on,cset_narrowing=off,sargable_casefold=on
optimizer-trace
optimizer-trace-max-mem-size 1048576
optimizer-use-condition-selectivity 4
+optimizer-where-cost 0.032
performance-schema FALSE
performance-schema-accounts-size -1
performance-schema-consumer-events-stages-current FALSE
@@ -1825,6 +1905,7 @@ read-binlog-speed-limit 0
read-buffer-size 131072
read-only FALSE
read-rnd-buffer-size 262144
+redirect-url
relay-log (No default value)
relay-log-index (No default value)
relay-log-info-file relay-log.info
@@ -1856,7 +1937,7 @@ secure-timestamp NO
server-id 1
session-track-schema TRUE
session-track-state-change FALSE
-session-track-system-variables autocommit,character_set_client,character_set_connection,character_set_results,time_zone
+session-track-system-variables autocommit,character_set_client,character_set_connection,character_set_results,redirect_url,time_zone
session-track-transaction-info OFF
show-slave-auth-info FALSE
silent-startup FALSE
@@ -1866,6 +1947,7 @@ skip-networking FALSE
skip-show-database FALSE
skip-slave-start FALSE
slave-compressed-protocol FALSE
+slave-connections-needed-for-purge 1
slave-ddl-exec-mode IDEMPOTENT
slave-domain-parallel-threads 0
slave-exec-mode STRICT
@@ -1917,7 +1999,6 @@ thread-pool-prio-kickup-timer 1000
thread-pool-priority auto
thread-pool-stall-limit 500
thread-stack 299008
-time-format %H:%i:%s
tmp-disk-table-size 18446744073709551615
tmp-memory-table-size 16777216
tmp-table-size 16777216
diff --git a/mysql-test/main/mysqldump-compat-102.result b/mysql-test/main/mysqldump-compat-102.result
index d5ed5457..cf8e9a6b 100644
--- a/mysql-test/main/mysqldump-compat-102.result
+++ b/mysql-test/main/mysqldump-compat-102.result
@@ -73,7 +73,7 @@ $$
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
--
-- Dumping routines for database 'db1_mdev17429'
@@ -104,7 +104,7 @@ DELIMITER ;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
-- Dump completed on TIMESTAMP
DROP DATABASE db1_mdev17429;
diff --git a/mysql-test/main/mysqldump-max.result b/mysql-test/main/mysqldump-max.result
index e76193ac..8c67b691 100644
--- a/mysql-test/main/mysqldump-max.result
+++ b/mysql-test/main/mysqldump-max.result
@@ -88,7 +88,7 @@ id name
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */;
@@ -203,7 +203,7 @@ INSERT IGNORE INTO `t6` VALUES
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
/*!999999\- enable the sandbox mode */
@@ -216,7 +216,7 @@ INSERT IGNORE INTO `t6` VALUES
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */;
@@ -331,7 +331,7 @@ INSERT INTO `t6` VALUES
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
drop table t1;
drop table t2;
diff --git a/mysql-test/main/mysqldump-system,win.rdiff b/mysql-test/main/mysqldump-system,win.rdiff
index 57ce772a..50c08438 100644
--- a/mysql-test/main/mysqldump-system,win.rdiff
+++ b/mysql-test/main/mysqldump-system,win.rdiff
@@ -3,24 +3,24 @@
@@ -449,9 +449,9 @@
Table Checksum
mysql.roles_mapping 2510045525
- mysql.time_zone_transition 3895294076
+ mysql.time_zone_transition 3719776009
-mysql.plugin 1587119305
+mysql.plugin 2184891911
mysql.servers 2079085450
-mysql.func 3241572444
+mysql.func 310494789
- mysql.innodb_table_stats 347867921
- mysql.table_stats 664320059
+ mysql.innodb_table_stats 1285726777
+ mysql.table_stats 2836905944
# Opps....
@@ -484,9 +484,9 @@
Table Checksum
mysql.roles_mapping 2510045525
- mysql.time_zone_transition 3895294076
+ mysql.time_zone_transition 3719776009
-mysql.plugin 1587119305
+mysql.plugin 2184891911
mysql.servers 2079085450
-mysql.func 3241572444
+mysql.func 310494789
- mysql.innodb_table_stats 347867921
- mysql.table_stats 664320059
+ mysql.innodb_table_stats 1285726777
+ mysql.table_stats 2836905944
DROP FUNCTION IF EXISTS metaphon;
diff --git a/mysql-test/main/mysqldump-system.result b/mysql-test/main/mysqldump-system.result
index 240a8499..59c0a09e 100644
--- a/mysql-test/main/mysqldump-system.result
+++ b/mysql-test/main/mysqldump-system.result
@@ -52,7 +52,7 @@ CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
INSTALL PLUGIN test_plugin_server SONAME 'AUTH_TEST_PLUGIN_LIB';
INSTALL PLUGIN cleartext_plugin_server SONAME 'AUTH_TEST_PLUGIN_LIB';
CREATE USER `mariadb.sys`@`localhost` PASSWORD EXPIRE;
@@ -97,29 +97,29 @@ USE mysql;
LOCK TABLES `column_stats` WRITE;
/*!40000 ALTER TABLE `column_stats` DISABLE KEYS */;
REPLACE INTO `column_stats` VALUES
-('mysql','tz','Time_zone_id','1','5',0.0000,4.0000,98.2500,4,'JSON_HB','{\"target_histogram_size\": 254, \"collected_at\": \"2022-01-07 07:07:00\", \"collected_by\": \"version\", \"histogram_hb\": [{\"start\": \"1\", \"size\": 0.340966921, \"ndv\": 1}, {\"start\": \"3\", \"size\": 0.328244275, \"ndv\": 1}, {\"start\": \"4\", \"size\": 0.328244275, \"ndv\": 1}, {\"start\": \"5\", \"end\": \"5\", \"size\": 0.002544529, \"ndv\": 1}]}');
+('mysql','tz','Time_zone_id','1','6',0.0000,4.0000,78.8000,4,'JSON_HB','{\"target_histogram_size\": 254, \"collected_at\": \"2022-01-07 07:07:00\", \"collected_by\": \"version\", \"histogram_hb\": [{\"start\": \"1\", \"size\": 0.340101523, \"ndv\": 1}, {\"start\": \"3\", \"size\": 0.327411168, \"ndv\": 1}, {\"start\": \"4\", \"size\": 0.327411168, \"ndv\": 1}, {\"start\": \"5\", \"end\": \"6\", \"size\": 0.005076142, \"ndv\": 2}]}');
/*!40000 ALTER TABLE `column_stats` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `index_stats` WRITE;
/*!40000 ALTER TABLE `index_stats` DISABLE KEYS */;
REPLACE INTO `index_stats` VALUES
-('mysql','tz','PRIMARY',1,98.2500);
+('mysql','tz','PRIMARY',1,78.8000);
/*!40000 ALTER TABLE `index_stats` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `table_stats` WRITE;
/*!40000 ALTER TABLE `table_stats` DISABLE KEYS */;
REPLACE INTO `table_stats` VALUES
-('mysql','tz',393);
+('mysql','tz',394);
/*!40000 ALTER TABLE `table_stats` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `innodb_index_stats` WRITE;
/*!40000 ALTER TABLE `innodb_index_stats` DISABLE KEYS */;
REPLACE INTO `innodb_index_stats` VALUES
-('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',4,1,'Time_zone_id'),
-('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',393,1,'Time_zone_id,Transition_time'),
+('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',5,1,'Time_zone_id'),
+('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',394,1,'Time_zone_id,Transition_time'),
('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),
('mysql','tz','PRIMARY','2019-12-31 21:00:00','size',1,NULL,'Number of pages in the index');
/*!40000 ALTER TABLE `innodb_index_stats` ENABLE KEYS */;
@@ -128,7 +128,7 @@ UNLOCK TABLES;
LOCK TABLES `innodb_table_stats` WRITE;
/*!40000 ALTER TABLE `innodb_table_stats` DISABLE KEYS */;
REPLACE INTO `innodb_table_stats` VALUES
-('mysql','tz','2019-12-31 21:00:00',393,1,0);
+('mysql','tz','2019-12-31 21:00:00',394,1,0);
/*!40000 ALTER TABLE `innodb_table_stats` ENABLE KEYS */;
UNLOCK TABLES;
@@ -141,7 +141,8 @@ REPLACE INTO `time_zone` VALUES
(2,'N'),
(3,'N'),
(4,'Y'),
-(5,'N');
+(5,'N'),
+(6,'Y');
/*!40000 ALTER TABLE `time_zone` ENABLE KEYS */;
UNLOCK TABLES;
@@ -149,6 +150,7 @@ LOCK TABLES `time_zone_name` WRITE;
/*!40000 ALTER TABLE `time_zone_name` DISABLE KEYS */;
REPLACE INTO `time_zone_name` VALUES
('Europe/Moscow',3),
+('India/Kolkata',6),
('Japan',5),
('leap/Europe/Moscow',4),
('MET',1),
@@ -160,6 +162,7 @@ UNLOCK TABLES;
LOCK TABLES `time_zone_leap_second` WRITE;
/*!40000 ALTER TABLE `time_zone_leap_second` DISABLE KEYS */;
REPLACE INTO `time_zone_leap_second` VALUES
+(174834660,1),
(78796800,1),
(94694401,2),
(126230402,3),
@@ -580,7 +583,8 @@ REPLACE INTO `time_zone_transition` VALUES
(4,2108588422,8),
(4,2121894022,9),
(4,2140038022,8),
-(5,-1009875600,1);
+(5,-1009875600,1),
+(6,174834660,1);
/*!40000 ALTER TABLE `time_zone_transition` ENABLE KEYS */;
UNLOCK TABLES;
@@ -617,7 +621,8 @@ REPLACE INTO `time_zone_transition_type` VALUES
(4,10,10800,1,'EEST'),
(4,11,7200,0,'EET'),
(5,0,32400,0,'CJT'),
-(5,1,32400,0,'JST');
+(5,1,32400,0,'JST'),
+(6,1,19800,0,'IST');
/*!40000 ALTER TABLE `time_zone_transition_type` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -628,7 +633,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
#
# mysqldump of system tables with --system=all --replace
@@ -644,7 +649,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
/*M!100401 UNINSTALL PLUGIN IF EXIST test_plugin_server */;
INSTALL PLUGIN test_plugin_server SONAME 'AUTH_TEST_PLUGIN_LIB';
/*M!100401 UNINSTALL PLUGIN IF EXIST cleartext_plugin_server */;
@@ -712,29 +717,29 @@ USE mysql;
LOCK TABLES `column_stats` WRITE;
/*!40000 ALTER TABLE `column_stats` DISABLE KEYS */;
REPLACE INTO `column_stats` VALUES
-('mysql','tz','Time_zone_id','1','5',0.0000,4.0000,98.2500,4,'JSON_HB','{\"target_histogram_size\": 254, \"collected_at\": \"2022-01-07 07:07:00\", \"collected_by\": \"version\", \"histogram_hb\": [{\"start\": \"1\", \"size\": 0.340966921, \"ndv\": 1}, {\"start\": \"3\", \"size\": 0.328244275, \"ndv\": 1}, {\"start\": \"4\", \"size\": 0.328244275, \"ndv\": 1}, {\"start\": \"5\", \"end\": \"5\", \"size\": 0.002544529, \"ndv\": 1}]}');
+('mysql','tz','Time_zone_id','1','6',0.0000,4.0000,78.8000,4,'JSON_HB','{\"target_histogram_size\": 254, \"collected_at\": \"2022-01-07 07:07:00\", \"collected_by\": \"version\", \"histogram_hb\": [{\"start\": \"1\", \"size\": 0.340101523, \"ndv\": 1}, {\"start\": \"3\", \"size\": 0.327411168, \"ndv\": 1}, {\"start\": \"4\", \"size\": 0.327411168, \"ndv\": 1}, {\"start\": \"5\", \"end\": \"6\", \"size\": 0.005076142, \"ndv\": 2}]}');
/*!40000 ALTER TABLE `column_stats` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `index_stats` WRITE;
/*!40000 ALTER TABLE `index_stats` DISABLE KEYS */;
REPLACE INTO `index_stats` VALUES
-('mysql','tz','PRIMARY',1,98.2500);
+('mysql','tz','PRIMARY',1,78.8000);
/*!40000 ALTER TABLE `index_stats` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `table_stats` WRITE;
/*!40000 ALTER TABLE `table_stats` DISABLE KEYS */;
REPLACE INTO `table_stats` VALUES
-('mysql','tz',393);
+('mysql','tz',394);
/*!40000 ALTER TABLE `table_stats` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `innodb_index_stats` WRITE;
/*!40000 ALTER TABLE `innodb_index_stats` DISABLE KEYS */;
REPLACE INTO `innodb_index_stats` VALUES
-('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',4,1,'Time_zone_id'),
-('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',393,1,'Time_zone_id,Transition_time'),
+('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',5,1,'Time_zone_id'),
+('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',394,1,'Time_zone_id,Transition_time'),
('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),
('mysql','tz','PRIMARY','2019-12-31 21:00:00','size',1,NULL,'Number of pages in the index');
/*!40000 ALTER TABLE `innodb_index_stats` ENABLE KEYS */;
@@ -743,7 +748,7 @@ UNLOCK TABLES;
LOCK TABLES `innodb_table_stats` WRITE;
/*!40000 ALTER TABLE `innodb_table_stats` DISABLE KEYS */;
REPLACE INTO `innodb_table_stats` VALUES
-('mysql','tz','2019-12-31 21:00:00',393,1,0);
+('mysql','tz','2019-12-31 21:00:00',394,1,0);
/*!40000 ALTER TABLE `innodb_table_stats` ENABLE KEYS */;
UNLOCK TABLES;
@@ -756,7 +761,8 @@ REPLACE INTO `time_zone` VALUES
(2,'N'),
(3,'N'),
(4,'Y'),
-(5,'N');
+(5,'N'),
+(6,'Y');
/*!40000 ALTER TABLE `time_zone` ENABLE KEYS */;
UNLOCK TABLES;
@@ -764,6 +770,7 @@ LOCK TABLES `time_zone_name` WRITE;
/*!40000 ALTER TABLE `time_zone_name` DISABLE KEYS */;
REPLACE INTO `time_zone_name` VALUES
('Europe/Moscow',3),
+('India/Kolkata',6),
('Japan',5),
('leap/Europe/Moscow',4),
('MET',1),
@@ -775,6 +782,7 @@ UNLOCK TABLES;
LOCK TABLES `time_zone_leap_second` WRITE;
/*!40000 ALTER TABLE `time_zone_leap_second` DISABLE KEYS */;
REPLACE INTO `time_zone_leap_second` VALUES
+(174834660,1),
(78796800,1),
(94694401,2),
(126230402,3),
@@ -1195,7 +1203,8 @@ REPLACE INTO `time_zone_transition` VALUES
(4,2108588422,8),
(4,2121894022,9),
(4,2140038022,8),
-(5,-1009875600,1);
+(5,-1009875600,1),
+(6,174834660,1);
/*!40000 ALTER TABLE `time_zone_transition` ENABLE KEYS */;
UNLOCK TABLES;
@@ -1232,7 +1241,8 @@ REPLACE INTO `time_zone_transition_type` VALUES
(4,10,10800,1,'EEST'),
(4,11,7200,0,'EET'),
(5,0,32400,0,'CJT'),
-(5,1,32400,0,'JST');
+(5,1,32400,0,'JST'),
+(6,1,19800,0,'IST');
/*!40000 ALTER TABLE `time_zone_transition_type` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -1243,7 +1253,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
#
# mysqldump of system tables with --system=all --insert-ignore
@@ -1259,7 +1269,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
INSTALL PLUGIN test_plugin_server /*M!100401 IF NOT EXISTS */ SONAME 'AUTH_TEST_PLUGIN_LIB';
INSTALL PLUGIN cleartext_plugin_server /*M!100401 IF NOT EXISTS */ SONAME 'AUTH_TEST_PLUGIN_LIB';
CREATE USER IF NOT EXISTS `mariadb.sys`@`localhost` PASSWORD EXPIRE;
@@ -1304,29 +1314,29 @@ USE mysql;
LOCK TABLES `column_stats` WRITE;
/*!40000 ALTER TABLE `column_stats` DISABLE KEYS */;
INSERT IGNORE INTO `column_stats` VALUES
-('mysql','tz','Time_zone_id','1','5',0.0000,4.0000,98.2500,4,'JSON_HB','{\"target_histogram_size\": 254, \"collected_at\": \"2022-01-07 07:07:00\", \"collected_by\": \"version\", \"histogram_hb\": [{\"start\": \"1\", \"size\": 0.340966921, \"ndv\": 1}, {\"start\": \"3\", \"size\": 0.328244275, \"ndv\": 1}, {\"start\": \"4\", \"size\": 0.328244275, \"ndv\": 1}, {\"start\": \"5\", \"end\": \"5\", \"size\": 0.002544529, \"ndv\": 1}]}');
+('mysql','tz','Time_zone_id','1','6',0.0000,4.0000,78.8000,4,'JSON_HB','{\"target_histogram_size\": 254, \"collected_at\": \"2022-01-07 07:07:00\", \"collected_by\": \"version\", \"histogram_hb\": [{\"start\": \"1\", \"size\": 0.340101523, \"ndv\": 1}, {\"start\": \"3\", \"size\": 0.327411168, \"ndv\": 1}, {\"start\": \"4\", \"size\": 0.327411168, \"ndv\": 1}, {\"start\": \"5\", \"end\": \"6\", \"size\": 0.005076142, \"ndv\": 2}]}');
/*!40000 ALTER TABLE `column_stats` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `index_stats` WRITE;
/*!40000 ALTER TABLE `index_stats` DISABLE KEYS */;
INSERT IGNORE INTO `index_stats` VALUES
-('mysql','tz','PRIMARY',1,98.2500);
+('mysql','tz','PRIMARY',1,78.8000);
/*!40000 ALTER TABLE `index_stats` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `table_stats` WRITE;
/*!40000 ALTER TABLE `table_stats` DISABLE KEYS */;
INSERT IGNORE INTO `table_stats` VALUES
-('mysql','tz',393);
+('mysql','tz',394);
/*!40000 ALTER TABLE `table_stats` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `innodb_index_stats` WRITE;
/*!40000 ALTER TABLE `innodb_index_stats` DISABLE KEYS */;
INSERT IGNORE INTO `innodb_index_stats` VALUES
-('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',4,1,'Time_zone_id'),
-('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',393,1,'Time_zone_id,Transition_time'),
+('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx01',5,1,'Time_zone_id'),
+('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_diff_pfx02',394,1,'Time_zone_id,Transition_time'),
('mysql','tz','PRIMARY','2019-12-31 21:00:00','n_leaf_pages',1,NULL,'Number of leaf pages in the index'),
('mysql','tz','PRIMARY','2019-12-31 21:00:00','size',1,NULL,'Number of pages in the index');
/*!40000 ALTER TABLE `innodb_index_stats` ENABLE KEYS */;
@@ -1335,7 +1345,7 @@ UNLOCK TABLES;
LOCK TABLES `innodb_table_stats` WRITE;
/*!40000 ALTER TABLE `innodb_table_stats` DISABLE KEYS */;
INSERT IGNORE INTO `innodb_table_stats` VALUES
-('mysql','tz','2019-12-31 21:00:00',393,1,0);
+('mysql','tz','2019-12-31 21:00:00',394,1,0);
/*!40000 ALTER TABLE `innodb_table_stats` ENABLE KEYS */;
UNLOCK TABLES;
@@ -1348,7 +1358,8 @@ INSERT IGNORE INTO `time_zone` VALUES
(2,'N'),
(3,'N'),
(4,'Y'),
-(5,'N');
+(5,'N'),
+(6,'Y');
/*!40000 ALTER TABLE `time_zone` ENABLE KEYS */;
UNLOCK TABLES;
@@ -1356,6 +1367,7 @@ LOCK TABLES `time_zone_name` WRITE;
/*!40000 ALTER TABLE `time_zone_name` DISABLE KEYS */;
INSERT IGNORE INTO `time_zone_name` VALUES
('Europe/Moscow',3),
+('India/Kolkata',6),
('Japan',5),
('leap/Europe/Moscow',4),
('MET',1),
@@ -1367,6 +1379,7 @@ UNLOCK TABLES;
LOCK TABLES `time_zone_leap_second` WRITE;
/*!40000 ALTER TABLE `time_zone_leap_second` DISABLE KEYS */;
INSERT IGNORE INTO `time_zone_leap_second` VALUES
+(174834660,1),
(78796800,1),
(94694401,2),
(126230402,3),
@@ -1787,7 +1800,8 @@ INSERT IGNORE INTO `time_zone_transition` VALUES
(4,2108588422,8),
(4,2121894022,9),
(4,2140038022,8),
-(5,-1009875600,1);
+(5,-1009875600,1),
+(6,174834660,1);
/*!40000 ALTER TABLE `time_zone_transition` ENABLE KEYS */;
UNLOCK TABLES;
@@ -1824,7 +1838,8 @@ INSERT IGNORE INTO `time_zone_transition_type` VALUES
(4,10,10800,1,'EEST'),
(4,11,7200,0,'EET'),
(5,0,32400,0,'CJT'),
-(5,1,32400,0,'JST');
+(5,1,32400,0,'JST'),
+(6,1,19800,0,'IST');
/*!40000 ALTER TABLE `time_zone_transition_type` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -1835,7 +1850,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
SELECT * FROM mysql.global_priv ORDER BY User,Host;
Host User Priv
@@ -1848,12 +1863,12 @@ CHECKSUM TABLE mysql.roles_mapping, mysql.time_zone_transition, mysql.plugin,
mysql.servers, mysql.func, mysql.innodb_table_stats, mysql.table_stats;
Table Checksum
mysql.roles_mapping 2510045525
-mysql.time_zone_transition 3895294076
+mysql.time_zone_transition 3719776009
mysql.plugin 1587119305
mysql.servers 2079085450
mysql.func 3241572444
-mysql.innodb_table_stats 347867921
-mysql.table_stats 664320059
+mysql.innodb_table_stats 1285726777
+mysql.table_stats 2836905944
# Opps....
CREATE USER mariadb_test_restore IDENTIFIED BY 'getitback';
GRANT ALL ON *.* TO mariadb_test_restore WITH GRANT OPTION;
@@ -1878,17 +1893,17 @@ Host User Priv
localhost mariadb.sys {"access":0,"version_id":VERSION,"plugin":"mysql_native_password","authentication_string":"","password_last_changed":NOW,"password_lifetime":-1,"default_role":""}
role_1 {"access":16384,"version_id":VERSION,"is_role":true}
role_2 {"access":0,"version_id":VERSION,"is_role":true}
-localhost root {"access":549755813887,"version_id":VERSION,"plugin":"mysql_native_password","authentication_string":"","password_last_changed":NOW,"default_role":""}
+localhost root {"access":1099511627775,"version_id":VERSION,"plugin":"mysql_native_password","authentication_string":"","password_last_changed":NOW,"default_role":""}
CHECKSUM TABLE mysql.roles_mapping, mysql.time_zone_transition, mysql.plugin,
mysql.servers, mysql.func, mysql.innodb_table_stats, mysql.table_stats;
Table Checksum
mysql.roles_mapping 2510045525
-mysql.time_zone_transition 3895294076
+mysql.time_zone_transition 3719776009
mysql.plugin 1587119305
mysql.servers 2079085450
mysql.func 3241572444
-mysql.innodb_table_stats 347867921
-mysql.table_stats 664320059
+mysql.innodb_table_stats 1285726777
+mysql.table_stats 2836905944
DROP FUNCTION IF EXISTS metaphon;
DROP SERVER s1;
DELETE FROM mysql.column_stats WHERE db_name='mysql' and table_name in ('tz', 'gtid_slave_pos');
diff --git a/mysql-test/main/mysqldump-timing.result b/mysql-test/main/mysqldump-timing.result
index 5e2851b8..439339d7 100644
--- a/mysql-test/main/mysqldump-timing.result
+++ b/mysql-test/main/mysqldump-timing.result
@@ -18,7 +18,7 @@ timeout without t1 contents expected
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -42,7 +42,7 @@ This would be a race condition otherwise, but default max_statement_time=0 makes
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -65,7 +65,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
SET GLOBAL max_statement_time=@save_max_statement_time;
DROP DATABASE test1;
diff --git a/mysql-test/main/mysqldump-utf8mb4.result b/mysql-test/main/mysqldump-utf8mb4.result
index 7c5aea5f..c75afc2d 100644
--- a/mysql-test/main/mysqldump-utf8mb4.result
+++ b/mysql-test/main/mysqldump-utf8mb4.result
@@ -43,7 +43,7 @@ Testing text format output
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -69,7 +69,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
DROP TABLE t1;
----
diff --git a/mysql-test/main/mysqldump-win.opt b/mysql-test/main/mysqldump-win.opt
new file mode 100644
index 00000000..e534ae1e
--- /dev/null
+++ b/mysql-test/main/mysqldump-win.opt
@@ -0,0 +1 @@
+--loose-enable-named-pipe
diff --git a/mysql-test/main/mysqldump-win.result b/mysql-test/main/mysqldump-win.result
new file mode 100644
index 00000000..8f889a60
--- /dev/null
+++ b/mysql-test/main/mysqldump-win.result
@@ -0,0 +1,9 @@
+# Test mysqldump specific features (pipe connection, with parallel)
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES(1);
+DROP TABLE t1;
+test.t1: Records: 1 Deleted: 0 Skipped: 0 Warnings: 0
+SELECT * FROM t1;
+i
+1
+DROP TABLE t1;
diff --git a/mysql-test/main/mysqldump-win.test b/mysql-test/main/mysqldump-win.test
new file mode 100644
index 00000000..4088c4a8
--- /dev/null
+++ b/mysql-test/main/mysqldump-win.test
@@ -0,0 +1,14 @@
+--source include/windows.inc
+--source include/not_embedded.inc
+
+--echo # Test mysqldump specific features (pipe connection, with parallel)
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES(1);
+
+--exec $MYSQL_DUMP --host=. --tab=$MYSQLTEST_VARDIR/tmp/ test --parallel=2
+DROP TABLE t1;
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/t1.sql
+--exec $MYSQL_IMPORT test $MYSQLTEST_VARDIR/tmp/t1.txt
+SELECT * FROM t1;
+DROP TABLE t1;
+
diff --git a/mysql-test/main/mysqldump.result b/mysql-test/main/mysqldump.result
index b1279320..f814e9c4 100644
--- a/mysql-test/main/mysqldump.result
+++ b/mysql-test/main/mysqldump.result
@@ -111,7 +111,7 @@ INSERT INTO `t1` VALUES
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -139,7 +139,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
/*!999999\- enable the sandbox mode */
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
@@ -147,7 +147,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` (
@@ -167,7 +167,7 @@ INSERT INTO `t1` VALUES
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
DROP TABLE t1;
CREATE TABLE t1(a int, b text, c varchar(3));
@@ -234,7 +234,7 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL);
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -257,7 +257,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
DROP TABLE t1;
#
@@ -271,7 +271,7 @@ INSERT INTO t1 VALUES (1), (2);
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL40' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
@@ -289,7 +289,7 @@ UNLOCK TABLES;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
/*!999999\- enable the sandbox mode */
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
@@ -297,7 +297,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
@@ -315,7 +315,7 @@ UNLOCK TABLES;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
DROP TABLE t1;
#
@@ -345,7 +345,7 @@ create table t1(a int);
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -366,7 +366,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
/*!999999\- enable the sandbox mode */
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
@@ -374,7 +374,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS "t1";
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -392,7 +392,7 @@ UNLOCK TABLES;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
set global sql_mode='ANSI_QUOTES';
/*!999999\- enable the sandbox mode */
@@ -406,7 +406,7 @@ set global sql_mode='ANSI_QUOTES';
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -427,7 +427,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
/*!999999\- enable the sandbox mode */
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
@@ -435,7 +435,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS "t1";
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -453,7 +453,7 @@ UNLOCK TABLES;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
set global sql_mode=default;
drop table t1;
@@ -471,7 +471,7 @@ insert into t1 values (1),(2),(3);
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -486,7 +486,7 @@ CREATE TABLE `t1` (
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
1
2
@@ -506,7 +506,7 @@ drop table t1;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */;
@@ -519,7 +519,7 @@ USE `test`;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
create database mysqldump_test_db character set latin2 collate latin2_bin;
/*!999999\- enable the sandbox mode */
@@ -533,7 +533,7 @@ create database mysqldump_test_db character set latin2 collate latin2_bin;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CHARACTER SET latin2 COLLATE latin2_bin */;
@@ -546,7 +546,7 @@ USE `mysqldump_test_db`;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
drop database mysqldump_test_db;
#
@@ -568,7 +568,7 @@ INSERT INTO t1 VALUES (_latin1 'ÄÖÜß');
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -591,7 +591,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
#
# Bug#8063 make test mysqldump [ fail ]
@@ -606,7 +606,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a` char(10) DEFAULT NULL
@@ -623,7 +623,7 @@ UNLOCK TABLES;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
/*!999999\- enable the sandbox mode */
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
@@ -631,7 +631,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a` char(10) DEFAULT NULL
@@ -648,7 +648,7 @@ UNLOCK TABLES;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
/*!999999\- enable the sandbox mode */
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
@@ -656,7 +656,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a` char(10) DEFAULT NULL
@@ -673,7 +673,7 @@ UNLOCK TABLES;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
DROP TABLE t1;
#
@@ -694,7 +694,7 @@ INSERT INTO t2 VALUES (4),(5),(6);
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -719,7 +719,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
DROP TABLE t1;
DROP TABLE t2;
@@ -739,7 +739,7 @@ INSERT INTO `t1` VALUES (0x602010000280100005E71A);
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -761,7 +761,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
DROP TABLE t1;
#
@@ -781,7 +781,7 @@ INSERT INTO t1 VALUES (4),(5),(6);
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -809,7 +809,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
/*!999999\- enable the sandbox mode */
@@ -822,7 +822,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -848,7 +848,7 @@ INSERT DELAYED IGNORE INTO `t1` VALUES
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
DROP TABLE t1;
#
@@ -1198,7 +1198,7 @@ insert into t1 (F_8d3bba7425e7c98c50f52ca1b52d3735) values (1);
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -1549,7 +1549,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
drop table t1;
#
@@ -1568,7 +1568,7 @@ INSERT INTO t1 VALUES (1),(2),(3);
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
/*!40000 DROP DATABASE IF EXISTS `test`*/;
@@ -1599,7 +1599,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
DROP TABLE t1;
#
@@ -1622,7 +1622,7 @@ INSERT INTO t2 VALUES (1), (2);
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -1645,7 +1645,7 @@ CREATE TABLE `t2` (
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
/*!999999\- enable the sandbox mode */
@@ -1658,7 +1658,7 @@ CREATE TABLE `t2` (
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -1681,7 +1681,7 @@ CREATE TABLE `t2` (
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
<?xml version="1.0"?>
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
@@ -1820,7 +1820,7 @@ insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thir
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
@@ -1847,7 +1847,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
/*!999999\- enable the sandbox mode */
@@ -1860,7 +1860,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -1908,7 +1908,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
drop table t1, t2;
#
@@ -1986,7 +1986,7 @@ mariadb-dump: Couldn't find table: "non_existing"
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t3`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -2016,7 +2016,7 @@ CREATE TABLE `t2` (
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
drop table t1, t2, t3;
#
@@ -2036,7 +2036,7 @@ mariadb-dump: Got error: 1064: "You have an error in your SQL syntax; check the
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -2053,7 +2053,7 @@ CREATE TABLE `t1` (
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
drop table t1;
#
@@ -2073,7 +2073,7 @@ insert into t1 values (0815, 4711, 2006);
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS "t1";
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -2096,7 +2096,7 @@ UNLOCK TABLES;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
/*!999999\- enable the sandbox mode */
@@ -2109,7 +2109,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -2135,7 +2135,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
DROP TABLE `t1`;
End of 4.1 tests
@@ -2165,7 +2165,7 @@ create view v2 as select * from t2 where a like 'a%' with check option;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -2214,7 +2214,7 @@ SET character_set_client = @saved_cs_client;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
drop table t2;
drop view v2;
@@ -2265,7 +2265,7 @@ create view v1 as select * from t1;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -2306,7 +2306,7 @@ SET character_set_client = @saved_cs_client;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
drop view v1;
drop table t1;
@@ -2336,7 +2336,7 @@ create view v2 as select * from t2 where a like 'a%' with check option;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -2385,7 +2385,7 @@ SET character_set_client = @saved_cs_client;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
drop table t2;
drop view v2;
@@ -2407,7 +2407,7 @@ INSERT INTO t1 VALUES ('\'');
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -2430,7 +2430,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
DROP TABLE t1;
#
@@ -2455,7 +2455,7 @@ select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -2546,7 +2546,7 @@ SET character_set_client = @saved_cs_client;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
drop view v1, v2, v3;
drop table t1;
@@ -2608,7 +2608,7 @@ update t1 set a = 4 where a=3;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */;
@@ -2729,7 +2729,7 @@ DELIMITER ;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
/*!999999\- enable the sandbox mode */
@@ -2742,7 +2742,7 @@ DELIMITER ;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */;
@@ -2785,7 +2785,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
drop table t1;
show tables;
@@ -2878,8 +2878,6 @@ CREATE PROCEDURE bug9056_proc2(OUT a INT)
BEGIN
select sum(id) from t1 into a;
END //
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
set sql_mode='ansi';
create procedure `a'b` () select 1;
set sql_mode='';
@@ -2894,7 +2892,7 @@ set sql_mode='';
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */;
@@ -3015,7 +3013,7 @@ DELIMITER ;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
DROP FUNCTION bug9056_func1;
DROP FUNCTION bug9056_func2;
@@ -3051,7 +3049,7 @@ set global time_zone='Europe/Moscow';
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */;
@@ -3080,7 +3078,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
/*!999999\- enable the sandbox mode */
@@ -3091,7 +3089,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */;
@@ -3119,7 +3117,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
drop table t1;
set global time_zone=default;
@@ -3151,7 +3149,7 @@ a2
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS "t1 test";
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -3205,7 +3203,7 @@ UNLOCK TABLES;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
DROP TRIGGER `test trig`;
DROP TABLE `t1 test`;
@@ -3237,7 +3235,7 @@ a b c
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */;
@@ -3336,7 +3334,7 @@ USE `test`;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
drop view v2;
drop view v0;
@@ -3366,7 +3364,7 @@ SET SQL_MODE = @old_sql_mode;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */;
@@ -3410,7 +3408,7 @@ DELIMITER ;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
DROP TRIGGER tr1;
DROP TABLE t1;
@@ -3430,7 +3428,7 @@ insert into t1 values ('','');
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -3453,7 +3451,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
/*!999999\- enable the sandbox mode */
@@ -3466,7 +3464,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -3490,7 +3488,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
drop table t1;
#
@@ -3646,7 +3644,7 @@ insert into t1 values (0815);
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
/*!40000 DROP DATABASE IF EXISTS `mysqldump_test_db`*/;
@@ -3700,7 +3698,7 @@ USE `mysqldump_test_db`;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
drop view v1;
drop table t1;
@@ -3804,9 +3802,9 @@ mariadb-dump: Couldn't execute 'FLUSH /*!40101 LOCAL */ TABLES': Access denied;
mariadb-dump: Couldn't execute 'FLUSH /*!40101 LOCAL */ TABLES': Access denied; you need (at least one of) the RELOAD privilege(s) for this operation (1227)
/*!999999\- enable the sandbox mode */
grant RELOAD on *.* to mysqltest_1@localhost;
-mariadb-dump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need (at least one of) the SUPER, BINLOG MONITOR privilege(s) for this operation (1227)
+mariadb-dump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need (at least one of) the BINLOG MONITOR privilege(s) for this operation (1227)
/*!999999\- enable the sandbox mode */
-mariadb-dump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need (at least one of) the SUPER, BINLOG MONITOR privilege(s) for this operation (1227)
+mariadb-dump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need (at least one of) the BINLOG MONITOR privilege(s) for this operation (1227)
/*!999999\- enable the sandbox mode */
grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
drop table t1;
@@ -3942,7 +3940,7 @@ CREATE TABLE t1 (a INT) ENGINE=merge UNION=(t2, t3);
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -3982,7 +3980,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
DROP TABLE t1, t2, t3;
#
@@ -4018,6 +4016,8 @@ use test;
create database mysqldump_test_db;
grant all privileges on mysqldump_test_db.* to user1;
grant all privileges on mysqldump_test_db.* to user2;
+revoke SHOW CREATE ROUTINE on mysqldump_test_db.* from user1;
+revoke SHOW CREATE ROUTINE on mysqldump_test_db.* from user2;
connect user27293,localhost,user1,,mysqldump_test_db,$MASTER_MYPORT,$MASTER_MYSOCK;
connection user27293;
create procedure mysqldump_test_db.sp1() select 'hello';
@@ -4105,19 +4105,25 @@ DROP TABLE t1,t2;
# --skip-dump-date:
--
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
-- Dump completed
# --dump-date:
--
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
-- Dump completed on DATE
# --dump-date (default):
--
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
-- Dump completed on DATE
#
@@ -4140,7 +4146,7 @@ create view db42635.v2 (c) as select * from db42635.t1;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -4181,7 +4187,7 @@ SET character_set_client = @saved_cs_client;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
use test;
drop database db42635;
@@ -4196,7 +4202,7 @@ CREATE TABLE `straße` ( f1 INT );
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `straße`;
CREATE TABLE `straße` (
`f1` int(11) DEFAULT NULL
@@ -4211,7 +4217,7 @@ UNLOCK TABLES;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
/*!999999\- enable the sandbox mode */
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
@@ -4219,7 +4225,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `straße`;
CREATE TABLE `straße` (
`f1` int(11) DEFAULT NULL
@@ -4234,7 +4240,7 @@ UNLOCK TABLES;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
DROP TABLE `straße`;
CREATE TABLE `כדשגכחךלדגכחשךדגחכךלדגכ` ( f1 INT );
@@ -4244,7 +4250,7 @@ CREATE TABLE `כדשגכחךלדגכחשךדגחכךלדגכ` ( f1 INT );
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `כדשגכחךלדגכחשךדגחכךלדגכ`;
CREATE TABLE `כדשגכחךלדגכחשךדגחכךלדגכ` (
`f1` int(11) DEFAULT NULL
@@ -4259,7 +4265,7 @@ UNLOCK TABLES;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
mariadb-dump: Got error: 1146: "Table 'test.???????????????????????' doesn't exist" when using LOCK TABLES
/*!999999\- enable the sandbox mode */
@@ -4268,7 +4274,7 @@ mariadb-dump: Got error: 1146: "Table 'test.???????????????????????' doesn't exi
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE `כדשגכחךלדגכחשךדגחכךלדגכ`;
SET NAMES latin1;
#
@@ -4290,7 +4296,7 @@ INSERT INTO t1 VALUES (3,4), (4,5);
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -4317,7 +4323,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
DROP TABLE t1;
create table t1 (a text , b text);
@@ -4565,7 +4571,7 @@ insert into t1 values (0815);
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
/*!40000 DROP DATABASE IF EXISTS `mysqldump_test_db`*/;
@@ -4619,7 +4625,7 @@ USE `mysqldump_test_db`;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
drop view v1;
drop table t1;
@@ -5268,6 +5274,7 @@ END
# Test to check 'Insufficient privileges' error.
GRANT ALL PRIVILEGES ON BUG52792.* TO user1;
+REVOKE SHOW CREATE ROUTINE ON BUG52792.* FROM user1;
connect conn_1, localhost, user1, , BUG52792, $MASTER_MYPORT, $MASTER_MYSOCK;
connection conn_1;
# Running 'replace_regex on timestamp'
@@ -5400,7 +5407,7 @@ CREATE TABLE t1 (a INT);
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -5418,7 +5425,7 @@ UNLOCK TABLES;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
DROP TABLE t1;
#
@@ -5572,6 +5579,8 @@ Warnings:
Warning 1105 Event scheduler is switched off, use SET GLOBAL event_scheduler=ON to enable it.
SHOW TABLES FROM bug25717383;
Tables_in_bug25717383
+temp
+one
tab
one
view
@@ -5593,6 +5602,8 @@ proc
one
SHOW TABLES FROM bug25717383;
Tables_in_bug25717383
+temp
+one
tab
one
view
@@ -5614,7 +5625,6 @@ proc
one
DROP DATABASE bug25717383;
mariadb-dump: Got error: 2005: "Unknown server host 'unknownhost'" when trying to connect
-mariadb-dump: Couldn't execute 'SHOW SLAVE STATUS': Server has gone away (2006)
Usage: mariadb-dump [OPTIONS] database [tables]
OR mariadb-dump [OPTIONS] --databases DB1 [DB2 DB3...]
OR mariadb-dump [OPTIONS] --all-databases
@@ -5913,7 +5923,7 @@ INSERT INTO t1 (a) VALUES (1),(2),(3);
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci */;
@@ -5942,7 +5952,7 @@ DELIMITER ;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
DROP TABLE t1;
#
@@ -5963,7 +5973,7 @@ DROP TABLE t1;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `general_log` (
@@ -6043,7 +6053,7 @@ CREATE TABLE IF NOT EXISTS `transaction_registry` (
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
#
# With --replace
@@ -6059,7 +6069,7 @@ CREATE TABLE IF NOT EXISTS `transaction_registry` (
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `general_log` (
@@ -6149,7 +6159,7 @@ CREATE TABLE IF NOT EXISTS `transaction_registry` (
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
#
# With --insert-ignore
@@ -6165,7 +6175,7 @@ CREATE TABLE IF NOT EXISTS `transaction_registry` (
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `general_log` (
@@ -6255,7 +6265,7 @@ CREATE TABLE IF NOT EXISTS `transaction_registry` (
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
# End of 10.2 tests
#
@@ -6768,3 +6778,12 @@ drop table t1;
#
mariadb-dump: --xml can't be used with --tab.
# End of 10.11 tests
+select @@max_connections into @save_max_connections;
+set global max_connections=10;
+mariadb-dump: Got error: 2002: "Received error packet before completion of TLS handshake. The authenticity of the following error cannot be verified: 1040 - Too many connections" when trying to connect
+set global max_connections=300;
+mariadb-dump: Too many connections
+set global max_connections=@save_max_connections;
+#
+# End of 11.4 tests
+#
diff --git a/mysql-test/main/mysqldump.test b/mysql-test/main/mysqldump.test
index 0f513a7f..c7874aa4 100644
--- a/mysql-test/main/mysqldump.test
+++ b/mysql-test/main/mysqldump.test
@@ -1602,6 +1602,8 @@ create database mysqldump_test_db;
grant all privileges on mysqldump_test_db.* to user1;
grant all privileges on mysqldump_test_db.* to user2;
+revoke SHOW CREATE ROUTINE on mysqldump_test_db.* from user1;
+revoke SHOW CREATE ROUTINE on mysqldump_test_db.* from user2;
connect (user27293,localhost,user1,,mysqldump_test_db,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user27293;
@@ -2334,6 +2336,7 @@ CREATE VIEW v2 AS SELECT * FROM t2;
--echo
GRANT ALL PRIVILEGES ON BUG52792.* TO user1;
+REVOKE SHOW CREATE ROUTINE ON BUG52792.* FROM user1;
connect (conn_1, localhost, user1, , BUG52792, $MASTER_MYPORT, $MASTER_MYSOCK);
connection conn_1;
@@ -2479,12 +2482,12 @@ INSERT INTO t2 VALUES (3), (4);
SELECT * FROM t1;
SELECT * FROM t2;
---exec $MYSQL_DUMP --default-character-set=utf8mb4 --tab=$MYSQLTEST_VARDIR/tmp/ db_20772273
+--exec $MYSQL_DUMP --default-character-set=utf8mb4 --tab=$MYSQLTEST_VARDIR/tmp/ --parallel=2 db_20772273
--exec $MYSQL db_20772273 < $MYSQLTEST_VARDIR/tmp/t1.sql
--exec $MYSQL db_20772273 < $MYSQLTEST_VARDIR/tmp/t2.sql
# Test mysqlimport with multiple threads
---exec $MYSQL_IMPORT --silent --use-threads=2 db_20772273 $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt
+--exec $MYSQL_IMPORT --silent --parallel=2 db_20772273 $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt
SELECT * FROM t1;
SELECT * FROM t2;
@@ -3039,3 +3042,24 @@ drop table t1;
--exec $MYSQL_DUMP --xml --tab=$MYSQLTEST_VARDIR/tmp 2>&1
--echo # End of 10.11 tests
+
+#
+# MDEV-32589 parallel-mysqldump - test "too many connections"
+#
+select @@max_connections into @save_max_connections;
+set global max_connections=10;
+--replace_result mariadb-dump.exe mariadb-dump
+--error 2
+--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ --parallel=20 mysql 2>&1
+#
+# MDEV-32589 test builtin 256 connections limit
+#
+set global max_connections=300;
+--replace_result mariadb-dump.exe mariadb-dump
+--error 1
+--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ --parallel=280 mysql 2>&1
+set global max_connections=@save_max_connections;
+
+--echo #
+--echo # End of 11.4 tests
+--echo #
diff --git a/mysql-test/main/mysqltest-break.result b/mysql-test/main/mysqltest-break.result
new file mode 100644
index 00000000..59091cbc
--- /dev/null
+++ b/mysql-test/main/mysqltest-break.result
@@ -0,0 +1,9 @@
+3
+2
+OK
+OK
+OK
+1
+cnt=3
+cnt=2
+mysqltest: At line 1: Stray break was found
diff --git a/mysql-test/main/mysqltest-break.test b/mysql-test/main/mysqltest-break.test
new file mode 100644
index 00000000..5ef8b70f
--- /dev/null
+++ b/mysql-test/main/mysqltest-break.test
@@ -0,0 +1,87 @@
+--source include/not_embedded.inc
+#
+# MDEV-12130 improve mysqltest language
+#
+# test "break" statement
+#
+
+# Break in a single loop
+
+let $cnt= 4;
+while($cnt > 1)
+{
+ dec $cnt;
+ break;
+ --echo $cnt
+ --echo Break did not stop a single loop
+}
+
+# Break stops inner loop
+
+let $outer= 4;
+while($outer > 1)
+{
+ let $inner= 4;
+ while($inner > 1)
+ {
+ if($outer == 2)
+ {
+ --echo OK
+ }
+ if($inner == 2)
+ {
+ break;
+ }
+ dec $inner;
+ }
+ dec $outer;
+ --echo $outer
+}
+
+# Break stops outer loop
+let $inner= 4;
+let $outer= 4;
+while($outer > 1)
+{
+ break;
+ while($inner > 1)
+ {
+ dec $inner;
+ --echo Outer loop`s break did not stop inner loop
+ }
+ dec $outer;
+ --echo $outer
+}
+
+# Break stops loop in if
+let $cnt= 4;
+if($cnt > 1)
+{
+ while($cnt)
+ {
+ break;
+ }
+ dec $cnt;
+}
+
+--echo cnt=$cnt
+
+# Break in inner if
+
+let $cnt= 4;
+while($cnt > 1)
+{
+ if($cnt == 2)
+ {
+ break;
+ --echo "if" is working after break
+ }
+ dec $cnt;
+}
+
+--echo cnt=$cnt
+
+# Stray break
+
+--error 1
+--exec echo "break;" | $MYSQL_TEST 2>&1
diff --git a/mysql-test/main/mysqltest_tracking_info.result b/mysql-test/main/mysqltest_tracking_info.result
index cad96ef8..d4010961 100644
--- a/mysql-test/main/mysqltest_tracking_info.result
+++ b/mysql-test/main/mysqltest_tracking_info.result
@@ -35,13 +35,11 @@ SET @@session.session_track_system_variables= @save_session_track_system_variabl
#
set @save_optimizer_switch=@@optimizer_switch;
SET @@session.session_track_system_variables='optimizer_switch';
-set optimizer_switch='index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off';
+set optimizer_switch='index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off';
-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
-- optimizer_switch
--- index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off
+-- index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on,cset_narrowing=off,sargable_casefold=on
-Warnings:
-Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release
set @@optimizer_switch=@save_optimizer_switch;
SET @@session.session_track_system_variables= @save_session_track_system_variables;
# End of 10.2 tests
@@ -91,3 +89,138 @@ SET GLOBAL event_scheduler=default;
# MDEV-16470 - Session user variables tracker
#
# End of 10.5 tests
+#
+# MDEV-31746 Problems with tx_isolation after MDEV-21921
+#
+# tracking info on
+SET session_track_system_variables='max_insert_delayed_threads';
+SET max_delayed_threads=0;
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- max_insert_delayed_threads
+-- 0
+
+SET @@max_delayed_threads=0;
+SET SESSION max_delayed_threads=0;
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- max_insert_delayed_threads
+-- 0
+
+SET session_track_system_variables='max_delayed_threads';
+SET max_insert_delayed_threads=@@global.max_delayed_threads;
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- max_delayed_threads
+-- 20
+
+SET session_track_system_variables='tx_isolation';
+SET @@session.tx_isolation='READ-COMMITTED';
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- tx_isolation
+-- READ-COMMITTED
+
+Warnings:
+Warning 1287 '@@tx_isolation' is deprecated and will be removed in a future release. Please use '@@transaction_isolation' instead
+SET SESSION tx_isolation='READ-UNCOMMITTED';
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- tx_isolation
+-- READ-UNCOMMITTED
+
+Warnings:
+Warning 1287 '@@tx_isolation' is deprecated and will be removed in a future release. Please use '@@transaction_isolation' instead
+SET SESSION transaction_isolation='REPEATABLE-READ';
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- tx_isolation
+-- REPEATABLE-READ
+
+Track 2, get 2
+SET session_track_system_variables='tx_isolation,transaction_isolation';
+select @@session_track_system_variables;
+@@session_track_system_variables
+tx_isolation
+SET @@session.tx_isolation='READ-COMMITTED';
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- tx_isolation
+-- READ-COMMITTED
+
+Warnings:
+Warning 1287 '@@tx_isolation' is deprecated and will be removed in a future release. Please use '@@transaction_isolation' instead
+SET SESSION tx_isolation='READ-UNCOMMITTED';
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- tx_isolation
+-- READ-UNCOMMITTED
+
+Warnings:
+Warning 1287 '@@tx_isolation' is deprecated and will be removed in a future release. Please use '@@transaction_isolation' instead
+SET SESSION transaction_isolation='REPEATABLE-READ';
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- tx_isolation
+-- REPEATABLE-READ
+
+SET session_track_system_variables='transaction_isolation';
+SET @@session.tx_isolation='READ-COMMITTED';
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- transaction_isolation
+-- READ-COMMITTED
+
+Warnings:
+Warning 1287 '@@tx_isolation' is deprecated and will be removed in a future release. Please use '@@transaction_isolation' instead
+SET SESSION tx_isolation='READ-UNCOMMITTED';
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- transaction_isolation
+-- READ-UNCOMMITTED
+
+Warnings:
+Warning 1287 '@@tx_isolation' is deprecated and will be removed in a future release. Please use '@@transaction_isolation' instead
+SET SESSION transaction_isolation='REPEATABLE-READ';
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- transaction_isolation
+-- REPEATABLE-READ
+
+SET session_track_system_variables='tx_isolation,transaction_isolation,tx_isolation';
+SELECT @@session_track_system_variables;
+@@session_track_system_variables
+tx_isolation
+SET @@session.tx_isolation='READ-COMMITTED';
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- tx_isolation
+-- READ-COMMITTED
+
+Warnings:
+Warning 1287 '@@tx_isolation' is deprecated and will be removed in a future release. Please use '@@transaction_isolation' instead
+SET SESSION tx_isolation='READ-UNCOMMITTED';
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- tx_isolation
+-- READ-UNCOMMITTED
+
+Warnings:
+Warning 1287 '@@tx_isolation' is deprecated and will be removed in a future release. Please use '@@transaction_isolation' instead
+SET SESSION transaction_isolation='REPEATABLE-READ';
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- tx_isolation
+-- REPEATABLE-READ
+
+accumulate as we encounter duplicates
+SET session_track_system_variables='*';
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- session_track_system_variables
+-- *
+
+SET @@session.tx_isolation='READ-COMMITTED';
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- tx_isolation
+-- READ-COMMITTED
+
+Warnings:
+Warning 1287 '@@tx_isolation' is deprecated and will be removed in a future release. Please use '@@transaction_isolation' instead
+SET SESSION tx_isolation='READ-UNCOMMITTED';
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- tx_isolation
+-- READ-UNCOMMITTED
+
+Warnings:
+Warning 1287 '@@tx_isolation' is deprecated and will be removed in a future release. Please use '@@transaction_isolation' instead
+SET SESSION transaction_isolation='REPEATABLE-READ';
+-- Tracker : SESSION_TRACK_SYSTEM_VARIABLES
+-- tx_isolation
+-- REPEATABLE-READ
+
+# End of 11.1 tests
diff --git a/mysql-test/main/mysqltest_tracking_info.test b/mysql-test/main/mysqltest_tracking_info.test
index 8f5e0954..feb52fab 100644
--- a/mysql-test/main/mysqltest_tracking_info.test
+++ b/mysql-test/main/mysqltest_tracking_info.test
@@ -36,7 +36,7 @@ set @save_optimizer_switch=@@optimizer_switch;
SET @@session.session_track_system_variables='optimizer_switch';
--enable_session_track_info
-set optimizer_switch='index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off';
+set optimizer_switch='index_merge=off,index_merge_union=off,index_merge_sort_union=off,index_merge_intersection=off,index_merge_sort_intersection=on,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=on,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off';
--disable_session_track_info
set @@optimizer_switch=@save_optimizer_switch;
@@ -123,3 +123,59 @@ SET GLOBAL event_scheduler=default;
#SET @inserted_value=REPEAT(1,16777180); # Only crashes when >=16777180 (max = 16777216)
--echo # End of 10.5 tests
+
+--echo #
+--echo # MDEV-31746 Problems with tx_isolation after MDEV-21921
+--echo #
+
+--echo # tracking info on
+
+--enable_session_track_info
+
+SET session_track_system_variables='max_insert_delayed_threads';
+SET max_delayed_threads=0;
+SET @@max_delayed_threads=0;
+SET SESSION max_delayed_threads=0;
+
+SET session_track_system_variables='max_delayed_threads';
+SET max_insert_delayed_threads=@@global.max_delayed_threads;
+
+SET session_track_system_variables='tx_isolation';
+
+SET @@session.tx_isolation='READ-COMMITTED';
+SET SESSION tx_isolation='READ-UNCOMMITTED';
+SET SESSION transaction_isolation='REPEATABLE-READ';
+
+--echo Track 2, get 2
+SET session_track_system_variables='tx_isolation,transaction_isolation';
+select @@session_track_system_variables;
+
+SET @@session.tx_isolation='READ-COMMITTED';
+SET SESSION tx_isolation='READ-UNCOMMITTED';
+SET SESSION transaction_isolation='REPEATABLE-READ';
+
+SET session_track_system_variables='transaction_isolation';
+
+SET @@session.tx_isolation='READ-COMMITTED';
+SET SESSION tx_isolation='READ-UNCOMMITTED';
+SET SESSION transaction_isolation='REPEATABLE-READ';
+
+SET session_track_system_variables='tx_isolation,transaction_isolation,tx_isolation';
+
+SELECT @@session_track_system_variables;
+
+SET @@session.tx_isolation='READ-COMMITTED';
+SET SESSION tx_isolation='READ-UNCOMMITTED';
+SET SESSION transaction_isolation='REPEATABLE-READ';
+
+--echo accumulate as we encounter duplicates
+SET session_track_system_variables='*';
+
+SET @@session.tx_isolation='READ-COMMITTED';
+SET SESSION tx_isolation='READ-UNCOMMITTED';
+SET SESSION transaction_isolation='REPEATABLE-READ';
+# TEST GAP, there are no aliases of Sys_var_bit variables, implemented but
+# no tests yet.
+--disable_session_track_info
+
+--echo # End of 11.1 tests
diff --git a/mysql-test/main/mysqltest_tracking_info_debug.result b/mysql-test/main/mysqltest_tracking_info_debug.result
index 39d17c7c..2fd20f99 100644
--- a/mysql-test/main/mysqltest_tracking_info_debug.result
+++ b/mysql-test/main/mysqltest_tracking_info_debug.result
@@ -7,7 +7,7 @@ set @save_session_track_system_variables=@@session_track_system_variables;
# is declared to never be null in my_strdup
#
# check that that parser problems do not lead to crash
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
set debug_dbug="+d,dbug_session_tracker_parse_error";
SET GLOBAL session_track_system_variables='query_cache_size';
ERROR HY001: Out of memory; restart server and try again (needed 1 bytes)
diff --git a/mysql-test/main/mysqltest_tracking_info_debug.test b/mysql-test/main/mysqltest_tracking_info_debug.test
index 1699801f..32d65bfd 100644
--- a/mysql-test/main/mysqltest_tracking_info_debug.test
+++ b/mysql-test/main/mysqltest_tracking_info_debug.test
@@ -15,7 +15,7 @@ set @save_session_track_system_variables=@@session_track_system_variables;
--echo #
--echo # check that that parser problems do not lead to crash
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
set debug_dbug="+d,dbug_session_tracker_parse_error";
--error ER_OUTOFMEMORY
SET GLOBAL session_track_system_variables='query_cache_size';
diff --git a/mysql-test/main/named_pipe.result b/mysql-test/main/named_pipe.result
index 2baa3471..a0738cda 100644
--- a/mysql-test/main/named_pipe.result
+++ b/mysql-test/main/named_pipe.result
@@ -1,5 +1,6 @@
connect pipe_con,localhost,root,,,,,PIPE;
drop table if exists t1,t2,t3,t4;
+set @@default_storage_engine="aria";
CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
@@ -600,6 +601,9 @@ explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index
+#
+# Some test with ORDER BY and limit
+#
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using filesort
@@ -1289,7 +1293,7 @@ companynr tinyint(2) unsigned zerofill NOT NULL default '00',
companyname char(30) NOT NULL default '',
PRIMARY KEY (companynr),
UNIQUE KEY companyname(companyname)
-) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
+) ENGINE=aria MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
companynr companyname
00 Unknown
@@ -1379,6 +1383,9 @@ explain select companynr,companyname from t4 left join t2 using (companynr) wher
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
delete from t2 where fld1=999999;
+#
+# Test left join optimization
+#
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
@@ -1393,15 +1400,15 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null;
id select_type table type possible_keys key key_len ref rows Extra
@@ -1417,11 +1424,11 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0;
id select_type table type possible_keys key key_len ref rows Extra
diff --git a/mysql-test/main/null.result b/mysql-test/main/null.result
index b54ecafb..858d24f2 100644
--- a/mysql-test/main/null.result
+++ b/mysql-test/main/null.result
@@ -442,7 +442,7 @@ NOT NOT NULLIF(2,3)
#
CREATE TABLE t1 (a YEAR(2));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
INSERT INTO t1 VALUES (0);
SELECT a,NULLIF(a,2000),NULLIF(2000,a) FROM t1;
a NULLIF(a,2000) NULLIF(2000,a)
diff --git a/mysql-test/main/null_key.result b/mysql-test/main/null_key.result
index c48382e7..0b1446fd 100644
--- a/mysql-test/main/null_key.result
+++ b/mysql-test/main/null_key.result
@@ -182,12 +182,12 @@ insert into t2 values (7),(8);
explain select * from t2 straight_join t1 where t1.a=t2.a and b is null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where
-1 SIMPLE t1 ref a,b a 10 test.t2.a,const 2 Using where; Using index
+1 SIMPLE t1 ref a,b a 10 test.t2.a,const 1 Using where; Using index
drop index b on t1;
explain select * from t2,t1 where t1.a=t2.a and b is null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where
-1 SIMPLE t1 ref a a 10 test.t2.a,const 2 Using where; Using index
+1 SIMPLE t1 ref a a 10 test.t2.a,const 1 Using where; Using index
select * from t2,t1 where t1.a=t2.a and b is null;
a a b
7 7 NULL
@@ -259,10 +259,11 @@ PRIMARY KEY (id)
) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,NULL),(2,NULL),(3,1),(4,2),(5,NULL),(6,NULL),(7,3),(8,4),(9,NULL),(10,NULL);
INSERT INTO t1 VALUES (11,5),(12,6),(13,7),(14,8),(15,9);
+INSERT INTO t1 VALUES (1000,1000),(1010,1010);
INSERT INTO t2 VALUES (1,NULL),(2,NULL),(3,1),(4,2),(5,NULL),(6,NULL),(7,3),(8,4),(9,NULL),(10,NULL);
explain select id from t1 where uniq_id is null;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL idx1 NULL NULL NULL 15 Using where
+1 SIMPLE t1 ref idx1 idx1 5 const 6 Using index condition
explain select id from t1 where uniq_id =1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const idx1 idx1 5 const 1
@@ -286,6 +287,7 @@ id
110
DELETE FROM t1 WHERE uniq_id IS NULL;
DELETE FROM t2 WHERE uniq_id IS NULL;
+DELETE FROM t1 WHERE id >= 1000;
SELECT * FROM t1 ORDER BY uniq_id, id;
id uniq_id
3 1
diff --git a/mysql-test/main/null_key.test b/mysql-test/main/null_key.test
index e0c318f7..7fc21ee1 100644
--- a/mysql-test/main/null_key.test
+++ b/mysql-test/main/null_key.test
@@ -107,6 +107,7 @@ CREATE TABLE t2 (
INSERT INTO t1 VALUES (1,NULL),(2,NULL),(3,1),(4,2),(5,NULL),(6,NULL),(7,3),(8,4),(9,NULL),(10,NULL);
INSERT INTO t1 VALUES (11,5),(12,6),(13,7),(14,8),(15,9);
+INSERT INTO t1 VALUES (1000,1000),(1010,1010);
INSERT INTO t2 VALUES (1,NULL),(2,NULL),(3,1),(4,2),(5,NULL),(6,NULL),(7,3),(8,4),(9,NULL),(10,NULL);
#
# Check IS NULL optimization
@@ -125,6 +126,12 @@ select id from t2 where uniq_id is null;
#
DELETE FROM t1 WHERE uniq_id IS NULL;
DELETE FROM t2 WHERE uniq_id IS NULL;
+
+#
+# Delete extra records that were used to force null optimization
+#
+DELETE FROM t1 WHERE id >= 1000;
+
#
# Select what is left -- notice the difference
#
diff --git a/mysql-test/main/old-mode-master.opt b/mysql-test/main/old-mode.opt
index 840ee0de..840ee0de 100644
--- a/mysql-test/main/old-mode-master.opt
+++ b/mysql-test/main/old-mode.opt
diff --git a/mysql-test/main/old-mode.result b/mysql-test/main/old-mode.result
index cb87c45a..9f911f8d 100644
--- a/mysql-test/main/old-mode.result
+++ b/mysql-test/main/old-mode.result
@@ -1,4 +1,3 @@
-drop table if exists t1,t2;
create table t1 (a int, b varchar(200), c text not null) checksum=1;
create table t2 (a int, b varchar(200), c text not null) checksum=0;
insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
@@ -23,6 +22,8 @@ Id User Host db Command Time State Info
# MDEV-5372 Make "CAST(time_expr AS DATETIME)" compatible with the SQL Standard)
#
set @@old_mode=zero_date_time_cast;
+Warnings:
+Warning 1287 'ZERO_DATE_TIME_CAST' is deprecated and will be removed in a future release
SELECT CAST(TIME'-10:30:30' AS DATETIME);
CAST(TIME'-10:30:30' AS DATETIME)
NULL
@@ -106,6 +107,8 @@ DROP TABLE t1;
#
SET @@global.mysql56_temporal_format=true;
SET @@old_mode=zero_date_time_cast;
+Warnings:
+Warning 1287 'ZERO_DATE_TIME_CAST' is deprecated and will be removed in a future release
CREATE TABLE t1 (a TIME,b TIME(1));
INSERT INTO t1 VALUES (TIME'830:20:30',TIME'830:20:30');
SELECT TO_DAYS(a), TO_DAYS(b) FROM t1;
@@ -117,6 +120,8 @@ Warning 1264 Out of range value for column 'b' at row 1
DROP TABLE t1;
SET @@global.mysql56_temporal_format=false;
SET @@old_mode=zero_date_time_cast;
+Warnings:
+Warning 1287 'ZERO_DATE_TIME_CAST' is deprecated and will be removed in a future release
CREATE TABLE t1 (a TIME,b TIME(1));
INSERT INTO t1 VALUES (TIME'830:20:30',TIME'830:20:30');
SELECT TO_DAYS(a), TO_DAYS(b) FROM t1;
@@ -225,6 +230,8 @@ SET global mysql56_temporal_format=true;
# MDEV-26765 UNIX_TIMESTAMP(CURRENT_TIME()) return null ?!?
#
SET old_mode=zero_date_time_cast;
+Warnings:
+Warning 1287 'ZERO_DATE_TIME_CAST' is deprecated and will be removed in a future release
SET @@time_zone='+00:00';
SET timestamp=1234567;
SELECT CURRENT_TIMESTAMP;
@@ -264,6 +271,8 @@ select count(*) > 0 from information_schema.collations where id IS NULL;
count(*) > 0
1
SET old_mode=no_null_collation_ids;
+Warnings:
+Warning 1287 'NO_NULL_COLLATION_IDS' is deprecated and will be removed in a future release
select count(*) > 0 from information_schema.collations where id IS NULL;
count(*) > 0
0
diff --git a/mysql-test/main/old-mode.test b/mysql-test/main/old-mode.test
index 177e00ed..cc44423d 100644
--- a/mysql-test/main/old-mode.test
+++ b/mysql-test/main/old-mode.test
@@ -2,11 +2,6 @@
# Test 'old' mode
#
-# Initialise
---disable_warnings
-drop table if exists t1,t2;
---enable_warnings
-
create table t1 (a int, b varchar(200), c text not null) checksum=1;
create table t2 (a int, b varchar(200), c text not null) checksum=0;
insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, "");
diff --git a/mysql-test/main/openssl_1.result b/mysql-test/main/openssl_1.result
index b022ce23..59c6ce6b 100644
--- a/mysql-test/main/openssl_1.result
+++ b/mysql-test/main/openssl_1.result
@@ -88,7 +88,7 @@ INSERT INTO t1 VALUES (1), (2);
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -112,7 +112,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
/*!999999\- enable the sandbox mode */
@@ -125,7 +125,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -149,7 +149,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
/*!999999\- enable the sandbox mode */
@@ -162,7 +162,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
DROP TABLE IF EXISTS `t1`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@@ -186,7 +186,7 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
mariadb-dump: Got error: 2026: "TLS/SSL error: xxxx
DROP TABLE t1;
diff --git a/mysql-test/main/opt_trace.result b/mysql-test/main/opt_trace.result
index 3c90e97c..7d77bb9d 100644
--- a/mysql-test/main/opt_trace.result
+++ b/mysql-test/main/opt_trace.result
@@ -59,7 +59,7 @@ select * from v1 {
}
},
{
- "expanded_query": "/* select#1 */ select t1.a AS a,t1.b AS b from v1"
+ "expanded_query": "/* select#1 */ select v1.a AS a,v1.b AS b from v1"
}
]
}
@@ -118,7 +118,8 @@ select * from v1 {
"table": "t1",
"table_scan": {
"rows": 2,
- "cost": 2.004394531
+ "read_cost": 0.01028441,
+ "read_and_compare_cost": 0.01034841
}
}
]
@@ -126,23 +127,30 @@ select * from v1 {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 1,
- "cost": 2.204394531,
+ "rows": 2,
+ "rows_after_filter": 1,
+ "rows_out": 1,
+ "cost": 0.01034841,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 1,
- "cost": 2.204394531,
+ "rows_read": 1,
+ "rows_out": 1,
+ "cost": 0.01034841,
"uses_join_buffering": false
}
}
@@ -150,15 +158,17 @@ select * from v1 {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t1",
"rows_for_plan": 1,
- "cost_for_plan": 2.404394531
+ "cost_for_plan": 0.01034841
}
]
},
{
- "best_join_order": ["t1"]
+ "best_join_order": ["t1"],
+ "rows": 1,
+ "cost": 0.01034841
},
{
"substitute_best_equal": {
@@ -172,10 +182,13 @@ select * from v1 {
"attached_conditions_summary": [
{
"table": "t1",
- "attached": "t1.a = 1"
+ "attached_condition": "t1.a = 1"
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -217,7 +230,7 @@ select * from (select * from t1 where t1.a=1)q {
}
},
{
- "expanded_query": "/* select#1 */ select t1.a AS a,t1.b AS b from (/* select#2 */ select t1.a AS a,t1.b AS b from t1 where t1.a = 1) q"
+ "expanded_query": "/* select#1 */ select q.a AS a,q.b AS b from (/* select#2 */ select t1.a AS a,t1.b AS b from t1 where t1.a = 1) q"
}
]
}
@@ -276,7 +289,8 @@ select * from (select * from t1 where t1.a=1)q {
"table": "t1",
"table_scan": {
"rows": 2,
- "cost": 2.004394531
+ "read_cost": 0.01028441,
+ "read_and_compare_cost": 0.01034841
}
}
]
@@ -284,23 +298,30 @@ select * from (select * from t1 where t1.a=1)q {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 1,
- "cost": 2.204394531,
+ "rows": 2,
+ "rows_after_filter": 1,
+ "rows_out": 1,
+ "cost": 0.01034841,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 1,
- "cost": 2.204394531,
+ "rows_read": 1,
+ "rows_out": 1,
+ "cost": 0.01034841,
"uses_join_buffering": false
}
}
@@ -308,15 +329,17 @@ select * from (select * from t1 where t1.a=1)q {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t1",
"rows_for_plan": 1,
- "cost_for_plan": 2.404394531
+ "cost_for_plan": 0.01034841
}
]
},
{
- "best_join_order": ["t1"]
+ "best_join_order": ["t1"],
+ "rows": 1,
+ "cost": 0.01034841
},
{
"substitute_best_equal": {
@@ -330,10 +353,13 @@ select * from (select * from t1 where t1.a=1)q {
"attached_conditions_summary": [
{
"table": "t1",
- "attached": "t1.a = 1"
+ "attached_condition": "t1.a = 1"
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -439,7 +465,8 @@ select * from v2 {
"table": "t1",
"table_scan": {
"rows": 2,
- "cost": 2.004394531
+ "read_cost": 0.01028441,
+ "read_and_compare_cost": 0.01034841
}
}
]
@@ -447,24 +474,31 @@ select * from v2 {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 1,
- "cost": 2.204394531,
+ "rows": 2,
+ "rows_after_filter": 1,
+ "rows_out": 1,
+ "cost": 0.01034841,
+ "index_only": false,
"chosen": true,
"use_tmp_table": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 1,
- "cost": 2.204394531,
+ "rows_read": 1,
+ "rows_out": 1,
+ "cost": 0.01034841,
"uses_join_buffering": false
}
}
@@ -472,11 +506,11 @@ select * from v2 {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t1",
"rows_for_plan": 1,
- "cost_for_plan": 2.404394531,
- "cost_for_sorting": 1
+ "cost_for_plan": 0.01034841,
+ "cost_for_sorting": 6.301866e-4
}
]
},
@@ -486,7 +520,9 @@ select * from v2 {
}
},
{
- "best_join_order": ["t1"]
+ "best_join_order": ["t1"],
+ "rows": 1,
+ "cost": 0.010978597
},
{
"substitute_best_equal": {
@@ -500,12 +536,15 @@ select * from v2 {
"attached_conditions_summary": [
{
"table": "t1",
- "attached": "t1.a = 1"
+ "attached_condition": "t1.a = 1"
}
]
}
},
{
+ "make_join_readinfo": []
+ },
+ {
"test_if_skip_sort_order": []
}
]
@@ -527,7 +566,8 @@ select * from v2 {
"table": "<derived2>",
"table_scan": {
"rows": 2,
- "cost": 2
+ "read_cost": 0.012350033,
+ "read_and_compare_cost": 0.012418701
}
}
]
@@ -535,23 +575,30 @@ select * from v2 {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "<derived2>",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 2,
- "cost": 2,
+ "rows": 2,
+ "rows_after_filter": 2,
+ "rows_out": 2,
+ "cost": 0.012418701,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 2,
- "cost": 2,
+ "rows_read": 2,
+ "rows_out": 2,
+ "cost": 0.012418701,
"uses_join_buffering": false
}
}
@@ -559,15 +606,17 @@ select * from v2 {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "<derived2>",
"rows_for_plan": 2,
- "cost_for_plan": 2.4
+ "cost_for_plan": 0.012418701
}
]
},
{
- "best_join_order": ["<derived2>"]
+ "best_join_order": ["<derived2>"],
+ "rows": 2,
+ "cost": 0.012418701
},
{
"attaching_conditions_to_tables": {
@@ -575,10 +624,13 @@ select * from v2 {
"attached_conditions_summary": [
{
"table": "<derived2>",
- "attached": null
+ "attached_condition": null
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -646,7 +698,7 @@ explain select * from v2 {
}
},
{
- "expanded_query": "/* select#1 */ select t2.a AS a from v2"
+ "expanded_query": "/* select#1 */ select v2.a AS a from v2"
}
]
}
@@ -671,7 +723,8 @@ explain select * from v2 {
"table": "t2",
"table_scan": {
"rows": 10,
- "cost": 2.021972656
+ "read_cost": 0.01127965,
+ "read_and_compare_cost": 0.01159965
}
}
]
@@ -679,23 +732,30 @@ explain select * from v2 {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t2",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 10,
- "cost": 2.021972656,
+ "rows": 10,
+ "rows_after_filter": 10,
+ "rows_out": 10,
+ "cost": 0.01159965,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 10,
- "cost": 2.021972656,
+ "rows_read": 10,
+ "rows_out": 10,
+ "cost": 0.01159965,
"uses_join_buffering": false
}
}
@@ -703,15 +763,17 @@ explain select * from v2 {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t2",
"rows_for_plan": 10,
- "cost_for_plan": 4.021972656
+ "cost_for_plan": 0.01159965
}
]
},
{
- "best_join_order": ["t2"]
+ "best_join_order": ["t2"],
+ "rows": 10,
+ "cost": 0.01159965
},
{
"attaching_conditions_to_tables": {
@@ -719,10 +781,13 @@ explain select * from v2 {
"attached_conditions_summary": [
{
"table": "t2",
- "attached": null
+ "attached_condition": null
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -794,7 +859,8 @@ explain select * from v1 {
"table": "t1",
"table_scan": {
"rows": 10,
- "cost": 2.021972656
+ "read_cost": 0.01127965,
+ "read_and_compare_cost": 0.01159965
}
}
]
@@ -802,24 +868,31 @@ explain select * from v1 {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 10,
- "cost": 2.021972656,
+ "rows": 10,
+ "rows_after_filter": 10,
+ "rows_out": 10,
+ "cost": 0.01159965,
+ "index_only": false,
"chosen": true,
"use_tmp_table": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 10,
- "cost": 2.021972656,
+ "rows_read": 10,
+ "rows_out": 10,
+ "cost": 0.01159965,
"uses_join_buffering": false
}
}
@@ -827,11 +900,11 @@ explain select * from v1 {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t1",
"rows_for_plan": 10,
- "cost_for_plan": 4.021972656,
- "cost_for_sorting": 10
+ "cost_for_plan": 0.01159965,
+ "cost_for_sorting": 0.006368384
}
]
},
@@ -841,7 +914,9 @@ explain select * from v1 {
}
},
{
- "best_join_order": ["t1"]
+ "best_join_order": ["t1"],
+ "rows": 10,
+ "cost": 0.017968034
},
{
"attaching_conditions_to_tables": {
@@ -849,12 +924,15 @@ explain select * from v1 {
"attached_conditions_summary": [
{
"table": "t1",
- "attached": null
+ "attached_condition": null
}
]
}
},
{
+ "make_join_readinfo": []
+ },
+ {
"test_if_skip_sort_order": []
}
]
@@ -876,7 +954,8 @@ explain select * from v1 {
"table": "<derived2>",
"table_scan": {
"rows": 10,
- "cost": 10
+ "read_cost": 0.012414166,
+ "read_and_compare_cost": 0.012757506
}
}
]
@@ -884,23 +963,30 @@ explain select * from v1 {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "<derived2>",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 10,
- "cost": 10,
+ "rows": 10,
+ "rows_after_filter": 10,
+ "rows_out": 10,
+ "cost": 0.012757506,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 10,
- "cost": 10,
+ "rows_read": 10,
+ "rows_out": 10,
+ "cost": 0.012757506,
"uses_join_buffering": false
}
}
@@ -908,15 +994,17 @@ explain select * from v1 {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "<derived2>",
"rows_for_plan": 10,
- "cost_for_plan": 12
+ "cost_for_plan": 0.012757506
}
]
},
{
- "best_join_order": ["<derived2>"]
+ "best_join_order": ["<derived2>"],
+ "rows": 10,
+ "cost": 0.012757506
},
{
"attaching_conditions_to_tables": {
@@ -924,10 +1012,13 @@ explain select * from v1 {
"attached_conditions_summary": [
{
"table": "<derived2>",
- "attached": null
+ "attached_condition": null
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -1048,14 +1139,16 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b {
"table": "t1",
"table_scan": {
"rows": 100,
- "cost": 2.317382812
+ "read_cost": 0.0224761,
+ "read_and_compare_cost": 0.0256761
}
},
{
"table": "t2",
"table_scan": {
"rows": 100,
- "cost": 2.317382812
+ "read_cost": 0.0224761,
+ "read_and_compare_cost": 0.0256761
}
}
]
@@ -1063,23 +1156,30 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 100,
- "cost": 2.317382812,
+ "rows": 100,
+ "rows_after_filter": 100,
+ "rows_out": 100,
+ "cost": 0.0256761,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 100,
- "cost": 2.317382812,
+ "rows_read": 100,
+ "rows_out": 100,
+ "cost": 0.0256761,
"uses_join_buffering": false
}
}
@@ -1087,18 +1187,25 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b {
{
"best_access_path": {
"table": "t2",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 100,
- "cost": 2.317382812,
+ "rows": 100,
+ "rows_after_filter": 100,
+ "rows_out": 100,
+ "cost": 0.0256761,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 100,
- "cost": 2.317382812,
+ "rows_read": 100,
+ "rows_out": 100,
+ "cost": 0.0256761,
"uses_join_buffering": false
}
}
@@ -1106,17 +1213,20 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t1",
"rows_for_plan": 100,
- "cost_for_plan": 22.31738281,
+ "cost_for_plan": 0.0256761,
"rest_of_plan": [
{
- "plan_prefix": ["t1"],
+ "plan_prefix": "t1",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t2",
+ "plan_details": {
+ "record_count": 100
+ },
"considered_access_paths": [
{
"access_type": "ref",
@@ -1124,20 +1234,25 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b {
"used_range_estimates": false,
"reason": "not available",
"rows": 1,
- "cost": 200.0585794,
+ "cost": 0.1821659,
"chosen": true
},
{
- "access_type": "scan",
- "resulting_rows": 100,
- "cost": 2.317382812,
+ "access_type": "scan_with_join_cache",
+ "rows": 100,
+ "rows_after_filter": 100,
+ "rows_out": 1,
+ "cost": 0.9604227,
+ "cost_without_join_buffer": 2.56761,
+ "index_only": false,
"chosen": false
}
],
"chosen_access_method": {
"type": "ref",
- "records": 1,
- "cost": 200.0585794,
+ "rows_read": 1,
+ "rows_out": 1,
+ "cost": 0.1821659,
"uses_join_buffering": false
}
}
@@ -1145,25 +1260,28 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b {
]
},
{
- "plan_prefix": ["t1"],
+ "plan_prefix": "t1",
"table": "t2",
"rows_for_plan": 100,
- "cost_for_plan": 242.3759623
+ "cost_for_plan": 0.207842
}
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t2",
"rows_for_plan": 100,
- "cost_for_plan": 22.31738281,
+ "cost_for_plan": 0.0256761,
"rest_of_plan": [
{
- "plan_prefix": ["t2"],
+ "plan_prefix": "t2",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 100
+ },
"considered_access_paths": [
{
"access_type": "ref",
@@ -1171,20 +1289,25 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b {
"used_range_estimates": false,
"reason": "not available",
"rows": 1,
- "cost": 200.0585794,
+ "cost": 0.1821659,
"chosen": true
},
{
- "access_type": "scan",
- "resulting_rows": 100,
- "cost": 2.317382812,
+ "access_type": "scan_with_join_cache",
+ "rows": 100,
+ "rows_after_filter": 100,
+ "rows_out": 1,
+ "cost": 0.9604227,
+ "cost_without_join_buffer": 2.56761,
+ "index_only": false,
"chosen": false
}
],
"chosen_access_method": {
"type": "ref",
- "records": 1,
- "cost": 200.0585794,
+ "rows_read": 1,
+ "rows_out": 1,
+ "cost": 0.1821659,
"uses_join_buffering": false
}
}
@@ -1192,20 +1315,22 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b {
]
},
{
- "plan_prefix": ["t2"],
+ "plan_prefix": "t2",
"table": "t1",
"rows_for_plan": 100,
- "cost_for_plan": 242.3759623,
+ "cost_for_plan": 0.207842,
"pruned_by_cost": true,
- "current_cost": 242.3759623,
- "best_cost": 242.3759623
+ "current_cost": 0.207842,
+ "best_cost": 0.207842
}
]
}
]
},
{
- "best_join_order": ["t1", "t2"]
+ "best_join_order": ["t1", "t2"],
+ "rows": 100,
+ "cost": 0.207842
},
{
"substitute_best_equal": {
@@ -1219,14 +1344,17 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b {
"attached_conditions_summary": [
{
"table": "t1",
- "attached": "t1.b is not null"
+ "attached_condition": "t1.b is not null"
},
{
"table": "t2",
- "attached": "t1.a = t2.b + 2"
+ "attached_condition": "t1.a = t2.b + 2"
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -1244,10 +1372,11 @@ drop table t1,t2,t0;
# group_by min max optimization
#
CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, a INT NOT NULL, KEY(a));
+insert into t1 select seq, mod(seq,4)+1 from seq_1_to_65536;
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
-test.t1 analyze status OK
+test.t1 analyze status Table is already up to date
EXPLAIN SELECT DISTINCT a FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range NULL a 4 NULL 5 Using index for group-by
@@ -1286,7 +1415,7 @@ EXPLAIN SELECT DISTINCT a FROM t1 {
"range_analysis": {
"table_scan": {
"rows": 65536,
- "cost": 13255.2
+ "cost": 10.29477568
},
"potential_range_indexes": [
{
@@ -1302,9 +1431,8 @@ EXPLAIN SELECT DISTINCT a FROM t1 {
],
"best_covering_index_scan": {
"index": "a",
- "cost": 13377.39141,
- "chosen": false,
- "cause": "cost"
+ "cost": 9.123706862,
+ "chosen": true
},
"group_index_range": {
"distinct_query": true,
@@ -1313,7 +1441,7 @@ EXPLAIN SELECT DISTINCT a FROM t1 {
"index": "a",
"covering": true,
"rows": 5,
- "cost": 6.25
+ "cost": 0.004191135
}
]
},
@@ -1325,7 +1453,7 @@ EXPLAIN SELECT DISTINCT a FROM t1 {
"max_aggregate": false,
"distinct_aggregate": false,
"rows": 5,
- "cost": 6.25,
+ "cost": 0.004191135,
"key_parts_used_for_access": ["a"],
"ranges": [],
"chosen": true
@@ -1339,12 +1467,12 @@ EXPLAIN SELECT DISTINCT a FROM t1 {
"max_aggregate": false,
"distinct_aggregate": false,
"rows": 5,
- "cost": 6.25,
+ "cost": 0.004191135,
"key_parts_used_for_access": ["a"],
"ranges": []
},
"rows_for_plan": 5,
- "cost_for_plan": 6.25,
+ "cost_for_plan": 0.004191135,
"chosen": true
}
}
@@ -1354,23 +1482,29 @@ EXPLAIN SELECT DISTINCT a FROM t1 {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "index_merge",
- "resulting_rows": 5,
- "cost": 6.25,
+ "rows": 5,
+ "rows_after_filter": 5,
+ "rows_out": 5,
+ "cost": 0.004191135,
"chosen": true
}
],
"chosen_access_method": {
"type": "index_merge",
- "records": 5,
- "cost": 6.25,
+ "rows_read": 5,
+ "rows_out": 5,
+ "cost": 0.004191135,
"uses_join_buffering": false
}
}
@@ -1378,15 +1512,17 @@ EXPLAIN SELECT DISTINCT a FROM t1 {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t1",
"rows_for_plan": 5,
- "cost_for_plan": 7.25
+ "cost_for_plan": 0.004191135
}
]
},
{
- "best_join_order": ["t1"]
+ "best_join_order": ["t1"],
+ "rows": 5,
+ "cost": 0.004191135
},
{
"attaching_conditions_to_tables": {
@@ -1394,12 +1530,15 @@ EXPLAIN SELECT DISTINCT a FROM t1 {
"attached_conditions_summary": [
{
"table": "t1",
- "attached": null
+ "attached_condition": null
}
]
}
},
{
+ "make_join_readinfo": []
+ },
+ {
"test_if_skip_sort_order": []
}
]
@@ -1425,10 +1564,13 @@ test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
EXPLAIN SELECT MIN(d) FROM t1 where b=2 and c=3 group by a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL a 20 NULL 8 Using where; Using index for group-by
+1 SIMPLE t1 range NULL a 20 NULL 7 Using where; Using index for group-by
+set statement optimizer_scan_setup_cost=0 for EXPLAIN SELECT MIN(d) FROM t1 where b=2 and c=3 group by a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 20 NULL 7 Using where; Using index
select * from information_schema.OPTIMIZER_TRACE;
QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES
-EXPLAIN SELECT MIN(d) FROM t1 where b=2 and c=3 group by a {
+set statement optimizer_scan_setup_cost=0 for EXPLAIN SELECT MIN(d) FROM t1 where b=2 and c=3 group by a {
"steps": [
{
"join_preparation": {
@@ -1484,7 +1626,7 @@ EXPLAIN SELECT MIN(d) FROM t1 where b=2 and c=3 group by a {
"range_analysis": {
"table_scan": {
"rows": 7,
- "cost": 5.429052734
+ "cost": 0.001130435
},
"potential_range_indexes": [
{
@@ -1495,8 +1637,9 @@ EXPLAIN SELECT MIN(d) FROM t1 where b=2 and c=3 group by a {
],
"best_covering_index_scan": {
"index": "a",
- "cost": 2.409226263,
- "chosen": true
+ "cost": 0.001758432,
+ "chosen": false,
+ "cause": "cost"
},
"setup_range_conditions": [],
"analyzing_range_alternatives": {
@@ -1512,8 +1655,8 @@ EXPLAIN SELECT MIN(d) FROM t1 where b=2 and c=3 group by a {
"index": "a",
"covering": true,
"ranges": ["(2,3) <= (b,c) <= (2,3)"],
- "rows": 8,
- "cost": 2.2
+ "rows": 7,
+ "cost": 0.004425189
}
]
},
@@ -1524,54 +1667,61 @@ EXPLAIN SELECT MIN(d) FROM t1 where b=2 and c=3 group by a {
"min_aggregate": true,
"max_aggregate": false,
"distinct_aggregate": false,
- "rows": 8,
- "cost": 2.2,
+ "rows": 7,
+ "cost": 0.004425189,
"key_parts_used_for_access": ["a", "b", "c"],
"ranges": ["(2,3) <= (b,c) <= (2,3)"],
- "chosen": true
- },
- "chosen_range_access_summary": {
- "range_access_plan": {
- "type": "index_group",
- "index": "a",
- "min_max_arg": "d",
- "min_aggregate": true,
- "max_aggregate": false,
- "distinct_aggregate": false,
- "rows": 8,
- "cost": 2.2,
- "key_parts_used_for_access": ["a", "b", "c"],
- "ranges": ["(2,3) <= (b,c) <= (2,3)"]
- },
- "rows_for_plan": 8,
- "cost_for_plan": 2.2,
- "chosen": true
+ "chosen": false,
+ "cause": "cost"
}
}
+ },
+ {
+ "selectivity_for_indexes": [],
+ "selectivity_for_columns": [
+ {
+ "column_name": "b",
+ "ranges": ["2 <= b <= 2"],
+ "selectivity_from_histogram": 0.285714286
+ },
+ {
+ "column_name": "c",
+ "ranges": ["3 <= c <= 3"],
+ "selectivity_from_histogram": 0.285714286
+ }
+ ],
+ "cond_selectivity": 0.081632653
}
]
},
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
- "access_type": "index_merge",
- "resulting_rows": 8,
- "cost": 2.2,
+ "access_type": "scan",
+ "rows": 7,
+ "rows_after_filter": 1,
+ "rows_out": 0.571428573,
+ "cost": 0.001758432,
+ "index_only": true,
"chosen": true,
"use_tmp_table": true
}
],
"chosen_access_method": {
- "type": "index_merge",
- "records": 8,
- "cost": 2.2,
+ "type": "scan",
+ "rows_read": 1,
+ "rows_out": 0.571428573,
+ "cost": 0.001758432,
"uses_join_buffering": false
}
}
@@ -1579,16 +1729,21 @@ EXPLAIN SELECT MIN(d) FROM t1 where b=2 and c=3 group by a {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t1",
- "rows_for_plan": 8,
- "cost_for_plan": 3.8,
- "cost_for_sorting": 8
+ "rows_for_plan": 0.571428573,
+ "cost_for_plan": 0.001758432,
+ "pushdown_cond_selectivity": 0.571428573,
+ "filtered": 8.163265322,
+ "rows_out": 0.571428573,
+ "cost_for_sorting": 3.585611e-4
}
]
},
{
- "best_join_order": ["t1"]
+ "best_join_order": ["t1"],
+ "rows": 0.571428573,
+ "cost": 0.002116993
},
{
"substitute_best_equal": {
@@ -1602,13 +1757,39 @@ EXPLAIN SELECT MIN(d) FROM t1 where b=2 and c=3 group by a {
"attached_conditions_summary": [
{
"table": "t1",
- "attached": "t1.b = 2 and t1.c = 3"
+ "attached_condition": "t1.b = 2 and t1.c = 3"
}
]
}
},
{
- "test_if_skip_sort_order": []
+ "make_join_readinfo": []
+ },
+ {
+ "test_if_skip_sort_order": [
+ {
+ "reconsidering_access_paths_for_index_ordering": {
+ "clause": "GROUP BY",
+ "table": "t1",
+ "rows_estimation": 1,
+ "filesort_cost": 4.579083e-5,
+ "read_cost": 0.001804223,
+ "filesort_type": "priority_queue with addon fields",
+ "fanout": 1,
+ "possible_keys": [
+ {
+ "index": "a",
+ "can_resolve_order": true,
+ "direction": 1,
+ "rows_to_examine": 7,
+ "range_scan": false,
+ "scan_cost": 0.001758432,
+ "chosen": true
+ }
+ ]
+ }
+ }
+ ]
},
{
"prepare_sum_aggregators": {
@@ -1699,7 +1880,7 @@ EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id {
"range_analysis": {
"table_scan": {
"rows": 16,
- "cost": 7.23125
+ "cost": 0.01253808
},
"potential_range_indexes": [
{
@@ -1710,7 +1891,7 @@ EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id {
],
"best_covering_index_scan": {
"index": "id",
- "cost": 4.21171589,
+ "cost": 0.008002862,
"chosen": true
},
"setup_range_conditions": [],
@@ -1728,7 +1909,7 @@ EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id {
"covering": true,
"ranges": ["(2001-01-04) <= (a)"],
"rows": 9,
- "cost": 2.35
+ "cost": 0.005620843
}
]
},
@@ -1740,7 +1921,7 @@ EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id {
"max_aggregate": true,
"distinct_aggregate": false,
"rows": 9,
- "cost": 2.35,
+ "cost": 0.005620843,
"key_parts_used_for_access": ["id"],
"ranges": ["(2001-01-04) <= (a)"],
"chosen": true
@@ -1754,12 +1935,12 @@ EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id {
"max_aggregate": true,
"distinct_aggregate": false,
"rows": 9,
- "cost": 2.35,
+ "cost": 0.005620843,
"key_parts_used_for_access": ["id"],
"ranges": ["(2001-01-04) <= (a)"]
},
"rows_for_plan": 9,
- "cost_for_plan": 2.35,
+ "cost_for_plan": 0.005620843,
"chosen": true
}
}
@@ -1769,24 +1950,30 @@ EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "index_merge",
- "resulting_rows": 9,
- "cost": 2.35,
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.005620843,
"chosen": true,
"use_tmp_table": true
}
],
"chosen_access_method": {
"type": "index_merge",
- "records": 9,
- "cost": 2.35,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.005620843,
"uses_join_buffering": false
}
}
@@ -1794,16 +1981,18 @@ EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t1",
"rows_for_plan": 9,
- "cost_for_plan": 4.15,
- "cost_for_sorting": 9
+ "cost_for_plan": 0.005620843,
+ "cost_for_sorting": 0.005728198
}
]
},
{
- "best_join_order": ["t1"]
+ "best_join_order": ["t1"],
+ "rows": 9,
+ "cost": 0.011349041
},
{
"substitute_best_equal": {
@@ -1817,12 +2006,15 @@ EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id {
"attached_conditions_summary": [
{
"table": "t1",
- "attached": "t1.a >= 20010104e0"
+ "attached_condition": "t1.a >= 20010104e0"
}
]
}
},
{
+ "make_join_readinfo": []
+ },
+ {
"test_if_skip_sort_order": []
},
{
@@ -1909,7 +2101,7 @@ EXPLAIN SELECT * FROM t1 WHERE a = 20010104e0 GROUP BY id {
"range_analysis": {
"table_scan": {
"rows": 16,
- "cost": 7.23125
+ "cost": 0.01253808
},
"potential_range_indexes": [
{
@@ -1920,7 +2112,7 @@ EXPLAIN SELECT * FROM t1 WHERE a = 20010104e0 GROUP BY id {
],
"best_covering_index_scan": {
"index": "id",
- "cost": 4.21171589,
+ "cost": 0.008002862,
"chosen": true
},
"setup_range_conditions": [],
@@ -1938,7 +2130,7 @@ EXPLAIN SELECT * FROM t1 WHERE a = 20010104e0 GROUP BY id {
"covering": true,
"ranges": ["(2001-01-04) <= (a) <= (2001-01-04)"],
"rows": 9,
- "cost": 2.35
+ "cost": 0.005620843
}
]
},
@@ -1950,7 +2142,7 @@ EXPLAIN SELECT * FROM t1 WHERE a = 20010104e0 GROUP BY id {
"max_aggregate": false,
"distinct_aggregate": false,
"rows": 9,
- "cost": 2.35,
+ "cost": 0.005620843,
"key_parts_used_for_access": ["id", "a"],
"ranges": ["(2001-01-04) <= (a) <= (2001-01-04)"],
"chosen": true
@@ -1964,12 +2156,12 @@ EXPLAIN SELECT * FROM t1 WHERE a = 20010104e0 GROUP BY id {
"max_aggregate": false,
"distinct_aggregate": false,
"rows": 9,
- "cost": 2.35,
+ "cost": 0.005620843,
"key_parts_used_for_access": ["id", "a"],
"ranges": ["(2001-01-04) <= (a) <= (2001-01-04)"]
},
"rows_for_plan": 9,
- "cost_for_plan": 2.35,
+ "cost_for_plan": 0.005620843,
"chosen": true
}
}
@@ -1979,24 +2171,30 @@ EXPLAIN SELECT * FROM t1 WHERE a = 20010104e0 GROUP BY id {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "index_merge",
- "resulting_rows": 9,
- "cost": 2.35,
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.005620843,
"chosen": true,
"use_tmp_table": true
}
],
"chosen_access_method": {
"type": "index_merge",
- "records": 9,
- "cost": 2.35,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.005620843,
"uses_join_buffering": false
}
}
@@ -2004,16 +2202,18 @@ EXPLAIN SELECT * FROM t1 WHERE a = 20010104e0 GROUP BY id {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t1",
"rows_for_plan": 9,
- "cost_for_plan": 4.15,
- "cost_for_sorting": 9
+ "cost_for_plan": 0.005620843,
+ "cost_for_sorting": 0.005728198
}
]
},
{
- "best_join_order": ["t1"]
+ "best_join_order": ["t1"],
+ "rows": 9,
+ "cost": 0.011349041
},
{
"substitute_best_equal": {
@@ -2027,12 +2227,15 @@ EXPLAIN SELECT * FROM t1 WHERE a = 20010104e0 GROUP BY id {
"attached_conditions_summary": [
{
"table": "t1",
- "attached": "t1.a = 20010104e0"
+ "attached_condition": "t1.a = 20010104e0"
}
]
}
},
{
+ "make_join_readinfo": []
+ },
+ {
"test_if_skip_sort_order": []
}
]
@@ -2050,28 +2253,27 @@ drop table t1;
#
# Late ORDER BY optimization
#
-create table ten(a int);
-insert into ten values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-create table one_k(a int primary key);
-insert into one_k select A.a + B.a* 10 + C.a * 100 from ten A, ten B, ten C;
create table t1 (
pk int not null,
a int,
b int,
c int,
filler char(100),
-KEY a_a(c),
+KEY c(c),
KEY a_c(a,c),
KEY a_b(a,b)
);
-insert into t1
-select a, a,a,a, 'filler-dataaa' from test.one_k;
+insert into t1 select seq, seq,seq,seq, 'filler-dataaa' from seq_0_to_999;
update t1 set a=1 where pk between 0 and 180;
update t1 set b=2 where pk between 0 and 20;
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
+explain select * from t1 where a=1 and b=2 order by c limit 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a_c,a_b a_b 10 const,const 21 Using where; Using filesort
+update t1 set b=2 where pk between 20 and 40;
set optimizer_trace='enabled=on';
explain select * from t1 where a=1 and b=2 order by c limit 1;
id select_type table type possible_keys key key_len ref rows Extra
@@ -2156,11 +2358,11 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 {
"range_analysis": {
"table_scan": {
"rows": 1000,
- "cost": 232.5644531
+ "cost": 0.1731718
},
"potential_range_indexes": [
{
- "index": "a_a",
+ "index": "c",
"usable": false,
"cause": "not applicable"
},
@@ -2185,8 +2387,9 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 {
"using_mrr": false,
"index_only": false,
"rows": 180,
- "cost": 216.2943776,
- "chosen": true
+ "cost": 0.223677504,
+ "chosen": false,
+ "cause": "cost"
},
{
"index": "a_b",
@@ -2194,8 +2397,8 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 {
"rowid_ordered": true,
"using_mrr": false,
"index_only": false,
- "rows": 21,
- "cost": 25.36242739,
+ "rows": 41,
+ "cost": 0.051929313,
"chosen": true
}
],
@@ -2212,11 +2415,11 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 {
"range_access_plan": {
"type": "range_scan",
"index": "a_b",
- "rows": 21,
+ "rows": 41,
"ranges": ["(1,2) <= (a,b) <= (1,2)"]
},
- "rows_for_plan": 21,
- "cost_for_plan": 25.36242739,
+ "rows_for_plan": 41,
+ "cost_for_plan": 0.051929313,
"chosen": true
}
}
@@ -2226,12 +2429,12 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 {
"rowid_filters": [
{
"key": "a_b",
- "build_cost": 0.886777098,
- "rows": 21
+ "build_cost": 0.005839142,
+ "rows": 41
},
{
"key": "a_c",
- "build_cost": 10.52169992,
+ "build_cost": 0.024214742,
"rows": 180
}
]
@@ -2240,7 +2443,7 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 {
"selectivity_for_indexes": [
{
"index_name": "a_b",
- "selectivity_from_index": 0.021
+ "selectivity_from_index": 0.041
}
],
"selectivity_for_columns": [
@@ -2255,34 +2458,36 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 {
"selectivity_from_histogram": 0.021
}
],
- "cond_selectivity": 0.021
+ "cond_selectivity": 0.041
}
]
},
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "ref",
"index": "a_c",
"used_range_estimates": true,
- "rowid_filter_skipped": "worst/max seeks clipping",
"rows": 180,
- "cost": 180.2743776,
+ "cost": 0.222922562,
"chosen": true
},
{
"access_type": "ref",
"index": "a_b",
"used_range_estimates": true,
- "rows": 21,
- "cost": 21.14242739,
+ "rows": 41,
+ "cost": 0.051379171,
"chosen": true
},
{
@@ -2293,8 +2498,9 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 {
],
"chosen_access_method": {
"type": "ref",
- "records": 21,
- "cost": 21.14242739,
+ "rows_read": 41,
+ "rows_out": 41,
+ "cost": 0.051379171,
"uses_join_buffering": false
}
}
@@ -2302,15 +2508,17 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t1",
- "rows_for_plan": 21,
- "cost_for_plan": 25.34242739
+ "rows_for_plan": 41,
+ "cost_for_plan": 0.051379171
}
]
},
{
- "best_join_order": ["t1"]
+ "best_join_order": ["t1"],
+ "rows": 41,
+ "cost": 0.051379171
},
{
"substitute_best_equal": {
@@ -2324,38 +2532,42 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 {
"attached_conditions_summary": [
{
"table": "t1",
- "attached": null
+ "attached_condition": null
}
]
}
},
{
+ "make_join_readinfo": []
+ },
+ {
"test_if_skip_sort_order": [
{
"reconsidering_access_paths_for_index_ordering": {
"clause": "ORDER BY",
- "fanout": 1,
- "read_time": 21.14342739,
"table": "t1",
- "rows_estimation": 21,
+ "rows_estimation": 41,
+ "filesort_cost": 9.387121e-4,
+ "read_cost": 0.052317883,
+ "filesort_type": "priority_queue with addon fields",
+ "fanout": 1,
"possible_keys": [
{
- "index": "a_a",
+ "index": "c",
"can_resolve_order": true,
"direction": 1,
- "updated_limit": 47,
- "index_scan_time": 47,
- "usable": false,
- "cause": "cost"
+ "rows_to_examine": 24,
+ "range_scan": false,
+ "scan_cost": 0.030403398,
+ "chosen": true
},
{
"index": "a_c",
"can_resolve_order": true,
"direction": 1,
- "updated_limit": 47,
- "range_scan_time": 4.331020747,
- "index_scan_time": 4.331020747,
- "records": 180,
+ "rows_to_examine": 4.390243902,
+ "range_scan": true,
+ "scan_cost": 0.023415994,
"chosen": true
},
{
@@ -2369,13 +2581,9 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 {
{
"table": "t1",
"range_analysis": {
- "table_scan": {
- "rows": 1000,
- "cost": 1.79769e308
- },
"potential_range_indexes": [
{
- "index": "a_a",
+ "index": "c",
"usable": false,
"cause": "not applicable"
},
@@ -2400,7 +2608,8 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 {
"using_mrr": false,
"index_only": false,
"rows": 180,
- "cost": 216.2943776,
+ "cost": 0.223677504,
+ "cost_with_limit": 0.002574553,
"chosen": true
}
],
@@ -2421,7 +2630,7 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 {
"ranges": ["(1) <= (a) <= (1)"]
},
"rows_for_plan": 180,
- "cost_for_plan": 216.2943776,
+ "cost_for_plan": 0.223677504,
"chosen": true
}
}
@@ -2439,7 +2648,7 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 {
}
]
} 0 0
-drop table t1,ten,one_k;
+drop table t1;
#
# TABLE ELIMINATION
#
@@ -2530,7 +2739,8 @@ select t1.a from t1 left join t2 on t1.a=t2.a {
"table": "t1",
"table_scan": {
"rows": 4,
- "cost": 2.006835938
+ "read_cost": 0.01053322,
+ "read_and_compare_cost": 0.01066122
}
},
{
@@ -2544,23 +2754,30 @@ select t1.a from t1 left join t2 on t1.a=t2.a {
{
"considered_execution_plans": [
{
- "plan_prefix": ["t2"],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 4,
- "cost": 2.006835938,
+ "rows": 4,
+ "rows_after_filter": 4,
+ "rows_out": 4,
+ "cost": 0.01066122,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 4,
- "cost": 2.006835938,
+ "rows_read": 4,
+ "rows_out": 4,
+ "cost": 0.01066122,
"uses_join_buffering": false
}
}
@@ -2568,15 +2785,17 @@ select t1.a from t1 left join t2 on t1.a=t2.a {
]
},
{
- "plan_prefix": ["t2"],
+ "plan_prefix": "",
"table": "t1",
"rows_for_plan": 4,
- "cost_for_plan": 2.806835937
+ "cost_for_plan": 0.01066122
}
]
},
{
- "best_join_order": ["t2", "t1"]
+ "best_join_order": ["t2", "t1"],
+ "rows": 4,
+ "cost": 0.01066122
},
{
"substitute_best_equal": {
@@ -2585,19 +2804,23 @@ select t1.a from t1 left join t2 on t1.a=t2.a {
}
},
{
- "condition_on_constant_tables": "1",
- "computing_condition": []
- },
- {
"attaching_conditions_to_tables": {
- "attached_conditions_computation": [],
+ "attached_conditions_computation": [
+ {
+ "condition_on_constant_tables": "1",
+ "computing_condition": []
+ }
+ ],
"attached_conditions_summary": [
{
"table": "t1",
- "attached": null
+ "attached_condition": null
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -2676,14 +2899,16 @@ explain select * from t1 left join t2 on t2.a=t1.a {
"table": "t1",
"table_scan": {
"rows": 4,
- "cost": 2.006835938
+ "read_cost": 0.01053322,
+ "read_and_compare_cost": 0.01066122
}
},
{
"table": "t2",
"table_scan": {
"rows": 2,
- "cost": 2.004394531
+ "read_cost": 0.01028441,
+ "read_and_compare_cost": 0.01034841
}
}
]
@@ -2691,23 +2916,30 @@ explain select * from t1 left join t2 on t2.a=t1.a {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 4,
- "cost": 2.006835938,
+ "rows": 4,
+ "rows_after_filter": 4,
+ "rows_out": 4,
+ "cost": 0.01066122,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 4,
- "cost": 2.006835938,
+ "rows_read": 4,
+ "rows_out": 4,
+ "cost": 0.01066122,
"uses_join_buffering": false
}
}
@@ -2715,36 +2947,39 @@ explain select * from t1 left join t2 on t2.a=t1.a {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t1",
"rows_for_plan": 4,
- "cost_for_plan": 2.806835937,
+ "cost_for_plan": 0.01066122,
"rest_of_plan": [
{
- "plan_prefix": ["t1"],
+ "plan_prefix": "t1",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t2",
+ "plan_details": {
+ "record_count": 4
+ },
"considered_access_paths": [
{
"access_type": "eq_ref",
"index": "PRIMARY",
"rows": 1,
- "cost": 4,
+ "cost": 0.007120904,
"chosen": true
},
{
- "access_type": "scan",
- "resulting_rows": 2,
- "cost": 8.017578125,
- "chosen": false
+ "type": "scan",
+ "chosen": false,
+ "cause": "cost"
}
],
"chosen_access_method": {
"type": "eq_ref",
- "records": 1,
- "cost": 4,
+ "rows_read": 1,
+ "rows_out": 1,
+ "cost": 0.007120904,
"uses_join_buffering": false
}
}
@@ -2752,17 +2987,19 @@ explain select * from t1 left join t2 on t2.a=t1.a {
]
},
{
- "plan_prefix": ["t1"],
+ "plan_prefix": "t1",
"table": "t2",
"rows_for_plan": 4,
- "cost_for_plan": 7.606835937
+ "cost_for_plan": 0.017782124
}
]
}
]
},
{
- "best_join_order": ["t1", "t2"]
+ "best_join_order": ["t1", "t2"],
+ "rows": 4,
+ "cost": 0.017782124
},
{
"substitute_best_equal": {
@@ -2778,23 +3015,27 @@ explain select * from t1 left join t2 on t2.a=t1.a {
}
},
{
- "condition_on_constant_tables": "1",
- "computing_condition": []
- },
- {
"attaching_conditions_to_tables": {
- "attached_conditions_computation": [],
+ "attached_conditions_computation": [
+ {
+ "condition_on_constant_tables": "1",
+ "computing_condition": []
+ }
+ ],
"attached_conditions_summary": [
{
"table": "t1",
- "attached": null
+ "attached_condition": null
},
{
"table": "t2",
- "attached": "trigcond(trigcond(t1.a is not null))"
+ "attached_condition": "trigcond(trigcond(t1.a is not null))"
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -2899,7 +3140,8 @@ explain select t1.a from t1 left join (t2 join t3 on t2.b=t3.b) on t2.a=t1.a and
"table": "t1",
"table_scan": {
"rows": 4,
- "cost": 2.006835938
+ "read_cost": 0.01053322,
+ "read_and_compare_cost": 0.01066122
}
},
{
@@ -2919,23 +3161,30 @@ explain select t1.a from t1 left join (t2 join t3 on t2.b=t3.b) on t2.a=t1.a and
{
"considered_execution_plans": [
{
- "plan_prefix": ["t3", "t2"],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 4,
- "cost": 2.006835938,
+ "rows": 4,
+ "rows_after_filter": 4,
+ "rows_out": 4,
+ "cost": 0.01066122,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 4,
- "cost": 2.006835938,
+ "rows_read": 4,
+ "rows_out": 4,
+ "cost": 0.01066122,
"uses_join_buffering": false
}
}
@@ -2943,15 +3192,17 @@ explain select t1.a from t1 left join (t2 join t3 on t2.b=t3.b) on t2.a=t1.a and
]
},
{
- "plan_prefix": ["t3", "t2"],
+ "plan_prefix": "",
"table": "t1",
"rows_for_plan": 4,
- "cost_for_plan": 2.806835937
+ "cost_for_plan": 0.01066122
}
]
},
{
- "best_join_order": ["t3", "t2", "t1"]
+ "best_join_order": ["t3", "t2", "t1"],
+ "rows": 4,
+ "cost": 0.01066122
},
{
"substitute_best_equal": {
@@ -2960,19 +3211,23 @@ explain select t1.a from t1 left join (t2 join t3 on t2.b=t3.b) on t2.a=t1.a and
}
},
{
- "condition_on_constant_tables": "1",
- "computing_condition": []
- },
- {
"attaching_conditions_to_tables": {
- "attached_conditions_computation": [],
+ "attached_conditions_computation": [
+ {
+ "condition_on_constant_tables": "1",
+ "computing_condition": []
+ }
+ ],
"attached_conditions_summary": [
{
"table": "t1",
- "attached": null
+ "attached_condition": null
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -2989,33 +3244,27 @@ drop table t0, t1, t2, t3;
#
# IN subquery to sem-join is traced
#
-create table t0 (a int);
-insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1(a int, b int);
-insert into t1 values (0,0),(1,1),(2,2);
-create table t2 as select * from t1;
-create table t11(a int, b int);
-create table t10 (pk int, a int);
-insert into t10 select a,a from t0;
-create table t12 like t10;
-insert into t12 select * from t10;
-analyze table t1,t10;
-Table Op Msg_type Msg_text
-test.t1 analyze status Engine-independent statistics collected
-test.t1 analyze status OK
-test.t10 analyze status Engine-independent statistics collected
-test.t10 analyze status OK
+insert into t1 select seq,seq from seq_0_to_3;
+create table t2 (p int, a int);
+insert into t2 select seq,seq from seq_1_to_10;
set optimizer_trace='enabled=on';
-explain extended select * from t1 where a in (select pk from t10);
+explain extended select * from t1 where a in (select p from t2);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED t10 ALL NULL NULL NULL NULL 10 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00
+1 PRIMARY t2 ALL NULL NULL NULL NULL 10 10.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t10`) where 1
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`p` = `test`.`t1`.`a`
+insert into t2 select seq,seq from seq_10_to_100;
+explain extended select * from t1 where a in (select p from t2);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00
+1 PRIMARY t2 ALL NULL NULL NULL NULL 101 0.99 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`p` = `test`.`t1`.`a`
select * from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES
-explain extended select * from t1 where a in (select pk from t10) {
+explain extended select * from t1 where a in (select p from t2) {
"steps": [
{
"join_preparation": {
@@ -3034,13 +3283,13 @@ explain extended select * from t1 where a in (select pk from t10) {
}
},
{
- "expanded_query": "/* select#2 */ select t10.pk from t10"
+ "expanded_query": "/* select#2 */ select t2.p from t2"
}
]
}
},
{
- "expanded_query": "/* select#1 */ select t1.a AS a,t1.b AS b from t1 where t1.a in (/* select#2 */ select t10.pk from t10)"
+ "expanded_query": "/* select#1 */ select t1.a AS a,t1.b AS b from t1 where t1.a in (/* select#2 */ select t2.p from t2)"
}
]
}
@@ -3069,19 +3318,19 @@ explain extended select * from t1 where a in (select pk from t10) {
{
"condition_processing": {
"condition": "WHERE",
- "original_condition": "1 and t1.a = t10.pk",
+ "original_condition": "1 and t1.a = t2.p",
"steps": [
{
"transformation": "equality_propagation",
- "resulting_condition": "1 and multiple equal(t1.a, t10.pk)"
+ "resulting_condition": "1 and multiple equal(t1.a, t2.p)"
},
{
"transformation": "constant_propagation",
- "resulting_condition": "1 and multiple equal(t1.a, t10.pk)"
+ "resulting_condition": "1 and multiple equal(t1.a, t2.p)"
},
{
"transformation": "trivial_condition_removal",
- "resulting_condition": "multiple equal(t1.a, t10.pk)"
+ "resulting_condition": "multiple equal(t1.a, t2.p)"
}
]
}
@@ -3095,7 +3344,7 @@ explain extended select * from t1 where a in (select pk from t10) {
"depends_on_map_bits": []
},
{
- "table": "t10",
+ "table": "t2",
"row_may_be_null": false,
"map_bit": 1,
"depends_on_map_bits": []
@@ -3110,15 +3359,17 @@ explain extended select * from t1 where a in (select pk from t10) {
{
"table": "t1",
"table_scan": {
- "rows": 3,
- "cost": 2.006591797
+ "rows": 4,
+ "read_cost": 0.01053322,
+ "read_and_compare_cost": 0.01066122
}
},
{
- "table": "t10",
+ "table": "t2",
"table_scan": {
- "rows": 10,
- "cost": 2.021972656
+ "rows": 101,
+ "read_cost": 0.022600505,
+ "read_and_compare_cost": 0.025832505
}
}
]
@@ -3134,23 +3385,30 @@ explain extended select * from t1 where a in (select pk from t10) {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
- "table": "t10",
+ "table": "t2",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 10,
- "cost": 2.021972656,
+ "rows": 101,
+ "rows_after_filter": 101,
+ "rows_out": 101,
+ "cost": 0.025832505,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 10,
- "cost": 2.021972656,
+ "rows_read": 101,
+ "rows_out": 101,
+ "cost": 0.025832505,
"uses_join_buffering": false
}
}
@@ -3158,10 +3416,10 @@ explain extended select * from t1 where a in (select pk from t10) {
]
},
{
- "plan_prefix": [],
- "table": "t10",
- "rows_for_plan": 10,
- "cost_for_plan": 4.021972656
+ "plan_prefix": "",
+ "table": "t2",
+ "rows_for_plan": 101,
+ "cost_for_plan": 0.025832505
}
]
}
@@ -3171,42 +3429,56 @@ explain extended select * from t1 where a in (select pk from t10) {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.006591797,
+ "rows": 4,
+ "rows_after_filter": 4,
+ "rows_out": 4,
+ "cost": 0.01066122,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.006591797,
+ "rows_read": 4,
+ "rows_out": 4,
+ "cost": 0.01066122,
"uses_join_buffering": false
}
}
},
{
"best_access_path": {
- "table": "t10",
+ "table": "t2",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 10,
- "cost": 2.021972656,
+ "rows": 101,
+ "rows_after_filter": 101,
+ "rows_out": 101,
+ "cost": 0.025832505,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 10,
- "cost": 2.021972656,
+ "rows_read": 101,
+ "rows_out": 101,
+ "cost": 0.025832505,
"uses_join_buffering": false
}
}
@@ -3214,30 +3486,38 @@ explain extended select * from t1 where a in (select pk from t10) {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t1",
- "rows_for_plan": 3,
- "cost_for_plan": 2.606591797,
+ "rows_for_plan": 4,
+ "cost_for_plan": 0.01066122,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": ["t1"],
+ "plan_prefix": "t1",
"get_costs_for_tables": [
{
"best_access_path": {
- "table": "t10",
+ "table": "t2",
+ "plan_details": {
+ "record_count": 4
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 10,
- "cost": 2.021972656,
+ "access_type": "scan_with_join_cache",
+ "rows": 101,
+ "rows_after_filter": 101,
+ "rows_out": 101,
+ "cost": 0.063593833,
+ "cost_without_join_buffer": 0.10333002,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 10,
- "cost": 2.021972656,
+ "rows_read": 101,
+ "rows_out": 101,
+ "cost": 0.063593833,
"uses_join_buffering": true
}
}
@@ -3245,38 +3525,47 @@ explain extended select * from t1 where a in (select pk from t10) {
]
},
{
- "plan_prefix": ["t1"],
- "table": "t10",
- "rows_for_plan": 30,
- "cost_for_plan": 10.62856445,
+ "plan_prefix": "t1",
+ "table": "t2",
+ "rows_for_plan": 404,
+ "cost_for_plan": 0.074255053,
"semijoin_strategy_choice": [
{
"strategy": "FirstMatch",
- "records": 3,
- "read_time": 10.62856445
+ "rows": 4,
+ "cost": 0.074255053
},
{
"strategy": "SJ-Materialization",
- "records": 3,
- "read_time": 5.278564453
+ "rows": 4,
+ "cost": 0.078768645
},
{
"strategy": "DuplicateWeedout",
- "records": 3,
- "read_time": 27.12856445
+ "prefix_row_count": 4,
+ "tmp_table_rows": 1,
+ "sj_inner_fanout": 101,
+ "rows": 4,
+ "dups_cost": 0.074255053,
+ "write_cost": 0.02564388,
+ "full_lookup_cost": 0.06503188,
+ "total_cost": 0.164930813
},
{
- "chosen_strategy": "SJ-Materialization"
+ "chosen_strategy": "FirstMatch"
}
- ]
+ ],
+ "sj_rows_out": 1,
+ "sj_rows_for_plan": 4,
+ "sj_filtered": 0.99009901
}
]
},
{
- "plan_prefix": [],
- "table": "t10",
- "rows_for_plan": 10,
- "cost_for_plan": 4.021972656,
+ "plan_prefix": "",
+ "table": "t2",
+ "rows_for_plan": 101,
+ "cost_for_plan": 0.025832505,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
}
@@ -3285,46 +3574,43 @@ explain extended select * from t1 where a in (select pk from t10) {
{
"fix_semijoin_strategies_for_picked_join_order": [
{
- "semi_join_strategy": "SJ-Materialization",
+ "semi_join_strategy": "FirstMatch",
"join_order": [
{
- "table": "t10"
+ "table": "t2"
}
]
}
]
},
{
- "best_join_order": ["t1", "<subquery2>"]
+ "best_join_order": ["t1", "t2"],
+ "rows": 4,
+ "cost": 0.074255053
},
{
"substitute_best_equal": {
"condition": "WHERE",
- "resulting_condition": "1"
+ "resulting_condition": "t2.p = t1.a"
}
},
{
- "condition_on_constant_tables": "1",
- "computing_condition": []
- },
- {
"attaching_conditions_to_tables": {
"attached_conditions_computation": [],
"attached_conditions_summary": [
{
"table": "t1",
- "attached": null
- },
- {
- "table": "t10",
- "attached": null
+ "attached_condition": null
},
{
- "table": "<subquery2>",
- "attached": null
+ "table": "t2",
+ "attached_condition": "t2.p = t1.a"
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -3337,12 +3623,10 @@ explain extended select * from t1 where a in (select pk from t10) {
}
]
} 0 0
-drop table t0,t1,t11,t10,t12,t2;
+drop table t1,t2;
#
# Selectivities for columns and indexes.
#
-create table t0 (a int);
-insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 (
pk int,
a int,
@@ -3350,7 +3634,7 @@ b int,
key pk(pk),
key pk_a(pk,a),
key pk_a_b(pk,a,b));
-insert into t1 select a,a,a from t0;
+insert into t1 select seq,seq,seq from seq_0_to_9;
ANALYZE TABLE t1 PERSISTENT FOR COLUMNS (a,b) INDEXES ();
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
@@ -3464,7 +3748,7 @@ explain select * from t1 where pk = 2 and a=5 and b=1 {
"range_analysis": {
"table_scan": {
"rows": 10,
- "cost": 6.031738281
+ "cost": 0.01159965
},
"potential_range_indexes": [
{
@@ -3485,7 +3769,7 @@ explain select * from t1 where pk = 2 and a=5 and b=1 {
],
"best_covering_index_scan": {
"index": "pk_a_b",
- "cost": 3.010739566,
+ "cost": 0.007173242,
"chosen": true
},
"setup_range_conditions": [],
@@ -3498,7 +3782,7 @@ explain select * from t1 where pk = 2 and a=5 and b=1 {
"using_mrr": false,
"index_only": false,
"rows": 1,
- "cost": 1.345585794,
+ "cost": 0.002574553,
"chosen": true
},
{
@@ -3508,7 +3792,7 @@ explain select * from t1 where pk = 2 and a=5 and b=1 {
"using_mrr": false,
"index_only": false,
"rows": 1,
- "cost": 1.345829876,
+ "cost": 0.002574553,
"chosen": false,
"cause": "cost"
},
@@ -3519,7 +3803,7 @@ explain select * from t1 where pk = 2 and a=5 and b=1 {
"using_mrr": false,
"index_only": true,
"rows": 1,
- "cost": 0.346073957,
+ "cost": 0.001478954,
"chosen": true
}
],
@@ -3527,10 +3811,10 @@ explain select * from t1 where pk = 2 and a=5 and b=1 {
"intersecting_indexes": [
{
"index": "pk",
- "index_scan_cost": 1.000585794,
- "cumulated_index_scan_cost": 1.000585794,
- "disk_sweep_cost": 0.90078125,
- "cumulative_total_cost": 1.901367044,
+ "index_scan_cost": 0.000806227,
+ "cumulated_index_scan_cost": 0.000806227,
+ "disk_sweep_cost": 0.001143284,
+ "cumulative_total_cost": 0.001949511,
"usable": true,
"matching_rows_now": 1,
"intersect_covering_with_this_index": false,
@@ -3568,7 +3852,7 @@ explain select * from t1 where pk = 2 and a=5 and b=1 {
"ranges": ["(2,5,1) <= (pk,a,b) <= (2,5,1)"]
},
"rows_for_plan": 1,
- "cost_for_plan": 0.346073957,
+ "cost_for_plan": 0.001478954,
"chosen": true
}
}
@@ -3578,17 +3862,17 @@ explain select * from t1 where pk = 2 and a=5 and b=1 {
"rowid_filters": [
{
"key": "pk",
- "build_cost": 0.130585794,
+ "build_cost": 0.000899465,
"rows": 1
},
{
"key": "pk_a",
- "build_cost": 0.130829876,
+ "build_cost": 0.000899465,
"rows": 1
},
{
"key": "pk_a_b",
- "build_cost": 0.131073957,
+ "build_cost": 0.000899465,
"rows": 1
}
]
@@ -3619,18 +3903,21 @@ explain select * from t1 where pk = 2 and a=5 and b=1 {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "ref",
"index": "pk",
"used_range_estimates": true,
"rows": 1,
- "cost": 1.125585794,
+ "cost": 0.002024411,
"chosen": true
},
{
@@ -3638,7 +3925,7 @@ explain select * from t1 where pk = 2 and a=5 and b=1 {
"index": "pk_a",
"used_range_estimates": true,
"rows": 1,
- "cost": 1.125829876,
+ "cost": 0.002024411,
"chosen": false,
"cause": "cost"
},
@@ -3647,7 +3934,7 @@ explain select * from t1 where pk = 2 and a=5 and b=1 {
"index": "pk_a_b",
"used_range_estimates": true,
"rows": 1,
- "cost": 0.126073957,
+ "cost": 0.000928812,
"chosen": true
},
{
@@ -3658,8 +3945,9 @@ explain select * from t1 where pk = 2 and a=5 and b=1 {
],
"chosen_access_method": {
"type": "ref",
- "records": 1,
- "cost": 0.126073957,
+ "rows_read": 1,
+ "rows_out": 1,
+ "cost": 0.000928812,
"uses_join_buffering": false
}
}
@@ -3667,15 +3955,17 @@ explain select * from t1 where pk = 2 and a=5 and b=1 {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t1",
"rows_for_plan": 1,
- "cost_for_plan": 0.326073957
+ "cost_for_plan": 0.000928812
}
]
},
{
- "best_join_order": ["t1"]
+ "best_join_order": ["t1"],
+ "rows": 1,
+ "cost": 0.000928812
},
{
"substitute_best_equal": {
@@ -3689,10 +3979,13 @@ explain select * from t1 where pk = 2 and a=5 and b=1 {
"attached_conditions_summary": [
{
"table": "t1",
- "attached": null
+ "attached_condition": null
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -3707,7 +4000,7 @@ explain select * from t1 where pk = 2 and a=5 and b=1 {
} 0 0
set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set @@use_stat_tables= @save_use_stat_tables;
-drop table t0,t1;
+drop table t1;
set optimizer_trace="enabled=off";
#
# Tests added to show that sub-statements are not traced
@@ -3728,8 +4021,6 @@ declare a int default 0;
select count(*) from t2 into a;
return a;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
set optimizer_trace='enabled=on';
select f1(a) from t1;
f1(a)
@@ -3771,7 +4062,8 @@ select f1(a) from t1 {
"table": "t1",
"table_scan": {
"rows": 4,
- "cost": 2.006835938
+ "read_cost": 0.01053322,
+ "read_and_compare_cost": 0.01066122
}
}
]
@@ -3779,23 +4071,30 @@ select f1(a) from t1 {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 4,
- "cost": 2.006835938,
+ "rows": 4,
+ "rows_after_filter": 4,
+ "rows_out": 4,
+ "cost": 0.01066122,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 4,
- "cost": 2.006835938,
+ "rows_read": 4,
+ "rows_out": 4,
+ "cost": 0.01066122,
"uses_join_buffering": false
}
}
@@ -3803,15 +4102,17 @@ select f1(a) from t1 {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t1",
"rows_for_plan": 4,
- "cost_for_plan": 2.806835937
+ "cost_for_plan": 0.01066122
}
]
},
{
- "best_join_order": ["t1"]
+ "best_join_order": ["t1"],
+ "rows": 4,
+ "cost": 0.01066122
},
{
"attaching_conditions_to_tables": {
@@ -3819,10 +4120,13 @@ select f1(a) from t1 {
"attached_conditions_summary": [
{
"table": "t1",
- "attached": null
+ "attached_condition": null
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -3875,7 +4179,8 @@ select f2(a) from t1 {
"table": "t1",
"table_scan": {
"rows": 4,
- "cost": 2.006835938
+ "read_cost": 0.01053322,
+ "read_and_compare_cost": 0.01066122
}
}
]
@@ -3883,23 +4188,30 @@ select f2(a) from t1 {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 4,
- "cost": 2.006835938,
+ "rows": 4,
+ "rows_after_filter": 4,
+ "rows_out": 4,
+ "cost": 0.01066122,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 4,
- "cost": 2.006835938,
+ "rows_read": 4,
+ "rows_out": 4,
+ "cost": 0.01066122,
"uses_join_buffering": false
}
}
@@ -3907,15 +4219,17 @@ select f2(a) from t1 {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t1",
"rows_for_plan": 4,
- "cost_for_plan": 2.806835937
+ "cost_for_plan": 0.01066122
}
]
},
{
- "best_join_order": ["t1"]
+ "best_join_order": ["t1"],
+ "rows": 4,
+ "cost": 0.01066122
},
{
"attaching_conditions_to_tables": {
@@ -3923,10 +4237,13 @@ select f2(a) from t1 {
"attached_conditions_summary": [
{
"table": "t1",
- "attached": null
+ "attached_condition": null
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -3956,7 +4273,7 @@ a
2
select length(trace) from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
length(trace)
-2360
+2819
set optimizer_trace_max_mem_size=100;
select * from t1;
a
@@ -3970,7 +4287,7 @@ select * from t1 {
"join_preparation": {
"select_id": 1,
"steps": [
- 2260 0
+ 2719 0
set optimizer_trace_max_mem_size=0;
select * from t1;
a
@@ -3978,7 +4295,7 @@ a
2
select * from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES
-select * from t1 2360 0
+select * from t1 2819 0
drop table t1;
set optimizer_trace='enabled=off';
set @@optimizer_trace_max_mem_size= @save_optimizer_trace_max_mem_size;
@@ -3999,11 +4316,21 @@ QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES
explain delete from t0 where t0.a<3 {
"steps": [
{
+ "join_preparation": {
+ "select_id": 1,
+ "steps": [
+ {
+ "expanded_query": "delete from t0 using dual where t0.a < 3"
+ }
+ ]
+ }
+ },
+ {
"table": "t0",
"range_analysis": {
"table_scan": {
"rows": 10,
- "cost": 6.021972656
+ "cost": 0.01159965
},
"potential_range_indexes": [
{
@@ -4022,7 +4349,7 @@ explain delete from t0 where t0.a<3 {
"using_mrr": false,
"index_only": false,
"rows": 3,
- "cost": 3.746757383,
+ "cost": 0.005042291,
"chosen": true
}
],
@@ -4030,7 +4357,7 @@ explain delete from t0 where t0.a<3 {
},
"group_index_range": {
"chosen": false,
- "cause": "no join"
+ "cause": "no group by or distinct"
},
"chosen_range_access_summary": {
"range_access_plan": {
@@ -4040,7 +4367,7 @@ explain delete from t0 where t0.a<3 {
"ranges": ["(NULL) < (a) < (3)"]
},
"rows_for_plan": 3,
- "cost_for_plan": 3.746757383,
+ "cost_for_plan": 0.005042291,
"chosen": true
}
}
@@ -4143,7 +4470,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
"range_analysis": {
"table_scan": {
"rows": 10,
- "cost": 6.021972656
+ "cost": 0.01159965
},
"potential_range_indexes": [
{
@@ -4154,7 +4481,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
],
"best_covering_index_scan": {
"index": "a",
- "cost": 3.005857945,
+ "cost": 0.007173242,
"chosen": true
},
"setup_range_conditions": [],
@@ -4167,7 +4494,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
"using_mrr": false,
"index_only": true,
"rows": 3,
- "cost": 0.746757383,
+ "cost": 0.001755494,
"chosen": true
}
],
@@ -4188,12 +4515,22 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
"ranges": ["(NULL) < (a) < (3)"]
},
"rows_for_plan": 3,
- "cost_for_plan": 0.746757383,
+ "cost_for_plan": 0.001755494,
"chosen": true
}
}
},
{
+ "table": "t0",
+ "rowid_filters": [
+ {
+ "key": "a",
+ "build_cost": 0.001129926,
+ "rows": 3
+ }
+ ]
+ },
+ {
"selectivity_for_indexes": [
{
"index_name": "a",
@@ -4208,7 +4545,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
"range_analysis": {
"table_scan": {
"rows": 10,
- "cost": 6.021972656
+ "cost": 0.01159965
},
"potential_range_indexes": [
{
@@ -4219,7 +4556,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
],
"best_covering_index_scan": {
"index": "a",
- "cost": 3.005857945,
+ "cost": 0.007173242,
"chosen": true
},
"setup_range_conditions": [],
@@ -4232,7 +4569,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
"using_mrr": false,
"index_only": true,
"rows": 3,
- "cost": 0.746757383,
+ "cost": 0.001755494,
"chosen": true
}
],
@@ -4253,12 +4590,22 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
"ranges": ["(NULL) < (a) < (3)"]
},
"rows_for_plan": 3,
- "cost_for_plan": 0.746757383,
+ "cost_for_plan": 0.001755494,
"chosen": true
}
}
},
{
+ "table": "t1",
+ "rowid_filters": [
+ {
+ "key": "a",
+ "build_cost": 0.001129926,
+ "rows": 3
+ }
+ ]
+ },
+ {
"selectivity_for_indexes": [
{
"index_name": "a",
@@ -4273,23 +4620,30 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t0",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "range",
- "resulting_rows": 3,
- "cost": 0.746757383,
+ "range_index": "a",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.001755494,
"chosen": true
}
],
"chosen_access_method": {
"type": "range",
- "records": 3,
- "cost": 0.746757383,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.001755494,
"uses_join_buffering": false
}
}
@@ -4297,18 +4651,25 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "range",
- "resulting_rows": 3,
- "cost": 0.746757383,
+ "range_index": "a",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.001755494,
"chosen": true
}
],
"chosen_access_method": {
"type": "range",
- "records": 3,
- "cost": 0.746757383,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.001755494,
"uses_join_buffering": false
}
}
@@ -4316,17 +4677,20 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t0",
"rows_for_plan": 3,
- "cost_for_plan": 1.346757383,
+ "cost_for_plan": 0.001755494,
"rest_of_plan": [
{
- "plan_prefix": ["t0"],
+ "plan_prefix": "t0",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 3
+ },
"considered_access_paths": [
{
"access_type": "ref",
@@ -4334,7 +4698,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
"used_range_estimates": false,
"reason": "not better than ref estimates",
"rows": 1,
- "cost": 3.001757383,
+ "cost": 0.002376836,
"chosen": true
},
{
@@ -4345,8 +4709,9 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
],
"chosen_access_method": {
"type": "ref",
- "records": 1,
- "cost": 3.001757383,
+ "rows_read": 1,
+ "rows_out": 1,
+ "cost": 0.002376836,
"uses_join_buffering": false
}
}
@@ -4354,25 +4719,28 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
]
},
{
- "plan_prefix": ["t0"],
+ "plan_prefix": "t0",
"table": "t1",
"rows_for_plan": 3,
- "cost_for_plan": 4.948514767
+ "cost_for_plan": 0.00413233
}
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t1",
"rows_for_plan": 3,
- "cost_for_plan": 1.346757383,
+ "cost_for_plan": 0.001755494,
"rest_of_plan": [
{
- "plan_prefix": ["t1"],
+ "plan_prefix": "t1",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t0",
+ "plan_details": {
+ "record_count": 3
+ },
"considered_access_paths": [
{
"access_type": "ref",
@@ -4380,9 +4748,8 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
"rec_per_key_stats_missing": true,
"used_range_estimates": false,
"reason": "not better than ref estimates",
- "rowid_filter_skipped": "worst/max seeks clipping",
- "rows": 2,
- "cost": 3.003514767,
+ "rows": 1.166666667,
+ "cost": 0.002392836,
"chosen": true
},
{
@@ -4393,8 +4760,9 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
],
"chosen_access_method": {
"type": "ref",
- "records": 2,
- "cost": 3.003514767,
+ "rows_read": 1.166666667,
+ "rows_out": 1.166666667,
+ "cost": 0.002392836,
"uses_join_buffering": false
}
}
@@ -4402,20 +4770,22 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
]
},
{
- "plan_prefix": ["t1"],
+ "plan_prefix": "t1",
"table": "t0",
- "rows_for_plan": 6,
- "cost_for_plan": 5.55027215,
+ "rows_for_plan": 3.5,
+ "cost_for_plan": 0.00414833,
"pruned_by_cost": true,
- "current_cost": 5.55027215,
- "best_cost": 4.948514767
+ "current_cost": 0.00414833,
+ "best_cost": 0.00413233
}
]
}
]
},
{
- "best_join_order": ["t0", "t1"]
+ "best_join_order": ["t0", "t1"],
+ "rows": 3,
+ "cost": 0.00413233
},
{
"substitute_best_equal": {
@@ -4429,14 +4799,17 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 {
"attached_conditions_summary": [
{
"table": "t0",
- "attached": "t0.a < 3 and t0.a is not null"
+ "attached_condition": "t0.a < 3 and t0.a is not null"
},
{
"table": "t1",
- "attached": null
+ "attached_condition": null
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -4516,7 +4889,8 @@ explain select * from (select rand() from t1)q {
"table": "t1",
"table_scan": {
"rows": 3,
- "cost": 2.005126953
+ "read_cost": 0.010408815,
+ "read_and_compare_cost": 0.010504815
}
}
]
@@ -4524,23 +4898,30 @@ explain select * from (select rand() from t1)q {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
"uses_join_buffering": false
}
}
@@ -4548,15 +4929,17 @@ explain select * from (select rand() from t1)q {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t1",
"rows_for_plan": 3,
- "cost_for_plan": 2.605126953
+ "cost_for_plan": 0.010504815
}
]
},
{
- "best_join_order": ["t1"]
+ "best_join_order": ["t1"],
+ "rows": 3,
+ "cost": 0.010504815
},
{
"attaching_conditions_to_tables": {
@@ -4564,10 +4947,13 @@ explain select * from (select rand() from t1)q {
"attached_conditions_summary": [
{
"table": "t1",
- "attached": null
+ "attached_condition": null
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -4588,7 +4974,8 @@ explain select * from (select rand() from t1)q {
"table": "<derived2>",
"table_scan": {
"rows": 3,
- "cost": 3
+ "read_cost": 0.01235805,
+ "read_and_compare_cost": 0.012461052
}
}
]
@@ -4596,23 +4983,30 @@ explain select * from (select rand() from t1)q {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "<derived2>",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 3,
- "cost": 3,
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.012461052,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 3,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.012461052,
"uses_join_buffering": false
}
}
@@ -4620,15 +5014,17 @@ explain select * from (select rand() from t1)q {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "<derived2>",
"rows_for_plan": 3,
- "cost_for_plan": 3.6
+ "cost_for_plan": 0.012461052
}
]
},
{
- "best_join_order": ["<derived2>"]
+ "best_join_order": ["<derived2>"],
+ "rows": 3,
+ "cost": 0.012461052
},
{
"attaching_conditions_to_tables": {
@@ -4636,10 +5032,13 @@ explain select * from (select rand() from t1)q {
"attached_conditions_summary": [
{
"table": "<derived2>",
- "attached": null
+ "attached_condition": null
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -4780,21 +5179,24 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
"table": "t1",
"table_scan": {
"rows": 3,
- "cost": 2.005126953
+ "read_cost": 0.010408815,
+ "read_and_compare_cost": 0.010504815
}
},
{
"table": "t_inner_1",
"table_scan": {
"rows": 3,
- "cost": 2.005126953
+ "read_cost": 0.010408815,
+ "read_and_compare_cost": 0.010504815
}
},
{
"table": "t_inner_2",
"table_scan": {
"rows": 3,
- "cost": 2.005126953
+ "read_cost": 0.010408815,
+ "read_and_compare_cost": 0.010504815
}
}
]
@@ -4810,23 +5212,30 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
"uses_join_buffering": false
}
}
@@ -4834,18 +5243,25 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
{
"best_access_path": {
"table": "t_inner_2",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
"uses_join_buffering": false
}
}
@@ -4853,29 +5269,37 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t_inner_1",
"rows_for_plan": 3,
- "cost_for_plan": 2.605126953,
+ "cost_for_plan": 0.010504815,
"rest_of_plan": [
{
- "plan_prefix": ["t_inner_1"],
+ "plan_prefix": "t_inner_1",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_2",
+ "plan_details": {
+ "record_count": 3
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.011523207,
+ "cost_without_join_buffer": 0.031514445,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.011523207,
"uses_join_buffering": true
}
}
@@ -4883,18 +5307,18 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
]
},
{
- "plan_prefix": ["t_inner_1"],
+ "plan_prefix": "t_inner_1",
"table": "t_inner_2",
"rows_for_plan": 9,
- "cost_for_plan": 6.410253906
+ "cost_for_plan": 0.022028022
}
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t_inner_2",
"rows_for_plan": 3,
- "cost_for_plan": 2.605126953,
+ "cost_for_plan": 0.010504815,
"pruned_by_heuristic": true
}
]
@@ -4905,23 +5329,30 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
"uses_join_buffering": false
}
}
@@ -4929,18 +5360,25 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
{
"best_access_path": {
"table": "t_inner_1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
"uses_join_buffering": false
}
}
@@ -4948,18 +5386,25 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
{
"best_access_path": {
"table": "t_inner_2",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
"uses_join_buffering": false
}
}
@@ -4967,30 +5412,38 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t1",
"rows_for_plan": 3,
- "cost_for_plan": 2.605126953,
+ "cost_for_plan": 0.010504815,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": ["t1"],
+ "plan_prefix": "t1",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_1",
+ "plan_details": {
+ "record_count": 3
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.011523207,
+ "cost_without_join_buffer": 0.031514445,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.011523207,
"uses_join_buffering": true
}
}
@@ -4998,18 +5451,26 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
{
"best_access_path": {
"table": "t_inner_2",
+ "plan_details": {
+ "record_count": 3
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.011523207,
+ "cost_without_join_buffer": 0.031514445,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.011523207,
"uses_join_buffering": true
}
}
@@ -5017,30 +5478,38 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
]
},
{
- "plan_prefix": ["t1"],
+ "plan_prefix": "t1",
"table": "t_inner_1",
"rows_for_plan": 9,
- "cost_for_plan": 6.410253906,
+ "cost_for_plan": 0.022028022,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": ["t1", "t_inner_1"],
+ "plan_prefix": "t1,t_inner_1",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_2",
+ "plan_details": {
+ "record_count": 9
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.015203373,
+ "cost_without_join_buffer": 0.094543335,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.015203373,
"uses_join_buffering": true
}
}
@@ -5048,56 +5517,65 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
]
},
{
- "plan_prefix": ["t1", "t_inner_1"],
+ "plan_prefix": "t1,t_inner_1",
"table": "t_inner_2",
"rows_for_plan": 27,
- "cost_for_plan": 13.81538086,
+ "cost_for_plan": 0.037231395,
"semijoin_strategy_choice": [
{
"strategy": "FirstMatch",
- "records": 3,
- "read_time": 33.86665039
+ "rows": 3,
+ "cost": 0.136562595
},
{
"strategy": "SJ-Materialization",
- "records": 3,
- "read_time": 7.215380859
+ "rows": 3,
+ "cost": 0.059588485
},
{
"strategy": "DuplicateWeedout",
- "records": 3,
- "read_time": 18.31538086
+ "prefix_row_count": 3,
+ "tmp_table_rows": 1,
+ "sj_inner_fanout": 9,
+ "rows": 3,
+ "dups_cost": 0.037231395,
+ "write_cost": 0.02548291,
+ "full_lookup_cost": 0.00434619,
+ "total_cost": 0.067060495
},
{
"chosen_strategy": "SJ-Materialization"
}
- ]
+ ],
+ "sj_rows_out": 0.333333333,
+ "sj_rows_for_plan": 3,
+ "sj_filtered": 11.11111111
}
]
},
{
- "plan_prefix": ["t1"],
+ "plan_prefix": "t1",
"table": "t_inner_2",
"rows_for_plan": 9,
- "cost_for_plan": 6.410253906,
+ "cost_for_plan": 0.022028022,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
}
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t_inner_1",
"rows_for_plan": 3,
- "cost_for_plan": 2.605126953,
+ "cost_for_plan": 0.010504815,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t_inner_2",
"rows_for_plan": 3,
- "cost_for_plan": 2.605126953,
+ "cost_for_plan": 0.010504815,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
}
@@ -5119,7 +5597,9 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
]
},
{
- "best_join_order": ["t1", "<subquery2>"]
+ "best_join_order": ["t1", "<subquery2>"],
+ "rows": 3,
+ "cost": 0.059588485
},
{
"substitute_best_equal": {
@@ -5128,31 +5608,35 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_
}
},
{
- "condition_on_constant_tables": "1",
- "computing_condition": []
- },
- {
"attaching_conditions_to_tables": {
- "attached_conditions_computation": [],
+ "attached_conditions_computation": [
+ {
+ "condition_on_constant_tables": "1",
+ "computing_condition": []
+ }
+ ],
"attached_conditions_summary": [
{
"table": "t1",
- "attached": null
+ "attached_condition": null
},
{
"table": "t_inner_1",
- "attached": null
+ "attached_condition": null
},
{
"table": "t_inner_2",
- "attached": null
+ "attached_condition": null
},
{
"table": "<subquery2>",
- "attached": null
+ "attached_condition": null
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -5334,42 +5818,48 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"table": "t_outer_1",
"table_scan": {
"rows": 3,
- "cost": 2.005126953
+ "read_cost": 0.010408815,
+ "read_and_compare_cost": 0.010504815
}
},
{
"table": "t_outer_2",
"table_scan": {
"rows": 9,
- "cost": 2.015380859
+ "read_cost": 0.011155245,
+ "read_and_compare_cost": 0.011443245
}
},
{
"table": "t_inner_2",
"table_scan": {
"rows": 9,
- "cost": 2.015380859
+ "read_cost": 0.011155245,
+ "read_and_compare_cost": 0.011443245
}
},
{
"table": "t_inner_1",
"table_scan": {
"rows": 3,
- "cost": 2.005126953
+ "read_cost": 0.010408815,
+ "read_and_compare_cost": 0.010504815
}
},
{
"table": "t_inner_3",
"table_scan": {
"rows": 9,
- "cost": 2.015380859
+ "read_cost": 0.011155245,
+ "read_and_compare_cost": 0.011443245
}
},
{
"table": "t_inner_4",
"table_scan": {
"rows": 3,
- "cost": 2.005126953
+ "read_cost": 0.010408815,
+ "read_and_compare_cost": 0.010504815
}
}
]
@@ -5392,23 +5882,30 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_outer_1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
"uses_join_buffering": false
}
}
@@ -5416,18 +5913,25 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
"uses_join_buffering": false
}
}
@@ -5435,18 +5939,25 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_2",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.011443245,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.011443245,
"uses_join_buffering": false
}
}
@@ -5454,18 +5965,25 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_outer_2",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.011443245,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.011443245,
"uses_join_buffering": false
}
}
@@ -5473,18 +5991,25 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_4",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
"uses_join_buffering": false
}
}
@@ -5492,18 +6017,25 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.011443245,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.011443245,
"uses_join_buffering": false
}
}
@@ -5511,30 +6043,38 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t_outer_1",
"rows_for_plan": 3,
- "cost_for_plan": 2.605126953,
+ "cost_for_plan": 0.010504815,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": ["t_outer_1"],
+ "plan_prefix": "t_outer_1",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_1",
+ "plan_details": {
+ "record_count": 3
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.011523207,
+ "cost_without_join_buffer": 0.031514445,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.011523207,
"uses_join_buffering": true
}
}
@@ -5542,18 +6082,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_2",
+ "plan_details": {
+ "record_count": 3
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.014133225,
+ "cost_without_join_buffer": 0.034329735,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.014133225,
"uses_join_buffering": true
}
}
@@ -5561,18 +6109,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_outer_2",
+ "plan_details": {
+ "record_count": 3
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.014133225,
+ "cost_without_join_buffer": 0.034329735,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.014133225,
"uses_join_buffering": true
}
}
@@ -5580,18 +6136,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_4",
+ "plan_details": {
+ "record_count": 3
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.011523207,
+ "cost_without_join_buffer": 0.031514445,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.011523207,
"uses_join_buffering": true
}
}
@@ -5599,18 +6163,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 3
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.014133225,
+ "cost_without_join_buffer": 0.034329735,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.014133225,
"uses_join_buffering": true
}
}
@@ -5618,30 +6190,38 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": ["t_outer_1"],
+ "plan_prefix": "t_outer_1",
"table": "t_outer_2",
"rows_for_plan": 27,
- "cost_for_plan": 10.02050781,
+ "cost_for_plan": 0.02463804,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": ["t_outer_1", "t_outer_2"],
+ "plan_prefix": "t_outer_1,t_outer_2",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_2",
+ "plan_details": {
+ "record_count": 27
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.050443503,
+ "cost_without_join_buffer": 0.308967615,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.050443503,
"uses_join_buffering": true
}
}
@@ -5649,18 +6229,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_1",
+ "plan_details": {
+ "record_count": 27
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.024600489,
+ "cost_without_join_buffer": 0.283630005,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.024600489,
"uses_join_buffering": true
}
}
@@ -5668,18 +6256,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_4",
+ "plan_details": {
+ "record_count": 27
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.024600489,
+ "cost_without_join_buffer": 0.283630005,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.024600489,
"uses_join_buffering": true
}
}
@@ -5687,18 +6283,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 27
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.050443503,
+ "cost_without_join_buffer": 0.308967615,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.050443503,
"uses_join_buffering": true
}
}
@@ -5706,30 +6310,38 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": ["t_outer_1", "t_outer_2"],
+ "plan_prefix": "t_outer_1,t_outer_2",
"table": "t_inner_1",
"rows_for_plan": 81,
- "cost_for_plan": 28.22563477,
+ "cost_for_plan": 0.049238529,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": ["t_outer_1", "t_outer_2", "t_inner_1"],
+ "plan_prefix": "t_outer_1,t_outer_2,t_inner_1",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_2",
+ "plan_details": {
+ "record_count": 81
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.172815333,
+ "cost_without_join_buffer": 0.926902845,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.172815333,
"uses_join_buffering": true
}
}
@@ -5737,18 +6349,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_4",
+ "plan_details": {
+ "record_count": 81
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.067582275,
+ "cost_without_join_buffer": 0.850890015,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.067582275,
"uses_join_buffering": true
}
}
@@ -5756,18 +6376,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 81
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.172815333,
+ "cost_without_join_buffer": 0.926902845,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.172815333,
"uses_join_buffering": true
}
}
@@ -5775,49 +6403,61 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": ["t_outer_1", "t_outer_2", "t_inner_1"],
+ "plan_prefix": "t_outer_1,t_outer_2,t_inner_1",
"table": "t_inner_2",
"rows_for_plan": 729,
- "cost_for_plan": 176.0410156,
+ "cost_for_plan": 0.222053862,
"semijoin_strategy_choice": [
{
"strategy": "FirstMatch",
- "records": 27,
- "read_time": 389.4047852
+ "rows": 27,
+ "cost": 1.23517089
},
{
"strategy": "DuplicateWeedout",
- "records": 27,
- "read_time": 289.4410156
+ "prefix_row_count": 27,
+ "tmp_table_rows": 1,
+ "sj_inner_fanout": 27,
+ "rows": 27,
+ "dups_cost": 0.222053862,
+ "write_cost": 0.02934619,
+ "full_lookup_cost": 0.11734713,
+ "total_cost": 0.368747182
},
{
"chosen_strategy": "DuplicateWeedout"
}
],
+ "sj_rows_out": 0.333333333,
+ "sj_rows_for_plan": 27,
+ "sj_filtered": 3.703703704,
"rest_of_plan": [
{
- "plan_prefix": [
- "t_outer_1",
- "t_outer_2",
- "t_inner_1",
- "t_inner_2"
- ],
+ "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_2",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_4",
+ "plan_details": {
+ "record_count": 27
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.034460781,
+ "cost_without_join_buffer": 0.283630005,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.034460781,
"uses_join_buffering": true
}
}
@@ -5825,18 +6465,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 27
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.080024379,
+ "cost_without_join_buffer": 0.308967615,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.080024379,
"uses_join_buffering": true
}
}
@@ -5844,41 +6492,38 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_outer_2",
- "t_inner_1",
- "t_inner_2"
- ],
+ "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_2",
"table": "t_inner_4",
"rows_for_plan": 81,
- "cost_for_plan": 307.6461426,
+ "cost_for_plan": 0.403207963,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": [
- "t_outer_1",
- "t_outer_2",
- "t_inner_1",
- "t_inner_2",
- "t_inner_4"
- ],
+ "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_2,t_inner_4",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 81
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.261557961,
+ "cost_without_join_buffer": 0.926902845,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.261557961,
"uses_join_buffering": true
}
}
@@ -5886,79 +6531,80 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_outer_2",
- "t_inner_1",
- "t_inner_2",
- "t_inner_4"
- ],
+ "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_2,t_inner_4",
"table": "t_inner_3",
"rows_for_plan": 729,
- "cost_for_plan": 455.4615234,
+ "cost_for_plan": 0.664765924,
"semijoin_strategy_choice": [
{
"strategy": "FirstMatch",
- "records": 27,
- "read_time": 668.825293
+ "rows": 27,
+ "cost": 1.579280032
},
{
"strategy": "DuplicateWeedout",
- "records": 27,
- "read_time": 568.8615234
+ "prefix_row_count": 27,
+ "tmp_table_rows": 1,
+ "sj_inner_fanout": 27,
+ "rows": 27,
+ "dups_cost": 0.664765924,
+ "write_cost": 0.02934619,
+ "full_lookup_cost": 0.11734713,
+ "total_cost": 0.811459244
},
{
"chosen_strategy": "DuplicateWeedout"
}
- ]
+ ],
+ "sj_rows_out": 0.333333333,
+ "sj_rows_for_plan": 27,
+ "sj_filtered": 3.703703704
}
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_outer_2",
- "t_inner_1",
- "t_inner_2"
- ],
+ "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_2",
"table": "t_inner_3",
"rows_for_plan": 243,
- "cost_for_plan": 340.0563965,
+ "cost_for_plan": 0.448771561,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
}
]
},
{
- "plan_prefix": ["t_outer_1", "t_outer_2", "t_inner_1"],
+ "plan_prefix": "t_outer_1,t_outer_2,t_inner_1",
"table": "t_inner_4",
"rows_for_plan": 243,
- "cost_for_plan": 78.83076172,
+ "cost_for_plan": 0.116820804,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": [
- "t_outer_1",
- "t_outer_2",
- "t_inner_1",
- "t_inner_4"
- ],
+ "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_4",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_2",
+ "plan_details": {
+ "record_count": 243
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.628673451,
+ "cost_without_join_buffer": 2.780708535,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.628673451,
"uses_join_buffering": true
}
}
@@ -5966,18 +6612,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 243
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.628673451,
+ "cost_without_join_buffer": 2.780708535,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.628673451,
"uses_join_buffering": true
}
}
@@ -5985,41 +6639,38 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_outer_2",
- "t_inner_1",
- "t_inner_4"
- ],
+ "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_4",
"table": "t_inner_2",
"rows_for_plan": 2187,
- "cost_for_plan": 518.2461426,
+ "cost_for_plan": 0.745494255,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": [
- "t_outer_1",
- "t_outer_2",
- "t_inner_1",
- "t_inner_4",
- "t_inner_2"
- ],
+ "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_4,t_inner_2",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 2187
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 6.764540577,
+ "cost_without_join_buffer": 25.02637682,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 6.764540577,
"uses_join_buffering": true
}
}
@@ -6027,113 +6678,119 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_outer_2",
- "t_inner_1",
- "t_inner_4",
- "t_inner_2"
- ],
+ "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_4,t_inner_2",
"table": "t_inner_3",
"rows_for_plan": 19683,
- "cost_for_plan": 4456.861523,
+ "cost_for_plan": 7.510034832,
"semijoin_strategy_choice": [
{
"strategy": "FirstMatch",
- "records": 27,
- "read_time": 9562.749707
+ "rows": 27,
+ "cost": 28.96624341
},
{
"strategy": "DuplicateWeedout",
- "records": 27,
- "read_time": 7413.361523
+ "prefix_row_count": 27,
+ "tmp_table_rows": 1,
+ "sj_inner_fanout": 729,
+ "rows": 27,
+ "dups_cost": 7.510034832,
+ "write_cost": 0.02934619,
+ "full_lookup_cost": 3.16837251,
+ "total_cost": 10.70775353
},
{
"chosen_strategy": "FirstMatch"
}
],
+ "sj_rows_out": 0.012345679,
+ "sj_rows_for_plan": 27,
+ "sj_filtered": 0.137174211,
"pruned_by_cost": true,
- "current_cost": 9562.749707,
- "best_cost": 568.8615234
+ "current_cost": 28.96624341,
+ "best_cost": 0.811459244
}
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_outer_2",
- "t_inner_1",
- "t_inner_4"
- ],
+ "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_4",
"table": "t_inner_3",
"rows_for_plan": 2187,
- "cost_for_plan": 518.2461426,
+ "cost_for_plan": 0.745494255,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
}
]
},
{
- "plan_prefix": ["t_outer_1", "t_outer_2", "t_inner_1"],
+ "plan_prefix": "t_outer_1,t_outer_2,t_inner_1",
"table": "t_inner_3",
"rows_for_plan": 729,
- "cost_for_plan": 176.0410156,
+ "cost_for_plan": 0.222053862,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": "min_read_time"
}
]
},
{
- "plan_prefix": ["t_outer_1", "t_outer_2"],
+ "plan_prefix": "t_outer_1,t_outer_2",
"table": "t_inner_2",
"rows_for_plan": 243,
- "cost_for_plan": 60.63588867,
+ "cost_for_plan": 0.075081543,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
},
{
- "plan_prefix": ["t_outer_1", "t_outer_2"],
+ "plan_prefix": "t_outer_1,t_outer_2",
"table": "t_inner_4",
"rows_for_plan": 81,
- "cost_for_plan": 28.22563477,
+ "cost_for_plan": 0.049238529,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
},
{
- "plan_prefix": ["t_outer_1", "t_outer_2"],
+ "plan_prefix": "t_outer_1,t_outer_2",
"table": "t_inner_3",
"rows_for_plan": 243,
- "cost_for_plan": 60.63588867,
+ "cost_for_plan": 0.075081543,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
}
]
},
{
- "plan_prefix": ["t_outer_1"],
+ "plan_prefix": "t_outer_1",
"table": "t_inner_1",
"rows_for_plan": 9,
- "cost_for_plan": 6.410253906,
+ "cost_for_plan": 0.022028022,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": ["t_outer_1", "t_inner_1"],
+ "plan_prefix": "t_outer_1,t_inner_1",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_2",
+ "plan_details": {
+ "record_count": 9
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.024443331,
+ "cost_without_join_buffer": 0.102989205,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.024443331,
"uses_join_buffering": true
}
}
@@ -6141,18 +6798,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_outer_2",
+ "plan_details": {
+ "record_count": 9
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.024443331,
+ "cost_without_join_buffer": 0.102989205,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.024443331,
"uses_join_buffering": true
}
}
@@ -6160,18 +6825,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_4",
+ "plan_details": {
+ "record_count": 9
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.015203373,
+ "cost_without_join_buffer": 0.094543335,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.015203373,
"uses_join_buffering": true
}
}
@@ -6179,18 +6852,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 9
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.024443331,
+ "cost_without_join_buffer": 0.102989205,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.024443331,
"uses_join_buffering": true
}
}
@@ -6198,30 +6879,38 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": ["t_outer_1", "t_inner_1"],
+ "plan_prefix": "t_outer_1,t_inner_1",
"table": "t_outer_2",
"rows_for_plan": 81,
- "cost_for_plan": 24.62563477,
+ "cost_for_plan": 0.046471353,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": ["t_outer_1", "t_inner_1", "t_outer_2"],
+ "plan_prefix": "t_outer_1,t_inner_1,t_outer_2",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_2",
+ "plan_details": {
+ "record_count": 81
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.172815333,
+ "cost_without_join_buffer": 0.926902845,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.172815333,
"uses_join_buffering": true
}
}
@@ -6229,18 +6918,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_4",
+ "plan_details": {
+ "record_count": 81
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.067582275,
+ "cost_without_join_buffer": 0.850890015,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.067582275,
"uses_join_buffering": true
}
}
@@ -6248,18 +6945,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 81
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.172815333,
+ "cost_without_join_buffer": 0.926902845,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.172815333,
"uses_join_buffering": true
}
}
@@ -6267,44 +6972,56 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": ["t_outer_1", "t_inner_1", "t_outer_2"],
+ "plan_prefix": "t_outer_1,t_inner_1,t_outer_2",
"table": "t_inner_2",
"rows_for_plan": 729,
- "cost_for_plan": 172.4410156,
+ "cost_for_plan": 0.219286686,
"semijoin_strategy_choice": [
{
"strategy": "DuplicateWeedout",
- "records": 27,
- "read_time": 285.8410156
+ "prefix_row_count": 3,
+ "tmp_table_rows": 9,
+ "sj_inner_fanout": 27,
+ "rows": 27,
+ "dups_cost": 0.219286686,
+ "write_cost": 0.02934619,
+ "full_lookup_cost": 0.11734713,
+ "total_cost": 0.365980006
},
{
"chosen_strategy": "DuplicateWeedout"
}
],
+ "sj_rows_out": 0.333333333,
+ "sj_rows_for_plan": 27,
+ "sj_filtered": 3.703703704,
"rest_of_plan": [
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_outer_2",
- "t_inner_2"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_2",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_4",
+ "plan_details": {
+ "record_count": 27
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.034460781,
+ "cost_without_join_buffer": 0.283630005,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.034460781,
"uses_join_buffering": true
}
}
@@ -6312,18 +7029,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 27
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.080024379,
+ "cost_without_join_buffer": 0.308967615,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.080024379,
"uses_join_buffering": true
}
}
@@ -6331,41 +7056,38 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_outer_2",
- "t_inner_2"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_2",
"table": "t_inner_4",
"rows_for_plan": 81,
- "cost_for_plan": 304.0461426,
+ "cost_for_plan": 0.400440787,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_outer_2",
- "t_inner_2",
- "t_inner_4"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_2,t_inner_4",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 81
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.261557961,
+ "cost_without_join_buffer": 0.926902845,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.261557961,
"uses_join_buffering": true
}
}
@@ -6373,79 +7095,80 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_outer_2",
- "t_inner_2",
- "t_inner_4"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_2,t_inner_4",
"table": "t_inner_3",
"rows_for_plan": 729,
- "cost_for_plan": 451.8615234,
+ "cost_for_plan": 0.661998748,
"semijoin_strategy_choice": [
{
"strategy": "FirstMatch",
- "records": 27,
- "read_time": 665.225293
+ "rows": 27,
+ "cost": 1.576512856
},
{
"strategy": "DuplicateWeedout",
- "records": 27,
- "read_time": 565.2615234
+ "prefix_row_count": 27,
+ "tmp_table_rows": 1,
+ "sj_inner_fanout": 27,
+ "rows": 27,
+ "dups_cost": 0.661998748,
+ "write_cost": 0.02934619,
+ "full_lookup_cost": 0.11734713,
+ "total_cost": 0.808692068
},
{
"chosen_strategy": "DuplicateWeedout"
}
- ]
+ ],
+ "sj_rows_out": 0.333333333,
+ "sj_rows_for_plan": 27,
+ "sj_filtered": 3.703703704
}
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_outer_2",
- "t_inner_2"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_2",
"table": "t_inner_3",
"rows_for_plan": 243,
- "cost_for_plan": 336.4563965,
+ "cost_for_plan": 0.446004385,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
}
]
},
{
- "plan_prefix": ["t_outer_1", "t_inner_1", "t_outer_2"],
+ "plan_prefix": "t_outer_1,t_inner_1,t_outer_2",
"table": "t_inner_4",
"rows_for_plan": 243,
- "cost_for_plan": 75.23076172,
+ "cost_for_plan": 0.114053628,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_outer_2",
- "t_inner_4"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_4",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_2",
+ "plan_details": {
+ "record_count": 243
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.628673451,
+ "cost_without_join_buffer": 2.780708535,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.628673451,
"uses_join_buffering": true
}
}
@@ -6453,18 +7176,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 243
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.628673451,
+ "cost_without_join_buffer": 2.780708535,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.628673451,
"uses_join_buffering": true
}
}
@@ -6472,41 +7203,38 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_outer_2",
- "t_inner_4"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_4",
"table": "t_inner_2",
"rows_for_plan": 2187,
- "cost_for_plan": 514.6461426,
+ "cost_for_plan": 0.742727079,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_outer_2",
- "t_inner_4",
- "t_inner_2"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_4,t_inner_2",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 2187
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 6.764540577,
+ "cost_without_join_buffer": 25.02637682,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 6.764540577,
"uses_join_buffering": true
}
}
@@ -6514,96 +7242,111 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_outer_2",
- "t_inner_4",
- "t_inner_2"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_4,t_inner_2",
"table": "t_inner_3",
"rows_for_plan": 19683,
- "cost_for_plan": 4453.261523,
+ "cost_for_plan": 7.507267656,
"semijoin_strategy_choice": [
{
"strategy": "DuplicateWeedout",
- "records": 27,
- "read_time": 7409.761523
+ "prefix_row_count": 3,
+ "tmp_table_rows": 9,
+ "sj_inner_fanout": 729,
+ "rows": 27,
+ "dups_cost": 7.507267656,
+ "write_cost": 0.02934619,
+ "full_lookup_cost": 3.16837251,
+ "total_cost": 10.70498636
},
{
"chosen_strategy": "DuplicateWeedout"
}
],
+ "sj_rows_out": 0.012345679,
+ "sj_rows_for_plan": 27,
+ "sj_filtered": 0.137174211,
"pruned_by_cost": true,
- "current_cost": 7409.761523,
- "best_cost": 565.2615234
+ "current_cost": 10.70498636,
+ "best_cost": 0.808692068
}
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_outer_2",
- "t_inner_4"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_4",
"table": "t_inner_3",
"rows_for_plan": 2187,
- "cost_for_plan": 514.6461426,
+ "cost_for_plan": 0.742727079,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
}
]
},
{
- "plan_prefix": ["t_outer_1", "t_inner_1", "t_outer_2"],
+ "plan_prefix": "t_outer_1,t_inner_1,t_outer_2",
"table": "t_inner_3",
"rows_for_plan": 729,
- "cost_for_plan": 172.4410156,
+ "cost_for_plan": 0.219286686,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": "min_read_time"
}
]
},
{
- "plan_prefix": ["t_outer_1", "t_inner_1"],
+ "plan_prefix": "t_outer_1,t_inner_1",
"table": "t_inner_2",
"rows_for_plan": 81,
- "cost_for_plan": 24.62563477,
+ "cost_for_plan": 0.046471353,
"semijoin_strategy_choice": [
{
"strategy": "FirstMatch",
- "records": 3,
- "read_time": 44.75893555
+ "rows": 3,
+ "cost": 0.145008465
},
{
"strategy": "DuplicateWeedout",
- "records": 3,
- "read_time": 37.22563477
+ "prefix_row_count": 3,
+ "tmp_table_rows": 1,
+ "sj_inner_fanout": 27,
+ "rows": 3,
+ "dups_cost": 0.046471353,
+ "write_cost": 0.02548291,
+ "full_lookup_cost": 0.01303857,
+ "total_cost": 0.084992833
},
{
"chosen_strategy": "DuplicateWeedout"
}
],
+ "sj_rows_out": 0.333333333,
+ "sj_rows_for_plan": 3,
+ "sj_filtered": 3.703703704,
"rest_of_plan": [
{
- "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_2"],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_outer_2",
+ "plan_details": {
+ "record_count": 3
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.017419989,
+ "cost_without_join_buffer": 0.034329735,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.017419989,
"uses_join_buffering": true
}
}
@@ -6611,18 +7354,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_4",
+ "plan_details": {
+ "record_count": 3
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.012618795,
+ "cost_without_join_buffer": 0.031514445,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.012618795,
"uses_join_buffering": true
}
}
@@ -6630,18 +7381,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 3
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.017419989,
+ "cost_without_join_buffer": 0.034329735,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.017419989,
"uses_join_buffering": true
}
}
@@ -6649,35 +7408,38 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_2"],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2",
"table": "t_outer_2",
"rows_for_plan": 27,
- "cost_for_plan": 44.64101563,
+ "cost_for_plan": 0.102412822,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_inner_2",
- "t_outer_2"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_outer_2",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_4",
+ "plan_details": {
+ "record_count": 27
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.034460781,
+ "cost_without_join_buffer": 0.283630005,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.034460781,
"uses_join_buffering": true
}
}
@@ -6685,18 +7447,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 27
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.080024379,
+ "cost_without_join_buffer": 0.308967615,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.080024379,
"uses_join_buffering": true
}
}
@@ -6704,41 +7474,38 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_inner_2",
- "t_outer_2"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_outer_2",
"table": "t_inner_4",
"rows_for_plan": 81,
- "cost_for_plan": 62.84614258,
+ "cost_for_plan": 0.136873603,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_inner_2",
- "t_outer_2",
- "t_inner_4"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_outer_2,t_inner_4",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 81
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.261557961,
+ "cost_without_join_buffer": 0.926902845,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.261557961,
"uses_join_buffering": true
}
}
@@ -6746,79 +7513,80 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_inner_2",
- "t_outer_2",
- "t_inner_4"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_outer_2,t_inner_4",
"table": "t_inner_3",
"rows_for_plan": 729,
- "cost_for_plan": 210.6615234,
+ "cost_for_plan": 0.398431564,
"semijoin_strategy_choice": [
{
"strategy": "FirstMatch",
- "records": 27,
- "read_time": 424.025293
+ "rows": 27,
+ "cost": 1.312945672
},
{
"strategy": "DuplicateWeedout",
- "records": 27,
- "read_time": 324.0615234
+ "prefix_row_count": 27,
+ "tmp_table_rows": 1,
+ "sj_inner_fanout": 27,
+ "rows": 27,
+ "dups_cost": 0.398431564,
+ "write_cost": 0.02934619,
+ "full_lookup_cost": 0.11734713,
+ "total_cost": 0.545124884
},
{
"chosen_strategy": "DuplicateWeedout"
}
- ]
+ ],
+ "sj_rows_out": 0.333333333,
+ "sj_rows_for_plan": 27,
+ "sj_filtered": 3.703703704
}
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_inner_2",
- "t_outer_2"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_outer_2",
"table": "t_inner_3",
"rows_for_plan": 243,
- "cost_for_plan": 95.25639648,
+ "cost_for_plan": 0.182437201,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
}
]
},
{
- "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_2"],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2",
"table": "t_inner_4",
"rows_for_plan": 9,
- "cost_for_plan": 41.03076172,
+ "cost_for_plan": 0.097611628,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_inner_2",
- "t_inner_4"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_inner_4",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_outer_2",
+ "plan_details": {
+ "record_count": 9
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.034303623,
+ "cost_without_join_buffer": 0.102989205,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.034303623,
"uses_join_buffering": true
}
}
@@ -6826,18 +7594,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 9
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.034303623,
+ "cost_without_join_buffer": 0.102989205,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.034303623,
"uses_join_buffering": true
}
}
@@ -6845,41 +7621,38 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_inner_2",
- "t_inner_4"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_inner_4",
"table": "t_outer_2",
"rows_for_plan": 81,
- "cost_for_plan": 59.24614258,
+ "cost_for_plan": 0.131915251,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_inner_2",
- "t_inner_4",
- "t_outer_2"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_inner_4,t_outer_2",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 81
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.261557961,
+ "cost_without_join_buffer": 0.926902845,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.261557961,
"uses_join_buffering": true
}
}
@@ -6887,79 +7660,85 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_inner_2",
- "t_inner_4",
- "t_outer_2"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_inner_4,t_outer_2",
"table": "t_inner_3",
"rows_for_plan": 729,
- "cost_for_plan": 207.0615234,
+ "cost_for_plan": 0.393473212,
"semijoin_strategy_choice": [
{
"strategy": "DuplicateWeedout",
- "records": 27,
- "read_time": 320.4615234
+ "prefix_row_count": 3,
+ "tmp_table_rows": 9,
+ "sj_inner_fanout": 27,
+ "rows": 27,
+ "dups_cost": 0.393473212,
+ "write_cost": 0.02934619,
+ "full_lookup_cost": 0.11734713,
+ "total_cost": 0.540166532
},
{
"chosen_strategy": "DuplicateWeedout"
}
- ]
+ ],
+ "sj_rows_out": 0.333333333,
+ "sj_rows_for_plan": 27,
+ "sj_filtered": 3.703703704
}
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_inner_2",
- "t_inner_4"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_inner_4",
"table": "t_inner_3",
"rows_for_plan": 81,
- "cost_for_plan": 59.24614258,
+ "cost_for_plan": 0.131915251,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
}
]
},
{
- "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_2"],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2",
"table": "t_inner_3",
"rows_for_plan": 27,
- "cost_for_plan": 44.64101563,
+ "cost_for_plan": 0.102412822,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
}
]
},
{
- "plan_prefix": ["t_outer_1", "t_inner_1"],
+ "plan_prefix": "t_outer_1,t_inner_1",
"table": "t_inner_4",
"rows_for_plan": 27,
- "cost_for_plan": 13.81538086,
+ "cost_for_plan": 0.037231395,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_4"],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_4",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_outer_2",
+ "plan_details": {
+ "record_count": 27
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.065233941,
+ "cost_without_join_buffer": 0.308967615,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.065233941,
"uses_join_buffering": true
}
}
@@ -6967,18 +7746,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_2",
+ "plan_details": {
+ "record_count": 27
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.065233941,
+ "cost_without_join_buffer": 0.308967615,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.065233941,
"uses_join_buffering": true
}
}
@@ -6986,18 +7773,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 27
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.065233941,
+ "cost_without_join_buffer": 0.308967615,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.065233941,
"uses_join_buffering": true
}
}
@@ -7005,35 +7800,38 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_4"],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_4",
"table": "t_outer_2",
"rows_for_plan": 243,
- "cost_for_plan": 64.43076172,
+ "cost_for_plan": 0.102465336,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_inner_4",
- "t_outer_2"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_4,t_outer_2",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_2",
+ "plan_details": {
+ "record_count": 243
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.628673451,
+ "cost_without_join_buffer": 2.780708535,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.628673451,
"uses_join_buffering": true
}
}
@@ -7041,18 +7839,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 243
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.628673451,
+ "cost_without_join_buffer": 2.780708535,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.628673451,
"uses_join_buffering": true
}
}
@@ -7060,128 +7866,118 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_inner_4",
- "t_outer_2"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_4,t_outer_2",
"table": "t_inner_2",
"rows_for_plan": 2187,
- "cost_for_plan": 503.8461426,
+ "cost_for_plan": 0.731138787,
"semijoin_strategy_choice": [],
"pruned_by_cost": true,
- "current_cost": 503.8461426,
- "best_cost": 320.4615234
+ "current_cost": 0.731138787,
+ "best_cost": 0.540166532
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_inner_4",
- "t_outer_2"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_4,t_outer_2",
"table": "t_inner_3",
"rows_for_plan": 2187,
- "cost_for_plan": 503.8461426,
+ "cost_for_plan": 0.731138787,
"semijoin_strategy_choice": [],
"pruned_by_cost": true,
- "current_cost": 503.8461426,
- "best_cost": 320.4615234
+ "current_cost": 0.731138787,
+ "best_cost": 0.540166532
}
]
},
{
- "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_4"],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_4",
"table": "t_inner_2",
"rows_for_plan": 243,
- "cost_for_plan": 64.43076172,
+ "cost_for_plan": 0.102465336,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
},
{
- "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_4"],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_4",
"table": "t_inner_3",
"rows_for_plan": 243,
- "cost_for_plan": 64.43076172,
+ "cost_for_plan": 0.102465336,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
}
]
},
{
- "plan_prefix": ["t_outer_1", "t_inner_1"],
+ "plan_prefix": "t_outer_1,t_inner_1",
"table": "t_inner_3",
"rows_for_plan": 81,
- "cost_for_plan": 24.62563477,
+ "cost_for_plan": 0.046471353,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
}
]
},
{
- "plan_prefix": ["t_outer_1"],
+ "plan_prefix": "t_outer_1",
"table": "t_inner_2",
"rows_for_plan": 27,
- "cost_for_plan": 10.02050781,
+ "cost_for_plan": 0.02463804,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
},
{
- "plan_prefix": ["t_outer_1"],
+ "plan_prefix": "t_outer_1",
"table": "t_inner_4",
"rows_for_plan": 9,
- "cost_for_plan": 6.410253906,
+ "cost_for_plan": 0.022028022,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
},
{
- "plan_prefix": ["t_outer_1"],
+ "plan_prefix": "t_outer_1",
"table": "t_inner_3",
"rows_for_plan": 27,
- "cost_for_plan": 10.02050781,
+ "cost_for_plan": 0.02463804,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
}
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t_outer_2",
"rows_for_plan": 9,
- "cost_for_plan": 3.815380859,
+ "cost_for_plan": 0.011443245,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t_inner_1",
"rows_for_plan": 3,
- "cost_for_plan": 2.605126953,
+ "cost_for_plan": 0.010504815,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t_inner_2",
"rows_for_plan": 9,
- "cost_for_plan": 3.815380859,
+ "cost_for_plan": 0.011443245,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t_inner_4",
"rows_for_plan": 3,
- "cost_for_plan": 2.605126953,
+ "cost_for_plan": 0.010504815,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t_inner_3",
"rows_for_plan": 9,
- "cost_for_plan": 3.815380859,
+ "cost_for_plan": 0.011443245,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
}
@@ -7205,7 +8001,9 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"t_inner_4",
"t_outer_2",
"t_inner_3"
- ]
+ ],
+ "rows": 27,
+ "cost": 0.540166532
},
{
"substitute_best_equal": {
@@ -7219,30 +8017,33 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"attached_conditions_summary": [
{
"table": "t_outer_1",
- "attached": null
+ "attached_condition": null
},
{
"table": "t_inner_1",
- "attached": "t_inner_1.a = t_outer_1.a"
+ "attached_condition": "t_inner_1.a = t_outer_1.a"
},
{
"table": "t_inner_2",
- "attached": null
+ "attached_condition": null
},
{
"table": "t_inner_4",
- "attached": null
+ "attached_condition": null
},
{
"table": "t_outer_2",
- "attached": null
+ "attached_condition": null
},
{
"table": "t_inner_3",
- "attached": "t_inner_3.a = t_outer_2.a"
+ "attached_condition": "t_inner_3.a = t_outer_2.a"
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -7260,8 +8061,8 @@ explain select * from t1 t_outer_1,t2 t_outer_2 where t_outer_1.a in (select t_
t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t_outer_1 ALL NULL NULL NULL NULL 3
-1 PRIMARY t_outer_2 ALL NULL NULL NULL NULL 9 Using join buffer (flat, BNL join)
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+1 PRIMARY t_outer_2 ALL NULL NULL NULL NULL 9 Using join buffer (flat, BNL join)
1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1
2 MATERIALIZED t_inner_1 ALL NULL NULL NULL NULL 3
2 MATERIALIZED t_inner_2 ALL NULL NULL NULL NULL 9 Using join buffer (flat, BNL join)
@@ -7425,42 +8226,48 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
"table": "t_outer_1",
"table_scan": {
"rows": 3,
- "cost": 2.005126953
+ "read_cost": 0.010408815,
+ "read_and_compare_cost": 0.010504815
}
},
{
"table": "t_outer_2",
"table_scan": {
"rows": 9,
- "cost": 2.015380859
+ "read_cost": 0.011155245,
+ "read_and_compare_cost": 0.011443245
}
},
{
"table": "t_inner_2",
"table_scan": {
"rows": 9,
- "cost": 2.015380859
+ "read_cost": 0.011155245,
+ "read_and_compare_cost": 0.011443245
}
},
{
"table": "t_inner_1",
"table_scan": {
"rows": 3,
- "cost": 2.005126953
+ "read_cost": 0.010408815,
+ "read_and_compare_cost": 0.010504815
}
},
{
"table": "t_inner_3",
"table_scan": {
"rows": 9,
- "cost": 2.015380859
+ "read_cost": 0.011155245,
+ "read_and_compare_cost": 0.011443245
}
},
{
"table": "t_inner_4",
"table_scan": {
"rows": 3,
- "cost": 2.005126953
+ "read_cost": 0.010408815,
+ "read_and_compare_cost": 0.010504815
}
}
]
@@ -7481,23 +8288,30 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
"uses_join_buffering": false
}
}
@@ -7505,18 +8319,25 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_2",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.011443245,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.011443245,
"uses_join_buffering": false
}
}
@@ -7524,29 +8345,37 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t_inner_1",
"rows_for_plan": 3,
- "cost_for_plan": 2.605126953,
+ "cost_for_plan": 0.010504815,
"rest_of_plan": [
{
- "plan_prefix": ["t_inner_1"],
+ "plan_prefix": "t_inner_1",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_2",
+ "plan_details": {
+ "record_count": 3
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.014133225,
+ "cost_without_join_buffer": 0.034329735,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.014133225,
"uses_join_buffering": true
}
}
@@ -7554,18 +8383,18 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": ["t_inner_1"],
+ "plan_prefix": "t_inner_1",
"table": "t_inner_2",
"rows_for_plan": 27,
- "cost_for_plan": 10.02050781
+ "cost_for_plan": 0.02463804
}
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t_inner_2",
"rows_for_plan": 9,
- "cost_for_plan": 3.815380859,
+ "cost_for_plan": 0.011443245,
"pruned_by_heuristic": true
}
]
@@ -7573,23 +8402,30 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_4",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
"uses_join_buffering": false
}
}
@@ -7597,18 +8433,25 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.011443245,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.011443245,
"uses_join_buffering": false
}
}
@@ -7616,29 +8459,37 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t_inner_4",
"rows_for_plan": 3,
- "cost_for_plan": 2.605126953,
+ "cost_for_plan": 0.010504815,
"rest_of_plan": [
{
- "plan_prefix": ["t_inner_4"],
+ "plan_prefix": "t_inner_4",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 3
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.014133225,
+ "cost_without_join_buffer": 0.034329735,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.014133225,
"uses_join_buffering": true
}
}
@@ -7646,18 +8497,18 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": ["t_inner_4"],
+ "plan_prefix": "t_inner_4",
"table": "t_inner_3",
"rows_for_plan": 27,
- "cost_for_plan": 10.02050781
+ "cost_for_plan": 0.02463804
}
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t_inner_3",
"rows_for_plan": 9,
- "cost_for_plan": 3.815380859,
+ "cost_for_plan": 0.011443245,
"pruned_by_heuristic": true
}
]
@@ -7668,23 +8519,30 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_outer_1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
"uses_join_buffering": false
}
}
@@ -7692,18 +8550,25 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
"uses_join_buffering": false
}
}
@@ -7711,18 +8576,25 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_2",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.011443245,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.011443245,
"uses_join_buffering": false
}
}
@@ -7730,18 +8602,25 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_outer_2",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.011443245,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.011443245,
"uses_join_buffering": false
}
}
@@ -7749,18 +8628,25 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_4",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
"uses_join_buffering": false
}
}
@@ -7768,18 +8654,25 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.011443245,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.011443245,
"uses_join_buffering": false
}
}
@@ -7787,30 +8680,38 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t_outer_1",
"rows_for_plan": 3,
- "cost_for_plan": 2.605126953,
+ "cost_for_plan": 0.010504815,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": ["t_outer_1"],
+ "plan_prefix": "t_outer_1",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_1",
+ "plan_details": {
+ "record_count": 3
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.011523207,
+ "cost_without_join_buffer": 0.031514445,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.011523207,
"uses_join_buffering": true
}
}
@@ -7818,18 +8719,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_2",
+ "plan_details": {
+ "record_count": 3
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.014133225,
+ "cost_without_join_buffer": 0.034329735,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.014133225,
"uses_join_buffering": true
}
}
@@ -7837,18 +8746,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_outer_2",
+ "plan_details": {
+ "record_count": 3
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.014133225,
+ "cost_without_join_buffer": 0.034329735,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.014133225,
"uses_join_buffering": true
}
}
@@ -7856,18 +8773,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_4",
+ "plan_details": {
+ "record_count": 3
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.011523207,
+ "cost_without_join_buffer": 0.031514445,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.011523207,
"uses_join_buffering": true
}
}
@@ -7875,18 +8800,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 3
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.014133225,
+ "cost_without_join_buffer": 0.034329735,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.014133225,
"uses_join_buffering": true
}
}
@@ -7894,30 +8827,38 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": ["t_outer_1"],
+ "plan_prefix": "t_outer_1",
"table": "t_outer_2",
"rows_for_plan": 27,
- "cost_for_plan": 10.02050781,
+ "cost_for_plan": 0.02463804,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": ["t_outer_1", "t_outer_2"],
+ "plan_prefix": "t_outer_1,t_outer_2",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_2",
+ "plan_details": {
+ "record_count": 27
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.050443503,
+ "cost_without_join_buffer": 0.308967615,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.050443503,
"uses_join_buffering": true
}
}
@@ -7925,18 +8866,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_1",
+ "plan_details": {
+ "record_count": 27
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.024600489,
+ "cost_without_join_buffer": 0.283630005,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.024600489,
"uses_join_buffering": true
}
}
@@ -7944,18 +8893,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_4",
+ "plan_details": {
+ "record_count": 27
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.024600489,
+ "cost_without_join_buffer": 0.283630005,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.024600489,
"uses_join_buffering": true
}
}
@@ -7963,18 +8920,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 27
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.050443503,
+ "cost_without_join_buffer": 0.308967615,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.050443503,
"uses_join_buffering": true
}
}
@@ -7982,30 +8947,38 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": ["t_outer_1", "t_outer_2"],
+ "plan_prefix": "t_outer_1,t_outer_2",
"table": "t_inner_1",
"rows_for_plan": 81,
- "cost_for_plan": 28.22563477,
+ "cost_for_plan": 0.049238529,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": ["t_outer_1", "t_outer_2", "t_inner_1"],
+ "plan_prefix": "t_outer_1,t_outer_2,t_inner_1",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_2",
+ "plan_details": {
+ "record_count": 81
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.172815333,
+ "cost_without_join_buffer": 0.926902845,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.172815333,
"uses_join_buffering": true
}
}
@@ -8013,18 +8986,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_4",
+ "plan_details": {
+ "record_count": 81
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.067582275,
+ "cost_without_join_buffer": 0.850890015,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.067582275,
"uses_join_buffering": true
}
}
@@ -8032,18 +9013,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 81
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.172815333,
+ "cost_without_join_buffer": 0.926902845,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.172815333,
"uses_join_buffering": true
}
}
@@ -8051,54 +9040,66 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": ["t_outer_1", "t_outer_2", "t_inner_1"],
+ "plan_prefix": "t_outer_1,t_outer_2,t_inner_1",
"table": "t_inner_2",
"rows_for_plan": 729,
- "cost_for_plan": 176.0410156,
+ "cost_for_plan": 0.222053862,
"semijoin_strategy_choice": [
{
"strategy": "FirstMatch",
- "records": 27,
- "read_time": 389.4047852
+ "rows": 27,
+ "cost": 1.23517089
},
{
"strategy": "SJ-Materialization",
- "records": 27,
- "read_time": 16.74101562
+ "rows": 27,
+ "cost": 0.083958496
},
{
"strategy": "DuplicateWeedout",
- "records": 27,
- "read_time": 289.4410156
+ "prefix_row_count": 27,
+ "tmp_table_rows": 1,
+ "sj_inner_fanout": 27,
+ "rows": 27,
+ "dups_cost": 0.222053862,
+ "write_cost": 0.02934619,
+ "full_lookup_cost": 0.11734713,
+ "total_cost": 0.368747182
},
{
"chosen_strategy": "SJ-Materialization"
}
],
+ "sj_rows_out": 0.333333333,
+ "sj_rows_for_plan": 27,
+ "sj_filtered": 3.703703704,
"rest_of_plan": [
{
- "plan_prefix": [
- "t_outer_1",
- "t_outer_2",
- "t_inner_1",
- "t_inner_2"
- ],
+ "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_2",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_4",
+ "plan_details": {
+ "record_count": 27
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.034460781,
+ "cost_without_join_buffer": 0.283630005,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.034460781,
"uses_join_buffering": true
}
}
@@ -8106,18 +9107,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 27
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.080024379,
+ "cost_without_join_buffer": 0.308967615,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.080024379,
"uses_join_buffering": true
}
}
@@ -8125,41 +9134,38 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_outer_2",
- "t_inner_1",
- "t_inner_2"
- ],
+ "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_2",
"table": "t_inner_4",
"rows_for_plan": 81,
- "cost_for_plan": 34.94614258,
+ "cost_for_plan": 0.118419277,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": [
- "t_outer_1",
- "t_outer_2",
- "t_inner_1",
- "t_inner_2",
- "t_inner_4"
- ],
+ "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_2,t_inner_4",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 81
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.261557961,
+ "cost_without_join_buffer": 0.926902845,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.261557961,
"uses_join_buffering": true
}
}
@@ -8167,135 +9173,133 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_outer_2",
- "t_inner_1",
- "t_inner_2",
- "t_inner_4"
- ],
+ "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_2,t_inner_4",
"table": "t_inner_3",
"rows_for_plan": 729,
- "cost_for_plan": 182.7615234,
+ "cost_for_plan": 0.379977238,
"semijoin_strategy_choice": [
{
"strategy": "FirstMatch",
- "records": 27,
- "read_time": 396.125293
+ "rows": 27,
+ "cost": 1.294491346
},
{
"strategy": "SJ-Materialization",
- "records": 27,
- "read_time": 23.46152344
+ "rows": 27,
+ "cost": 0.143278952
},
{
"strategy": "DuplicateWeedout",
- "records": 27,
- "read_time": 296.1615234
+ "prefix_row_count": 27,
+ "tmp_table_rows": 1,
+ "sj_inner_fanout": 27,
+ "rows": 27,
+ "dups_cost": 0.379977238,
+ "write_cost": 0.02934619,
+ "full_lookup_cost": 0.11734713,
+ "total_cost": 0.526670558
},
{
"chosen_strategy": "SJ-Materialization"
}
- ]
+ ],
+ "sj_rows_out": 0.333333333,
+ "sj_rows_for_plan": 27,
+ "sj_filtered": 3.703703704
}
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_outer_2",
- "t_inner_1",
- "t_inner_2"
- ],
+ "plan_prefix": "t_outer_1,t_outer_2,t_inner_1,t_inner_2",
"table": "t_inner_3",
"rows_for_plan": 243,
- "cost_for_plan": 67.35639648,
+ "cost_for_plan": 0.163982875,
"semijoin_strategy_choice": [],
"pruned_by_cost": true,
- "current_cost": 67.35639648,
- "best_cost": 23.46152344
+ "current_cost": 0.163982875,
+ "best_cost": 0.143278952
}
]
},
{
- "plan_prefix": ["t_outer_1", "t_outer_2", "t_inner_1"],
+ "plan_prefix": "t_outer_1,t_outer_2,t_inner_1",
"table": "t_inner_4",
"rows_for_plan": 243,
- "cost_for_plan": 78.83076172,
+ "cost_for_plan": 0.116820804,
"semijoin_strategy_choice": [],
- "pruned_by_cost": true,
- "current_cost": 78.83076172,
- "best_cost": 23.46152344
+ "pruned_by_heuristic": true
},
{
- "plan_prefix": ["t_outer_1", "t_outer_2", "t_inner_1"],
+ "plan_prefix": "t_outer_1,t_outer_2,t_inner_1",
"table": "t_inner_3",
"rows_for_plan": 729,
- "cost_for_plan": 176.0410156,
+ "cost_for_plan": 0.222053862,
"semijoin_strategy_choice": [],
"pruned_by_cost": true,
- "current_cost": 176.0410156,
- "best_cost": 23.46152344
+ "current_cost": 0.222053862,
+ "best_cost": 0.143278952
}
]
},
{
- "plan_prefix": ["t_outer_1", "t_outer_2"],
+ "plan_prefix": "t_outer_1,t_outer_2",
"table": "t_inner_2",
"rows_for_plan": 243,
- "cost_for_plan": 60.63588867,
+ "cost_for_plan": 0.075081543,
"semijoin_strategy_choice": [],
- "pruned_by_cost": true,
- "current_cost": 60.63588867,
- "best_cost": 23.46152344
+ "pruned_by_heuristic": true
},
{
- "plan_prefix": ["t_outer_1", "t_outer_2"],
+ "plan_prefix": "t_outer_1,t_outer_2",
"table": "t_inner_4",
"rows_for_plan": 81,
- "cost_for_plan": 28.22563477,
+ "cost_for_plan": 0.049238529,
"semijoin_strategy_choice": [],
- "pruned_by_cost": true,
- "current_cost": 28.22563477,
- "best_cost": 23.46152344
+ "pruned_by_heuristic": true
},
{
- "plan_prefix": ["t_outer_1", "t_outer_2"],
+ "plan_prefix": "t_outer_1,t_outer_2",
"table": "t_inner_3",
"rows_for_plan": 243,
- "cost_for_plan": 60.63588867,
+ "cost_for_plan": 0.075081543,
"semijoin_strategy_choice": [],
- "pruned_by_cost": true,
- "current_cost": 60.63588867,
- "best_cost": 23.46152344
+ "pruned_by_heuristic": true
}
]
},
{
- "plan_prefix": ["t_outer_1"],
+ "plan_prefix": "t_outer_1",
"table": "t_inner_1",
"rows_for_plan": 9,
- "cost_for_plan": 6.410253906,
+ "cost_for_plan": 0.022028022,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": ["t_outer_1", "t_inner_1"],
+ "plan_prefix": "t_outer_1,t_inner_1",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_2",
+ "plan_details": {
+ "record_count": 9
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.024443331,
+ "cost_without_join_buffer": 0.102989205,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.024443331,
"uses_join_buffering": true
}
}
@@ -8303,18 +9307,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_outer_2",
+ "plan_details": {
+ "record_count": 9
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.024443331,
+ "cost_without_join_buffer": 0.102989205,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.024443331,
"uses_join_buffering": true
}
}
@@ -8322,18 +9334,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_4",
+ "plan_details": {
+ "record_count": 9
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.015203373,
+ "cost_without_join_buffer": 0.094543335,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.015203373,
"uses_join_buffering": true
}
}
@@ -8341,18 +9361,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 9
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.024443331,
+ "cost_without_join_buffer": 0.102989205,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.024443331,
"uses_join_buffering": true
}
}
@@ -8360,59 +9388,358 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": ["t_outer_1", "t_inner_1"],
+ "plan_prefix": "t_outer_1,t_inner_1",
"table": "t_outer_2",
"rows_for_plan": 81,
- "cost_for_plan": 24.62563477,
+ "cost_for_plan": 0.046471353,
"semijoin_strategy_choice": [],
- "pruned_by_cost": true,
- "current_cost": 24.62563477,
- "best_cost": 23.46152344
+ "rest_of_plan": [
+ {
+ "plan_prefix": "t_outer_1,t_inner_1,t_outer_2",
+ "get_costs_for_tables": [
+ {
+ "best_access_path": {
+ "table": "t_inner_2",
+ "plan_details": {
+ "record_count": 81
+ },
+ "considered_access_paths": [
+ {
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.172815333,
+ "cost_without_join_buffer": 0.926902845,
+ "index_only": false,
+ "chosen": true
+ }
+ ],
+ "chosen_access_method": {
+ "type": "scan",
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.172815333,
+ "uses_join_buffering": true
+ }
+ }
+ },
+ {
+ "best_access_path": {
+ "table": "t_inner_4",
+ "plan_details": {
+ "record_count": 81
+ },
+ "considered_access_paths": [
+ {
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.067582275,
+ "cost_without_join_buffer": 0.850890015,
+ "index_only": false,
+ "chosen": true
+ }
+ ],
+ "chosen_access_method": {
+ "type": "scan",
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.067582275,
+ "uses_join_buffering": true
+ }
+ }
+ },
+ {
+ "best_access_path": {
+ "table": "t_inner_3",
+ "plan_details": {
+ "record_count": 81
+ },
+ "considered_access_paths": [
+ {
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.172815333,
+ "cost_without_join_buffer": 0.926902845,
+ "index_only": false,
+ "chosen": true
+ }
+ ],
+ "chosen_access_method": {
+ "type": "scan",
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.172815333,
+ "uses_join_buffering": true
+ }
+ }
+ }
+ ]
+ },
+ {
+ "plan_prefix": "t_outer_1,t_inner_1,t_outer_2",
+ "table": "t_inner_2",
+ "rows_for_plan": 729,
+ "cost_for_plan": 0.219286686,
+ "semijoin_strategy_choice": [
+ {
+ "strategy": "DuplicateWeedout",
+ "prefix_row_count": 3,
+ "tmp_table_rows": 9,
+ "sj_inner_fanout": 27,
+ "rows": 27,
+ "dups_cost": 0.219286686,
+ "write_cost": 0.02934619,
+ "full_lookup_cost": 0.11734713,
+ "total_cost": 0.365980006
+ },
+ {
+ "chosen_strategy": "DuplicateWeedout"
+ }
+ ],
+ "sj_rows_out": 0.333333333,
+ "sj_rows_for_plan": 27,
+ "sj_filtered": 3.703703704,
+ "pruned_by_cost": true,
+ "current_cost": 0.365980006,
+ "best_cost": 0.143278952
+ },
+ {
+ "plan_prefix": "t_outer_1,t_inner_1,t_outer_2",
+ "table": "t_inner_4",
+ "rows_for_plan": 243,
+ "cost_for_plan": 0.114053628,
+ "semijoin_strategy_choice": [],
+ "rest_of_plan": [
+ {
+ "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_4",
+ "get_costs_for_tables": [
+ {
+ "best_access_path": {
+ "table": "t_inner_2",
+ "plan_details": {
+ "record_count": 243
+ },
+ "considered_access_paths": [
+ {
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.628673451,
+ "cost_without_join_buffer": 2.780708535,
+ "index_only": false,
+ "chosen": true
+ }
+ ],
+ "chosen_access_method": {
+ "type": "scan",
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.628673451,
+ "uses_join_buffering": true
+ }
+ }
+ },
+ {
+ "best_access_path": {
+ "table": "t_inner_3",
+ "plan_details": {
+ "record_count": 243
+ },
+ "considered_access_paths": [
+ {
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.628673451,
+ "cost_without_join_buffer": 2.780708535,
+ "index_only": false,
+ "chosen": true
+ }
+ ],
+ "chosen_access_method": {
+ "type": "scan",
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.628673451,
+ "uses_join_buffering": true
+ }
+ }
+ }
+ ]
+ },
+ {
+ "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_4",
+ "table": "t_inner_2",
+ "rows_for_plan": 2187,
+ "cost_for_plan": 0.742727079,
+ "semijoin_strategy_choice": [],
+ "pruned_by_cost": true,
+ "current_cost": 0.742727079,
+ "best_cost": 0.143278952
+ },
+ {
+ "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_4",
+ "table": "t_inner_3",
+ "rows_for_plan": 2187,
+ "cost_for_plan": 0.742727079,
+ "semijoin_strategy_choice": [
+ {
+ "strategy": "SJ-Materialization",
+ "rows": 81,
+ "cost": 0.116338225
+ },
+ {
+ "chosen_strategy": "SJ-Materialization"
+ }
+ ],
+ "sj_rows_out": 0.333333333,
+ "sj_rows_for_plan": 81,
+ "sj_filtered": 3.703703704,
+ "rest_of_plan": [
+ {
+ "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_4,t_inner_3",
+ "get_costs_for_tables": [
+ {
+ "best_access_path": {
+ "table": "t_inner_2",
+ "plan_details": {
+ "record_count": 81
+ },
+ "considered_access_paths": [
+ {
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.261557961,
+ "cost_without_join_buffer": 0.926902845,
+ "index_only": false,
+ "chosen": true
+ }
+ ],
+ "chosen_access_method": {
+ "type": "scan",
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.261557961,
+ "uses_join_buffering": true
+ }
+ }
+ }
+ ]
+ },
+ {
+ "plan_prefix": "t_outer_1,t_inner_1,t_outer_2,t_inner_4,t_inner_3",
+ "table": "t_inner_2",
+ "rows_for_plan": 729,
+ "cost_for_plan": 0.377896186,
+ "semijoin_strategy_choice": [
+ {
+ "strategy": "DuplicateWeedout",
+ "prefix_row_count": 3,
+ "tmp_table_rows": 9,
+ "sj_inner_fanout": 27,
+ "rows": 27,
+ "dups_cost": 1.00428504,
+ "write_cost": 0.02934619,
+ "full_lookup_cost": 0.11734713,
+ "total_cost": 1.15097836
+ },
+ {
+ "chosen_strategy": "DuplicateWeedout"
+ }
+ ],
+ "sj_rows_out": 0.333333333,
+ "sj_rows_for_plan": 27,
+ "sj_filtered": 3.703703704,
+ "pruned_by_cost": true,
+ "current_cost": 1.15097836,
+ "best_cost": 0.143278952
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "plan_prefix": "t_outer_1,t_inner_1,t_outer_2",
+ "table": "t_inner_3",
+ "rows_for_plan": 729,
+ "cost_for_plan": 0.219286686,
+ "semijoin_strategy_choice": [],
+ "pruned_by_cost": true,
+ "current_cost": 0.219286686,
+ "best_cost": 0.143278952
+ }
+ ]
},
{
- "plan_prefix": ["t_outer_1", "t_inner_1"],
+ "plan_prefix": "t_outer_1,t_inner_1",
"table": "t_inner_2",
"rows_for_plan": 81,
- "cost_for_plan": 24.62563477,
+ "cost_for_plan": 0.046471353,
"semijoin_strategy_choice": [
{
"strategy": "FirstMatch",
- "records": 3,
- "read_time": 44.75893555
+ "rows": 3,
+ "cost": 0.145008465
},
{
"strategy": "SJ-Materialization",
- "records": 3,
- "read_time": 8.125634766
+ "rows": 3,
+ "cost": 0.065137975
},
{
"strategy": "DuplicateWeedout",
- "records": 3,
- "read_time": 37.22563477
+ "prefix_row_count": 3,
+ "tmp_table_rows": 1,
+ "sj_inner_fanout": 27,
+ "rows": 3,
+ "dups_cost": 0.046471353,
+ "write_cost": 0.02548291,
+ "full_lookup_cost": 0.01303857,
+ "total_cost": 0.084992833
},
{
"chosen_strategy": "SJ-Materialization"
}
],
+ "sj_rows_out": 0.333333333,
+ "sj_rows_for_plan": 3,
+ "sj_filtered": 3.703703704,
"rest_of_plan": [
{
- "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_2"],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_outer_2",
+ "plan_details": {
+ "record_count": 3
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.017419989,
+ "cost_without_join_buffer": 0.034329735,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.017419989,
"uses_join_buffering": true
}
}
@@ -8420,18 +9747,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_4",
+ "plan_details": {
+ "record_count": 3
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.012618795,
+ "cost_without_join_buffer": 0.031514445,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.012618795,
"uses_join_buffering": true
}
}
@@ -8439,18 +9774,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 3
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.017419989,
+ "cost_without_join_buffer": 0.034329735,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.017419989,
"uses_join_buffering": true
}
}
@@ -8458,35 +9801,38 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_2"],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2",
"table": "t_outer_2",
"rows_for_plan": 27,
- "cost_for_plan": 15.54101562,
+ "cost_for_plan": 0.082557964,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_inner_2",
- "t_outer_2"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_outer_2",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_inner_4",
+ "plan_details": {
+ "record_count": 27
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "access_type": "scan_with_join_cache",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.034460781,
+ "cost_without_join_buffer": 0.283630005,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.034460781,
"uses_join_buffering": true
}
}
@@ -8494,18 +9840,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 27
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.080024379,
+ "cost_without_join_buffer": 0.308967615,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.080024379,
"uses_join_buffering": true
}
}
@@ -8513,67 +9867,126 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_inner_2",
- "t_outer_2"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_outer_2",
"table": "t_inner_4",
"rows_for_plan": 81,
- "cost_for_plan": 33.74614258,
+ "cost_for_plan": 0.117018745,
"semijoin_strategy_choice": [],
- "pruned_by_cost": true,
- "current_cost": 33.74614258,
- "best_cost": 23.46152344
+ "rest_of_plan": [
+ {
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_outer_2,t_inner_4",
+ "get_costs_for_tables": [
+ {
+ "best_access_path": {
+ "table": "t_inner_3",
+ "plan_details": {
+ "record_count": 81
+ },
+ "considered_access_paths": [
+ {
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.261557961,
+ "cost_without_join_buffer": 0.926902845,
+ "index_only": false,
+ "chosen": true
+ }
+ ],
+ "chosen_access_method": {
+ "type": "scan",
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.261557961,
+ "uses_join_buffering": true
+ }
+ }
+ }
+ ]
+ },
+ {
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_outer_2,t_inner_4",
+ "table": "t_inner_3",
+ "rows_for_plan": 729,
+ "cost_for_plan": 0.378576706,
+ "semijoin_strategy_choice": [
+ {
+ "strategy": "FirstMatch",
+ "rows": 27,
+ "cost": 1.293090814
+ },
+ {
+ "strategy": "SJ-Materialization",
+ "rows": 27,
+ "cost": 0.14187842
+ },
+ {
+ "strategy": "DuplicateWeedout",
+ "prefix_row_count": 27,
+ "tmp_table_rows": 1,
+ "sj_inner_fanout": 27,
+ "rows": 27,
+ "dups_cost": 0.378576706,
+ "write_cost": 0.02934619,
+ "full_lookup_cost": 0.11734713,
+ "total_cost": 0.525270026
+ },
+ {
+ "chosen_strategy": "SJ-Materialization"
+ }
+ ],
+ "sj_rows_out": 0.333333333,
+ "sj_rows_for_plan": 27,
+ "sj_filtered": 3.703703704
+ }
+ ]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_inner_2",
- "t_outer_2"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_outer_2",
"table": "t_inner_3",
"rows_for_plan": 243,
- "cost_for_plan": 66.15639648,
+ "cost_for_plan": 0.162582343,
"semijoin_strategy_choice": [],
"pruned_by_cost": true,
- "current_cost": 66.15639648,
- "best_cost": 23.46152344
+ "current_cost": 0.162582343,
+ "best_cost": 0.14187842
}
]
},
{
- "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_2"],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2",
"table": "t_inner_4",
"rows_for_plan": 9,
- "cost_for_plan": 11.93076172,
+ "cost_for_plan": 0.07775677,
"semijoin_strategy_choice": [],
"rest_of_plan": [
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_inner_2",
- "t_inner_4"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_inner_4",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t_outer_2",
+ "plan_details": {
+ "record_count": 9
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.034303623,
+ "cost_without_join_buffer": 0.102989205,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.034303623,
"uses_join_buffering": true
}
}
@@ -8581,18 +9994,26 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_access_path": {
"table": "t_inner_3",
+ "plan_details": {
+ "record_count": 9
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 9,
- "cost": 2.015380859,
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.034303623,
+ "cost_without_join_buffer": 0.102989205,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 9,
- "cost": 2.015380859,
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.034303623,
"uses_join_buffering": true
}
}
@@ -8600,130 +10021,366 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_inner_2",
- "t_inner_4"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_inner_4",
"table": "t_outer_2",
"rows_for_plan": 81,
- "cost_for_plan": 30.14614258,
+ "cost_for_plan": 0.112060393,
"semijoin_strategy_choice": [],
- "pruned_by_cost": true,
- "current_cost": 30.14614258,
- "best_cost": 23.46152344
+ "rest_of_plan": [
+ {
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_inner_4,t_outer_2",
+ "get_costs_for_tables": [
+ {
+ "best_access_path": {
+ "table": "t_inner_3",
+ "plan_details": {
+ "record_count": 81
+ },
+ "considered_access_paths": [
+ {
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.261557961,
+ "cost_without_join_buffer": 0.926902845,
+ "index_only": false,
+ "chosen": true
+ }
+ ],
+ "chosen_access_method": {
+ "type": "scan",
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.261557961,
+ "uses_join_buffering": true
+ }
+ }
+ }
+ ]
+ },
+ {
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_inner_4,t_outer_2",
+ "table": "t_inner_3",
+ "rows_for_plan": 729,
+ "cost_for_plan": 0.373618354,
+ "semijoin_strategy_choice": [
+ {
+ "strategy": "DuplicateWeedout",
+ "prefix_row_count": 3,
+ "tmp_table_rows": 9,
+ "sj_inner_fanout": 27,
+ "rows": 27,
+ "dups_cost": 0.373618354,
+ "write_cost": 0.02934619,
+ "full_lookup_cost": 0.11734713,
+ "total_cost": 0.520311674
+ },
+ {
+ "chosen_strategy": "DuplicateWeedout"
+ }
+ ],
+ "sj_rows_out": 0.333333333,
+ "sj_rows_for_plan": 27,
+ "sj_filtered": 3.703703704,
+ "pruned_by_cost": true,
+ "current_cost": 0.520311674,
+ "best_cost": 0.14187842
+ }
+ ]
},
{
- "plan_prefix": [
- "t_outer_1",
- "t_inner_1",
- "t_inner_2",
- "t_inner_4"
- ],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2,t_inner_4",
"table": "t_inner_3",
"rows_for_plan": 81,
- "cost_for_plan": 30.14614258,
+ "cost_for_plan": 0.112060393,
"semijoin_strategy_choice": [],
- "pruned_by_cost": true,
- "current_cost": 30.14614258,
- "best_cost": 23.46152344
+ "pruned_by_heuristic": true
}
]
},
{
- "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_2"],
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_2",
"table": "t_inner_3",
"rows_for_plan": 27,
- "cost_for_plan": 15.54101562,
+ "cost_for_plan": 0.082557964,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
}
]
},
{
- "plan_prefix": ["t_outer_1", "t_inner_1"],
+ "plan_prefix": "t_outer_1,t_inner_1",
"table": "t_inner_4",
"rows_for_plan": 27,
- "cost_for_plan": 13.81538086,
+ "cost_for_plan": 0.037231395,
"semijoin_strategy_choice": [],
- "pruned_by_heuristic": true
+ "rest_of_plan": [
+ {
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_4",
+ "get_costs_for_tables": [
+ {
+ "best_access_path": {
+ "table": "t_outer_2",
+ "plan_details": {
+ "record_count": 27
+ },
+ "considered_access_paths": [
+ {
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.065233941,
+ "cost_without_join_buffer": 0.308967615,
+ "index_only": false,
+ "chosen": true
+ }
+ ],
+ "chosen_access_method": {
+ "type": "scan",
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.065233941,
+ "uses_join_buffering": true
+ }
+ }
+ },
+ {
+ "best_access_path": {
+ "table": "t_inner_2",
+ "plan_details": {
+ "record_count": 27
+ },
+ "considered_access_paths": [
+ {
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.065233941,
+ "cost_without_join_buffer": 0.308967615,
+ "index_only": false,
+ "chosen": true
+ }
+ ],
+ "chosen_access_method": {
+ "type": "scan",
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.065233941,
+ "uses_join_buffering": true
+ }
+ }
+ },
+ {
+ "best_access_path": {
+ "table": "t_inner_3",
+ "plan_details": {
+ "record_count": 27
+ },
+ "considered_access_paths": [
+ {
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.065233941,
+ "cost_without_join_buffer": 0.308967615,
+ "index_only": false,
+ "chosen": true
+ }
+ ],
+ "chosen_access_method": {
+ "type": "scan",
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.065233941,
+ "uses_join_buffering": true
+ }
+ }
+ }
+ ]
+ },
+ {
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_4",
+ "table": "t_outer_2",
+ "rows_for_plan": 243,
+ "cost_for_plan": 0.102465336,
+ "semijoin_strategy_choice": [],
+ "rest_of_plan": [
+ {
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_4,t_outer_2",
+ "get_costs_for_tables": [
+ {
+ "best_access_path": {
+ "table": "t_inner_2",
+ "plan_details": {
+ "record_count": 243
+ },
+ "considered_access_paths": [
+ {
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.628673451,
+ "cost_without_join_buffer": 2.780708535,
+ "index_only": false,
+ "chosen": true
+ }
+ ],
+ "chosen_access_method": {
+ "type": "scan",
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.628673451,
+ "uses_join_buffering": true
+ }
+ }
+ },
+ {
+ "best_access_path": {
+ "table": "t_inner_3",
+ "plan_details": {
+ "record_count": 243
+ },
+ "considered_access_paths": [
+ {
+ "access_type": "scan_with_join_cache",
+ "rows": 9,
+ "rows_after_filter": 9,
+ "rows_out": 9,
+ "cost": 0.628673451,
+ "cost_without_join_buffer": 2.780708535,
+ "index_only": false,
+ "chosen": true
+ }
+ ],
+ "chosen_access_method": {
+ "type": "scan",
+ "rows_read": 9,
+ "rows_out": 9,
+ "cost": 0.628673451,
+ "uses_join_buffering": true
+ }
+ }
+ }
+ ]
+ },
+ {
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_4,t_outer_2",
+ "table": "t_inner_2",
+ "rows_for_plan": 2187,
+ "cost_for_plan": 0.731138787,
+ "semijoin_strategy_choice": [],
+ "pruned_by_cost": true,
+ "current_cost": 0.731138787,
+ "best_cost": 0.14187842
+ },
+ {
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_4,t_outer_2",
+ "table": "t_inner_3",
+ "rows_for_plan": 2187,
+ "cost_for_plan": 0.731138787,
+ "semijoin_strategy_choice": [],
+ "pruned_by_cost": true,
+ "current_cost": 0.731138787,
+ "best_cost": 0.14187842
+ }
+ ]
+ },
+ {
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_4",
+ "table": "t_inner_2",
+ "rows_for_plan": 243,
+ "cost_for_plan": 0.102465336,
+ "semijoin_strategy_choice": [],
+ "pruned_by_heuristic": true
+ },
+ {
+ "plan_prefix": "t_outer_1,t_inner_1,t_inner_4",
+ "table": "t_inner_3",
+ "rows_for_plan": 243,
+ "cost_for_plan": 0.102465336,
+ "semijoin_strategy_choice": [],
+ "pruned_by_heuristic": true
+ }
+ ]
},
{
- "plan_prefix": ["t_outer_1", "t_inner_1"],
+ "plan_prefix": "t_outer_1,t_inner_1",
"table": "t_inner_3",
"rows_for_plan": 81,
- "cost_for_plan": 24.62563477,
+ "cost_for_plan": 0.046471353,
"semijoin_strategy_choice": [],
- "pruned_by_cost": true,
- "current_cost": 24.62563477,
- "best_cost": 23.46152344
+ "pruned_by_heuristic": true
}
]
},
{
- "plan_prefix": ["t_outer_1"],
+ "plan_prefix": "t_outer_1",
"table": "t_inner_2",
"rows_for_plan": 27,
- "cost_for_plan": 10.02050781,
+ "cost_for_plan": 0.02463804,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
},
{
- "plan_prefix": ["t_outer_1"],
+ "plan_prefix": "t_outer_1",
"table": "t_inner_4",
"rows_for_plan": 9,
- "cost_for_plan": 6.410253906,
+ "cost_for_plan": 0.022028022,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
},
{
- "plan_prefix": ["t_outer_1"],
+ "plan_prefix": "t_outer_1",
"table": "t_inner_3",
"rows_for_plan": 27,
- "cost_for_plan": 10.02050781,
+ "cost_for_plan": 0.02463804,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
}
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t_outer_2",
"rows_for_plan": 9,
- "cost_for_plan": 3.815380859,
+ "cost_for_plan": 0.011443245,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t_inner_1",
"rows_for_plan": 3,
- "cost_for_plan": 2.605126953,
+ "cost_for_plan": 0.010504815,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t_inner_2",
"rows_for_plan": 9,
- "cost_for_plan": 3.815380859,
+ "cost_for_plan": 0.011443245,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t_inner_4",
"rows_for_plan": 3,
- "cost_for_plan": 2.605126953,
+ "cost_for_plan": 0.010504815,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t_inner_3",
"rows_for_plan": 9,
- "cost_for_plan": 3.815380859,
+ "cost_for_plan": 0.011443245,
"semijoin_strategy_choice": [],
"pruned_by_heuristic": true
}
@@ -8758,10 +10415,12 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
{
"best_join_order": [
"t_outer_1",
- "t_outer_2",
"<subquery2>",
+ "t_outer_2",
"<subquery3>"
- ]
+ ],
+ "rows": 27,
+ "cost": 0.14187842
},
{
"substitute_best_equal": {
@@ -8770,47 +10429,51 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) {
}
},
{
- "condition_on_constant_tables": "1",
- "computing_condition": []
- },
- {
"attaching_conditions_to_tables": {
- "attached_conditions_computation": [],
+ "attached_conditions_computation": [
+ {
+ "condition_on_constant_tables": "1",
+ "computing_condition": []
+ }
+ ],
"attached_conditions_summary": [
{
"table": "t_outer_1",
- "attached": null
- },
- {
- "table": "t_outer_2",
- "attached": null
+ "attached_condition": null
},
{
"table": "t_inner_1",
- "attached": null
+ "attached_condition": null
},
{
"table": "t_inner_2",
- "attached": null
+ "attached_condition": null
},
{
"table": "<subquery2>",
- "attached": null
+ "attached_condition": null
+ },
+ {
+ "table": "t_outer_2",
+ "attached_condition": null
},
{
"table": "t_inner_4",
- "attached": null
+ "attached_condition": null
},
{
"table": "t_inner_3",
- "attached": null
+ "attached_condition": null
},
{
"table": "<subquery3>",
- "attached": null
+ "attached_condition": null
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -8865,7 +10528,7 @@ JS
"using_mrr": false,
"index_only": true,
"rows": 1,
- "cost": 0.345829876,
+ "cost": 0.001478954,
"chosen": true
}
],
@@ -8894,7 +10557,7 @@ JS
"using_mrr": false,
"index_only": true,
"rows": 107,
- "cost": 21.63379668,
+ "cost": 0.016135574,
"chosen": true
}
],
@@ -8926,7 +10589,7 @@ JS
"using_mrr": false,
"index_only": false,
"rows": 1000,
- "cost": 1203.877243,
+ "cost": 1.235690484,
"chosen": true
}
],
@@ -8966,7 +10629,7 @@ JS
"using_mrr": false,
"index_only": false,
"rows": 4,
- "cost": 4.948710032,
+ "cost": 0.00627616,
"chosen": true
}
],
@@ -9000,7 +10663,7 @@ JS
"using_mrr": false,
"index_only": false,
"rows": 1,
- "cost": 1.346171589,
+ "cost": 0.002574553,
"chosen": true
}
],
@@ -9029,7 +10692,7 @@ JS
"using_mrr": false,
"index_only": false,
"rows": 1,
- "cost": 1.346171589,
+ "cost": 0.002574553,
"chosen": true
}
],
@@ -9066,7 +10729,7 @@ JS
"using_mrr": false,
"index_only": false,
"rows": 1,
- "cost": 1.345927508,
+ "cost": 0.002574553,
"chosen": true
}
],
@@ -9096,7 +10759,7 @@ JS
"using_mrr": false,
"index_only": false,
"rows": 1,
- "cost": 1.345878692,
+ "cost": 0.002574553,
"chosen": true
}
],
@@ -9126,7 +10789,7 @@ JS
"using_mrr": false,
"index_only": false,
"rows": 1,
- "cost": 1.345927508,
+ "cost": 0.002574553,
"chosen": true
}
],
@@ -9159,7 +10822,7 @@ JS
"using_mrr": false,
"index_only": false,
"rows": 1,
- "cost": 1.345878692,
+ "cost": 0.002574553,
"chosen": true
}
],
@@ -9195,7 +10858,7 @@ JS
"using_mrr": false,
"index_only": false,
"rows": 1,
- "cost": 1.394255553,
+ "cost": 0.002574553,
"chosen": true
}
],
@@ -9229,7 +10892,7 @@ JS
"using_mrr": false,
"index_only": false,
"rows": 2,
- "cost": 2.546855016,
+ "cost": 0.003808422,
"chosen": true
}
],
@@ -9253,6 +10916,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": 1.235690484,
"nested_loop": [
{
"table": {
@@ -9262,7 +10926,9 @@ EXPLAIN
"key": "start_date",
"key_length": "8",
"used_key_parts": ["start_date", "end_date"],
+ "loops": 1,
"rows": 1000,
+ "cost": 1.235690484,
"filtered": 100,
"index_condition": "t1.start_date >= '2019-02-10' and t1.end_date < '2019-04-01'"
}
@@ -9284,7 +10950,7 @@ JS
"using_mrr": false,
"index_only": false,
"rows": 1000,
- "cost": 1203.877243,
+ "cost": 1.235690484,
"chosen": true
}
],
@@ -9334,28 +11000,35 @@ JS
[
[
{
- "plan_prefix":
- [],
+ "plan_prefix": "",
"get_costs_for_tables":
[
{
"best_access_path":
{
"table": "A",
+ "plan_details":
+ {
+ "record_count": 1
+ },
"considered_access_paths":
[
{
"access_type": "scan",
- "resulting_rows": 5,
- "cost": 3.017089844,
+ "rows": 10,
+ "rows_after_filter": 5,
+ "rows_out": 5,
+ "cost": 0.01159965,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method":
{
"type": "scan",
- "records": 5,
- "cost": 3.017089844,
+ "rows_read": 5,
+ "rows_out": 5,
+ "cost": 0.01159965,
"uses_join_buffering": false
}
}
@@ -9364,20 +11037,28 @@ JS
"best_access_path":
{
"table": "B",
+ "plan_details":
+ {
+ "record_count": 1
+ },
"considered_access_paths":
[
{
"access_type": "scan",
- "resulting_rows": 800,
- "cost": 44.19726562,
+ "rows": 1000,
+ "rows_after_filter": 800,
+ "rows_out": 800,
+ "cost": 0.1669214,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method":
{
"type": "scan",
- "records": 800,
- "cost": 44.19726562,
+ "rows_read": 800,
+ "rows_out": 800,
+ "cost": 0.1669214,
"uses_join_buffering": false
}
}
@@ -9385,36 +11066,42 @@ JS
]
},
{
- "plan_prefix":
- [],
+ "plan_prefix": "",
"table": "A",
"rows_for_plan": 5,
- "cost_for_plan": 4.017089844,
+ "cost_for_plan": 0.01159965,
"rest_of_plan":
[
{
- "plan_prefix":
- ["A"],
+ "plan_prefix": "A",
"get_costs_for_tables":
[
{
"best_access_path":
{
"table": "B",
+ "plan_details":
+ {
+ "record_count": 5
+ },
"considered_access_paths":
[
{
"access_type": "scan",
- "resulting_rows": 800,
- "cost": 220.9863281,
+ "rows": 1000,
+ "rows_after_filter": 800,
+ "rows_out": 800,
+ "cost": 0.8329686,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method":
{
"type": "scan",
- "records": 800,
- "cost": 220.9863281,
+ "rows_read": 800,
+ "rows_out": 800,
+ "cost": 0.8329686,
"uses_join_buffering": false
}
}
@@ -9422,20 +11109,18 @@ JS
]
},
{
- "plan_prefix":
- ["A"],
+ "plan_prefix": "A",
"table": "B",
"rows_for_plan": 4000,
- "cost_for_plan": 1025.003418
+ "cost_for_plan": 0.84456825
}
]
},
{
- "plan_prefix":
- [],
+ "plan_prefix": "",
"table": "B",
"rows_for_plan": 800,
- "cost_for_plan": 204.1972656,
+ "cost_for_plan": 0.1669214,
"pruned_by_heuristic": true
}
]
@@ -9451,28 +11136,35 @@ JS
[
[
{
- "plan_prefix":
- [],
+ "plan_prefix": "",
"get_costs_for_tables":
[
{
"best_access_path":
{
"table": "A",
+ "plan_details":
+ {
+ "record_count": 1
+ },
"considered_access_paths":
[
{
"access_type": "scan",
- "resulting_rows": 10,
- "cost": 2.017089844,
+ "rows": 10,
+ "rows_after_filter": 10,
+ "rows_out": 10,
+ "cost": 0.01159965,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method":
{
"type": "scan",
- "records": 10,
- "cost": 2.017089844,
+ "rows_read": 10,
+ "rows_out": 10,
+ "cost": 0.01159965,
"uses_join_buffering": false
}
}
@@ -9481,20 +11173,28 @@ JS
"best_access_path":
{
"table": "B",
+ "plan_details":
+ {
+ "record_count": 1
+ },
"considered_access_paths":
[
{
"access_type": "scan",
- "resulting_rows": 800,
- "cost": 44.19726562,
+ "rows": 1000,
+ "rows_after_filter": 800,
+ "rows_out": 800,
+ "cost": 0.1669214,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method":
{
"type": "scan",
- "records": 800,
- "cost": 44.19726562,
+ "rows_read": 800,
+ "rows_out": 800,
+ "cost": 0.1669214,
"uses_join_buffering": false
}
}
@@ -9502,22 +11202,24 @@ JS
]
},
{
- "plan_prefix":
- [],
+ "plan_prefix": "",
"table": "A",
"rows_for_plan": 10,
- "cost_for_plan": 4.017089844,
+ "cost_for_plan": 0.01159965,
"rest_of_plan":
[
{
- "plan_prefix":
- ["A"],
+ "plan_prefix": "A",
"get_costs_for_tables":
[
{
"best_access_path":
{
"table": "B",
+ "plan_details":
+ {
+ "record_count": 10
+ },
"considered_access_paths":
[
{
@@ -9526,21 +11228,21 @@ JS
"used_range_estimates": false,
"reason": "not available",
"rows": 1,
- "cost": 20.00585794,
+ "cost": 0.01901531,
"chosen": true
},
{
- "access_type": "scan",
- "resulting_rows": 800,
- "cost": 44.19726562,
- "chosen": false
+ "type": "scan",
+ "chosen": false,
+ "cause": "cost"
}
],
"chosen_access_method":
{
"type": "ref",
- "records": 1,
- "cost": 20.00585794,
+ "rows_read": 1,
+ "rows_out": 1,
+ "cost": 0.01901531,
"uses_join_buffering": false
}
}
@@ -9548,25 +11250,26 @@ JS
]
},
{
- "plan_prefix":
- ["A"],
+ "plan_prefix": "A",
"table": "B",
"rows_for_plan": 10,
- "cost_for_plan": 26.02294779,
+ "cost_for_plan": 0.03061496,
+ "pushdown_cond_selectivity": 0.8,
+ "filtered": 80,
+ "rows_out": 0.8,
"selectivity": 0.8,
"estimated_join_cardinality": 8
}
]
},
{
- "plan_prefix":
- [],
+ "plan_prefix": "",
"table": "B",
"rows_for_plan": 800,
- "cost_for_plan": 204.1972656,
+ "cost_for_plan": 0.1669214,
"pruned_by_cost": true,
- "current_cost": 204.1972656,
- "best_cost": 26.02294779
+ "current_cost": 0.1669214,
+ "best_cost": 0.03061496
}
]
]
@@ -9595,7 +11298,7 @@ JS
"using_mrr": false,
"index_only": false,
"rows": 1,
- "cost": 1.357887479,
+ "cost": 0.002574553,
"chosen": true
}
],
@@ -9655,7 +11358,7 @@ JS
"using_mrr": false,
"index_only": true,
"rows": 1,
- "cost": 0.345829876,
+ "cost": 0.001478954,
"chosen": true
}
]
@@ -9678,28 +11381,35 @@ JS
[
[
{
- "plan_prefix":
- [],
+ "plan_prefix": "",
"get_costs_for_tables":
[
{
"best_access_path":
{
"table": "t1",
+ "plan_details":
+ {
+ "record_count": 1
+ },
"considered_access_paths":
[
{
"access_type": "scan",
- "resulting_rows": 10,
- "cost": 2.021972656,
+ "rows": 10,
+ "rows_after_filter": 10,
+ "rows_out": 10,
+ "cost": 0.01159965,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method":
{
"type": "scan",
- "records": 10,
- "cost": 2.021972656,
+ "rows_read": 10,
+ "rows_out": 10,
+ "cost": 0.01159965,
"uses_join_buffering": false
}
}
@@ -9708,12 +11418,19 @@ JS
"best_access_path":
{
"table": "t2",
+ "plan_details":
+ {
+ "record_count": 1
+ },
"considered_access_paths":
[
{
"access_type": "scan",
- "resulting_rows": 100,
- "cost": 2.219726562,
+ "rows": 100,
+ "rows_after_filter": 100,
+ "rows_out": 100,
+ "cost": 0.0256761,
+ "index_only": false,
"chosen": true,
"use_tmp_table": true
}
@@ -9721,8 +11438,9 @@ JS
"chosen_access_method":
{
"type": "scan",
- "records": 100,
- "cost": 2.219726562,
+ "rows_read": 100,
+ "rows_out": 100,
+ "cost": 0.0256761,
"uses_join_buffering": false
}
}
@@ -9730,22 +11448,24 @@ JS
]
},
{
- "plan_prefix":
- [],
+ "plan_prefix": "",
"table": "t1",
"rows_for_plan": 10,
- "cost_for_plan": 4.021972656,
+ "cost_for_plan": 0.01159965,
"rest_of_plan":
[
{
- "plan_prefix":
- ["t1"],
+ "plan_prefix": "t1",
"get_costs_for_tables":
[
{
"best_access_path":
{
"table": "t2",
+ "plan_details":
+ {
+ "record_count": 10
+ },
"considered_access_paths":
[
{
@@ -9754,21 +11474,21 @@ JS
"used_range_estimates": false,
"reason": "not available",
"rows": 1,
- "cost": 20.00585794,
+ "cost": 0.01840091,
"chosen": true
},
{
- "access_type": "scan",
- "resulting_rows": 100,
- "cost": 2.219726562,
- "chosen": false
+ "type": "scan",
+ "chosen": false,
+ "cause": "cost"
}
],
"chosen_access_method":
{
"type": "ref",
- "records": 1,
- "cost": 20.00585794,
+ "rows_read": 1,
+ "rows_out": 1,
+ "cost": 0.01840091,
"uses_join_buffering": false
}
}
@@ -9776,32 +11496,33 @@ JS
]
},
{
- "plan_prefix":
- ["t1"],
+ "plan_prefix": "t1",
"table": "t2",
"rows_for_plan": 10,
- "cost_for_plan": 26.0278306,
- "cost_for_sorting": 10
+ "cost_for_plan": 0.03000056,
+ "cost_for_sorting": 0.006368384
}
]
},
{
- "plan_prefix":
- [],
+ "plan_prefix": "",
"table": "t2",
"rows_for_plan": 100,
- "cost_for_plan": 22.21972656,
+ "cost_for_plan": 0.0256761,
"rest_of_plan":
[
{
- "plan_prefix":
- ["t2"],
+ "plan_prefix": "t2",
"get_costs_for_tables":
[
{
"best_access_path":
{
"table": "t1",
+ "plan_details":
+ {
+ "record_count": 100
+ },
"considered_access_paths":
[
{
@@ -9810,21 +11531,26 @@ JS
"used_range_estimates": false,
"reason": "not available",
"rows": 1,
- "cost": 200.0585794,
+ "cost": 0.1821659,
"chosen": true
},
{
- "access_type": "scan",
- "resulting_rows": 10,
- "cost": 2.021972656,
+ "access_type": "scan_with_join_cache",
+ "rows": 10,
+ "rows_after_filter": 10,
+ "rows_out": 1,
+ "cost": 0.11055225,
+ "cost_without_join_buffer": 1.159965,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method":
{
"type": "scan",
- "records": 10,
- "cost": 2.021972656,
+ "rows_read": 10,
+ "rows_out": 1,
+ "cost": 0.11055225,
"uses_join_buffering": true
}
}
@@ -9832,14 +11558,13 @@ JS
]
},
{
- "plan_prefix":
- ["t2"],
+ "plan_prefix": "t2",
"table": "t1",
- "rows_for_plan": 1000,
- "cost_for_plan": 224.2416992,
+ "rows_for_plan": 100,
+ "cost_for_plan": 0.13622835,
"pruned_by_cost": true,
- "current_cost": 224.2416992,
- "best_cost": 36.0278306
+ "current_cost": 0.13622835,
+ "best_cost": 0.036368944
}
]
}
@@ -9923,6 +11648,7 @@ drop table t1;
# (on optimized builds)
#
CREATE TABLE t1( a INT, b INT, PRIMARY KEY( a ) );
+insert t1 values (2,3);
SELECT sum(b), row_number() OVER (order by b) FROM t1 WHERE a = 101;
sum(b) row_number() OVER (order by b)
NULL 1
@@ -9938,8 +11664,8 @@ JS
"rowid_ordered": true,
"using_mrr": false,
"index_only": false,
- "rows": 0,
- "cost": 0.145,
+ "rows": 1,
+ "cost": 0.002483968,
"chosen": true
}
]
@@ -10087,6 +11813,16 @@ UPDATE t, v SET t.b = t.a, t.a = v.c WHERE v.c < t.a {
},
{
"join_preparation": {
+ "select_id": "fake",
+ "steps": [
+ {
+ "expanded_query": "select c AS c from dual"
+ }
+ ]
+ }
+ },
+ {
+ "join_preparation": {
"select_id": 1,
"steps": [
{
@@ -10156,14 +11892,16 @@ UPDATE t, v SET t.b = t.a, t.a = v.c WHERE v.c < t.a {
"table": "t",
"table_scan": {
"rows": 2,
- "cost": 2.004394531
+ "read_cost": 0.01028441,
+ "read_and_compare_cost": 0.01034841
}
},
{
"table": "<derived2>",
"table_scan": {
"rows": 2,
- "cost": 2
+ "read_cost": 0.012350033,
+ "read_and_compare_cost": 0.012418701
}
}
]
@@ -10171,23 +11909,30 @@ UPDATE t, v SET t.b = t.a, t.a = v.c WHERE v.c < t.a {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 2,
- "cost": 2.004394531,
+ "rows": 2,
+ "rows_after_filter": 2,
+ "rows_out": 2,
+ "cost": 0.01034841,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 2,
- "cost": 2.004394531,
+ "rows_read": 2,
+ "rows_out": 2,
+ "cost": 0.01034841,
"uses_join_buffering": false
}
}
@@ -10195,18 +11940,25 @@ UPDATE t, v SET t.b = t.a, t.a = v.c WHERE v.c < t.a {
{
"best_access_path": {
"table": "<derived2>",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 2,
- "cost": 2,
+ "rows": 2,
+ "rows_after_filter": 2,
+ "rows_out": 2,
+ "cost": 0.012418701,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 2,
- "cost": 2,
+ "rows_read": 2,
+ "rows_out": 2,
+ "cost": 0.012418701,
"uses_join_buffering": false
}
}
@@ -10214,29 +11966,37 @@ UPDATE t, v SET t.b = t.a, t.a = v.c WHERE v.c < t.a {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t",
"rows_for_plan": 2,
- "cost_for_plan": 2.404394531,
+ "cost_for_plan": 0.01034841,
"rest_of_plan": [
{
- "plan_prefix": ["t"],
+ "plan_prefix": "t",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "<derived2>",
+ "plan_details": {
+ "record_count": 2
+ },
"considered_access_paths": [
{
- "access_type": "scan",
- "resulting_rows": 2,
- "cost": 2,
+ "access_type": "scan_with_join_cache",
+ "rows": 2,
+ "rows_after_filter": 2,
+ "rows_out": 2,
+ "cost": 0.012911897,
+ "cost_without_join_buffer": 0.024837402,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 2,
- "cost": 2,
+ "rows_read": 2,
+ "rows_out": 2,
+ "cost": 0.012911897,
"uses_join_buffering": true
}
}
@@ -10244,58 +12004,26 @@ UPDATE t, v SET t.b = t.a, t.a = v.c WHERE v.c < t.a {
]
},
{
- "plan_prefix": ["t"],
+ "plan_prefix": "t",
"table": "<derived2>",
"rows_for_plan": 4,
- "cost_for_plan": 5.204394531
+ "cost_for_plan": 0.023260307
}
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "<derived2>",
"rows_for_plan": 2,
- "cost_for_plan": 2.4,
- "rest_of_plan": [
- {
- "plan_prefix": ["<derived2>"],
- "get_costs_for_tables": [
- {
- "best_access_path": {
- "table": "t",
- "considered_access_paths": [
- {
- "access_type": "scan",
- "resulting_rows": 2,
- "cost": 2.004394531,
- "chosen": true
- }
- ],
- "chosen_access_method": {
- "type": "scan",
- "records": 2,
- "cost": 2.004394531,
- "uses_join_buffering": true
- }
- }
- }
- ]
- },
- {
- "plan_prefix": ["<derived2>"],
- "table": "t",
- "rows_for_plan": 4,
- "cost_for_plan": 5.204394531,
- "pruned_by_cost": true,
- "current_cost": 5.204394531,
- "best_cost": 5.204394531
- }
- ]
+ "cost_for_plan": 0.012418701,
+ "pruned_by_heuristic": true
}
]
},
{
- "best_join_order": ["t", "<derived2>"]
+ "best_join_order": ["t", "<derived2>"],
+ "rows": 4,
+ "cost": 0.023260307
},
{
"substitute_best_equal": {
@@ -10309,14 +12037,17 @@ UPDATE t, v SET t.b = t.a, t.a = v.c WHERE v.c < t.a {
"attached_conditions_summary": [
{
"table": "t",
- "attached": null
+ "attached_condition": null
},
{
"table": "<derived2>",
- "attached": "v.c < t.a"
+ "attached_condition": "v.c < t.a"
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -10338,16 +12069,6 @@ UPDATE t, v SET t.b = t.a, t.a = v.c WHERE v.c < t.a {
}
},
{
- "join_preparation": {
- "select_id": "fake",
- "steps": [
- {
- "expanded_query": "select c AS c from dual"
- }
- ]
- }
- },
- {
"join_optimization": {
"select_id": "fake",
"steps": [
@@ -10367,7 +12088,8 @@ UPDATE t, v SET t.b = t.a, t.a = v.c WHERE v.c < t.a {
"table": "union",
"table_scan": {
"rows": 2,
- "cost": 10.1
+ "read_cost": 0.010020701,
+ "read_and_compare_cost": 0.010084701
}
}
]
@@ -10375,23 +12097,30 @@ UPDATE t, v SET t.b = t.a, t.a = v.c WHERE v.c < t.a {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "union",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 2,
- "cost": 10.1,
+ "rows": 2,
+ "rows_after_filter": 2,
+ "rows_out": 2,
+ "cost": 0.010084701,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 2,
- "cost": 10.1,
+ "rows_read": 2,
+ "rows_out": 2,
+ "cost": 0.010084701,
"uses_join_buffering": false
}
}
@@ -10399,15 +12128,17 @@ UPDATE t, v SET t.b = t.a, t.a = v.c WHERE v.c < t.a {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "union",
"rows_for_plan": 2,
- "cost_for_plan": 10.5
+ "cost_for_plan": 0.010084701
}
]
},
{
- "best_join_order": ["union"]
+ "best_join_order": ["union"],
+ "rows": 2,
+ "cost": 0.010084701
},
{
"attaching_conditions_to_tables": {
@@ -10415,10 +12146,13 @@ UPDATE t, v SET t.b = t.a, t.a = v.c WHERE v.c < t.a {
"attached_conditions_summary": [
{
"table": "union",
- "attached": null
+ "attached_condition": null
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -10533,14 +12267,20 @@ JS
"spl_pd_boundary": 2,
"split_plan_search":
[],
- "lead_table": "t10",
- "index": "grp_id",
- "parts": 1,
- "split_sel": 0.001,
- "cost": 2535.968504,
- "unsplit_cost": 253440.0075,
- "records": 100,
- "chosen": true
+ "split_materialized":
+ {
+ "table": "t10",
+ "key": "grp_id",
+ "org_cost": 1.159965,
+ "postjoin_cost": 4.020888502,
+ "one_splitting_cost": 5.180853502,
+ "unsplit_postjoin_cost": 32.78652054,
+ "unsplit_cost": 148.7830205,
+ "rows": 100,
+ "refills": 5,
+ "total_splitting_cost": 25.90426751,
+ "chosen": true
+ }
}
]
drop table t1,t2,t3,t10,t11;
@@ -10608,7 +12348,8 @@ select count(*) from seq_1_to_10000000 {
"table": "seq_1_to_10000000",
"table_scan": {
"rows": 10000000,
- "cost": 10000000
+ "read_cost": 124.7880673,
+ "read_and_compare_cost": 444.7880673
}
}
]
@@ -10616,23 +12357,30 @@ select count(*) from seq_1_to_10000000 {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "seq_1_to_10000000",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 10000000,
- "cost": 10000000,
+ "rows": 10000000,
+ "rows_after_filter": 10000000,
+ "rows_out": 10000000,
+ "cost": 444.7880673,
+ "index_only": true,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 10000000,
- "cost": 10000000,
+ "rows_read": 10000000,
+ "rows_out": 10000000,
+ "cost": 444.7880673,
"uses_join_buffering": false
}
}
@@ -10640,15 +12388,17 @@ select count(*) from seq_1_to_10000000 {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "seq_1_to_10000000",
"rows_for_plan": 10000000,
- "cost_for_plan": 12000000
+ "cost_for_plan": 444.7880673
}
]
},
{
- "best_join_order": ["seq_1_to_10000000"]
+ "best_join_order": ["seq_1_to_10000000"],
+ "rows": 10000000,
+ "cost": 444.7880673
},
{
"attaching_conditions_to_tables": {
@@ -10656,10 +12406,13 @@ select count(*) from seq_1_to_10000000 {
"attached_conditions_summary": [
{
"table": "seq_1_to_10000000",
- "attached": null
+ "attached_condition": null
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -10687,7 +12440,7 @@ explain
select * from t1 left join (t2 join t3 on t3.pk=1000) on t2.a=t1.a and t2.pk is null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 const PRIMARY NULL NULL NULL 1 Impossible ON condition
-1 SIMPLE t2 const PRIMARY NULL NULL NULL 1 Impossible ON condition
+1 SIMPLE t2 const PRIMARY NULL NULL NULL 0 Impossible ON condition
1 SIMPLE t1 ALL NULL NULL NULL NULL 10
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.mark_join_nest_as_const'))
from information_schema.optimizer_trace;
@@ -10712,7 +12465,7 @@ set in_predicate_conversion_threshold=3;
explain select * from t0 where a in (1,2,3,4,5,6);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t0 ALL NULL NULL NULL NULL 10 Using where
-1 PRIMARY <derived3> ref key0 key0 4 test.t0.a 2 FirstMatch(t0)
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 4 test.t0.a 1
3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
select json_detailed(json_extract(trace, '$**.in_to_subquery_conversion'))
from information_schema.optimizer_trace;
@@ -10826,8 +12579,6 @@ S
{
"access_type": "ref",
"index": "PRIMARY",
- "rows": 1.79769e308,
- "cost": 1.79769e308,
"chosen": false,
"cause": "no predicate for first keypart"
}
@@ -10989,7 +12740,7 @@ on t1.a=t.a
where t1.b < 3;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 range idx_b idx_b 5 NULL 4 Using index condition; Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 2
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 1
2 LATERAL DERIVED t2 ref idx_a idx_a 5 test.t1.a 1
select
json_detailed(json_extract(trace, '$**.choose_best_splitting'))
@@ -11019,14 +12770,17 @@ json_detailed(json_extract(trace, '$**.choose_best_splitting'))
"considered_execution_plans":
[
{
- "plan_prefix":
- [],
+ "plan_prefix": "",
"get_costs_for_tables":
[
{
"best_access_path":
{
"table": "t2",
+ "plan_details":
+ {
+ "record_count": 1
+ },
"considered_access_paths":
[
{
@@ -11035,7 +12789,7 @@ json_detailed(json_extract(trace, '$**.choose_best_splitting'))
"used_range_estimates": false,
"reason": "not available",
"rows": 1.8367,
- "cost": 2.000585794,
+ "cost": 0.002051185,
"chosen": true
},
{
@@ -11047,8 +12801,9 @@ json_detailed(json_extract(trace, '$**.choose_best_splitting'))
"chosen_access_method":
{
"type": "ref",
- "records": 1.8367,
- "cost": 2.000585794,
+ "rows_read": 1.8367,
+ "rows_out": 1.8367,
+ "cost": 0.002051185,
"uses_join_buffering": false
}
}
@@ -11056,24 +12811,29 @@ json_detailed(json_extract(trace, '$**.choose_best_splitting'))
]
},
{
- "plan_prefix":
- [],
+ "plan_prefix": "",
"table": "t2",
"rows_for_plan": 1.8367,
- "cost_for_plan": 2.367925794,
- "cost_for_sorting": 1.8367
+ "cost_for_plan": 0.002051185,
+ "cost_for_sorting": 0.001155201
}
]
}
],
- "lead_table": "t2",
- "index": "idx_a",
- "parts": 1,
- "split_sel": 0.020407778,
- "cost": 2.488945919,
- "unsplit_cost": 25.72361682,
- "records": 1,
- "chosen": true
+ "split_materialized":
+ {
+ "table": "t2",
+ "key": "idx_a",
+ "org_cost": 0.002051185,
+ "postjoin_cost": 0.001135418,
+ "one_splitting_cost": 0.003186603,
+ "unsplit_postjoin_cost": 0.036032575,
+ "unsplit_cost": 0.060625425,
+ "rows": 1.8367,
+ "refills": 4,
+ "total_splitting_cost": 0.012746412,
+ "chosen": true
+ }
}
]
drop table t1,t2;
@@ -11122,3 +12882,926 @@ left(trace, 100)
set optimizer_trace='enabled=off';
# End of 10.6 tests
+#
+# Testing of records_out
+#
+set @save_optimizer_switch= @@optimizer_switch;
+set @save_use_stat_tables= @@use_stat_tables;
+set @save_histogram_size= @@histogram_size;
+set @save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
+set optimizer_switch='rowid_filter=on';
+set use_stat_tables='preferably';
+set histogram_size=127;
+create table t1 (a int, b int, c int, key(a),key(b));
+insert into t1 select seq, seq*2, seq/10 from seq_1_to_1000;
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
+explain select * from t1 where a<10 and b between 10 and 50 and c < 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range|filter a,b a|b 5|5 NULL 9 (2%) Using index condition; Using where; Using rowid filter
+QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES
+explain select * from t1 where a<10 and b between 10 and 50 and c < 10 {
+ "steps": [
+ {
+ "join_preparation": {
+ "select_id": 1,
+ "steps": [
+ {
+ "expanded_query": "select t1.a AS a,t1.b AS b,t1.c AS c from t1 where t1.a < 10 and t1.b between 10 and 50 and t1.c < 10"
+ }
+ ]
+ }
+ },
+ {
+ "join_optimization": {
+ "select_id": 1,
+ "steps": [
+ {
+ "condition_processing": {
+ "condition": "WHERE",
+ "original_condition": "t1.a < 10 and t1.b between 10 and 50 and t1.c < 10",
+ "steps": [
+ {
+ "transformation": "equality_propagation",
+ "resulting_condition": "t1.a < 10 and t1.b between 10 and 50 and t1.c < 10"
+ },
+ {
+ "transformation": "constant_propagation",
+ "resulting_condition": "t1.a < 10 and t1.b between 10 and 50 and t1.c < 10"
+ },
+ {
+ "transformation": "trivial_condition_removal",
+ "resulting_condition": "t1.a < 10 and t1.b between 10 and 50 and t1.c < 10"
+ }
+ ]
+ }
+ },
+ {
+ "table_dependencies": [
+ {
+ "table": "t1",
+ "row_may_be_null": false,
+ "map_bit": 0,
+ "depends_on_map_bits": []
+ }
+ ]
+ },
+ {
+ "ref_optimizer_key_uses": []
+ },
+ {
+ "rows_estimation": [
+ {
+ "table": "t1",
+ "range_analysis": {
+ "table_scan": {
+ "rows": 1000,
+ "cost": 0.1671618
+ },
+ "potential_range_indexes": [
+ {
+ "index": "a",
+ "usable": true,
+ "key_parts": ["a"]
+ },
+ {
+ "index": "b",
+ "usable": true,
+ "key_parts": ["b"]
+ }
+ ],
+ "setup_range_conditions": [],
+ "analyzing_range_alternatives": {
+ "range_scan_alternatives": [
+ {
+ "index": "a",
+ "ranges": ["(NULL) < (a) < (10)"],
+ "rowid_ordered": false,
+ "using_mrr": false,
+ "index_only": false,
+ "rows": 9,
+ "cost": 0.012445505,
+ "chosen": true
+ },
+ {
+ "index": "b",
+ "ranges": ["(10) <= (b) <= (50)"],
+ "rowid_ordered": false,
+ "using_mrr": false,
+ "index_only": false,
+ "rows": 21,
+ "cost": 0.027251933,
+ "chosen": false,
+ "cause": "cost"
+ }
+ ],
+ "analyzing_roworder_intersect": {
+ "cause": "too few roworder scans"
+ },
+ "analyzing_index_merge_union": []
+ },
+ "group_index_range": {
+ "chosen": false,
+ "cause": "no group by or distinct"
+ },
+ "chosen_range_access_summary": {
+ "range_access_plan": {
+ "type": "range_scan",
+ "index": "a",
+ "rows": 9,
+ "ranges": ["(NULL) < (a) < (10)"]
+ },
+ "rows_for_plan": 9,
+ "cost_for_plan": 0.012445505,
+ "chosen": true
+ }
+ }
+ },
+ {
+ "table": "t1",
+ "rowid_filters": [
+ {
+ "key": "a",
+ "build_cost": 0.001846537,
+ "rows": 9
+ },
+ {
+ "key": "b",
+ "build_cost": 0.003322634,
+ "rows": 21
+ }
+ ]
+ },
+ {
+ "selectivity_for_indexes": [
+ {
+ "index_name": "a",
+ "selectivity_from_index": 0.009
+ },
+ {
+ "index_name": "b",
+ "selectivity_from_index": 0.021
+ }
+ ],
+ "selectivity_for_columns": [
+ {
+ "column_name": "c",
+ "ranges": ["NULL < c < 10"],
+ "selectivity_from_histogram": 0.094
+ }
+ ],
+ "cond_selectivity": 0.000017766
+ }
+ ]
+ },
+ {
+ "considered_execution_plans": [
+ {
+ "plan_prefix": "",
+ "get_costs_for_tables": [
+ {
+ "best_access_path": {
+ "table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
+ "considered_access_paths": [
+ {
+ "filter": {
+ "rowid_filter_index": "b",
+ "index_only_cost": 0.001605807,
+ "filter_startup_cost": 0.003322634,
+ "find_key_and_filter_lookup_cost": 6.695354e-4,
+ "filter_selectivity": 0.021,
+ "original_rows": 9,
+ "new_rows": 0.189,
+ "original_access_cost": 0.011607363,
+ "with_filter_access_cost": 0.002485375,
+ "original_found_rows_cost": 0.010001556,
+ "with_filter_found_rows_cost": 2.100327e-4,
+ "org_cost": 0.011895363,
+ "filter_cost": 0.005814057,
+ "filter_used": true
+ },
+ "access_type": "range",
+ "range_index": "a",
+ "rows": 9,
+ "rows_after_filter": 0.189,
+ "rows_out": 0.017766,
+ "cost": 0.006364199,
+ "chosen": true
+ }
+ ],
+ "chosen_access_method": {
+ "type": "range",
+ "rows_read": 0.189,
+ "rows_out": 0.017766,
+ "cost": 0.006364199,
+ "uses_join_buffering": false,
+ "rowid_filter_index": "b"
+ }
+ }
+ }
+ ]
+ },
+ {
+ "plan_prefix": "",
+ "table": "t1",
+ "rows_for_plan": 0.017766,
+ "cost_for_plan": 0.006364199,
+ "pushdown_cond_selectivity": 0.094,
+ "filtered": 0.1974,
+ "rows_out": 0.017766
+ }
+ ]
+ },
+ {
+ "best_join_order": ["t1"],
+ "rows": 0.017766,
+ "cost": 0.006364199
+ },
+ {
+ "table": "t1",
+ "range_analysis": {
+ "potential_range_indexes": [
+ {
+ "index": "a",
+ "usable": false,
+ "cause": "not applicable"
+ },
+ {
+ "index": "b",
+ "usable": true,
+ "key_parts": ["b"]
+ }
+ ],
+ "setup_range_conditions": [],
+ "analyzing_range_alternatives": {
+ "range_scan_alternatives": [
+ {
+ "index": "b",
+ "ranges": ["(10) <= (b) <= (50)"],
+ "rowid_ordered": false,
+ "using_mrr": false,
+ "index_only": true,
+ "rows": 21,
+ "cost": 0.004244354,
+ "chosen": true
+ }
+ ]
+ },
+ "chosen_range_access_summary": {
+ "range_access_plan": {
+ "type": "range_scan",
+ "index": "b",
+ "rows": 21,
+ "ranges": ["(10) <= (b) <= (50)"]
+ },
+ "rows_for_plan": 21,
+ "cost_for_plan": 0.004244354,
+ "chosen": true
+ }
+ }
+ },
+ {
+ "substitute_best_equal": {
+ "condition": "WHERE",
+ "resulting_condition": "t1.a < 10 and t1.b between 10 and 50 and t1.c < 10"
+ }
+ },
+ {
+ "attaching_conditions_to_tables": {
+ "attached_conditions_computation": [],
+ "attached_conditions_summary": [
+ {
+ "table": "t1",
+ "attached_condition": "t1.a < 10 and t1.b between 10 and 50 and t1.c < 10"
+ }
+ ]
+ }
+ },
+ {
+ "make_join_readinfo": [
+ {
+ "table": "t1",
+ "index_condition": "t1.a < 10",
+ "row_condition": "t1.b between 10 and 50 and t1.c < 10"
+ }
+ ]
+ }
+ ]
+ }
+ },
+ {
+ "join_execution": {
+ "select_id": 1,
+ "steps": []
+ }
+ }
+ ]
+} 0 0
+drop table t1;
+create table three (a int);
+insert into three values (1),(2),(3);
+create table t1 (a int, b int, c int, key(a),key(b));
+insert into t1 select mod(seq,10), seq, seq from seq_1_to_10000;
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
+set optimizer_use_condition_selectivity=2;
+explain format=json select * from three, t1 where t1.a=three.a and t1.b<5000 and t1.c<1000;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 2.662022424,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "three",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 3,
+ "cost": 0.010504815,
+ "filtered": 100,
+ "attached_condition": "three.a is not null"
+ }
+ },
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ref",
+ "possible_keys": ["a", "b"],
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "ref": ["test.three.a"],
+ "rowid_filter": {
+ "range": {
+ "key": "b",
+ "used_key_parts": ["b"]
+ },
+ "rows": 4312,
+ "selectivity_pct": 43.12
+ },
+ "loops": 3,
+ "rows": 1000,
+ "cost": 2.651517609,
+ "filtered": 43.11999893,
+ "attached_condition": "t1.b < 5000 and t1.c < 1000"
+ }
+ }
+ ]
+ }
+}
+set optimizer_use_condition_selectivity=4;
+explain format=json select * from three, t1 where t1.a=three.a and t1.b<5000 and t1.c<1000;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 1.712236739,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "three",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 3,
+ "cost": 0.010504815,
+ "filtered": 100
+ }
+ },
+ {
+ "block-nl-join": {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "possible_keys": ["a", "b"],
+ "loops": 3,
+ "rows": 10000,
+ "cost": 1.701731924,
+ "filtered": 3.230766058,
+ "attached_condition": "t1.b < 5000 and t1.c < 1000"
+ },
+ "buffer_type": "flat",
+ "buffer_size": "65",
+ "join_type": "BNL",
+ "attached_condition": "t1.a = three.a"
+ }
+ }
+ ]
+ }
+}
+QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES
+explain format=json select * from three, t1 where t1.a=three.a and t1.b<5000 and t1.c<1000 {
+ "steps": [
+ {
+ "join_preparation": {
+ "select_id": 1,
+ "steps": [
+ {
+ "expanded_query": "select three.a AS a,t1.a AS a,t1.b AS b,t1.c AS c from three join t1 where t1.a = three.a and t1.b < 5000 and t1.c < 1000"
+ }
+ ]
+ }
+ },
+ {
+ "join_optimization": {
+ "select_id": 1,
+ "steps": [
+ {
+ "condition_processing": {
+ "condition": "WHERE",
+ "original_condition": "t1.a = three.a and t1.b < 5000 and t1.c < 1000",
+ "steps": [
+ {
+ "transformation": "equality_propagation",
+ "resulting_condition": "t1.b < 5000 and t1.c < 1000 and multiple equal(t1.a, three.a)"
+ },
+ {
+ "transformation": "constant_propagation",
+ "resulting_condition": "t1.b < 5000 and t1.c < 1000 and multiple equal(t1.a, three.a)"
+ },
+ {
+ "transformation": "trivial_condition_removal",
+ "resulting_condition": "t1.b < 5000 and t1.c < 1000 and multiple equal(t1.a, three.a)"
+ }
+ ]
+ }
+ },
+ {
+ "table_dependencies": [
+ {
+ "table": "three",
+ "row_may_be_null": false,
+ "map_bit": 0,
+ "depends_on_map_bits": []
+ },
+ {
+ "table": "t1",
+ "row_may_be_null": false,
+ "map_bit": 1,
+ "depends_on_map_bits": []
+ }
+ ]
+ },
+ {
+ "ref_optimizer_key_uses": [
+ {
+ "table": "t1",
+ "index": "a",
+ "field": "a",
+ "equals": "three.a",
+ "null_rejecting": true
+ }
+ ]
+ },
+ {
+ "rows_estimation": [
+ {
+ "table": "three",
+ "table_scan": {
+ "rows": 3,
+ "read_cost": 0.010408815,
+ "read_and_compare_cost": 0.010504815
+ }
+ },
+ {
+ "table": "t1",
+ "range_analysis": {
+ "table_scan": {
+ "rows": 10000,
+ "cost": 1.581538
+ },
+ "potential_range_indexes": [
+ {
+ "index": "a",
+ "usable": false,
+ "cause": "not applicable"
+ },
+ {
+ "index": "b",
+ "usable": true,
+ "key_parts": ["b"]
+ }
+ ],
+ "setup_range_conditions": [],
+ "analyzing_range_alternatives": {
+ "range_scan_alternatives": [
+ {
+ "index": "b",
+ "ranges": ["(NULL) < (b) < (5000)"],
+ "rowid_ordered": false,
+ "using_mrr": false,
+ "index_only": false,
+ "rows": 4312,
+ "cost": 5.325149412,
+ "chosen": false,
+ "cause": "cost"
+ }
+ ],
+ "analyzing_roworder_intersect": {
+ "cause": "too few roworder scans"
+ },
+ "analyzing_index_merge_union": []
+ },
+ "group_index_range": {
+ "chosen": false,
+ "cause": "not single_table"
+ }
+ }
+ },
+ {
+ "table": "t1",
+ "rowid_filters": [
+ {
+ "key": "b",
+ "build_cost": 0.611957109,
+ "rows": 4312
+ }
+ ]
+ },
+ {
+ "selectivity_for_indexes": [
+ {
+ "index_name": "b",
+ "selectivity_from_index": 0.4312
+ }
+ ],
+ "selectivity_for_columns": [
+ {
+ "column_name": "c",
+ "ranges": ["NULL < c < 1000"],
+ "selectivity_from_histogram": 0.0999
+ }
+ ],
+ "cond_selectivity": 0.04307688
+ }
+ ]
+ },
+ {
+ "considered_execution_plans": [
+ {
+ "plan_prefix": "",
+ "get_costs_for_tables": [
+ {
+ "best_access_path": {
+ "table": "three",
+ "plan_details": {
+ "record_count": 1
+ },
+ "considered_access_paths": [
+ {
+ "access_type": "scan",
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
+ "index_only": false,
+ "chosen": true
+ }
+ ],
+ "chosen_access_method": {
+ "type": "scan",
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
+ "uses_join_buffering": false
+ }
+ }
+ },
+ {
+ "best_access_path": {
+ "table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
+ "considered_access_paths": [
+ {
+ "access_type": "scan",
+ "rows": 10000,
+ "rows_after_filter": 430.7688,
+ "rows_out": 430.7688,
+ "cost": 1.581538,
+ "index_only": false,
+ "chosen": true
+ }
+ ],
+ "chosen_access_method": {
+ "type": "scan",
+ "rows_read": 430.7688,
+ "rows_out": 430.7688,
+ "cost": 1.581538,
+ "uses_join_buffering": false
+ }
+ }
+ }
+ ]
+ },
+ {
+ "plan_prefix": "",
+ "table": "three",
+ "rows_for_plan": 3,
+ "cost_for_plan": 0.010504815,
+ "rest_of_plan": [
+ {
+ "plan_prefix": "three",
+ "get_costs_for_tables": [
+ {
+ "best_access_path": {
+ "table": "t1",
+ "plan_details": {
+ "record_count": 3
+ },
+ "considered_access_paths": [
+ {
+ "access_type": "ref",
+ "index": "a",
+ "used_range_estimates": false,
+ "reason": "not available",
+ "filter": {
+ "rowid_filter_index": "b",
+ "index_only_cost": 0.092096742,
+ "filter_startup_cost": 0.611957109,
+ "find_key_and_filter_lookup_cost": 0.094772697,
+ "filter_selectivity": 0.4312,
+ "original_rows": 1000,
+ "new_rows": 431.2,
+ "original_access_cost": 1.203380742,
+ "with_filter_access_cost": 0.6660551,
+ "original_found_rows_cost": 1.111284,
+ "with_filter_found_rows_cost": 0.479185661,
+ "org_cost": 3.706142226,
+ "filter_cost": 2.651517609,
+ "filter_used": true
+ },
+ "rows": 431.2,
+ "cost": 2.651517609,
+ "chosen": true
+ },
+ {
+ "access_type": "scan_with_join_cache",
+ "rows": 10000,
+ "rows_after_filter": 430.7688,
+ "rows_out": 323.0766,
+ "cost": 1.701731924,
+ "cost_without_join_buffer": 4.7319164,
+ "index_only": false,
+ "chosen": true
+ }
+ ],
+ "chosen_access_method": {
+ "type": "scan",
+ "rows_read": 430.7688,
+ "rows_out": 323.0766,
+ "cost": 1.701731924,
+ "uses_join_buffering": true
+ }
+ }
+ }
+ ]
+ },
+ {
+ "plan_prefix": "three",
+ "table": "t1",
+ "rows_for_plan": 969.2298,
+ "cost_for_plan": 1.712236739,
+ "pushdown_cond_selectivity": 0.75,
+ "filtered": 3.230766,
+ "rows_out": 323.0766
+ }
+ ]
+ },
+ {
+ "plan_prefix": "",
+ "table": "t1",
+ "rows_for_plan": 430.7688,
+ "cost_for_plan": 1.581538,
+ "pruned_by_heuristic": true
+ }
+ ]
+ },
+ {
+ "best_join_order": ["three", "t1"],
+ "rows": 969.2298,
+ "cost": 1.712236739
+ },
+ {
+ "substitute_best_equal": {
+ "condition": "WHERE",
+ "resulting_condition": "t1.a = three.a and t1.b < 5000 and t1.c < 1000"
+ }
+ },
+ {
+ "attaching_conditions_to_tables": {
+ "attached_conditions_computation": [
+ {
+ "table": "t1",
+ "range_analysis": {
+ "table_scan": {
+ "rows": 10000,
+ "cost": 1.581538
+ },
+ "potential_range_indexes": [
+ {
+ "index": "a",
+ "usable": true,
+ "key_parts": ["a"]
+ },
+ {
+ "index": "b",
+ "usable": true,
+ "key_parts": ["b"]
+ }
+ ],
+ "setup_range_conditions": [],
+ "analyzing_range_alternatives": {
+ "range_scan_alternatives": [
+ {
+ "index": "a"
+ },
+ {
+ "index": "b",
+ "ranges": ["(NULL) < (b) < (5000)"],
+ "rowid_ordered": false,
+ "using_mrr": false,
+ "index_only": false,
+ "rows": 4312,
+ "cost": 5.325149412,
+ "chosen": false,
+ "cause": "cost"
+ }
+ ],
+ "analyzing_roworder_intersect": {
+ "cause": "too few roworder scans"
+ },
+ "analyzing_index_merge_union": []
+ },
+ "group_index_range": {
+ "chosen": false,
+ "cause": "not single_table"
+ }
+ }
+ }
+ ],
+ "attached_conditions_summary": [
+ {
+ "table": "three",
+ "attached_condition": null
+ },
+ {
+ "table": "t1",
+ "attached_condition": "t1.a = three.a and t1.b < 5000 and t1.c < 1000"
+ }
+ ]
+ }
+ },
+ {
+ "make_join_readinfo": []
+ }
+ ]
+ }
+ },
+ {
+ "join_execution": {
+ "select_id": 1,
+ "steps": []
+ }
+ }
+ ]
+} 0 0
+drop table three, t1;
+#
+# MDEV-21095: Index condition push down is not reflected in optimizer trace
+#
+create table t10 (a int, b int, c int, key(a,b));
+insert into t10 select seq, seq, seq from seq_1_to_10000;
+explain format=json select * from t10 where a<3 and b!=5 and c<10;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.003808422,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t10",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 2,
+ "cost": 0.003808422,
+ "filtered": 100,
+ "index_condition": "t10.a < 3 and t10.b <> 5",
+ "attached_condition": "t10.c < 10"
+ }
+ }
+ ]
+ }
+}
+set optimizer_trace='enabled=on';
+select * from t10 where a<3 and b!=5 and c<10;
+a b c
+1 1 1
+2 2 2
+select json_detailed(json_extract(trace, '$**.attaching_conditions_to_tables')) as out1
+from information_schema.optimizer_trace;
+out1
+[
+ {
+ "attached_conditions_computation":
+ [],
+ "attached_conditions_summary":
+ [
+ {
+ "table": "t10",
+ "attached_condition": "t10.a < 3 and t10.b <> 5 and t10.c < 10"
+ }
+ ]
+ }
+]
+drop table t10;
+#
+# MDEV-21092: EXISTS to IN is not reflected in the optimizer trace
+#
+set optimizer_trace='enabled=on';
+create table t1 (cn_c int, cn_n char(10), cn_a int );
+create table t2 (ci_p int, ci_c int );
+create table t3 (ci_p int, ci_c int );
+SELECT cn_n FROM t1 WHERE (EXISTS (select 1 from t2 where ci_p > 100000 and cn_c = ci_c)
+OR (cn_n LIKE 'L%') )
+AND cn_a > 1000000;
+cn_n
+select
+json_detailed(
+json_extract(trace, '$.steps[*].join_optimization[0].steps[0].transformation')
+) as out1
+from information_schema.optimizer_trace;
+out1
+[
+ {
+ "select_id": 2,
+ "from": "EXISTS (SELECT)",
+ "to": "IN (SELECT)",
+ "upper_not": false
+ }
+]
+drop table t1, t2, t3;
+#
+# MDEV-29997 Partition Pruning not included in optimizer tracing
+#
+create table t2 (a int, b int) partition by hash(a) partitions 10;
+create table t3 (a int, b int) partition by hash(a) partitions 10;
+INSERT INTO t2 SELECT seq, seq from seq_1_to_10;
+INSERT INTO t3 SELECT seq, seq from seq_1_to_10;
+set optimizer_trace='enabled=on';
+explain partitions select * from t2,t3 where t2.a in (2,3,4) and t3.a in (4,5);
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t3 p4,p5 ALL NULL NULL NULL NULL 2 Using where
+1 SIMPLE t2 p2,p3,p4 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
+select json_detailed(json_extract(trace, '$**.prune_partitions')) as out1
+from information_schema.optimizer_trace;
+out1
+[
+ {
+ "table": "t2",
+ "used_partitions": "p2,p3,p4"
+ },
+ {
+ "table": "t3",
+ "used_partitions": "p4,p5"
+ }
+]
+drop table t2,t3;
+create table t1 (
+a int
+) partition by range (a)
+( partition p0 values less than(10),
+partition p1 values less than (20),
+partition p2 values less than (25)
+);
+insert into t1 values (5),(15),(22);
+explain select * from t1 where a = 28;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+select json_detailed(json_extract(trace, '$**.prune_partitions')) as out1
+from information_schema.optimizer_trace;
+out1
+[
+ {
+ "table": "t1",
+ "used_partitions": ""
+ }
+]
+drop table t1;
+set @@optimizer_switch= @save_optimizer_switch;
+set @@use_stat_tables= @save_use_stat_tables;
+set @@histogram_size= @save_histogram_size;
+set @@optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
diff --git a/mysql-test/main/opt_trace.test b/mysql-test/main/opt_trace.test
index 58a6b23d..b3a9c211 100644
--- a/mysql-test/main/opt_trace.test
+++ b/mysql-test/main/opt_trace.test
@@ -90,23 +90,7 @@ drop table t1,t2,t0;
--echo # group_by min max optimization
--echo #
CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, a INT NOT NULL, KEY(a));
---disable_query_log
-INSERT INTO t1(a) VALUES (1), (2), (3), (4);
-INSERT INTO t1(a) SELECT a FROM t1;
-INSERT INTO t1(a) SELECT a FROM t1;
-INSERT INTO t1(a) SELECT a FROM t1;
-INSERT INTO t1(a) SELECT a FROM t1;
-INSERT INTO t1(a) SELECT a FROM t1;
-INSERT INTO t1(a) SELECT a FROM t1;
-INSERT INTO t1(a) SELECT a FROM t1;
-INSERT INTO t1(a) SELECT a FROM t1;
-INSERT INTO t1(a) SELECT a FROM t1;
-INSERT INTO t1(a) SELECT a FROM t1;
-INSERT INTO t1(a) SELECT a FROM t1;
-INSERT INTO t1(a) SELECT a FROM t1;
-INSERT INTO t1(a) SELECT a FROM t1;
-INSERT INTO t1(a) SELECT a FROM t1;
---enable_query_log
+insert into t1 select seq, mod(seq,4)+1 from seq_1_to_65536;
analyze table t1;
EXPLAIN SELECT DISTINCT a FROM t1;
@@ -120,6 +104,7 @@ CREATE TABLE t1 (a INT, b INT, c int, d int, KEY(a,b,c,d));
INSERT INTO t1 VALUES (1,1,1,1), (2,2,2,2), (3,3,3,3), (4,4,4,4), (1,0,1,1), (3,2,3,3), (4,5,4,4);
ANALYZE TABLE t1;
EXPLAIN SELECT MIN(d) FROM t1 where b=2 and c=3 group by a;
+set statement optimizer_scan_setup_cost=0 for EXPLAIN SELECT MIN(d) FROM t1 where b=2 and c=3 group by a;
select * from information_schema.OPTIMIZER_TRACE;
DROP TABLE t1;
@@ -143,30 +128,27 @@ drop table t1;
--echo # Late ORDER BY optimization
--echo #
-create table ten(a int);
-insert into ten values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-create table one_k(a int primary key);
-insert into one_k select A.a + B.a* 10 + C.a * 100 from ten A, ten B, ten C;
create table t1 (
pk int not null,
a int,
b int,
c int,
filler char(100),
- KEY a_a(c),
+ KEY c(c),
KEY a_c(a,c),
KEY a_b(a,b)
);
-insert into t1
-select a, a,a,a, 'filler-dataaa' from test.one_k;
+insert into t1 select seq, seq,seq,seq, 'filler-dataaa' from seq_0_to_999;
update t1 set a=1 where pk between 0 and 180;
update t1 set b=2 where pk between 0 and 20;
analyze table t1;
+explain select * from t1 where a=1 and b=2 order by c limit 1;
+update t1 set b=2 where pk between 20 and 40;
set optimizer_trace='enabled=on';
explain select * from t1 where a=1 and b=2 order by c limit 1;
select * from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
-drop table t1,ten,one_k;
+drop table t1;
--echo #
--echo # TABLE ELIMINATION
@@ -206,34 +188,23 @@ drop table t0, t1, t2, t3;
--echo # IN subquery to sem-join is traced
--echo #
-create table t0 (a int);
-insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-
create table t1(a int, b int);
-insert into t1 values (0,0),(1,1),(2,2);
-create table t2 as select * from t1;
+insert into t1 select seq,seq from seq_0_to_3;
-create table t11(a int, b int);
-
-create table t10 (pk int, a int);
-insert into t10 select a,a from t0;
-create table t12 like t10;
-insert into t12 select * from t10;
-
-analyze table t1,t10;
+create table t2 (p int, a int);
+insert into t2 select seq,seq from seq_1_to_10;
set optimizer_trace='enabled=on';
-explain extended select * from t1 where a in (select pk from t10);
+explain extended select * from t1 where a in (select p from t2);
+insert into t2 select seq,seq from seq_10_to_100;
+explain extended select * from t1 where a in (select p from t2);
select * from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
-drop table t0,t1,t11,t10,t12,t2;
+drop table t1,t2;
--echo #
--echo # Selectivities for columns and indexes.
--echo #
-create table t0 (a int);
-insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-
create table t1 (
pk int,
a int,
@@ -241,7 +212,7 @@ b int,
key pk(pk),
key pk_a(pk,a),
key pk_a_b(pk,a,b));
-insert into t1 select a,a,a from t0;
+insert into t1 select seq,seq,seq from seq_0_to_9;
ANALYZE TABLE t1 PERSISTENT FOR COLUMNS (a,b) INDEXES ();
set @save_optimizer_use_condition_selectivity=@@optimizer_use_condition_selectivity;
@@ -253,7 +224,7 @@ explain select * from t1 where pk = 2 and a=5 and b=1;
select * from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set @@use_stat_tables= @save_use_stat_tables;
-drop table t0,t1;
+drop table t1;
set optimizer_trace="enabled=off";
--echo #
@@ -629,6 +600,7 @@ drop table t1;
--echo #
CREATE TABLE t1( a INT, b INT, PRIMARY KEY( a ) );
+insert t1 values (2,3);
SELECT sum(b), row_number() OVER (order by b) FROM t1 WHERE a = 101;
UPDATE t1 SET b=10 WHERE a=1;
SELECT JSON_DETAILED(JSON_EXTRACT(trace, '$**.range_scan_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
@@ -1066,3 +1038,108 @@ set optimizer_trace='enabled=off';
--echo # End of 10.6 tests
+
+--echo #
+--echo # Testing of records_out
+--echo #
+
+set @save_optimizer_switch= @@optimizer_switch;
+set @save_use_stat_tables= @@use_stat_tables;
+set @save_histogram_size= @@histogram_size;
+set @save_optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
+set optimizer_switch='rowid_filter=on';
+set use_stat_tables='preferably';
+set histogram_size=127;
+create table t1 (a int, b int, c int, key(a),key(b));
+insert into t1 select seq, seq*2, seq/10 from seq_1_to_1000;
+analyze table t1;
+--optimizer_trace
+explain select * from t1 where a<10 and b between 10 and 50 and c < 10;
+drop table t1;
+
+create table three (a int);
+insert into three values (1),(2),(3);
+create table t1 (a int, b int, c int, key(a),key(b));
+insert into t1 select mod(seq,10), seq, seq from seq_1_to_10000;
+analyze table t1;
+
+set optimizer_use_condition_selectivity=2;
+explain format=json select * from three, t1 where t1.a=three.a and t1.b<5000 and t1.c<1000;
+set optimizer_use_condition_selectivity=4;
+--optimizer_trace
+explain format=json select * from three, t1 where t1.a=three.a and t1.b<5000 and t1.c<1000;
+
+drop table three, t1;
+
+--echo #
+--echo # MDEV-21095: Index condition push down is not reflected in optimizer trace
+--echo #
+create table t10 (a int, b int, c int, key(a,b));
+insert into t10 select seq, seq, seq from seq_1_to_10000;
+explain format=json select * from t10 where a<3 and b!=5 and c<10;
+set optimizer_trace='enabled=on';
+select * from t10 where a<3 and b!=5 and c<10;
+select json_detailed(json_extract(trace, '$**.attaching_conditions_to_tables')) as out1
+from information_schema.optimizer_trace;
+drop table t10;
+
+--echo #
+--echo # MDEV-21092: EXISTS to IN is not reflected in the optimizer trace
+--echo #
+# EXISTS-to-IN conversion is traced on PREPARE so won't be visible with a VIEW:
+--disable_view_protocol
+set optimizer_trace='enabled=on';
+
+create table t1 (cn_c int, cn_n char(10), cn_a int );
+create table t2 (ci_p int, ci_c int );
+create table t3 (ci_p int, ci_c int );
+
+--disable_ps2_protocol
+SELECT cn_n FROM t1 WHERE (EXISTS (select 1 from t2 where ci_p > 100000 and cn_c = ci_c)
+ OR (cn_n LIKE 'L%') )
+ AND cn_a > 1000000;
+--enable_ps2_protocol
+
+select
+ json_detailed(
+ json_extract(trace, '$.steps[*].join_optimization[0].steps[0].transformation')
+ ) as out1
+from information_schema.optimizer_trace;
+
+--enable_view_protocol
+drop table t1, t2, t3;
+
+--echo #
+--echo # MDEV-29997 Partition Pruning not included in optimizer tracing
+--echo #
+--source include/have_partition.inc
+create table t2 (a int, b int) partition by hash(a) partitions 10;
+create table t3 (a int, b int) partition by hash(a) partitions 10;
+INSERT INTO t2 SELECT seq, seq from seq_1_to_10;
+INSERT INTO t3 SELECT seq, seq from seq_1_to_10;
+
+set optimizer_trace='enabled=on';
+explain partitions select * from t2,t3 where t2.a in (2,3,4) and t3.a in (4,5);
+select json_detailed(json_extract(trace, '$**.prune_partitions')) as out1
+from information_schema.optimizer_trace;
+drop table t2,t3;
+
+create table t1 (
+ a int
+) partition by range (a)
+( partition p0 values less than(10),
+ partition p1 values less than (20),
+ partition p2 values less than (25)
+);
+insert into t1 values (5),(15),(22);
+
+explain select * from t1 where a = 28;
+select json_detailed(json_extract(trace, '$**.prune_partitions')) as out1
+from information_schema.optimizer_trace;
+drop table t1;
+
+set @@optimizer_switch= @save_optimizer_switch;
+set @@use_stat_tables= @save_use_stat_tables;
+set @@histogram_size= @save_histogram_size;
+set @@optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
+
diff --git a/mysql-test/main/opt_trace_index_merge.result b/mysql-test/main/opt_trace_index_merge.result
index d0f171bf..c07240cc 100644
--- a/mysql-test/main/opt_trace_index_merge.result
+++ b/mysql-test/main/opt_trace_index_merge.result
@@ -73,7 +73,7 @@ explain select * from t1 where a=1 or b=1 {
"range_analysis": {
"table_scan": {
"rows": 1000,
- "cost": 231.5878906
+ "cost": 0.1729314
},
"potential_range_indexes": [
{
@@ -98,7 +98,9 @@ explain select * from t1 where a=1 or b=1 {
"analyzing_roworder_intersect": {
"cause": "too few roworder scans"
},
- "analyzing_sort_intersect": {},
+ "analyzing_sort_intersect": {
+ "cutoff_cost": 0.1729314
+ },
"analyzing_index_merge_union": [
{
"indexes_to_merge": [
@@ -111,12 +113,12 @@ explain select * from t1 where a=1 or b=1 {
"using_mrr": false,
"index_only": true,
"rows": 1,
- "cost": 0.345585794,
+ "cost": 0.001478954,
"chosen": true
}
],
"index_to_merge": "a",
- "cumulated_cost": 0.345585794
+ "cumulated_cost": 0.001478954
},
{
"range_scan_alternatives": [
@@ -127,15 +129,15 @@ explain select * from t1 where a=1 or b=1 {
"using_mrr": false,
"index_only": true,
"rows": 1,
- "cost": 0.345585794,
+ "cost": 0.001478954,
"chosen": true
}
],
"index_to_merge": "b",
- "cumulated_cost": 0.691171589
+ "cumulated_cost": 0.002957908
}
],
- "cost_of_reading_ranges": 0.691171589,
+ "cost_of_reading_ranges": 0.002957908,
"use_roworder_union": true,
"cause": "always cheaper than non roworder retrieval",
"analyzing_roworder_scans": [
@@ -158,7 +160,7 @@ explain select * from t1 where a=1 or b=1 {
}
}
],
- "index_roworder_union_cost": 2.484903732,
+ "index_roworder_union_cost": 0.005185782,
"members": 2,
"chosen": true
}
@@ -187,13 +189,17 @@ explain select * from t1 where a=1 or b=1 {
]
},
"rows_for_plan": 2,
- "cost_for_plan": 2.484903732,
+ "cost_for_plan": 0.005185782,
"chosen": true
}
}
},
{
- "selectivity_for_indexes": [],
+ "selectivity_for_indexes": [
+ {
+ "use_opt_range_condition_rows_selectivity": 0.002
+ }
+ ],
"selectivity_for_columns": [],
"cond_selectivity": 0.002
}
@@ -202,23 +208,29 @@ explain select * from t1 where a=1 or b=1 {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "index_merge",
- "resulting_rows": 2,
- "cost": 2.484903732,
+ "rows": 2,
+ "rows_after_filter": 2,
+ "rows_out": 2,
+ "cost": 0.005185782,
"chosen": true
}
],
"chosen_access_method": {
"type": "index_merge",
- "records": 2,
- "cost": 2.484903732,
+ "rows_read": 2,
+ "rows_out": 2,
+ "cost": 0.005185782,
"uses_join_buffering": false
}
}
@@ -226,15 +238,17 @@ explain select * from t1 where a=1 or b=1 {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t1",
"rows_for_plan": 2,
- "cost_for_plan": 2.884903732
+ "cost_for_plan": 0.005185782
}
]
},
{
- "best_join_order": ["t1"]
+ "best_join_order": ["t1"],
+ "rows": 2,
+ "cost": 0.005185782
},
{
"substitute_best_equal": {
@@ -248,10 +262,13 @@ explain select * from t1 where a=1 or b=1 {
"attached_conditions_summary": [
{
"table": "t1",
- "attached": "t1.a = 1 or t1.b = 1"
+ "attached_condition": "t1.a = 1 or t1.b = 1"
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -315,7 +332,7 @@ set optimizer_trace='enabled=on';
# 3-way ROR-intersection
explain select key1,key2,key3 from t1 where key1=100 and key2=100 and key3=100;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index_merge key1,key2,key3 key1,key2,key3 5,5,5 NULL 2 Using intersect(key1,key2,key3); Using where; Using index
+1 SIMPLE t1 index_merge key1,key2,key3 key1,key2 5,5 NULL 77 Using intersect(key1,key2); Using where
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
JS
[
@@ -330,7 +347,7 @@ JS
"using_mrr": false,
"index_only": false,
"rows": 2243,
- "cost": 2700.058937,
+ "cost": 2.770351251,
"chosen": true
},
{
@@ -341,7 +358,7 @@ JS
"using_mrr": false,
"index_only": false,
"rows": 2243,
- "cost": 2700.058937,
+ "cost": 2.770351251,
"chosen": false,
"cause": "cost"
},
@@ -353,7 +370,7 @@ JS
"using_mrr": false,
"index_only": false,
"rows": 2243,
- "cost": 2700.058937,
+ "cost": 2.770351251,
"chosen": false,
"cause": "cost"
}
@@ -364,10 +381,10 @@ JS
[
{
"index": "key1",
- "index_scan_cost": 10.31393703,
- "cumulated_index_scan_cost": 10.31393703,
- "disk_sweep_cost": 1923.144061,
- "cumulative_total_cost": 1933.457998,
+ "index_scan_cost": 0.240986767,
+ "cumulated_index_scan_cost": 0.240986767,
+ "disk_sweep_cost": 2.564386012,
+ "cumulative_total_cost": 2.805372779,
"usable": true,
"matching_rows_now": 2243,
"intersect_covering_with_this_index": false,
@@ -375,10 +392,10 @@ JS
},
{
"index": "key2",
- "index_scan_cost": 10.31393703,
- "cumulated_index_scan_cost": 20.62787405,
- "disk_sweep_cost": 84.51771758,
- "cumulative_total_cost": 105.1455916,
+ "index_scan_cost": 0.240986767,
+ "cumulated_index_scan_cost": 0.481973534,
+ "disk_sweep_cost": 0.089164506,
+ "cumulative_total_cost": 0.57113804,
"usable": true,
"matching_rows_now": 77.6360508,
"intersect_covering_with_this_index": false,
@@ -386,14 +403,15 @@ JS
},
{
"index": "key3",
- "index_scan_cost": 10.31393703,
- "cumulated_index_scan_cost": 30.94181108,
+ "index_scan_cost": 0.240986767,
+ "cumulated_index_scan_cost": 0.722960301,
"disk_sweep_cost": 0,
- "cumulative_total_cost": 30.94181108,
+ "cumulative_total_cost": 0.722960301,
"usable": true,
"matching_rows_now": 2.687185191,
"intersect_covering_with_this_index": true,
- "chosen": true
+ "chosen": false,
+ "cause": "does not reduce cost"
}
],
"clustered_pk":
@@ -401,9 +419,9 @@ JS
"clustered_pk_added_to_intersect": false,
"cause": "no clustered pk index"
},
- "rows": 2,
- "cost": 30.94181108,
- "covering": true,
+ "rows": 77,
+ "cost": 0.573622393,
+ "covering": false,
"chosen": true
},
"analyzing_index_merge_union":
@@ -417,9 +435,9 @@ JS
"range_access_plan":
{
"type": "index_roworder_intersect",
- "rows": 2,
- "cost": 30.94181108,
- "covering": true,
+ "rows": 77,
+ "cost": 0.573622393,
+ "covering": false,
"clustered_pk_scan": false,
"intersect_of":
[
@@ -436,18 +454,11 @@ JS
"rows": 2243,
"ranges":
["(100) <= (key2) <= (100)"]
- },
- {
- "type": "range_scan",
- "index": "key3",
- "rows": 2243,
- "ranges":
- ["(100) <= (key3) <= (100)"]
}
]
},
- "rows_for_plan": 2,
- "cost_for_plan": 30.94181108,
+ "rows_for_plan": 77,
+ "cost_for_plan": 0.573622393,
"chosen": true
}
]
@@ -481,7 +492,7 @@ JS
"using_mrr": false,
"index_only": true,
"rows": 2243,
- "cost": 457.058937,
+ "cost": 0.312922694,
"chosen": true
},
{
@@ -492,13 +503,13 @@ JS
"using_mrr": false,
"index_only": true,
"rows": 2243,
- "cost": 457.058937,
+ "cost": 0.312922694,
"chosen": false,
"cause": "cost"
}
],
"index_to_merge": "key1",
- "cumulated_cost": 457.058937
+ "cumulated_cost": 0.312922694
},
{
"range_scan_alternatives":
@@ -511,7 +522,7 @@ JS
"using_mrr": false,
"index_only": true,
"rows": 2243,
- "cost": 457.058937,
+ "cost": 0.312922694,
"chosen": true
},
{
@@ -522,16 +533,16 @@ JS
"using_mrr": false,
"index_only": true,
"rows": 2243,
- "cost": 457.058937,
+ "cost": 0.312922694,
"chosen": false,
"cause": "cost"
}
],
"index_to_merge": "key3",
- "cumulated_cost": 914.1178741
+ "cumulated_cost": 0.625845388
}
],
- "cost_of_reading_ranges": 914.1178741,
+ "cost_of_reading_ranges": 0.625845388,
"use_roworder_union": true,
"cause": "always cheaper than non roworder retrieval",
"analyzing_roworder_scans":
@@ -548,10 +559,10 @@ JS
[
{
"index": "key1",
- "index_scan_cost": 10.31393703,
- "cumulated_index_scan_cost": 10.31393703,
- "disk_sweep_cost": 1923.144061,
- "cumulative_total_cost": 1933.457998,
+ "index_scan_cost": 0.240986767,
+ "cumulated_index_scan_cost": 0.240986767,
+ "disk_sweep_cost": 2.564386012,
+ "cumulative_total_cost": 2.805372779,
"usable": true,
"matching_rows_now": 2243,
"intersect_covering_with_this_index": false,
@@ -559,10 +570,10 @@ JS
},
{
"index": "key2",
- "index_scan_cost": 10.31393703,
- "cumulated_index_scan_cost": 20.62787405,
- "disk_sweep_cost": 84.51771758,
- "cumulative_total_cost": 105.1455916,
+ "index_scan_cost": 0.240986767,
+ "cumulated_index_scan_cost": 0.481973534,
+ "disk_sweep_cost": 0.089164506,
+ "cumulative_total_cost": 0.57113804,
"usable": true,
"matching_rows_now": 77.6360508,
"intersect_covering_with_this_index": false,
@@ -575,7 +586,7 @@ JS
"cause": "no clustered pk index"
},
"rows": 77,
- "cost": 105.1455916,
+ "cost": 0.573622393,
"covering": false,
"chosen": true
}
@@ -592,10 +603,10 @@ JS
[
{
"index": "key3",
- "index_scan_cost": 10.31393703,
- "cumulated_index_scan_cost": 10.31393703,
- "disk_sweep_cost": 1923.144061,
- "cumulative_total_cost": 1933.457998,
+ "index_scan_cost": 0.240986767,
+ "cumulated_index_scan_cost": 0.240986767,
+ "disk_sweep_cost": 2.564386012,
+ "cumulative_total_cost": 2.805372779,
"usable": true,
"matching_rows_now": 2243,
"intersect_covering_with_this_index": false,
@@ -603,10 +614,10 @@ JS
},
{
"index": "key4",
- "index_scan_cost": 10.31393703,
- "cumulated_index_scan_cost": 20.62787405,
- "disk_sweep_cost": 84.51771758,
- "cumulative_total_cost": 105.1455916,
+ "index_scan_cost": 0.240986767,
+ "cumulated_index_scan_cost": 0.481973534,
+ "disk_sweep_cost": 0.089164506,
+ "cumulative_total_cost": 0.57113804,
"usable": true,
"matching_rows_now": 77.6360508,
"intersect_covering_with_this_index": false,
@@ -619,13 +630,13 @@ JS
"cause": "no clustered pk index"
},
"rows": 77,
- "cost": 105.1455916,
+ "cost": 0.573622393,
"covering": false,
"chosen": true
}
}
],
- "index_roworder_union_cost": 194.9771115,
+ "index_roworder_union_cost": 1.135493366,
"members": 2,
"chosen": true
}
@@ -644,7 +655,7 @@ JS
{
"type": "index_roworder_intersect",
"rows": 77,
- "cost": 105.1455916,
+ "cost": 0.573622393,
"covering": false,
"clustered_pk_scan": false,
"intersect_of":
@@ -668,7 +679,7 @@ JS
{
"type": "index_roworder_intersect",
"rows": 77,
- "cost": 105.1455916,
+ "cost": 0.573622393,
"covering": false,
"clustered_pk_scan": false,
"intersect_of":
@@ -692,7 +703,7 @@ JS
]
},
"rows_for_plan": 154,
- "cost_for_plan": 194.9771115,
+ "cost_for_plan": 1.135493366,
"chosen": true
}
]
diff --git a/mysql-test/main/opt_trace_index_merge_innodb.result b/mysql-test/main/opt_trace_index_merge_innodb.result
index adb9cd5d..02509aa9 100644
--- a/mysql-test/main/opt_trace_index_merge_innodb.result
+++ b/mysql-test/main/opt_trace_index_merge_innodb.result
@@ -89,7 +89,7 @@ explain select * from t1 where pk1 != 0 and key1 = 1 {
"range_analysis": {
"table_scan": {
"rows": 1000,
- "cost": 206
+ "cost": 0.1764192
},
"potential_range_indexes": [
{
@@ -118,8 +118,9 @@ explain select * from t1 where pk1 != 0 and key1 = 1 {
"using_mrr": false,
"index_only": false,
"rows": 1000,
- "cost": 204.27,
- "chosen": true
+ "cost": 0.19598856,
+ "chosen": false,
+ "cause": "cost"
},
{
"index": "key1",
@@ -128,7 +129,7 @@ explain select * from t1 where pk1 != 0 and key1 = 1 {
"using_mrr": false,
"index_only": false,
"rows": 1,
- "cost": 1.345146475,
+ "cost": 0.00424968,
"chosen": true
}
],
@@ -136,10 +137,10 @@ explain select * from t1 where pk1 != 0 and key1 = 1 {
"intersecting_indexes": [
{
"index": "key1",
- "index_scan_cost": 1.000146475,
- "cumulated_index_scan_cost": 1.000146475,
- "disk_sweep_cost": 1.004153686,
- "cumulative_total_cost": 2.004300162,
+ "index_scan_cost": 0.001661605,
+ "cumulated_index_scan_cost": 0.001661605,
+ "disk_sweep_cost": 0.00171364,
+ "cumulative_total_cost": 0.003375245,
"usable": true,
"matching_rows_now": 1,
"intersect_covering_with_this_index": false,
@@ -151,7 +152,7 @@ explain select * from t1 where pk1 != 0 and key1 = 1 {
"cause": "cost"
},
"chosen": false,
- "cause": "cost"
+ "cause": "too few indexes to merge"
},
"analyzing_index_merge_union": []
},
@@ -167,7 +168,7 @@ explain select * from t1 where pk1 != 0 and key1 = 1 {
"ranges": ["(1) <= (key1) <= (1)"]
},
"rows_for_plan": 1,
- "cost_for_plan": 1.345146475,
+ "cost_for_plan": 0.00424968,
"chosen": true
}
}
@@ -177,7 +178,7 @@ explain select * from t1 where pk1 != 0 and key1 = 1 {
"rowid_filters": [
{
"key": "key1",
- "build_cost": 0.130146475,
+ "build_cost": 0.001763258,
"rows": 1
}
]
@@ -201,18 +202,21 @@ explain select * from t1 where pk1 != 0 and key1 = 1 {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "ref",
"index": "key1",
"used_range_estimates": true,
"rows": 1,
- "cost": 1.125146475,
+ "cost": 0.00345856,
"chosen": true
},
{
@@ -223,8 +227,9 @@ explain select * from t1 where pk1 != 0 and key1 = 1 {
],
"chosen_access_method": {
"type": "ref",
- "records": 1,
- "cost": 1.125146475,
+ "rows_read": 1,
+ "rows_out": 1,
+ "cost": 0.00345856,
"uses_join_buffering": false
}
}
@@ -232,15 +237,17 @@ explain select * from t1 where pk1 != 0 and key1 = 1 {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t1",
"rows_for_plan": 1,
- "cost_for_plan": 1.325146475
+ "cost_for_plan": 0.00345856
}
]
},
{
- "best_join_order": ["t1"]
+ "best_join_order": ["t1"],
+ "rows": 1,
+ "cost": 0.00345856
},
{
"substitute_best_equal": {
@@ -254,10 +261,18 @@ explain select * from t1 where pk1 != 0 and key1 = 1 {
"attached_conditions_summary": [
{
"table": "t1",
- "attached": "t1.pk1 <> 0"
+ "attached_condition": "t1.pk1 <> 0"
}
]
}
+ },
+ {
+ "make_join_readinfo": [
+ {
+ "table": "t1",
+ "index_condition": "t1.pk1 <> 0"
+ }
+ ]
}
]
}
diff --git a/mysql-test/main/opt_trace_security.result b/mysql-test/main/opt_trace_security.result
index 48ca5c5e..cf5dcf5d 100644
--- a/mysql-test/main/opt_trace_security.result
+++ b/mysql-test/main/opt_trace_security.result
@@ -80,7 +80,8 @@ select * from db1.t1 {
"table": "t1",
"table_scan": {
"rows": 3,
- "cost": 2.005126953
+ "read_cost": 0.010408815,
+ "read_and_compare_cost": 0.010504815
}
}
]
@@ -88,23 +89,30 @@ select * from db1.t1 {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
"uses_join_buffering": false
}
}
@@ -112,15 +120,17 @@ select * from db1.t1 {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t1",
"rows_for_plan": 3,
- "cost_for_plan": 2.605126953
+ "cost_for_plan": 0.010504815
}
]
},
{
- "best_join_order": ["t1"]
+ "best_join_order": ["t1"],
+ "rows": 3,
+ "cost": 0.010504815
},
{
"attaching_conditions_to_tables": {
@@ -128,10 +138,13 @@ select * from db1.t1 {
"attached_conditions_summary": [
{
"table": "t1",
- "attached": null
+ "attached_condition": null
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
@@ -184,7 +197,7 @@ select * from db1.v1 {
}
},
{
- "expanded_query": "/* select#1 */ select db1.t1.a AS a from v1"
+ "expanded_query": "/* select#1 */ select v1.a AS a from v1"
}
]
}
@@ -209,7 +222,8 @@ select * from db1.v1 {
"table": "t1",
"table_scan": {
"rows": 3,
- "cost": 2.005126953
+ "read_cost": 0.010408815,
+ "read_and_compare_cost": 0.010504815
}
}
]
@@ -217,23 +231,30 @@ select * from db1.v1 {
{
"considered_execution_plans": [
{
- "plan_prefix": [],
+ "plan_prefix": "",
"get_costs_for_tables": [
{
"best_access_path": {
"table": "t1",
+ "plan_details": {
+ "record_count": 1
+ },
"considered_access_paths": [
{
"access_type": "scan",
- "resulting_rows": 3,
- "cost": 2.005126953,
+ "rows": 3,
+ "rows_after_filter": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
+ "index_only": false,
"chosen": true
}
],
"chosen_access_method": {
"type": "scan",
- "records": 3,
- "cost": 2.005126953,
+ "rows_read": 3,
+ "rows_out": 3,
+ "cost": 0.010504815,
"uses_join_buffering": false
}
}
@@ -241,15 +262,17 @@ select * from db1.v1 {
]
},
{
- "plan_prefix": [],
+ "plan_prefix": "",
"table": "t1",
"rows_for_plan": 3,
- "cost_for_plan": 2.605126953
+ "cost_for_plan": 0.010504815
}
]
},
{
- "best_join_order": ["t1"]
+ "best_join_order": ["t1"],
+ "rows": 3,
+ "cost": 0.010504815
},
{
"attaching_conditions_to_tables": {
@@ -257,10 +280,13 @@ select * from db1.v1 {
"attached_conditions_summary": [
{
"table": "t1",
- "attached": null
+ "attached_condition": null
}
]
}
+ },
+ {
+ "make_join_readinfo": []
}
]
}
diff --git a/mysql-test/main/opt_trace_selectivity.result b/mysql-test/main/opt_trace_selectivity.result
new file mode 100644
index 00000000..d6abad79
--- /dev/null
+++ b/mysql-test/main/opt_trace_selectivity.result
@@ -0,0 +1,369 @@
+create or replace table t1 (a int, b int, c int, key(a,c), key(b,c), key (c,b)) engine=aria;
+insert into t1 select seq/100+1, mod(seq,10), mod(seq,15) from seq_1_to_10000;
+insert into t1 select seq/100+1, mod(seq,10), 10 from seq_1_to_1000;
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+select count(*) from t1 where a=2;
+count(*)
+200
+select count(*) from t1 where b=5;
+count(*)
+1100
+select count(*) from t1 where c=5;
+count(*)
+667
+select count(*) from t1 where c=10;
+count(*)
+1667
+select count(*) from t1 where a=2 and b=5;
+count(*)
+20
+select count(*) from t1 where c=10 and b=5;
+count(*)
+433
+select count(*) from t1 where c=5 and b=5;
+count(*)
+334
+set optimizer_trace="enabled=on";
+select count(*) from t1 where a=2 and b=5 and c=10;
+count(*)
+14
+set @trace=(select trace from INFORMATION_SCHEMA.OPTIMIZER_TRACE);
+select
+JSON_DETAILED(
+JSON_EXTRACT(
+JSON_EXTRACT(@trace, '$**.considered_execution_plans'),
+'$[0]'
+ )
+) as JS;
+JS
+[
+ {
+ "plan_prefix": "",
+ "get_costs_for_tables":
+ [
+ {
+ "best_access_path":
+ {
+ "table": "t1",
+ "plan_details":
+ {
+ "record_count": 1
+ },
+ "considered_access_paths":
+ [
+ {
+ "access_type": "ref",
+ "index": "a",
+ "used_range_estimates": true,
+ "rows": 104,
+ "cost": 0.060988785,
+ "chosen": true
+ },
+ {
+ "access_type": "ref",
+ "index": "b",
+ "used_range_estimates": true,
+ "rows": 340,
+ "cost": 0.141618657,
+ "chosen": false,
+ "cause": "cost"
+ },
+ {
+ "access_type": "ref",
+ "index": "c",
+ "used_range_estimates": true,
+ "rows": 632,
+ "cost": 0.241826241,
+ "chosen": false,
+ "cause": "cost"
+ },
+ {
+ "access_type": "index_merge",
+ "rows": 7,
+ "rows_after_filter": 7,
+ "rows_out": 7,
+ "cost": 0.045367017,
+ "chosen": true
+ }
+ ],
+ "chosen_access_method":
+ {
+ "type": "index_merge",
+ "rows_read": 7,
+ "rows_out": 7,
+ "cost": 0.045367017,
+ "uses_join_buffering": false
+ }
+ }
+ }
+ ]
+ },
+ {
+ "plan_prefix": "",
+ "table": "t1",
+ "rows_for_plan": 7,
+ "cost_for_plan": 0.045367017
+ }
+]
+select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.selectivity_for_indexes')) as JS;
+JS
+[
+ [
+ {
+ "index_name": "a",
+ "selectivity_from_index": 0.009454545
+ },
+ {
+ "index_name": "b",
+ "selectivity_from_index": 0.1
+ },
+ {
+ "use_opt_range_condition_rows_selectivity": 6.363636e-4
+ }
+ ]
+]
+select count(*) from t1 where a=2 and b=5 and c=5;
+count(*)
+3
+set @trace=(select trace from INFORMATION_SCHEMA.OPTIMIZER_TRACE);
+select
+JSON_DETAILED(
+JSON_EXTRACT(
+JSON_EXTRACT(@trace, '$**.considered_execution_plans'),
+'$[0]'
+ )
+) as JS;
+JS
+[
+ {
+ "plan_prefix": "",
+ "get_costs_for_tables":
+ [
+ {
+ "best_access_path":
+ {
+ "table": "t1",
+ "plan_details":
+ {
+ "record_count": 1
+ },
+ "considered_access_paths":
+ [
+ {
+ "access_type": "ref",
+ "index": "a",
+ "used_range_estimates": true,
+ "rows": 6,
+ "cost": 0.005388489,
+ "chosen": true
+ },
+ {
+ "access_type": "ref",
+ "index": "b",
+ "used_range_estimates": true,
+ "rows": 232,
+ "cost": 0.104720241,
+ "chosen": false,
+ "cause": "cost"
+ },
+ {
+ "access_type": "ref",
+ "index": "c",
+ "used_range_estimates": true,
+ "rows": 293,
+ "cost": 0.125561013,
+ "chosen": false,
+ "cause": "cost"
+ },
+ {
+ "type": "scan",
+ "chosen": false,
+ "cause": "cost"
+ }
+ ],
+ "chosen_access_method":
+ {
+ "type": "ref",
+ "rows_read": 6,
+ "rows_out": 0.6,
+ "cost": 0.005388489,
+ "uses_join_buffering": false
+ }
+ }
+ }
+ ]
+ },
+ {
+ "plan_prefix": "",
+ "table": "t1",
+ "rows_for_plan": 0.6,
+ "cost_for_plan": 0.005388489,
+ "pushdown_cond_selectivity": 0.1,
+ "filtered": 10,
+ "rows_out": 0.6
+ }
+]
+select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.selectivity_for_indexes')) as JS;
+JS
+[
+ [
+ {
+ "index_name": "a",
+ "selectivity_from_index": 5.454545e-4
+ },
+ {
+ "index_name": "b",
+ "selectivity_from_index": 0.1
+ }
+ ]
+]
+# Ensure that we only use selectivity from non used index for simple cases
+select count(*) from t1 where (a=2 and b= 5);
+count(*)
+20
+select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_indexes')) as JS
+from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
+JS
+[
+ [
+ {
+ "index_name": "a",
+ "selectivity_from_index": 0.017545455
+ },
+ {
+ "index_name": "b",
+ "selectivity_from_index": 0.073181818
+ }
+ ]
+]
+# All of the following should have selectivity=1 for index 'b'
+select count(*) from t1 where (a=2 and b between 0 and 100);
+count(*)
+200
+select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_indexes')) as JS
+from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
+JS
+[
+ [
+ {
+ "index_name": "a",
+ "selectivity_from_index": 0.017545455
+ },
+ {
+ "index_name": "b",
+ "selectivity_from_index": 1
+ }
+ ]
+]
+select count(*) from t1 where (a in (2,3) and b between 0 and 100);
+count(*)
+400
+select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_indexes')) as JS
+from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
+JS
+[
+ [
+ {
+ "index_name": "a",
+ "selectivity_from_index": 0.035090909
+ },
+ {
+ "index_name": "b",
+ "selectivity_from_index": 1
+ }
+ ]
+]
+select count(*) from t1 where (a>2 and b between 0 and 100);
+count(*)
+10702
+select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_indexes')) as JS
+from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
+JS
+[
+ [
+ {
+ "index_name": "a",
+ "selectivity_from_index": 0.973909091
+ },
+ {
+ "index_name": "b",
+ "selectivity_from_index": 1
+ }
+ ]
+]
+select count(*) from t1 where (a>=2 and b between 0 and 100);
+count(*)
+10902
+select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_indexes')) as JS
+from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
+JS
+[
+ [
+ {
+ "index_name": "a",
+ "selectivity_from_index": 0.991454545
+ },
+ {
+ "index_name": "b",
+ "selectivity_from_index": 1
+ }
+ ]
+]
+select count(*) from t1 where (a<=2 and b between 0 and 100);
+count(*)
+298
+select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_indexes')) as JS
+from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
+JS
+[
+ [
+ {
+ "index_name": "a",
+ "selectivity_from_index": 0.026181818
+ },
+ {
+ "index_name": "b",
+ "selectivity_from_index": 1
+ }
+ ]
+]
+select count(*) from t1 where (a<2 and b between 0 and 100);
+count(*)
+98
+select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_indexes')) as JS
+from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
+JS
+[
+ [
+ {
+ "index_name": "a",
+ "selectivity_from_index": 0.008636364
+ },
+ {
+ "index_name": "b",
+ "selectivity_from_index": 1
+ }
+ ]
+]
+select count(*) from t1 where (a between 2 and 3 and b between 0 and 100);
+count(*)
+400
+select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_indexes')) as JS
+from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
+JS
+[
+ [
+ {
+ "index_name": "a",
+ "selectivity_from_index": 0.035090909
+ },
+ {
+ "index_name": "b",
+ "selectivity_from_index": 1
+ }
+ ]
+]
+drop table t1;
+set optimizer_trace='enabled=off';
diff --git a/mysql-test/main/opt_trace_selectivity.test b/mysql-test/main/opt_trace_selectivity.test
new file mode 100644
index 00000000..40f78d91
--- /dev/null
+++ b/mysql-test/main/opt_trace_selectivity.test
@@ -0,0 +1,86 @@
+--source include/have_sequence.inc
+--source include/not_embedded.inc
+
+#
+# Test changes in calculate_cond_selectivity_for_table()
+#
+create or replace table t1 (a int, b int, c int, key(a,c), key(b,c), key (c,b)) engine=aria;
+insert into t1 select seq/100+1, mod(seq,10), mod(seq,15) from seq_1_to_10000;
+insert into t1 select seq/100+1, mod(seq,10), 10 from seq_1_to_1000;
+optimize table t1;
+
+select count(*) from t1 where a=2;
+select count(*) from t1 where b=5;
+select count(*) from t1 where c=5;
+select count(*) from t1 where c=10;
+select count(*) from t1 where a=2 and b=5;
+select count(*) from t1 where c=10 and b=5;
+select count(*) from t1 where c=5 and b=5;
+
+set optimizer_trace="enabled=on";
+select count(*) from t1 where a=2 and b=5 and c=10;
+
+set @trace=(select trace from INFORMATION_SCHEMA.OPTIMIZER_TRACE);
+
+# The second JSON_EXTRACT is for --view-protocol which wraps every select:
+select
+ JSON_DETAILED(
+ JSON_EXTRACT(
+ JSON_EXTRACT(@trace, '$**.considered_execution_plans'),
+ '$[0]'
+ )
+ ) as JS;
+
+select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.selectivity_for_indexes')) as JS;
+
+select count(*) from t1 where a=2 and b=5 and c=5;
+set @trace=(select trace from INFORMATION_SCHEMA.OPTIMIZER_TRACE);
+
+# The second JSON_EXTRACT is for --view-protocol which wraps every select:
+select
+ JSON_DETAILED(
+ JSON_EXTRACT(
+ JSON_EXTRACT(@trace, '$**.considered_execution_plans'),
+ '$[0]'
+ )
+ ) as JS;
+select JSON_DETAILED(JSON_EXTRACT(@trace, '$**.selectivity_for_indexes')) as JS;
+
+--echo # Ensure that we only use selectivity from non used index for simple cases
+
+
+select count(*) from t1 where (a=2 and b= 5);
+select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_indexes')) as JS
+from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
+
+--echo # All of the following should have selectivity=1 for index 'b'
+select count(*) from t1 where (a=2 and b between 0 and 100);
+select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_indexes')) as JS
+from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
+
+select count(*) from t1 where (a in (2,3) and b between 0 and 100);
+select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_indexes')) as JS
+from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
+
+select count(*) from t1 where (a>2 and b between 0 and 100);
+select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_indexes')) as JS
+from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
+
+select count(*) from t1 where (a>=2 and b between 0 and 100);
+select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_indexes')) as JS
+from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
+
+select count(*) from t1 where (a<=2 and b between 0 and 100);
+select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_indexes')) as JS
+from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
+
+select count(*) from t1 where (a<2 and b between 0 and 100);
+select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_indexes')) as JS
+from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
+
+select count(*) from t1 where (a between 2 and 3 and b between 0 and 100);
+select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_indexes')) as JS
+from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
+
+drop table t1;
+set optimizer_trace='enabled=off';
diff --git a/mysql-test/main/opt_trace_ucs2.result b/mysql-test/main/opt_trace_ucs2.result
index dfb35731..2ea8d250 100644
--- a/mysql-test/main/opt_trace_ucs2.result
+++ b/mysql-test/main/opt_trace_ucs2.result
@@ -7,6 +7,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -16,7 +17,9 @@ EXPLAIN
"key": "col1",
"key_length": "21",
"used_key_parts": ["col1"],
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t1.col1 >= 'a'"
}
@@ -38,7 +41,7 @@ JS
"using_mrr": false,
"index_only": false,
"rows": 2,
- "cost": 2.547733708,
+ "cost": 0.003808422,
"chosen": true
}
],
diff --git a/mysql-test/main/opt_trace_ucs2.test b/mysql-test/main/opt_trace_ucs2.test
index eff7d960..f636215b 100644
--- a/mysql-test/main/opt_trace_ucs2.test
+++ b/mysql-test/main/opt_trace_ucs2.test
@@ -5,6 +5,7 @@ create or replace table t1 (col1 char(10) character set ucs2, filler char(100),
insert into t1 values ('a', 'a');
insert into t1 values ('a', 'a');
set optimizer_trace=1;
+--source include/explain-no-costs.inc
explain format=json select * from t1 force index(col1) where col1 >='a';
select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) AS JS from INFORMATION_SCHEMA.OPTIMIZER_TRACE;
drop table t1;
diff --git a/mysql-test/main/opt_tvc.result b/mysql-test/main/opt_tvc.result
index eaf75ed7..c08c68eb 100644
--- a/mysql-test/main/opt_tvc.result
+++ b/mysql-test/main/opt_tvc.result
@@ -46,12 +46,11 @@ a b
2 5
explain extended select * from t1 where a in (1,2);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1),(2)) `tvc_0`) where 1
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1),(2)) `tvc_0` join `test`.`t1` where `tvc_0`.`_col_1` = `test`.`t1`.`a`
explain extended select * from t1
where a in
(
@@ -59,12 +58,49 @@ select *
from (values (1),(2)) as tvc_0
);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
+3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1),(2)) `tvc_0` join `test`.`t1` where `tvc_0`.`1` = `test`.`t1`.`a`
+select * from t1 where a in (1,2,2,2,3,4,5,6,7);
+a b
+1 2
+4 6
+1 1
+2 5
+7 8
+select * from t1
+where a in
+(
+select *
+from (values (1),(2),(2),(2),(2),(3),(4),(5),(6),(7)) as tvc_0
+);
+a b
+1 2
+4 6
+1 1
+2 5
+7 8
+explain extended select * from t1 where a in (1,2,2,2,3,4,5,6,7);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
+3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1),(2),(2),(2),(3),(4),(5),(6),(7)) `tvc_0` join `test`.`t1` where `tvc_0`.`_col_1` = `test`.`t1`.`a`
+explain extended select * from t1
+where a in
+(
+select *
+from (values (1),(2),(2),(2),(2),(3),(4),(5),(6),(7)) as tvc_0
+);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1),(2)) `tvc_0`) where 1
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1),(2),(2),(2),(2),(3),(4),(5),(6),(7)) `tvc_0` join `test`.`t1` where `tvc_0`.`1` = `test`.`t1`.`a`
# AND-condition with IN-predicates in WHERE-part
select * from t1
where a in (1,2) and
@@ -90,15 +126,13 @@ explain extended select * from t1
where a in (1,2) and
b in (1,5);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-1 PRIMARY <subquery4> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
-4 MATERIALIZED <derived5> ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
+1 PRIMARY <derived5> eq_ref distinct_key distinct_key 4 test.t1.b 1 100.00
5 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1),(2)) `tvc_0`) semi join ((values (1),(5)) `tvc_1`) where 1
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1),(5)) `tvc_1` join (values (1),(2)) `tvc_0` join `test`.`t1` where `tvc_0`.`_col_1` = `test`.`t1`.`a` and `tvc_1`.`_col_1` = `test`.`t1`.`b`
explain extended select * from t1
where a in
(
@@ -111,15 +145,13 @@ select *
from (values (1),(5)) as tvc_1
);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-1 PRIMARY <subquery4> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
-4 MATERIALIZED <derived5> ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
+1 PRIMARY <derived5> eq_ref distinct_key distinct_key 4 test.t1.b 1 100.00
5 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1),(2)) `tvc_0`) semi join ((values (1),(5)) `tvc_1`) where 1
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1),(5)) `tvc_1` join (values (1),(2)) `tvc_0` join `test`.`t1` where `tvc_0`.`1` = `test`.`t1`.`a` and `tvc_1`.`1` = `test`.`t1`.`b`
# subquery with IN-predicate
select * from t1
where a in
@@ -150,11 +182,11 @@ from t2 where b in (3,4)
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED <derived4> ALL NULL NULL NULL NULL 2 100.00
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 6 100.00 Using where
+2 MATERIALIZED <derived4> eq_ref distinct_key distinct_key 4 test.t2.b 1 100.00
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (3),(4)) `tvc_0` join `test`.`t2`) where `test`.`t2`.`b` = `tvc_0`.`_col_1`
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (3),(4)) `tvc_0` join `test`.`t2`) where `tvc_0`.`_col_1` = `test`.`t2`.`b`
explain extended select * from t1
where a in
(
@@ -168,11 +200,11 @@ from (values (3),(4)) as tvc_0
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED <derived4> ALL NULL NULL NULL NULL 2 100.00
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 6 100.00 Using where
+2 MATERIALIZED <derived4> eq_ref distinct_key distinct_key 4 test.t2.b 1 100.00
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (3),(4)) `tvc_0` join `test`.`t2`) where `test`.`t2`.`b` = `tvc_0`.`3`
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (3),(4)) `tvc_0` join `test`.`t2`) where `tvc_0`.`3` = `test`.`t2`.`b`
# derived table with IN-predicate
select * from
(
@@ -206,12 +238,11 @@ from t1
where a in (1,2)
) as dr_table;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
-1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00
-3 MATERIALIZED <derived4> ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+1 PRIMARY <derived4> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1),(2)) `tvc_0`) where 1
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1),(2)) `tvc_0` join `test`.`t1` where `tvc_0`.`_col_1` = `test`.`t1`.`a`
explain extended select * from
(
select *
@@ -224,12 +255,11 @@ as tvc_0
)
) as dr_table;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
-1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00
-3 MATERIALIZED <derived4> ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+1 PRIMARY <derived4> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1),(2)) `tvc_0`) where 1
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1),(2)) `tvc_0` join `test`.`t1` where `tvc_0`.`1` = `test`.`t1`.`a`
# non-recursive CTE with IN-predicate
with tvc_0 as
(
@@ -265,12 +295,11 @@ where a in (1,2)
)
select * from tvc_0;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
-1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00
-3 MATERIALIZED <derived4> ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+1 PRIMARY <derived4> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 with tvc_0 as (/* select#2 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1),(2)) `tvc_0`) where `test`.`t1`.`a` in (1,2))/* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1),(2)) `tvc_0`) where 1
+Note 1003 with tvc_0 as (/* select#2 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (dual) join `test`.`t1` where `test`.`t1`.`a` in (1,2))/* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1),(2)) `tvc_0` join `test`.`t1` where `tvc_0`.`_col_1` = `test`.`t1`.`a`
explain extended select * from
(
select *
@@ -283,12 +312,11 @@ as tvc_0
)
) as dr_table;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
-1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00
-3 MATERIALIZED <derived4> ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+1 PRIMARY <derived4> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1),(2)) `tvc_0`) where 1
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1),(2)) `tvc_0` join `test`.`t1` where `tvc_0`.`1` = `test`.`t1`.`a`
# VIEW with IN-predicate
create view v1 as
select *
@@ -316,20 +344,18 @@ a b
2 5
explain extended select * from v1;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
-1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00
-3 MATERIALIZED <derived4> ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+1 PRIMARY <derived4> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1),(2)) `tvc_0`) where 1
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1),(2)) `tvc_0` join `test`.`t1` where `tvc_0`.`_col_1` = `test`.`t1`.`a`
explain extended select * from v2;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
-1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00
-3 MATERIALIZED <derived4> ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+1 PRIMARY <derived4> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1),(2)) `tvc_0`) where 1
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1),(2)) `tvc_0` join `test`.`t1` where `tvc_0`.`1` = `test`.`t1`.`a`
drop view v1,v2;
# subselect defined by derived table with IN-predicate
select * from t1
@@ -382,11 +408,11 @@ as dr_table
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED <derived5> ALL NULL NULL NULL NULL 2 100.00
-2 MATERIALIZED t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+2 MATERIALIZED <derived5> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
5 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1),(2)) `tvc_0` join `test`.`t1`) where `test`.`t1`.`a` = 1 and `test`.`t1`.`a` = `tvc_0`.`_col_1`
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1),(2)) `tvc_0` join `test`.`t1`) where `test`.`t1`.`a` = 1 and `tvc_0`.`_col_1` = `test`.`t1`.`a`
explain extended select * from t1
where a in
(
@@ -407,11 +433,11 @@ as dr_table
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED <derived5> ALL NULL NULL NULL NULL 2 100.00
-2 MATERIALIZED t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+2 MATERIALIZED <derived5> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
5 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1),(2)) `tvc_0` join `test`.`t1`) where `test`.`t1`.`a` = 1 and `test`.`t1`.`a` = `tvc_0`.`1`
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1),(2)) `tvc_0` join `test`.`t1`) where `test`.`t1`.`a` = 1 and `tvc_0`.`1` = `test`.`t1`.`a`
# derived table with IN-predicate and group by
select * from
(
@@ -444,13 +470,12 @@ where b in (3,5)
group by b
) as dr_table;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 12 100.00
-2 DERIVED t1 ALL NULL NULL NULL NULL 6 100.00 Using temporary; Using filesort
-2 DERIVED <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00
-3 MATERIALIZED <derived4> ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 6 100.00
+2 DERIVED t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using temporary; Using filesort
+2 DERIVED <derived4> eq_ref distinct_key distinct_key 4 test.t1.b 1 100.00
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `dr_table`.`max(a)` AS `max(a)`,`dr_table`.`b` AS `b` from (/* select#2 */ select max(`test`.`t1`.`a`) AS `max(a)`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (3),(5)) `tvc_0`) where 1 group by `test`.`t1`.`b`) `dr_table`
+Note 1003 /* select#1 */ select `dr_table`.`max(a)` AS `max(a)`,`dr_table`.`b` AS `b` from (/* select#2 */ select max(`test`.`t1`.`a`) AS `max(a)`,`test`.`t1`.`b` AS `b` from (values (3),(5)) `tvc_0` join `test`.`t1` where `tvc_0`.`_col_1` = `test`.`t1`.`b` group by `test`.`t1`.`b`) `dr_table`
explain extended select * from
(
select max(a),b
@@ -464,13 +489,12 @@ as tvc_0
group by b
) as dr_table;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 12 100.00
-2 DERIVED t1 ALL NULL NULL NULL NULL 6 100.00 Using temporary; Using filesort
-2 DERIVED <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00
-3 MATERIALIZED <derived4> ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 6 100.00
+2 DERIVED t1 ALL NULL NULL NULL NULL 6 100.00 Using where; Using temporary; Using filesort
+2 DERIVED <derived4> eq_ref distinct_key distinct_key 4 test.t1.b 1 100.00
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `dr_table`.`max(a)` AS `max(a)`,`dr_table`.`b` AS `b` from (/* select#2 */ select max(`test`.`t1`.`a`) AS `max(a)`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (3),(5)) `tvc_0`) where 1 group by `test`.`t1`.`b`) `dr_table`
+Note 1003 /* select#1 */ select `dr_table`.`max(a)` AS `max(a)`,`dr_table`.`b` AS `b` from (/* select#2 */ select max(`test`.`t1`.`a`) AS `max(a)`,`test`.`t1`.`b` AS `b` from (values (3),(5)) `tvc_0` join `test`.`t1` where `tvc_0`.`3` = `test`.`t1`.`b` group by `test`.`t1`.`b`) `dr_table`
# prepare statement
prepare stmt from "select * from t1 where a in (1,2)";
execute stmt;
@@ -506,12 +530,11 @@ a b
4 yq
explain extended select * from t3 where a in (1,4);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2 100.00
-1 PRIMARY t3 ref idx idx 5 tvc_0._col_1 3 100.00
-2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t3 ALL idx NULL NULL NULL 28 100.00 Using where
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 4 test.t3.a 1 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t3` semi join ((values (1),(4)) `tvc_0`) where `test`.`t3`.`a` = `tvc_0`.`_col_1`
+Note 1003 /* select#1 */ select `test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from (values (1),(4)) `tvc_0` join `test`.`t3` where `tvc_0`.`_col_1` = `test`.`t3`.`a`
# use vectors in IN predeicate
set @@in_predicate_conversion_threshold= 4;
select * from t1 where (a,b) in ((1,2),(3,4));
@@ -519,14 +542,13 @@ a b
1 2
explain extended select * from t1 where (a,b) in ((1,2),(3,4));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1 100.00
-2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 8 test.t1.a,test.t1.b 1 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1,2),(3,4)) `tvc_0`) where 1
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1,2),(3,4)) `tvc_0` join `test`.`t1` where `tvc_0`.`_col_1` = `test`.`t1`.`a` and `tvc_0`.`_col_2` = `test`.`t1`.`b`
set @@in_predicate_conversion_threshold= 2;
-# trasformation works for the one IN predicate and doesn't work for the other
+# transformation works for the one IN predicate and doesn't work for the other
set @@in_predicate_conversion_threshold= 5;
select * from t2
where (a,b) in ((1,2),(8,9)) and
@@ -539,11 +561,10 @@ where (a,b) in ((1,2),(8,9)) and
(a,c) in ((1,3),(8,0),(5,1));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 6 100.00 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1 100.00
-2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 3 100.00
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 8 test.t2.a,test.t2.c 1 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` semi join ((values (1,3),(8,0),(5,1)) `tvc_0`) where (`test`.`t2`.`a`,`test`.`t2`.`b`) in (<cache>((1,2)),<cache>((8,9)))
+Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from (values (1,3),(8,0),(5,1)) `tvc_0` join `test`.`t2` where `tvc_0`.`_col_1` = `test`.`t2`.`a` and `tvc_0`.`_col_2` = `test`.`t2`.`c` and (`test`.`t2`.`a`,`test`.`t2`.`b`) in (<cache>((1,2)),<cache>((8,9)))
set @@in_predicate_conversion_threshold= 2;
#
# mdev-14281: conversion of NOT IN predicate into subquery predicate
@@ -568,18 +589,18 @@ explain extended select * from t1
where (a,b) not in ((1,2),(8,9), (5,1));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
-2 DEPENDENT SUBQUERY <derived3> index_subquery key0 key0 8 func,func 2 100.00 Using where; Full scan on NULL key
+2 DEPENDENT SUBQUERY <derived3> unique_subquery distinct_key distinct_key 8 func,func 1 100.00 Using where; Full scan on NULL key
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where !<expr_cache><`test`.`t1`.`a`,`test`.`t1`.`b`>(<in_optimizer>((`test`.`t1`.`a`,`test`.`t1`.`b`),<exists>(<index_lookup>(<cache>(`test`.`t1`.`a`) in (temporary) on key0 where trigcond(<cache>(`test`.`t1`.`a`) = `tvc_0`.`_col_1`) and trigcond(<cache>(`test`.`t1`.`b`) = `tvc_0`.`_col_2`)))))
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where !<expr_cache><`test`.`t1`.`a`,`test`.`t1`.`b`>(<in_optimizer>((`test`.`t1`.`a`,`test`.`t1`.`b`),<exists>(<primary_index_lookup>(<cache>(`test`.`t1`.`a`) in <temporary table> on distinct_key where trigcond(<cache>(`test`.`t1`.`a`) = `tvc_0`.`_col_1`) and trigcond(<cache>(`test`.`t1`.`b`) = `tvc_0`.`_col_2`)))))
explain extended select * from t1
where (a,b) not in (select * from (values (1,2),(8,9), (5,1)) as tvc_0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
-2 DEPENDENT SUBQUERY <derived3> index_subquery key0 key0 8 func,func 2 100.00 Using where; Full scan on NULL key
+2 DEPENDENT SUBQUERY <derived3> unique_subquery distinct_key distinct_key 8 func,func 1 100.00 Using where; Full scan on NULL key
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where !<expr_cache><`test`.`t1`.`a`,`test`.`t1`.`b`>(<in_optimizer>((`test`.`t1`.`a`,`test`.`t1`.`b`),<exists>(<index_lookup>(<cache>(`test`.`t1`.`a`) in (temporary) on key0 where trigcond(<cache>(`test`.`t1`.`a`) = `tvc_0`.`1`) and trigcond(<cache>(`test`.`t1`.`b`) = `tvc_0`.`2`)))))
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where !<expr_cache><`test`.`t1`.`a`,`test`.`t1`.`b`>(<in_optimizer>((`test`.`t1`.`a`,`test`.`t1`.`b`),<exists>(<primary_index_lookup>(<cache>(`test`.`t1`.`a`) in <temporary table> on distinct_key where trigcond(<cache>(`test`.`t1`.`a`) = `tvc_0`.`1`) and trigcond(<cache>(`test`.`t1`.`b`) = `tvc_0`.`2`)))))
select * from t1
where b < 7 and (a,b) not in ((1,2),(8,9), (5,1));
a b
@@ -590,10 +611,10 @@ explain extended select * from t1
where b < 7 and (a,b) not in ((1,2),(8,9), (5,1));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
-2 DEPENDENT SUBQUERY <derived3> index_subquery key0 key0 8 func,func 2 100.00 Using where; Full scan on NULL key
+2 DEPENDENT SUBQUERY <derived3> unique_subquery distinct_key distinct_key 8 func,func 1 100.00 Using where; Full scan on NULL key
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` < 7 and !<expr_cache><`test`.`t1`.`a`,`test`.`t1`.`b`>(<in_optimizer>((`test`.`t1`.`a`,`test`.`t1`.`b`),<exists>(<index_lookup>(<cache>(`test`.`t1`.`a`) in (temporary) on key0 where trigcond(<cache>(`test`.`t1`.`a`) = `tvc_0`.`_col_1`) and trigcond(<cache>(`test`.`t1`.`b`) = `tvc_0`.`_col_2`)))))
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` < 7 and !<expr_cache><`test`.`t1`.`a`,`test`.`t1`.`b`>(<in_optimizer>((`test`.`t1`.`a`,`test`.`t1`.`b`),<exists>(<primary_index_lookup>(<cache>(`test`.`t1`.`a`) in <temporary table> on distinct_key where trigcond(<cache>(`test`.`t1`.`a`) = `tvc_0`.`_col_1`) and trigcond(<cache>(`test`.`t1`.`b`) = `tvc_0`.`_col_2`)))))
select * from t2
where (a,c) not in ((1,2),(8,9), (5,1));
a b c
@@ -606,10 +627,10 @@ explain extended select * from t2
where (a,c) not in ((1,2),(8,9), (5,1));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 6 100.00 Using where
-2 DEPENDENT SUBQUERY <derived3> index_subquery key0 key0 8 func,func 2 100.00 Using where; Full scan on NULL key
+2 DEPENDENT SUBQUERY <derived3> unique_subquery distinct_key distinct_key 8 func,func 1 100.00 Using where; Full scan on NULL key
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where !<expr_cache><`test`.`t2`.`a`,`test`.`t2`.`c`>(<in_optimizer>((`test`.`t2`.`a`,`test`.`t2`.`c`),<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in (temporary) on key0 where trigcond(<cache>(`test`.`t2`.`a`) = `tvc_0`.`_col_1`) and trigcond(<cache>(`test`.`t2`.`c`) = `tvc_0`.`_col_2`)))))
+Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where !<expr_cache><`test`.`t2`.`a`,`test`.`t2`.`c`>(<in_optimizer>((`test`.`t2`.`a`,`test`.`t2`.`c`),<exists>(<primary_index_lookup>(<cache>(`test`.`t2`.`a`) in <temporary table> on distinct_key where trigcond(<cache>(`test`.`t2`.`a`) = `tvc_0`.`_col_1`) and trigcond(<cache>(`test`.`t2`.`c`) = `tvc_0`.`_col_2`)))))
drop table t1, t2, t3;
set @@in_predicate_conversion_threshold= default;
#
diff --git a/mysql-test/main/opt_tvc.test b/mysql-test/main/opt_tvc.test
index e08f0a3f..d6761884 100644
--- a/mysql-test/main/opt_tvc.test
+++ b/mysql-test/main/opt_tvc.test
@@ -54,6 +54,23 @@ eval $optimized_query;
eval explain extended $query;
eval explain extended $optimized_query;
+
+let $query= select * from t1 where a in (1,2,2,2,3,4,5,6,7);
+
+let $optimized_query=
+select * from t1
+where a in
+ (
+ select *
+ from (values (1),(2),(2),(2),(2),(3),(4),(5),(6),(7)) as tvc_0
+ );
+
+eval $query;
+eval $optimized_query;
+eval explain extended $query;
+eval explain extended $optimized_query;
+
+
--echo # AND-condition with IN-predicates in WHERE-part
let $query=
@@ -276,7 +293,7 @@ eval $query;
eval explain extended $query;
set @@in_predicate_conversion_threshold= 2;
---echo # trasformation works for the one IN predicate and doesn't work for the other
+--echo # transformation works for the one IN predicate and doesn't work for the other
set @@in_predicate_conversion_threshold= 5;
diff --git a/mysql-test/main/optimizer_costs.result b/mysql-test/main/optimizer_costs.result
new file mode 100644
index 00000000..797c6172
--- /dev/null
+++ b/mysql-test/main/optimizer_costs.result
@@ -0,0 +1,347 @@
+select table_name,engine from information_schema.tables where table_name="optimizer_costs";
+table_name engine
+OPTIMIZER_COSTS MEMORY
+show create table information_schema.optimizer_costs;
+Table Create Table
+OPTIMIZER_COSTS CREATE TEMPORARY TABLE `OPTIMIZER_COSTS` (
+ `ENGINE` varchar(192) NOT NULL,
+ `OPTIMIZER_DISK_READ_COST` decimal(9,6) NOT NULL,
+ `OPTIMIZER_INDEX_BLOCK_COPY_COST` decimal(9,6) NOT NULL,
+ `OPTIMIZER_KEY_COMPARE_COST` decimal(9,6) NOT NULL,
+ `OPTIMIZER_KEY_COPY_COST` decimal(9,6) NOT NULL,
+ `OPTIMIZER_KEY_LOOKUP_COST` decimal(9,6) NOT NULL,
+ `OPTIMIZER_KEY_NEXT_FIND_COST` decimal(9,6) NOT NULL,
+ `OPTIMIZER_DISK_READ_RATIO` decimal(9,6) NOT NULL,
+ `OPTIMIZER_ROW_COPY_COST` decimal(9,6) NOT NULL,
+ `OPTIMIZER_ROW_LOOKUP_COST` decimal(9,6) NOT NULL,
+ `OPTIMIZER_ROW_NEXT_FIND_COST` decimal(9,6) NOT NULL,
+ `OPTIMIZER_ROWID_COMPARE_COST` decimal(9,6) NOT NULL,
+ `OPTIMIZER_ROWID_COPY_COST` decimal(9,6) NOT NULL
+) ENGINE=MEMORY DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
+select * from information_schema.optimizer_costs where engine in
+("memory","innodb","aria","default") order by engine;
+ENGINE Aria
+OPTIMIZER_DISK_READ_COST 10.240000
+OPTIMIZER_INDEX_BLOCK_COPY_COST 0.035600
+OPTIMIZER_KEY_COMPARE_COST 0.011361
+OPTIMIZER_KEY_COPY_COST 0.015685
+OPTIMIZER_KEY_LOOKUP_COST 0.435777
+OPTIMIZER_KEY_NEXT_FIND_COST 0.082347
+OPTIMIZER_DISK_READ_RATIO 0.020000
+OPTIMIZER_ROW_COPY_COST 0.060866
+OPTIMIZER_ROW_LOOKUP_COST 0.130839
+OPTIMIZER_ROW_NEXT_FIND_COST 0.045916
+OPTIMIZER_ROWID_COMPARE_COST 0.002653
+OPTIMIZER_ROWID_COPY_COST 0.002653
+ENGINE default
+OPTIMIZER_DISK_READ_COST 10.240000
+OPTIMIZER_INDEX_BLOCK_COPY_COST 0.035600
+OPTIMIZER_KEY_COMPARE_COST 0.011361
+OPTIMIZER_KEY_COPY_COST 0.015685
+OPTIMIZER_KEY_LOOKUP_COST 0.435777
+OPTIMIZER_KEY_NEXT_FIND_COST 0.082347
+OPTIMIZER_DISK_READ_RATIO 0.020000
+OPTIMIZER_ROW_COPY_COST 0.060866
+OPTIMIZER_ROW_LOOKUP_COST 0.130839
+OPTIMIZER_ROW_NEXT_FIND_COST 0.045916
+OPTIMIZER_ROWID_COMPARE_COST 0.002653
+OPTIMIZER_ROWID_COPY_COST 0.002653
+ENGINE InnoDB
+OPTIMIZER_DISK_READ_COST 10.240000
+OPTIMIZER_INDEX_BLOCK_COPY_COST 0.035600
+OPTIMIZER_KEY_COMPARE_COST 0.011361
+OPTIMIZER_KEY_COPY_COST 0.015685
+OPTIMIZER_KEY_LOOKUP_COST 0.791120
+OPTIMIZER_KEY_NEXT_FIND_COST 0.099000
+OPTIMIZER_DISK_READ_RATIO 0.020000
+OPTIMIZER_ROW_COPY_COST 0.060870
+OPTIMIZER_ROW_LOOKUP_COST 0.765970
+OPTIMIZER_ROW_NEXT_FIND_COST 0.070130
+OPTIMIZER_ROWID_COMPARE_COST 0.002653
+OPTIMIZER_ROWID_COPY_COST 0.002653
+ENGINE MEMORY
+OPTIMIZER_DISK_READ_COST 0.000000
+OPTIMIZER_INDEX_BLOCK_COPY_COST 0.000000
+OPTIMIZER_KEY_COMPARE_COST 0.011361
+OPTIMIZER_KEY_COPY_COST 0.000000
+OPTIMIZER_KEY_LOOKUP_COST 0.000000
+OPTIMIZER_KEY_NEXT_FIND_COST 0.000000
+OPTIMIZER_DISK_READ_RATIO 0.000000
+OPTIMIZER_ROW_COPY_COST 0.002334
+OPTIMIZER_ROW_LOOKUP_COST 0.000000
+OPTIMIZER_ROW_NEXT_FIND_COST 0.000000
+OPTIMIZER_ROWID_COMPARE_COST 0.002653
+OPTIMIZER_ROWID_COPY_COST 0.002653
+show variables like "optimizer%cost";
+Variable_name Value
+optimizer_disk_read_cost 10.240000
+optimizer_index_block_copy_cost 0.035600
+optimizer_key_compare_cost 0.011361
+optimizer_key_copy_cost 0.015685
+optimizer_key_lookup_cost 0.435777
+optimizer_key_next_find_cost 0.082347
+optimizer_row_copy_cost 0.060866
+optimizer_row_lookup_cost 0.130839
+optimizer_row_next_find_cost 0.045916
+optimizer_rowid_compare_cost 0.002653
+optimizer_rowid_copy_cost 0.002653
+optimizer_scan_setup_cost 10.000000
+optimizer_where_cost 0.032000
+show variables like "optimizer_disk_read_ratio";
+Variable_name Value
+optimizer_disk_read_ratio 0.020000
+#
+# Test change some 'default' variables
+#
+SELECT @@optimizer_disk_read_ratio,@@optimizer_index_block_copy_cost;
+@@optimizer_disk_read_ratio @@optimizer_index_block_copy_cost
+0.020000 0.035600
+SET global optimizer_disk_read_ratio=0.8;
+SET global optimizer_index_block_copy_cost=0.1;
+SELECT @@optimizer_disk_read_ratio,@@optimizer_index_block_copy_cost;
+@@optimizer_disk_read_ratio @@optimizer_index_block_copy_cost
+0.800000 0.100000
+select optimizer_disk_read_ratio,optimizer_index_block_copy_cost from information_schema.optimizer_costs where engine='default';
+optimizer_disk_read_ratio optimizer_index_block_copy_cost
+0.800000 0.100000
+SET global optimizer_disk_read_ratio=default;
+SET global optimizer_index_block_copy_cost=default;
+SELECT @@optimizer_disk_read_ratio,@@optimizer_index_block_copy_cost;
+@@optimizer_disk_read_ratio @@optimizer_index_block_copy_cost
+0.020000 0.035600
+#
+# Test change some 'engine' variables
+#
+select @@MEMORY.optimizer_row_lookup_cost;
+@@MEMORY.optimizer_row_lookup_cost
+0.000000
+set @tmp=@@MEMORY.optimizer_row_lookup_cost;
+set @@global.MEMORY.optimizer_row_lookup_cost=1;
+select @@MEMORY.optimizer_row_lookup_cost;
+@@MEMORY.optimizer_row_lookup_cost
+1.000000
+set @@global.MEMORY.optimizer_row_lookup_cost=default;
+select @@MEMORY.optimizer_row_lookup_cost;
+@@MEMORY.optimizer_row_lookup_cost
+0.130839
+set @@global.MEMORY.optimizer_row_lookup_cost=@tmp;
+select @@MEMORY.optimizer_row_lookup_cost;
+@@MEMORY.optimizer_row_lookup_cost
+0.000000
+#
+# Print variables with different syntaxes
+#
+SHOW VARIABLES like "optimizer_row_lookup_cost";
+Variable_name Value
+optimizer_row_lookup_cost 0.130839
+SELECT @@optimizer_row_lookup_cost;
+@@optimizer_row_lookup_cost
+0.130839
+SELECT @@global.default.optimizer_row_lookup_cost;
+@@global.default.optimizer_row_lookup_cost
+0.130839
+SELECT @@global.default.`optimizer_row_lookup_cost`;
+@@global.default.`optimizer_row_lookup_cost`
+0.130839
+SELECT @@MEMORY.optimizer_row_lookup_cost;
+@@MEMORY.optimizer_row_lookup_cost
+0.000000
+SELECT @@memory.optimizer_row_lookup_cost;
+@@memory.optimizer_row_lookup_cost
+0.000000
+SELECT @@InnoDB.optimizer_row_lookup_cost;
+@@InnoDB.optimizer_row_lookup_cost
+0.765970
+#
+# Accessing not existing cost
+#
+SELECT @@not_existing.optimizer_row_lookup_cost;
+@@not_existing.optimizer_row_lookup_cost
+0.130839
+SELECT @@NOT_existing.optimizer_row_lookup_cost;
+@@NOT_existing.optimizer_row_lookup_cost
+0.130839
+select engine from information_schema.optimizer_costs where engine like '%existing';
+engine
+#
+# Creating a new cost structure
+#
+SET global new_engine.optimizer_disk_read_cost=100;
+select * from information_schema.optimizer_costs where engine like 'new_engine';
+ENGINE OPTIMIZER_DISK_READ_COST OPTIMIZER_INDEX_BLOCK_COPY_COST OPTIMIZER_KEY_COMPARE_COST OPTIMIZER_KEY_COPY_COST OPTIMIZER_KEY_LOOKUP_COST OPTIMIZER_KEY_NEXT_FIND_COST OPTIMIZER_DISK_READ_RATIO OPTIMIZER_ROW_COPY_COST OPTIMIZER_ROW_LOOKUP_COST OPTIMIZER_ROW_NEXT_FIND_COST OPTIMIZER_ROWID_COMPARE_COST OPTIMIZER_ROWID_COPY_COST
+new_engine 100.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000 -1.000000
+select @@new_engine.optimizer_disk_read_cost, @@new_engine.optimizer_row_copy_cost;
+@@new_engine.optimizer_disk_read_cost @@new_engine.optimizer_row_copy_cost
+100.000000 -1.000000
+#
+# Errors
+#
+SELECT @@default.optimizer_disk_read_cost;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'default.optimizer_disk_read_cost' at line 1
+set global Aria.optimizer_disk_read_cost=NULL;
+ERROR 42000: Incorrect argument type to variable 'optimizer_disk_read_cost'
+set @tmp=@@Aria.optimizer_disk_read_cost;
+SET global Aria.optimizer_disk_read_cost=-1;
+Warnings:
+Warning 1292 Truncated incorrect optimizer_disk_read_cost value: '-1'
+select @@Aria.optimizer_disk_read_cost;
+@@Aria.optimizer_disk_read_cost
+0.000000
+SET global Aria.optimizer_disk_read_cost=200000;
+Warnings:
+Warning 1292 Truncated incorrect optimizer_disk_read_cost value: '200000'
+select @@Aria.optimizer_disk_read_cost;
+@@Aria.optimizer_disk_read_cost
+10000.000000
+set global Aria.optimizer_disk_read_cost=@tmp;
+select @@Aria.optimizer_disk_read_cost;
+@@Aria.optimizer_disk_read_cost
+10.240000
+#
+# Test of cost of ref compared to table scan + join_cache
+#
+create or replace table t1 (p int primary key, a char(10)) engine=myisam;
+create or replace table t2 (p int primary key, i int, a char(10), key k2(a)) engine=myisam;
+insert into t2 select seq,seq,'a' from seq_1_to_512;
+insert into t1 select seq,'a' from seq_1_to_4;
+explain select count(*) from t1, t2 where t1.p = t2.i;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 4 Using index
+1 SIMPLE t2 ALL NULL NULL NULL NULL 512 Using where; Using join buffer (flat, BNL join)
+insert into t1 select seq,'a' from seq_5_to_10;
+explain select count(*) from t1, t2 where t1.p = t2.i;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 512 Using where
+1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.i 1 Using index
+drop table t1,t2;
+#
+# Test of optimizer_scan_setup_cost
+#
+create table t1 (p int primary key, a char(10)) engine=myisam;
+create table t2 (p int primary key, i int, a char(10), key k1(i), key k2(a)) engine=myisam;
+insert into t1 values (2, 'qqqq'), (11, 'yyyy');
+insert into t2 values (1, 2, 'qqqq'), (2, 2, 'pppp'),
+(3, 2, 'yyyy'), (4, 3, 'zzzz');
+set @org_myisam_disk_read_ratio=@@myisam.optimizer_disk_read_ratio;
+set @@optimizer_scan_setup_cost=10,@@global.myisam.optimizer_disk_read_ratio=0.2;
+flush tables;
+explain select sum(t2.p+length(t1.a)) from t1, t2 where t1.p = t2.i;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 2
+1 SIMPLE t2 ref k1 k1 5 test.t1.p 1
+set @@optimizer_scan_setup_cost=0.0, @@global.myisam.optimizer_disk_read_ratio=0.0;
+flush tables;
+explain select sum(t2.p+length(t1.a)) from t1, t2 where t1.p = t2.i;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 2
+1 SIMPLE t2 ALL k1 NULL NULL NULL 4 Using where; Using join buffer (flat, BNL join)
+set @@optimizer_scan_setup_cost=default,@@global.myisam.optimizer_disk_read_ratio=@org_myisam_disk_read_ratio;
+flush tables;
+drop table t1,t2;
+#
+# Test of group by optimization
+#
+set @@optimizer_scan_setup_cost=0;
+CREATE TABLE t1 (id INT NOT NULL, a DATE, KEY(id,a)) engine=myisam;
+INSERT INTO t1 values (1,'2001-01-01'),(1,'2001-01-02'),
+(1,'2001-01-03'),(1,'2001-01-04'),
+(2,'2001-01-01'),(2,'2001-01-02'),
+(2,'2001-01-03'),(2,'2001-01-04'),
+(3,'2001-01-01'),(3,'2001-01-02'),
+(3,'2001-01-03'),(3,'2001-01-04'),
+(4,'2001-01-01'),(4,'2001-01-02'),
+(4,'2001-01-03'),(4,'2001-01-04');
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL id 8 NULL 16 Using where; Using index
+insert into t1 values (3,'2001-01-03'),(3,'2001-01-04');
+insert into t1 values (3,'2001-01-03'),(3,'2001-01-04');
+insert into t1 values (3,'2001-01-03'),(3,'2001-01-04');
+insert into t1 values (3,'2001-01-03'),(3,'2001-01-04');
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL id 8 NULL 5 Using where; Using index for group-by
+drop table t1;
+set @@optimizer_scan_setup_cost=default;
+#
+# Test of straight join costs
+#
+create table t1 (l_orderkey int(11) NOT NULL,
+l_partkey int(11) DEFAULT NULL,
+l_suppkey int(11) DEFAULT NULL,
+PRIMARY KEY (l_orderkey)) engine=aria;
+insert into t1 select seq,seq,seq from seq_1_to_1000;
+explain select straight_join count(*) from seq_1_to_10000,t1 where seq=l_orderkey;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE seq_1_to_10000 index PRIMARY PRIMARY 8 NULL 10000 Using index
+1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.seq_1_to_10000.seq 1 Using where; Using index
+show status like "last_query_cost";
+Variable_name Value
+Last_query_cost 5.641229
+set @org_cost=@@aria.optimizer_key_next_find_cost;
+set global aria.optimizer_key_next_find_cost=1000;
+flush tables;
+explain select count(*) from seq_1_to_10000,t1 where seq=l_orderkey;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE seq_1_to_10000 index PRIMARY PRIMARY 8 NULL 10000 Using index
+1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.seq_1_to_10000.seq 1 Using where; Using index
+show status like "last_query_cost";
+Variable_name Value
+Last_query_cost 5.641229
+set global aria.optimizer_key_next_find_cost=@org_cost;
+drop table t1;
+#
+# Testing distinct group optimization
+#
+create table t1 (a int, b int, key(a,b));
+insert into t1 select seq,seq from seq_1_to_1000;
+explain select count(distinct a,b) from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL a 10 NULL 1000 Using index for group-by (scanning)
+explain select count(distinct a,b) from t1 where a>100;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 10 NULL 901 Using where; Using index for group-by (scanning)
+explain select count(distinct a,b) from t1 where a>800;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 5 NULL 206 Using where; Using index
+update t1 set a=mod(a,10);
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select count(distinct a,b) from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL a 10 NULL 1000 Using index for group-by (scanning)
+explain select count(distinct a,b) from t1 where a>1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 10 NULL 788 Using where; Using index for group-by (scanning)
+explain select count(distinct a,b) from t1 where a>8;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 5 NULL 109 Using where; Using index
+update t1 set b=mod(b,2);
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select count(distinct a,b) from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL a 10 NULL 11 Using index for group-by
+explain select count(distinct a,b) from t1 where a>1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 10 NULL 9 Using where; Using index for group-by
+explain select count(distinct a,b) from t1 where a>8;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range a a 10 NULL 1 Using where; Using index for group-by
+drop table t1;
+#
+# cleanup
+#
+"New cost structures: 1 (should be 1)"
diff --git a/mysql-test/main/optimizer_costs.test b/mysql-test/main/optimizer_costs.test
new file mode 100644
index 00000000..bd7e89a5
--- /dev/null
+++ b/mysql-test/main/optimizer_costs.test
@@ -0,0 +1,189 @@
+#
+# Test of optimizer_costs
+#
+--source include/have_innodb.inc
+--source include/have_sequence.inc
+
+select table_name,engine from information_schema.tables where table_name="optimizer_costs";
+show create table information_schema.optimizer_costs;
+let $start_engines=`select count(*) from information_schema.optimizer_costs`;
+--vertical_results
+select * from information_schema.optimizer_costs where engine in
+("memory","innodb","aria","default") order by engine;
+--horizontal_results
+show variables like "optimizer%cost";
+show variables like "optimizer_disk_read_ratio";
+
+--echo #
+--echo # Test change some 'default' variables
+--echo #
+SELECT @@optimizer_disk_read_ratio,@@optimizer_index_block_copy_cost;
+SET global optimizer_disk_read_ratio=0.8;
+SET global optimizer_index_block_copy_cost=0.1;
+SELECT @@optimizer_disk_read_ratio,@@optimizer_index_block_copy_cost;
+select optimizer_disk_read_ratio,optimizer_index_block_copy_cost from information_schema.optimizer_costs where engine='default';
+SET global optimizer_disk_read_ratio=default;
+SET global optimizer_index_block_copy_cost=default;
+SELECT @@optimizer_disk_read_ratio,@@optimizer_index_block_copy_cost;
+
+--echo #
+--echo # Test change some 'engine' variables
+--echo #
+select @@MEMORY.optimizer_row_lookup_cost;
+set @tmp=@@MEMORY.optimizer_row_lookup_cost;
+set @@global.MEMORY.optimizer_row_lookup_cost=1;
+select @@MEMORY.optimizer_row_lookup_cost;
+set @@global.MEMORY.optimizer_row_lookup_cost=default;
+select @@MEMORY.optimizer_row_lookup_cost;
+set @@global.MEMORY.optimizer_row_lookup_cost=@tmp;
+select @@MEMORY.optimizer_row_lookup_cost;
+
+--echo #
+--echo # Print variables with different syntaxes
+--echo #
+SHOW VARIABLES like "optimizer_row_lookup_cost";
+SELECT @@optimizer_row_lookup_cost;
+SELECT @@global.default.optimizer_row_lookup_cost;
+SELECT @@global.default.`optimizer_row_lookup_cost`;
+SELECT @@MEMORY.optimizer_row_lookup_cost;
+SELECT @@memory.optimizer_row_lookup_cost;
+SELECT @@InnoDB.optimizer_row_lookup_cost;
+
+--echo #
+--echo # Accessing not existing cost
+--echo #
+SELECT @@not_existing.optimizer_row_lookup_cost;
+SELECT @@NOT_existing.optimizer_row_lookup_cost;
+select engine from information_schema.optimizer_costs where engine like '%existing';
+
+--echo #
+--echo # Creating a new cost structure
+--echo #
+SET global new_engine.optimizer_disk_read_cost=100;
+select * from information_schema.optimizer_costs where engine like 'new_engine';
+select @@new_engine.optimizer_disk_read_cost, @@new_engine.optimizer_row_copy_cost;
+
+--echo #
+--echo # Errors
+--echo #
+--error ER_PARSE_ERROR
+SELECT @@default.optimizer_disk_read_cost;
+--error ER_WRONG_TYPE_FOR_VAR
+set global Aria.optimizer_disk_read_cost=NULL;
+
+set @tmp=@@Aria.optimizer_disk_read_cost;
+SET global Aria.optimizer_disk_read_cost=-1;
+select @@Aria.optimizer_disk_read_cost;
+SET global Aria.optimizer_disk_read_cost=200000;
+select @@Aria.optimizer_disk_read_cost;
+set global Aria.optimizer_disk_read_cost=@tmp;
+select @@Aria.optimizer_disk_read_cost;
+
+--echo #
+--echo # Test of cost of ref compared to table scan + join_cache
+--echo #
+
+create or replace table t1 (p int primary key, a char(10)) engine=myisam;
+create or replace table t2 (p int primary key, i int, a char(10), key k2(a)) engine=myisam;
+insert into t2 select seq,seq,'a' from seq_1_to_512;
+
+insert into t1 select seq,'a' from seq_1_to_4;
+explain select count(*) from t1, t2 where t1.p = t2.i;
+insert into t1 select seq,'a' from seq_5_to_10;
+explain select count(*) from t1, t2 where t1.p = t2.i;
+
+drop table t1,t2;
+
+--echo #
+--echo # Test of optimizer_scan_setup_cost
+--echo #
+
+create table t1 (p int primary key, a char(10)) engine=myisam;
+create table t2 (p int primary key, i int, a char(10), key k1(i), key k2(a)) engine=myisam;
+insert into t1 values (2, 'qqqq'), (11, 'yyyy');
+insert into t2 values (1, 2, 'qqqq'), (2, 2, 'pppp'),
+ (3, 2, 'yyyy'), (4, 3, 'zzzz');
+set @org_myisam_disk_read_ratio=@@myisam.optimizer_disk_read_ratio;
+set @@optimizer_scan_setup_cost=10,@@global.myisam.optimizer_disk_read_ratio=0.2;
+flush tables;
+explain select sum(t2.p+length(t1.a)) from t1, t2 where t1.p = t2.i;
+set @@optimizer_scan_setup_cost=0.0, @@global.myisam.optimizer_disk_read_ratio=0.0;
+flush tables;
+explain select sum(t2.p+length(t1.a)) from t1, t2 where t1.p = t2.i;
+set @@optimizer_scan_setup_cost=default,@@global.myisam.optimizer_disk_read_ratio=@org_myisam_disk_read_ratio;
+flush tables;
+drop table t1,t2;
+
+--echo #
+--echo # Test of group by optimization
+--echo #
+
+set @@optimizer_scan_setup_cost=0;
+CREATE TABLE t1 (id INT NOT NULL, a DATE, KEY(id,a)) engine=myisam;
+INSERT INTO t1 values (1,'2001-01-01'),(1,'2001-01-02'),
+(1,'2001-01-03'),(1,'2001-01-04'),
+(2,'2001-01-01'),(2,'2001-01-02'),
+(2,'2001-01-03'),(2,'2001-01-04'),
+(3,'2001-01-01'),(3,'2001-01-02'),
+(3,'2001-01-03'),(3,'2001-01-04'),
+(4,'2001-01-01'),(4,'2001-01-02'),
+(4,'2001-01-03'),(4,'2001-01-04');
+analyze table t1;
+EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id;
+insert into t1 values (3,'2001-01-03'),(3,'2001-01-04');
+insert into t1 values (3,'2001-01-03'),(3,'2001-01-04');
+insert into t1 values (3,'2001-01-03'),(3,'2001-01-04');
+insert into t1 values (3,'2001-01-03'),(3,'2001-01-04');
+analyze table t1;
+EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id;
+drop table t1;
+set @@optimizer_scan_setup_cost=default;
+
+--echo #
+--echo # Test of straight join costs
+--echo #
+create table t1 (l_orderkey int(11) NOT NULL,
+ l_partkey int(11) DEFAULT NULL,
+ l_suppkey int(11) DEFAULT NULL,
+ PRIMARY KEY (l_orderkey)) engine=aria;
+insert into t1 select seq,seq,seq from seq_1_to_1000;
+explain select straight_join count(*) from seq_1_to_10000,t1 where seq=l_orderkey;
+show status like "last_query_cost";
+set @org_cost=@@aria.optimizer_key_next_find_cost;
+# Set cost for t1 high so that we cannot use it for index scans
+set global aria.optimizer_key_next_find_cost=1000;
+flush tables;
+explain select count(*) from seq_1_to_10000,t1 where seq=l_orderkey;
+show status like "last_query_cost";
+set global aria.optimizer_key_next_find_cost=@org_cost;
+drop table t1;
+
+--echo #
+--echo # Testing distinct group optimization
+--echo #
+
+create table t1 (a int, b int, key(a,b));
+insert into t1 select seq,seq from seq_1_to_1000;
+explain select count(distinct a,b) from t1;
+explain select count(distinct a,b) from t1 where a>100;
+explain select count(distinct a,b) from t1 where a>800;
+update t1 set a=mod(a,10);
+analyze table t1;
+explain select count(distinct a,b) from t1;
+explain select count(distinct a,b) from t1 where a>1;
+explain select count(distinct a,b) from t1 where a>8;
+update t1 set b=mod(b,2);
+analyze table t1;
+explain select count(distinct a,b) from t1;
+explain select count(distinct a,b) from t1 where a>1;
+explain select count(distinct a,b) from t1 where a>8;
+drop table t1;
+
+--echo #
+--echo # cleanup
+--echo #
+
+let $end_engines=`select count(*) from information_schema.optimizer_costs`;
+let $diff=`select $end_engines - $start_engines`;
+--echo "New cost structures: $diff (should be 1)"
+
diff --git a/mysql-test/main/optimizer_costs2.opt b/mysql-test/main/optimizer_costs2.opt
new file mode 100644
index 00000000..718ccafc
--- /dev/null
+++ b/mysql-test/main/optimizer_costs2.opt
@@ -0,0 +1 @@
+--optimizer_disk_read_ratio=0.9 --MEMORY.optimizer_disk_read_ratio=0.1 --memory.optimizer_disk_read_ratio=0.3 --memory.optimizer_row_lookup_cost=0.8
diff --git a/mysql-test/main/optimizer_costs2.result b/mysql-test/main/optimizer_costs2.result
new file mode 100644
index 00000000..688dcb51
--- /dev/null
+++ b/mysql-test/main/optimizer_costs2.result
@@ -0,0 +1,8 @@
+select engine,optimizer_disk_read_ratio from information_schema.optimizer_costs where engine in ("memory","aria","default");
+engine optimizer_disk_read_ratio
+default 0.900000
+MEMORY 0.300000
+Aria 0.900000
+select @@memory.optimizer_row_lookup_cost;
+@@memory.optimizer_row_lookup_cost
+0.800000
diff --git a/mysql-test/main/optimizer_costs2.test b/mysql-test/main/optimizer_costs2.test
new file mode 100644
index 00000000..0445ce52
--- /dev/null
+++ b/mysql-test/main/optimizer_costs2.test
@@ -0,0 +1,6 @@
+#
+# Check default optimizer_cost_arguments
+#
+
+select engine,optimizer_disk_read_ratio from information_schema.optimizer_costs where engine in ("memory","aria","default");
+select @@memory.optimizer_row_lookup_cost;
diff --git a/mysql-test/main/optimizer_crash.result b/mysql-test/main/optimizer_crash.result
new file mode 100644
index 00000000..8edac2eb
--- /dev/null
+++ b/mysql-test/main/optimizer_crash.result
@@ -0,0 +1,73 @@
+#
+# MDEV-31247 Assertion `c >= 0' failed in COST_MULT upon query with
+# many joins
+#
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (b INT) ENGINE=MyISAM;
+CREATE TABLE t3 (c INT) ENGINE=MyISAM;
+INSERT INTO t3 VALUES (1),(2),(3);
+CREATE TABLE t4 (d CHAR(200), e INT, KEY(e)) ENGINE=Aria;
+INSERT INTO t4 (e) VALUES (1),(2),(3);
+CREATE TABLE t5 (f INT) ENGINE=MyISAM;
+INSERT INTO t5 VALUES (1),(2),(3),(4),(5),(6);
+create table t1000 engine=memory select seq from seq_1_to_1000;
+create table t2000 engine=memory select seq from seq_1_to_2000;
+CREATE ALGORITHM=TEMPTABLE VIEW v AS select t1000.seq
+from t1000 ml1
+join t1000 ml2
+join t1000;
+set @@max_statement_time=10;
+SELECT * FROM information_schema.TABLES
+JOIN t1000 ts
+JOIN t1000 d1
+JOIN t2000 d3
+LEFT JOIN (t1 JOIN t2) ON 1
+JOIN t1000 d5
+JOIN t1000 PROCESSLIST
+JOIN t1000 d2
+JOIN t1000 event_name
+JOIN t3
+JOIN t4 ON ts.seq = t4.e
+JOIN v ON ts.seq+1 = v.seq
+JOIN t5 limit rows examined 1000;
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT MAX_INDEX_LENGTH TEMPORARY seq seq seq a b seq seq seq seq c d e seq f
+Warnings:
+Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 1000. The query result may be incomplete
+DROP VIEW v;
+DROP TABLE t1, t2, t3, t4, t5, t1000, t2000;
+#
+# MDEV-31391 Assertion `((best.records_out) == 0.0 &&
+# (best.records) == 0.0) ||
+# (best.records_out)/(best.records) < 1.0000001' failed
+#
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a), KEY(b)) ENGINE=Aria;
+INSERT INTO t1 VALUES
+(1,13),(2,22),(3,8),(4,88),(5,6),(7,21),(9,64),(10,14),(11,15),(12,8),
+(6,20),(8,39),(13,0),(14,3),(15,54),(16,85),(17,1),(18,1),(19,0),(20,0);
+CREATE TABLE t2 (c INT) ENGINE=Aria;
+INSERT INTO t2 VALUES (1),(2),(3);
+EXPLAIN SELECT a FROM t1 JOIN t2 WHERE a = b AND c <> 7 GROUP BY a HAVING a != 6 AND a <= 9;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range PRIMARY,b PRIMARY 4 NULL 9 Using index condition; Using where; Using temporary; Using filesort
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
+SELECT a FROM t1 JOIN t2 WHERE a = b AND c <> 7 GROUP BY a HAVING a != 6 AND a <= 9;
+a
+DROP TABLE t1, t2;
+#
+# MDEV-31375 Assertion `dbl_records <= s->records' failed with
+# optimizer_use_condition_selectivity=1
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (id INT PRIMARY KEY);
+INSERT INTO t2 VALUES (2),(3);
+SET optimizer_switch = 'derived_with_keys=off';
+SET optimizer_use_condition_selectivity = 1;
+SELECT t1.* FROM t1 JOIN (SELECT id, COUNT(*) FROM t2 GROUP BY id) sq ON sq.id = t1.a;
+a
+2
+DROP TABLE t1, t2;
+#
+# End of 11.0 tests
+#
diff --git a/mysql-test/main/optimizer_crash.test b/mysql-test/main/optimizer_crash.test
new file mode 100644
index 00000000..bfcc4835
--- /dev/null
+++ b/mysql-test/main/optimizer_crash.test
@@ -0,0 +1,82 @@
+--source include/have_innodb.inc
+--source include/have_sequence.inc
+
+--echo #
+--echo # MDEV-31247 Assertion `c >= 0' failed in COST_MULT upon query with
+--echo # many joins
+--echo #
+
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE TABLE t2 (b INT) ENGINE=MyISAM;
+
+CREATE TABLE t3 (c INT) ENGINE=MyISAM;
+INSERT INTO t3 VALUES (1),(2),(3);
+
+CREATE TABLE t4 (d CHAR(200), e INT, KEY(e)) ENGINE=Aria;
+INSERT INTO t4 (e) VALUES (1),(2),(3);
+
+CREATE TABLE t5 (f INT) ENGINE=MyISAM;
+INSERT INTO t5 VALUES (1),(2),(3),(4),(5),(6);
+
+create table t1000 engine=memory select seq from seq_1_to_1000;
+create table t2000 engine=memory select seq from seq_1_to_2000;
+
+CREATE ALGORITHM=TEMPTABLE VIEW v AS select t1000.seq
+ from t1000 ml1
+ join t1000 ml2
+ join t1000;
+
+set @@max_statement_time=10;
+--replace_regex /least \d* rows/least ### rows/
+SELECT * FROM information_schema.TABLES
+ JOIN t1000 ts
+ JOIN t1000 d1
+ JOIN t2000 d3
+ LEFT JOIN (t1 JOIN t2) ON 1
+ JOIN t1000 d5
+ JOIN t1000 PROCESSLIST
+ JOIN t1000 d2
+ JOIN t1000 event_name
+ JOIN t3
+ JOIN t4 ON ts.seq = t4.e
+ JOIN v ON ts.seq+1 = v.seq
+ JOIN t5 limit rows examined 1000;
+# Cleanup
+DROP VIEW v;
+DROP TABLE t1, t2, t3, t4, t5, t1000, t2000;
+
+--echo #
+--echo # MDEV-31391 Assertion `((best.records_out) == 0.0 &&
+--echo # (best.records) == 0.0) ||
+--echo # (best.records_out)/(best.records) < 1.0000001' failed
+--echo #
+
+CREATE TABLE t1 (a INT, b INT, PRIMARY KEY(a), KEY(b)) ENGINE=Aria;
+INSERT INTO t1 VALUES
+(1,13),(2,22),(3,8),(4,88),(5,6),(7,21),(9,64),(10,14),(11,15),(12,8),
+(6,20),(8,39),(13,0),(14,3),(15,54),(16,85),(17,1),(18,1),(19,0),(20,0);
+CREATE TABLE t2 (c INT) ENGINE=Aria;
+INSERT INTO t2 VALUES (1),(2),(3);
+EXPLAIN SELECT a FROM t1 JOIN t2 WHERE a = b AND c <> 7 GROUP BY a HAVING a != 6 AND a <= 9;
+SELECT a FROM t1 JOIN t2 WHERE a = b AND c <> 7 GROUP BY a HAVING a != 6 AND a <= 9;
+DROP TABLE t1, t2;
+
+--echo #
+--echo # MDEV-31375 Assertion `dbl_records <= s->records' failed with
+--echo # optimizer_use_condition_selectivity=1
+--echo #
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (id INT PRIMARY KEY);
+INSERT INTO t2 VALUES (2),(3);
+SET optimizer_switch = 'derived_with_keys=off';
+SET optimizer_use_condition_selectivity = 1;
+SELECT t1.* FROM t1 JOIN (SELECT id, COUNT(*) FROM t2 GROUP BY id) sq ON sq.id = t1.a;
+DROP TABLE t1, t2;
+
+--echo #
+--echo # End of 11.0 tests
+--echo #
diff --git a/mysql-test/main/order_by.result b/mysql-test/main/order_by.result
index 9d587c06..3e6460ae 100644
--- a/mysql-test/main/order_by.result
+++ b/mysql-test/main/order_by.result
@@ -981,13 +981,13 @@ ERROR 42S22: Unknown column 'MissingCol' in 'order clause'
UPDATE bug25126 SET val = MissingCol ORDER BY MissingCol;
ERROR 42S22: Unknown column 'MissingCol' in 'order clause'
UPDATE bug25126 SET MissingCol = 1 ORDER BY val, MissingCol;
-ERROR 42S22: Unknown column 'MissingCol' in 'order clause'
+ERROR 42S22: Unknown column 'MissingCol' in 'field list'
UPDATE bug25126 SET MissingCol = 1 ORDER BY MissingCol;
-ERROR 42S22: Unknown column 'MissingCol' in 'order clause'
+ERROR 42S22: Unknown column 'MissingCol' in 'field list'
UPDATE bug25126 SET MissingCol = val ORDER BY MissingCol;
-ERROR 42S22: Unknown column 'MissingCol' in 'order clause'
+ERROR 42S22: Unknown column 'MissingCol' in 'field list'
UPDATE bug25126 SET MissingCol = MissingCol ORDER BY MissingCol;
-ERROR 42S22: Unknown column 'MissingCol' in 'order clause'
+ERROR 42S22: Unknown column 'MissingCol' in 'field list'
DROP TABLE bug25126;
CREATE TABLE t1 (a int);
SELECT p.a AS val, q.a AS val1 FROM t1 p, t1 q ORDER BY val > 1;
@@ -1192,7 +1192,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index k2 k3 5 NULL 111 Using where
EXPLAIN SELECT id,c3 FROM t2 WHERE c2=11 ORDER BY c3 LIMIT 4000;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 index k2 k3 5 NULL 22318 Using where
+1 SIMPLE t2 range k2 k2 5 NULL 7341 Using index condition; Using filesort
+EXPLAIN SELECT id,c3 FROM t2 WHERE c2=11 ORDER BY c3 LIMIT 6000;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL k2 NULL NULL NULL 40960 Using where; Using filesort
EXPLAIN SELECT id,c3 FROM t2 WHERE c2 BETWEEN 10 AND 12 ORDER BY c3 LIMIT 20;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index k2 k3 5 NULL 73 Using where
@@ -1221,6 +1224,10 @@ id c3
176 14
186 14
196 14
+ALTER TABLE t2 DROP INDEX k3, ADD INDEX k3 (c3,c2);
+EXPLAIN SELECT c3 FROM t2 WHERE c2=11 ORDER BY c3 LIMIT 4000;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 index k2 k3 10 NULL 22318 Using where; Using index
DROP TABLE t1,t2;
CREATE TABLE t1 (
a INT,
@@ -1548,6 +1555,57 @@ UNIQUE KEY a_c (a,c),
KEY (a));
INSERT INTO t1 VALUES (1, 10), (2, NULL);
# Must use ref-or-null on the a_c index
+ANALYZE FORMAT=JSON
+SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c;
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "read_sorted_file": {
+ "r_rows": 1,
+ "filesort": {
+ "sort_key": "t1.c",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "r_used_priority_queue": false,
+ "r_output_rows": 1,
+ "r_buffer_size": "REPLACED",
+ "r_sort_mode": "sort_key,addon_fields",
+ "table": {
+ "table_name": "t1",
+ "access_type": "ref_or_null",
+ "possible_keys": ["a_c", "a"],
+ "key": "a_c",
+ "key_length": "10",
+ "used_key_parts": ["a", "c"],
+ "ref": ["const", "const"],
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 2,
+ "r_rows": 1,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 50,
+ "r_filtered": 100,
+ "attached_condition": "t1.c = 10 or t1.c is null",
+ "using_index": true
+ }
+ }
+ }
+ }
+ ]
+ }
+}
EXPLAIN
SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c;
id select_type table type possible_keys key key_len ref rows Extra
@@ -2976,17 +3034,17 @@ EXPLAIN
SELECT t1.a FROM t1 LEFT JOIN t2 ON t1.a=t2.a ORDER BY t1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL 8 Using index
-1 SIMPLE t2 ref i_a i_a 5 test.t1.a 2 Using index
+1 SIMPLE t2 ref i_a i_a 5 test.t1.a 1 Using index
EXPLAIN
SELECT t1.a FROM t1 LEFT JOIN t2 ON t1.a=t2.a ORDER BY t1.a LIMIT 8;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 Using index
-1 SIMPLE t2 ref i_a i_a 5 test.t1.a 2 Using index
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 6 Using index
+1 SIMPLE t2 ref i_a i_a 5 test.t1.a 1 Using index
EXPLAIN
SELECT t1.a FROM t1 LEFT JOIN t2 ON t1.a=t2.a ORDER BY t1.a LIMIT 100;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL 8 Using index
-1 SIMPLE t2 ref i_a i_a 5 test.t1.a 2 Using index
+1 SIMPLE t2 ref i_a i_a 5 test.t1.a 1 Using index
DROP TABLE t1,t2;
#
# MDEV-4974 memory leak in 5.5.32-MariaDB-1~wheezy-log
@@ -3065,7 +3123,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1 100.00
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00
1 PRIMARY t3a ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary
-1 PRIMARY t3b ref f3_key f3_key 6 test.t3a.f3 1 100.00 Using where; End temporary
+1 PRIMARY t3b ref f3_key f3_key 6 test.t3a.f3 1 41.67 Using where; End temporary
Warnings:
Note 1003 select concat('foo',`test`.`t2`.`f2`) AS `field` from `test`.`t2` semi join ((`test`.`t3` `t3a` join `test`.`t3` `t3b`)) where `test`.`t3a`.`f3` < 'foo' or `test`.`t3b`.`f3` <> 'foo' order by concat('foo',`test`.`t2`.`f2`)
DROP TABLE t1,t2,t3;
@@ -3119,7 +3177,7 @@ id select_type table type possible_keys key key_len ref rows Extra
# See above query
EXPLAIN SELECT id1 FROM t2 WHERE id2=1 AND id3=1 ORDER BY date DESC LIMIT 0,4;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range id_23_date,id_234_date id_23_date 2 NULL 8 Using where
+1 SIMPLE t2 ref id_23_date,id_234_date id_23_date 2 const,const 8 Using where
drop table t1,t2;
#
# MDEV-8989: ORDER BY optimizer ignores equality propagation
@@ -3188,13 +3246,13 @@ explain
select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
from t2, t3 where t2.a=t3.a order by t2.a limit 25;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL a NULL NULL NULL 200 Using where; Using filesort
+1 SIMPLE t2 index a a 5 NULL 25 Using where
1 SIMPLE t3 ref a a 5 test.t2.a 1
explain
select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
from t2, t3 where t2.a=t3.a order by t3.a limit 25;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL a NULL NULL NULL 200 Using where; Using filesort
+1 SIMPLE t2 index a a 5 NULL 25 Using where
1 SIMPLE t3 ref a a 5 test.t2.a 1
select t2.pk,t2.a,t2.b,t3.pk,t3.a,t3.b
from t2, t3 where t2.a=t3.a order by t2.a limit 25;
@@ -3401,6 +3459,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -3412,16 +3471,17 @@ ANALYZE
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"r_limit": 5,
- "r_used_priority_queue": false,
- "r_output_rows": 100,
- "r_buffer_size": "REPLACED",
- "r_sort_mode": "sort_key,packed_addon_fields",
+ "r_used_priority_queue": true,
+ "r_output_rows": 6,
+ "r_sort_mode": "sort_key,rowid",
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 100,
"r_rows": 100,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -3502,11 +3562,10 @@ WHERE books.library_id = 8663 AND
books.scheduled_for_removal=0 )
ORDER BY wings.id;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2 100.00 Using filesort
-1 PRIMARY wings eq_ref PRIMARY PRIMARY 4 test.books.wings_id 1 100.00
-2 MATERIALIZED books ref library_idx library_idx 4 const 2 100.00 Using where
+1 PRIMARY wings ALL PRIMARY NULL NULL NULL 2 100.00 Using filesort
+1 PRIMARY books ref library_idx library_idx 4 const 2 50.00 Using where; FirstMatch(wings)
Warnings:
-Note 1003 select `test`.`wings`.`id` AS `wing_id`,`test`.`wings`.`department_id` AS `department_id` from `test`.`wings` semi join (`test`.`books`) where `test`.`books`.`library_id` = 8663 and `test`.`books`.`scheduled_for_removal` = 0 and `test`.`wings`.`id` = `test`.`books`.`wings_id` order by `test`.`wings`.`id`
+Note 1003 select `test`.`wings`.`id` AS `wing_id`,`test`.`wings`.`department_id` AS `department_id` from `test`.`wings` semi join (`test`.`books`) where `test`.`books`.`library_id` = 8663 and `test`.`books`.`scheduled_for_removal` = 0 and `test`.`books`.`wings_id` = `test`.`wings`.`id` order by `test`.`wings`.`id`
set optimizer_switch= @save_optimizer_switch;
DROP TABLE books, wings;
#
@@ -3638,8 +3697,8 @@ WHERE
t2.key1 = t1.a and t2.key1 IS NOT NULL
ORDER BY
t2.key2 ASC
-LIMIT 1)
-from t1;
+LIMIT 1) as "con"
+ from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 10
2 DEPENDENT SUBQUERY t2 ref key1 key1 5 test.t1.a 10 Using index condition; Using where; Using filesort
@@ -3650,25 +3709,19 @@ WHERE
t2.key1 = t1.a and t2.key1 IS NOT NULL
ORDER BY
t2.key2 ASC
-LIMIT 1)
-from t1;
-(SELECT concat(id, '-', key1, '-', col1)
-FROM t2
-WHERE
-t2.key1 = t1.a and t2.key1 IS NOT NULL
-ORDER BY
-t2.key2 ASC
-LIMIT 1)
-900-0-123456
-901-1-123456
-902-2-123456
-903-3-123456
-904-4-123456
-905-5-123456
-906-6-123456
-907-7-123456
-908-8-123456
-909-9-123456
+LIMIT 1) as "con"
+ from t1;
+con
+100-0-123456
+101-1-123456
+102-2-123456
+103-3-123456
+104-4-123456
+105-5-123456
+106-6-123456
+107-7-123456
+108-8-123456
+109-9-123456
drop table t1,t2;
# End of 10.3 tests
#
@@ -3904,6 +3957,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -3921,9 +3975,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 100,
"r_rows": 100,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -4071,6 +4127,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -4088,9 +4145,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 5,
"r_rows": 5,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -4121,6 +4180,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -4138,9 +4198,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 6,
"r_rows": 6,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -4177,6 +4239,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -4194,9 +4257,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 6,
"r_rows": 6,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -4247,6 +4312,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -4264,9 +4330,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -4430,6 +4498,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -4437,9 +4506,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 50,
"r_rows": 50,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -4455,6 +4526,7 @@ ANALYZE
"r_hit_ratio": 0,
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 50,
"r_total_time_ms": "REPLACED",
"filesort": {
@@ -4471,9 +4543,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 50,
"rows": 50,
"r_rows": 50,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -4553,7 +4627,8 @@ CREATE TABLE t1 (a INT, b int, primary key(a));
CREATE TABLE t2 (a INT, b INT);
INSERT INTO t1 (a,b) VALUES (58,1),(96,2),(273,3),(23,4),(231,5),(525,6),
(2354,7),(321421,3),(535,2),(4535,3);
-INSERT INTO t2 (a,b) VALUES (58,3),(96,3),(273,3);
+INSERT INTO t2 (a,b) VALUES (58,3),(96,3),(273,3),(1000,1000),(2000,2000),(3000,3000);
+INSERT INTO t2 select seq,seq from seq_10_to_100;
# Join order should have the SJM scan table as the first table for both
# the queries with GROUP BY and ORDER BY clause.
EXPLAIN SELECT t1.a
@@ -4561,9 +4636,9 @@ FROM t1
WHERE t1.a IN (SELECT a FROM t2 WHERE b=3)
ORDER BY t1.a DESC;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 Using filesort
-1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1 Using index
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
+1 PRIMARY t1 index PRIMARY PRIMARY 4 NULL 10 Using index
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 97 Using where
EXPLAIN FORMAT=JSON SELECT t1.a
FROM t1
WHERE t1.a IN (SELECT a FROM t2 WHERE b=3)
@@ -4572,50 +4647,53 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
- "read_sorted_file": {
- "filesort": {
- "sort_key": "t1.a desc",
- "table": {
- "table_name": "<subquery2>",
- "access_type": "ALL",
- "possible_keys": ["distinct_key"],
- "rows": 3,
- "filtered": 100,
- "materialized": {
- "unique": 1,
- "query_block": {
- "select_id": 2,
- "nested_loop": [
- {
- "table": {
- "table_name": "t2",
- "access_type": "ALL",
- "rows": 3,
- "filtered": 100,
- "attached_condition": "t2.b = 3 and t2.a is not null"
- }
- }
- ]
- }
- }
- }
- }
+ "table": {
+ "table_name": "t1",
+ "access_type": "index",
+ "possible_keys": ["PRIMARY"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 10,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "using_index": true
}
},
{
"table": {
- "table_name": "t1",
+ "table_name": "<subquery2>",
"access_type": "eq_ref",
- "possible_keys": ["PRIMARY"],
- "key": "PRIMARY",
+ "possible_keys": ["distinct_key"],
+ "key": "distinct_key",
"key_length": "4",
"used_key_parts": ["a"],
- "ref": ["test.t2.a"],
+ "ref": ["func"],
"rows": 1,
"filtered": 100,
- "using_index": true
+ "materialized": {
+ "unique": 1,
+ "query_block": {
+ "select_id": 2,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 97,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "attached_condition": "t2.b = 3"
+ }
+ }
+ ]
+ }
+ }
}
}
]
@@ -4634,9 +4712,9 @@ FROM t1
WHERE t1.a IN (SELECT a FROM t2 WHERE b=3)
GROUP BY t1.a DESC;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 Using filesort
-1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
+1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 10 Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 97 Using where
EXPLAIN FORMAT=JSON SELECT t1.a, group_concat(t1.b)
FROM t1
WHERE t1.a IN (SELECT a FROM t2 WHERE b=3)
@@ -4645,49 +4723,54 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"read_sorted_file": {
"filesort": {
"sort_key": "t1.a desc",
"table": {
- "table_name": "<subquery2>",
+ "table_name": "t1",
"access_type": "ALL",
- "possible_keys": ["distinct_key"],
- "rows": 3,
- "filtered": 100,
- "materialized": {
- "unique": 1,
- "query_block": {
- "select_id": 2,
- "nested_loop": [
- {
- "table": {
- "table_name": "t2",
- "access_type": "ALL",
- "rows": 3,
- "filtered": 100,
- "attached_condition": "t2.b = 3 and t2.a is not null"
- }
- }
- ]
- }
- }
+ "possible_keys": ["PRIMARY"],
+ "loops": 1,
+ "rows": 10,
+ "cost": "COST_REPLACED",
+ "filtered": 100
}
}
}
},
{
"table": {
- "table_name": "t1",
+ "table_name": "<subquery2>",
"access_type": "eq_ref",
- "possible_keys": ["PRIMARY"],
- "key": "PRIMARY",
+ "possible_keys": ["distinct_key"],
+ "key": "distinct_key",
"key_length": "4",
"used_key_parts": ["a"],
- "ref": ["test.t2.a"],
+ "ref": ["func"],
"rows": 1,
- "filtered": 100
+ "filtered": 100,
+ "materialized": {
+ "unique": 1,
+ "query_block": {
+ "select_id": 2,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 97,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "attached_condition": "t2.b = 3"
+ }
+ }
+ ]
+ }
+ }
}
}
]
diff --git a/mysql-test/main/order_by.test b/mysql-test/main/order_by.test
index 14e50cb2..f28f7e36 100644
--- a/mysql-test/main/order_by.test
+++ b/mysql-test/main/order_by.test
@@ -9,6 +9,7 @@
--source include/no_view_protocol.inc
call mtr.add_suppression("Sort aborted.*");
+--source include/have_sequence.inc
call mtr.add_suppression("Out of sort memory; increase server sort buffer size");
--source include/have_sequence.inc
@@ -798,11 +799,16 @@ INSERT INTO t2 SELECT * FROM t1 ORDER BY id;
EXPLAIN SELECT id,c3 FROM t2 WHERE c2=11 ORDER BY c3 LIMIT 20;
EXPLAIN SELECT id,c3 FROM t2 WHERE c2=11 ORDER BY c3 LIMIT 4000;
+EXPLAIN SELECT id,c3 FROM t2 WHERE c2=11 ORDER BY c3 LIMIT 6000;
EXPLAIN SELECT id,c3 FROM t2 WHERE c2 BETWEEN 10 AND 12 ORDER BY c3 LIMIT 20;
EXPLAIN SELECT id,c3 FROM t2 WHERE c2 BETWEEN 20 AND 30 ORDER BY c3 LIMIT 4000;
SELECT id,c3 FROM t2 WHERE c2=11 ORDER BY c3 LIMIT 20;
+# Show that order by optimization takes into account index only scans
+ALTER TABLE t2 DROP INDEX k3, ADD INDEX k3 (c3,c2);
+EXPLAIN SELECT c3 FROM t2 WHERE c2=11 ORDER BY c3 LIMIT 4000;
+
DROP TABLE t1,t2;
#
@@ -907,8 +913,12 @@ CREATE TABLE t1 (
INSERT INTO t1 VALUES (1, 10), (2, NULL);
--echo # Must use ref-or-null on the a_c index
+--source include/analyze-format.inc
+ANALYZE FORMAT=JSON
+SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c;
EXPLAIN
SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c;
+
--echo # Must return 1 row
SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c;
@@ -2394,7 +2404,7 @@ let $query= select
t2.key1 = t1.a and t2.key1 IS NOT NULL
ORDER BY
t2.key2 ASC
- LIMIT 1)
+ LIMIT 1) as "con"
from t1;
--echo # here type should show ref not index
@@ -2757,8 +2767,8 @@ CREATE TABLE t2 (a INT, b INT);
INSERT INTO t1 (a,b) VALUES (58,1),(96,2),(273,3),(23,4),(231,5),(525,6),
(2354,7),(321421,3),(535,2),(4535,3);
-INSERT INTO t2 (a,b) VALUES (58,3),(96,3),(273,3);
-
+INSERT INTO t2 (a,b) VALUES (58,3),(96,3),(273,3),(1000,1000),(2000,2000),(3000,3000);
+INSERT INTO t2 select seq,seq from seq_10_to_100;
--echo # Join order should have the SJM scan table as the first table for both
--echo # the queries with GROUP BY and ORDER BY clause.
@@ -2768,6 +2778,7 @@ let $query= SELECT t1.a
ORDER BY t1.a DESC;
eval EXPLAIN $query;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $query;
eval $query;
@@ -2777,6 +2788,7 @@ let $query= SELECT t1.a, group_concat(t1.b)
GROUP BY t1.a DESC;
eval EXPLAIN $query;
+--source include/explain-no-costs.inc
eval EXPLAIN FORMAT=JSON $query;
eval $query;
DROP TABLE t1, t2;
diff --git a/mysql-test/main/order_by_innodb.result b/mysql-test/main/order_by_innodb.result
index e0d8143b..5516c563 100644
--- a/mysql-test/main/order_by_innodb.result
+++ b/mysql-test/main/order_by_innodb.result
@@ -53,17 +53,29 @@ KEY a_c (a,c),
KEY a_b (a,b)
) ENGINE=InnoDB;
insert into t1 select A.a , B.a, C.a from t0 A, t0 B, t0 C;
+select count(*) from t1;
+count(*)
+1000
+select count(*) from t1 where a=1;
+count(*)
+200
+select count(*) from t1 where a=1 and c=2;
+count(*)
+20
# should use ref access
explain select a,b,c from t1 where a=1 and c=2 order by b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref a_c,a_b a_c 10 const,const 20 Using where; Using filesort
-# both should use range access
-explain select a,b,c from t1 where a=1 and c=2 order by b limit 1000;
+# all should use range access
+explain select a,b,c from t1 where a=1 and c=2 order by b limit 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref a_c,a_b a_c 10 const,const 20 Using where; Using filesort
+explain select a,b,c from t1 where a=1 and c=2 order by b limit 300;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range a_c,a_b a_b 5 NULL 200 Using where
-explain select a,b,c from t1 where a=1 and c=2 order by b limit 2000;
+1 SIMPLE t1 ref a_c,a_b a_c 10 const,const 20 Using where; Using filesort
+explain select a,b,c from t1 where a=1 and c=2 order by b limit 1000;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range a_c,a_b a_b 5 NULL 200 Using where
+1 SIMPLE t1 ref a_c,a_b a_c 10 const,const 20 Using where; Using filesort
drop table t1,t0;
# Start of 10.2 tests
#
@@ -254,9 +266,9 @@ d1 > '2019-02-06 00:00:00'
dd.d1, dd.d2, dd.id limit 1
);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 index NULL PRIMARY 4 NULL # Using index
-1 PRIMARY t2 eq_ref PRIMARY,id2 PRIMARY 4 func # Using where
-2 DEPENDENT SUBQUERY dd range id2,for_latest_sort for_latest_sort 6 NULL # Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL #
+1 PRIMARY t2 eq_ref PRIMARY,id2 id2 8 test.t1.id,func # Using where; Using index
+2 DEPENDENT SUBQUERY dd ref id2,for_latest_sort id2 4 test.t1.id # Using where; Using filesort
drop table t1,t2,t3;
# End of 10.2 tests
#
@@ -294,3 +306,13 @@ a b c
6 2 26
6 3 36
drop table t1;
+#
+# MDEV-31116: SIGSEGV in test_if_skip_sort_order|JOIN::optimize_stage2
+#
+CREATE TABLE t1 (a BINARY (2),b BINARY (1),KEY(a)) ENGINE=innodb;
+INSERT INTO t1 select 'ab', NULL from seq_1_to_14;
+SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 WHERE a >'') ORDER BY a LIMIT 1;
+a b
+ab NULL
+DROP TABLE t1;
+# End of 11.0 tests
diff --git a/mysql-test/main/order_by_innodb.test b/mysql-test/main/order_by_innodb.test
index e66a5a49..6dab3baa 100644
--- a/mysql-test/main/order_by_innodb.test
+++ b/mysql-test/main/order_by_innodb.test
@@ -66,13 +66,17 @@ KEY a_c (a,c),
KEY a_b (a,b)
) ENGINE=InnoDB;
insert into t1 select A.a , B.a, C.a from t0 A, t0 B, t0 C;
+select count(*) from t1;
+select count(*) from t1 where a=1;
+select count(*) from t1 where a=1 and c=2;
--echo # should use ref access
explain select a,b,c from t1 where a=1 and c=2 order by b;
---echo # both should use range access
+--echo # all should use range access
+explain select a,b,c from t1 where a=1 and c=2 order by b limit 10;
+explain select a,b,c from t1 where a=1 and c=2 order by b limit 300;
explain select a,b,c from t1 where a=1 and c=2 order by b limit 1000;
-explain select a,b,c from t1 where a=1 and c=2 order by b limit 2000;
drop table t1,t0;
--echo # Start of 10.2 tests
@@ -248,3 +252,12 @@ explain select * from t1 force index(r) order by a,b limit 20;
explain select * from t1 force index(r) order by a desc,b limit 20;
select * from t1 force index(r) order by a desc,b limit 20;
drop table t1;
+
+--echo #
+--echo # MDEV-31116: SIGSEGV in test_if_skip_sort_order|JOIN::optimize_stage2
+--echo #
+CREATE TABLE t1 (a BINARY (2),b BINARY (1),KEY(a)) ENGINE=innodb;
+INSERT INTO t1 select 'ab', NULL from seq_1_to_14;
+SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 WHERE a >'') ORDER BY a LIMIT 1;
+DROP TABLE t1;
+--echo # End of 11.0 tests
diff --git a/mysql-test/main/order_by_pack_big.result b/mysql-test/main/order_by_pack_big.result
index eda697fd..f7b9deeb 100644
--- a/mysql-test/main/order_by_pack_big.result
+++ b/mysql-test/main/order_by_pack_big.result
@@ -94,6 +94,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -111,9 +112,11 @@ ANALYZE
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10000,
"r_rows": 10000,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -259,6 +262,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -277,9 +281,11 @@ ANALYZE
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10000,
"r_rows": 10000,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -422,6 +428,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -439,9 +446,11 @@ ANALYZE
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10000,
"r_rows": 10000,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -479,6 +488,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -496,9 +506,11 @@ ANALYZE
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10000,
"r_rows": 10000,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
diff --git a/mysql-test/main/order_by_sortkey.result b/mysql-test/main/order_by_sortkey.result
index c1d9609e..69705688 100644
--- a/mysql-test/main/order_by_sortkey.result
+++ b/mysql-test/main/order_by_sortkey.result
@@ -40,6 +40,9 @@ INSERT INTO tmp SELECT f1,f2 FROM t1;
INSERT INTO t1(f1,f2) SELECT * FROM tmp;
INSERT INTO tmp SELECT f1,f2 FROM t1;
INSERT INTO t1(f1,f2) SELECT * FROM tmp;
+select count(*) from t1;
+count(*)
+87700
set sort_buffer_size= 32768;
FLUSH STATUS;
SHOW SESSION STATUS LIKE 'Sort%';
@@ -49,6 +52,9 @@ Sort_priority_queue_sorts 0
Sort_range 0
Sort_rows 0
Sort_scan 0
+explain SELECT * FROM t1 ORDER BY f2 LIMIT 100;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 87700 Using filesort
SELECT * FROM t1 ORDER BY f2 LIMIT 100;
f0 f1 f2
1 0 0
@@ -151,11 +157,24 @@ f0 f1 f2
9701 0 0
9801 0 0
9901 0 0
-SHOW SESSION STATUS LIKE 'Sort%';
-Variable_name Value
-Sort_merge_passes 0
-Sort_priority_queue_sorts 1
-Sort_range 0
-Sort_rows 100
-Sort_scan 1
-DROP TABLE t1, tmp;
+create table t2
+select * from information_schema.SESSION_STATUS
+where
+variable_name like 'handler_read_rnd%' or
+variable_name like 'Sort%';
+select * from t2 where variable_name like 'Sort%';
+VARIABLE_NAME VARIABLE_VALUE
+SORT_MERGE_PASSES 0
+SORT_PRIORITY_QUEUE_SORTS 1
+SORT_RANGE 0
+SORT_ROWS 100
+SORT_SCAN 1
+select * from t2 where variable_name='HANDLER_READ_RND';
+VARIABLE_NAME VARIABLE_VALUE
+HANDLER_READ_RND 100
+select
+if(variable_value in (87701, 87802), 'OK', 'FAIL') as RES
+from t2 where variable_name='HANDLER_READ_RND_NEXT';
+RES
+OK
+DROP TABLE t1, tmp, t2;
diff --git a/mysql-test/main/order_by_sortkey.test b/mysql-test/main/order_by_sortkey.test
index 4a875b60..a0c2b51f 100644
--- a/mysql-test/main/order_by_sortkey.test
+++ b/mysql-test/main/order_by_sortkey.test
@@ -50,6 +50,7 @@ INSERT INTO tmp SELECT f1,f2 FROM t1;
INSERT INTO t1(f1,f2) SELECT * FROM tmp;
INSERT INTO tmp SELECT f1,f2 FROM t1;
INSERT INTO t1(f1,f2) SELECT * FROM tmp;
+select count(*) from t1;
# Test when only sortkeys fits to memory
set sort_buffer_size= 32768;
@@ -58,9 +59,25 @@ FLUSH STATUS;
SHOW SESSION STATUS LIKE 'Sort%';
--disable_ps2_protocol
+explain SELECT * FROM t1 ORDER BY f2 LIMIT 100;
SELECT * FROM t1 ORDER BY f2 LIMIT 100;
--enable_ps2_protocol
-SHOW SESSION STATUS LIKE 'Sort%';
+create table t2
+select * from information_schema.SESSION_STATUS
+where
+ variable_name like 'handler_read_rnd%' or
+ variable_name like 'Sort%';
+
+# Check that Sort_priority_queue_sorts is used
+select * from t2 where variable_name like 'Sort%';
+
+# Check that we did scan the whole table and did LIMIT lookups
+select * from t2 where variable_name='HANDLER_READ_RND';
+
+select
+ if(variable_value in (87701, 87802), 'OK', 'FAIL') as RES
+from t2 where variable_name='HANDLER_READ_RND_NEXT';
+
-DROP TABLE t1, tmp;
+DROP TABLE t1, tmp, t2;
diff --git a/mysql-test/main/parser.result b/mysql-test/main/parser.result
index bf9b8e4b..b10af81a 100644
--- a/mysql-test/main/parser.result
+++ b/mysql-test/main/parser.result
@@ -764,11 +764,8 @@ SELECT 1 FROM t1 UNION SELECT 1 FROM t1 ORDER BY 1 LIMIT 1 FOR UPDATE;
# "INTO" clause tests
SELECT 1 FROM t1 INTO @var17727401;
Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
Warning 1329 No data - zero rows fetched, selected, or processed
SELECT 1 FROM DUAL INTO @var17727401;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
SELECT 1 INTO @var17727401;
SELECT 1 INTO @var17727401 FROM t1;
Warnings:
@@ -784,7 +781,6 @@ Warnings:
Warning 1329 No data - zero rows fetched, selected, or processed
SELECT 1 FROM t1 WHERE 1 GROUP BY 1 HAVING 1 ORDER BY 1 LIMIT 1 INTO @var17727401;
Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
Warning 1329 No data - zero rows fetched, selected, or processed
SELECT 1 FROM t1 WHERE 1 INTO @var17727401 GROUP BY 1 HAVING 1 ORDER BY 1 LIMIT 1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'GROUP BY 1 HAVING 1 ORDER BY 1 LIMIT 1' at line 1
@@ -804,7 +800,6 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INTO @var17727401) UNION (SELECT 1 FROM t1 INTO t1)' at line 1
SELECT 1 FROM t1 UNION SELECT 1 FROM t1 INTO @var17727401;
Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
Warning 1329 No data - zero rows fetched, selected, or processed
SELECT 1 INTO @var17727401 FROM t1 PROCEDURE ANALYSE();
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'PROCEDURE ANALYSE()' at line 1
diff --git a/mysql-test/main/partition.result b/mysql-test/main/partition.result
index 4c762a1d..68b74aaf 100644
--- a/mysql-test/main/partition.result
+++ b/mysql-test/main/partition.result
@@ -2360,11 +2360,11 @@ b c
EXPLAIN
SELECT b, c FROM t1 WHERE b = 1 GROUP BY b, c;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range bc bc 10 NULL 8 Using where; Using index for group-by
+1 SIMPLE t1 ref bc bc 5 const 23 Using where; Using index
EXPLAIN
SELECT b, c FROM t1 WHERE b = 1 or b=2 GROUP BY b, c;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range bc bc 10 NULL 8 Using where; Using index for group-by
+1 SIMPLE t1 range bc bc 5 NULL 23 Using where; Using index
DROP TABLE t1;
#
# Bug #45807: crash accessing partitioned table and sql_mode
@@ -2870,3 +2870,41 @@ DROP TABLE t1;
#
# End of 10.6 tests
#
+#
+# MDEV-31494 Server crashes in ha_partition::index_blocks /
+# get_key_scans_params
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (b INT, c INT, KEY(c)) PARTITION BY LIST (b) (PARTITION p0 VALUES IN (1,2), PARTITION p1 VALUES IN (3,4));
+INSERT INTO t2 VALUES (1,1),(2,2);
+explain SELECT * FROM t1 STRAIGHT_JOIN t2 WHERE t2.b = 5 AND t2.c = 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT * FROM t1 STRAIGHT_JOIN t2 WHERE t2.b = 5 AND t2.c = 10;
+a b c
+DROP TABLE t1, t2;
+#
+# MDEV-31445 Server crashes in ha_partition::index_blocks /
+# cost_for_index_read
+#
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (b INT);
+CREATE TABLE t3 (c INT, d INT, KEY(d)) PARTITION BY KEY (c) PARTITIONS 2;
+CREATE TABLE t4 (e INT);
+INSERT INTO t1 VALUES (1),(2);
+INSERT INTO t2 VALUES (1),(2);
+INSERT INTO t3 VALUES (1,1),(2,2);
+INSERT INTO t4 VALUES (1),(2);
+explain SELECT * FROM t1 LEFT JOIN (t2 JOIN t3 ON (0 IN (SELECT e FROM t4) AND t3.d = t2.b)) ON (t3.c < t2.b);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
+1 PRIMARY t3 ref d d 5 test.t2.b 1 Using where
+2 SUBQUERY t4 ALL NULL NULL NULL NULL 2 Using where
+SELECT * FROM t1 LEFT JOIN (t2 JOIN t3 ON (0 IN (SELECT e FROM t4) AND t3.d = t2.b)) ON (t3.c < t2.b);
+a b c d
+1 NULL NULL NULL
+2 NULL NULL NULL
+drop table t1,t2,t3,t4;
+# End of 11.0 tests
diff --git a/mysql-test/main/partition.test b/mysql-test/main/partition.test
index dd778ebd..ca22e779 100644
--- a/mysql-test/main/partition.test
+++ b/mysql-test/main/partition.test
@@ -3080,3 +3080,40 @@ DROP TABLE t1;
--echo #
--echo # End of 10.6 tests
--echo #
+
+--echo #
+--echo # MDEV-31494 Server crashes in ha_partition::index_blocks /
+--echo # get_key_scans_params
+--echo #
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE TABLE t2 (b INT, c INT, KEY(c)) PARTITION BY LIST (b) (PARTITION p0 VALUES IN (1,2), PARTITION p1 VALUES IN (3,4));
+
+INSERT INTO t2 VALUES (1,1),(2,2);
+explain SELECT * FROM t1 STRAIGHT_JOIN t2 WHERE t2.b = 5 AND t2.c = 10;
+SELECT * FROM t1 STRAIGHT_JOIN t2 WHERE t2.b = 5 AND t2.c = 10;
+DROP TABLE t1, t2;
+
+--echo #
+--echo # MDEV-31445 Server crashes in ha_partition::index_blocks /
+--echo # cost_for_index_read
+--echo #
+
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (b INT);
+CREATE TABLE t3 (c INT, d INT, KEY(d)) PARTITION BY KEY (c) PARTITIONS 2;
+CREATE TABLE t4 (e INT);
+
+INSERT INTO t1 VALUES (1),(2);
+INSERT INTO t2 VALUES (1),(2);
+INSERT INTO t3 VALUES (1,1),(2,2);
+INSERT INTO t4 VALUES (1),(2);
+
+explain SELECT * FROM t1 LEFT JOIN (t2 JOIN t3 ON (0 IN (SELECT e FROM t4) AND t3.d = t2.b)) ON (t3.c < t2.b);
+SELECT * FROM t1 LEFT JOIN (t2 JOIN t3 ON (0 IN (SELECT e FROM t4) AND t3.d = t2.b)) ON (t3.c < t2.b);
+
+drop table t1,t2,t3,t4;
+
+--echo # End of 11.0 tests
diff --git a/mysql-test/main/partition_exchange.result b/mysql-test/main/partition_exchange.result
index b7c9be34..f68267c0 100644
--- a/mysql-test/main/partition_exchange.result
+++ b/mysql-test/main/partition_exchange.result
@@ -1231,7 +1231,7 @@ DROP TABLE t, t2, tp;
# failed during EXCHANGE PARTITION with different TABLESPACE.
#
CREATE TABLE t1 (a VARCHAR(200)) PARTITION BY KEY(a) partitions 10;
-ALTER TABLE t1 ADD PARTITION (PARTITION pm TABLESPACE = `innodb_file_per_table`);
+ALTER TABLE t1 ADD PARTITION (PARTITION pm);
CREATE TABLE t2 like t1;
ALTER TABLE t2 REMOVE PARTITIONING;
ALTER TABLE t1 EXCHANGE PARTITION pm WITH TABLE t2;
diff --git a/mysql-test/main/partition_exchange.test b/mysql-test/main/partition_exchange.test
index 82ccc29e..e35d8e1f 100644
--- a/mysql-test/main/partition_exchange.test
+++ b/mysql-test/main/partition_exchange.test
@@ -525,7 +525,7 @@ DROP TABLE t, t2, tp;
--echo # failed during EXCHANGE PARTITION with different TABLESPACE.
--echo #
CREATE TABLE t1 (a VARCHAR(200)) PARTITION BY KEY(a) partitions 10;
-ALTER TABLE t1 ADD PARTITION (PARTITION pm TABLESPACE = `innodb_file_per_table`);
+ALTER TABLE t1 ADD PARTITION (PARTITION pm);
CREATE TABLE t2 like t1;
ALTER TABLE t2 REMOVE PARTITIONING;
# The following works as table spaces are not checked anymore
diff --git a/mysql-test/main/partition_explicit_prune.result b/mysql-test/main/partition_explicit_prune.result
index 8b49210d..d31790e4 100644
--- a/mysql-test/main/partition_explicit_prune.result
+++ b/mysql-test/main/partition_explicit_prune.result
@@ -469,7 +469,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE TableAlias p0-9_subp3 index NULL b 71 NULL 3 Using index
EXPLAIN PARTITIONS SELECT COUNT(*) FROM t1 PARTITION (`p10-99`);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p10-99_subp4,p10-99_subp5 index NULL PRIMARY 4 NULL 2 Using index
+1 SIMPLE t1 p10-99_subp4,p10-99_subp5 index NULL b 71 NULL 2 Using index
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = 1000000;
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
@@ -692,8 +692,6 @@ a b
-21 REPLACEd by REPLACE
FLUSH STATUS;
SELECT * FROM t1 PARTITION (pNeg, `p10-99`) INTO OUTFILE 'loadtest.txt';
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS
WHERE VARIABLE_NAME LIKE 'HANDLER_%' AND VARIABLE_VALUE > 0;
VARIABLE_NAME VARIABLE_VALUE
diff --git a/mysql-test/main/partition_geometries.result b/mysql-test/main/partition_geometries.result
new file mode 100644
index 00000000..ec63b92b
--- /dev/null
+++ b/mysql-test/main/partition_geometries.result
@@ -0,0 +1,125 @@
+#
+# MDEV-19177: Geometry support for partition feature
+# Test partition/geometry type cross-compatibility for the 4 storage engines that support
+# geometries (Aria, MyISAM, InnoDB, Archive)
+# Geometries to test - point, multipolygon, geometry collection
+# Note: Archive does not support additional indices.
+#
+SET @point = Point(3,3);
+SET @poly = MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))));
+SET @collection = GeometryCollection(Point(1,1), Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))));
+#
+# Aria engine
+#
+CREATE TABLE t1 (
+`id` int(11) NOT NULL AUTO_INCREMENT,
+`geom` geometry NOT NULL,
+PRIMARY KEY (id),
+SPATIAL INDEX(geom)
+) Engine=Aria PARTITION BY HASH (id)
+PARTITIONS 10;
+INSERT INTO t1 VALUES (NULL, @point), (NULL, @poly), (NULL, @collection);
+SELECT ST_AsGeoJSON(geom) FROM t1;
+ST_AsGeoJSON(geom)
+{"type": "Point", "coordinates": [3, 3]}
+{"type": "MultiPolygon", "coordinates": [[[[0, 3], [3, 3], [3, 0], [0, 3]]]]}
+{"type": "GeometryCollection", "geometries": [{"type": "Point", "coordinates": [1, 1]}, {"type": "Polygon", "coordinates": [[[0, 3], [3, 3], [3, 0], [0, 3]]]}]}
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `geom` geometry NOT NULL,
+ PRIMARY KEY (`id`),
+ SPATIAL KEY `geom` (`geom`)
+) ENGINE=Aria AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY HASH (`id`)
+PARTITIONS 10
+DROP TABLE t1;
+#
+# MyISAM engine
+#
+CREATE TABLE t1 (
+`id` int(11) NOT NULL AUTO_INCREMENT,
+`geom` geometry NOT NULL,
+PRIMARY KEY (id),
+SPATIAL INDEX(geom)
+) Engine=myisam PARTITION BY HASH (id)
+PARTITIONS 10;
+INSERT INTO t1 VALUES (NULL, @point), (NULL, @poly), (NULL, @collection);
+SELECT ST_AsGeoJSON(geom) FROM t1;
+ST_AsGeoJSON(geom)
+{"type": "Point", "coordinates": [3, 3]}
+{"type": "MultiPolygon", "coordinates": [[[[0, 3], [3, 3], [3, 0], [0, 3]]]]}
+{"type": "GeometryCollection", "geometries": [{"type": "Point", "coordinates": [1, 1]}, {"type": "Polygon", "coordinates": [[[0, 3], [3, 3], [3, 0], [0, 3]]]}]}
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `geom` geometry NOT NULL,
+ PRIMARY KEY (`id`),
+ SPATIAL KEY `geom` (`geom`)
+) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY HASH (`id`)
+PARTITIONS 10
+DROP TABLE t1;
+#
+# InnoDB engine
+#
+CREATE TABLE t1 (
+`id` int(11) NOT NULL AUTO_INCREMENT,
+`geom` geometry NOT NULL,
+PRIMARY KEY (id),
+SPATIAL INDEX(geom)
+) Engine=innodb PARTITION BY HASH (id)
+PARTITIONS 10;
+INSERT INTO t1 VALUES (NULL, @point), (NULL, @poly), (NULL, @collection);
+SELECT ST_AsGeoJSON(geom) FROM t1;
+ST_AsGeoJSON(geom)
+{"type": "Point", "coordinates": [3, 3]}
+{"type": "MultiPolygon", "coordinates": [[[[0, 3], [3, 3], [3, 0], [0, 3]]]]}
+{"type": "GeometryCollection", "geometries": [{"type": "Point", "coordinates": [1, 1]}, {"type": "Polygon", "coordinates": [[[0, 3], [3, 3], [3, 0], [0, 3]]]}]}
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `geom` geometry NOT NULL,
+ PRIMARY KEY (`id`),
+ SPATIAL KEY `geom` (`geom`)
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY HASH (`id`)
+PARTITIONS 10
+DROP TABLE t1;
+#
+# Archive engine
+#
+INSTALL SONAME 'ha_archive';
+CREATE TABLE t1 (
+`id` int(11) NOT NULL AUTO_INCREMENT,
+`geom` geometry,
+SPATIAL INDEX(geom)
+) Engine=archive PARTITION BY HASH (id)
+PARTITIONS 10;
+ERROR HY000: The storage engine partition doesn't support SPATIAL indexes
+CREATE TABLE t1 (
+`id` int(11) NOT NULL AUTO_INCREMENT,
+`geom` geometry,
+PRIMARY KEY (id)
+) Engine=archive PARTITION BY HASH (id)
+PARTITIONS 10;
+INSERT INTO t1 VALUES (NULL, @point), (NULL, @poly), (NULL, @collection);
+SELECT ST_AsGeoJSON(geom) FROM t1;
+ST_AsGeoJSON(geom)
+{"type": "Point", "coordinates": [3, 3]}
+{"type": "MultiPolygon", "coordinates": [[[[0, 3], [3, 3], [3, 0], [0, 3]]]]}
+{"type": "GeometryCollection", "geometries": [{"type": "Point", "coordinates": [1, 1]}, {"type": "Polygon", "coordinates": [[[0, 3], [3, 3], [3, 0], [0, 3]]]}]}
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `geom` geometry DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=ARCHIVE AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+ PARTITION BY HASH (`id`)
+PARTITIONS 10
+DROP TABLE t1;
+UNINSTALL SONAME 'ha_archive';
diff --git a/mysql-test/main/partition_geometries.test b/mysql-test/main/partition_geometries.test
new file mode 100644
index 00000000..34e72463
--- /dev/null
+++ b/mysql-test/main/partition_geometries.test
@@ -0,0 +1,93 @@
+-- source include/have_geometry.inc
+
+if (!$HA_ARCHIVE_SO) {
+ skip Needs Archive plugin;
+}
+
+--echo #
+--echo # MDEV-19177: Geometry support for partition feature
+--echo # Test partition/geometry type cross-compatibility for the 4 storage engines that support
+--echo # geometries (Aria, MyISAM, InnoDB, Archive)
+--echo # Geometries to test - point, multipolygon, geometry collection
+--echo # Note: Archive does not support additional indices.
+--echo #
+SET @point = Point(3,3);
+SET @poly = MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))));
+SET @collection = GeometryCollection(Point(1,1), Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))));
+
+--source include/have_partition.inc
+
+--echo #
+--echo # Aria engine
+--echo #
+CREATE TABLE t1 (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `geom` geometry NOT NULL,
+ PRIMARY KEY (id),
+ SPATIAL INDEX(geom)
+) Engine=Aria PARTITION BY HASH (id)
+PARTITIONS 10;
+
+INSERT INTO t1 VALUES (NULL, @point), (NULL, @poly), (NULL, @collection);
+SELECT ST_AsGeoJSON(geom) FROM t1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MyISAM engine
+--echo #
+CREATE TABLE t1 (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `geom` geometry NOT NULL,
+ PRIMARY KEY (id),
+ SPATIAL INDEX(geom)
+) Engine=myisam PARTITION BY HASH (id)
+PARTITIONS 10;
+
+INSERT INTO t1 VALUES (NULL, @point), (NULL, @poly), (NULL, @collection);
+SELECT ST_AsGeoJSON(geom) FROM t1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--echo #
+--echo # InnoDB engine
+--echo #
+--source include/have_innodb.inc
+CREATE TABLE t1 (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `geom` geometry NOT NULL,
+ PRIMARY KEY (id),
+ SPATIAL INDEX(geom)
+) Engine=innodb PARTITION BY HASH (id)
+PARTITIONS 10;
+
+INSERT INTO t1 VALUES (NULL, @point), (NULL, @poly), (NULL, @collection);
+SELECT ST_AsGeoJSON(geom) FROM t1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
+--echo #
+--echo # Archive engine
+--echo #
+
+INSTALL SONAME 'ha_archive';
+--error ER_TABLE_CANT_HANDLE_SPKEYS
+CREATE TABLE t1 (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `geom` geometry,
+ SPATIAL INDEX(geom)
+) Engine=archive PARTITION BY HASH (id)
+PARTITIONS 10;
+CREATE TABLE t1 (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `geom` geometry,
+ PRIMARY KEY (id)
+) Engine=archive PARTITION BY HASH (id)
+PARTITIONS 10;
+
+INSERT INTO t1 VALUES (NULL, @point), (NULL, @poly), (NULL, @collection);
+SELECT ST_AsGeoJSON(geom) FROM t1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+UNINSTALL SONAME 'ha_archive';
+
diff --git a/mysql-test/main/partition_innodb.result b/mysql-test/main/partition_innodb.result
index cbaec550..7f9b6406 100644
--- a/mysql-test/main/partition_innodb.result
+++ b/mysql-test/main/partition_innodb.result
@@ -38,7 +38,7 @@ test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
EXPLAIN SELECT b FROM t1 WHERE b between 'L' and 'N' AND a > -100;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range PRIMARY,b b 67 NULL 90 Using where; Using index
+1 SIMPLE t1 index PRIMARY,b b 67 NULL 308 Using where; Using index
DROP TABLE t1;
#
# Bug#13007154: Crash in keys_to_use_for_scanning with ORDER BY
@@ -307,12 +307,12 @@ PARTITION p2 VALUES LESS THAN MAXVALUE
);
INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4), (5,5), (6,6), (7,7), (8,8),
(9,9), (10,10), (11,11);
-SET @old_tx_isolation := @@session.tx_isolation;
+SET @old_transaction_isolation := @@session.transaction_isolation;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
SET autocommit = 0;
UPDATE t1 SET DATA = data*2 WHERE id = 3;
UPDATE t1 SET data = data*2 WHERE data = 2;
-SET @@session.tx_isolation = @old_tx_isolation;
+SET @@session.transaction_isolation = @old_transaction_isolation;
DROP TABLE t1;
# Bug#37721, test of ORDER BY on PK and WHERE on INDEX
CREATE TABLE t1 (
diff --git a/mysql-test/main/partition_innodb.test b/mysql-test/main/partition_innodb.test
index e9771811..2ed0c10c 100644
--- a/mysql-test/main/partition_innodb.test
+++ b/mysql-test/main/partition_innodb.test
@@ -322,7 +322,7 @@ PARTITION BY RANGE(id) (
INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4), (5,5), (6,6), (7,7), (8,8),
(9,9), (10,10), (11,11);
-SET @old_tx_isolation := @@session.tx_isolation;
+SET @old_transaction_isolation := @@session.transaction_isolation;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
SET autocommit = 0;
@@ -345,7 +345,7 @@ UPDATE t1 SET data = data*2 WHERE data = 2;
#--replace_regex /.*---TRANSACTION [0-9]+ [0-9]+, .*, OS thread id [0-9]+// /MariaDB thread id [0-9]+, query id [0-9]+ .*// /.*([0-9]+ lock struct\(s\)), heap size [0-9]+, ([0-9]+ row lock\(s\)).*/\1 \2/
#SHOW ENGINE InnoDB STATUS;
-SET @@session.tx_isolation = @old_tx_isolation;
+SET @@session.transaction_isolation = @old_transaction_isolation;
DROP TABLE t1;
diff --git a/mysql-test/main/partition_innodb2.result b/mysql-test/main/partition_innodb2.result
new file mode 100644
index 00000000..4d75b468
--- /dev/null
+++ b/mysql-test/main/partition_innodb2.result
@@ -0,0 +1,24 @@
+#
+# MDEV-30442: Assertion `!m_innodb' failed in ha_partition::cmp_ref on MULTI-DELETE
+#
+create table t1 (a int) engine=innodb;
+insert into t1 values (1),(2),(1),(2);
+create table t2 (
+a int,
+b int,
+key(a)
+) engine=innodb partition by list(a)
+(
+partition p0 values in (1),
+partition p1 values in (2),
+partition p2 values in (0,3,4,5,6,7,8,9)
+);
+insert into t2 select
+mod(seq, 10), seq from seq_1_to_50;
+explain
+delete t1, t2 from t1, t2 where t1.a=t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where
+1 SIMPLE t2 ref a a 5 test.t1.a #
+delete t1, t2 from t1, t2 where t1.a=t2.a;
+drop table t1,t2;
diff --git a/mysql-test/main/partition_innodb2.test b/mysql-test/main/partition_innodb2.test
new file mode 100644
index 00000000..e2089ae3
--- /dev/null
+++ b/mysql-test/main/partition_innodb2.test
@@ -0,0 +1,31 @@
+--source include/not_embedded.inc
+--source include/have_partition.inc
+--source include/have_innodb.inc
+--source include/have_sequence.inc
+
+--echo #
+--echo # MDEV-30442: Assertion `!m_innodb' failed in ha_partition::cmp_ref on MULTI-DELETE
+--echo #
+create table t1 (a int) engine=innodb;
+insert into t1 values (1),(2),(1),(2);
+
+create table t2 (
+ a int,
+ b int,
+ key(a)
+) engine=innodb partition by list(a)
+(
+ partition p0 values in (1),
+ partition p1 values in (2),
+ partition p2 values in (0,3,4,5,6,7,8,9)
+);
+
+insert into t2 select
+ mod(seq, 10), seq from seq_1_to_50;
+
+--replace_column 9 #
+explain
+delete t1, t2 from t1, t2 where t1.a=t2.a;
+delete t1, t2 from t1, t2 where t1.a=t2.a;
+
+drop table t1,t2;
diff --git a/mysql-test/main/partition_innodb_plugin.result b/mysql-test/main/partition_innodb_plugin.result
index 8211f0aa..25b69212 100644
--- a/mysql-test/main/partition_innodb_plugin.result
+++ b/mysql-test/main/partition_innodb_plugin.result
@@ -42,6 +42,8 @@ SET @old_innodb_file_per_table = @@global.innodb_file_per_table;
SET @old_innodb_strict_mode = @@global.innodb_strict_mode;
SET @@global.innodb_file_per_table = ON,
@@global.innodb_strict_mode = ON;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
connect con1,localhost,root,,;
CREATE TABLE t1 (id INT NOT NULL
PRIMARY KEY,
@@ -62,6 +64,8 @@ t1 CREATE TABLE `t1` (
PARTITION BY HASH (`id`)
PARTITIONS 1
SET GLOBAL innodb_file_per_table = OFF;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
disconnect con1;
connect con2,localhost,root,,;
LOCK TABLE t1 WRITE;
@@ -104,6 +108,8 @@ disconnect con2;
connection default;
SET @@global.innodb_strict_mode = @old_innodb_strict_mode;
SET @@global.innodb_file_per_table = @old_innodb_file_per_table;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
SET @save_detect= @@GLOBAL.innodb_deadlock_detect;
SET @save_report= @@GLOBAL.innodb_deadlock_report;
SET GLOBAL innodb_deadlock_detect=ON;
diff --git a/mysql-test/main/partition_mrr_aria.result b/mysql-test/main/partition_mrr_aria.result
index 7ff5c9b6..c7983007 100644
--- a/mysql-test/main/partition_mrr_aria.result
+++ b/mysql-test/main/partition_mrr_aria.result
@@ -130,7 +130,7 @@ set optimizer_switch='mrr=on';
explain extended select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = t2.a-1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index
-1 SIMPLE t0 ref idx idx 5 test.t2.a 12 100.00 Using index condition(BKA); Using join buffer (flat, BKA join); Rowid-ordered scan
+1 SIMPLE t0 ALL idx NULL NULL NULL 50 25.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t0`.`tp` AS `tp`,`test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t0`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t0` join `test`.`t2` where `test`.`t0`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t0`.`b` / 10 = `test`.`t2`.`a` - 1
select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = t2.a-1;
@@ -164,7 +164,7 @@ tp a b c a
explain extended select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = 4;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index
-1 SIMPLE t0 ref idx idx 5 test.t2.a 12 100.00 Using index condition; Using join buffer (flat, BKA join); Rowid-ordered scan
+1 SIMPLE t0 ALL idx NULL NULL NULL 50 25.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t0`.`tp` AS `tp`,`test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t0`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t0` join `test`.`t2` where `test`.`t0`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t0`.`b` / 10 = 4
select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = 4;
diff --git a/mysql-test/main/partition_mrr_innodb.result b/mysql-test/main/partition_mrr_innodb.result
index 98819021..7d91fafe 100644
--- a/mysql-test/main/partition_mrr_innodb.result
+++ b/mysql-test/main/partition_mrr_innodb.result
@@ -130,7 +130,7 @@ set optimizer_switch='mrr=on';
explain extended select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = t2.a-1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index
-1 SIMPLE t0 ref idx idx 5 test.t2.a 12 100.00 Using index condition(BKA); Using join buffer (flat, BKA join); Rowid-ordered scan
+1 SIMPLE t0 ALL idx NULL NULL NULL 50 25.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t0`.`tp` AS `tp`,`test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t0`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t0` join `test`.`t2` where `test`.`t0`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t0`.`b` / 10 = `test`.`t2`.`a` - 1
select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = t2.a-1;
@@ -164,7 +164,7 @@ tp a b c a
explain extended select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = 4;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index
-1 SIMPLE t0 ref idx idx 5 test.t2.a 12 100.00 Using index condition; Using join buffer (flat, BKA join); Rowid-ordered scan
+1 SIMPLE t0 ALL idx NULL NULL NULL 50 25.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t0`.`tp` AS `tp`,`test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t0`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t0` join `test`.`t2` where `test`.`t0`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t0`.`b` / 10 = 4
select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = 4;
diff --git a/mysql-test/main/partition_mrr_myisam.result b/mysql-test/main/partition_mrr_myisam.result
index c3ce2935..9155851a 100644
--- a/mysql-test/main/partition_mrr_myisam.result
+++ b/mysql-test/main/partition_mrr_myisam.result
@@ -130,7 +130,7 @@ set optimizer_switch='mrr=on';
explain extended select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = t2.a-1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index
-1 SIMPLE t0 ref idx idx 5 test.t2.a 12 100.00 Using index condition(BKA); Using join buffer (flat, BKA join); Rowid-ordered scan
+1 SIMPLE t0 ALL idx NULL NULL NULL 50 25.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t0`.`tp` AS `tp`,`test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t0`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t0` join `test`.`t2` where `test`.`t0`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t0`.`b` / 10 = `test`.`t2`.`a` - 1
select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = t2.a-1;
@@ -164,7 +164,7 @@ tp a b c a
explain extended select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = 4;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 range idx idx 5 NULL 2 100.00 Using where; Using index
-1 SIMPLE t0 ref idx idx 5 test.t2.a 12 100.00 Using index condition; Using join buffer (flat, BKA join); Rowid-ordered scan
+1 SIMPLE t0 ALL idx NULL NULL NULL 50 25.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t0`.`tp` AS `tp`,`test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t0`.`c` AS `c`,`test`.`t2`.`a` AS `a` from `test`.`t0` join `test`.`t2` where `test`.`t0`.`a` = `test`.`t2`.`a` and `test`.`t2`.`a` in (3,4) and `test`.`t0`.`b` / 10 = 4
select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = 4;
@@ -288,7 +288,7 @@ explain
select * from t0,t2 where t2.a in (3,4) and t0.a=t2.a and (t0.b / 10) = 4;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range idx idx 5 NULL 2 Using where; Using index
-1 SIMPLE t0 ref idx idx 5 test.t2.a 12 Using index condition; Using join buffer (flat, BKA join); Rowid-ordered scan
+1 SIMPLE t0 ALL idx NULL NULL NULL 50 Using where; Using join buffer (flat, BNL join)
# This will use "Using index condition(BKA)"
explain
select * from t1,t2 where t2.a in (3,4) and t1.a=t2.a and (t1.b / 10) = 4;
diff --git a/mysql-test/main/partition_pruning.result b/mysql-test/main/partition_pruning.result
index ad3883fd..5461011d 100644
--- a/mysql-test/main/partition_pruning.result
+++ b/mysql-test/main/partition_pruning.result
@@ -15,13 +15,13 @@ PARTITION max VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (-1),(0),(1),(2),(3),(4),(5),(6),(7),(8);
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 1;
id select_type table partitions type possible_keys key key_len ref rows Extra
-# # # # # # # # # 3 #
+# # # # range # # # # 3 #
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < 7;
id select_type table partitions type possible_keys key key_len ref rows Extra
-# # # # # # # # # 8 #
+# # # # index # # # # 10 #
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 1;
id select_type table partitions type possible_keys key key_len ref rows Extra
-# # # # # # # # # 3 #
+# # # # range # # # # 3 #
DROP TABLE t1;
#
# Bug#49742: Partition Pruning not working correctly for RANGE
@@ -92,7 +92,7 @@ a
5
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < 6;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0,p1,p2,p3,p4,p5 range PRIMARY PRIMARY 4 NULL 7 Using where; Using index
+1 SIMPLE t1 p0,p1,p2,p3,p4,p5 index PRIMARY PRIMARY 4 NULL 7 Using where; Using index
SELECT * FROM t1 WHERE a < 7;
a
-1
@@ -105,7 +105,7 @@ a
6
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < 7;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0,p1,p2,p3,p4,p5,max range PRIMARY PRIMARY 4 NULL 8 Using where; Using index
+1 SIMPLE t1 p0,p1,p2,p3,p4,p5,max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
SELECT * FROM t1 WHERE a <= 1;
a
-1
@@ -155,7 +155,7 @@ a
5
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0,p1,p2,p3,p4,p5 range PRIMARY PRIMARY 4 NULL 7 Using where; Using index
+1 SIMPLE t1 p0,p1,p2,p3,p4,p5 index PRIMARY PRIMARY 4 NULL 7 Using where; Using index
SELECT * FROM t1 WHERE a <= 6;
a
-1
@@ -168,7 +168,7 @@ a
6
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 6;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0,p1,p2,p3,p4,p5,max range PRIMARY PRIMARY 4 NULL 8 Using where; Using index
+1 SIMPLE t1 p0,p1,p2,p3,p4,p5,max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
SELECT * FROM t1 WHERE a <= 7;
a
-1
@@ -182,7 +182,7 @@ a
7
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 7;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0,p1,p2,p3,p4,p5,max range PRIMARY PRIMARY 4 NULL 9 Using where; Using index
+1 SIMPLE t1 p0,p1,p2,p3,p4,p5,max index PRIMARY PRIMARY 4 NULL 10 Using where; Using index
SELECT * FROM t1 WHERE a = 1;
a
1
@@ -237,7 +237,7 @@ a
8
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= 1;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p1,p2,p3,p4,p5,max range PRIMARY PRIMARY 4 NULL 8 Using where; Using index
+1 SIMPLE t1 p1,p2,p3,p4,p5,max index PRIMARY PRIMARY 4 NULL 8 Using where; Using index
SELECT * FROM t1 WHERE a >= 2;
a
2
@@ -424,7 +424,7 @@ a
5
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < 6;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0,p1,p2,p3,p4,max range PRIMARY PRIMARY 4 NULL 7 Using where; Using index
+1 SIMPLE t1 p0,p1,p2,p3,p4,max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
SELECT * FROM t1 WHERE a <= 1;
a
-1
@@ -474,7 +474,7 @@ a
5
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0,p1,p2,p3,p4,max range PRIMARY PRIMARY 4 NULL 7 Using where; Using index
+1 SIMPLE t1 p0,p1,p2,p3,p4,max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
SELECT * FROM t1 WHERE a <= 6;
a
-1
@@ -487,7 +487,7 @@ a
6
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 6;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0,p1,p2,p3,p4,max range PRIMARY PRIMARY 4 NULL 8 Using where; Using index
+1 SIMPLE t1 p0,p1,p2,p3,p4,max index PRIMARY PRIMARY 4 NULL 9 Using where; Using index
SELECT * FROM t1 WHERE a = 1;
a
1
@@ -2677,12 +2677,12 @@ select * from t1 X, t1 Y
where X.b = Y.b and (X.a=1 or X.a=2) and (Y.a=2 or Y.a=3);
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE X p1,p2 range a,b a 4 NULL 4 Using where
-1 SIMPLE Y p2,p3 ref a,b b 4 test.X.b 2 Using where
+1 SIMPLE Y p2,p3 ref a,b b 4 test.X.b 1 Using where
explain partitions
select * from t1 X, t1 Y where X.a = Y.a and (X.a=1 or X.a=2);
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE X p1,p2 range a a 4 NULL 4 Using where
-1 SIMPLE Y p1,p2 ref a a 4 test.X.a 2
+1 SIMPLE Y p1,p2 ref a a 4 test.X.a 1
drop table t1;
create table t1 (a int) partition by hash(a) partitions 20;
insert into t1 values (1),(2),(3);
@@ -3465,8 +3465,8 @@ select * from t1
where company_id = 1000
and dept_id in (select dept_id from t2 where COMPANY_ID = 1000);
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 p_1000 ref PRIMARY PRIMARY 8 const 3 Using index
-1 PRIMARY t1 p_1000 ALL PRIMARY NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t1 p_1000 ref PRIMARY PRIMARY 8 const 6 Using where
+1 PRIMARY t2 p_1000 eq_ref PRIMARY PRIMARY 16 const,test.t1.dept_id 1 Using index
drop table t1,t2;
#
# MDEV-9505: Valgrind failure in SEL_ARG::store_min,find_used_partitions,...
diff --git a/mysql-test/main/partition_pruning.test b/mysql-test/main/partition_pruning.test
index 5c65274a..2cfcf5d0 100644
--- a/mysql-test/main/partition_pruning.test
+++ b/mysql-test/main/partition_pruning.test
@@ -25,11 +25,11 @@ PARTITION max VALUES LESS THAN MAXVALUE);
INSERT INTO t1 VALUES (-1),(0),(1),(2),(3),(4),(5),(6),(7),(8);
---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 11 #
+--replace_column 1 # 2 # 3 # 4 # 6 # 7 # 8 # 9 # 11 #
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 1;
---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 11 #
+--replace_column 1 # 2 # 3 # 4 # 6 # 7 # 8 # 9 # 11 #
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < 7;
---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 11 #
+--replace_column 1 # 2 # 3 # 4 # 6 # 7 # 8 # 9 # 11 #
EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 1;
DROP TABLE t1;
diff --git a/mysql-test/main/partition_range.result b/mysql-test/main/partition_range.result
index 9cefe83e..2f1a73a0 100644
--- a/mysql-test/main/partition_range.result
+++ b/mysql-test/main/partition_range.result
@@ -4,23 +4,26 @@ drop table if exists t1, t2;
#
CREATE TABLE t1 (a INT,b INT,KEY a (a,b));
INSERT INTO `t1` VALUES (0,580092),(3000,894076),(4000,805483),(4000,913540),(6000,611137),(8000,171602),(9000,599495),(9000,746305),(10000,272829),(10000,847519),(12000,258869),(12000,929028),(13000,288970),(15000,20971),(15000,105839),(16000,788272),(17000,76914),(18000,827274),(19000,802258),(20000,123677),(20000,587729),(22000,701449),(25000,31565),(25000,230782),(25000,442887),(25000,733139),(25000,851020);
+SELECT COUNT(*) from t1 where a IN (10000, 1000000, 3000);
+COUNT(*)
+3
EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10000, 1000000, 3000) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range a a 5 NULL 1 Using where; Using index for group-by
+1 SIMPLE t1 range a a 5 NULL 3 Using where; Using index for group-by
alter table t1 partition by hash(a) partitions 1;
EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10000, 1000000, 3000) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range a a 5 NULL 1 Using where; Using index for group-by
+1 SIMPLE t1 range a a 5 NULL 3 Using where; Using index for group-by
alter table t1 remove partitioning;
insert into t1 (a,b) select seq,seq from seq_4001_to_4100;
insert into t1 (a,b) select seq,seq from seq_10001_to_10100;
EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10000, 1000000, 3000) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range a a 5 NULL 4 Using where; Using index
+1 SIMPLE t1 range a a 5 NULL 3 Using where; Using index for group-by
alter table t1 partition by hash(a) partitions 1;
EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10000, 1000000, 3000) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range a a 5 NULL 4 Using where; Using index
+1 SIMPLE t1 range a a 5 NULL 3 Using where; Using index for group-by
DROP TABLE t1;
create table t1 (a DATETIME)
partition by range (TO_DAYS(a))
@@ -955,6 +958,11 @@ CREATE TABLE t1 (
a INT,
b INT,
KEY ( a, b )
+);
+CREATE TABLE t1_part (
+a INT,
+b INT,
+KEY ( a, b )
) PARTITION BY HASH (a) PARTITIONS 1;
CREATE TABLE t2 (
a INT,
@@ -966,36 +974,68 @@ INSERT INTO t1 SELECT a + 5, b + 5 FROM t1;
INSERT INTO t1 SELECT a + 10, b + 10 FROM t1;
INSERT INTO t1 SELECT a + 20, b + 20 FROM t1;
INSERT INTO t1 SELECT a + 40, b + 40 FROM t1;
+INSERT INTO t1 values(10,0),(10,1),(10,2),(100,0),(100,1);
+select count(*) from t1;
+count(*)
+85
+select count(*) from t1 where a=10;
+count(*)
+4
+select count(*) from t1 where a=100;
+count(*)
+2
+INSERT INTO t1_part SELECT * FROM t1;
INSERT INTO t2 SELECT * FROM t1;
-ANALYZE TABLE t1,t2;
+ANALYZE TABLE t1_part,t2;
Table Op Msg_type Msg_text
-test.t1 analyze status Engine-independent statistics collected
-test.t1 analyze status OK
+test.t1_part analyze status Engine-independent statistics collected
+test.t1_part analyze status OK
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status Table is already up to date
# plans should be identical
-EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10,100) GROUP BY a;
+EXPLAIN SELECT a, MAX(b) FROM t1_part WHERE a IN (10,100) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range a a 5 NULL 2 Using where; Using index
+1 SIMPLE t1_part range a a 5 NULL 2 Using where; Using index for group-by
EXPLAIN SELECT a, MAX(b) FROM t2 WHERE a IN (10,100) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range a a 5 NULL 2 Using where; Using index
+1 SIMPLE t2 range a a 5 NULL 2 Using where; Using index for group-by
FLUSH status;
-SELECT a, MAX(b) FROM t1 WHERE a IN (10, 100) GROUP BY a;
+SELECT a, MAX(b) FROM t1_part WHERE a IN (10, 100) GROUP BY a;
a MAX(b)
10 10
-# Should be no more than 4 reads.
-SHOW status LIKE 'handler_read_key';
+100 1
+SHOW status LIKE 'handler_read%';
Variable_name Value
-Handler_read_key 2
+Handler_read_first 0
+Handler_read_key 6
+Handler_read_last 0
+Handler_read_next 0
+Handler_read_prev 0
+Handler_read_retry 0
+Handler_read_rnd 0
+Handler_read_rnd_deleted 0
+Handler_read_rnd_next 0
FLUSH status;
SELECT a, MAX(b) FROM t2 WHERE a IN (10, 100) GROUP BY a;
a MAX(b)
10 10
-# Should be no more than 4 reads.
-SHOW status LIKE 'handler_read_key';
+100 1
+SHOW status LIKE 'handler_read%';
Variable_name Value
-Handler_read_key 2
+Handler_read_first 0
+Handler_read_key 6
+Handler_read_last 0
+Handler_read_next 0
+Handler_read_prev 0
+Handler_read_retry 0
+Handler_read_rnd 0
+Handler_read_rnd_deleted 0
+Handler_read_rnd_next 0
+insert into t2 select 100,seq from seq_1_to_100;
+EXPLAIN SELECT a, MAX(b) FROM t2 WHERE a IN (10,100) GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range a a 5 NULL 2 Using where; Using index for group-by
+DROP TABLE t1,t1_part,t2;
#
# MDEV-18501 Partition pruning doesn't work for historical queries
#
@@ -1023,7 +1063,7 @@ d
select * from t1 partition (p1);
d
2000-01-01 00:00:01.000000
-DROP TABLE t1, t2;
+DROP TABLE t1;
#
# MDEV-21195 INSERT chooses wrong partition for RANGE partitioning by DECIMAL column
#
diff --git a/mysql-test/main/partition_range.test b/mysql-test/main/partition_range.test
index 19050267..e10ad870 100644
--- a/mysql-test/main/partition_range.test
+++ b/mysql-test/main/partition_range.test
@@ -17,6 +17,7 @@ drop table if exists t1, t2;
CREATE TABLE t1 (a INT,b INT,KEY a (a,b));
INSERT INTO `t1` VALUES (0,580092),(3000,894076),(4000,805483),(4000,913540),(6000,611137),(8000,171602),(9000,599495),(9000,746305),(10000,272829),(10000,847519),(12000,258869),(12000,929028),(13000,288970),(15000,20971),(15000,105839),(16000,788272),(17000,76914),(18000,827274),(19000,802258),(20000,123677),(20000,587729),(22000,701449),(25000,31565),(25000,230782),(25000,442887),(25000,733139),(25000,851020);
+SELECT COUNT(*) from t1 where a IN (10000, 1000000, 3000);
EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10000, 1000000, 3000) GROUP BY a;
alter table t1 partition by hash(a) partitions 1;
@@ -941,10 +942,17 @@ drop table t1, t2;
--echo # Bug#50939: Loose Index Scan unduly relies on engine to remember range
--echo # endpoints
--echo #
+
CREATE TABLE t1 (
a INT,
b INT,
KEY ( a, b )
+);
+
+CREATE TABLE t1_part (
+ a INT,
+ b INT,
+ KEY ( a, b )
) PARTITION BY HASH (a) PARTITIONS 1;
CREATE TABLE t2 (
@@ -959,27 +967,38 @@ INSERT INTO t1 SELECT a + 5, b + 5 FROM t1;
INSERT INTO t1 SELECT a + 10, b + 10 FROM t1;
INSERT INTO t1 SELECT a + 20, b + 20 FROM t1;
INSERT INTO t1 SELECT a + 40, b + 40 FROM t1;
+INSERT INTO t1 values(10,0),(10,1),(10,2),(100,0),(100,1);
+select count(*) from t1;
+select count(*) from t1 where a=10;
+select count(*) from t1 where a=100;
+INSERT INTO t1_part SELECT * FROM t1;
INSERT INTO t2 SELECT * FROM t1;
-ANALYZE TABLE t1,t2;
+ANALYZE TABLE t1_part,t2;
--echo # plans should be identical
-EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10,100) GROUP BY a;
+EXPLAIN SELECT a, MAX(b) FROM t1_part WHERE a IN (10,100) GROUP BY a;
EXPLAIN SELECT a, MAX(b) FROM t2 WHERE a IN (10,100) GROUP BY a;
+# view protocol will cause changed table counters
+--disable_view_protocol
--disable_ps2_protocol
FLUSH status;
-SELECT a, MAX(b) FROM t1 WHERE a IN (10, 100) GROUP BY a;
---echo # Should be no more than 4 reads.
-SHOW status LIKE 'handler_read_key';
+SELECT a, MAX(b) FROM t1_part WHERE a IN (10, 100) GROUP BY a;
+SHOW status LIKE 'handler_read%';
FLUSH status;
SELECT a, MAX(b) FROM t2 WHERE a IN (10, 100) GROUP BY a;
---echo # Should be no more than 4 reads.
-SHOW status LIKE 'handler_read_key';
+SHOW status LIKE 'handler_read%';
--enable_ps2_protocol
+--enable_view_protocol
+insert into t2 select 100,seq from seq_1_to_100;
+EXPLAIN SELECT a, MAX(b) FROM t2 WHERE a IN (10,100) GROUP BY a;
+
+DROP TABLE t1,t1_part,t2;
+
--echo #
--echo # MDEV-18501 Partition pruning doesn't work for historical queries
--echo #
@@ -1007,7 +1026,7 @@ insert into t1 values
select * from t1 partition (p0);
select * from t1 partition (p1);
-DROP TABLE t1, t2;
+DROP TABLE t1;
--echo #
--echo # MDEV-21195 INSERT chooses wrong partition for RANGE partitioning by DECIMAL column
diff --git a/mysql-test/main/percona_nonflushing_analyze_debug.result b/mysql-test/main/percona_nonflushing_analyze_debug.result
index 78da085f..c3388fa4 100644
--- a/mysql-test/main/percona_nonflushing_analyze_debug.result
+++ b/mysql-test/main/percona_nonflushing_analyze_debug.result
@@ -1,7 +1,7 @@
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1), (2), (3);
connect con1,localhost,root;
-SET DEBUG_SYNC="handler_ha_index_next_end SIGNAL idx_scan_in_progress WAIT_FOR finish_scan";
+SET DEBUG_SYNC="handler_rnd_next_end SIGNAL idx_scan_in_progress WAIT_FOR finish_scan";
SELECT * FROM t1;
connection default;
SET DEBUG_SYNC="now WAIT_FOR idx_scan_in_progress";
diff --git a/mysql-test/main/plugin_auth.test b/mysql-test/main/plugin_auth.test
index 1c471cab..dfc0572a 100644
--- a/mysql-test/main/plugin_auth.test
+++ b/mysql-test/main/plugin_auth.test
@@ -506,7 +506,7 @@ SELECT IS_NULLABLE, COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
COLUMN_NAME IN ('plugin', 'authentication_string')
ORDER BY COLUMN_NAME;
let $datadir= `select @@datadir`;
-remove_file $datadir/mysql_upgrade_info;
+remove_file $datadir/mariadb_upgrade_info;
drop table mysql.global_priv;
rename table mysql.global_priv_bak to mysql.global_priv;
diff --git a/mysql-test/main/pool_of_threads.result b/mysql-test/main/pool_of_threads.result
index 91ad7ab0..718cb7dc 100644
--- a/mysql-test/main/pool_of_threads.result
+++ b/mysql-test/main/pool_of_threads.result
@@ -1,5 +1,6 @@
SET optimizer_switch='outer_join_with_cache=off';
drop table if exists t1,t2,t3,t4;
+set @@default_storage_engine="aria";
CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
@@ -600,6 +601,9 @@ explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index
+#
+# Some test with ORDER BY and limit
+#
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using filesort
@@ -1289,7 +1293,7 @@ companynr tinyint(2) unsigned zerofill NOT NULL default '00',
companyname char(30) NOT NULL default '',
PRIMARY KEY (companynr),
UNIQUE KEY companyname(companyname)
-) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
+) ENGINE=aria MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
companynr companyname
00 Unknown
@@ -1379,6 +1383,9 @@ explain select companynr,companyname from t4 left join t2 using (companynr) wher
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
delete from t2 where fld1=999999;
+#
+# Test left join optimization
+#
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
@@ -1393,15 +1400,15 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null;
id select_type table type possible_keys key key_len ref rows Extra
@@ -1417,11 +1424,11 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0;
id select_type table type possible_keys key key_len ref rows Extra
diff --git a/mysql-test/main/ps.result b/mysql-test/main/ps.result
index fb3681ca..2e5b5dbb 100644
--- a/mysql-test/main/ps.result
+++ b/mysql-test/main/ps.result
@@ -244,8 +244,6 @@ prepare stmt1 from "insert into t1 select i from t1";
execute stmt1;
execute stmt1;
prepare stmt1 from "select * from t1 into outfile '<MYSQLTEST_VARDIR>/tmp/f1.txt'";
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
execute stmt1;
deallocate prepare stmt1;
drop table t1;
@@ -698,21 +696,21 @@ set @@time_zone:='Japan';
execute stmt;
@@time_zone
Japan
-prepare stmt from "select @@tx_isolation";
+prepare stmt from "select @@transaction_isolation";
execute stmt;
-@@tx_isolation
+@@transaction_isolation
REPEATABLE-READ
set transaction isolation level read committed;
execute stmt;
-@@tx_isolation
+@@transaction_isolation
REPEATABLE-READ
set transaction isolation level serializable;
execute stmt;
-@@tx_isolation
+@@transaction_isolation
REPEATABLE-READ
-set @@tx_isolation=default;
+set @@transaction_isolation=default;
execute stmt;
-@@tx_isolation
+@@transaction_isolation
REPEATABLE-READ
deallocate prepare stmt;
prepare stmt from "create temporary table t1 (letter enum('','a','b','c')
@@ -5561,15 +5559,13 @@ CREATE TABLE t2 (c2 INT) ENGINE=MyISAM;
CREATE TABLE t3 (c3 INT) ENGINE=MyISAM;
EXPLAIN EXTENDED UPDATE t3 SET c3 = ( SELECT COUNT(d1.c1) FROM ( SELECT a11.c1 FROM t1 AS a11 STRAIGHT_JOIN t2 AS a21 ON a21.c2 = a11.c1 JOIN t1 AS a12 ON a12.c1 = a11.c1 ) d1 );
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t3 ALL NULL NULL NULL NULL 0 100.00
-2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
Warnings:
Note 1003 /* select#1 */ update `test`.`t3` set `test`.`t3`.`c3` = (/* select#2 */ select count(NULL) from `test`.`t1` `a11` straight_join `test`.`t2` `a21` join `test`.`t1` `a12` where 0)
PREPARE stmt FROM "EXPLAIN EXTENDED UPDATE t3 SET c3 = ( SELECT COUNT(d1.c1) FROM ( SELECT a11.c1 FROM t1 AS a11 STRAIGHT_JOIN t2 AS a21 ON a21.c2 = a11.c1 JOIN t1 AS a12 ON a12.c1 = a11.c1 ) d1 )";
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t3 ALL NULL NULL NULL NULL 0 100.00
-2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
Warnings:
Note 1003 /* select#1 */ update `test`.`t3` set `test`.`t3`.`c3` = (/* select#2 */ select count(NULL) from `test`.`t1` `a11` straight_join `test`.`t2` `a21` join `test`.`t1` `a12` where 0)
DEALLOCATE PREPARE stmt;
diff --git a/mysql-test/main/ps.test b/mysql-test/main/ps.test
index c7568f73..bf223850 100644
--- a/mysql-test/main/ps.test
+++ b/mysql-test/main/ps.test
@@ -766,13 +766,13 @@ prepare stmt from "select @@time_zone";
execute stmt;
set @@time_zone:='Japan';
execute stmt;
-prepare stmt from "select @@tx_isolation";
+prepare stmt from "select @@transaction_isolation";
execute stmt;
set transaction isolation level read committed;
execute stmt;
set transaction isolation level serializable;
execute stmt;
-set @@tx_isolation=default;
+set @@transaction_isolation=default;
execute stmt;
deallocate prepare stmt;
diff --git a/mysql-test/main/ps_1general.result b/mysql-test/main/ps_1general.result
index ca2447b6..b7105724 100644
--- a/mysql-test/main/ps_1general.result
+++ b/mysql-test/main/ps_1general.result
@@ -451,7 +451,7 @@ def Extra 253 255 14 N 1 39 8
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using filesort
SET @arg00=1 ;
-prepare stmt1 from ' explain select a from t1 where a > ? order by b ';
+prepare stmt1 from ' explain select a from t1 force index (primary) where a > ? order by b ';
execute stmt1 using @arg00;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def id 8 3 1 Y 32928 0 63
diff --git a/mysql-test/main/ps_1general.test b/mysql-test/main/ps_1general.test
index 20f2ad01..c98fc4a5 100644
--- a/mysql-test/main/ps_1general.test
+++ b/mysql-test/main/ps_1general.test
@@ -437,8 +437,10 @@ prepare stmt3 from ' unlock tables ' ;
## Load/Unload table contents
--let $datafile = $MYSQLTEST_VARDIR/tmp/data.txt
+--disable_warnings
--error 0,1
--remove_file $datafile
+--enable_warnings
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval prepare stmt1 from ' load data infile ''$datafile''
@@ -497,7 +499,7 @@ prepare stmt1 from ' explain select a from t1 order by b ';
execute stmt1;
--disable_metadata
SET @arg00=1 ;
-prepare stmt1 from ' explain select a from t1 where a > ? order by b ';
+prepare stmt1 from ' explain select a from t1 force index (primary) where a > ? order by b ';
--enable_metadata
--replace_result 4096 4_OR_8_K 8192 4_OR_8_K
execute stmt1 using @arg00;
diff --git a/mysql-test/main/ps_change_master.result b/mysql-test/main/ps_change_master.result
index 25069a53..4c97715b 100644
--- a/mysql-test/main/ps_change_master.result
+++ b/mysql-test/main/ps_change_master.result
@@ -18,5 +18,5 @@ EXECUTE stmt;
DEALLOCATE PREPARE stmt;
# Master_Host : host2
# Master_User : user2
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0;
# End of test
diff --git a/mysql-test/main/ps_change_master.test b/mysql-test/main/ps_change_master.test
index d756b8cd..19040917 100644
--- a/mysql-test/main/ps_change_master.test
+++ b/mysql-test/main/ps_change_master.test
@@ -40,6 +40,6 @@ let $master_user= query_get_value(SHOW SLAVE STATUS, Master_User, 1);
# Reset
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0;
--echo # End of test
diff --git a/mysql-test/main/ps_ddl.result b/mysql-test/main/ps_ddl.result
index dcbb6982..e4b9cd37 100644
--- a/mysql-test/main/ps_ddl.result
+++ b/mysql-test/main/ps_ddl.result
@@ -20,8 +20,6 @@ else
select '' as "SUCCESS";
end if;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
set @reprepare_count= 0;
flush status;
=====================================================================
@@ -322,8 +320,8 @@ create table t3 (a int unique);
create view v1 as select a from t2;
create trigger t1_ai after insert on t1 for each row
insert into v1 (a) values (new.a);
-# Demonstrate that the same bug is present
-# without prepared statements
+# Demonstrate that this bug is fixed by MDEV-5816
+# both for regular and prepared statements
insert into t1 (a) values (5);
select * from t2;
a
@@ -333,15 +331,15 @@ a
drop view v1;
create view v1 as select a from t3;
insert into t1 (a) values (6);
-ERROR 42S02: Table 'test.t2' doesn't exist
flush table t1;
-insert into t1 (a) values (6);
+insert into t1 (a) values (60);
select * from t2;
a
5
select * from t3;
a
6
+60
prepare stmt from "insert into t1 (a) values (?)";
set @var=7;
execute stmt using @var;
@@ -352,6 +350,7 @@ select * from t3;
a
6
7
+60
select * from t2;
a
5
@@ -366,23 +365,26 @@ set @var=8;
# but repreparation of the main statement doesn't cause repreparation
# of trigger statements.
#
-# The following EXECUTE results in ER_NO_SUCH_TABLE (t3) error, because
-# pre-locking list of the prepared statement has been changed
+# Prior MDEV-5816, the following EXECUTE resulted in
+# ER_NO_SUCH_TABLE (t3) error, because pre-locking list of the prepared
+# statement has been changed
# (the prepared statement has noticed the meta-data change),
# but the trigger still tries to deal with 't3', which is not opened.
# That's why '8' is not inserted neither into 't2', nor into 't3'.
+# After the task MDEV-5816 be implemented this issue does't exist.
execute stmt using @var;
-ERROR 42S02: Table 'test.t3' doesn't exist
call p_verify_reprepare_count(1);
SUCCESS
select * from t2;
a
5
+8
select * from t3;
a
6
7
+60
flush table t1;
set @var=9;
execute stmt using @var;
@@ -392,11 +394,13 @@ SUCCESS
select * from t2;
a
5
+8
9
select * from t3;
a
6
7
+60
drop view v1;
drop table t1,t2,t3;
# Test 7-d: dependent TABLE has changed
@@ -1075,8 +1079,6 @@ call p1(x);
return x;
end|
create procedure p1(out x int) select max(a) from t1 into x;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
prepare stmt from "select * from v1";
execute stmt;
f1()
@@ -1089,8 +1091,6 @@ SUCCESS
drop procedure p1;
create procedure p1(out x int) select max(a) from t2 into x;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# XXX: used to be a bug. The prelocked list was not invalidated
# and we kept opening table t1, whereas the procedure
# is now referring to table t2
diff --git a/mysql-test/main/ps_ddl.test b/mysql-test/main/ps_ddl.test
index e12fb11d..e17539b3 100644
--- a/mysql-test/main/ps_ddl.test
+++ b/mysql-test/main/ps_ddl.test
@@ -334,17 +334,18 @@ create view v1 as select a from t2;
create trigger t1_ai after insert on t1 for each row
insert into v1 (a) values (new.a);
---echo # Demonstrate that the same bug is present
---echo # without prepared statements
+--echo # Demonstrate that this bug is fixed by MDEV-5816
+--echo # both for regular and prepared statements
insert into t1 (a) values (5);
select * from t2;
select * from t3;
drop view v1;
create view v1 as select a from t3;
---error ER_NO_SUCH_TABLE
+# Before MDEV-5816 the following statement would fail
+# with the error ER_NO_SUCH_TABLE
insert into t1 (a) values (6);
flush table t1;
-insert into t1 (a) values (6);
+insert into t1 (a) values (60);
select * from t2;
select * from t3;
@@ -365,12 +366,13 @@ set @var=8;
--echo # but repreparation of the main statement doesn't cause repreparation
--echo # of trigger statements.
--echo #
---echo # The following EXECUTE results in ER_NO_SUCH_TABLE (t3) error, because
---echo # pre-locking list of the prepared statement has been changed
+--echo # Prior MDEV-5816, the following EXECUTE resulted in
+--echo # ER_NO_SUCH_TABLE (t3) error, because pre-locking list of the prepared
+--echo # statement has been changed
--echo # (the prepared statement has noticed the meta-data change),
--echo # but the trigger still tries to deal with 't3', which is not opened.
--echo # That's why '8' is not inserted neither into 't2', nor into 't3'.
---error ER_NO_SUCH_TABLE
+--echo # After the task MDEV-5816 be implemented this issue does't exist.
execute stmt using @var;
call p_verify_reprepare_count(1);
select * from t2;
diff --git a/mysql-test/main/ps_ddl1.result b/mysql-test/main/ps_ddl1.result
index 5178ee64..667cbed8 100644
--- a/mysql-test/main/ps_ddl1.result
+++ b/mysql-test/main/ps_ddl1.result
@@ -20,8 +20,6 @@ else
select '' as "SUCCESS";
end if;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
set @reprepare_count= 0;
flush status;
drop table if exists t1;
diff --git a/mysql-test/main/query_cache.result b/mysql-test/main/query_cache.result
index f68f619f..1532890c 100644
--- a/mysql-test/main/query_cache.result
+++ b/mysql-test/main/query_cache.result
@@ -646,13 +646,9 @@ show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
select * from t1 into outfile "query_cache.out.file";
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select * from t1 into outfile "query_cache.out.file";
ERROR HY000: File 'query_cache.out.file' already exists
select * from t1 limit 1 into dumpfile "query_cache.dump.file";
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
@@ -1105,8 +1101,6 @@ Declare var1 int;
select max(a) from t1 into var1;
return var1;
end//
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create procedure `p1`()
begin
select a, f1() from t1;
diff --git a/mysql-test/main/range.result b/mysql-test/main/range.result
index 692eea3f..e14b78ba 100644
--- a/mysql-test/main/range.result
+++ b/mysql-test/main/range.result
@@ -281,7 +281,7 @@ INSERT INTO t1 VALUES
(33,5),(33,5),(33,5),(33,5),(34,5),(35,5);
EXPLAIN SELECT * FROM t1 WHERE a IN(1,2) AND b=5;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range|filter a,b a|b 5|5 NULL 2 (41%) Using index condition; Using where; Using rowid filter
+1 SIMPLE t1 range a,b a 5 NULL 2 Using index condition; Using where
SELECT * FROM t1 WHERE a IN(1,2) AND b=5;
a b
DROP TABLE t1;
@@ -309,6 +309,9 @@ a b
15 1
47 1
DROP TABLE t1;
+#
+# Test of problem with IN on many different keyparts. (Bug #4157)
+#
CREATE TABLE t1 (
id int( 11 ) unsigned NOT NULL AUTO_INCREMENT ,
line int( 5 ) unsigned NOT NULL default '0',
@@ -325,10 +328,17 @@ KEY `LINES` ( owner, tableid, content, id ) ,
KEY recount( owner, line )
) ENGINE = MYISAM;
INSERT into t1 (owner,id,columnid,line) values (11,15,15,1),(11,13,13,5);
+INSERT into t1 (owner,id,columnid,line) select 11,seq+20,seq,seq from seq_1_to_100;
+explain SELECT id, columnid, tableid, content, showid, line, ordinal FROM t1 WHERE owner=11 AND ((columnid IN ( 15, 13, 14 ) AND line IN ( 1, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 31 )) OR (columnid IN ( 13, 14 ) AND line IN ( 15 ))) LIMIT 0 , 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref PRIMARY,menu,COLUMN,LINES,recount COLUMN 4 const 11 Using index condition
SELECT id, columnid, tableid, content, showid, line, ordinal FROM t1 WHERE owner=11 AND ((columnid IN ( 15, 13, 14 ) AND line IN ( 1, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 31 )) OR (columnid IN ( 13, 14 ) AND line IN ( 15 ))) LIMIT 0 , 30;
id columnid tableid content showid line ordinal
-15 15 1 188 1 1 0
13 13 1 188 1 5 0
+15 15 1 188 1 1 0
+33 13 1 188 1 13 0
+34 14 1 188 1 14 0
+35 15 1 188 1 15 0
drop table t1;
create table t1 (id int(10) primary key);
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9);
@@ -725,7 +735,7 @@ WHERE
v.oxrootid ='d8c4177d09f8b11f5.52725521' AND
s.oxleft > v.oxleft AND s.oxleft < v.oxright;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE v ALL OXLEFT,OXRIGHT,OXROOTID NULL NULL NULL 12 Using where
+1 SIMPLE v ref OXLEFT,OXRIGHT,OXROOTID OXROOTID 34 const 6 Using index condition
1 SIMPLE s ALL OXLEFT NULL NULL NULL 12 Range checked for each record (index map: 0x4)
SELECT s.oxid FROM t1 v, t1 s
WHERE
@@ -1238,14 +1248,16 @@ insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t2 (a int, b int, filler char(100));
insert into t2 select A.a + 10 * (B.a + 10 * C.a), 10, 'filler' from t1 A,
t1 B, t1 C where A.a < 5;
-insert into t2 select 1000, b, 'filler' from t2;
+insert into t2 select 1000, b, 'filler' from t2 limit 50;
+select count(*) from t2;
+count(*)
+550
alter table t2 add index (a,b);
-select 'In following EXPLAIN the access method should be ref, #rows~=500 (and not 2)' Z;
-Z
-In following EXPLAIN the access method should be ref, #rows~=500 (and not 2)
+# In following EXPLAIN the access method should be ref, #rows~=50
+# (and not 2) when we are not using rowid-ordered scans
explain select * from t2 where a=1000 and b<11;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ref a a 5 const 503 Using index condition
+1 SIMPLE t2 range a a 10 NULL 63 Using index condition
drop table t1, t2;
CREATE TABLE t1( a INT, b INT, KEY( a, b ) );
CREATE TABLE t2( a INT, b INT, KEY( a, b ) );
@@ -2418,6 +2430,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -2427,7 +2440,9 @@ EXPLAIN
"key": "idx",
"key_length": "10",
"used_key_parts": ["a", "b"],
+ "loops": 1,
"rows": 6,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a,t1.b) in (<cache>((2,3)),<cache>((3,3)),<cache>((8,8)),<cache>((7,7)))"
}
@@ -2482,6 +2497,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -2491,7 +2507,9 @@ EXPLAIN
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a,t1.b + t1.a) in (<cache>((4,9)),<cache>((8,8)),<cache>((7,7)))"
}
@@ -2512,6 +2530,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -2521,7 +2540,9 @@ EXPLAIN
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a,t1.b) in ((4,t1.a - 1),(8,t1.a + 8),(7,t1.a + 7))"
}
@@ -2548,7 +2569,7 @@ insert into t2 values
explain select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(2,2));
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range|filter idx1,idx2 idx1|idx2 5|5 NULL 3 (60%) Using index condition; Using where; Using rowid filter
+1 SIMPLE t2 range idx1,idx2 idx1 5 NULL 3 Using index condition; Using where
1 SIMPLE t1 ref idx idx 5 test.t2.d 8
explain format=json select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(2,2));
@@ -2556,6 +2577,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -2565,15 +2587,9 @@ EXPLAIN
"key": "idx1",
"key_length": "5",
"used_key_parts": ["d"],
- "rowid_filter": {
- "range": {
- "key": "idx2",
- "used_key_parts": ["e"]
- },
- "rows": 12,
- "selectivity_pct": 60
- },
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 60,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((2,2)))"
@@ -2588,7 +2604,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
+ "loops": 1.8,
"rows": 8,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -2642,6 +2660,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -2659,7 +2678,9 @@ EXPLAIN
"rows": 15,
"selectivity_pct": 14.42307692
},
+ "loops": 1,
"rows": 8,
+ "cost": "COST_REPLACED",
"filtered": 14.42307663,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1"
@@ -2674,8 +2695,10 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
+ "loops": 1.153846154,
"rows": 8,
- "filtered": 100
+ "cost": "COST_REPLACED",
+ "filtered": 73.17073059
}
}
]
@@ -2684,60 +2707,60 @@ EXPLAIN
select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1;
a b c d e f
-3 2 uuuw 3 3 i
3 2 uuua 3 3 i
-3 3 zzzz 3 3 i
-3 3 zyxw 3 3 i
-3 3 zzza 3 3 i
-3 3 zyxa 3 3 i
-3 2 uuuw 3 3 i
3 2 uuua 3 3 i
-3 3 zzzz 3 3 i
+3 2 uuuw 3 3 i
+3 2 uuuw 3 3 i
+3 3 zyxa 3 3 i
+3 3 zyxa 3 3 i
+3 3 zyxw 3 3 i
3 3 zyxw 3 3 i
3 3 zzza 3 3 i
-3 3 zyxa 3 3 i
-7 7 xxxyy 7 7 h
+3 3 zzza 3 3 i
+3 3 zzzz 3 3 i
+3 3 zzzz 3 3 i
7 7 xxxya 7 7 h
-7 8 xxxxx 7 7 h
+7 7 xxxyy 7 7 h
7 8 xxxxa 7 7 h
+7 8 xxxxx 7 7 h
prepare stmt from "select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1";
execute stmt;
a b c d e f
-3 2 uuuw 3 3 i
3 2 uuua 3 3 i
-3 3 zzzz 3 3 i
-3 3 zyxw 3 3 i
-3 3 zzza 3 3 i
-3 3 zyxa 3 3 i
-3 2 uuuw 3 3 i
3 2 uuua 3 3 i
-3 3 zzzz 3 3 i
+3 2 uuuw 3 3 i
+3 2 uuuw 3 3 i
+3 3 zyxa 3 3 i
+3 3 zyxa 3 3 i
+3 3 zyxw 3 3 i
3 3 zyxw 3 3 i
3 3 zzza 3 3 i
-3 3 zyxa 3 3 i
-7 7 xxxyy 7 7 h
+3 3 zzza 3 3 i
+3 3 zzzz 3 3 i
+3 3 zzzz 3 3 i
7 7 xxxya 7 7 h
-7 8 xxxxx 7 7 h
+7 7 xxxyy 7 7 h
7 8 xxxxa 7 7 h
+7 8 xxxxx 7 7 h
execute stmt;
a b c d e f
-3 2 uuuw 3 3 i
3 2 uuua 3 3 i
-3 3 zzzz 3 3 i
-3 3 zyxw 3 3 i
-3 3 zzza 3 3 i
-3 3 zyxa 3 3 i
-3 2 uuuw 3 3 i
3 2 uuua 3 3 i
-3 3 zzzz 3 3 i
+3 2 uuuw 3 3 i
+3 2 uuuw 3 3 i
+3 3 zyxa 3 3 i
+3 3 zyxa 3 3 i
+3 3 zyxw 3 3 i
3 3 zyxw 3 3 i
3 3 zzza 3 3 i
-3 3 zyxa 3 3 i
-7 7 xxxyy 7 7 h
+3 3 zzza 3 3 i
+3 3 zzzz 3 3 i
+3 3 zzzz 3 3 i
7 7 xxxya 7 7 h
-7 8 xxxxx 7 7 h
+7 7 xxxyy 7 7 h
7 8 xxxxa 7 7 h
+7 8 xxxxx 7 7 h
deallocate prepare stmt;
insert into t1 select * from t1;
# join order: (t2,t1) with ref access of t1
@@ -2753,6 +2776,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -2770,7 +2794,9 @@ EXPLAIN
"rows": 7,
"selectivity_pct": 6.730769231
},
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 6.730769157,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1"
@@ -2785,7 +2811,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
+ "loops": 1,
"rows": 11,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -2795,54 +2823,64 @@ EXPLAIN
select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
a b c d e f
-7 7 xxxyy 7 7 h
7 7 xxxya 7 7 h
-7 7 xxxyy 7 7 h
7 7 xxxya 7 7 h
-7 8 xxxxx 7 7 h
+7 7 xxxyy 7 7 h
+7 7 xxxyy 7 7 h
7 8 xxxxa 7 7 h
-7 8 xxxxx 7 7 h
7 8 xxxxa 7 7 h
+7 8 xxxxx 7 7 h
+7 8 xxxxx 7 7 h
alter table t2 drop index idx1, drop index idx2, add index idx3(d,e);
# join order: (t2,t1) with ref access of t1
# range access to t2 by 2-component keys for index idx3
explain select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range idx3 idx3 10 NULL 5 Using index condition; Using where
-1 SIMPLE t1 ref idx idx 5 test.t2.d 11
+1 SIMPLE t1 range idx idx 5 NULL 15 Using index condition
+1 SIMPLE t2 range idx3 idx3 10 NULL 5 Using where; Using join buffer (flat, BNL join)
explain format=json select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
- "table_name": "t2",
- "access_type": "range",
- "possible_keys": ["idx3"],
- "key": "idx3",
- "key_length": "10",
- "used_key_parts": ["d", "e"],
- "rows": 5,
- "filtered": 100,
- "index_condition": "t2.d is not null",
- "attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1"
- }
- },
- {
- "table": {
"table_name": "t1",
- "access_type": "ref",
+ "access_type": "range",
"possible_keys": ["idx"],
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
- "ref": ["test.t2.d"],
- "rows": 11,
- "filtered": 100
+ "loops": 1,
+ "rows": 15,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "index_condition": "1"
+ }
+ },
+ {
+ "block-nl-join": {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["idx3"],
+ "key": "idx3",
+ "key_length": "10",
+ "used_key_parts": ["d", "e"],
+ "loops": 15,
+ "rows": 5,
+ "cost": "COST_REPLACED",
+ "filtered": 60,
+ "attached_condition": "octet_length(t2.f) = 1"
+ },
+ "buffer_type": "flat",
+ "buffer_size": "461",
+ "join_type": "BNL",
+ "attached_condition": "t2.d = t1.a and (t1.a,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8)))"
}
}
]
@@ -2851,14 +2889,14 @@ EXPLAIN
select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
a b c d e f
-7 7 xxxyy 7 7 h
7 7 xxxya 7 7 h
-7 7 xxxyy 7 7 h
7 7 xxxya 7 7 h
-7 8 xxxxx 7 7 h
+7 7 xxxyy 7 7 h
+7 7 xxxyy 7 7 h
7 8 xxxxa 7 7 h
-7 8 xxxxx 7 7 h
7 8 xxxxa 7 7 h
+7 8 xxxxx 7 7 h
+7 8 xxxxx 7 7 h
# join order: (t1,t2) with ref access of t2
# range access to t1 by 1-component keys for index idx
explain select * from t1,t2
@@ -2872,6 +2910,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -2881,7 +2920,9 @@ EXPLAIN
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 15,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t1.a is not null"
}
@@ -2895,7 +2936,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
+ "loops": 15,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a,t2.e) in ((4,t1.a + 1),(7,t1.a + 1),(8,t1.a + 1)) and octet_length(t2.f) = 1"
}
@@ -2906,22 +2949,22 @@ EXPLAIN
select * from t1,t2
where a = d and (a,e) in ((4,d+1),(7,d+1),(8,d+1)) and length(f) = 1;
a b c d e f
-4 3 zyx 4 5 a
4 3 zya 4 5 a
-4 3 zyx 4 5 a
4 3 zya 4 5 a
-4 5 ww 4 5 a
+4 3 zyx 4 5 a
+4 3 zyx 4 5 a
4 5 wa 4 5 a
-4 5 ww 4 5 a
4 5 wa 4 5 a
-7 7 xxxyy 7 8 b
+4 5 ww 4 5 a
+4 5 ww 4 5 a
7 7 xxxya 7 8 b
-7 7 xxxyy 7 8 b
7 7 xxxya 7 8 b
-7 8 xxxxx 7 8 b
+7 7 xxxyy 7 8 b
+7 7 xxxyy 7 8 b
7 8 xxxxa 7 8 b
-7 8 xxxxx 7 8 b
7 8 xxxxa 7 8 b
+7 8 xxxxx 7 8 b
+7 8 xxxxx 7 8 b
# join order: (t1,t2) with ref access of t2
# no range access
explain select * from t1,t2
@@ -2935,13 +2978,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"possible_keys": ["idx"],
+ "loops": 1,
"rows": 144,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a is not null"
}
@@ -2955,7 +3001,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
+ "loops": 144,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a,t2.e) in ((t2.e,t1.a + 1),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1"
}
@@ -2966,14 +3014,14 @@ EXPLAIN
select * from t1,t2
where a = d and (a,e) in ((e,d+1),(7,7),(8,8)) and length(f) = 1;
a b c d e f
-7 8 xxxxx 7 7 h
-7 7 xxxyy 7 7 h
-7 8 xxxxa 7 7 h
7 7 xxxya 7 7 h
-7 8 xxxxx 7 7 h
+7 7 xxxya 7 7 h
+7 7 xxxyy 7 7 h
7 7 xxxyy 7 7 h
7 8 xxxxa 7 7 h
-7 7 xxxya 7 7 h
+7 8 xxxxa 7 7 h
+7 8 xxxxx 7 7 h
+7 8 xxxxx 7 7 h
# join order: (t1,t2) with ref access of t2
# range access to t1 by 1-component keys for index idx
explain select * from t1,t2
@@ -2989,6 +3037,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -2998,7 +3047,9 @@ EXPLAIN
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t1.a is not null",
"attached_condition": "(t1.a,2) in (<cache>((2,2)),<cache>((7,7)),<cache>((8,8))) and octet_length(t1.c) = 1"
@@ -3013,7 +3064,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
+ "loops": 12,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "octet_length(t2.f) = 1"
}
@@ -3072,6 +3125,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -3094,7 +3148,9 @@ EXPLAIN
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t1.a is not null",
"attached_condition": "(t1.a,1 + 1) in (<cache>((2,2)),<cache>((7,7)),<cache>((8,8))) and octet_length(t1.c) = 1"
@@ -3109,7 +3165,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
+ "loops": 12,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "octet_length(t2.f) = 1"
}
@@ -3387,7 +3445,7 @@ insert into t2 select A.a + B.a*10 + C.a*100 from ten A, ten B,ten C where A.a +
# expected type=range, rows=1487 , reason=using index dives
analyze SELECT * FROM t1 where a in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198);
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
-1 SIMPLE t1 range a a 5 NULL 1487 1199.00 100.00 100.00 Using where; Using index
+1 SIMPLE t1 index a a 5 NULL 2000 2000.00 74.35 59.95 Using where; Using index
insert into t2 values (200),(201);
# expected type=range, rows=201 , reason=using index statistics
analyze SELECT * FROM t1 where a in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,200,201);
@@ -3739,3 +3797,58 @@ DROP TABLE t1;
set global innodb_stats_persistent= @innodb_stats_persistent_save;
set global innodb_stats_persistent_sample_pages=
@innodb_stats_persistent_sample_pages_save;
+#
+# MDEV-31258 Assertion `cond_selectivity <= 1.000000001' upon range
+# query
+#
+CREATE TABLE t1 (id int, a int, b char(3), PRIMARY KEY (id), KEY idx (a,b)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES
+(1,8,'UT'),(2,0,'NU'),(3,1,'SD'),(4,0,'QU'),(5,0,'FL'),(6,0,'ZR'),
+(7,3,'LA'),(8,5,'NU'),(9,0,'NU'),(10,0,'SD'),(11,0,'NU'),(12,1,'SD'),
+(13,0,'BD'),(14,0,'PA'),(15,0,'VT'),(16,4,'WA'),(17,0,'ME'),(18,6,'OH'),
+(19,0,'ME'),(20,4,'NU'),(21,0,'SC'),(22,0,'GA'),(23,1,'CO'),(24,0,'IL'),
+(25,0,'GA'),(26,0,'HI'),(27,0,'BU'),(28,0,'NU'),(29,7,'LA'),(30,0,'NU'),
+(31,0,'JR'),(32,6,'BR'),(33,0,'NU'),(34,6,'CO'),(35,7,'NU'),(36,2,'LA'),
+(37,0,'PR'),(38,1,'UT'),(39,2,'BR'),(40,1,'HI'),(41,0,'SD'),(42,0,'RI'),
+(43,2,'LA'),(44,0,'TN'),(45,4,'HI'),(46,0,'VT'),(47,1,'NU'),(48,0,'SC'),
+(49,0,'TX'),(50,8,'DC'),(51,4,'NU'),(52,0,'AL'),(53,0,'CO'),(54,9,'PR'),
+(55,0,'AR'),(56,0,'SD'),(57,0,'RI'),(58,0,'XE'),(59,0,'NU'),(60,4,'EL'),
+(61,2,'LA'),(62,5,'UT'),(63,3,'NU'),(64,0,'RI'),(65,1,'NU'),(66,0,'BR'),
+(67,3,'WA'),(68,0,'TN'),(69,3,'HI'),(70,0,'OH'),(71,8,'GA'),(72,6,'AL'),
+(73,6,'NU'),(74,1,'HI'),(75,5,'JR'),(76,3,'RI'),(77,0,'DC'),(78,0,'SC'),
+(79,0,'CO'),(80,2,'BO'),(81,8,'XE'),(82,1,'NU'),(83,0,'SD'),(84,0,'PA'),
+(85,5,'PA'),(86,0,'QU'),(87,0,'PA'),(88,0,'NU'),(89,0,'ND'),(90,0,'UT'),
+(91,0,'NU'),(92,0,'NU'),(93,6,'ZR'),(94,0,'NU'),(95,2,'EL'),(96,0,'NU'),
+(97,0,'RI'),(98,5,'DC'),(99,7,'JR'),(100,5,'CO'),(101,0,'UT'),(102,0,'QU'),
+(103,0,'NU'),(104,0,'GA'),(105,7,'AK'),(106,0,'ZR'),(107,0,'YT'),(108,0,'MD'),
+(109,0,'NU'),(110,1,'EL'),(111,0,'ME'),(112,0,'VT'),(113,2,'NU'),(114,0,'CO'),
+(115,5,'TN'),(116,0,'OH'),(117,0,'GA'),(118,9,'GA'),(119,0,'CO'),(120,0,'AL'),
+(121,0,'NU'),(122,2,'NE'),(123,2,'TX'),(124,3,'CO'),(125,0,'TN'),(126,0,'WA'),
+(127,0,'NE'),(128,6,'TN'),(129,0,'BR'),(130,0,'ID'),(131,0,'NU'),(132,2,'EL'),
+(133,0,'PR'),(134,0,'NU'),(135,1,'AZ'),(136,7,'EL'),(137,0,'TN'),(138,0,'PA'),
+(139,5,'QU'),(140,0,'AR'),(141,0,'DC'),(142,2,'WA'),(143,7,'OH'),(144,2,'CO'),
+(145,6,'NU'),(146,9,'FL'),(147,0,'HI'),(148,0,'WA'),(149,1,'BR'),(150,3,'QU');
+SELECT id, MIN(id) FROM t1
+WHERE (b > 'TX' OR b BETWEEN 'NE' AND 'SC') AND id IN (1,7,8) AND a = 5
+GROUP BY id;
+id MIN(id)
+8 8
+DROP TABLE t1;
+#
+# MDEV-31237 Assertion `!(tab->select && tab->select->quick)' failed
+# in make_join_readinfo
+#
+CREATE TABLE lineitem (l_orderkey int, l_linenumber int, l_receiptDATE date DEFAULT NULL, PRIMARY KEY (l_orderkey,l_linenumber), KEY i_l_receiptdate (l_receiptDATE), KEY i_l_orderkey (l_orderkey)) ENGINE=InnoDB;
+INSERT INTO lineitem VALUES (291,1,'1994-06-23'),(291,2,'1994-06-19'),
+(291,3,'1994-03-24'),(292,1,'1992-03-18'),(292,2,'1992-04-20');
+EXPLAIN SELECT DISTINCT l_orderkey FROM lineitem FORCE KEY (i_l_orderkey, i_l_receiptdate) WHERE l_orderkey > 1 ORDER BY l_receiptdate;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE lineitem range i_l_orderkey i_l_orderkey 4 NULL 5 Using where; Using temporary; Using filesort
+SELECT DISTINCT l_orderkey FROM lineitem FORCE KEY (i_l_orderkey, i_l_receiptdate) WHERE l_orderkey > 1 ORDER BY l_receiptdate;
+l_orderkey
+292
+291
+DROP TABLE lineitem;
+#
+# End of 11.0 tests
+#
diff --git a/mysql-test/main/range.test b/mysql-test/main/range.test
index c42670c1..28ee8e5c 100644
--- a/mysql-test/main/range.test
+++ b/mysql-test/main/range.test
@@ -3,6 +3,8 @@
# Problem with range optimizer
#
--source include/have_innodb.inc
+--source include/have_sequence.inc
+
SET optimizer_use_condition_selectivity=4;
set @innodb_stats_persistent_save= @@innodb_stats_persistent;
@@ -263,9 +265,9 @@ WHERE
);
DROP TABLE t1;
-#
-# Test of problem with IN on many different keyparts. (Bug #4157)
-#
+--echo #
+--echo # Test of problem with IN on many different keyparts. (Bug #4157)
+--echo #
CREATE TABLE t1 (
id int( 11 ) unsigned NOT NULL AUTO_INCREMENT ,
@@ -284,7 +286,10 @@ KEY recount( owner, line )
) ENGINE = MYISAM;
INSERT into t1 (owner,id,columnid,line) values (11,15,15,1),(11,13,13,5);
+INSERT into t1 (owner,id,columnid,line) select 11,seq+20,seq,seq from seq_1_to_100;
+explain SELECT id, columnid, tableid, content, showid, line, ordinal FROM t1 WHERE owner=11 AND ((columnid IN ( 15, 13, 14 ) AND line IN ( 1, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 31 )) OR (columnid IN ( 13, 14 ) AND line IN ( 15 ))) LIMIT 0 , 30;
+--sorted_result
SELECT id, columnid, tableid, content, showid, line, ordinal FROM t1 WHERE owner=11 AND ((columnid IN ( 15, 13, 14 ) AND line IN ( 1, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 31 )) OR (columnid IN ( 13, 14 ) AND line IN ( 15 ))) LIMIT 0 , 30;
drop table t1;
@@ -1025,7 +1030,8 @@ create table t2 (a int, b int, filler char(100));
insert into t2 select A.a + 10 * (B.a + 10 * C.a), 10, 'filler' from t1 A,
t1 B, t1 C where A.a < 5;
-insert into t2 select 1000, b, 'filler' from t2;
+insert into t2 select 1000, b, 'filler' from t2 limit 50;
+select count(*) from t2;
alter table t2 add index (a,b);
# t2 values
# ( 1 , 10, 'filler')
@@ -1033,13 +1039,14 @@ alter table t2 add index (a,b);
# ( 3 , 10, 'filler')
# (... , 10, 'filler')
# ...
-# (1000, 10, 'filler') - 500 times
+# (1000, 10, 'filler') - 100 times
-# 500 rows, 1 row
+# 50 rows, 1 row
-select 'In following EXPLAIN the access method should be ref, #rows~=500 (and not 2)' Z;
-explain select * from t2 where a=1000 and b<11;
+--echo # In following EXPLAIN the access method should be ref, #rows~=50
+--echo # (and not 2) when we are not using rowid-ordered scans
+explain select * from t2 where a=1000 and b<11;
drop table t1, t2;
#
@@ -1913,6 +1920,7 @@ insert into t1 values
let $q1=
select * from t1 where (a,b) IN ((2, 3),(3,3),(8,8),(7,7));
eval explain $q1;
+--source include/explain-no-costs.inc
eval explain format=json $q1;
eval $q1;
eval prepare stmt from "$q1";
@@ -1924,6 +1932,7 @@ deallocate prepare stmt;
let $q2=
select * from t1 where (a,b+a) IN ((4,9),(8,8),(7,7));
eval explain $q2;
+--source include/explain-no-costs.inc
eval explain format=json $q2;
eval $q2;
@@ -1931,6 +1940,7 @@ eval $q2;
let $q3=
select * from t1 where (a,b) IN ((4,a-1),(8,a+8),(7,a+7));
eval explain $q3;
+--source include/explain-no-costs.inc
eval explain format=json $q3;
eval $q3;
@@ -1954,6 +1964,7 @@ let $q4=
select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(2,2));
eval explain $q4;
+--source include/explain-no-costs.inc
eval explain format=json $q4;
eval $q4;
@@ -1979,10 +1990,14 @@ let $q5=
select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1;
eval explain $q5;
+--source include/explain-no-costs.inc
eval explain format=json $q5;
+--sorted_result
eval $q5;
eval prepare stmt from "$q5";
+--sorted_result
execute stmt;
+--sorted_result
execute stmt;
deallocate prepare stmt;
@@ -1994,7 +2009,9 @@ let $q6=
select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
eval explain $q6;
+--source include/explain-no-costs.inc
eval explain format=json $q6;
+--sorted_result
eval $q6;
alter table t2 drop index idx1, drop index idx2, add index idx3(d,e);
@@ -2005,7 +2022,9 @@ let $q7=
select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
eval explain $q7;
+--source include/explain-no-costs.inc
eval explain format=json $q7;
+--sorted_result
eval $q7;
--echo # join order: (t1,t2) with ref access of t2
@@ -2014,7 +2033,9 @@ let $q8=
select * from t1,t2
where a = d and (a,e) in ((4,d+1),(7,d+1),(8,d+1)) and length(f) = 1;
eval explain $q8;
+--source include/explain-no-costs.inc
eval explain format=json $q8;
+--sorted_result
eval $q8;
--echo # join order: (t1,t2) with ref access of t2
@@ -2023,7 +2044,9 @@ let $q9=
select * from t1,t2
where a = d and (a,e) in ((e,d+1),(7,7),(8,8)) and length(f) = 1;
eval explain $q9;
+--source include/explain-no-costs.inc
eval explain format=json $q9;
+--sorted_result
eval $q9;
--echo # join order: (t1,t2) with ref access of t2
@@ -2033,6 +2056,7 @@ select * from t1,t2
where a = d and (a,2) in ((2,2),(7,7),(8,8)) and
length(c) = 1 and length(f) = 1;
eval explain $q10;
+--source include/explain-no-costs.inc
eval explain format=json $q10;
eval $q10;
eval prepare stmt from "$q10";
@@ -2053,6 +2077,7 @@ select * from t1,t2,t3
(a,v+1) in ((2,2),(7,7),(8,8)) and
length(c) = 1 and length(f) = 1;
eval explain $q11;
+--source include/explain-no-costs.inc
eval explain format=json $q11;
eval $q11;
@@ -2539,3 +2564,57 @@ DROP TABLE t1;
set global innodb_stats_persistent= @innodb_stats_persistent_save;
set global innodb_stats_persistent_sample_pages=
@innodb_stats_persistent_sample_pages_save;
+
+--echo #
+--echo # MDEV-31258 Assertion `cond_selectivity <= 1.000000001' upon range
+--echo # query
+--echo #
+
+CREATE TABLE t1 (id int, a int, b char(3), PRIMARY KEY (id), KEY idx (a,b)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES
+(1,8,'UT'),(2,0,'NU'),(3,1,'SD'),(4,0,'QU'),(5,0,'FL'),(6,0,'ZR'),
+(7,3,'LA'),(8,5,'NU'),(9,0,'NU'),(10,0,'SD'),(11,0,'NU'),(12,1,'SD'),
+(13,0,'BD'),(14,0,'PA'),(15,0,'VT'),(16,4,'WA'),(17,0,'ME'),(18,6,'OH'),
+(19,0,'ME'),(20,4,'NU'),(21,0,'SC'),(22,0,'GA'),(23,1,'CO'),(24,0,'IL'),
+(25,0,'GA'),(26,0,'HI'),(27,0,'BU'),(28,0,'NU'),(29,7,'LA'),(30,0,'NU'),
+(31,0,'JR'),(32,6,'BR'),(33,0,'NU'),(34,6,'CO'),(35,7,'NU'),(36,2,'LA'),
+(37,0,'PR'),(38,1,'UT'),(39,2,'BR'),(40,1,'HI'),(41,0,'SD'),(42,0,'RI'),
+(43,2,'LA'),(44,0,'TN'),(45,4,'HI'),(46,0,'VT'),(47,1,'NU'),(48,0,'SC'),
+(49,0,'TX'),(50,8,'DC'),(51,4,'NU'),(52,0,'AL'),(53,0,'CO'),(54,9,'PR'),
+(55,0,'AR'),(56,0,'SD'),(57,0,'RI'),(58,0,'XE'),(59,0,'NU'),(60,4,'EL'),
+(61,2,'LA'),(62,5,'UT'),(63,3,'NU'),(64,0,'RI'),(65,1,'NU'),(66,0,'BR'),
+(67,3,'WA'),(68,0,'TN'),(69,3,'HI'),(70,0,'OH'),(71,8,'GA'),(72,6,'AL'),
+(73,6,'NU'),(74,1,'HI'),(75,5,'JR'),(76,3,'RI'),(77,0,'DC'),(78,0,'SC'),
+(79,0,'CO'),(80,2,'BO'),(81,8,'XE'),(82,1,'NU'),(83,0,'SD'),(84,0,'PA'),
+(85,5,'PA'),(86,0,'QU'),(87,0,'PA'),(88,0,'NU'),(89,0,'ND'),(90,0,'UT'),
+(91,0,'NU'),(92,0,'NU'),(93,6,'ZR'),(94,0,'NU'),(95,2,'EL'),(96,0,'NU'),
+(97,0,'RI'),(98,5,'DC'),(99,7,'JR'),(100,5,'CO'),(101,0,'UT'),(102,0,'QU'),
+(103,0,'NU'),(104,0,'GA'),(105,7,'AK'),(106,0,'ZR'),(107,0,'YT'),(108,0,'MD'),
+(109,0,'NU'),(110,1,'EL'),(111,0,'ME'),(112,0,'VT'),(113,2,'NU'),(114,0,'CO'),
+(115,5,'TN'),(116,0,'OH'),(117,0,'GA'),(118,9,'GA'),(119,0,'CO'),(120,0,'AL'),
+(121,0,'NU'),(122,2,'NE'),(123,2,'TX'),(124,3,'CO'),(125,0,'TN'),(126,0,'WA'),
+(127,0,'NE'),(128,6,'TN'),(129,0,'BR'),(130,0,'ID'),(131,0,'NU'),(132,2,'EL'),
+(133,0,'PR'),(134,0,'NU'),(135,1,'AZ'),(136,7,'EL'),(137,0,'TN'),(138,0,'PA'),
+(139,5,'QU'),(140,0,'AR'),(141,0,'DC'),(142,2,'WA'),(143,7,'OH'),(144,2,'CO'),
+(145,6,'NU'),(146,9,'FL'),(147,0,'HI'),(148,0,'WA'),(149,1,'BR'),(150,3,'QU');
+
+SELECT id, MIN(id) FROM t1
+WHERE (b > 'TX' OR b BETWEEN 'NE' AND 'SC') AND id IN (1,7,8) AND a = 5
+GROUP BY id;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-31237 Assertion `!(tab->select && tab->select->quick)' failed
+--echo # in make_join_readinfo
+--echo #
+
+CREATE TABLE lineitem (l_orderkey int, l_linenumber int, l_receiptDATE date DEFAULT NULL, PRIMARY KEY (l_orderkey,l_linenumber), KEY i_l_receiptdate (l_receiptDATE), KEY i_l_orderkey (l_orderkey)) ENGINE=InnoDB;
+INSERT INTO lineitem VALUES (291,1,'1994-06-23'),(291,2,'1994-06-19'),
+ (291,3,'1994-03-24'),(292,1,'1992-03-18'),(292,2,'1992-04-20');
+EXPLAIN SELECT DISTINCT l_orderkey FROM lineitem FORCE KEY (i_l_orderkey, i_l_receiptdate) WHERE l_orderkey > 1 ORDER BY l_receiptdate;
+SELECT DISTINCT l_orderkey FROM lineitem FORCE KEY (i_l_orderkey, i_l_receiptdate) WHERE l_orderkey > 1 ORDER BY l_receiptdate;
+DROP TABLE lineitem;
+
+--echo #
+--echo # End of 11.0 tests
+--echo #
diff --git a/mysql-test/main/range_aria_dbt3.result b/mysql-test/main/range_aria_dbt3.result
index f08a1b24..be3bc79c 100644
--- a/mysql-test/main/range_aria_dbt3.result
+++ b/mysql-test/main/range_aria_dbt3.result
@@ -19,6 +19,16 @@ id select_type table type possible_keys key key_len ref rows Extra
SELECT COUNT(*) FROM lineitem WHERE l_orderkey BETWEEN 111 AND 262 OR ( l_orderkey BETWEEN 152 AND 672 AND l_linenumber BETWEEN 4 AND 9 );
COUNT(*)
293
+#
+# MDEV-30486 Table is not eliminated in bb-11.0
+#
+explain SELECT c_custkey, c_name AS currency2 FROM partsupp LEFT JOIN part ON ( p_partkey = ps_partkey ) JOIN supplier ON (s_suppkey = ps_suppkey) JOIN lineitem ON ( ps_suppkey = l_suppkey ) JOIN orders ON ( l_orderkey = o_orderkey ) JOIN customer ON ( o_custkey = c_custkey ) HAVING c_custkey > 150;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE supplier index PRIMARY PRIMARY 4 NULL 10 Using index
+1 SIMPLE partsupp ref i_ps_suppkey i_ps_suppkey 4 dbt3_s001.supplier.s_suppkey 16
+1 SIMPLE lineitem ref PRIMARY,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity i_l_suppkey 5 dbt3_s001.supplier.s_suppkey 100
+1 SIMPLE orders eq_ref PRIMARY,i_o_custkey PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 Using where
+1 SIMPLE customer eq_ref PRIMARY PRIMARY 4 dbt3_s001.orders.o_custkey 1
DROP DATABASE dbt3_s001;
#
# End of 10.5 tests
diff --git a/mysql-test/main/range_aria_dbt3.test b/mysql-test/main/range_aria_dbt3.test
index 141bf438..b373d5b9 100644
--- a/mysql-test/main/range_aria_dbt3.test
+++ b/mysql-test/main/range_aria_dbt3.test
@@ -26,6 +26,12 @@ explain SELECT COUNT(*) FROM lineitem WHERE l_orderkey BETWEEN 111 AND 262 OR (
SELECT COUNT(*) FROM lineitem WHERE l_orderkey BETWEEN 111 AND 262 OR ( l_orderkey BETWEEN 152 AND 672 AND l_linenumber BETWEEN 4 AND 9 );
+--echo #
+--echo # MDEV-30486 Table is not eliminated in bb-11.0
+--echo #
+
+explain SELECT c_custkey, c_name AS currency2 FROM partsupp LEFT JOIN part ON ( p_partkey = ps_partkey ) JOIN supplier ON (s_suppkey = ps_suppkey) JOIN lineitem ON ( ps_suppkey = l_suppkey ) JOIN orders ON ( l_orderkey = o_orderkey ) JOIN customer ON ( o_custkey = c_custkey ) HAVING c_custkey > 150;
+
DROP DATABASE dbt3_s001;
--echo #
diff --git a/mysql-test/main/range_innodb.result b/mysql-test/main/range_innodb.result
index eddfbfd0..98f41270 100644
--- a/mysql-test/main/range_innodb.result
+++ b/mysql-test/main/range_innodb.result
@@ -53,9 +53,9 @@ set optimizer_switch='extended_keys=on';
explain
select pk, a, b from t1,t2,t3 where b >= d and pk < c and b = '0';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ALL NULL NULL NULL NULL 2
-1 SIMPLE t1 ref PRIMARY,idx1,idx2 idx1 5 const 3 Using index condition
-1 SIMPLE t3 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t1 ref PRIMARY,idx1,idx2 idx1 5 const #
+1 SIMPLE t2 ALL NULL NULL NULL NULL # Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t3 ALL NULL NULL NULL NULL # Using where; Using join buffer (incremental, BNL join)
select pk, a, b from t1,t2,t3 where b >= d and pk < c and b = '0';
pk a b
1 6 0
@@ -83,6 +83,7 @@ drop table t1,t2;
# MDEV-14440: Server crash in in handler::ha_external_lock or Assertion `inited==RND'
# failed in handler::ha_rnd_end upon SELECT from partitioned table
#
+call mtr.add_suppression("Got error .* when reading table");
set @optimizer_switch_save= @@optimizer_switch;
set optimizer_switch='index_merge_sort_intersection=off';
create table t0(a int);
@@ -229,3 +230,23 @@ SELECT a FROM t1 WHERE pk < 0 AND a <= 'w' and b > 0;
a
drop table t1;
# End of 10.4 tests
+#
+# MDEV-31501 Assertion `cond_selectivity <= 1.000000001' failed
+# (actual value 1.125)
+#
+CREATE TABLE lineitem (l_orderkey int(11) NOT NULL DEFAULT '0', l_partkey int(11) DEFAULT NULL, l_suppkey int(11) DEFAULT NULL, l_linenumber int(11) NOT NULL DEFAULT '0', l_quantity double DEFAULT NULL, l_extendedprice double DEFAULT NULL, l_discount double DEFAULT NULL, l_tax double DEFAULT NULL, l_returnflag char(1) DEFAULT NULL, l_linestatus char(1) DEFAULT NULL, l_shipDATE date DEFAULT NULL, l_commitDATE date DEFAULT NULL, l_receiptDATE date DEFAULT NULL, l_shipinstruct char(25) DEFAULT NULL, l_shipmode char(10) DEFAULT NULL, l_comment varchar(44) DEFAULT NULL, PRIMARY KEY (l_orderkey,l_linenumber), KEY i_l_shipdate (l_shipDATE), KEY i_l_suppkey_partkey (l_partkey,l_suppkey), KEY i_l_partkey (l_partkey), KEY i_l_suppkey (l_suppkey), KEY i_l_receiptdate (l_receiptDATE), KEY i_l_orderkey (l_orderkey), KEY i_l_orderkey_quantity (l_orderkey,l_quantity), KEY i_l_commitdate (l_commitDATE)) ENGINE=InnoDB;
+CREATE TABLE part (p_partkey int(11) NOT NULL, p_name varchar(55) DEFAULT NULL, p_mfgr char(25) DEFAULT NULL, p_brand char(10) DEFAULT NULL, p_type varchar(25) DEFAULT NULL, p_size int(11) DEFAULT NULL, p_container char(10) DEFAULT NULL, p_retailprice double DEFAULT NULL, p_comment varchar(23) DEFAULT NULL, PRIMARY KEY (p_partkey)) ENGINE=InnoDB;
+CREATE TABLE partsupp (ps_partkey int(11) NOT NULL DEFAULT '0', ps_suppkey int(11) NOT NULL DEFAULT '0', ps_availqty int(11) DEFAULT NULL, ps_supplycost double DEFAULT NULL, ps_comment varchar(199) DEFAULT NULL, PRIMARY KEY (ps_partkey,ps_suppkey), KEY i_ps_partkey (ps_partkey), KEY i_ps_suppkey (ps_suppkey)) ENGINE=InnoDB;
+INSERT INTO lineitem VALUES (581,7,1,1,41,37187,0.09,0.07,'N','O','1997-05-26','1997-04-06','1997-06-10','TAKE BACK RETURN','MAIL','even, bold excuses about the'),(581,10,1,2,14,12740.14,0.06,0.08,'N','O','1997-05-17','1997-04-14','1997-06-08','NONE','MAIL','furiously silent depths'),(581,11,1,3,49,44639.49,0.1,0.02,'N','O','1997-02-27','1997-04-24','1997-03-10','TAKE BACK RETURN','MAIL','furiously regular theodolites wake qu'),(581,8,1,4,30,27240,0.1,0.08,'N','O','1997-06-19','1997-05-21','1997-06-22','TAKE BACK RETURN','TRUCK','even deposits wa'),(582,6,1,1,7,6342,0.07,0,'N','O','1997-11-16','1997-11-29','1997-12-10','TAKE BACK RETURN','FOB','carefully final requests sleep slyly. even,'),(582,6,1,2,49,44394,0.05,0.03,'N','O','1997-12-17','1998-01-12','1997-12-31','COLLECT COD','REG AIR','carefully regular'),(582,15,1,3,42,38430.42,0.07,0,'N','O','1997-11-15','1997-12-21','1997-12-03','COLLECT COD','SHIP','pending, spe'),(582,17,1,4,36,33012.36,0.06,0.01,'N','O','1997-12-09','1997-11-27','1997-12-26','TAKE BACK RETURN','SHIP','slyly final foxes nag permanen');
+INSERT INTO part VALUES (1,'goldenrod lace spring peru powder','Manufacturer#1','Brand#13','PROMO BURNISHED COPPER',7,'JUMBO PKG',901,'final deposits s'),(2,'blush rosy metallic lemon navajo','Manufacturer#1','Brand#13','LARGE BRUSHED BRASS',1,'LG CASE',902,'final platelets hang f'),(3,'dark green antique puff wheat','Manufacturer#4','Brand#42','STANDARD POLISHED BRASS',21,'WRAP CASE',903,'unusual excuses ac'),(4,'chocolate metallic smoke ghost drab','Manufacturer#3','Brand#34','SMALL PLATED BRASS',14,'MED DRUM',904,'ironi'),(5,'forest blush chiffon thistle chocolate','Manufacturer#3','Brand#32','STANDARD POLISHED TIN',15,'SM PKG',905,'pending, spe'),(6,'white ivory azure firebrick black','Manufacturer#2','Brand#24','PROMO PLATED STEEL',4,'MED BAG',906,'pending pinto be'),(7,'blue blanched tan indian olive','Manufacturer#1','Brand#11','SMALL PLATED COPPER',45,'SM BAG',907,'blithely ironic');
+INSERT INTO partsupp VALUES (1,1,3325,771.64,'requests after the carefully ironic ideas cajole alongside of the enticingly special accounts. fluffily regular deposits haggle about the blithely ironic deposits. regular requests sleep c'),(2,1,8895,378.49,'furiously even asymptotes are furiously regular plate'),(3,1,4651,920.92,'ironic, pending theodolites sleep slyly at the slyly final foxes. slyly ironic accounts sleep express accounts. quickly fina'),(4,1,1339,113.97,'furiously even accounts sleep. slyly regular deposits hag'),(5,1,3735,255.88,'even, ironic requests snooze blithely throughout the carefully pending deposits. busy deposits mold blithely after the furiously final pinto beans. regular, unus'),(6,1,8851,130.72,'carefully regular asymptotes wake slyly according to the quickly re'),(7,1,7454,763.98,'carefully even ideas should wake. blithely final instructions are special foxes. pending, ironic requests wake blithely about the furiously regular foxes. ironic idea'),(8,1,6834,249.63,'furiously unusual instructions use quickly. unusual deposits among the regular deposits doze unusual epitaph'),(9,1,7054,84.2,'final ideas through the requests boost quickly about the furiously regular accounts. blithely silent foxes affix carefully ironic instructions. blithely bold foxe'),(10,1,2952,996.12,'blithely even foxes nag furiously about the quickly ex'),(11,1,4540,709.87,'final packages mold after the carefully unusual requests. quickly fi'),(12,1,3610,659.73,'unusual dolphins sleep slyly. ironic deposits use fluffily. carefully unusual platelets poach slyly. evenly pending deposits nag ironi'),(13,1,612,169.44,'blithely special theodolites serve quickly. regular deposits are alongside of the fluffily sl'),(14,1,5278,650.07,'quickly even deposits doze quickly pending, bold deposits. carefully regular packages sublate carefully'),(15,1,7047,835.7,'packages haggle across the carefully express ideas. slyly bold instructions promise even, express packages. furiously ironic acc');
+SELECT ps_suppkey FROM part
+JOIN partsupp ON (p_partkey = ps_partkey)
+JOIN lineitem ON (ps_partkey = l_partkey AND ps_suppkey = l_suppkey)
+WHERE p_partkey != 222 order by 1 limit 1;
+ps_suppkey
+1
+drop table partsupp,part,lineitem;
+#
+# End of 11.0 tests
+#
diff --git a/mysql-test/main/range_innodb.test b/mysql-test/main/range_innodb.test
index 276b9cea..f7e6a31d 100644
--- a/mysql-test/main/range_innodb.test
+++ b/mysql-test/main/range_innodb.test
@@ -58,6 +58,8 @@ insert into t3 values (3),(-1),(4);
set @save_optimizer_switch=@@optimizer_switch;
set optimizer_switch='extended_keys=on';
+# InnoDB sometimes returns 4 other times 5 records for t1
+--replace_column 9 #
explain
select pk, a, b from t1,t2,t3 where b >= d and pk < c and b = '0';
select pk, a, b from t1,t2,t3 where b >= d and pk < c and b = '0';
@@ -89,6 +91,8 @@ drop table t1,t2;
--echo # failed in handler::ha_rnd_end upon SELECT from partitioned table
--echo #
+call mtr.add_suppression("Got error .* when reading table");
+
set @optimizer_switch_save= @@optimizer_switch;
set optimizer_switch='index_merge_sort_intersection=off';
create table t0(a int);
@@ -221,3 +225,25 @@ SELECT a FROM t1 WHERE pk < 0 AND a <= 'w' and b > 0;
drop table t1;
-- echo # End of 10.4 tests
+
+--echo #
+--echo # MDEV-31501 Assertion `cond_selectivity <= 1.000000001' failed
+--echo # (actual value 1.125)
+--echo #
+
+CREATE TABLE lineitem (l_orderkey int(11) NOT NULL DEFAULT '0', l_partkey int(11) DEFAULT NULL, l_suppkey int(11) DEFAULT NULL, l_linenumber int(11) NOT NULL DEFAULT '0', l_quantity double DEFAULT NULL, l_extendedprice double DEFAULT NULL, l_discount double DEFAULT NULL, l_tax double DEFAULT NULL, l_returnflag char(1) DEFAULT NULL, l_linestatus char(1) DEFAULT NULL, l_shipDATE date DEFAULT NULL, l_commitDATE date DEFAULT NULL, l_receiptDATE date DEFAULT NULL, l_shipinstruct char(25) DEFAULT NULL, l_shipmode char(10) DEFAULT NULL, l_comment varchar(44) DEFAULT NULL, PRIMARY KEY (l_orderkey,l_linenumber), KEY i_l_shipdate (l_shipDATE), KEY i_l_suppkey_partkey (l_partkey,l_suppkey), KEY i_l_partkey (l_partkey), KEY i_l_suppkey (l_suppkey), KEY i_l_receiptdate (l_receiptDATE), KEY i_l_orderkey (l_orderkey), KEY i_l_orderkey_quantity (l_orderkey,l_quantity), KEY i_l_commitdate (l_commitDATE)) ENGINE=InnoDB;
+CREATE TABLE part (p_partkey int(11) NOT NULL, p_name varchar(55) DEFAULT NULL, p_mfgr char(25) DEFAULT NULL, p_brand char(10) DEFAULT NULL, p_type varchar(25) DEFAULT NULL, p_size int(11) DEFAULT NULL, p_container char(10) DEFAULT NULL, p_retailprice double DEFAULT NULL, p_comment varchar(23) DEFAULT NULL, PRIMARY KEY (p_partkey)) ENGINE=InnoDB;
+CREATE TABLE partsupp (ps_partkey int(11) NOT NULL DEFAULT '0', ps_suppkey int(11) NOT NULL DEFAULT '0', ps_availqty int(11) DEFAULT NULL, ps_supplycost double DEFAULT NULL, ps_comment varchar(199) DEFAULT NULL, PRIMARY KEY (ps_partkey,ps_suppkey), KEY i_ps_partkey (ps_partkey), KEY i_ps_suppkey (ps_suppkey)) ENGINE=InnoDB;
+INSERT INTO lineitem VALUES (581,7,1,1,41,37187,0.09,0.07,'N','O','1997-05-26','1997-04-06','1997-06-10','TAKE BACK RETURN','MAIL','even, bold excuses about the'),(581,10,1,2,14,12740.14,0.06,0.08,'N','O','1997-05-17','1997-04-14','1997-06-08','NONE','MAIL','furiously silent depths'),(581,11,1,3,49,44639.49,0.1,0.02,'N','O','1997-02-27','1997-04-24','1997-03-10','TAKE BACK RETURN','MAIL','furiously regular theodolites wake qu'),(581,8,1,4,30,27240,0.1,0.08,'N','O','1997-06-19','1997-05-21','1997-06-22','TAKE BACK RETURN','TRUCK','even deposits wa'),(582,6,1,1,7,6342,0.07,0,'N','O','1997-11-16','1997-11-29','1997-12-10','TAKE BACK RETURN','FOB','carefully final requests sleep slyly. even,'),(582,6,1,2,49,44394,0.05,0.03,'N','O','1997-12-17','1998-01-12','1997-12-31','COLLECT COD','REG AIR','carefully regular'),(582,15,1,3,42,38430.42,0.07,0,'N','O','1997-11-15','1997-12-21','1997-12-03','COLLECT COD','SHIP','pending, spe'),(582,17,1,4,36,33012.36,0.06,0.01,'N','O','1997-12-09','1997-11-27','1997-12-26','TAKE BACK RETURN','SHIP','slyly final foxes nag permanen');
+INSERT INTO part VALUES (1,'goldenrod lace spring peru powder','Manufacturer#1','Brand#13','PROMO BURNISHED COPPER',7,'JUMBO PKG',901,'final deposits s'),(2,'blush rosy metallic lemon navajo','Manufacturer#1','Brand#13','LARGE BRUSHED BRASS',1,'LG CASE',902,'final platelets hang f'),(3,'dark green antique puff wheat','Manufacturer#4','Brand#42','STANDARD POLISHED BRASS',21,'WRAP CASE',903,'unusual excuses ac'),(4,'chocolate metallic smoke ghost drab','Manufacturer#3','Brand#34','SMALL PLATED BRASS',14,'MED DRUM',904,'ironi'),(5,'forest blush chiffon thistle chocolate','Manufacturer#3','Brand#32','STANDARD POLISHED TIN',15,'SM PKG',905,'pending, spe'),(6,'white ivory azure firebrick black','Manufacturer#2','Brand#24','PROMO PLATED STEEL',4,'MED BAG',906,'pending pinto be'),(7,'blue blanched tan indian olive','Manufacturer#1','Brand#11','SMALL PLATED COPPER',45,'SM BAG',907,'blithely ironic');
+INSERT INTO partsupp VALUES (1,1,3325,771.64,'requests after the carefully ironic ideas cajole alongside of the enticingly special accounts. fluffily regular deposits haggle about the blithely ironic deposits. regular requests sleep c'),(2,1,8895,378.49,'furiously even asymptotes are furiously regular plate'),(3,1,4651,920.92,'ironic, pending theodolites sleep slyly at the slyly final foxes. slyly ironic accounts sleep express accounts. quickly fina'),(4,1,1339,113.97,'furiously even accounts sleep. slyly regular deposits hag'),(5,1,3735,255.88,'even, ironic requests snooze blithely throughout the carefully pending deposits. busy deposits mold blithely after the furiously final pinto beans. regular, unus'),(6,1,8851,130.72,'carefully regular asymptotes wake slyly according to the quickly re'),(7,1,7454,763.98,'carefully even ideas should wake. blithely final instructions are special foxes. pending, ironic requests wake blithely about the furiously regular foxes. ironic idea'),(8,1,6834,249.63,'furiously unusual instructions use quickly. unusual deposits among the regular deposits doze unusual epitaph'),(9,1,7054,84.2,'final ideas through the requests boost quickly about the furiously regular accounts. blithely silent foxes affix carefully ironic instructions. blithely bold foxe'),(10,1,2952,996.12,'blithely even foxes nag furiously about the quickly ex'),(11,1,4540,709.87,'final packages mold after the carefully unusual requests. quickly fi'),(12,1,3610,659.73,'unusual dolphins sleep slyly. ironic deposits use fluffily. carefully unusual platelets poach slyly. evenly pending deposits nag ironi'),(13,1,612,169.44,'blithely special theodolites serve quickly. regular deposits are alongside of the fluffily sl'),(14,1,5278,650.07,'quickly even deposits doze quickly pending, bold deposits. carefully regular packages sublate carefully'),(15,1,7047,835.7,'packages haggle across the carefully express ideas. slyly bold instructions promise even, express packages. furiously ironic acc');
+
+SELECT ps_suppkey FROM part
+ JOIN partsupp ON (p_partkey = ps_partkey)
+ JOIN lineitem ON (ps_partkey = l_partkey AND ps_suppkey = l_suppkey)
+ WHERE p_partkey != 222 order by 1 limit 1;
+
+drop table partsupp,part,lineitem;
+--echo #
+--echo # End of 11.0 tests
+--echo #
diff --git a/mysql-test/main/range_interrupted-13751.result b/mysql-test/main/range_interrupted-13751.result
index 68610cdd..eadd32bf 100644
--- a/mysql-test/main/range_interrupted-13751.result
+++ b/mysql-test/main/range_interrupted-13751.result
@@ -1,11 +1,11 @@
CREATE TABLE t1 (i INT AUTO_INCREMENT, c VARCHAR(1), KEY(i), KEY(c,i)) ENGINE=MyISAM;
-INSERT INTO t1 (c) VALUES ('a'),('b'),('c'),('d');
-INSERT INTO t1 (c) SELECT c FROM t1;
-INSERT INTO t1 (c) SELECT c FROM t1;
-INSERT INTO t1 (c) SELECT c FROM t1;
-INSERT INTO t1 (c) SELECT c FROM t1;
-INSERT INTO t1 (c) SELECT c FROM t1;
-INSERT INTO t1 (c) SELECT c FROM t1;
+INSERT INTO t1 (c) select mid("abcdefgh", mod(seq,8)+1, 1) from seq_1_to_256;
+explain SELECT 1 FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
+WHERE alias1.c = alias2.c OR alias1.i <= 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE alias2 index c c 8 NULL 256 Using index
+1 SIMPLE alias3 index NULL i 4 NULL 256 Using index; Using join buffer (flat, BNL join)
+1 SIMPLE alias1 ALL i,c NULL NULL NULL 256 Range checked for each record (index map: 0x3)
set @old_dbug=@@session.debug_dbug;
SET debug_dbug="+d,kill_join_init_read_record";
SELECT 1 FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
diff --git a/mysql-test/main/range_interrupted-13751.test b/mysql-test/main/range_interrupted-13751.test
index b0793ede..939f15b2 100644
--- a/mysql-test/main/range_interrupted-13751.test
+++ b/mysql-test/main/range_interrupted-13751.test
@@ -1,17 +1,15 @@
--- source include/have_debug.inc
+--source include/have_debug.inc
--source include/default_optimizer_switch.inc
+--source include/have_sequence.inc
#
# MDEV-13751 Interrupted SELECT fails with 1030: 'Got error 1 "Operation not permitted" from storage engine MyISAM'
#
CREATE TABLE t1 (i INT AUTO_INCREMENT, c VARCHAR(1), KEY(i), KEY(c,i)) ENGINE=MyISAM;
-INSERT INTO t1 (c) VALUES ('a'),('b'),('c'),('d');
-INSERT INTO t1 (c) SELECT c FROM t1;
-INSERT INTO t1 (c) SELECT c FROM t1;
-INSERT INTO t1 (c) SELECT c FROM t1;
-INSERT INTO t1 (c) SELECT c FROM t1;
-INSERT INTO t1 (c) SELECT c FROM t1;
-INSERT INTO t1 (c) SELECT c FROM t1;
+INSERT INTO t1 (c) select mid("abcdefgh", mod(seq,8)+1, 1) from seq_1_to_256;
+
+explain SELECT 1 FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
+WHERE alias1.c = alias2.c OR alias1.i <= 1;
set @old_dbug=@@session.debug_dbug;
SET debug_dbug="+d,kill_join_init_read_record";
diff --git a/mysql-test/main/range_mrr_icp.result b/mysql-test/main/range_mrr_icp.result
index 26089cc5..a8d547f1 100644
--- a/mysql-test/main/range_mrr_icp.result
+++ b/mysql-test/main/range_mrr_icp.result
@@ -312,6 +312,9 @@ a b
15 1
47 1
DROP TABLE t1;
+#
+# Test of problem with IN on many different keyparts. (Bug #4157)
+#
CREATE TABLE t1 (
id int( 11 ) unsigned NOT NULL AUTO_INCREMENT ,
line int( 5 ) unsigned NOT NULL default '0',
@@ -328,10 +331,17 @@ KEY `LINES` ( owner, tableid, content, id ) ,
KEY recount( owner, line )
) ENGINE = MYISAM;
INSERT into t1 (owner,id,columnid,line) values (11,15,15,1),(11,13,13,5);
+INSERT into t1 (owner,id,columnid,line) select 11,seq+20,seq,seq from seq_1_to_100;
+explain SELECT id, columnid, tableid, content, showid, line, ordinal FROM t1 WHERE owner=11 AND ((columnid IN ( 15, 13, 14 ) AND line IN ( 1, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 31 )) OR (columnid IN ( 13, 14 ) AND line IN ( 15 ))) LIMIT 0 , 30;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref PRIMARY,menu,COLUMN,LINES,recount COLUMN 4 const 11 Using index condition
SELECT id, columnid, tableid, content, showid, line, ordinal FROM t1 WHERE owner=11 AND ((columnid IN ( 15, 13, 14 ) AND line IN ( 1, 2, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 31 )) OR (columnid IN ( 13, 14 ) AND line IN ( 15 ))) LIMIT 0 , 30;
id columnid tableid content showid line ordinal
-15 15 1 188 1 1 0
13 13 1 188 1 5 0
+15 15 1 188 1 1 0
+33 13 1 188 1 13 0
+34 14 1 188 1 14 0
+35 15 1 188 1 15 0
drop table t1;
create table t1 (id int(10) primary key);
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9);
@@ -728,7 +738,7 @@ WHERE
v.oxrootid ='d8c4177d09f8b11f5.52725521' AND
s.oxleft > v.oxleft AND s.oxleft < v.oxright;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE v ALL OXLEFT,OXRIGHT,OXROOTID NULL NULL NULL 12 Using where
+1 SIMPLE v ref OXLEFT,OXRIGHT,OXROOTID OXROOTID 34 const 6 Using index condition
1 SIMPLE s ALL OXLEFT NULL NULL NULL 12 Range checked for each record (index map: 0x4)
SELECT s.oxid FROM t1 v, t1 s
WHERE
@@ -1241,14 +1251,16 @@ insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t2 (a int, b int, filler char(100));
insert into t2 select A.a + 10 * (B.a + 10 * C.a), 10, 'filler' from t1 A,
t1 B, t1 C where A.a < 5;
-insert into t2 select 1000, b, 'filler' from t2;
+insert into t2 select 1000, b, 'filler' from t2 limit 50;
+select count(*) from t2;
+count(*)
+550
alter table t2 add index (a,b);
-select 'In following EXPLAIN the access method should be ref, #rows~=500 (and not 2)' Z;
-Z
-In following EXPLAIN the access method should be ref, #rows~=500 (and not 2)
+# In following EXPLAIN the access method should be ref, #rows~=50
+# (and not 2) when we are not using rowid-ordered scans
explain select * from t2 where a=1000 and b<11;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ref a a 5 const 503 Using index condition
+1 SIMPLE t2 range a a 10 NULL 63 Using index condition; Rowid-ordered scan
drop table t1, t2;
CREATE TABLE t1( a INT, b INT, KEY( a, b ) );
CREATE TABLE t2( a INT, b INT, KEY( a, b ) );
@@ -2421,6 +2433,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -2430,7 +2443,9 @@ EXPLAIN
"key": "idx",
"key_length": "10",
"used_key_parts": ["a", "b"],
+ "loops": 1,
"rows": 6,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a,t1.b) in (<cache>((2,3)),<cache>((3,3)),<cache>((8,8)),<cache>((7,7)))",
"mrr_type": "Rowid-ordered scan"
@@ -2486,6 +2501,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -2495,7 +2511,9 @@ EXPLAIN
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a,t1.b + t1.a) in (<cache>((4,9)),<cache>((8,8)),<cache>((7,7)))",
"mrr_type": "Rowid-ordered scan"
@@ -2517,6 +2535,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -2526,7 +2545,9 @@ EXPLAIN
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a,t1.b) in ((4,t1.a - 1),(8,t1.a + 8),(7,t1.a + 7))",
"mrr_type": "Rowid-ordered scan"
@@ -2562,6 +2583,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -2571,7 +2593,9 @@ EXPLAIN
"key": "idx1",
"key_length": "5",
"used_key_parts": ["d"],
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 60,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((2,2)))",
@@ -2587,7 +2611,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
+ "loops": 1.8,
"rows": 8,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -2641,6 +2667,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -2650,7 +2677,9 @@ EXPLAIN
"key": "idx1",
"key_length": "5",
"used_key_parts": ["d"],
+ "loops": 1,
"rows": 8,
+ "cost": "COST_REPLACED",
"filtered": 14.42307663,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1",
@@ -2666,8 +2695,10 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
+ "loops": 1.153846154,
"rows": 8,
- "filtered": 100
+ "cost": "COST_REPLACED",
+ "filtered": 73.17073059
}
}
]
@@ -2676,60 +2707,60 @@ EXPLAIN
select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1;
a b c d e f
-3 2 uuuw 3 3 i
3 2 uuua 3 3 i
-3 3 zzzz 3 3 i
+3 2 uuua 3 3 i
+3 2 uuuw 3 3 i
+3 2 uuuw 3 3 i
+3 3 zyxa 3 3 i
+3 3 zyxa 3 3 i
+3 3 zyxw 3 3 i
3 3 zyxw 3 3 i
3 3 zzza 3 3 i
-3 3 zyxa 3 3 i
-7 7 xxxyy 7 7 h
+3 3 zzza 3 3 i
+3 3 zzzz 3 3 i
+3 3 zzzz 3 3 i
7 7 xxxya 7 7 h
-7 8 xxxxx 7 7 h
+7 7 xxxyy 7 7 h
7 8 xxxxa 7 7 h
-3 2 uuuw 3 3 i
-3 2 uuua 3 3 i
-3 3 zzzz 3 3 i
-3 3 zyxw 3 3 i
-3 3 zzza 3 3 i
-3 3 zyxa 3 3 i
+7 8 xxxxx 7 7 h
prepare stmt from "select * from t1,t2
where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1";
execute stmt;
a b c d e f
-3 2 uuuw 3 3 i
3 2 uuua 3 3 i
-3 3 zzzz 3 3 i
+3 2 uuua 3 3 i
+3 2 uuuw 3 3 i
+3 2 uuuw 3 3 i
+3 3 zyxa 3 3 i
+3 3 zyxa 3 3 i
+3 3 zyxw 3 3 i
3 3 zyxw 3 3 i
3 3 zzza 3 3 i
-3 3 zyxa 3 3 i
-7 7 xxxyy 7 7 h
+3 3 zzza 3 3 i
+3 3 zzzz 3 3 i
+3 3 zzzz 3 3 i
7 7 xxxya 7 7 h
-7 8 xxxxx 7 7 h
+7 7 xxxyy 7 7 h
7 8 xxxxa 7 7 h
-3 2 uuuw 3 3 i
-3 2 uuua 3 3 i
-3 3 zzzz 3 3 i
-3 3 zyxw 3 3 i
-3 3 zzza 3 3 i
-3 3 zyxa 3 3 i
+7 8 xxxxx 7 7 h
execute stmt;
a b c d e f
-3 2 uuuw 3 3 i
3 2 uuua 3 3 i
-3 3 zzzz 3 3 i
+3 2 uuua 3 3 i
+3 2 uuuw 3 3 i
+3 2 uuuw 3 3 i
+3 3 zyxa 3 3 i
+3 3 zyxa 3 3 i
+3 3 zyxw 3 3 i
3 3 zyxw 3 3 i
3 3 zzza 3 3 i
-3 3 zyxa 3 3 i
-7 7 xxxyy 7 7 h
+3 3 zzza 3 3 i
+3 3 zzzz 3 3 i
+3 3 zzzz 3 3 i
7 7 xxxya 7 7 h
-7 8 xxxxx 7 7 h
+7 7 xxxyy 7 7 h
7 8 xxxxa 7 7 h
-3 2 uuuw 3 3 i
-3 2 uuua 3 3 i
-3 3 zzzz 3 3 i
-3 3 zyxw 3 3 i
-3 3 zzza 3 3 i
-3 3 zyxa 3 3 i
+7 8 xxxxx 7 7 h
deallocate prepare stmt;
insert into t1 select * from t1;
# join order: (t2,t1) with ref access of t1
@@ -2745,6 +2776,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -2754,7 +2786,9 @@ EXPLAIN
"key": "idx1",
"key_length": "5",
"used_key_parts": ["d"],
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 6.730769157,
"index_condition": "t2.d is not null",
"attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1",
@@ -2770,7 +2804,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["a"],
"ref": ["test.t2.d"],
+ "loops": 1,
"rows": 11,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -2780,55 +2816,66 @@ EXPLAIN
select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
a b c d e f
-7 7 xxxyy 7 7 h
7 7 xxxya 7 7 h
-7 7 xxxyy 7 7 h
7 7 xxxya 7 7 h
-7 8 xxxxx 7 7 h
+7 7 xxxyy 7 7 h
+7 7 xxxyy 7 7 h
7 8 xxxxa 7 7 h
-7 8 xxxxx 7 7 h
7 8 xxxxa 7 7 h
+7 8 xxxxx 7 7 h
+7 8 xxxxx 7 7 h
alter table t2 drop index idx1, drop index idx2, add index idx3(d,e);
# join order: (t2,t1) with ref access of t1
# range access to t2 by 2-component keys for index idx3
explain select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range idx3 idx3 10 NULL 5 Using index condition; Using where; Rowid-ordered scan
-1 SIMPLE t1 ref idx idx 5 test.t2.d 11
+1 SIMPLE t1 range idx idx 5 NULL 15 Using index condition; Rowid-ordered scan
+1 SIMPLE t2 range idx3 idx3 10 NULL 5 Using where; Rowid-ordered scan; Using join buffer (flat, BNL join)
explain format=json select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
- "table_name": "t2",
+ "table_name": "t1",
"access_type": "range",
- "possible_keys": ["idx3"],
- "key": "idx3",
- "key_length": "10",
- "used_key_parts": ["d", "e"],
- "rows": 5,
+ "possible_keys": ["idx"],
+ "key": "idx",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 15,
+ "cost": "COST_REPLACED",
"filtered": 100,
- "index_condition": "t2.d is not null",
- "attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1",
+ "index_condition": "1",
"mrr_type": "Rowid-ordered scan"
}
},
{
- "table": {
- "table_name": "t1",
- "access_type": "ref",
- "possible_keys": ["idx"],
- "key": "idx",
- "key_length": "5",
- "used_key_parts": ["a"],
- "ref": ["test.t2.d"],
- "rows": 11,
- "filtered": 100
+ "block-nl-join": {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["idx3"],
+ "key": "idx3",
+ "key_length": "10",
+ "used_key_parts": ["d", "e"],
+ "loops": 15,
+ "rows": 5,
+ "cost": "COST_REPLACED",
+ "filtered": 60,
+ "attached_condition": "octet_length(t2.f) = 1",
+ "mrr_type": "Rowid-ordered scan"
+ },
+ "buffer_type": "flat",
+ "buffer_size": "461",
+ "join_type": "BNL",
+ "attached_condition": "t2.d = t1.a and (t1.a,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8)))"
}
}
]
@@ -2837,14 +2884,14 @@ EXPLAIN
select * from t1,t2
where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1;
a b c d e f
-7 7 xxxyy 7 7 h
7 7 xxxya 7 7 h
-7 7 xxxyy 7 7 h
7 7 xxxya 7 7 h
-7 8 xxxxx 7 7 h
+7 7 xxxyy 7 7 h
+7 7 xxxyy 7 7 h
7 8 xxxxa 7 7 h
-7 8 xxxxx 7 7 h
7 8 xxxxa 7 7 h
+7 8 xxxxx 7 7 h
+7 8 xxxxx 7 7 h
# join order: (t1,t2) with ref access of t2
# range access to t1 by 1-component keys for index idx
explain select * from t1,t2
@@ -2858,6 +2905,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -2867,7 +2915,9 @@ EXPLAIN
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 15,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t1.a is not null",
"mrr_type": "Rowid-ordered scan"
@@ -2882,7 +2932,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
+ "loops": 15,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a,t2.e) in ((4,t1.a + 1),(7,t1.a + 1),(8,t1.a + 1)) and octet_length(t2.f) = 1"
}
@@ -2893,22 +2945,22 @@ EXPLAIN
select * from t1,t2
where a = d and (a,e) in ((4,d+1),(7,d+1),(8,d+1)) and length(f) = 1;
a b c d e f
-4 5 ww 4 5 a
-7 8 xxxxx 7 8 b
+4 3 zya 4 5 a
+4 3 zya 4 5 a
+4 3 zyx 4 5 a
4 3 zyx 4 5 a
-7 7 xxxyy 7 8 b
4 5 wa 4 5 a
-7 8 xxxxa 7 8 b
-4 3 zya 4 5 a
-7 7 xxxya 7 8 b
+4 5 wa 4 5 a
4 5 ww 4 5 a
-7 8 xxxxx 7 8 b
-4 3 zyx 4 5 a
+4 5 ww 4 5 a
+7 7 xxxya 7 8 b
+7 7 xxxya 7 8 b
+7 7 xxxyy 7 8 b
7 7 xxxyy 7 8 b
-4 5 wa 4 5 a
7 8 xxxxa 7 8 b
-4 3 zya 4 5 a
-7 7 xxxya 7 8 b
+7 8 xxxxa 7 8 b
+7 8 xxxxx 7 8 b
+7 8 xxxxx 7 8 b
# join order: (t1,t2) with ref access of t2
# no range access
explain select * from t1,t2
@@ -2922,13 +2974,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
"possible_keys": ["idx"],
+ "loops": 1,
"rows": 144,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a is not null"
}
@@ -2942,7 +2997,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
+ "loops": 144,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "(t1.a,t2.e) in ((t2.e,t1.a + 1),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1"
}
@@ -2953,14 +3010,14 @@ EXPLAIN
select * from t1,t2
where a = d and (a,e) in ((e,d+1),(7,7),(8,8)) and length(f) = 1;
a b c d e f
-7 8 xxxxx 7 7 h
-7 7 xxxyy 7 7 h
-7 8 xxxxa 7 7 h
7 7 xxxya 7 7 h
-7 8 xxxxx 7 7 h
+7 7 xxxya 7 7 h
+7 7 xxxyy 7 7 h
7 7 xxxyy 7 7 h
7 8 xxxxa 7 7 h
-7 7 xxxya 7 7 h
+7 8 xxxxa 7 7 h
+7 8 xxxxx 7 7 h
+7 8 xxxxx 7 7 h
# join order: (t1,t2) with ref access of t2
# range access to t1 by 1-component keys for index idx
explain select * from t1,t2
@@ -2976,6 +3033,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -2985,7 +3043,9 @@ EXPLAIN
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t1.a is not null",
"attached_condition": "(t1.a,2) in (<cache>((2,2)),<cache>((7,7)),<cache>((8,8))) and octet_length(t1.c) = 1",
@@ -3001,7 +3061,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
+ "loops": 12,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "octet_length(t2.f) = 1"
}
@@ -3060,6 +3122,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -3082,7 +3145,9 @@ EXPLAIN
"key": "idx",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 12,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t1.a is not null",
"attached_condition": "(t1.a,1 + 1) in (<cache>((2,2)),<cache>((7,7)),<cache>((8,8))) and octet_length(t1.c) = 1",
@@ -3098,7 +3163,9 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["d"],
"ref": ["test.t1.a"],
+ "loops": 12,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "octet_length(t2.f) = 1"
}
@@ -3376,7 +3443,7 @@ insert into t2 select A.a + B.a*10 + C.a*100 from ten A, ten B,ten C where A.a +
# expected type=range, rows=1487 , reason=using index dives
analyze SELECT * FROM t1 where a in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198);
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
-1 SIMPLE t1 range a a 5 NULL 1487 1199.00 100.00 100.00 Using where; Using index
+1 SIMPLE t1 index a a 5 NULL 2000 2000.00 74.35 59.95 Using where; Using index
insert into t2 values (200),(201);
# expected type=range, rows=201 , reason=using index statistics
analyze SELECT * FROM t1 where a in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,200,201);
@@ -3728,4 +3795,59 @@ DROP TABLE t1;
set global innodb_stats_persistent= @innodb_stats_persistent_save;
set global innodb_stats_persistent_sample_pages=
@innodb_stats_persistent_sample_pages_save;
+#
+# MDEV-31258 Assertion `cond_selectivity <= 1.000000001' upon range
+# query
+#
+CREATE TABLE t1 (id int, a int, b char(3), PRIMARY KEY (id), KEY idx (a,b)) ENGINE=InnoDB;
+INSERT INTO t1 VALUES
+(1,8,'UT'),(2,0,'NU'),(3,1,'SD'),(4,0,'QU'),(5,0,'FL'),(6,0,'ZR'),
+(7,3,'LA'),(8,5,'NU'),(9,0,'NU'),(10,0,'SD'),(11,0,'NU'),(12,1,'SD'),
+(13,0,'BD'),(14,0,'PA'),(15,0,'VT'),(16,4,'WA'),(17,0,'ME'),(18,6,'OH'),
+(19,0,'ME'),(20,4,'NU'),(21,0,'SC'),(22,0,'GA'),(23,1,'CO'),(24,0,'IL'),
+(25,0,'GA'),(26,0,'HI'),(27,0,'BU'),(28,0,'NU'),(29,7,'LA'),(30,0,'NU'),
+(31,0,'JR'),(32,6,'BR'),(33,0,'NU'),(34,6,'CO'),(35,7,'NU'),(36,2,'LA'),
+(37,0,'PR'),(38,1,'UT'),(39,2,'BR'),(40,1,'HI'),(41,0,'SD'),(42,0,'RI'),
+(43,2,'LA'),(44,0,'TN'),(45,4,'HI'),(46,0,'VT'),(47,1,'NU'),(48,0,'SC'),
+(49,0,'TX'),(50,8,'DC'),(51,4,'NU'),(52,0,'AL'),(53,0,'CO'),(54,9,'PR'),
+(55,0,'AR'),(56,0,'SD'),(57,0,'RI'),(58,0,'XE'),(59,0,'NU'),(60,4,'EL'),
+(61,2,'LA'),(62,5,'UT'),(63,3,'NU'),(64,0,'RI'),(65,1,'NU'),(66,0,'BR'),
+(67,3,'WA'),(68,0,'TN'),(69,3,'HI'),(70,0,'OH'),(71,8,'GA'),(72,6,'AL'),
+(73,6,'NU'),(74,1,'HI'),(75,5,'JR'),(76,3,'RI'),(77,0,'DC'),(78,0,'SC'),
+(79,0,'CO'),(80,2,'BO'),(81,8,'XE'),(82,1,'NU'),(83,0,'SD'),(84,0,'PA'),
+(85,5,'PA'),(86,0,'QU'),(87,0,'PA'),(88,0,'NU'),(89,0,'ND'),(90,0,'UT'),
+(91,0,'NU'),(92,0,'NU'),(93,6,'ZR'),(94,0,'NU'),(95,2,'EL'),(96,0,'NU'),
+(97,0,'RI'),(98,5,'DC'),(99,7,'JR'),(100,5,'CO'),(101,0,'UT'),(102,0,'QU'),
+(103,0,'NU'),(104,0,'GA'),(105,7,'AK'),(106,0,'ZR'),(107,0,'YT'),(108,0,'MD'),
+(109,0,'NU'),(110,1,'EL'),(111,0,'ME'),(112,0,'VT'),(113,2,'NU'),(114,0,'CO'),
+(115,5,'TN'),(116,0,'OH'),(117,0,'GA'),(118,9,'GA'),(119,0,'CO'),(120,0,'AL'),
+(121,0,'NU'),(122,2,'NE'),(123,2,'TX'),(124,3,'CO'),(125,0,'TN'),(126,0,'WA'),
+(127,0,'NE'),(128,6,'TN'),(129,0,'BR'),(130,0,'ID'),(131,0,'NU'),(132,2,'EL'),
+(133,0,'PR'),(134,0,'NU'),(135,1,'AZ'),(136,7,'EL'),(137,0,'TN'),(138,0,'PA'),
+(139,5,'QU'),(140,0,'AR'),(141,0,'DC'),(142,2,'WA'),(143,7,'OH'),(144,2,'CO'),
+(145,6,'NU'),(146,9,'FL'),(147,0,'HI'),(148,0,'WA'),(149,1,'BR'),(150,3,'QU');
+SELECT id, MIN(id) FROM t1
+WHERE (b > 'TX' OR b BETWEEN 'NE' AND 'SC') AND id IN (1,7,8) AND a = 5
+GROUP BY id;
+id MIN(id)
+8 8
+DROP TABLE t1;
+#
+# MDEV-31237 Assertion `!(tab->select && tab->select->quick)' failed
+# in make_join_readinfo
+#
+CREATE TABLE lineitem (l_orderkey int, l_linenumber int, l_receiptDATE date DEFAULT NULL, PRIMARY KEY (l_orderkey,l_linenumber), KEY i_l_receiptdate (l_receiptDATE), KEY i_l_orderkey (l_orderkey)) ENGINE=InnoDB;
+INSERT INTO lineitem VALUES (291,1,'1994-06-23'),(291,2,'1994-06-19'),
+(291,3,'1994-03-24'),(292,1,'1992-03-18'),(292,2,'1992-04-20');
+EXPLAIN SELECT DISTINCT l_orderkey FROM lineitem FORCE KEY (i_l_orderkey, i_l_receiptdate) WHERE l_orderkey > 1 ORDER BY l_receiptdate;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE lineitem range i_l_orderkey i_l_orderkey 4 NULL 5 Using where; Using temporary; Using filesort
+SELECT DISTINCT l_orderkey FROM lineitem FORCE KEY (i_l_orderkey, i_l_receiptdate) WHERE l_orderkey > 1 ORDER BY l_receiptdate;
+l_orderkey
+292
+291
+DROP TABLE lineitem;
+#
+# End of 11.0 tests
+#
set optimizer_switch=@mrr_icp_extra_tmp;
diff --git a/mysql-test/main/range_notembedded.result b/mysql-test/main/range_notembedded.result
index e1bcc746..7834418b 100644
--- a/mysql-test/main/range_notembedded.result
+++ b/mysql-test/main/range_notembedded.result
@@ -225,9 +225,10 @@ user_id int(10) unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (notification_type_id,item_id,item_parent_id,user_id)
);
insert into t1 values (1,1,1,1), (2,2,2,2), (3,3,3,3);
+insert into t1 select seq,seq,seq,seq from seq_10_to_30;
# Run crashing query
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range PRIMARY PRIMARY 2 NULL 3 Using where
+1 SIMPLE t1 range PRIMARY PRIMARY 2 NULL 5 Using where
drop table t1;
#
# MDEV-25069: Assertion `root->weight >= ...' failed in SEL_ARG::tree_delete #2
diff --git a/mysql-test/main/range_notembedded.test b/mysql-test/main/range_notembedded.test
index 00d16a5d..5778cdbd 100644
--- a/mysql-test/main/range_notembedded.test
+++ b/mysql-test/main/range_notembedded.test
@@ -122,6 +122,7 @@ CREATE TABLE t1 (
PRIMARY KEY (notification_type_id,item_id,item_parent_id,user_id)
);
insert into t1 values (1,1,1,1), (2,2,2,2), (3,3,3,3);
+insert into t1 select seq,seq,seq,seq from seq_10_to_30;
let $consts=`select group_concat(concat("'",seq,"'")) from seq_1_to_4642`;
diff --git a/mysql-test/main/range_vs_index_merge.result b/mysql-test/main/range_vs_index_merge.result
index 1729b95a..03ae3d69 100644
--- a/mysql-test/main/range_vs_index_merge.result
+++ b/mysql-test/main/range_vs_index_merge.result
@@ -949,7 +949,7 @@ WHERE ((Population > 101000 AND Population < 11000) OR
ID BETWEEN 3500 AND 3800) AND Country='USA'
AND (Name LIKE 'P%' OR ID BETWEEN 4000 AND 4300);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range|filter PRIMARY,Population,Country,Name,CountryPopulation,CountryName CountryName|PRIMARY 38|4 NULL 23 (7%) Using index condition; Using where; Using rowid filter
+1 SIMPLE City range PRIMARY,Population,Country,Name,CountryPopulation,CountryName CountryName 38 NULL 23 Using index condition; Using where
EXPLAIN
SELECT * FROM City
WHERE ((Population > 101000 AND Population < 11000) OR
@@ -1077,7 +1077,7 @@ EXPLAIN SELECT Name, Country, Population FROM City WHERE
(Name='Samara' AND Country='RUS') OR
(Name='Seattle' AND Country='USA');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City index_merge Country,CountryPopulation,CountryName,CityName CountryName,CityName 38,35 NULL 28 Using sort_union(CountryName,CityName); Using where
+1 SIMPLE City range Country,CountryPopulation,CountryName,CityName CountryName 38 NULL 28 Using index condition
SELECT Name, Country, Population FROM City WHERE
(Name='Manila' AND Country='PHL') OR
(Name='Addis Abeba' AND Country='ETH') OR
@@ -1325,11 +1325,11 @@ WHERE ((Name > 'Ca' AND Name < 'Cf') OR (Country > 'E' AND Country < 'H'))
AND (Population >= 100000 AND Population < 120000)
ORDER BY Population LIMIT 5;
ID Name Country Population
+3792 Tartu EST 101246
+518 Basildon GBR 100924
519 Worthing GBR 100000
638 al-Arish EGY 100447
-518 Basildon GBR 100924
707 Marbella ESP 101144
-3792 Tartu EST 101246
SHOW STATUS LIKE 'Handler_read_%';
Variable_name Value
Handler_read_first 0
@@ -1750,6 +1750,9 @@ SELECT * FROM t1,t2,t3
WHERE (t2.f3 = 1 OR t3.f1=t2.f1) AND t3.f1 <> t2.f2 AND t3.f2 = t2.f4;
f1 f1 f2 f3 f4 f1 f2
DROP TABLE t1,t2,t3;
+#
+# LP bug #823301: index merge sort union with possible index scan
+#
CREATE TABLE t1 (
a int, b int, c int, d int,
PRIMARY KEY(b), INDEX idx1(d), INDEX idx2(d,b,c)
@@ -1766,7 +1769,7 @@ EXPLAIN
SELECT * FROM t1
WHERE t1.b>7 AND t1.d>1 AND t1.d<>8 OR t1.d>=7 AND t1.d<8 OR t1.d>7;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY,idx1,idx2 NULL NULL NULL 9 Using where
+1 SIMPLE t1 range PRIMARY,idx1,idx2 idx1 5 NULL 5 Using index condition; Using where
SELECT * FROM t1
WHERE t1.b>7 AND t1.d>1 AND t1.d<>8 OR t1.d>=7 AND t1.d<8 OR t1.d>7;
a b c d
@@ -1780,7 +1783,7 @@ EXPLAIN
SELECT * FROM t1
WHERE t1.b>7 AND t1.d>1 AND t1.d<>8 OR t1.d>=7 AND t1.d<8 OR t1.d>7;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY,idx1,idx2 NULL NULL NULL 9 Using where
+1 SIMPLE t1 range PRIMARY,idx1,idx2 idx1 5 NULL 5 Using index condition; Using where
SELECT * FROM t1
WHERE t1.b>7 AND t1.d>1 AND t1.d<>8 OR t1.d>=7 AND t1.d<8 OR t1.d>7;
a b c d
@@ -1894,7 +1897,7 @@ INDEX (Percentage)
DROP INDEX Country ON City;
CREATE INDEX CountryName ON City(Country,Name);
CREATE INDEX Name ON City(Name);
-select * from City
+explain select * from City
where
Country='FIN' AND Name IN ('Lahti','Imatra') OR
Country='RUS' AND Name IN ('St Petersburg', 'Moscow') OR
@@ -1906,26 +1909,9 @@ Country='FRA' AND Name IN ('Paris', 'Marcel') OR
Country='POL' AND Name IN ('Warszawa', 'Wroclaw') OR
Country='NOR' AND Name IN ('Oslo', 'Bergen') OR
Country='ITA' AND Name IN ('Napoli', 'Venezia');
-ID Name Country Population
-175 Antwerpen BEL 446525
-176 Gent BEL 224180
-3068 Berlin DEU 3386667
-3087 Bonn DEU 301048
-3242 Lahti FIN 96921
-2974 Paris FRA 2125246
-1466 Napoli ITA 1002619
-1474 Venezia ITA 277305
-2808 Bergen NOR 230948
-2807 Oslo NOR 508726
-2928 Warszawa POL 1615369
-2931 Wroclaw POL 636765
-2918 Braga PRT 90535
-2915 Porto PRT 273060
-3580 Moscow RUS 8389200
-3581 St Petersburg RUS 4694000
-3048 Stockholm SWE 750348
-3051 Uppsala SWE 189569
-explain select * from City
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE City range CountryName,Name CountryName 38 NULL 20 Using index condition
+select * from City
where
Country='FIN' AND Name IN ('Lahti','Imatra') OR
Country='RUS' AND Name IN ('St Petersburg', 'Moscow') OR
@@ -1937,7 +1923,24 @@ Country='FRA' AND Name IN ('Paris', 'Marcel') OR
Country='POL' AND Name IN ('Warszawa', 'Wroclaw') OR
Country='NOR' AND Name IN ('Oslo', 'Bergen') OR
Country='ITA' AND Name IN ('Napoli', 'Venezia');
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range CountryName,Name CountryName 38 NULL 20 Using index condition
+ID Name Country Population
+1466 Napoli ITA 1002619
+1474 Venezia ITA 277305
+175 Antwerpen BEL 446525
+176 Gent BEL 224180
+2807 Oslo NOR 508726
+2808 Bergen NOR 230948
+2915 Porto PRT 273060
+2918 Braga PRT 90535
+2928 Warszawa POL 1615369
+2931 Wroclaw POL 636765
+2974 Paris FRA 2125246
+3048 Stockholm SWE 750348
+3051 Uppsala SWE 189569
+3068 Berlin DEU 3386667
+3087 Bonn DEU 301048
+3242 Lahti FIN 96921
+3580 Moscow RUS 8389200
+3581 St Petersburg RUS 4694000
DROP DATABASE world;
set session optimizer_switch='index_merge_sort_intersection=default';
diff --git a/mysql-test/main/range_vs_index_merge.test b/mysql-test/main/range_vs_index_merge.test
index c4b90bc6..be158d66 100644
--- a/mysql-test/main/range_vs_index_merge.test
+++ b/mysql-test/main/range_vs_index_merge.test
@@ -659,7 +659,7 @@ let $cond =
(Name='Lugansk' AND Country='UKR') OR
(Name='Caracas' AND Country='VEN') OR
(Name='Samara' AND Country='RUS') OR
-(Name='Seattle' AND Country='USA');
+(Name='Seattle' AND Country='USA');
eval
EXPLAIN SELECT Name, Country, Population FROM City WHERE
@@ -715,6 +715,7 @@ SELECT * FROM City
ORDER BY Population LIMIT 5;
FLUSH STATUS;
+--sorted_result
SELECT * FROM City
WHERE ((Name > 'Ca' AND Name < 'Cf') OR (Country > 'E' AND Country < 'H'))
AND (Population >= 100000 AND Population < 120000)
@@ -1176,9 +1177,9 @@ SELECT * FROM t1,t2,t3
DROP TABLE t1,t2,t3;
-#
-# LP bug #823301: index merge sort union with possible index scan
-#
+--echo #
+--echo # LP bug #823301: index merge sort union with possible index scan
+--echo #
CREATE TABLE t1 (
a int, b int, c int, d int,
@@ -1194,12 +1195,14 @@ SET SESSION optimizer_switch='index_merge_sort_union=off';
EXPLAIN
SELECT * FROM t1
WHERE t1.b>7 AND t1.d>1 AND t1.d<>8 OR t1.d>=7 AND t1.d<8 OR t1.d>7;
+--sorted_result
SELECT * FROM t1
WHERE t1.b>7 AND t1.d>1 AND t1.d<>8 OR t1.d>=7 AND t1.d<8 OR t1.d>7;
SET SESSION optimizer_switch='index_merge_sort_union=on';
EXPLAIN
SELECT * FROM t1
WHERE t1.b>7 AND t1.d>1 AND t1.d<>8 OR t1.d>=7 AND t1.d<8 OR t1.d>7;
+--sorted_result
SELECT * FROM t1
WHERE t1.b>7 AND t1.d>1 AND t1.d<>8 OR t1.d>=7 AND t1.d<8 OR t1.d>7;
SET SESSION optimizer_switch=DEFAULT;
@@ -1322,12 +1325,11 @@ where
Country='NOR' AND Name IN ('Oslo', 'Bergen') OR
Country='ITA' AND Name IN ('Napoli', 'Venezia');
-eval $q;
eval explain $q;
-
+--sorted_result
+eval $q;
DROP DATABASE world;
#the following command must be the last one in the file
set session optimizer_switch='index_merge_sort_intersection=default';
-
diff --git a/mysql-test/main/range_vs_index_merge_innodb.result b/mysql-test/main/range_vs_index_merge_innodb.result
index 79a670ae..8e0bf58f 100644
--- a/mysql-test/main/range_vs_index_merge_innodb.result
+++ b/mysql-test/main/range_vs_index_merge_innodb.result
@@ -1331,11 +1331,11 @@ WHERE ((Name > 'Ca' AND Name < 'Cf') OR (Country > 'E' AND Country < 'H'))
AND (Population >= 100000 AND Population < 120000)
ORDER BY Population LIMIT 5;
ID Name Country Population
+3792 Tartu EST 101246
+518 Basildon GBR 100924
519 Worthing GBR 100000
638 al-Arish EGY 100447
-518 Basildon GBR 100924
707 Marbella ESP 101144
-3792 Tartu EST 101246
SHOW STATUS LIKE 'Handler_read_%';
Variable_name Value
Handler_read_first 0
@@ -1756,6 +1756,9 @@ SELECT * FROM t1,t2,t3
WHERE (t2.f3 = 1 OR t3.f1=t2.f1) AND t3.f1 <> t2.f2 AND t3.f2 = t2.f4;
f1 f1 f2 f3 f4 f1 f2
DROP TABLE t1,t2,t3;
+#
+# LP bug #823301: index merge sort union with possible index scan
+#
CREATE TABLE t1 (
a int, b int, c int, d int,
PRIMARY KEY(b), INDEX idx1(d), INDEX idx2(d,b,c)
@@ -1772,7 +1775,7 @@ EXPLAIN
SELECT * FROM t1
WHERE t1.b>7 AND t1.d>1 AND t1.d<>8 OR t1.d>=7 AND t1.d<8 OR t1.d>7;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY,idx1,idx2 NULL NULL NULL 9 Using where
+1 SIMPLE t1 range PRIMARY,idx1,idx2 idx1 5 NULL 5 Using index condition
SELECT * FROM t1
WHERE t1.b>7 AND t1.d>1 AND t1.d<>8 OR t1.d>=7 AND t1.d<8 OR t1.d>7;
a b c d
@@ -1786,7 +1789,7 @@ EXPLAIN
SELECT * FROM t1
WHERE t1.b>7 AND t1.d>1 AND t1.d<>8 OR t1.d>=7 AND t1.d<8 OR t1.d>7;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY,idx1,idx2 NULL NULL NULL 9 Using where
+1 SIMPLE t1 range PRIMARY,idx1,idx2 idx1 5 NULL 5 Using index condition
SELECT * FROM t1
WHERE t1.b>7 AND t1.d>1 AND t1.d<>8 OR t1.d>=7 AND t1.d<8 OR t1.d>7;
a b c d
@@ -1804,7 +1807,7 @@ SELECT * FROM t1
WHERE t1.a>300 AND t1.c!=0 AND t1.b>=350 AND t1.b<=400 AND
(t1.c=0 OR t1.a=500);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range PRIMARY,idx idx 5 NULL 2 Using where; Using index
+1 SIMPLE t1 range PRIMARY,idx PRIMARY 4 NULL 1 Using where
SELECT * FROM t1
WHERE t1.a>300 AND t1.c!=0 AND t1.b>=350 AND t1.b<=400 AND
(t1.c=0 OR t1.a=500);
@@ -1900,7 +1903,7 @@ INDEX (Percentage)
DROP INDEX Country ON City;
CREATE INDEX CountryName ON City(Country,Name);
CREATE INDEX Name ON City(Name);
-select * from City
+explain select * from City
where
Country='FIN' AND Name IN ('Lahti','Imatra') OR
Country='RUS' AND Name IN ('St Petersburg', 'Moscow') OR
@@ -1912,26 +1915,9 @@ Country='FRA' AND Name IN ('Paris', 'Marcel') OR
Country='POL' AND Name IN ('Warszawa', 'Wroclaw') OR
Country='NOR' AND Name IN ('Oslo', 'Bergen') OR
Country='ITA' AND Name IN ('Napoli', 'Venezia');
-ID Name Country Population
-175 Antwerpen BEL 446525
-2808 Bergen NOR 230948
-3068 Berlin DEU 3386667
-3087 Bonn DEU 301048
-2918 Braga PRT 90535
-176 Gent BEL 224180
-3242 Lahti FIN 96921
-3580 Moscow RUS 8389200
-1466 Napoli ITA 1002619
-2807 Oslo NOR 508726
-2974 Paris FRA 2125246
-2915 Porto PRT 273060
-3581 St Petersburg RUS 4694000
-3048 Stockholm SWE 750348
-3051 Uppsala SWE 189569
-1474 Venezia ITA 277305
-2928 Warszawa POL 1615369
-2931 Wroclaw POL 636765
-explain select * from City
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE City range CountryName,Name Name 35 NULL 20 Using index condition; Using where
+select * from City
where
Country='FIN' AND Name IN ('Lahti','Imatra') OR
Country='RUS' AND Name IN ('St Petersburg', 'Moscow') OR
@@ -1943,8 +1929,25 @@ Country='FRA' AND Name IN ('Paris', 'Marcel') OR
Country='POL' AND Name IN ('Warszawa', 'Wroclaw') OR
Country='NOR' AND Name IN ('Oslo', 'Bergen') OR
Country='ITA' AND Name IN ('Napoli', 'Venezia');
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE City range CountryName,Name Name 35 NULL 20 Using index condition; Using where
+ID Name Country Population
+1466 Napoli ITA 1002619
+1474 Venezia ITA 277305
+175 Antwerpen BEL 446525
+176 Gent BEL 224180
+2807 Oslo NOR 508726
+2808 Bergen NOR 230948
+2915 Porto PRT 273060
+2918 Braga PRT 90535
+2928 Warszawa POL 1615369
+2931 Wroclaw POL 636765
+2974 Paris FRA 2125246
+3048 Stockholm SWE 750348
+3051 Uppsala SWE 189569
+3068 Berlin DEU 3386667
+3087 Bonn DEU 301048
+3242 Lahti FIN 96921
+3580 Moscow RUS 8389200
+3581 St Petersburg RUS 4694000
DROP DATABASE world;
set session optimizer_switch='index_merge_sort_intersection=default';
set global innodb_stats_persistent= @innodb_stats_persistent_save;
diff --git a/mysql-test/main/rename.result b/mysql-test/main/rename.result
index 64ccf385..dfa78e5a 100644
--- a/mysql-test/main/rename.result
+++ b/mysql-test/main/rename.result
@@ -106,6 +106,8 @@ rename table t2 to tmp, tmp to t2;
rename table t1_tmp to tmp, tmp to t1_tmp;
show tables;
Tables_in_test
+t2
+t1_tmp
t1_tmp
t2
SHOW CREATE TABLE t1_tmp;
diff --git a/mysql-test/main/require_secure_transport.result b/mysql-test/main/require_secure_transport.result
index c9df2f90..570f868b 100644
--- a/mysql-test/main/require_secure_transport.result
+++ b/mysql-test/main/require_secure_transport.result
@@ -1,8 +1,17 @@
-CREATE TABLE t1 (t int(1));
SET GLOBAL require_secure_transport=ON;
-ERROR 28000: Access denied for user 'root'@'localhost' (using password: NO)
+connect(localhost,root,,test,MASTER_PORT,MASTER_SOCKET);
+connect without_ssl,localhost,root,,,,,TCP NOSSL;
+ERROR 08004: Connections using insecure transport are prohibited while --require_secure_transport=ON.
+connect with_ssl,localhost,root,,,,,TCP SSL;
+SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher';
+have_ssl
+1
+disconnect with_ssl;
connection default;
SET GLOBAL require_secure_transport=OFF;
+connect without_ssl,localhost,root,,,,,TCP NOSSL;
+SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher';
+have_ssl
+0
disconnect without_ssl;
connection default;
-DROP TABLE t1;
diff --git a/mysql-test/main/require_secure_transport.test b/mysql-test/main/require_secure_transport.test
index ce62e7d5..51ace629 100644
--- a/mysql-test/main/require_secure_transport.test
+++ b/mysql-test/main/require_secure_transport.test
@@ -1,15 +1,21 @@
+-- source include/no_view_protocol.inc
-- source include/have_ssl_communication.inc
-CREATE TABLE t1 (t int(1));
SET GLOBAL require_secure_transport=ON;
---disable_query_log
---error ER_ACCESS_DENIED_ERROR
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_SECURE_TRANSPORT_REQUIRED
connect without_ssl,localhost,root,,,,,TCP NOSSL;
---enable_query_log
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+connect with_ssl,localhost,root,,,,,TCP SSL;
+--disable_view_protocol
+SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher';
+--enable_view_protocol
+disconnect with_ssl;
+
connection default;
SET GLOBAL require_secure_transport=OFF;
---disable_query_log
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
connect without_ssl,localhost,root,,,,,TCP NOSSL;
---enable_query_log
+SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher';
disconnect without_ssl;
connection default;
-DROP TABLE t1;
diff --git a/mysql-test/main/require_secure_transport_on.opt b/mysql-test/main/require_secure_transport_on.opt
new file mode 100644
index 00000000..c774f970
--- /dev/null
+++ b/mysql-test/main/require_secure_transport_on.opt
@@ -0,0 +1 @@
+--require-secure-transport=TRUE
diff --git a/mysql-test/main/require_secure_transport_on.result b/mysql-test/main/require_secure_transport_on.result
new file mode 100644
index 00000000..3ad8468b
--- /dev/null
+++ b/mysql-test/main/require_secure_transport_on.result
@@ -0,0 +1,9 @@
+connect(localhost,root,,test,MASTER_PORT,MASTER_SOCKET);
+connect without_ssl,localhost,root,,,,,TCP NOSSL;
+ERROR 08004: Connections using insecure transport are prohibited while --require_secure_transport=ON.
+connect with_ssl,localhost,root,,,,,TCP SSL;
+SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher';
+have_ssl
+1
+disconnect with_ssl;
+connection default;
diff --git a/mysql-test/main/require_secure_transport_on.test b/mysql-test/main/require_secure_transport_on.test
new file mode 100644
index 00000000..2cdeb66f
--- /dev/null
+++ b/mysql-test/main/require_secure_transport_on.test
@@ -0,0 +1,15 @@
+--source include/no_view_protocol.inc
+--source include/not_windows.inc
+--source include/have_ssl_communication.inc
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+--error ER_SECURE_TRANSPORT_REQUIRED
+connect without_ssl,localhost,root,,,,,TCP NOSSL;
+
+--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
+connect with_ssl,localhost,root,,,,,TCP SSL;
+SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher';
+disconnect with_ssl;
+
+connection default;
+
diff --git a/mysql-test/main/rowid_filter.result b/mysql-test/main/rowid_filter.result
index 3f3e1d0f..11f92f5b 100644
--- a/mysql-test/main/rowid_filter.result
+++ b/mysql-test/main/rowid_filter.result
@@ -57,47 +57,50 @@ set optimizer_use_condition_selectivity=2;
select
100 *
(select count(*) from lineitem
-WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 45
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 47
)
/
(select count(*) from lineitem
where l_shipdate BETWEEN '1997-01-01' AND '1997-06-30')
as correct_r_filtered_when_using_l_shipdate;
correct_r_filtered_when_using_l_shipdate
-11.7647
+6.6667
set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45;
+l_quantity > 47;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE lineitem range|filter i_l_shipdate,i_l_quantity i_l_shipdate|i_l_quantity 4|9 NULL 509 (12%) Using index condition; Using where; Using rowid filter
+1 SIMPLE lineitem range|filter i_l_shipdate,i_l_quantity i_l_quantity|i_l_shipdate 9|4 NULL 426 (8%) Using index condition; Using where; Using rowid filter
set statement optimizer_switch='rowid_filter=on' for EXPLAIN FORMAT=JSON SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45;
+l_quantity > 47;
EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
"possible_keys": ["i_l_shipdate", "i_l_quantity"],
- "key": "i_l_shipdate",
- "key_length": "4",
- "used_key_parts": ["l_shipDATE"],
+ "key": "i_l_quantity",
+ "key_length": "9",
+ "used_key_parts": ["l_quantity"],
"rowid_filter": {
"range": {
- "key": "i_l_quantity",
- "used_key_parts": ["l_quantity"]
+ "key": "i_l_shipdate",
+ "used_key_parts": ["l_shipDATE"]
},
- "rows": 702,
- "selectivity_pct": 11.69025812
+ "rows": 509,
+ "selectivity_pct": 8.476269775
},
- "rows": 509,
- "filtered": 11.69025803,
- "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
- "attached_condition": "lineitem.l_quantity > 45"
+ "loops": 1,
+ "rows": 426,
+ "cost": "COST_REPLACED",
+ "filtered": 8.476269722,
+ "index_condition": "lineitem.l_quantity > 47",
+ "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
}
]
@@ -105,12 +108,12 @@ EXPLAIN
}
set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45;
+l_quantity > 47;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
-1 SIMPLE lineitem range|filter i_l_shipdate,i_l_quantity i_l_shipdate|i_l_quantity 4|9 NULL 509 (12%) 60.00 (11%) 11.69 100.00 Using index condition; Using where; Using rowid filter
+1 SIMPLE lineitem range|filter i_l_shipdate,i_l_quantity i_l_quantity|i_l_shipdate 9|4 NULL 426 (8%) 34.00 (9%) 8.48 100.00 Using index condition; Using where; Using rowid filter
set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45;
+l_quantity > 47;
ANALYZE
{
"query_optimization": {
@@ -118,6 +121,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -126,32 +130,34 @@ ANALYZE
"table_name": "lineitem",
"access_type": "range",
"possible_keys": ["i_l_shipdate", "i_l_quantity"],
- "key": "i_l_shipdate",
- "key_length": "4",
- "used_key_parts": ["l_shipDATE"],
+ "key": "i_l_quantity",
+ "key_length": "9",
+ "used_key_parts": ["l_quantity"],
"rowid_filter": {
"range": {
- "key": "i_l_quantity",
- "used_key_parts": ["l_quantity"]
+ "key": "i_l_shipdate",
+ "used_key_parts": ["l_shipDATE"]
},
- "rows": 702,
- "selectivity_pct": 11.69025812,
- "r_rows": 605,
- "r_lookups": 510,
- "r_selectivity_pct": 11.76470588,
+ "rows": 509,
+ "selectivity_pct": 8.476269775,
+ "r_rows": 510,
+ "r_lookups": 349,
+ "r_selectivity_pct": 9.742120344,
"r_buffer_size": "REPLACED",
"r_filling_time_ms": "REPLACED"
},
+ "loops": 1,
"r_loops": 1,
- "rows": 509,
- "r_rows": 60,
+ "rows": 426,
+ "r_rows": 34,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
- "filtered": 11.69025803,
+ "filtered": 8.476269722,
"r_filtered": 100,
- "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
- "attached_condition": "lineitem.l_quantity > 45"
+ "index_condition": "lineitem.l_quantity > 47",
+ "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
}
]
@@ -159,21 +165,13 @@ ANALYZE
}
set statement optimizer_switch='rowid_filter=on' for SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45;
+l_quantity > 47;
l_orderkey l_linenumber l_shipdate l_quantity
-1121 5 1997-04-27 47
1121 6 1997-04-21 50
1441 7 1997-06-07 50
-1443 1 1997-02-05 47
1473 1 1997-05-05 50
-1568 2 1997-04-06 46
-1632 1 1997-01-25 47
-1632 3 1997-01-29 47
1954 7 1997-06-04 49
-1959 1 1997-05-05 46
2151 3 1997-01-20 49
-2177 5 1997-05-10 46
-2369 2 1997-01-02 47
2469 3 1997-01-11 48
2469 6 1997-03-03 49
2470 2 1997-06-02 50
@@ -186,66 +184,51 @@ l_orderkey l_linenumber l_shipdate l_quantity
3429 1 1997-04-08 48
3490 2 1997-06-27 50
3619 1 1997-01-22 49
-3619 3 1997-01-31 46
-3969 3 1997-05-29 46
4005 4 1997-01-31 49
-4036 1 1997-06-21 46
4066 4 1997-02-17 49
-4098 1 1997-01-26 46
-422 3 1997-06-21 46
-4258 3 1997-01-02 46
-4421 2 1997-04-21 46
-4421 3 1997-05-25 46
4453 3 1997-05-29 48
4484 7 1997-03-17 50
-4609 3 1997-02-11 46
484 1 1997-03-06 49
484 3 1997-01-24 50
484 5 1997-03-05 48
485 1 1997-03-28 50
-4868 1 1997-04-29 47
4868 3 1997-04-23 49
4934 1 1997-05-20 48
4967 1 1997-05-27 50
-5090 2 1997-04-05 46
5152 2 1997-03-10 50
5158 4 1997-04-10 49
-5606 3 1997-03-11 46
-5606 7 1997-02-01 46
-5762 4 1997-03-02 47
581 3 1997-02-27 49
5829 5 1997-01-31 49
-5831 4 1997-02-24 46
-5895 2 1997-04-27 47
5895 3 1997-03-15 49
5952 1 1997-06-30 49
-705 1 1997-04-18 46
-836 3 1997-03-21 46
set statement optimizer_switch='rowid_filter=off' for EXPLAIN SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45;
+l_quantity > 47;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE lineitem range i_l_shipdate,i_l_quantity i_l_shipdate 4 NULL 509 Using index condition; Using where
+1 SIMPLE lineitem range i_l_shipdate,i_l_quantity i_l_quantity 9 NULL 426 Using index condition; Using where
set statement optimizer_switch='rowid_filter=off' for EXPLAIN FORMAT=JSON SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45;
+l_quantity > 47;
EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
"possible_keys": ["i_l_shipdate", "i_l_quantity"],
- "key": "i_l_shipdate",
- "key_length": "4",
- "used_key_parts": ["l_shipDATE"],
- "rows": 509,
- "filtered": 11.69025803,
- "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
- "attached_condition": "lineitem.l_quantity > 45"
+ "key": "i_l_quantity",
+ "key_length": "9",
+ "used_key_parts": ["l_quantity"],
+ "loops": 1,
+ "rows": 426,
+ "cost": "COST_REPLACED",
+ "filtered": 8.476269722,
+ "index_condition": "lineitem.l_quantity > 47",
+ "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
}
]
@@ -253,12 +236,12 @@ EXPLAIN
}
set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45;
+l_quantity > 47;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
-1 SIMPLE lineitem range i_l_shipdate,i_l_quantity i_l_shipdate 4 NULL 509 510.00 11.69 11.76 Using index condition; Using where
+1 SIMPLE lineitem range i_l_shipdate,i_l_quantity i_l_quantity 9 NULL 426 349.00 8.48 9.74 Using index condition; Using where
set statement optimizer_switch='rowid_filter=off' for ANALYZE FORMAT=JSON SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45;
+l_quantity > 47;
ANALYZE
{
"query_optimization": {
@@ -266,6 +249,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -274,19 +258,21 @@ ANALYZE
"table_name": "lineitem",
"access_type": "range",
"possible_keys": ["i_l_shipdate", "i_l_quantity"],
- "key": "i_l_shipdate",
- "key_length": "4",
- "used_key_parts": ["l_shipDATE"],
+ "key": "i_l_quantity",
+ "key_length": "9",
+ "used_key_parts": ["l_quantity"],
+ "loops": 1,
"r_loops": 1,
- "rows": 509,
- "r_rows": 510,
+ "rows": 426,
+ "r_rows": 349,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
- "filtered": 11.69025803,
- "r_filtered": 11.76470588,
- "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
- "attached_condition": "lineitem.l_quantity > 45"
+ "filtered": 8.476269722,
+ "r_filtered": 9.742120344,
+ "index_condition": "lineitem.l_quantity > 47",
+ "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
}
]
@@ -294,21 +280,13 @@ ANALYZE
}
set statement optimizer_switch='rowid_filter=off' for SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45;
+l_quantity > 47;
l_orderkey l_linenumber l_shipdate l_quantity
-1121 5 1997-04-27 47
1121 6 1997-04-21 50
1441 7 1997-06-07 50
-1443 1 1997-02-05 47
1473 1 1997-05-05 50
-1568 2 1997-04-06 46
-1632 1 1997-01-25 47
-1632 3 1997-01-29 47
1954 7 1997-06-04 49
-1959 1 1997-05-05 46
2151 3 1997-01-20 49
-2177 5 1997-05-10 46
-2369 2 1997-01-02 47
2469 3 1997-01-11 48
2469 6 1997-03-03 49
2470 2 1997-06-02 50
@@ -321,41 +299,23 @@ l_orderkey l_linenumber l_shipdate l_quantity
3429 1 1997-04-08 48
3490 2 1997-06-27 50
3619 1 1997-01-22 49
-3619 3 1997-01-31 46
-3969 3 1997-05-29 46
4005 4 1997-01-31 49
-4036 1 1997-06-21 46
4066 4 1997-02-17 49
-4098 1 1997-01-26 46
-422 3 1997-06-21 46
-4258 3 1997-01-02 46
-4421 2 1997-04-21 46
-4421 3 1997-05-25 46
4453 3 1997-05-29 48
4484 7 1997-03-17 50
-4609 3 1997-02-11 46
484 1 1997-03-06 49
484 3 1997-01-24 50
484 5 1997-03-05 48
485 1 1997-03-28 50
-4868 1 1997-04-29 47
4868 3 1997-04-23 49
4934 1 1997-05-20 48
4967 1 1997-05-27 50
-5090 2 1997-04-05 46
5152 2 1997-03-10 50
5158 4 1997-04-10 49
-5606 3 1997-03-11 46
-5606 7 1997-02-01 46
-5762 4 1997-03-02 47
581 3 1997-02-27 49
5829 5 1997-01-31 49
-5831 4 1997-02-24 46
-5895 2 1997-04-27 47
5895 3 1997-03-15 49
5952 1 1997-06-30 49
-705 1 1997-04-18 46
-836 3 1997-03-21 46
set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-01-31' AND
@@ -371,6 +331,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -380,7 +341,9 @@ EXPLAIN
"key": "i_o_totalprice",
"key_length": "9",
"used_key_parts": ["o_totalprice"],
+ "loops": 1,
"rows": 69,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "orders.o_totalprice between 200000 and 230000"
}
@@ -407,7 +370,9 @@ EXPLAIN
"rows": 98,
"selectivity_pct": 1.631973356
},
+ "loops": 69,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 1.631973386,
"attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'"
}
@@ -433,6 +398,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -444,9 +410,11 @@ ANALYZE
"key": "i_o_totalprice",
"key_length": "9",
"used_key_parts": ["o_totalprice"],
+ "loops": 1,
"r_loops": 1,
"rows": 69,
"r_rows": 71,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -482,9 +450,11 @@ ANALYZE
"r_buffer_size": "REPLACED",
"r_filling_time_ms": "REPLACED"
},
+ "loops": 69,
"r_loops": 71,
"rows": 4,
"r_rows": 0.154929577,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -527,6 +497,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -541,7 +512,9 @@ EXPLAIN
"key": "i_l_shipdate",
"key_length": "4",
"used_key_parts": ["l_shipDATE"],
+ "loops": 1,
"rows": 98,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'"
}
@@ -555,7 +528,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["o_orderkey"],
"ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 98,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 4.599999905,
"attached_condition": "orders.o_totalprice between 200000 and 230000"
}
@@ -581,6 +556,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -597,9 +573,11 @@ ANALYZE
"key": "i_l_shipdate",
"key_length": "4",
"used_key_parts": ["l_shipDATE"],
+ "loops": 1,
"r_loops": 1,
"rows": 98,
"r_rows": 98,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -617,9 +595,12 @@ ANALYZE
"key_length": "4",
"used_key_parts": ["o_orderkey"],
"ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 98,
"r_loops": 98,
+ "r_table_loops": 96,
"rows": 1,
"r_rows": 1,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -650,20 +631,21 @@ o_orderkey l_linenumber l_shipdate o_totalprice
set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45 AND
+l_quantity > 47 AND
o_totalprice between 180000 and 230000;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE lineitem range|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_shipdate|i_l_quantity 4|9 NULL 509 (12%) Using index condition; Using where; Using rowid filter
+1 SIMPLE lineitem range|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_quantity|i_l_shipdate 9|4 NULL 426 (8%) Using index condition; Using where; Using rowid filter
1 SIMPLE orders eq_ref|filter PRIMARY,i_o_totalprice PRIMARY|i_o_totalprice 4|9 dbt3_s001.lineitem.l_orderkey 1 (9%) Using where; Using rowid filter
set statement optimizer_switch='rowid_filter=on' for EXPLAIN FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45 AND
+l_quantity > 47 AND
o_totalprice between 180000 and 230000;
EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -676,21 +658,23 @@ EXPLAIN
"i_l_orderkey_quantity",
"i_l_quantity"
],
- "key": "i_l_shipdate",
- "key_length": "4",
- "used_key_parts": ["l_shipDATE"],
+ "key": "i_l_quantity",
+ "key_length": "9",
+ "used_key_parts": ["l_quantity"],
"rowid_filter": {
"range": {
- "key": "i_l_quantity",
- "used_key_parts": ["l_quantity"]
+ "key": "i_l_shipdate",
+ "used_key_parts": ["l_shipDATE"]
},
- "rows": 702,
- "selectivity_pct": 11.69025812
+ "rows": 509,
+ "selectivity_pct": 8.476269775
},
- "rows": 509,
- "filtered": 11.69025803,
- "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
- "attached_condition": "lineitem.l_quantity > 45"
+ "loops": 1,
+ "rows": 426,
+ "cost": "COST_REPLACED",
+ "filtered": 8.476269722,
+ "index_condition": "lineitem.l_quantity > 47",
+ "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
},
{
@@ -710,7 +694,9 @@ EXPLAIN
"rows": 139,
"selectivity_pct": 9.266666667
},
+ "loops": 36.10890924,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 9.266666412,
"attached_condition": "orders.o_totalprice between 180000 and 230000"
}
@@ -721,15 +707,15 @@ EXPLAIN
set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45 AND
+l_quantity > 47 AND
o_totalprice between 180000 and 230000;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
-1 SIMPLE lineitem range|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_shipdate|i_l_quantity 4|9 NULL 509 (12%) 60.00 (11%) 11.69 100.00 Using index condition; Using where; Using rowid filter
-1 SIMPLE orders eq_ref|filter PRIMARY,i_o_totalprice PRIMARY|i_o_totalprice 4|9 dbt3_s001.lineitem.l_orderkey 1 (9%) 0.27 (25%) 9.27 100.00 Using where; Using rowid filter
+1 SIMPLE lineitem range|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_quantity|i_l_shipdate 9|4 NULL 426 (8%) 34.00 (9%) 8.48 100.00 Using index condition; Using where; Using rowid filter
+1 SIMPLE orders eq_ref|filter PRIMARY,i_o_totalprice PRIMARY|i_o_totalprice 4|9 dbt3_s001.lineitem.l_orderkey 1 (9%) 0.26 (26%) 9.27 100.00 Using where; Using rowid filter
set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45 AND
+l_quantity > 47 AND
o_totalprice between 180000 and 230000;
ANALYZE
{
@@ -738,6 +724,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -752,32 +739,34 @@ ANALYZE
"i_l_orderkey_quantity",
"i_l_quantity"
],
- "key": "i_l_shipdate",
- "key_length": "4",
- "used_key_parts": ["l_shipDATE"],
+ "key": "i_l_quantity",
+ "key_length": "9",
+ "used_key_parts": ["l_quantity"],
"rowid_filter": {
"range": {
- "key": "i_l_quantity",
- "used_key_parts": ["l_quantity"]
+ "key": "i_l_shipdate",
+ "used_key_parts": ["l_shipDATE"]
},
- "rows": 702,
- "selectivity_pct": 11.69025812,
- "r_rows": 605,
- "r_lookups": 510,
- "r_selectivity_pct": 11.76470588,
+ "rows": 509,
+ "selectivity_pct": 8.476269775,
+ "r_rows": 510,
+ "r_lookups": 349,
+ "r_selectivity_pct": 9.742120344,
"r_buffer_size": "REPLACED",
"r_filling_time_ms": "REPLACED"
},
+ "loops": 1,
"r_loops": 1,
- "rows": 509,
- "r_rows": 60,
+ "rows": 426,
+ "r_rows": 34,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
- "filtered": 11.69025803,
+ "filtered": 8.476269722,
"r_filtered": 100,
- "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
- "attached_condition": "lineitem.l_quantity > 45"
+ "index_condition": "lineitem.l_quantity > 47",
+ "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
},
{
@@ -797,14 +786,16 @@ ANALYZE
"rows": 139,
"selectivity_pct": 9.266666667,
"r_rows": 144,
- "r_lookups": 59,
- "r_selectivity_pct": 25.42372881,
+ "r_lookups": 34,
+ "r_selectivity_pct": 26.47058824,
"r_buffer_size": "REPLACED",
"r_filling_time_ms": "REPLACED"
},
- "r_loops": 60,
+ "loops": 36.10890924,
+ "r_loops": 34,
"rows": 1,
- "r_rows": 0.266666667,
+ "r_rows": 0.264705882,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -819,42 +810,36 @@ ANALYZE
set statement optimizer_switch='rowid_filter=on' for SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45 AND
+l_quantity > 47 AND
o_totalprice between 180000 and 230000;
o_orderkey l_linenumber l_shipdate l_quantity o_totalprice
-1632 1 1997-01-25 47 183286.33
-1632 3 1997-01-29 47 183286.33
-2177 5 1997-05-10 46 183493.42
2469 3 1997-01-11 48 192074.23
2469 6 1997-03-03 49 192074.23
3619 1 1997-01-22 49 222274.54
-3619 3 1997-01-31 46 222274.54
484 1 1997-03-06 49 219920.62
484 3 1997-01-24 50 219920.62
484 5 1997-03-05 48 219920.62
4934 1 1997-05-20 48 180478.16
-5606 3 1997-03-11 46 219959.08
-5606 7 1997-02-01 46 219959.08
5829 5 1997-01-31 49 183734.56
-5895 2 1997-04-27 47 201419.83
5895 3 1997-03-15 49 201419.83
set statement optimizer_switch='rowid_filter=off' for EXPLAIN SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45 AND
+l_quantity > 47 AND
o_totalprice between 180000 and 230000;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_shipdate 4 NULL 509 Using index condition; Using where
+1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_quantity 9 NULL 426 Using index condition; Using where
1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 Using where
set statement optimizer_switch='rowid_filter=off' for EXPLAIN FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45 AND
+l_quantity > 47 AND
o_totalprice between 180000 and 230000;
EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -867,13 +852,15 @@ EXPLAIN
"i_l_orderkey_quantity",
"i_l_quantity"
],
- "key": "i_l_shipdate",
- "key_length": "4",
- "used_key_parts": ["l_shipDATE"],
- "rows": 509,
- "filtered": 11.69025803,
- "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
- "attached_condition": "lineitem.l_quantity > 45"
+ "key": "i_l_quantity",
+ "key_length": "9",
+ "used_key_parts": ["l_quantity"],
+ "loops": 1,
+ "rows": 426,
+ "cost": "COST_REPLACED",
+ "filtered": 8.476269722,
+ "index_condition": "lineitem.l_quantity > 47",
+ "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
},
{
@@ -885,7 +872,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["o_orderkey"],
"ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 36.10890924,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 9.266666412,
"attached_condition": "orders.o_totalprice between 180000 and 230000"
}
@@ -896,15 +885,15 @@ EXPLAIN
set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45 AND
+l_quantity > 47 AND
o_totalprice between 180000 and 230000;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
-1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_shipdate 4 NULL 509 510.00 11.69 11.76 Using index condition; Using where
-1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 1.00 9.27 26.67 Using where
+1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_quantity 9 NULL 426 349.00 8.48 9.74 Using index condition; Using where
+1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 1.00 9.27 26.47 Using where
set statement optimizer_switch='rowid_filter=off' for ANALYZE FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45 AND
+l_quantity > 47 AND
o_totalprice between 180000 and 230000;
ANALYZE
{
@@ -913,6 +902,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -927,19 +917,21 @@ ANALYZE
"i_l_orderkey_quantity",
"i_l_quantity"
],
- "key": "i_l_shipdate",
- "key_length": "4",
- "used_key_parts": ["l_shipDATE"],
+ "key": "i_l_quantity",
+ "key_length": "9",
+ "used_key_parts": ["l_quantity"],
+ "loops": 1,
"r_loops": 1,
- "rows": 509,
- "r_rows": 510,
+ "rows": 426,
+ "r_rows": 349,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
- "filtered": 11.69025803,
- "r_filtered": 11.76470588,
- "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
- "attached_condition": "lineitem.l_quantity > 45"
+ "filtered": 8.476269722,
+ "r_filtered": 9.742120344,
+ "index_condition": "lineitem.l_quantity > 47",
+ "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
},
{
@@ -951,14 +943,16 @@ ANALYZE
"key_length": "4",
"used_key_parts": ["o_orderkey"],
"ref": ["dbt3_s001.lineitem.l_orderkey"],
- "r_loops": 60,
+ "loops": 36.10890924,
+ "r_loops": 34,
"rows": 1,
"r_rows": 1,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
"filtered": 9.266666412,
- "r_filtered": 26.66666667,
+ "r_filtered": 26.47058824,
"attached_condition": "orders.o_totalprice between 180000 and 230000"
}
}
@@ -968,25 +962,26 @@ ANALYZE
set statement optimizer_switch='rowid_filter=off' for SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45 AND
+l_quantity > 47 AND
o_totalprice between 180000 and 230000;
o_orderkey l_linenumber l_shipdate l_quantity o_totalprice
-1632 1 1997-01-25 47 183286.33
-1632 3 1997-01-29 47 183286.33
-2177 5 1997-05-10 46 183493.42
2469 3 1997-01-11 48 192074.23
2469 6 1997-03-03 49 192074.23
3619 1 1997-01-22 49 222274.54
-3619 3 1997-01-31 46 222274.54
484 1 1997-03-06 49 219920.62
484 3 1997-01-24 50 219920.62
484 5 1997-03-05 48 219920.62
4934 1 1997-05-20 48 180478.16
-5606 3 1997-03-11 46 219959.08
-5606 7 1997-02-01 46 219959.08
5829 5 1997-01-31 49 183734.56
-5895 2 1997-04-27 47 201419.83
5895 3 1997-03-15 49 201419.83
+set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT STRAIGHT_JOIN o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
+FROM lineitem JOIN orders ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+l_quantity > 47 AND
+o_totalprice between 180000 and 230000;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE lineitem range|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_quantity|i_l_shipdate 9|4 NULL 426 (8%) Using index condition; Using where; Using rowid filter
+1 SIMPLE orders eq_ref|filter PRIMARY,i_o_totalprice PRIMARY|i_o_totalprice 4|9 dbt3_s001.lineitem.l_orderkey 1 (9%) Using where; Using rowid filter
set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
@@ -1002,6 +997,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -1011,7 +1007,9 @@ EXPLAIN
"key": "i_o_totalprice",
"key_length": "9",
"used_key_parts": ["o_totalprice"],
+ "loops": 1,
"rows": 69,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "orders.o_totalprice between 200000 and 230000"
}
@@ -1038,7 +1036,9 @@ EXPLAIN
"rows": 509,
"selectivity_pct": 8.476269775
},
+ "loops": 69,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 8.476269722,
"attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
@@ -1064,6 +1064,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -1075,9 +1076,11 @@ ANALYZE
"key": "i_o_totalprice",
"key_length": "9",
"used_key_parts": ["o_totalprice"],
+ "loops": 1,
"r_loops": 1,
"rows": 69,
"r_rows": 71,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1113,9 +1116,11 @@ ANALYZE
"r_buffer_size": "REPLACED",
"r_filling_time_ms": "REPLACED"
},
+ "loops": 69,
"r_loops": 71,
"rows": 4,
"r_rows": 0.521126761,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1184,6 +1189,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -1193,7 +1199,9 @@ EXPLAIN
"key": "i_o_totalprice",
"key_length": "9",
"used_key_parts": ["o_totalprice"],
+ "loops": 1,
"rows": 69,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "orders.o_totalprice between 200000 and 230000"
}
@@ -1212,7 +1220,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 69,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 8.476269722,
"attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
@@ -1238,6 +1248,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -1249,9 +1260,11 @@ ANALYZE
"key": "i_o_totalprice",
"key_length": "9",
"used_key_parts": ["o_totalprice"],
+ "loops": 1,
"r_loops": 1,
"rows": 69,
"r_rows": 71,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1274,9 +1287,11 @@ ANALYZE
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 69,
"r_loops": 71,
"rows": 4,
"r_rows": 6.704225352,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1356,6 +1371,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -1371,7 +1387,9 @@ EXPLAIN
"key": "i_l_receiptdate",
"key_length": "4",
"used_key_parts": ["l_receiptDATE"],
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 0.566194832,
"index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'",
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'"
@@ -1386,7 +1404,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["o_orderkey"],
"ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 7.466666698,
"attached_condition": "orders.o_totalprice between 200000 and 250000"
}
@@ -1416,6 +1436,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -1433,9 +1454,11 @@ ANALYZE
"key": "i_l_receiptdate",
"key_length": "4",
"used_key_parts": ["l_receiptDATE"],
+ "loops": 1,
"r_loops": 1,
"rows": 18,
"r_rows": 18,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1454,9 +1477,11 @@ ANALYZE
"key_length": "4",
"used_key_parts": ["o_orderkey"],
"ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 1,
"r_loops": 7,
"rows": 1,
"r_rows": 1,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1495,6 +1520,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -1510,7 +1536,9 @@ EXPLAIN
"key": "i_l_receiptdate",
"key_length": "4",
"used_key_parts": ["l_receiptDATE"],
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 0.566194832,
"index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'",
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'"
@@ -1525,7 +1553,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["o_orderkey"],
"ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 7.466666698,
"attached_condition": "orders.o_totalprice between 200000 and 250000"
}
@@ -1555,6 +1585,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -1572,9 +1603,11 @@ ANALYZE
"key": "i_l_receiptdate",
"key_length": "4",
"used_key_parts": ["l_receiptDATE"],
+ "loops": 1,
"r_loops": 1,
"rows": 18,
"r_rows": 18,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1593,9 +1626,11 @@ ANALYZE
"key_length": "4",
"used_key_parts": ["o_orderkey"],
"ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 1,
"r_loops": 7,
"rows": 1,
"r_rows": 1,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1630,7 +1665,7 @@ o_totalprice BETWEEN 200000 AND 220000 AND
l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE orders range PRIMARY,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 39 Using index condition; Using where
-1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey 4 dbt3_s001.orders.o_orderkey 4 Using where
+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where
set statement optimizer_switch='rowid_filter=on' for EXPLAIN FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM orders, lineitem
WHERE o_orderkey=l_orderkey AND
@@ -1641,6 +1676,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -1650,7 +1686,9 @@ EXPLAIN
"key": "i_o_totaldiscount",
"key_length": "9",
"used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
"rows": 39,
+ "cost": "COST_REPLACED",
"filtered": 3.200000048,
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000"
@@ -1666,11 +1704,13 @@ EXPLAIN
"i_l_orderkey",
"i_l_orderkey_quantity"
],
- "key": "i_l_orderkey",
+ "key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 1.248,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 3.047460556,
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
@@ -1686,7 +1726,7 @@ o_totalprice BETWEEN 200000 AND 220000 AND
l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE orders range PRIMARY,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 39 41.00 3.20 2.44 Using index condition; Using where
-1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey 4 dbt3_s001.orders.o_orderkey 4 6.00 3.05 66.67 Using where
+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 6.00 3.05 66.67 Using where
set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM orders, lineitem
WHERE o_orderkey=l_orderkey AND
@@ -1700,6 +1740,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -1711,9 +1752,11 @@ ANALYZE
"key": "i_o_totaldiscount",
"key_length": "9",
"used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
"r_loops": 1,
"rows": 39,
"r_rows": 41,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1733,13 +1776,15 @@ ANALYZE
"i_l_orderkey",
"i_l_orderkey_quantity"
],
- "key": "i_l_orderkey",
+ "key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 1.248,
"r_loops": 1,
"rows": 4,
"r_rows": 6,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1770,7 +1815,7 @@ o_totalprice BETWEEN 200000 AND 220000 AND
l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE orders range PRIMARY,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 39 Using index condition; Using where
-1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey 4 dbt3_s001.orders.o_orderkey 4 Using where
+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where
set statement optimizer_switch='rowid_filter=off' for EXPLAIN FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM orders, lineitem
WHERE o_orderkey=l_orderkey AND
@@ -1781,6 +1826,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -1790,7 +1836,9 @@ EXPLAIN
"key": "i_o_totaldiscount",
"key_length": "9",
"used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
"rows": 39,
+ "cost": "COST_REPLACED",
"filtered": 3.200000048,
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000"
@@ -1806,11 +1854,13 @@ EXPLAIN
"i_l_orderkey",
"i_l_orderkey_quantity"
],
- "key": "i_l_orderkey",
+ "key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 1.248,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 3.047460556,
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
@@ -1826,7 +1876,7 @@ o_totalprice BETWEEN 200000 AND 220000 AND
l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE orders range PRIMARY,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 39 41.00 3.20 2.44 Using index condition; Using where
-1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey 4 dbt3_s001.orders.o_orderkey 4 6.00 3.05 66.67 Using where
+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 6.00 3.05 66.67 Using where
set statement optimizer_switch='rowid_filter=off' for ANALYZE FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM orders, lineitem
WHERE o_orderkey=l_orderkey AND
@@ -1840,6 +1890,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -1851,9 +1902,11 @@ ANALYZE
"key": "i_o_totaldiscount",
"key_length": "9",
"used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
"r_loops": 1,
"rows": 39,
"r_rows": 41,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1873,13 +1926,15 @@ ANALYZE
"i_l_orderkey",
"i_l_orderkey_quantity"
],
- "key": "i_l_orderkey",
+ "key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 1.248,
"r_loops": 1,
"rows": 4,
"r_rows": 6,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1913,7 +1968,7 @@ o_totalprice BETWEEN 200000 AND 220000 AND
l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE orders range PRIMARY,i_o_orderdate,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 39 Using index condition; Using where
-1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey 4 dbt3_s001.orders.o_orderkey 4 Using where
+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where
set statement optimizer_switch='rowid_filter=on' for EXPLAIN FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM v1, lineitem
WHERE o_orderkey=l_orderkey AND
@@ -1924,6 +1979,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
@@ -1938,7 +1994,9 @@ EXPLAIN
"key": "i_o_totaldiscount",
"key_length": "9",
"used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
"rows": 39,
+ "cost": "REPLACED",
"filtered": "REPLACED",
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000 and orders.o_orderDATE between '1992-12-01' and '1997-01-01'"
@@ -1954,11 +2012,13 @@ EXPLAIN
"i_l_orderkey",
"i_l_orderkey_quantity"
],
- "key": "i_l_orderkey",
+ "key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 1,
"rows": 4,
+ "cost": "REPLACED",
"filtered": "REPLACED",
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
@@ -1974,7 +2034,7 @@ o_totalprice BETWEEN 200000 AND 220000 AND
l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE orders range PRIMARY,i_o_orderdate,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 39 41.00 # 2.44 Using index condition; Using where
-1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey 4 dbt3_s001.orders.o_orderkey 4 6.00 # 66.67 Using where
+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 6.00 # 66.67 Using where
set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM v1, lineitem
WHERE o_orderkey=l_orderkey AND
@@ -1988,6 +2048,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -2004,9 +2065,11 @@ ANALYZE
"key": "i_o_totaldiscount",
"key_length": "9",
"used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
"r_loops": 1,
"rows": 39,
"r_rows": 41,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": {},
@@ -2026,13 +2089,15 @@ ANALYZE
"i_l_orderkey",
"i_l_orderkey_quantity"
],
- "key": "i_l_orderkey",
+ "key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 1,
"r_loops": 1,
"rows": 4,
"r_rows": 6,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": {},
@@ -2063,7 +2128,7 @@ o_totalprice BETWEEN 200000 AND 220000 AND
l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE orders range PRIMARY,i_o_orderdate,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 39 Using index condition; Using where
-1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey 4 dbt3_s001.orders.o_orderkey 4 Using where
+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where
set statement optimizer_switch='rowid_filter=off' for EXPLAIN FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM v1, lineitem
WHERE o_orderkey=l_orderkey AND
@@ -2074,6 +2139,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
@@ -2088,7 +2154,9 @@ EXPLAIN
"key": "i_o_totaldiscount",
"key_length": "9",
"used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
"rows": 39,
+ "cost": "REPLACED",
"filtered": "REPLACED",
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000 and orders.o_orderDATE between '1992-12-01' and '1997-01-01'"
@@ -2104,11 +2172,13 @@ EXPLAIN
"i_l_orderkey",
"i_l_orderkey_quantity"
],
- "key": "i_l_orderkey",
+ "key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 1,
"rows": 4,
+ "cost": "REPLACED",
"filtered": "REPLACED",
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
@@ -2124,7 +2194,7 @@ o_totalprice BETWEEN 200000 AND 220000 AND
l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE orders range PRIMARY,i_o_orderdate,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 39 41.00 # 2.44 Using index condition; Using where
-1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey 4 dbt3_s001.orders.o_orderkey 4 6.00 # 66.67 Using where
+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 6.00 # 66.67 Using where
set statement optimizer_switch='rowid_filter=off' for ANALYZE FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate
FROM v1, lineitem
WHERE o_orderkey=l_orderkey AND
@@ -2138,6 +2208,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -2154,9 +2225,11 @@ ANALYZE
"key": "i_o_totaldiscount",
"key_length": "9",
"used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
"r_loops": 1,
"rows": 39,
"r_rows": 41,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": {},
@@ -2176,13 +2249,15 @@ ANALYZE
"i_l_orderkey",
"i_l_orderkey_quantity"
],
- "key": "i_l_orderkey",
+ "key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 1,
"r_loops": 1,
"rows": 4,
"r_rows": 6,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": {},
@@ -2211,705 +2286,3 @@ ALTER TABLE orders DROP COLUMN o_totaldiscount;
DROP VIEW v1;
DROP DATABASE dbt3_s001;
use test;
-#
-# MDEV-18816: potential range filter for one join table with
-# impossible WHERE for another
-#
-create table t1 (
-pk int not null primary key, c2 varchar(10) , i1 int,key (c2)
-) engine=myisam;
-insert into t1 values (1,'a',-5),(2,'a',null);
-create table t2 (
-pk int, i1 int, c1 varchar(30) , key c1 (c1(30)), key i1 (i1)
-) engine=myisam;
-insert into t2 values
-(1,-5,'a'),(2,null,'a'),(3,null,'a'),(4,null,'a'),(5,5,'a'),(6,null,'a'),
-(7,4,'a'),(8,55,'a'),(9,null,'a'),(10,null,'a'),(11,null,'a'),(12,-5,'a'),
-(13,-5,'a'),(14,null,'a'),(15,null,'a'),(16,-5,'a'),(17,-5,'a');
-select 1
-from t1
-left join
-t2 join t1 as t1_a on t2.i1 = t1_a.pk
-on t1.c2 = t2.c1
-where t1_a.pk is null and t1_a.i1 != 3;
-1
-explain extended select 1
-from t1
-left join
-t2 join t1 as t1_a on t2.i1 = t1_a.pk
-on t1.c2 = t2.c1
-where t1_a.pk is null and t1_a.i1 != 3;
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
-Warnings:
-Note 1003 select 1 AS `1` from `test`.`t1` join `test`.`t2` join `test`.`t1` `t1_a` where 0
-drop table t1,t2;
-#
-# MDEV-18640: TABLE::prune_range_rowid_filters: Conditional jump or
-# move depends on uninitialized value
-#
-CREATE TABLE t1 (
-pk INT, i INT, PRIMARY KEY (pk), KEY (pk,i)
-) ENGINE=MyISAM;
-INSERT INTO t1 VALUES (1,10), (7,70), (2,20);
-SELECT * FROM t1 WHERE pk < 5;
-pk i
-1 10
-2 20
-DROP TABLE t1;
-#
-# MDEV-18956: Possible rowid filter for subquery for which
-# in_to_exists strategy has been chosen
-#
-CREATE TABLE t1 (pk int) engine=myisam ;
-INSERT INTO t1 VALUES (1),(2);
-CREATE TABLE t2 (
-pk int auto_increment PRIMARY KEY,
-i1 int, i2 int, c2 varchar(1),
-KEY (i1), KEY (i2)
-) engine=myisam;
-INSERT INTO t2 VALUES
-(1,8,6,'t'),(2,5,7,'i'),(3,4,4,'h'),(4,207,38,'d'),(5,183,206,'b'),
-(6,7,null,'o'),(7,1,2,'j'),(8,17,36,'s'),(9,4,5,'q'),(10,0,6,'l'),
-(11,1,9,'j'),(12,5,6,'y'),(13,null,0,'i'),(14,7,7,'x'),(15,5,2,'u');
-SELECT * FROM t1 HAVING (7, 9) IN (SELECT t2.i1, t2.i2 FROM t2 WHERE t2.i1 = 3);
-pk
-EXPLAIN EXTENDED
-SELECT * FROM t1 HAVING (7, 9) IN (SELECT t2.i1, t2.i2 FROM t2 WHERE t2.i1 = 3);
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING
-2 SUBQUERY t2 ref i1,i2 i1 5 const 1 100.00 Using index condition; Using where
-Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk` from `test`.`t1` having 0
-DROP TABLE t1,t2;
-#
-# MDEV-19255: rowid range filter built for range condition
-# that uses in expensive subquery
-#
-CREATE TABLE t1 (
-pk1 INT PRIMARY KEY, a1 INT, b1 VARCHAR(1), KEY(a1), KEY(b1)
-) ENGINE=MyISAM;
-INSERT INTO t1 VALUES
-(10,0,'z'),(11,3,'j'),(12,8,'f'),(13,8,'p'),(14,6,'w'),(15,0,'c'),(16,1,'j'),
-(17,1,'f'),(18,5,'v'),(19,3,'f'),(20,2,'q'),(21,8,'y'),(22,0,'a'),(23,9,'w'),
-(24,3,'e'),(25,1,'b'),(26,9,'r'),(27,2,'k'),(28,5,'c'),(29,3,'k'),(30,9,'b'),
-(31,8,'j'),(32,1,'t'),(33,8,'n'),(34,3,'z'),(35,0,'u'),(36,3,'a'),(37,3,'g'),
-(38,1,'f'),(39,6,'p'),(40,6,'m'),(41,6,'t'),(42,7,'i'),(43,4,'h'),(44,3,'d'),
-(45,2,'b'),(46,1,'o'),(47,2,'j'),(48,6,'s'),(49,5,'q'),(50,6,'l'),(51,9,'j'),
-(52,6,'y'),(53,0,'i'),(54,7,'x'),(55,2,'u'),(56,6,'t'),(57,4,'b'),(58,5,'m'),
-(59,4,'x'),(60,8,'x'),(61,6,'v'),(62,8,'m'),(63,4,'j'),(64,8,'z'),(65,2,'a'),
-(66,9,'i'),(67,4,'g'),(68,8,'h'),(69,1,'p'),(70,8,'a'),(71,0,'x'),(72,2,'s'),
-(73,6,'k'),(74,0,'m'),(75,6,'e'),(76,9,'y'),(77,7,'d'),(78,7,'w'),(79,6,'y'),
-(80,9,'s'),(81,9,'x'),(82,6,'l'),(83,9,'f'),(84,8,'x'),(85,1,'p'),(86,7,'y'),
-(87,6,'p'),(88,1,'g'),(89,3,'c'),(90,5,'h'),(91,3,'p'),(92,2,'b'),(93,1,NULL),
-(94,3,NULL),(95,2,'y'),(96,7,'s'),(97,7,'x'),(98,6,'i'),(99,9,'t'),(100,5,'j'),
-(101,0,'u'),(102,7,'r'),(103,2,'x'),(104,8,'e'),(105,8,'i'),(106,5,'q'),
-(107,8,'z'),(108,3,'k'),(109,65,NULL);
-CREATE TABLE t2 (pk2 INT PRIMARY KEY, a2 INT, b2 VARCHAR(1)) ENGINE=MyISAM;
-INSERT INTO t2 VALUES (1,1,'i');
-INSERT INTO t2 SELECT * FROM t1;
-INSERT INTO t1 SELECT pk1+200, a1, b1 FROM t1;
-INSERT INTO t1 SELECT pk1+400, a1, b1 FROM t1;
-ANALYZE TABLE t1,t2 PERSISTENT FOR ALL;
-Table Op Msg_type Msg_text
-test.t1 analyze status Engine-independent statistics collected
-test.t1 analyze status OK
-test.t2 analyze status Engine-independent statistics collected
-test.t2 analyze status OK
-SELECT * FROM t1 INNER JOIN t2 ON ( pk1+1 = pk2+2 AND a1 = a2 )
-WHERE b1 <= ( SELECT MAX(b2) FROM t2 WHERE pk2 <= 1 );
-pk1 a1 b1 pk2 a2 b2
-17 1 f 16 1 j
-37 3 g 36 3 a
-105 8 i 104 8 e
-EXPLAIN EXTENDED SELECT * FROM t1 INNER JOIN t2 ON ( pk1+1 = pk2+2 AND a1 = a2 )
-WHERE b1 <= ( SELECT MAX(b2) FROM t2 WHERE pk2 <= 1 );
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2 ALL NULL NULL NULL NULL 101 100.00 Using where
-1 PRIMARY t1 ref a1,b1 a1 5 test.t2.a2 36 28.75 Using where
-2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 100.00 Using index condition
-Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,`test`.`t2`.`pk2` AS `pk2`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b2` AS `b2` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a1` = `test`.`t2`.`a2` and `test`.`t1`.`b1` <= (/* select#2 */ select max(`test`.`t2`.`b2`) from `test`.`t2` where `test`.`t2`.`pk2` <= 1) and `test`.`t1`.`pk1` + 1 = `test`.`t2`.`pk2` + 2
-EXPLAIN FORMAT=JSON SELECT * FROM t1 INNER JOIN t2 ON ( pk1+1 = pk2+2 AND a1 = a2 )
-WHERE b1 <= ( SELECT MAX(b2) FROM t2 WHERE pk2 <= 1 );
-EXPLAIN
-{
- "query_block": {
- "select_id": 1,
- "nested_loop": [
- {
- "table": {
- "table_name": "t2",
- "access_type": "ALL",
- "rows": 101,
- "filtered": 100,
- "attached_condition": "t2.a2 is not null"
- }
- },
- {
- "table": {
- "table_name": "t1",
- "access_type": "ref",
- "possible_keys": ["a1", "b1"],
- "key": "a1",
- "key_length": "5",
- "used_key_parts": ["a1"],
- "ref": ["test.t2.a2"],
- "rows": 36,
- "filtered": 28.75,
- "attached_condition": "t1.b1 <= (subquery#2) and t1.pk1 + 1 = t2.pk2 + 2"
- }
- }
- ],
- "subqueries": [
- {
- "query_block": {
- "select_id": 2,
- "nested_loop": [
- {
- "table": {
- "table_name": "t2",
- "access_type": "range",
- "possible_keys": ["PRIMARY"],
- "key": "PRIMARY",
- "key_length": "4",
- "used_key_parts": ["pk2"],
- "rows": 1,
- "filtered": 100,
- "index_condition": "t2.pk2 <= 1"
- }
- }
- ]
- }
- }
- ]
- }
-}
-DROP TABLE t1,t2;
-#
-# MDEV-21794: Optimizer flag rowid_filter leads to long query
-#
-create table t10(a int);
-insert into t10 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-create table t11(a int);
-insert into t11 select A.a + B.a* 10 + C.a * 100 from t10 A, t10 B, t10 C;
-CREATE TABLE t1 (
-el_id int(10) unsigned NOT NULL ,
-el_index blob NOT NULL,
-el_index_60 varbinary(60) NOT NULL,
-filler blob,
-PRIMARY KEY (el_id),
-KEY el_index (el_index(60)),
-KEY el_index_60 (el_index_60,el_id)
-);
-insert into t1
-select
-A.a+1000*B.a,
-A.a+1000*B.a + 10000,
-A.a+1000*B.a + 10000,
-'filler-data-filler-data'
-from
-t11 A, t10 B;
-analyze table t1 persistent for all;
-Table Op Msg_type Msg_text
-test.t1 analyze status Engine-independent statistics collected
-test.t1 analyze Warning Engine-independent statistics are not collected for column 'el_index'
-test.t1 analyze Warning Engine-independent statistics are not collected for column 'filler'
-test.t1 analyze status Table is already up to date
-# This must not use rowid_filter with key=el_index|el_index_60:
-explain
-select * from t1
-where el_index like '10%' and (el_index_60 like '10%' or el_index_60 like '20%');
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range el_index,el_index_60 el_index 62 NULL 645 Using where
-drop table t10, t11, t1;
-#
-# MDEV-22160: SIGSEGV in st_join_table::save_explain_data on SELECT
-#
-set @save_optimizer_switch= @@optimizer_switch;
-SET @@optimizer_switch="index_merge_sort_union=OFF";
-CREATE TABLE t1 (a INT, b INT, INDEX(a), INDEX(b));
-INSERT INTO t1 VALUES (0,0),(1,0),(-1,1), (-2,1), (-2,3), (-3,4), (-2,4);
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-ANALYZE table t1 PERSISTENT FOR ALL;
-Table Op Msg_type Msg_text
-test.t1 analyze status Engine-independent statistics collected
-test.t1 analyze status OK
-explain
-SELECT * FROM t1 WHERE a > 0 AND b=0;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range|filter a,b a|b 5|5 NULL 77 (34%) Using index condition; Using where; Using rowid filter
-SELECT * FROM t1 WHERE a > 0 AND b=0;
-a b
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-drop table t1;
-SET @@optimizer_switch=@save_optimizer_switch;
-#
-# MDEV-28846: Poor performance when rowid filter contains no elements
-#
-create table t1 (
-pk int primary key auto_increment,
-nm varchar(32),
-fl1 tinyint default 0,
-fl2 tinyint default 0,
-index idx1(nm, fl1),
-index idx2(fl2)
-) engine=myisam;
-create table name (
-pk int primary key auto_increment,
-nm bigint
-) engine=myisam;
-create table flag2 (
-pk int primary key auto_increment,
-fl2 tinyint
-) engine=myisam;
-insert into name(nm) select seq from seq_1_to_1000 order by rand(17);
-insert into flag2(fl2) select seq mod 2 from seq_1_to_1000 order by rand(19);
-insert into t1(nm,fl2)
-select nm, fl2 from name, flag2 where name.pk = flag2.pk;
-analyze table t1 persistent for all;
-Table Op Msg_type Msg_text
-test.t1 analyze status Engine-independent statistics collected
-test.t1 analyze status Table is already up to date
-select '500%' as a;
-a
-500%
-set optimizer_switch='rowid_filter=on';
-explain
-select * from t1 where nm like '500%' AND fl2 = 0;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range idx1,idx2 idx1 35 NULL 1 Using index condition; Using where
-analyze format=json
-select * from t1 where nm like '500%' AND fl2 = 0;
-ANALYZE
-{
- "query_optimization": {
- "r_total_time_ms": "REPLACED"
- },
- "query_block": {
- "select_id": 1,
- "r_loops": 1,
- "r_total_time_ms": "REPLACED",
- "nested_loop": [
- {
- "table": {
- "table_name": "t1",
- "access_type": "range",
- "possible_keys": ["idx1", "idx2"],
- "key": "idx1",
- "key_length": "35",
- "used_key_parts": ["nm"],
- "r_loops": 1,
- "rows": 1,
- "r_rows": 1,
- "r_table_time_ms": "REPLACED",
- "r_other_time_ms": "REPLACED",
- "r_engine_stats": REPLACED,
- "filtered": 49.20000076,
- "r_filtered": 100,
- "index_condition": "t1.nm like '500%'",
- "attached_condition": "t1.fl2 = 0"
- }
- }
- ]
- }
-}
-select * from t1 where nm like '500%' AND fl2 = 0;
-pk nm fl1 fl2
-517 500 0 0
-truncate table name;
-truncate table flag2;
-truncate table t1;
-insert into name(nm) select seq from seq_1_to_1000 order by rand(17);
-insert into flag2(fl2) select seq mod 2 from seq_1_to_1000 order by rand(19);
-insert into t1(nm,fl2)
-select nm, fl2 from name, flag2 where name.pk = flag2.pk;
-analyze table t1 persistent for all;
-Table Op Msg_type Msg_text
-test.t1 analyze status Engine-independent statistics collected
-test.t1 analyze status Table is already up to date
-set optimizer_switch='rowid_filter=off';
-explain
-select * from t1 where nm like '500%' AND fl2 = 0;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range idx1,idx2 idx1 35 NULL 1 Using index condition; Using where
-analyze format=json
-select * from t1 where nm like '500%' AND fl2 = 0;
-ANALYZE
-{
- "query_optimization": {
- "r_total_time_ms": "REPLACED"
- },
- "query_block": {
- "select_id": 1,
- "r_loops": 1,
- "r_total_time_ms": "REPLACED",
- "nested_loop": [
- {
- "table": {
- "table_name": "t1",
- "access_type": "range",
- "possible_keys": ["idx1", "idx2"],
- "key": "idx1",
- "key_length": "35",
- "used_key_parts": ["nm"],
- "r_loops": 1,
- "rows": 1,
- "r_rows": 1,
- "r_table_time_ms": "REPLACED",
- "r_other_time_ms": "REPLACED",
- "r_engine_stats": REPLACED,
- "filtered": 49.20000076,
- "r_filtered": 100,
- "index_condition": "t1.nm like '500%'",
- "attached_condition": "t1.fl2 = 0"
- }
- }
- ]
- }
-}
-select * from t1 where nm like '500%' AND fl2 = 0;
-pk nm fl1 fl2
-517 500 0 0
-truncate table name;
-truncate table flag2;
-truncate table t1;
-insert into name(nm) select seq from seq_1_to_1000 order by rand(17);
-insert into flag2(fl2) select seq mod 10 from seq_1_to_1000 order by rand(19);
-insert into t1(nm,fl2)
-select nm, fl2 from name, flag2 where name.pk = flag2.pk;
-analyze table t1 persistent for all;
-Table Op Msg_type Msg_text
-test.t1 analyze status Engine-independent statistics collected
-test.t1 analyze status Table is already up to date
-select '607%' as a;
-a
-607%
-set optimizer_switch='rowid_filter=on';
-explain
-select * from t1 where nm like '607%' AND fl2 = 0;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range idx1,idx2 idx1 35 NULL 1 Using index condition; Using where
-select * from t1 where nm like '607%' AND fl2 = 0;
-pk nm fl1 fl2
-721 607 0 0
-truncate table name;
-truncate table flag2;
-truncate table t1;
-insert into name(nm) select seq from seq_1_to_10000 order by rand(17);
-insert into flag2(fl2) select seq mod 100 from seq_1_to_10000 order by rand(19);
-insert into t1(nm,fl2)
-select nm, fl2 from name, flag2 where name.pk = flag2.pk;
-analyze table t1 persistent for all;
-Table Op Msg_type Msg_text
-test.t1 analyze status Engine-independent statistics collected
-test.t1 analyze status Table is already up to date
-select '75%' as a;
-a
-75%
-set optimizer_switch='rowid_filter=on';
-explain
-select * from t1 where nm like '75%' AND fl2 = 0;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref|filter idx1,idx2 idx2|idx1 2|35 const 55 (1%) Using where; Using rowid filter
-analyze format=json
-select * from t1 where nm like '75%' AND fl2 = 0;
-ANALYZE
-{
- "query_optimization": {
- "r_total_time_ms": "REPLACED"
- },
- "query_block": {
- "select_id": 1,
- "r_loops": 1,
- "r_total_time_ms": "REPLACED",
- "nested_loop": [
- {
- "table": {
- "table_name": "t1",
- "access_type": "ref",
- "possible_keys": ["idx1", "idx2"],
- "key": "idx2",
- "key_length": "2",
- "used_key_parts": ["fl2"],
- "ref": ["const"],
- "rowid_filter": {
- "range": {
- "key": "idx1",
- "used_key_parts": ["nm"]
- },
- "rows": 115,
- "selectivity_pct": 1.15,
- "r_rows": 111,
- "r_lookups": 100,
- "r_selectivity_pct": 2,
- "r_buffer_size": "REPLACED",
- "r_filling_time_ms": "REPLACED"
- },
- "r_loops": 1,
- "rows": 55,
- "r_rows": 2,
- "r_table_time_ms": "REPLACED",
- "r_other_time_ms": "REPLACED",
- "r_engine_stats": REPLACED,
- "filtered": 1.149999976,
- "r_filtered": 100,
- "attached_condition": "t1.nm like '75%'"
- }
- }
- ]
- }
-}
-select * from t1 where nm like '75%' AND fl2 = 0;
-pk nm fl1 fl2
-4543 7503 0 0
-7373 7518 0 0
-drop table name, flag2;
-drop table t1;
-create table t1 (
-pk int primary key auto_increment,
-nm char(255),
-fl1 tinyint default 0,
-fl2 int default 0,
-index idx1(nm, fl1),
-index idx2(fl2)
-) engine=myisam;
-create table name (
-pk int primary key auto_increment,
-nm bigint
-) engine=myisam;
-create table flag2 (
-pk int primary key auto_increment,
-fl2 int
-) engine=myisam;
-insert into name(nm) select seq from seq_1_to_10000 order by rand(17);
-insert into flag2(fl2) select seq mod 10 from seq_1_to_10000 order by rand(19);
-insert into t1(nm,fl2)
-select nm, fl2 from name, flag2 where name.pk = flag2.pk;
-analyze table t1 persistent for all;
-Table Op Msg_type Msg_text
-test.t1 analyze status Engine-independent statistics collected
-test.t1 analyze status Table is already up to date
-select * from t1
-where
-(
-nm like '3400%' or nm like '3402%' or nm like '3403%' or
-nm like '3404%' or nm like '3405%' or nm like '3406%' or nm like '3407%' or
-nm like '3409%' or
-nm like '3411%' or nm like '3412%' or nm like '3413%' or
-nm like '3414%' or nm like '3415%' or nm like '3416%' or nm like '3417%' or
-nm like '3418%' or nm like '3419%' or
-nm like '3421%' or nm like '3422%' or nm like '3423%' or
-nm like '3424%' or nm like '3425%' or nm like '3426%' or nm like '3427%' or
-nm like '3428%' or nm like '3429%' or
-nm like '3430%' or nm like '3431%' or nm like '3432%' or nm like '3433%' or
-nm like '3434%' or nm like '3435%' or nm like '3436%' or nm like '3437%' or
-nm like '3439%' or
-nm like '3440%' or nm like '3441%' or nm like '3442%' or nm like '3443%' or
-nm like '3444%' or nm like '3445%' or nm like '3446%' or nm like '3447%' or
-nm like '3448%'
-) and fl2 = 0;
-pk nm fl1 fl2
-analyze format=json select * from t1
-where
-(
-nm like '3400%' or nm like '3402%' or nm like '3403%' or
-nm like '3404%' or nm like '3405%' or nm like '3406%' or nm like '3407%' or
-nm like '3409%' or
-nm like '3411%' or nm like '3412%' or nm like '3413%' or
-nm like '3414%' or nm like '3415%' or nm like '3416%' or nm like '3417%' or
-nm like '3418%' or nm like '3419%' or
-nm like '3421%' or nm like '3422%' or nm like '3423%' or
-nm like '3424%' or nm like '3425%' or nm like '3426%' or nm like '3427%' or
-nm like '3428%' or nm like '3429%' or
-nm like '3430%' or nm like '3431%' or nm like '3432%' or nm like '3433%' or
-nm like '3434%' or nm like '3435%' or nm like '3436%' or nm like '3437%' or
-nm like '3439%' or
-nm like '3440%' or nm like '3441%' or nm like '3442%' or nm like '3443%' or
-nm like '3444%' or nm like '3445%' or nm like '3446%' or nm like '3447%' or
-nm like '3448%'
-) and fl2 = 0;
-ANALYZE
-{
- "query_optimization": {
- "r_total_time_ms": "REPLACED"
- },
- "query_block": {
- "select_id": 1,
- "r_loops": 1,
- "r_total_time_ms": "REPLACED",
- "nested_loop": [
- {
- "table": {
- "table_name": "t1",
- "access_type": "ref",
- "possible_keys": ["idx1", "idx2"],
- "key": "idx2",
- "key_length": "5",
- "used_key_parts": ["fl2"],
- "ref": ["const"],
- "rowid_filter": {
- "range": {
- "key": "idx1",
- "used_key_parts": ["nm"]
- },
- "rows": 44,
- "selectivity_pct": 0.44,
- "r_rows": 44,
- "r_lookups": 1000,
- "r_selectivity_pct": 0,
- "r_buffer_size": "REPLACED",
- "r_filling_time_ms": "REPLACED"
- },
- "r_loops": 1,
- "rows": 863,
- "r_rows": 0,
- "r_table_time_ms": "REPLACED",
- "r_other_time_ms": "REPLACED",
- "r_engine_stats": REPLACED,
- "filtered": 0.439999998,
- "r_filtered": 100,
- "attached_condition": "t1.nm like '3400%' or t1.nm like '3402%' or t1.nm like '3403%' or t1.nm like '3404%' or t1.nm like '3405%' or t1.nm like '3406%' or t1.nm like '3407%' or t1.nm like '3409%' or t1.nm like '3411%' or t1.nm like '3412%' or t1.nm like '3413%' or t1.nm like '3414%' or t1.nm like '3415%' or t1.nm like '3416%' or t1.nm like '3417%' or t1.nm like '3418%' or t1.nm like '3419%' or t1.nm like '3421%' or t1.nm like '3422%' or t1.nm like '3423%' or t1.nm like '3424%' or t1.nm like '3425%' or t1.nm like '3426%' or t1.nm like '3427%' or t1.nm like '3428%' or t1.nm like '3429%' or t1.nm like '3430%' or t1.nm like '3431%' or t1.nm like '3432%' or t1.nm like '3433%' or t1.nm like '3434%' or t1.nm like '3435%' or t1.nm like '3436%' or t1.nm like '3437%' or t1.nm like '3439%' or t1.nm like '3440%' or t1.nm like '3441%' or t1.nm like '3442%' or t1.nm like '3443%' or t1.nm like '3444%' or t1.nm like '3445%' or t1.nm like '3446%' or t1.nm like '3447%' or t1.nm like '3448%'"
- }
- }
- ]
- }
-}
-create table t0 select * from t1 where nm like '34%';
-delete from t1 using t1,t0 where t1.nm=t0.nm;
-analyze format=json select * from t1
-where
-(
-nm like '3400%' or nm like '3402%' or nm like '3403%' or
-nm like '3404%' or nm like '3405%' or nm like '3406%' or nm like '3407%' or
-nm like '3409%' or
-nm like '3411%' or nm like '3412%' or nm like '3413%' or
-nm like '3414%' or nm like '3415%' or nm like '3416%' or nm like '3417%' or
-nm like '3418%' or nm like '3419%' or
-nm like '3421%' or nm like '3422%' or nm like '3423%' or
-nm like '3424%' or nm like '3425%' or nm like '3426%' or nm like '3427%' or
-nm like '3428%' or nm like '3429%' or
-nm like '3430%' or nm like '3431%' or nm like '3432%' or nm like '3433%' or
-nm like '3434%' or nm like '3435%' or nm like '3436%' or nm like '3437%' or
-nm like '3439%' or
-nm like '3440%' or nm like '3441%' or nm like '3442%' or nm like '3443%' or
-nm like '3444%' or nm like '3445%' or nm like '3446%' or nm like '3447%' or
-nm like '3448%'
-) and fl2 = 0;
-ANALYZE
-{
- "query_optimization": {
- "r_total_time_ms": "REPLACED"
- },
- "query_block": {
- "select_id": 1,
- "r_loops": 1,
- "r_total_time_ms": "REPLACED",
- "nested_loop": [
- {
- "table": {
- "table_name": "t1",
- "access_type": "ref",
- "possible_keys": ["idx1", "idx2"],
- "key": "idx2",
- "key_length": "5",
- "used_key_parts": ["fl2"],
- "ref": ["const"],
- "rowid_filter": {
- "range": {
- "key": "idx1",
- "used_key_parts": ["nm"]
- },
- "rows": 44,
- "selectivity_pct": 0.44,
- "r_rows": 0,
- "r_lookups": 0,
- "r_selectivity_pct": 0,
- "r_buffer_size": "REPLACED",
- "r_filling_time_ms": "REPLACED"
- },
- "r_loops": 1,
- "rows": 853,
- "r_rows": 0,
- "r_engine_stats": REPLACED,
- "filtered": 0.439999998,
- "r_filtered": 100,
- "attached_condition": "t1.nm like '3400%' or t1.nm like '3402%' or t1.nm like '3403%' or t1.nm like '3404%' or t1.nm like '3405%' or t1.nm like '3406%' or t1.nm like '3407%' or t1.nm like '3409%' or t1.nm like '3411%' or t1.nm like '3412%' or t1.nm like '3413%' or t1.nm like '3414%' or t1.nm like '3415%' or t1.nm like '3416%' or t1.nm like '3417%' or t1.nm like '3418%' or t1.nm like '3419%' or t1.nm like '3421%' or t1.nm like '3422%' or t1.nm like '3423%' or t1.nm like '3424%' or t1.nm like '3425%' or t1.nm like '3426%' or t1.nm like '3427%' or t1.nm like '3428%' or t1.nm like '3429%' or t1.nm like '3430%' or t1.nm like '3431%' or t1.nm like '3432%' or t1.nm like '3433%' or t1.nm like '3434%' or t1.nm like '3435%' or t1.nm like '3436%' or t1.nm like '3437%' or t1.nm like '3439%' or t1.nm like '3440%' or t1.nm like '3441%' or t1.nm like '3442%' or t1.nm like '3443%' or t1.nm like '3444%' or t1.nm like '3445%' or t1.nm like '3446%' or t1.nm like '3447%' or t1.nm like '3448%'"
- }
- }
- ]
- }
-}
-drop table t0;
-set optimizer_switch='rowid_filter=default';
-drop table name, flag2;
-drop table t1;
-set @@use_stat_tables=@save_use_stat_tables;
diff --git a/mysql-test/main/rowid_filter.test b/mysql-test/main/rowid_filter.test
index a2543e19..c582a405 100644
--- a/mysql-test/main/rowid_filter.test
+++ b/mysql-test/main/rowid_filter.test
@@ -42,7 +42,7 @@ set statement optimizer_switch='rowid_filter=off' for;
select
100 *
(select count(*) from lineitem
- WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 45
+ WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 47
)
/
(select count(*) from lineitem
@@ -52,9 +52,10 @@ select
let $q1=
SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
- l_quantity > 45;
+ l_quantity > 47;
eval $with_filter EXPLAIN $q1;
+--source include/explain-no-costs.inc
eval $with_filter EXPLAIN FORMAT=JSON $q1;
eval $with_filter ANALYZE $q1;
--source include/analyze-format.inc
@@ -63,6 +64,7 @@ eval $with_filter ANALYZE FORMAT=JSON $q1;
eval $with_filter $q1;
eval $without_filter EXPLAIN $q1;
+--source include/explain-no-costs.inc
eval $without_filter EXPLAIN FORMAT=JSON $q1;
eval $without_filter ANALYZE $q1;
--source include/analyze-format.inc
@@ -77,6 +79,7 @@ SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
o_totalprice between 200000 and 230000;
eval $with_filter EXPLAIN $q2;
+--source include/explain-no-costs.inc
eval $with_filter EXPLAIN FORMAT=JSON $q2;
eval $with_filter ANALYZE $q2;
--source include/analyze-format.inc
@@ -85,6 +88,7 @@ eval $with_filter ANALYZE FORMAT=JSON $q2;
eval $with_filter $q2;
eval $without_filter EXPLAIN $q2;
+--source include/explain-no-costs.inc
eval $without_filter EXPLAIN FORMAT=JSON $q2;
eval $without_filter ANALYZE $q2;
--source include/analyze-format.inc
@@ -96,10 +100,11 @@ let $q3=
SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
- l_quantity > 45 AND
+ l_quantity > 47 AND
o_totalprice between 180000 and 230000;
eval $with_filter EXPLAIN $q3;
+--source include/explain-no-costs.inc
eval $with_filter EXPLAIN FORMAT=JSON $q3;
eval $with_filter ANALYZE $q3;
--source include/analyze-format.inc
@@ -108,6 +113,7 @@ eval $with_filter ANALYZE FORMAT=JSON $q3;
eval $with_filter $q3;
eval $without_filter EXPLAIN $q3;
+--source include/explain-no-costs.inc
eval $without_filter EXPLAIN FORMAT=JSON $q3;
eval $without_filter ANALYZE $q3;
--source include/analyze-format.inc
@@ -115,6 +121,13 @@ eval $without_filter ANALYZE FORMAT=JSON $q3;
--sorted_result
eval $without_filter $q3;
+# Check different optimization
+eval $with_filter EXPLAIN SELECT STRAIGHT_JOIN o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
+ FROM lineitem JOIN orders ON o_orderkey=l_orderkey
+ WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+ l_quantity > 47 AND
+ o_totalprice between 180000 and 230000;
+
let $q4=
SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
@@ -122,6 +135,7 @@ SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
o_totalprice between 200000 and 230000;
eval $with_filter EXPLAIN $q4;
+--source include/explain-no-costs.inc
eval $with_filter EXPLAIN FORMAT=JSON $q4;
eval $with_filter ANALYZE $q4;
--source include/analyze-format.inc
@@ -130,6 +144,7 @@ eval $with_filter ANALYZE FORMAT=JSON $q4;
eval $with_filter $q4;
eval $without_filter EXPLAIN $q4;
+--source include/explain-no-costs.inc
eval $without_filter EXPLAIN FORMAT=JSON $q4;
eval $without_filter ANALYZE $q4;
--source include/analyze-format.inc
@@ -155,6 +170,7 @@ WHERE o_orderkey=l_orderkey AND
o_totalprice BETWEEN 200000 AND 250000;
eval $with_filter EXPLAIN $q5;
+--source include/explain-no-costs.inc
eval $with_filter EXPLAIN FORMAT=JSON $q5;
eval $with_filter ANALYZE $q5;
--source include/analyze-format.inc
@@ -163,6 +179,7 @@ eval $with_filter ANALYZE FORMAT=JSON $q5;
eval $with_filter $q5;
eval $without_filter EXPLAIN $q5;
+--source include/explain-no-costs.inc
eval $without_filter EXPLAIN FORMAT=JSON $q5;
eval $without_filter ANALYZE $q5;
--source include/analyze-format.inc
@@ -188,6 +205,7 @@ WHERE o_orderkey=l_orderkey AND
l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
eval $with_filter EXPLAIN $q6;
+--source include/explain-no-costs.inc
eval $with_filter EXPLAIN FORMAT=JSON $q6;
eval $with_filter ANALYZE $q6;
--source include/analyze-format.inc
@@ -196,6 +214,7 @@ eval $with_filter ANALYZE FORMAT=JSON $q6;
eval $with_filter $q6;
eval $without_filter EXPLAIN $q6;
+--source include/explain-no-costs.inc
eval $without_filter EXPLAIN FORMAT=JSON $q6;
eval $without_filter ANALYZE $q6;
--source include/analyze-format.inc
@@ -216,21 +235,21 @@ WHERE o_orderkey=l_orderkey AND
l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
eval $with_filter EXPLAIN $q7;
---replace_regex /"filtered": [0-9e\.\-+]*,/"filtered": "REPLACED",/
+--source include/explain-no-costs-filtered.inc
eval $with_filter EXPLAIN FORMAT=JSON $q7;
--replace_column 11 #
eval $with_filter ANALYZE $q7;
---replace_regex /("(r_(total|table|other)_time_ms|r_buffer_size|r_filling_time_ms|filtered)": )[^, \n]*/\1"REPLACED"/
+--source include/analyze-no-filtered.inc
eval $with_filter ANALYZE FORMAT=JSON $q7;
--sorted_result
eval $with_filter $q7;
eval $without_filter EXPLAIN $q7;
---replace_regex /"filtered": [0-9e\.\-+]*,/"filtered": "REPLACED",/
+--source include/explain-no-costs-filtered.inc
eval $without_filter EXPLAIN FORMAT=JSON $q7;
--replace_column 11 #
eval $without_filter ANALYZE $q7;
---replace_regex /("(r_(total|table|other)_time_ms|r_buffer_size|r_filling_time_ms|filtered)": )[^, \n]*/\1"REPLACED"/
+--source include/analyze-no-filtered.inc
eval $without_filter ANALYZE FORMAT=JSON $q7;
--sorted_result
eval $without_filter $q7;
@@ -243,371 +262,3 @@ DROP VIEW v1;
DROP DATABASE dbt3_s001;
use test;
-
---echo #
---echo # MDEV-18816: potential range filter for one join table with
---echo # impossible WHERE for another
---echo #
-
-create table t1 (
- pk int not null primary key, c2 varchar(10) , i1 int,key (c2)
-) engine=myisam;
-insert into t1 values (1,'a',-5),(2,'a',null);
-
-create table t2 (
- pk int, i1 int, c1 varchar(30) , key c1 (c1(30)), key i1 (i1)
-) engine=myisam;
-insert into t2 values
- (1,-5,'a'),(2,null,'a'),(3,null,'a'),(4,null,'a'),(5,5,'a'),(6,null,'a'),
- (7,4,'a'),(8,55,'a'),(9,null,'a'),(10,null,'a'),(11,null,'a'),(12,-5,'a'),
- (13,-5,'a'),(14,null,'a'),(15,null,'a'),(16,-5,'a'),(17,-5,'a');
-
-let $q=
-select 1
- from t1
- left join
- t2 join t1 as t1_a on t2.i1 = t1_a.pk
- on t1.c2 = t2.c1
-where t1_a.pk is null and t1_a.i1 != 3;
-
-eval $q;
-eval explain extended $q;
-
-drop table t1,t2;
-
---echo #
---echo # MDEV-18640: TABLE::prune_range_rowid_filters: Conditional jump or
---echo # move depends on uninitialized value
---echo #
-
-CREATE TABLE t1 (
- pk INT, i INT, PRIMARY KEY (pk), KEY (pk,i)
-) ENGINE=MyISAM;
-INSERT INTO t1 VALUES (1,10), (7,70), (2,20);
-
-SELECT * FROM t1 WHERE pk < 5;
-
-DROP TABLE t1;
-
---echo #
---echo # MDEV-18956: Possible rowid filter for subquery for which
---echo # in_to_exists strategy has been chosen
---echo #
-
-CREATE TABLE t1 (pk int) engine=myisam ;
-INSERT INTO t1 VALUES (1),(2);
-
-CREATE TABLE t2 (
- pk int auto_increment PRIMARY KEY,
- i1 int, i2 int, c2 varchar(1),
- KEY (i1), KEY (i2)
-) engine=myisam;
-
-INSERT INTO t2 VALUES
- (1,8,6,'t'),(2,5,7,'i'),(3,4,4,'h'),(4,207,38,'d'),(5,183,206,'b'),
- (6,7,null,'o'),(7,1,2,'j'),(8,17,36,'s'),(9,4,5,'q'),(10,0,6,'l'),
- (11,1,9,'j'),(12,5,6,'y'),(13,null,0,'i'),(14,7,7,'x'),(15,5,2,'u');
-
-SELECT * FROM t1 HAVING (7, 9) IN (SELECT t2.i1, t2.i2 FROM t2 WHERE t2.i1 = 3);
-EXPLAIN EXTENDED
-SELECT * FROM t1 HAVING (7, 9) IN (SELECT t2.i1, t2.i2 FROM t2 WHERE t2.i1 = 3);
-
-DROP TABLE t1,t2;
-
---echo #
---echo # MDEV-19255: rowid range filter built for range condition
---echo # that uses in expensive subquery
---echo #
-
-CREATE TABLE t1 (
- pk1 INT PRIMARY KEY, a1 INT, b1 VARCHAR(1), KEY(a1), KEY(b1)
-) ENGINE=MyISAM;
-INSERT INTO t1 VALUES
-(10,0,'z'),(11,3,'j'),(12,8,'f'),(13,8,'p'),(14,6,'w'),(15,0,'c'),(16,1,'j'),
-(17,1,'f'),(18,5,'v'),(19,3,'f'),(20,2,'q'),(21,8,'y'),(22,0,'a'),(23,9,'w'),
-(24,3,'e'),(25,1,'b'),(26,9,'r'),(27,2,'k'),(28,5,'c'),(29,3,'k'),(30,9,'b'),
-(31,8,'j'),(32,1,'t'),(33,8,'n'),(34,3,'z'),(35,0,'u'),(36,3,'a'),(37,3,'g'),
-(38,1,'f'),(39,6,'p'),(40,6,'m'),(41,6,'t'),(42,7,'i'),(43,4,'h'),(44,3,'d'),
-(45,2,'b'),(46,1,'o'),(47,2,'j'),(48,6,'s'),(49,5,'q'),(50,6,'l'),(51,9,'j'),
-(52,6,'y'),(53,0,'i'),(54,7,'x'),(55,2,'u'),(56,6,'t'),(57,4,'b'),(58,5,'m'),
-(59,4,'x'),(60,8,'x'),(61,6,'v'),(62,8,'m'),(63,4,'j'),(64,8,'z'),(65,2,'a'),
-(66,9,'i'),(67,4,'g'),(68,8,'h'),(69,1,'p'),(70,8,'a'),(71,0,'x'),(72,2,'s'),
-(73,6,'k'),(74,0,'m'),(75,6,'e'),(76,9,'y'),(77,7,'d'),(78,7,'w'),(79,6,'y'),
-(80,9,'s'),(81,9,'x'),(82,6,'l'),(83,9,'f'),(84,8,'x'),(85,1,'p'),(86,7,'y'),
-(87,6,'p'),(88,1,'g'),(89,3,'c'),(90,5,'h'),(91,3,'p'),(92,2,'b'),(93,1,NULL),
-(94,3,NULL),(95,2,'y'),(96,7,'s'),(97,7,'x'),(98,6,'i'),(99,9,'t'),(100,5,'j'),
-(101,0,'u'),(102,7,'r'),(103,2,'x'),(104,8,'e'),(105,8,'i'),(106,5,'q'),
-(107,8,'z'),(108,3,'k'),(109,65,NULL);
-
-CREATE TABLE t2 (pk2 INT PRIMARY KEY, a2 INT, b2 VARCHAR(1)) ENGINE=MyISAM;
-INSERT INTO t2 VALUES (1,1,'i');
-INSERT INTO t2 SELECT * FROM t1;
-
-INSERT INTO t1 SELECT pk1+200, a1, b1 FROM t1;
-INSERT INTO t1 SELECT pk1+400, a1, b1 FROM t1;
-
-ANALYZE TABLE t1,t2 PERSISTENT FOR ALL;
-
-let $q=
-SELECT * FROM t1 INNER JOIN t2 ON ( pk1+1 = pk2+2 AND a1 = a2 )
- WHERE b1 <= ( SELECT MAX(b2) FROM t2 WHERE pk2 <= 1 );
-
-eval $q;
-eval EXPLAIN EXTENDED $q;
-eval EXPLAIN FORMAT=JSON $q;
-
-DROP TABLE t1,t2;
-
---echo #
---echo # MDEV-21794: Optimizer flag rowid_filter leads to long query
---echo #
-create table t10(a int);
-insert into t10 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-
-create table t11(a int);
-insert into t11 select A.a + B.a* 10 + C.a * 100 from t10 A, t10 B, t10 C;
-
-CREATE TABLE t1 (
- el_id int(10) unsigned NOT NULL ,
- el_index blob NOT NULL,
- el_index_60 varbinary(60) NOT NULL,
- filler blob,
-
- PRIMARY KEY (el_id),
- KEY el_index (el_index(60)),
- KEY el_index_60 (el_index_60,el_id)
-);
-
-insert into t1
-select
- A.a+1000*B.a,
- A.a+1000*B.a + 10000,
- A.a+1000*B.a + 10000,
- 'filler-data-filler-data'
-from
- t11 A, t10 B;
-analyze table t1 persistent for all;
-
---echo # This must not use rowid_filter with key=el_index|el_index_60:
-explain
-select * from t1
-where el_index like '10%' and (el_index_60 like '10%' or el_index_60 like '20%');
-
-drop table t10, t11, t1;
-
-
---echo #
---echo # MDEV-22160: SIGSEGV in st_join_table::save_explain_data on SELECT
---echo #
-
-set @save_optimizer_switch= @@optimizer_switch;
-SET @@optimizer_switch="index_merge_sort_union=OFF";
-CREATE TABLE t1 (a INT, b INT, INDEX(a), INDEX(b));
-INSERT INTO t1 VALUES (0,0),(1,0),(-1,1), (-2,1), (-2,3), (-3,4), (-2,4);
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-
-ANALYZE table t1 PERSISTENT FOR ALL;
-
-explain
-SELECT * FROM t1 WHERE a > 0 AND b=0;
-SELECT * FROM t1 WHERE a > 0 AND b=0;
-drop table t1;
-SET @@optimizer_switch=@save_optimizer_switch;
-
-
---echo #
---echo # MDEV-28846: Poor performance when rowid filter contains no elements
---echo #
-
---source include/have_sequence.inc
-
-create table t1 (
- pk int primary key auto_increment,
- nm varchar(32),
- fl1 tinyint default 0,
- fl2 tinyint default 0,
- index idx1(nm, fl1),
- index idx2(fl2)
-) engine=myisam;
-
-create table name (
- pk int primary key auto_increment,
- nm bigint
-) engine=myisam;
-
-create table flag2 (
- pk int primary key auto_increment,
- fl2 tinyint
-) engine=myisam;
-
-insert into name(nm) select seq from seq_1_to_1000 order by rand(17);
-insert into flag2(fl2) select seq mod 2 from seq_1_to_1000 order by rand(19);
-
-insert into t1(nm,fl2)
- select nm, fl2 from name, flag2 where name.pk = flag2.pk;
-
-analyze table t1 persistent for all;
-
-let $a=
-`select concat((select nm from t1 where fl2=0 order by RAND(13) limit 1),'%')`;
-eval select '$a' as a;
-
-set optimizer_switch='rowid_filter=on';
-eval
-explain
-select * from t1 where nm like '$a' AND fl2 = 0;
---source include/analyze-format.inc
-eval
-analyze format=json
-select * from t1 where nm like '$a' AND fl2 = 0;
-eval
-select * from t1 where nm like '$a' AND fl2 = 0;
-
-truncate table name;
-truncate table flag2;
-truncate table t1;
-
-insert into name(nm) select seq from seq_1_to_1000 order by rand(17);
-insert into flag2(fl2) select seq mod 2 from seq_1_to_1000 order by rand(19);
-
-insert into t1(nm,fl2)
- select nm, fl2 from name, flag2 where name.pk = flag2.pk;
-
-analyze table t1 persistent for all;
-
-set optimizer_switch='rowid_filter=off';
-eval
-explain
-select * from t1 where nm like '$a' AND fl2 = 0;
---source include/analyze-format.inc
-eval
-analyze format=json
-select * from t1 where nm like '$a' AND fl2 = 0;
-eval
-select * from t1 where nm like '$a' AND fl2 = 0;
-
-truncate table name;
-truncate table flag2;
-truncate table t1;
-
-insert into name(nm) select seq from seq_1_to_1000 order by rand(17);
-insert into flag2(fl2) select seq mod 10 from seq_1_to_1000 order by rand(19);
-
-insert into t1(nm,fl2)
- select nm, fl2 from name, flag2 where name.pk = flag2.pk;
-
-analyze table t1 persistent for all;
-
-let $a=
-`select concat((select nm from t1 where fl2=0 order by RAND(13) limit 1),'%')`;
-eval select '$a' as a;
-
-set optimizer_switch='rowid_filter=on';
-eval
-explain
-select * from t1 where nm like '$a' AND fl2 = 0;
-eval
-select * from t1 where nm like '$a' AND fl2 = 0;
-
-truncate table name;
-truncate table flag2;
-truncate table t1;
-
-insert into name(nm) select seq from seq_1_to_10000 order by rand(17);
-insert into flag2(fl2) select seq mod 100 from seq_1_to_10000 order by rand(19);
-
-insert into t1(nm,fl2)
- select nm, fl2 from name, flag2 where name.pk = flag2.pk;
-
-analyze table t1 persistent for all;
-
-let $a=
-`select concat(left((select nm from t1 where fl2=0 order by RAND(13) limit 1),2),'%')`;
-eval select '$a' as a;
-
-set optimizer_switch='rowid_filter=on';
-eval
-explain
-select * from t1 where nm like '$a' AND fl2 = 0;
---source include/analyze-format.inc
-eval
-analyze format=json
-select * from t1 where nm like '$a' AND fl2 = 0;
-eval
-select * from t1 where nm like '$a' AND fl2 = 0;
-
-drop table name, flag2;
-drop table t1;
-
-# This test shows that if the container is empty there are no lookups into it
-
-create table t1 (
- pk int primary key auto_increment,
- nm char(255),
- fl1 tinyint default 0,
- fl2 int default 0,
- index idx1(nm, fl1),
- index idx2(fl2)
-) engine=myisam;
-
-create table name (
- pk int primary key auto_increment,
- nm bigint
-) engine=myisam;
-
-create table flag2 (
- pk int primary key auto_increment,
- fl2 int
-) engine=myisam;
-
-insert into name(nm) select seq from seq_1_to_10000 order by rand(17);
-insert into flag2(fl2) select seq mod 10 from seq_1_to_10000 order by rand(19);
-
-insert into t1(nm,fl2)
- select nm, fl2 from name, flag2 where name.pk = flag2.pk;
-
-analyze table t1 persistent for all;
-
-let $q=
-select * from t1
-where
-(
- nm like '3400%' or nm like '3402%' or nm like '3403%' or
- nm like '3404%' or nm like '3405%' or nm like '3406%' or nm like '3407%' or
- nm like '3409%' or
- nm like '3411%' or nm like '3412%' or nm like '3413%' or
- nm like '3414%' or nm like '3415%' or nm like '3416%' or nm like '3417%' or
- nm like '3418%' or nm like '3419%' or
- nm like '3421%' or nm like '3422%' or nm like '3423%' or
- nm like '3424%' or nm like '3425%' or nm like '3426%' or nm like '3427%' or
- nm like '3428%' or nm like '3429%' or
- nm like '3430%' or nm like '3431%' or nm like '3432%' or nm like '3433%' or
- nm like '3434%' or nm like '3435%' or nm like '3436%' or nm like '3437%' or
- nm like '3439%' or
- nm like '3440%' or nm like '3441%' or nm like '3442%' or nm like '3443%' or
- nm like '3444%' or nm like '3445%' or nm like '3446%' or nm like '3447%' or
- nm like '3448%'
-) and fl2 = 0;
-
-eval $q;
---source include/analyze-format.inc
-eval analyze format=json $q;
-
-create table t0 select * from t1 where nm like '34%';
-delete from t1 using t1,t0 where t1.nm=t0.nm;
---source include/analyze-format.inc
-eval analyze format=json $q;
-
-drop table t0;
-
-set optimizer_switch='rowid_filter=default';
-
-drop table name, flag2;
-drop table t1;
-
-set @@use_stat_tables=@save_use_stat_tables;
diff --git a/mysql-test/main/rowid_filter_aria.result b/mysql-test/main/rowid_filter_aria.result
new file mode 100644
index 00000000..aa31a247
--- /dev/null
+++ b/mysql-test/main/rowid_filter_aria.result
@@ -0,0 +1,2271 @@
+SET SESSION DEFAULT_STORAGE_ENGINE='Aria';
+DROP DATABASE IF EXISTS dbt3_s001;
+CREATE DATABASE dbt3_s001;
+use dbt3_s001;
+CREATE INDEX i_l_quantity ON lineitem(l_quantity);
+CREATE INDEX i_o_totalprice ON orders(o_totalprice);
+set @save_use_stat_tables= @@use_stat_tables;
+set @@use_stat_tables=preferably;
+ANALYZE TABLE lineitem, orders;
+show create table lineitem;
+Table Create Table
+lineitem CREATE TABLE `lineitem` (
+ `l_orderkey` int(11) NOT NULL DEFAULT 0,
+ `l_partkey` int(11) DEFAULT NULL,
+ `l_suppkey` int(11) DEFAULT NULL,
+ `l_linenumber` int(11) NOT NULL DEFAULT 0,
+ `l_quantity` double DEFAULT NULL,
+ `l_extendedprice` double DEFAULT NULL,
+ `l_discount` double DEFAULT NULL,
+ `l_tax` double DEFAULT NULL,
+ `l_returnflag` char(1) DEFAULT NULL,
+ `l_linestatus` char(1) DEFAULT NULL,
+ `l_shipDATE` date DEFAULT NULL,
+ `l_commitDATE` date DEFAULT NULL,
+ `l_receiptDATE` date DEFAULT NULL,
+ `l_shipinstruct` char(25) DEFAULT NULL,
+ `l_shipmode` char(10) DEFAULT NULL,
+ `l_comment` varchar(44) DEFAULT NULL,
+ PRIMARY KEY (`l_orderkey`,`l_linenumber`),
+ KEY `i_l_shipdate` (`l_shipDATE`),
+ KEY `i_l_suppkey_partkey` (`l_partkey`,`l_suppkey`),
+ KEY `i_l_partkey` (`l_partkey`),
+ KEY `i_l_suppkey` (`l_suppkey`),
+ KEY `i_l_receiptdate` (`l_receiptDATE`),
+ KEY `i_l_orderkey` (`l_orderkey`),
+ KEY `i_l_orderkey_quantity` (`l_orderkey`,`l_quantity`),
+ KEY `i_l_commitdate` (`l_commitDATE`),
+ KEY `i_l_quantity` (`l_quantity`)
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+show create table orders;
+Table Create Table
+orders CREATE TABLE `orders` (
+ `o_orderkey` int(11) NOT NULL,
+ `o_custkey` int(11) DEFAULT NULL,
+ `o_orderstatus` char(1) DEFAULT NULL,
+ `o_totalprice` double DEFAULT NULL,
+ `o_orderDATE` date DEFAULT NULL,
+ `o_orderpriority` char(15) DEFAULT NULL,
+ `o_clerk` char(15) DEFAULT NULL,
+ `o_shippriority` int(11) DEFAULT NULL,
+ `o_comment` varchar(79) DEFAULT NULL,
+ PRIMARY KEY (`o_orderkey`),
+ KEY `i_o_orderdate` (`o_orderDATE`),
+ KEY `i_o_custkey` (`o_custkey`),
+ KEY `i_o_totalprice` (`o_totalprice`)
+) ENGINE=Aria DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci PAGE_CHECKSUM=1
+set optimizer_use_condition_selectivity=2;
+select
+100 *
+(select count(*) from lineitem
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 47
+)
+/
+(select count(*) from lineitem
+where l_shipdate BETWEEN '1997-01-01' AND '1997-06-30')
+as correct_r_filtered_when_using_l_shipdate;
+correct_r_filtered_when_using_l_shipdate
+6.6667
+set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+l_quantity > 47;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE lineitem range|filter i_l_shipdate,i_l_quantity i_l_shipdate|i_l_quantity 4|9 NULL 482 (12%) Using index condition; Using where; Using rowid filter
+set statement optimizer_switch='rowid_filter=on' for EXPLAIN FORMAT=JSON SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+l_quantity > 47;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": "COST_REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "range",
+ "possible_keys": ["i_l_shipdate", "i_l_quantity"],
+ "key": "i_l_shipdate",
+ "key_length": "4",
+ "used_key_parts": ["l_shipDATE"],
+ "rowid_filter": {
+ "range": {
+ "key": "i_l_quantity",
+ "used_key_parts": ["l_quantity"]
+ },
+ "rows": 709,
+ "selectivity_pct": 11.80682764
+ },
+ "loops": 1,
+ "rows": 482,
+ "cost": "COST_REPLACED",
+ "filtered": 11.80682755,
+ "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
+ "attached_condition": "lineitem.l_quantity > 47"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+l_quantity > 47;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE lineitem range|filter i_l_shipdate,i_l_quantity i_l_shipdate|i_l_quantity 4|9 NULL 482 (12%) 34.00 (6%) 11.81 100.00 Using index condition; Using where; Using rowid filter
+set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+l_quantity > 47;
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "range",
+ "possible_keys": ["i_l_shipdate", "i_l_quantity"],
+ "key": "i_l_shipdate",
+ "key_length": "4",
+ "used_key_parts": ["l_shipDATE"],
+ "rowid_filter": {
+ "range": {
+ "key": "i_l_quantity",
+ "used_key_parts": ["l_quantity"]
+ },
+ "rows": 709,
+ "selectivity_pct": 11.80682764,
+ "r_rows": 349,
+ "r_lookups": 510,
+ "r_selectivity_pct": 6.666666667,
+ "r_buffer_size": "REPLACED",
+ "r_filling_time_ms": "REPLACED"
+ },
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 482,
+ "r_rows": 34,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 11.80682755,
+ "r_filtered": 100,
+ "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
+ "attached_condition": "lineitem.l_quantity > 47"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=on' for SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+l_quantity > 47;
+l_orderkey l_linenumber l_shipdate l_quantity
+1121 6 1997-04-21 50
+1441 7 1997-06-07 50
+1473 1 1997-05-05 50
+1954 7 1997-06-04 49
+2151 3 1997-01-20 49
+2469 3 1997-01-11 48
+2469 6 1997-03-03 49
+2470 2 1997-06-02 50
+260 1 1997-03-24 50
+288 2 1997-04-19 49
+289 4 1997-03-14 48
+3009 1 1997-03-19 48
+3105 3 1997-02-28 48
+3106 2 1997-02-27 49
+3429 1 1997-04-08 48
+3490 2 1997-06-27 50
+3619 1 1997-01-22 49
+4005 4 1997-01-31 49
+4066 4 1997-02-17 49
+4453 3 1997-05-29 48
+4484 7 1997-03-17 50
+484 1 1997-03-06 49
+484 3 1997-01-24 50
+484 5 1997-03-05 48
+485 1 1997-03-28 50
+4868 3 1997-04-23 49
+4934 1 1997-05-20 48
+4967 1 1997-05-27 50
+5152 2 1997-03-10 50
+5158 4 1997-04-10 49
+581 3 1997-02-27 49
+5829 5 1997-01-31 49
+5895 3 1997-03-15 49
+5952 1 1997-06-30 49
+set statement optimizer_switch='rowid_filter=off' for EXPLAIN SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+l_quantity > 47;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE lineitem range i_l_shipdate,i_l_quantity i_l_shipdate 4 NULL 482 Using index condition; Using where
+set statement optimizer_switch='rowid_filter=off' for EXPLAIN FORMAT=JSON SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+l_quantity > 47;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": "COST_REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "range",
+ "possible_keys": ["i_l_shipdate", "i_l_quantity"],
+ "key": "i_l_shipdate",
+ "key_length": "4",
+ "used_key_parts": ["l_shipDATE"],
+ "loops": 1,
+ "rows": 482,
+ "cost": "COST_REPLACED",
+ "filtered": 11.80682755,
+ "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
+ "attached_condition": "lineitem.l_quantity > 47"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+l_quantity > 47;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE lineitem range i_l_shipdate,i_l_quantity i_l_shipdate 4 NULL 482 510.00 11.81 6.67 Using index condition; Using where
+set statement optimizer_switch='rowid_filter=off' for ANALYZE FORMAT=JSON SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+l_quantity > 47;
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "range",
+ "possible_keys": ["i_l_shipdate", "i_l_quantity"],
+ "key": "i_l_shipdate",
+ "key_length": "4",
+ "used_key_parts": ["l_shipDATE"],
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 482,
+ "r_rows": 510,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 11.80682755,
+ "r_filtered": 6.666666667,
+ "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
+ "attached_condition": "lineitem.l_quantity > 47"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=off' for SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+l_quantity > 47;
+l_orderkey l_linenumber l_shipdate l_quantity
+1121 6 1997-04-21 50
+1441 7 1997-06-07 50
+1473 1 1997-05-05 50
+1954 7 1997-06-04 49
+2151 3 1997-01-20 49
+2469 3 1997-01-11 48
+2469 6 1997-03-03 49
+2470 2 1997-06-02 50
+260 1 1997-03-24 50
+288 2 1997-04-19 49
+289 4 1997-03-14 48
+3009 1 1997-03-19 48
+3105 3 1997-02-28 48
+3106 2 1997-02-27 49
+3429 1 1997-04-08 48
+3490 2 1997-06-27 50
+3619 1 1997-01-22 49
+4005 4 1997-01-31 49
+4066 4 1997-02-17 49
+4453 3 1997-05-29 48
+4484 7 1997-03-17 50
+484 1 1997-03-06 49
+484 3 1997-01-24 50
+484 5 1997-03-05 48
+485 1 1997-03-28 50
+4868 3 1997-04-23 49
+4934 1 1997-05-20 48
+4967 1 1997-05-27 50
+5152 2 1997-03-10 50
+5158 4 1997-04-10 49
+581 3 1997-02-27 49
+5829 5 1997-01-31 49
+5895 3 1997-03-15 49
+5952 1 1997-06-30 49
+set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-01-31' AND
+o_totalprice between 200000 and 230000;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate 4 NULL 92 Using index condition
+1 SIMPLE orders eq_ref|filter PRIMARY,i_o_totalprice PRIMARY|i_o_totalprice 4|9 dbt3_s001.lineitem.l_orderkey 1 (7%) Using where; Using rowid filter
+set statement optimizer_switch='rowid_filter=on' for EXPLAIN FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-01-31' AND
+o_totalprice between 200000 and 230000;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": "COST_REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "range",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity"
+ ],
+ "key": "i_l_shipdate",
+ "key_length": "4",
+ "used_key_parts": ["l_shipDATE"],
+ "loops": 1,
+ "rows": 92,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'"
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "eq_ref",
+ "possible_keys": ["PRIMARY", "i_o_totalprice"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["o_orderkey"],
+ "ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "rowid_filter": {
+ "range": {
+ "key": "i_o_totalprice",
+ "used_key_parts": ["o_totalprice"]
+ },
+ "rows": 106,
+ "selectivity_pct": 7.066666667
+ },
+ "loops": 92,
+ "rows": 1,
+ "cost": "COST_REPLACED",
+ "filtered": 7.066666603,
+ "attached_condition": "orders.o_totalprice between 200000 and 230000"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-01-31' AND
+o_totalprice between 200000 and 230000;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate 4 NULL 92 98.00 100.00 100.00 Using index condition
+1 SIMPLE orders eq_ref|filter PRIMARY,i_o_totalprice PRIMARY|i_o_totalprice 4|9 dbt3_s001.lineitem.l_orderkey 1 (7%) 0.11 (10%) 7.07 100.00 Using where; Using rowid filter
+set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-01-31' AND
+o_totalprice between 200000 and 230000;
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "range",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity"
+ ],
+ "key": "i_l_shipdate",
+ "key_length": "4",
+ "used_key_parts": ["l_shipDATE"],
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 92,
+ "r_rows": 98,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 100,
+ "r_filtered": 100,
+ "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'"
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "eq_ref",
+ "possible_keys": ["PRIMARY", "i_o_totalprice"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["o_orderkey"],
+ "ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "rowid_filter": {
+ "range": {
+ "key": "i_o_totalprice",
+ "used_key_parts": ["o_totalprice"]
+ },
+ "rows": 106,
+ "selectivity_pct": 7.066666667,
+ "r_rows": 71,
+ "r_lookups": 96,
+ "r_selectivity_pct": 10.41666667,
+ "r_buffer_size": "REPLACED",
+ "r_filling_time_ms": "REPLACED"
+ },
+ "loops": 92,
+ "r_loops": 98,
+ "r_table_loops": 96,
+ "rows": 1,
+ "r_rows": 0.112244898,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 7.066666603,
+ "r_filtered": 100,
+ "attached_condition": "orders.o_totalprice between 200000 and 230000"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=on' for SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-01-31' AND
+o_totalprice between 200000 and 230000;
+o_orderkey l_linenumber l_shipdate o_totalprice
+1156 3 1997-01-24 217682.81
+1156 4 1997-01-18 217682.81
+1156 6 1997-01-27 217682.81
+1156 7 1997-01-01 217682.81
+2180 2 1997-01-03 208481.57
+2180 3 1997-01-03 208481.57
+3619 1 1997-01-22 222274.54
+3619 3 1997-01-31 222274.54
+3619 6 1997-01-25 222274.54
+484 3 1997-01-24 219920.62
+5606 6 1997-01-11 219959.08
+set statement optimizer_switch='rowid_filter=off' for EXPLAIN SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-01-31' AND
+o_totalprice between 200000 and 230000;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate 4 NULL 92 Using index condition
+1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 Using where
+set statement optimizer_switch='rowid_filter=off' for EXPLAIN FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-01-31' AND
+o_totalprice between 200000 and 230000;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": "COST_REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "range",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity"
+ ],
+ "key": "i_l_shipdate",
+ "key_length": "4",
+ "used_key_parts": ["l_shipDATE"],
+ "loops": 1,
+ "rows": 92,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'"
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "eq_ref",
+ "possible_keys": ["PRIMARY", "i_o_totalprice"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["o_orderkey"],
+ "ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 92,
+ "rows": 1,
+ "cost": "COST_REPLACED",
+ "filtered": 7.066666603,
+ "attached_condition": "orders.o_totalprice between 200000 and 230000"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-01-31' AND
+o_totalprice between 200000 and 230000;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate 4 NULL 92 98.00 100.00 100.00 Using index condition
+1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 1.00 7.07 11.22 Using where
+set statement optimizer_switch='rowid_filter=off' for ANALYZE FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-01-31' AND
+o_totalprice between 200000 and 230000;
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "range",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity"
+ ],
+ "key": "i_l_shipdate",
+ "key_length": "4",
+ "used_key_parts": ["l_shipDATE"],
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 92,
+ "r_rows": 98,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 100,
+ "r_filtered": 100,
+ "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'"
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "eq_ref",
+ "possible_keys": ["PRIMARY", "i_o_totalprice"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["o_orderkey"],
+ "ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 92,
+ "r_loops": 98,
+ "r_table_loops": 96,
+ "rows": 1,
+ "r_rows": 1,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 7.066666603,
+ "r_filtered": 11.2244898,
+ "attached_condition": "orders.o_totalprice between 200000 and 230000"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=off' for SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-01-31' AND
+o_totalprice between 200000 and 230000;
+o_orderkey l_linenumber l_shipdate o_totalprice
+1156 3 1997-01-24 217682.81
+1156 4 1997-01-18 217682.81
+1156 6 1997-01-27 217682.81
+1156 7 1997-01-01 217682.81
+2180 2 1997-01-03 208481.57
+2180 3 1997-01-03 208481.57
+3619 1 1997-01-22 222274.54
+3619 3 1997-01-31 222274.54
+3619 6 1997-01-25 222274.54
+484 3 1997-01-24 219920.62
+5606 6 1997-01-11 219959.08
+set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+l_quantity > 47 AND
+o_totalprice between 180000 and 230000;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE lineitem range|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_shipdate|i_l_quantity 4|9 NULL 482 (12%) Using index condition; Using where; Using rowid filter
+1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 Using where
+set statement optimizer_switch='rowid_filter=on' for EXPLAIN FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+l_quantity > 47 AND
+o_totalprice between 180000 and 230000;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": "COST_REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "range",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity",
+ "i_l_quantity"
+ ],
+ "key": "i_l_shipdate",
+ "key_length": "4",
+ "used_key_parts": ["l_shipDATE"],
+ "rowid_filter": {
+ "range": {
+ "key": "i_l_quantity",
+ "used_key_parts": ["l_quantity"]
+ },
+ "rows": 709,
+ "selectivity_pct": 11.80682764
+ },
+ "loops": 1,
+ "rows": 482,
+ "cost": "COST_REPLACED",
+ "filtered": 11.80682755,
+ "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
+ "attached_condition": "lineitem.l_quantity > 47"
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "eq_ref",
+ "possible_keys": ["PRIMARY", "i_o_totalprice"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["o_orderkey"],
+ "ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 56.90890924,
+ "rows": 1,
+ "cost": "COST_REPLACED",
+ "filtered": 14.39999962,
+ "attached_condition": "orders.o_totalprice between 180000 and 230000"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+l_quantity > 47 AND
+o_totalprice between 180000 and 230000;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE lineitem range|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_shipdate|i_l_quantity 4|9 NULL 482 (12%) 34.00 (6%) 11.81 100.00 Using index condition; Using where; Using rowid filter
+1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 1.00 14.40 26.47 Using where
+set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+l_quantity > 47 AND
+o_totalprice between 180000 and 230000;
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "range",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity",
+ "i_l_quantity"
+ ],
+ "key": "i_l_shipdate",
+ "key_length": "4",
+ "used_key_parts": ["l_shipDATE"],
+ "rowid_filter": {
+ "range": {
+ "key": "i_l_quantity",
+ "used_key_parts": ["l_quantity"]
+ },
+ "rows": 709,
+ "selectivity_pct": 11.80682764,
+ "r_rows": 349,
+ "r_lookups": 510,
+ "r_selectivity_pct": 6.666666667,
+ "r_buffer_size": "REPLACED",
+ "r_filling_time_ms": "REPLACED"
+ },
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 482,
+ "r_rows": 34,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 11.80682755,
+ "r_filtered": 100,
+ "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
+ "attached_condition": "lineitem.l_quantity > 47"
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "eq_ref",
+ "possible_keys": ["PRIMARY", "i_o_totalprice"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["o_orderkey"],
+ "ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 56.90890924,
+ "r_loops": 34,
+ "r_table_loops": 33,
+ "rows": 1,
+ "r_rows": 1,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 14.39999962,
+ "r_filtered": 26.47058824,
+ "attached_condition": "orders.o_totalprice between 180000 and 230000"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=on' for SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+l_quantity > 47 AND
+o_totalprice between 180000 and 230000;
+o_orderkey l_linenumber l_shipdate l_quantity o_totalprice
+2469 3 1997-01-11 48 192074.23
+2469 6 1997-03-03 49 192074.23
+3619 1 1997-01-22 49 222274.54
+484 1 1997-03-06 49 219920.62
+484 3 1997-01-24 50 219920.62
+484 5 1997-03-05 48 219920.62
+4934 1 1997-05-20 48 180478.16
+5829 5 1997-01-31 49 183734.56
+5895 3 1997-03-15 49 201419.83
+set statement optimizer_switch='rowid_filter=off' for EXPLAIN SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+l_quantity > 47 AND
+o_totalprice between 180000 and 230000;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_shipdate 4 NULL 482 Using index condition; Using where
+1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 Using where
+set statement optimizer_switch='rowid_filter=off' for EXPLAIN FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+l_quantity > 47 AND
+o_totalprice between 180000 and 230000;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": "COST_REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "range",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity",
+ "i_l_quantity"
+ ],
+ "key": "i_l_shipdate",
+ "key_length": "4",
+ "used_key_parts": ["l_shipDATE"],
+ "loops": 1,
+ "rows": 482,
+ "cost": "COST_REPLACED",
+ "filtered": 11.80682755,
+ "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
+ "attached_condition": "lineitem.l_quantity > 47"
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "eq_ref",
+ "possible_keys": ["PRIMARY", "i_o_totalprice"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["o_orderkey"],
+ "ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 56.90890924,
+ "rows": 1,
+ "cost": "COST_REPLACED",
+ "filtered": 14.39999962,
+ "attached_condition": "orders.o_totalprice between 180000 and 230000"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+l_quantity > 47 AND
+o_totalprice between 180000 and 230000;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_shipdate 4 NULL 482 510.00 11.81 6.67 Using index condition; Using where
+1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 1.00 14.40 26.47 Using where
+set statement optimizer_switch='rowid_filter=off' for ANALYZE FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+l_quantity > 47 AND
+o_totalprice between 180000 and 230000;
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "range",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity",
+ "i_l_quantity"
+ ],
+ "key": "i_l_shipdate",
+ "key_length": "4",
+ "used_key_parts": ["l_shipDATE"],
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 482,
+ "r_rows": 510,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 11.80682755,
+ "r_filtered": 6.666666667,
+ "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
+ "attached_condition": "lineitem.l_quantity > 47"
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "eq_ref",
+ "possible_keys": ["PRIMARY", "i_o_totalprice"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["o_orderkey"],
+ "ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 56.90890924,
+ "r_loops": 34,
+ "r_table_loops": 33,
+ "rows": 1,
+ "r_rows": 1,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 14.39999962,
+ "r_filtered": 26.47058824,
+ "attached_condition": "orders.o_totalprice between 180000 and 230000"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=off' for SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+l_quantity > 47 AND
+o_totalprice between 180000 and 230000;
+o_orderkey l_linenumber l_shipdate l_quantity o_totalprice
+2469 3 1997-01-11 48 192074.23
+2469 6 1997-03-03 49 192074.23
+3619 1 1997-01-22 49 222274.54
+484 1 1997-03-06 49 219920.62
+484 3 1997-01-24 50 219920.62
+484 5 1997-03-05 48 219920.62
+4934 1 1997-05-20 48 180478.16
+5829 5 1997-01-31 49 183734.56
+5895 3 1997-03-15 49 201419.83
+set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT STRAIGHT_JOIN o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
+FROM lineitem JOIN orders ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+l_quantity > 47 AND
+o_totalprice between 180000 and 230000;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE lineitem range|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_shipdate|i_l_quantity 4|9 NULL 482 (12%) Using index condition; Using where; Using rowid filter
+1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 Using where
+set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+o_totalprice between 200000 and 230000;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE orders range PRIMARY,i_o_totalprice i_o_totalprice 9 NULL 106 Using index condition
+1 SIMPLE lineitem ref|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey|i_l_shipdate 4|4 dbt3_s001.orders.o_orderkey 4 (8%) Using where; Using rowid filter
+set statement optimizer_switch='rowid_filter=on' for EXPLAIN FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+o_totalprice between 200000 and 230000;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": "COST_REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "range",
+ "possible_keys": ["PRIMARY", "i_o_totalprice"],
+ "key": "i_o_totalprice",
+ "key_length": "9",
+ "used_key_parts": ["o_totalprice"],
+ "loops": 1,
+ "rows": 106,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "index_condition": "orders.o_totalprice between 200000 and 230000"
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity"
+ ],
+ "key": "i_l_orderkey",
+ "key_length": "4",
+ "used_key_parts": ["l_orderkey"],
+ "ref": ["dbt3_s001.orders.o_orderkey"],
+ "rowid_filter": {
+ "range": {
+ "key": "i_l_shipdate",
+ "used_key_parts": ["l_shipDATE"]
+ },
+ "rows": 482,
+ "selectivity_pct": 8.026644463
+ },
+ "loops": 106,
+ "rows": 4,
+ "cost": "COST_REPLACED",
+ "filtered": 8.026644707,
+ "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+o_totalprice between 200000 and 230000;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE orders range PRIMARY,i_o_totalprice i_o_totalprice 9 NULL 106 71.00 100.00 100.00 Using index condition
+1 SIMPLE lineitem ref|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey|i_l_shipdate 4|4 dbt3_s001.orders.o_orderkey 4 (8%) 0.52 (7%) 8.03 100.00 Using where; Using rowid filter
+set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+o_totalprice between 200000 and 230000;
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "range",
+ "possible_keys": ["PRIMARY", "i_o_totalprice"],
+ "key": "i_o_totalprice",
+ "key_length": "9",
+ "used_key_parts": ["o_totalprice"],
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 106,
+ "r_rows": 71,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 100,
+ "r_filtered": 100,
+ "index_condition": "orders.o_totalprice between 200000 and 230000"
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity"
+ ],
+ "key": "i_l_orderkey",
+ "key_length": "4",
+ "used_key_parts": ["l_orderkey"],
+ "ref": ["dbt3_s001.orders.o_orderkey"],
+ "rowid_filter": {
+ "range": {
+ "key": "i_l_shipdate",
+ "used_key_parts": ["l_shipDATE"]
+ },
+ "rows": 482,
+ "selectivity_pct": 8.026644463,
+ "r_rows": 510,
+ "r_lookups": 476,
+ "r_selectivity_pct": 7.773109244,
+ "r_buffer_size": "REPLACED",
+ "r_filling_time_ms": "REPLACED"
+ },
+ "loops": 106,
+ "r_loops": 71,
+ "rows": 4,
+ "r_rows": 0.521126761,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 8.026644707,
+ "r_filtered": 100,
+ "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=on' for SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+o_totalprice between 200000 and 230000;
+o_orderkey l_linenumber l_shipdate o_totalprice
+1156 3 1997-01-24 217682.81
+1156 4 1997-01-18 217682.81
+1156 6 1997-01-27 217682.81
+1156 7 1997-01-01 217682.81
+1890 1 1997-04-02 202364.58
+1890 3 1997-02-09 202364.58
+1890 4 1997-04-08 202364.58
+1890 5 1997-04-15 202364.58
+1890 6 1997-02-13 202364.58
+2180 2 1997-01-03 208481.57
+2180 3 1997-01-03 208481.57
+3619 1 1997-01-22 222274.54
+3619 3 1997-01-31 222274.54
+3619 4 1997-03-18 222274.54
+3619 6 1997-01-25 222274.54
+453 1 1997-06-30 216826.73
+453 2 1997-06-30 216826.73
+484 1 1997-03-06 219920.62
+484 2 1997-04-09 219920.62
+484 3 1997-01-24 219920.62
+484 4 1997-04-29 219920.62
+484 5 1997-03-05 219920.62
+484 6 1997-04-06 219920.62
+5606 2 1997-02-23 219959.08
+5606 3 1997-03-11 219959.08
+5606 4 1997-02-06 219959.08
+5606 6 1997-01-11 219959.08
+5606 7 1997-02-01 219959.08
+5859 2 1997-05-15 210643.96
+5859 5 1997-05-28 210643.96
+5859 6 1997-06-15 210643.96
+5895 1 1997-04-05 201419.83
+5895 2 1997-04-27 201419.83
+5895 3 1997-03-15 201419.83
+5895 4 1997-03-03 201419.83
+5895 5 1997-04-30 201419.83
+5895 6 1997-04-19 201419.83
+set statement optimizer_switch='rowid_filter=off' for EXPLAIN SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+o_totalprice between 200000 and 230000;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE orders range PRIMARY,i_o_totalprice i_o_totalprice 9 NULL 106 Using index condition
+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey 4 dbt3_s001.orders.o_orderkey 4 Using where
+set statement optimizer_switch='rowid_filter=off' for EXPLAIN FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+o_totalprice between 200000 and 230000;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": "COST_REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "range",
+ "possible_keys": ["PRIMARY", "i_o_totalprice"],
+ "key": "i_o_totalprice",
+ "key_length": "9",
+ "used_key_parts": ["o_totalprice"],
+ "loops": 1,
+ "rows": 106,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "index_condition": "orders.o_totalprice between 200000 and 230000"
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity"
+ ],
+ "key": "i_l_orderkey",
+ "key_length": "4",
+ "used_key_parts": ["l_orderkey"],
+ "ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 106,
+ "rows": 4,
+ "cost": "COST_REPLACED",
+ "filtered": 8.026644707,
+ "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+o_totalprice between 200000 and 230000;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE orders range PRIMARY,i_o_totalprice i_o_totalprice 9 NULL 106 71.00 100.00 100.00 Using index condition
+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey 4 dbt3_s001.orders.o_orderkey 4 6.70 8.03 7.77 Using where
+set statement optimizer_switch='rowid_filter=off' for ANALYZE FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+o_totalprice between 200000 and 230000;
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "range",
+ "possible_keys": ["PRIMARY", "i_o_totalprice"],
+ "key": "i_o_totalprice",
+ "key_length": "9",
+ "used_key_parts": ["o_totalprice"],
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 106,
+ "r_rows": 71,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 100,
+ "r_filtered": 100,
+ "index_condition": "orders.o_totalprice between 200000 and 230000"
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity"
+ ],
+ "key": "i_l_orderkey",
+ "key_length": "4",
+ "used_key_parts": ["l_orderkey"],
+ "ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 106,
+ "r_loops": 71,
+ "rows": 4,
+ "r_rows": 6.704225352,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 8.026644707,
+ "r_filtered": 7.773109244,
+ "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=off' for SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
+FROM orders JOIN lineitem ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+o_totalprice between 200000 and 230000;
+o_orderkey l_linenumber l_shipdate o_totalprice
+1156 3 1997-01-24 217682.81
+1156 4 1997-01-18 217682.81
+1156 6 1997-01-27 217682.81
+1156 7 1997-01-01 217682.81
+1890 1 1997-04-02 202364.58
+1890 3 1997-02-09 202364.58
+1890 4 1997-04-08 202364.58
+1890 5 1997-04-15 202364.58
+1890 6 1997-02-13 202364.58
+2180 2 1997-01-03 208481.57
+2180 3 1997-01-03 208481.57
+3619 1 1997-01-22 222274.54
+3619 3 1997-01-31 222274.54
+3619 4 1997-03-18 222274.54
+3619 6 1997-01-25 222274.54
+453 1 1997-06-30 216826.73
+453 2 1997-06-30 216826.73
+484 1 1997-03-06 219920.62
+484 2 1997-04-09 219920.62
+484 3 1997-01-24 219920.62
+484 4 1997-04-29 219920.62
+484 5 1997-03-05 219920.62
+484 6 1997-04-06 219920.62
+5606 2 1997-02-23 219959.08
+5606 3 1997-03-11 219959.08
+5606 4 1997-02-06 219959.08
+5606 6 1997-01-11 219959.08
+5606 7 1997-02-01 219959.08
+5859 2 1997-05-15 210643.96
+5859 5 1997-05-28 210643.96
+5859 6 1997-06-15 210643.96
+5895 1 1997-04-05 201419.83
+5895 2 1997-04-27 201419.83
+5895 3 1997-03-15 201419.83
+5895 4 1997-03-03 201419.83
+5895 5 1997-04-30 201419.83
+5895 6 1997-04-19 201419.83
+#
+# MDEV-18413: find constraint correlated indexes
+#
+ALTER TABLE lineitem ADD CONSTRAINT l_date CHECK(l_shipdate < l_receiptdate);
+# Filter on l_shipdate is not used because it participates in
+# the same constraint as l_receiptdate.
+# Access is made on l_receiptdate.
+set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT l_shipdate, l_receiptdate, o_totalprice
+FROM orders, lineitem
+WHERE o_orderkey=l_orderkey AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-10-10' AND
+l_receiptdate BETWEEN '1996-10-05' AND '1996-10-10' AND
+o_totalprice BETWEEN 200000 AND 250000;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_receiptdate 4 NULL 17 Using index condition; Using where
+1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 Using where
+set statement optimizer_switch='rowid_filter=on' for EXPLAIN FORMAT=JSON SELECT l_shipdate, l_receiptdate, o_totalprice
+FROM orders, lineitem
+WHERE o_orderkey=l_orderkey AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-10-10' AND
+l_receiptdate BETWEEN '1996-10-05' AND '1996-10-10' AND
+o_totalprice BETWEEN 200000 AND 250000;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": "COST_REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "range",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_receiptdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity"
+ ],
+ "key": "i_l_receiptdate",
+ "key_length": "4",
+ "used_key_parts": ["l_receiptDATE"],
+ "loops": 1,
+ "rows": 17,
+ "cost": "COST_REPLACED",
+ "filtered": 0.532889247,
+ "index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'",
+ "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'"
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "eq_ref",
+ "possible_keys": ["PRIMARY", "i_o_totalprice"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["o_orderkey"],
+ "ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
+ "filtered": 8.466666222,
+ "attached_condition": "orders.o_totalprice between 200000 and 250000"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT l_shipdate, l_receiptdate, o_totalprice
+FROM orders, lineitem
+WHERE o_orderkey=l_orderkey AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-10-10' AND
+l_receiptdate BETWEEN '1996-10-05' AND '1996-10-10' AND
+o_totalprice BETWEEN 200000 AND 250000;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_receiptdate 4 NULL 17 18.00 0.53 38.89 Using index condition; Using where
+1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 1.00 8.47 14.29 Using where
+set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT l_shipdate, l_receiptdate, o_totalprice
+FROM orders, lineitem
+WHERE o_orderkey=l_orderkey AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-10-10' AND
+l_receiptdate BETWEEN '1996-10-05' AND '1996-10-10' AND
+o_totalprice BETWEEN 200000 AND 250000;
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "range",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_receiptdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity"
+ ],
+ "key": "i_l_receiptdate",
+ "key_length": "4",
+ "used_key_parts": ["l_receiptDATE"],
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 17,
+ "r_rows": 18,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 0.532889247,
+ "r_filtered": 38.88888889,
+ "index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'",
+ "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'"
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "eq_ref",
+ "possible_keys": ["PRIMARY", "i_o_totalprice"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["o_orderkey"],
+ "ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 1,
+ "r_loops": 7,
+ "rows": 1,
+ "r_rows": 1,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 8.466666222,
+ "r_filtered": 14.28571429,
+ "attached_condition": "orders.o_totalprice between 200000 and 250000"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=on' for SELECT l_shipdate, l_receiptdate, o_totalprice
+FROM orders, lineitem
+WHERE o_orderkey=l_orderkey AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-10-10' AND
+l_receiptdate BETWEEN '1996-10-05' AND '1996-10-10' AND
+o_totalprice BETWEEN 200000 AND 250000;
+l_shipdate l_receiptdate o_totalprice
+1996-10-07 1996-10-08 202623.92
+set statement optimizer_switch='rowid_filter=off' for EXPLAIN SELECT l_shipdate, l_receiptdate, o_totalprice
+FROM orders, lineitem
+WHERE o_orderkey=l_orderkey AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-10-10' AND
+l_receiptdate BETWEEN '1996-10-05' AND '1996-10-10' AND
+o_totalprice BETWEEN 200000 AND 250000;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_receiptdate 4 NULL 17 Using index condition; Using where
+1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 Using where
+set statement optimizer_switch='rowid_filter=off' for EXPLAIN FORMAT=JSON SELECT l_shipdate, l_receiptdate, o_totalprice
+FROM orders, lineitem
+WHERE o_orderkey=l_orderkey AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-10-10' AND
+l_receiptdate BETWEEN '1996-10-05' AND '1996-10-10' AND
+o_totalprice BETWEEN 200000 AND 250000;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": "COST_REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "range",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_receiptdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity"
+ ],
+ "key": "i_l_receiptdate",
+ "key_length": "4",
+ "used_key_parts": ["l_receiptDATE"],
+ "loops": 1,
+ "rows": 17,
+ "cost": "COST_REPLACED",
+ "filtered": 0.532889247,
+ "index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'",
+ "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'"
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "eq_ref",
+ "possible_keys": ["PRIMARY", "i_o_totalprice"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["o_orderkey"],
+ "ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
+ "filtered": 8.466666222,
+ "attached_condition": "orders.o_totalprice between 200000 and 250000"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT l_shipdate, l_receiptdate, o_totalprice
+FROM orders, lineitem
+WHERE o_orderkey=l_orderkey AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-10-10' AND
+l_receiptdate BETWEEN '1996-10-05' AND '1996-10-10' AND
+o_totalprice BETWEEN 200000 AND 250000;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_receiptdate 4 NULL 17 18.00 0.53 38.89 Using index condition; Using where
+1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 1.00 8.47 14.29 Using where
+set statement optimizer_switch='rowid_filter=off' for ANALYZE FORMAT=JSON SELECT l_shipdate, l_receiptdate, o_totalprice
+FROM orders, lineitem
+WHERE o_orderkey=l_orderkey AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-10-10' AND
+l_receiptdate BETWEEN '1996-10-05' AND '1996-10-10' AND
+o_totalprice BETWEEN 200000 AND 250000;
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "range",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_receiptdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity"
+ ],
+ "key": "i_l_receiptdate",
+ "key_length": "4",
+ "used_key_parts": ["l_receiptDATE"],
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 17,
+ "r_rows": 18,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 0.532889247,
+ "r_filtered": 38.88888889,
+ "index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'",
+ "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'"
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "eq_ref",
+ "possible_keys": ["PRIMARY", "i_o_totalprice"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["o_orderkey"],
+ "ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 1,
+ "r_loops": 7,
+ "rows": 1,
+ "r_rows": 1,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 8.466666222,
+ "r_filtered": 14.28571429,
+ "attached_condition": "orders.o_totalprice between 200000 and 250000"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=off' for SELECT l_shipdate, l_receiptdate, o_totalprice
+FROM orders, lineitem
+WHERE o_orderkey=l_orderkey AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-10-10' AND
+l_receiptdate BETWEEN '1996-10-05' AND '1996-10-10' AND
+o_totalprice BETWEEN 200000 AND 250000;
+l_shipdate l_receiptdate o_totalprice
+1996-10-07 1996-10-08 202623.92
+ALTER TABLE orders ADD COLUMN o_totaldiscount double;
+UPDATE orders SET o_totaldiscount = o_totalprice*(o_custkey/1000);
+CREATE INDEX i_o_totaldiscount on orders(o_totaldiscount);
+ALTER TABLE orders ADD CONSTRAINT o_price CHECK(o_totalprice > o_totaldiscount);
+# Filter on o_totalprice is not used because it participates in
+# the same constraint as o_discount.
+# Access is made on o_discount.
+set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT o_totaldiscount, o_totalprice, l_shipdate
+FROM orders, lineitem
+WHERE o_orderkey=l_orderkey AND
+o_totaldiscount BETWEEN 18000 AND 20000 AND
+o_totalprice BETWEEN 200000 AND 220000 AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE orders range PRIMARY,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 61 Using index condition; Using where
+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where
+set statement optimizer_switch='rowid_filter=on' for EXPLAIN FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate
+FROM orders, lineitem
+WHERE o_orderkey=l_orderkey AND
+o_totaldiscount BETWEEN 18000 AND 20000 AND
+o_totalprice BETWEEN 200000 AND 220000 AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": "COST_REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "range",
+ "possible_keys": ["PRIMARY", "i_o_totalprice", "i_o_totaldiscount"],
+ "key": "i_o_totaldiscount",
+ "key_length": "9",
+ "used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
+ "rows": 61,
+ "cost": "COST_REPLACED",
+ "filtered": 5,
+ "index_condition": "orders.o_totaldiscount between 18000 and 20000",
+ "attached_condition": "orders.o_totalprice between 200000 and 220000"
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity"
+ ],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["l_orderkey"],
+ "ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 3.05,
+ "rows": 4,
+ "cost": "COST_REPLACED",
+ "filtered": 2.897585392,
+ "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT o_totaldiscount, o_totalprice, l_shipdate
+FROM orders, lineitem
+WHERE o_orderkey=l_orderkey AND
+o_totaldiscount BETWEEN 18000 AND 20000 AND
+o_totalprice BETWEEN 200000 AND 220000 AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE orders range PRIMARY,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 61 41.00 5.00 2.44 Using index condition; Using where
+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 6.00 2.90 66.67 Using where
+set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate
+FROM orders, lineitem
+WHERE o_orderkey=l_orderkey AND
+o_totaldiscount BETWEEN 18000 AND 20000 AND
+o_totalprice BETWEEN 200000 AND 220000 AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "range",
+ "possible_keys": ["PRIMARY", "i_o_totalprice", "i_o_totaldiscount"],
+ "key": "i_o_totaldiscount",
+ "key_length": "9",
+ "used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 61,
+ "r_rows": 41,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 5,
+ "r_filtered": 2.43902439,
+ "index_condition": "orders.o_totaldiscount between 18000 and 20000",
+ "attached_condition": "orders.o_totalprice between 200000 and 220000"
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity"
+ ],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["l_orderkey"],
+ "ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 3.05,
+ "r_loops": 1,
+ "rows": 4,
+ "r_rows": 6,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 2.897585392,
+ "r_filtered": 66.66666667,
+ "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=on' for SELECT o_totaldiscount, o_totalprice, l_shipdate
+FROM orders, lineitem
+WHERE o_orderkey=l_orderkey AND
+o_totaldiscount BETWEEN 18000 AND 20000 AND
+o_totalprice BETWEEN 200000 AND 220000 AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
+o_totaldiscount o_totalprice l_shipdate
+18016.04288 219707.84 1996-10-02
+18016.04288 219707.84 1996-10-17
+18016.04288 219707.84 1996-11-04
+18016.04288 219707.84 1996-11-14
+set statement optimizer_switch='rowid_filter=off' for EXPLAIN SELECT o_totaldiscount, o_totalprice, l_shipdate
+FROM orders, lineitem
+WHERE o_orderkey=l_orderkey AND
+o_totaldiscount BETWEEN 18000 AND 20000 AND
+o_totalprice BETWEEN 200000 AND 220000 AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE orders range PRIMARY,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 61 Using index condition; Using where
+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where
+set statement optimizer_switch='rowid_filter=off' for EXPLAIN FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate
+FROM orders, lineitem
+WHERE o_orderkey=l_orderkey AND
+o_totaldiscount BETWEEN 18000 AND 20000 AND
+o_totalprice BETWEEN 200000 AND 220000 AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": "COST_REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "range",
+ "possible_keys": ["PRIMARY", "i_o_totalprice", "i_o_totaldiscount"],
+ "key": "i_o_totaldiscount",
+ "key_length": "9",
+ "used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
+ "rows": 61,
+ "cost": "COST_REPLACED",
+ "filtered": 5,
+ "index_condition": "orders.o_totaldiscount between 18000 and 20000",
+ "attached_condition": "orders.o_totalprice between 200000 and 220000"
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity"
+ ],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["l_orderkey"],
+ "ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 3.05,
+ "rows": 4,
+ "cost": "COST_REPLACED",
+ "filtered": 2.897585392,
+ "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT o_totaldiscount, o_totalprice, l_shipdate
+FROM orders, lineitem
+WHERE o_orderkey=l_orderkey AND
+o_totaldiscount BETWEEN 18000 AND 20000 AND
+o_totalprice BETWEEN 200000 AND 220000 AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE orders range PRIMARY,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 61 41.00 5.00 2.44 Using index condition; Using where
+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 6.00 2.90 66.67 Using where
+set statement optimizer_switch='rowid_filter=off' for ANALYZE FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate
+FROM orders, lineitem
+WHERE o_orderkey=l_orderkey AND
+o_totaldiscount BETWEEN 18000 AND 20000 AND
+o_totalprice BETWEEN 200000 AND 220000 AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "range",
+ "possible_keys": ["PRIMARY", "i_o_totalprice", "i_o_totaldiscount"],
+ "key": "i_o_totaldiscount",
+ "key_length": "9",
+ "used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 61,
+ "r_rows": 41,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 5,
+ "r_filtered": 2.43902439,
+ "index_condition": "orders.o_totaldiscount between 18000 and 20000",
+ "attached_condition": "orders.o_totalprice between 200000 and 220000"
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity"
+ ],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["l_orderkey"],
+ "ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 3.05,
+ "r_loops": 1,
+ "rows": 4,
+ "r_rows": 6,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 2.897585392,
+ "r_filtered": 66.66666667,
+ "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=off' for SELECT o_totaldiscount, o_totalprice, l_shipdate
+FROM orders, lineitem
+WHERE o_orderkey=l_orderkey AND
+o_totaldiscount BETWEEN 18000 AND 20000 AND
+o_totalprice BETWEEN 200000 AND 220000 AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
+o_totaldiscount o_totalprice l_shipdate
+18016.04288 219707.84 1996-10-02
+18016.04288 219707.84 1996-10-17
+18016.04288 219707.84 1996-11-04
+18016.04288 219707.84 1996-11-14
+CREATE VIEW v1 AS
+SELECT * FROM orders
+WHERE o_orderdate BETWEEN '1992-12-01' AND '1997-01-01';
+set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT o_totaldiscount, o_totalprice, l_shipdate
+FROM v1, lineitem
+WHERE o_orderkey=l_orderkey AND
+o_totaldiscount BETWEEN 18000 AND 20000 AND
+o_totalprice BETWEEN 200000 AND 220000 AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE orders range PRIMARY,i_o_orderdate,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 61 Using index condition; Using where
+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where
+set statement optimizer_switch='rowid_filter=on' for EXPLAIN FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate
+FROM v1, lineitem
+WHERE o_orderkey=l_orderkey AND
+o_totaldiscount BETWEEN 18000 AND 20000 AND
+o_totalprice BETWEEN 200000 AND 220000 AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "range",
+ "possible_keys": [
+ "PRIMARY",
+ "i_o_orderdate",
+ "i_o_totalprice",
+ "i_o_totaldiscount"
+ ],
+ "key": "i_o_totaldiscount",
+ "key_length": "9",
+ "used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
+ "rows": 61,
+ "cost": "REPLACED",
+ "filtered": "REPLACED",
+ "index_condition": "orders.o_totaldiscount between 18000 and 20000",
+ "attached_condition": "orders.o_totalprice between 200000 and 220000 and orders.o_orderDATE between '1992-12-01' and '1997-01-01'"
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity"
+ ],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["l_orderkey"],
+ "ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 1.779166667,
+ "rows": 4,
+ "cost": "REPLACED",
+ "filtered": "REPLACED",
+ "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT o_totaldiscount, o_totalprice, l_shipdate
+FROM v1, lineitem
+WHERE o_orderkey=l_orderkey AND
+o_totaldiscount BETWEEN 18000 AND 20000 AND
+o_totalprice BETWEEN 200000 AND 220000 AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE orders range PRIMARY,i_o_orderdate,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 61 41.00 # 2.44 Using index condition; Using where
+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 6.00 # 66.67 Using where
+set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate
+FROM v1, lineitem
+WHERE o_orderkey=l_orderkey AND
+o_totaldiscount BETWEEN 18000 AND 20000 AND
+o_totalprice BETWEEN 200000 AND 220000 AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "range",
+ "possible_keys": [
+ "PRIMARY",
+ "i_o_orderdate",
+ "i_o_totalprice",
+ "i_o_totaldiscount"
+ ],
+ "key": "i_o_totaldiscount",
+ "key_length": "9",
+ "used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 61,
+ "r_rows": 41,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": {},
+ "filtered": "REPLACED",
+ "r_filtered": 2.43902439,
+ "index_condition": "orders.o_totaldiscount between 18000 and 20000",
+ "attached_condition": "orders.o_totalprice between 200000 and 220000 and orders.o_orderDATE between '1992-12-01' and '1997-01-01'"
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity"
+ ],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["l_orderkey"],
+ "ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 1.779166667,
+ "r_loops": 1,
+ "rows": 4,
+ "r_rows": 6,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": {},
+ "filtered": "REPLACED",
+ "r_filtered": 66.66666667,
+ "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=on' for SELECT o_totaldiscount, o_totalprice, l_shipdate
+FROM v1, lineitem
+WHERE o_orderkey=l_orderkey AND
+o_totaldiscount BETWEEN 18000 AND 20000 AND
+o_totalprice BETWEEN 200000 AND 220000 AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
+o_totaldiscount o_totalprice l_shipdate
+18016.04288 219707.84 1996-10-02
+18016.04288 219707.84 1996-10-17
+18016.04288 219707.84 1996-11-04
+18016.04288 219707.84 1996-11-14
+set statement optimizer_switch='rowid_filter=off' for EXPLAIN SELECT o_totaldiscount, o_totalprice, l_shipdate
+FROM v1, lineitem
+WHERE o_orderkey=l_orderkey AND
+o_totaldiscount BETWEEN 18000 AND 20000 AND
+o_totalprice BETWEEN 200000 AND 220000 AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE orders range PRIMARY,i_o_orderdate,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 61 Using index condition; Using where
+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where
+set statement optimizer_switch='rowid_filter=off' for EXPLAIN FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate
+FROM v1, lineitem
+WHERE o_orderkey=l_orderkey AND
+o_totaldiscount BETWEEN 18000 AND 20000 AND
+o_totalprice BETWEEN 200000 AND 220000 AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "range",
+ "possible_keys": [
+ "PRIMARY",
+ "i_o_orderdate",
+ "i_o_totalprice",
+ "i_o_totaldiscount"
+ ],
+ "key": "i_o_totaldiscount",
+ "key_length": "9",
+ "used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
+ "rows": 61,
+ "cost": "REPLACED",
+ "filtered": "REPLACED",
+ "index_condition": "orders.o_totaldiscount between 18000 and 20000",
+ "attached_condition": "orders.o_totalprice between 200000 and 220000 and orders.o_orderDATE between '1992-12-01' and '1997-01-01'"
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity"
+ ],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["l_orderkey"],
+ "ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 1.779166667,
+ "rows": 4,
+ "cost": "REPLACED",
+ "filtered": "REPLACED",
+ "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT o_totaldiscount, o_totalprice, l_shipdate
+FROM v1, lineitem
+WHERE o_orderkey=l_orderkey AND
+o_totaldiscount BETWEEN 18000 AND 20000 AND
+o_totalprice BETWEEN 200000 AND 220000 AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+1 SIMPLE orders range PRIMARY,i_o_orderdate,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 61 41.00 # 2.44 Using index condition; Using where
+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 6.00 # 66.67 Using where
+set statement optimizer_switch='rowid_filter=off' for ANALYZE FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate
+FROM v1, lineitem
+WHERE o_orderkey=l_orderkey AND
+o_totaldiscount BETWEEN 18000 AND 20000 AND
+o_totalprice BETWEEN 200000 AND 220000 AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "range",
+ "possible_keys": [
+ "PRIMARY",
+ "i_o_orderdate",
+ "i_o_totalprice",
+ "i_o_totaldiscount"
+ ],
+ "key": "i_o_totaldiscount",
+ "key_length": "9",
+ "used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 61,
+ "r_rows": 41,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": {},
+ "filtered": "REPLACED",
+ "r_filtered": 2.43902439,
+ "index_condition": "orders.o_totaldiscount between 18000 and 20000",
+ "attached_condition": "orders.o_totalprice between 200000 and 220000 and orders.o_orderDATE between '1992-12-01' and '1997-01-01'"
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": [
+ "PRIMARY",
+ "i_l_shipdate",
+ "i_l_orderkey",
+ "i_l_orderkey_quantity"
+ ],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["l_orderkey"],
+ "ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 1.779166667,
+ "r_loops": 1,
+ "rows": 4,
+ "r_rows": 6,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": {},
+ "filtered": "REPLACED",
+ "r_filtered": 66.66666667,
+ "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
+ }
+ }
+ ]
+ }
+}
+set statement optimizer_switch='rowid_filter=off' for SELECT o_totaldiscount, o_totalprice, l_shipdate
+FROM v1, lineitem
+WHERE o_orderkey=l_orderkey AND
+o_totaldiscount BETWEEN 18000 AND 20000 AND
+o_totalprice BETWEEN 200000 AND 220000 AND
+l_shipdate BETWEEN '1996-10-01' AND '1996-12-01';
+o_totaldiscount o_totalprice l_shipdate
+18016.04288 219707.84 1996-10-02
+18016.04288 219707.84 1996-10-17
+18016.04288 219707.84 1996-11-04
+18016.04288 219707.84 1996-11-14
+ALTER TABLE lineitem DROP CONSTRAINT l_date;
+ALTER TABLE orders DROP CONSTRAINT o_price;
+ALTER TABLE orders DROP COLUMN o_totaldiscount;
+DROP VIEW v1;
+DROP DATABASE dbt3_s001;
+use test;
diff --git a/mysql-test/main/rowid_filter_aria.test b/mysql-test/main/rowid_filter_aria.test
new file mode 100644
index 00000000..869d398f
--- /dev/null
+++ b/mysql-test/main/rowid_filter_aria.test
@@ -0,0 +1,9 @@
+#
+# Test rowid filters with Aria
+#
+
+SET SESSION DEFAULT_STORAGE_ENGINE='Aria';
+
+#set global aria.optimizer_rowid_compare_cost=0.00001;
+#set global aria.optimizer_rowid_copy_cost=0.00001;
+--source rowid_filter.test
diff --git a/mysql-test/main/rowid_filter_innodb.result b/mysql-test/main/rowid_filter_innodb.result
index 85a3008c..63a74485 100644
--- a/mysql-test/main/rowid_filter_innodb.result
+++ b/mysql-test/main/rowid_filter_innodb.result
@@ -60,47 +60,50 @@ set optimizer_use_condition_selectivity=2;
select
100 *
(select count(*) from lineitem
-WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 45
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 47
)
/
(select count(*) from lineitem
where l_shipdate BETWEEN '1997-01-01' AND '1997-06-30')
as correct_r_filtered_when_using_l_shipdate;
correct_r_filtered_when_using_l_shipdate
-11.7647
+6.6667
set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45;
+l_quantity > 47;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE lineitem range|filter i_l_shipdate,i_l_quantity i_l_shipdate|i_l_quantity 4|9 NULL 510 (10%) Using index condition; Using where; Using rowid filter
+1 SIMPLE lineitem range|filter i_l_shipdate,i_l_quantity i_l_quantity|i_l_shipdate 9|4 NULL 349 (8%) Using index condition; Using where; Using rowid filter
set statement optimizer_switch='rowid_filter=on' for EXPLAIN FORMAT=JSON SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45;
+l_quantity > 47;
EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
"possible_keys": ["i_l_shipdate", "i_l_quantity"],
- "key": "i_l_shipdate",
- "key_length": "4",
- "used_key_parts": ["l_shipDATE"],
+ "key": "i_l_quantity",
+ "key_length": "9",
+ "used_key_parts": ["l_quantity"],
"rowid_filter": {
"range": {
- "key": "i_l_quantity",
- "used_key_parts": ["l_quantity"]
+ "key": "i_l_shipdate",
+ "used_key_parts": ["l_shipDATE"]
},
- "rows": 605,
- "selectivity_pct": 10.07493755
+ "rows": 510,
+ "selectivity_pct": 8.492922565
},
- "rows": 510,
- "filtered": 10.07493782,
- "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
- "attached_condition": "lineitem.l_quantity > 45"
+ "loops": 1,
+ "rows": 349,
+ "cost": "COST_REPLACED",
+ "filtered": 8.492922783,
+ "index_condition": "lineitem.l_quantity > 47",
+ "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
}
]
@@ -108,12 +111,12 @@ EXPLAIN
}
set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45;
+l_quantity > 47;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
-1 SIMPLE lineitem range|filter i_l_shipdate,i_l_quantity i_l_shipdate|i_l_quantity 4|9 NULL 510 (10%) 60.00 (11%) 10.07 100.00 Using index condition; Using where; Using rowid filter
+1 SIMPLE lineitem range|filter i_l_shipdate,i_l_quantity i_l_quantity|i_l_shipdate 9|4 NULL 349 (8%) 34.00 (9%) 8.49 100.00 Using index condition; Using where; Using rowid filter
set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45;
+l_quantity > 47;
ANALYZE
{
"query_optimization": {
@@ -121,6 +124,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -129,32 +133,34 @@ ANALYZE
"table_name": "lineitem",
"access_type": "range",
"possible_keys": ["i_l_shipdate", "i_l_quantity"],
- "key": "i_l_shipdate",
- "key_length": "4",
- "used_key_parts": ["l_shipDATE"],
+ "key": "i_l_quantity",
+ "key_length": "9",
+ "used_key_parts": ["l_quantity"],
"rowid_filter": {
"range": {
- "key": "i_l_quantity",
- "used_key_parts": ["l_quantity"]
+ "key": "i_l_shipdate",
+ "used_key_parts": ["l_shipDATE"]
},
- "rows": 605,
- "selectivity_pct": 10.07493755,
- "r_rows": 605,
- "r_lookups": 510,
- "r_selectivity_pct": 11.76470588,
+ "rows": 510,
+ "selectivity_pct": 8.492922565,
+ "r_rows": 510,
+ "r_lookups": 349,
+ "r_selectivity_pct": 9.742120344,
"r_buffer_size": "REPLACED",
"r_filling_time_ms": "REPLACED"
},
+ "loops": 1,
"r_loops": 1,
- "rows": 510,
- "r_rows": 60,
+ "rows": 349,
+ "r_rows": 34,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
- "filtered": 10.07493782,
+ "filtered": 8.492922783,
"r_filtered": 100,
- "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
- "attached_condition": "lineitem.l_quantity > 45"
+ "index_condition": "lineitem.l_quantity > 47",
+ "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
}
]
@@ -162,21 +168,13 @@ ANALYZE
}
set statement optimizer_switch='rowid_filter=on' for SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45;
+l_quantity > 47;
l_orderkey l_linenumber l_shipdate l_quantity
-1121 5 1997-04-27 47
1121 6 1997-04-21 50
1441 7 1997-06-07 50
-1443 1 1997-02-05 47
1473 1 1997-05-05 50
-1568 2 1997-04-06 46
-1632 1 1997-01-25 47
-1632 3 1997-01-29 47
1954 7 1997-06-04 49
-1959 1 1997-05-05 46
2151 3 1997-01-20 49
-2177 5 1997-05-10 46
-2369 2 1997-01-02 47
2469 3 1997-01-11 48
2469 6 1997-03-03 49
2470 2 1997-06-02 50
@@ -189,66 +187,51 @@ l_orderkey l_linenumber l_shipdate l_quantity
3429 1 1997-04-08 48
3490 2 1997-06-27 50
3619 1 1997-01-22 49
-3619 3 1997-01-31 46
-3969 3 1997-05-29 46
4005 4 1997-01-31 49
-4036 1 1997-06-21 46
4066 4 1997-02-17 49
-4098 1 1997-01-26 46
-422 3 1997-06-21 46
-4258 3 1997-01-02 46
-4421 2 1997-04-21 46
-4421 3 1997-05-25 46
4453 3 1997-05-29 48
4484 7 1997-03-17 50
-4609 3 1997-02-11 46
484 1 1997-03-06 49
484 3 1997-01-24 50
484 5 1997-03-05 48
485 1 1997-03-28 50
-4868 1 1997-04-29 47
4868 3 1997-04-23 49
4934 1 1997-05-20 48
4967 1 1997-05-27 50
-5090 2 1997-04-05 46
5152 2 1997-03-10 50
5158 4 1997-04-10 49
-5606 3 1997-03-11 46
-5606 7 1997-02-01 46
-5762 4 1997-03-02 47
581 3 1997-02-27 49
5829 5 1997-01-31 49
-5831 4 1997-02-24 46
-5895 2 1997-04-27 47
5895 3 1997-03-15 49
5952 1 1997-06-30 49
-705 1 1997-04-18 46
-836 3 1997-03-21 46
set statement optimizer_switch='rowid_filter=off' for EXPLAIN SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45;
+l_quantity > 47;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE lineitem range i_l_shipdate,i_l_quantity i_l_shipdate 4 NULL 510 Using index condition; Using where
+1 SIMPLE lineitem range i_l_shipdate,i_l_quantity i_l_quantity 9 NULL 349 Using index condition; Using where
set statement optimizer_switch='rowid_filter=off' for EXPLAIN FORMAT=JSON SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45;
+l_quantity > 47;
EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "lineitem",
"access_type": "range",
"possible_keys": ["i_l_shipdate", "i_l_quantity"],
- "key": "i_l_shipdate",
- "key_length": "4",
- "used_key_parts": ["l_shipDATE"],
- "rows": 510,
- "filtered": 10.07493782,
- "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
- "attached_condition": "lineitem.l_quantity > 45"
+ "key": "i_l_quantity",
+ "key_length": "9",
+ "used_key_parts": ["l_quantity"],
+ "loops": 1,
+ "rows": 349,
+ "cost": "COST_REPLACED",
+ "filtered": 8.492922783,
+ "index_condition": "lineitem.l_quantity > 47",
+ "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
}
]
@@ -256,12 +239,12 @@ EXPLAIN
}
set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45;
+l_quantity > 47;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
-1 SIMPLE lineitem range i_l_shipdate,i_l_quantity i_l_shipdate 4 NULL 510 510.00 10.07 11.76 Using index condition; Using where
+1 SIMPLE lineitem range i_l_shipdate,i_l_quantity i_l_quantity 9 NULL 349 349.00 8.49 9.74 Using index condition; Using where
set statement optimizer_switch='rowid_filter=off' for ANALYZE FORMAT=JSON SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45;
+l_quantity > 47;
ANALYZE
{
"query_optimization": {
@@ -269,6 +252,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -277,19 +261,21 @@ ANALYZE
"table_name": "lineitem",
"access_type": "range",
"possible_keys": ["i_l_shipdate", "i_l_quantity"],
- "key": "i_l_shipdate",
- "key_length": "4",
- "used_key_parts": ["l_shipDATE"],
+ "key": "i_l_quantity",
+ "key_length": "9",
+ "used_key_parts": ["l_quantity"],
+ "loops": 1,
"r_loops": 1,
- "rows": 510,
- "r_rows": 510,
+ "rows": 349,
+ "r_rows": 349,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
- "filtered": 10.07493782,
- "r_filtered": 11.76470588,
- "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
- "attached_condition": "lineitem.l_quantity > 45"
+ "filtered": 8.492922783,
+ "r_filtered": 9.742120344,
+ "index_condition": "lineitem.l_quantity > 47",
+ "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
}
]
@@ -297,21 +283,13 @@ ANALYZE
}
set statement optimizer_switch='rowid_filter=off' for SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45;
+l_quantity > 47;
l_orderkey l_linenumber l_shipdate l_quantity
-1121 5 1997-04-27 47
1121 6 1997-04-21 50
1441 7 1997-06-07 50
-1443 1 1997-02-05 47
1473 1 1997-05-05 50
-1568 2 1997-04-06 46
-1632 1 1997-01-25 47
-1632 3 1997-01-29 47
1954 7 1997-06-04 49
-1959 1 1997-05-05 46
2151 3 1997-01-20 49
-2177 5 1997-05-10 46
-2369 2 1997-01-02 47
2469 3 1997-01-11 48
2469 6 1997-03-03 49
2470 2 1997-06-02 50
@@ -324,41 +302,23 @@ l_orderkey l_linenumber l_shipdate l_quantity
3429 1 1997-04-08 48
3490 2 1997-06-27 50
3619 1 1997-01-22 49
-3619 3 1997-01-31 46
-3969 3 1997-05-29 46
4005 4 1997-01-31 49
-4036 1 1997-06-21 46
4066 4 1997-02-17 49
-4098 1 1997-01-26 46
-422 3 1997-06-21 46
-4258 3 1997-01-02 46
-4421 2 1997-04-21 46
-4421 3 1997-05-25 46
4453 3 1997-05-29 48
4484 7 1997-03-17 50
-4609 3 1997-02-11 46
484 1 1997-03-06 49
484 3 1997-01-24 50
484 5 1997-03-05 48
485 1 1997-03-28 50
-4868 1 1997-04-29 47
4868 3 1997-04-23 49
4934 1 1997-05-20 48
4967 1 1997-05-27 50
-5090 2 1997-04-05 46
5152 2 1997-03-10 50
5158 4 1997-04-10 49
-5606 3 1997-03-11 46
-5606 7 1997-02-01 46
-5762 4 1997-03-02 47
581 3 1997-02-27 49
5829 5 1997-01-31 49
-5831 4 1997-02-24 46
-5895 2 1997-04-27 47
5895 3 1997-03-15 49
5952 1 1997-06-30 49
-705 1 1997-04-18 46
-836 3 1997-03-21 46
set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-01-31' AND
@@ -374,6 +334,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -388,7 +349,9 @@ EXPLAIN
"key": "i_l_shipdate",
"key_length": "4",
"used_key_parts": ["l_shipDATE"],
+ "loops": 1,
"rows": 98,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'",
"using_index": true
@@ -403,7 +366,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["o_orderkey"],
"ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 98,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 4.733333111,
"attached_condition": "orders.o_totalprice between 200000 and 230000"
}
@@ -429,6 +394,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -445,9 +411,11 @@ ANALYZE
"key": "i_l_shipdate",
"key_length": "4",
"used_key_parts": ["l_shipDATE"],
+ "loops": 1,
"r_loops": 1,
"rows": 98,
"r_rows": 98,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -466,9 +434,12 @@ ANALYZE
"key_length": "4",
"used_key_parts": ["o_orderkey"],
"ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 98,
"r_loops": 98,
+ "r_table_loops": 96,
"rows": 1,
"r_rows": 1,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -511,6 +482,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -525,7 +497,9 @@ EXPLAIN
"key": "i_l_shipdate",
"key_length": "4",
"used_key_parts": ["l_shipDATE"],
+ "loops": 1,
"rows": 98,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'",
"using_index": true
@@ -540,7 +514,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["o_orderkey"],
"ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 98,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 4.733333111,
"attached_condition": "orders.o_totalprice between 200000 and 230000"
}
@@ -566,6 +542,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -582,9 +559,11 @@ ANALYZE
"key": "i_l_shipdate",
"key_length": "4",
"used_key_parts": ["l_shipDATE"],
+ "loops": 1,
"r_loops": 1,
"rows": 98,
"r_rows": 98,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -603,9 +582,12 @@ ANALYZE
"key_length": "4",
"used_key_parts": ["o_orderkey"],
"ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 98,
"r_loops": 98,
+ "r_table_loops": 96,
"rows": 1,
"r_rows": 1,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -636,20 +618,21 @@ o_orderkey l_linenumber l_shipdate o_totalprice
set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45 AND
+l_quantity > 47 AND
o_totalprice between 180000 and 230000;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE lineitem range|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_shipdate|i_l_quantity 4|9 NULL 510 (10%) Using index condition; Using where; Using rowid filter
+1 SIMPLE lineitem range|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_quantity|i_l_shipdate 9|4 NULL 349 (8%) Using index condition; Using where; Using rowid filter
1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 Using where
set statement optimizer_switch='rowid_filter=on' for EXPLAIN FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45 AND
+l_quantity > 47 AND
o_totalprice between 180000 and 230000;
EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -662,21 +645,23 @@ EXPLAIN
"i_l_orderkey_quantity",
"i_l_quantity"
],
- "key": "i_l_shipdate",
- "key_length": "4",
- "used_key_parts": ["l_shipDATE"],
+ "key": "i_l_quantity",
+ "key_length": "9",
+ "used_key_parts": ["l_quantity"],
"rowid_filter": {
"range": {
- "key": "i_l_quantity",
- "used_key_parts": ["l_quantity"]
+ "key": "i_l_shipdate",
+ "used_key_parts": ["l_shipDATE"]
},
- "rows": 605,
- "selectivity_pct": 10.07493755
+ "rows": 510,
+ "selectivity_pct": 8.492922565
},
- "rows": 510,
- "filtered": 10.07493782,
- "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
- "attached_condition": "lineitem.l_quantity > 45"
+ "loops": 1,
+ "rows": 349,
+ "cost": "COST_REPLACED",
+ "filtered": 8.492922783,
+ "index_condition": "lineitem.l_quantity > 47",
+ "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
},
{
@@ -688,7 +673,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["o_orderkey"],
"ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 29.64029975,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 9.600000381,
"attached_condition": "orders.o_totalprice between 180000 and 230000"
}
@@ -699,15 +686,15 @@ EXPLAIN
set statement optimizer_switch='rowid_filter=on' for ANALYZE SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45 AND
+l_quantity > 47 AND
o_totalprice between 180000 and 230000;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
-1 SIMPLE lineitem range|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_shipdate|i_l_quantity 4|9 NULL 510 (10%) 60.00 (11%) 10.07 100.00 Using index condition; Using where; Using rowid filter
-1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 1.00 9.60 26.67 Using where
+1 SIMPLE lineitem range|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_quantity|i_l_shipdate 9|4 NULL 349 (8%) 34.00 (9%) 8.49 100.00 Using index condition; Using where; Using rowid filter
+1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 1.00 9.60 26.47 Using where
set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45 AND
+l_quantity > 47 AND
o_totalprice between 180000 and 230000;
ANALYZE
{
@@ -716,6 +703,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -730,32 +718,34 @@ ANALYZE
"i_l_orderkey_quantity",
"i_l_quantity"
],
- "key": "i_l_shipdate",
- "key_length": "4",
- "used_key_parts": ["l_shipDATE"],
+ "key": "i_l_quantity",
+ "key_length": "9",
+ "used_key_parts": ["l_quantity"],
"rowid_filter": {
"range": {
- "key": "i_l_quantity",
- "used_key_parts": ["l_quantity"]
+ "key": "i_l_shipdate",
+ "used_key_parts": ["l_shipDATE"]
},
- "rows": 605,
- "selectivity_pct": 10.07493755,
- "r_rows": 605,
- "r_lookups": 510,
- "r_selectivity_pct": 11.76470588,
+ "rows": 510,
+ "selectivity_pct": 8.492922565,
+ "r_rows": 510,
+ "r_lookups": 349,
+ "r_selectivity_pct": 9.742120344,
"r_buffer_size": "REPLACED",
"r_filling_time_ms": "REPLACED"
},
+ "loops": 1,
"r_loops": 1,
- "rows": 510,
- "r_rows": 60,
+ "rows": 349,
+ "r_rows": 34,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
- "filtered": 10.07493782,
+ "filtered": 8.492922783,
"r_filtered": 100,
- "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'",
- "attached_condition": "lineitem.l_quantity > 45"
+ "index_condition": "lineitem.l_quantity > 47",
+ "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
},
{
@@ -767,14 +757,16 @@ ANALYZE
"key_length": "4",
"used_key_parts": ["o_orderkey"],
"ref": ["dbt3_s001.lineitem.l_orderkey"],
- "r_loops": 60,
+ "loops": 29.64029975,
+ "r_loops": 34,
"rows": 1,
"r_rows": 1,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
"filtered": 9.600000381,
- "r_filtered": 26.66666667,
+ "r_filtered": 26.47058824,
"attached_condition": "orders.o_totalprice between 180000 and 230000"
}
}
@@ -784,29 +776,22 @@ ANALYZE
set statement optimizer_switch='rowid_filter=on' for SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45 AND
+l_quantity > 47 AND
o_totalprice between 180000 and 230000;
o_orderkey l_linenumber l_shipdate l_quantity o_totalprice
-1632 1 1997-01-25 47 183286.33
-1632 3 1997-01-29 47 183286.33
-2177 5 1997-05-10 46 183493.42
2469 3 1997-01-11 48 192074.23
2469 6 1997-03-03 49 192074.23
3619 1 1997-01-22 49 222274.54
-3619 3 1997-01-31 46 222274.54
484 1 1997-03-06 49 219920.62
484 3 1997-01-24 50 219920.62
484 5 1997-03-05 48 219920.62
4934 1 1997-05-20 48 180478.16
-5606 3 1997-03-11 46 219959.08
-5606 7 1997-02-01 46 219959.08
5829 5 1997-01-31 49 183734.56
-5895 2 1997-04-27 47 201419.83
5895 3 1997-03-15 49 201419.83
set statement optimizer_switch='rowid_filter=off' for EXPLAIN SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45 AND
+l_quantity > 47 AND
o_totalprice between 180000 and 230000;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE orders range PRIMARY,i_o_totalprice i_o_totalprice 9 NULL 144 Using where; Using index
@@ -814,12 +799,13 @@ id select_type table type possible_keys key key_len ref rows Extra
set statement optimizer_switch='rowid_filter=off' for EXPLAIN FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45 AND
+l_quantity > 47 AND
o_totalprice between 180000 and 230000;
EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -829,7 +815,9 @@ EXPLAIN
"key": "i_o_totalprice",
"key_length": "9",
"used_key_parts": ["o_totalprice"],
+ "loops": 1,
"rows": 144,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "orders.o_totalprice between 180000 and 230000",
"using_index": true
@@ -850,9 +838,11 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 144,
"rows": 4,
- "filtered": 0.855656624,
- "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30' and lineitem.l_quantity > 45"
+ "cost": "COST_REPLACED",
+ "filtered": 0.493593663,
+ "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30' and lineitem.l_quantity > 47"
}
}
]
@@ -861,15 +851,15 @@ EXPLAIN
set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45 AND
+l_quantity > 47 AND
o_totalprice between 180000 and 230000;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE orders range PRIMARY,i_o_totalprice i_o_totalprice 9 NULL 144 144.00 100.00 100.00 Using where; Using index
-1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 6.62 0.86 1.68 Using where
+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 6.62 0.49 0.94 Using where
set statement optimizer_switch='rowid_filter=off' for ANALYZE FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45 AND
+l_quantity > 47 AND
o_totalprice between 180000 and 230000;
ANALYZE
{
@@ -878,6 +868,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -889,9 +880,11 @@ ANALYZE
"key": "i_o_totalprice",
"key_length": "9",
"used_key_parts": ["o_totalprice"],
+ "loops": 1,
"r_loops": 1,
"rows": 144,
"r_rows": 144,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -916,15 +909,17 @@ ANALYZE
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 144,
"r_loops": 144,
"rows": 4,
"r_rows": 6.625,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
- "filtered": 0.855656624,
- "r_filtered": 1.677148847,
- "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30' and lineitem.l_quantity > 45"
+ "filtered": 0.493593663,
+ "r_filtered": 0.943396226,
+ "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30' and lineitem.l_quantity > 47"
}
}
]
@@ -933,25 +928,26 @@ ANALYZE
set statement optimizer_switch='rowid_filter=off' for SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
-l_quantity > 45 AND
+l_quantity > 47 AND
o_totalprice between 180000 and 230000;
o_orderkey l_linenumber l_shipdate l_quantity o_totalprice
-1632 1 1997-01-25 47 183286.33
-1632 3 1997-01-29 47 183286.33
-2177 5 1997-05-10 46 183493.42
2469 3 1997-01-11 48 192074.23
2469 6 1997-03-03 49 192074.23
3619 1 1997-01-22 49 222274.54
-3619 3 1997-01-31 46 222274.54
484 1 1997-03-06 49 219920.62
484 3 1997-01-24 50 219920.62
484 5 1997-03-05 48 219920.62
4934 1 1997-05-20 48 180478.16
-5606 3 1997-03-11 46 219959.08
-5606 7 1997-02-01 46 219959.08
5829 5 1997-01-31 49 183734.56
-5895 2 1997-04-27 47 201419.83
5895 3 1997-03-15 49 201419.83
+set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT STRAIGHT_JOIN o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice
+FROM lineitem JOIN orders ON o_orderkey=l_orderkey
+WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
+l_quantity > 47 AND
+o_totalprice between 180000 and 230000;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE lineitem range|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_quantity|i_l_shipdate 9|4 NULL 349 (8%) Using index condition; Using where; Using rowid filter
+1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 Using where
set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice
FROM orders JOIN lineitem ON o_orderkey=l_orderkey
WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND
@@ -967,6 +963,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -976,7 +973,9 @@ EXPLAIN
"key": "i_o_totalprice",
"key_length": "9",
"used_key_parts": ["o_totalprice"],
+ "loops": 1,
"rows": 71,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "orders.o_totalprice between 200000 and 230000",
"using_index": true
@@ -996,7 +995,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 71,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 8.492922783,
"attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
@@ -1022,6 +1023,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -1033,9 +1035,11 @@ ANALYZE
"key": "i_o_totalprice",
"key_length": "9",
"used_key_parts": ["o_totalprice"],
+ "loops": 1,
"r_loops": 1,
"rows": 71,
"r_rows": 71,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1059,9 +1063,11 @@ ANALYZE
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 71,
"r_loops": 71,
"rows": 4,
"r_rows": 6.704225352,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1130,6 +1136,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -1139,7 +1146,9 @@ EXPLAIN
"key": "i_o_totalprice",
"key_length": "9",
"used_key_parts": ["o_totalprice"],
+ "loops": 1,
"rows": 71,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "orders.o_totalprice between 200000 and 230000",
"using_index": true
@@ -1159,7 +1168,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 71,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 8.492922783,
"attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'"
}
@@ -1185,6 +1196,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -1196,9 +1208,11 @@ ANALYZE
"key": "i_o_totalprice",
"key_length": "9",
"used_key_parts": ["o_totalprice"],
+ "loops": 1,
"r_loops": 1,
"rows": 71,
"r_rows": 71,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1222,9 +1236,11 @@ ANALYZE
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 71,
"r_loops": 71,
"rows": 4,
"r_rows": 6.704225352,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1304,6 +1320,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -1319,7 +1336,9 @@ EXPLAIN
"key": "i_l_receiptdate",
"key_length": "4",
"used_key_parts": ["l_receiptDATE"],
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 0.566194832,
"index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'",
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'"
@@ -1334,7 +1353,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["o_orderkey"],
"ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 5.666666508,
"attached_condition": "orders.o_totalprice between 200000 and 250000"
}
@@ -1364,6 +1385,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -1381,9 +1403,11 @@ ANALYZE
"key": "i_l_receiptdate",
"key_length": "4",
"used_key_parts": ["l_receiptDATE"],
+ "loops": 1,
"r_loops": 1,
"rows": 18,
"r_rows": 18,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1402,9 +1426,11 @@ ANALYZE
"key_length": "4",
"used_key_parts": ["o_orderkey"],
"ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 1,
"r_loops": 7,
"rows": 1,
"r_rows": 1,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1443,6 +1469,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -1458,7 +1485,9 @@ EXPLAIN
"key": "i_l_receiptdate",
"key_length": "4",
"used_key_parts": ["l_receiptDATE"],
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 0.566194832,
"index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'",
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'"
@@ -1473,7 +1502,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["o_orderkey"],
"ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 1,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 5.666666508,
"attached_condition": "orders.o_totalprice between 200000 and 250000"
}
@@ -1503,6 +1534,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -1520,9 +1552,11 @@ ANALYZE
"key": "i_l_receiptdate",
"key_length": "4",
"used_key_parts": ["l_receiptDATE"],
+ "loops": 1,
"r_loops": 1,
"rows": 18,
"r_rows": 18,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1541,9 +1575,11 @@ ANALYZE
"key_length": "4",
"used_key_parts": ["o_orderkey"],
"ref": ["dbt3_s001.lineitem.l_orderkey"],
+ "loops": 1,
"r_loops": 7,
"rows": 1,
"r_rows": 1,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1589,6 +1625,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -1598,7 +1635,9 @@ EXPLAIN
"key": "i_o_totaldiscount",
"key_length": "9",
"used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
"rows": 41,
+ "cost": "COST_REPLACED",
"filtered": 3.333333254,
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000"
@@ -1618,7 +1657,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 1.366666667,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 3.047460556,
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
@@ -1648,6 +1689,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -1659,9 +1701,11 @@ ANALYZE
"key": "i_o_totaldiscount",
"key_length": "9",
"used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
"r_loops": 1,
"rows": 41,
"r_rows": 41,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1685,9 +1729,11 @@ ANALYZE
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 1.366666667,
"r_loops": 1,
"rows": 4,
"r_rows": 6,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1729,6 +1775,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -1738,7 +1785,9 @@ EXPLAIN
"key": "i_o_totaldiscount",
"key_length": "9",
"used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
"rows": 41,
+ "cost": "COST_REPLACED",
"filtered": 3.333333254,
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000"
@@ -1758,7 +1807,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 1.366666667,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 3.047460556,
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
@@ -1788,6 +1839,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -1799,9 +1851,11 @@ ANALYZE
"key": "i_o_totaldiscount",
"key_length": "9",
"used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
"r_loops": 1,
"rows": 41,
"r_rows": 41,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1825,9 +1879,11 @@ ANALYZE
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 1.366666667,
"r_loops": 1,
"rows": 4,
"r_rows": 6,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -1872,6 +1928,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
@@ -1886,7 +1943,9 @@ EXPLAIN
"key": "i_o_totaldiscount",
"key_length": "9",
"used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
"rows": 41,
+ "cost": "REPLACED",
"filtered": "REPLACED",
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000 and orders.o_orderDATE between '1992-12-01' and '1997-01-01'"
@@ -1906,7 +1965,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 1,
"rows": 4,
+ "cost": "REPLACED",
"filtered": "REPLACED",
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
@@ -1936,6 +1997,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -1952,9 +2014,11 @@ ANALYZE
"key": "i_o_totaldiscount",
"key_length": "9",
"used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
"r_loops": 1,
"rows": 41,
"r_rows": 41,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": {
@@ -1980,9 +2044,11 @@ ANALYZE
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 1,
"r_loops": 1,
"rows": 4,
"r_rows": 6,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": {
@@ -2026,6 +2092,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
@@ -2040,7 +2107,9 @@ EXPLAIN
"key": "i_o_totaldiscount",
"key_length": "9",
"used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
"rows": 41,
+ "cost": "REPLACED",
"filtered": "REPLACED",
"index_condition": "orders.o_totaldiscount between 18000 and 20000",
"attached_condition": "orders.o_totalprice between 200000 and 220000 and orders.o_orderDATE between '1992-12-01' and '1997-01-01'"
@@ -2060,7 +2129,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 1,
"rows": 4,
+ "cost": "REPLACED",
"filtered": "REPLACED",
"attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'"
}
@@ -2090,6 +2161,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -2106,9 +2178,11 @@ ANALYZE
"key": "i_o_totaldiscount",
"key_length": "9",
"used_key_parts": ["o_totaldiscount"],
+ "loops": 1,
"r_loops": 1,
"rows": 41,
"r_rows": 41,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": {
@@ -2134,9 +2208,11 @@ ANALYZE
"key_length": "4",
"used_key_parts": ["l_orderkey"],
"ref": ["dbt3_s001.orders.o_orderkey"],
+ "loops": 1,
"r_loops": 1,
"rows": 4,
"r_rows": 6,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": {
@@ -2167,708 +2243,6 @@ ALTER TABLE orders DROP COLUMN o_totaldiscount;
DROP VIEW v1;
DROP DATABASE dbt3_s001;
use test;
-#
-# MDEV-18816: potential range filter for one join table with
-# impossible WHERE for another
-#
-create table t1 (
-pk int not null primary key, c2 varchar(10) , i1 int,key (c2)
-) engine=myisam;
-insert into t1 values (1,'a',-5),(2,'a',null);
-create table t2 (
-pk int, i1 int, c1 varchar(30) , key c1 (c1(30)), key i1 (i1)
-) engine=myisam;
-insert into t2 values
-(1,-5,'a'),(2,null,'a'),(3,null,'a'),(4,null,'a'),(5,5,'a'),(6,null,'a'),
-(7,4,'a'),(8,55,'a'),(9,null,'a'),(10,null,'a'),(11,null,'a'),(12,-5,'a'),
-(13,-5,'a'),(14,null,'a'),(15,null,'a'),(16,-5,'a'),(17,-5,'a');
-select 1
-from t1
-left join
-t2 join t1 as t1_a on t2.i1 = t1_a.pk
-on t1.c2 = t2.c1
-where t1_a.pk is null and t1_a.i1 != 3;
-1
-explain extended select 1
-from t1
-left join
-t2 join t1 as t1_a on t2.i1 = t1_a.pk
-on t1.c2 = t2.c1
-where t1_a.pk is null and t1_a.i1 != 3;
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
-Warnings:
-Note 1003 select 1 AS `1` from `test`.`t1` join `test`.`t2` join `test`.`t1` `t1_a` where 0
-drop table t1,t2;
-#
-# MDEV-18640: TABLE::prune_range_rowid_filters: Conditional jump or
-# move depends on uninitialized value
-#
-CREATE TABLE t1 (
-pk INT, i INT, PRIMARY KEY (pk), KEY (pk,i)
-) ENGINE=MyISAM;
-INSERT INTO t1 VALUES (1,10), (7,70), (2,20);
-SELECT * FROM t1 WHERE pk < 5;
-pk i
-1 10
-2 20
-DROP TABLE t1;
-#
-# MDEV-18956: Possible rowid filter for subquery for which
-# in_to_exists strategy has been chosen
-#
-CREATE TABLE t1 (pk int) engine=myisam ;
-INSERT INTO t1 VALUES (1),(2);
-CREATE TABLE t2 (
-pk int auto_increment PRIMARY KEY,
-i1 int, i2 int, c2 varchar(1),
-KEY (i1), KEY (i2)
-) engine=myisam;
-INSERT INTO t2 VALUES
-(1,8,6,'t'),(2,5,7,'i'),(3,4,4,'h'),(4,207,38,'d'),(5,183,206,'b'),
-(6,7,null,'o'),(7,1,2,'j'),(8,17,36,'s'),(9,4,5,'q'),(10,0,6,'l'),
-(11,1,9,'j'),(12,5,6,'y'),(13,null,0,'i'),(14,7,7,'x'),(15,5,2,'u');
-SELECT * FROM t1 HAVING (7, 9) IN (SELECT t2.i1, t2.i2 FROM t2 WHERE t2.i1 = 3);
-pk
-EXPLAIN EXTENDED
-SELECT * FROM t1 HAVING (7, 9) IN (SELECT t2.i1, t2.i2 FROM t2 WHERE t2.i1 = 3);
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING
-2 SUBQUERY t2 ref i1,i2 i1 5 const 1 100.00 Using index condition; Using where
-Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk` from `test`.`t1` having 0
-DROP TABLE t1,t2;
-#
-# MDEV-19255: rowid range filter built for range condition
-# that uses in expensive subquery
-#
-CREATE TABLE t1 (
-pk1 INT PRIMARY KEY, a1 INT, b1 VARCHAR(1), KEY(a1), KEY(b1)
-) ENGINE=MyISAM;
-INSERT INTO t1 VALUES
-(10,0,'z'),(11,3,'j'),(12,8,'f'),(13,8,'p'),(14,6,'w'),(15,0,'c'),(16,1,'j'),
-(17,1,'f'),(18,5,'v'),(19,3,'f'),(20,2,'q'),(21,8,'y'),(22,0,'a'),(23,9,'w'),
-(24,3,'e'),(25,1,'b'),(26,9,'r'),(27,2,'k'),(28,5,'c'),(29,3,'k'),(30,9,'b'),
-(31,8,'j'),(32,1,'t'),(33,8,'n'),(34,3,'z'),(35,0,'u'),(36,3,'a'),(37,3,'g'),
-(38,1,'f'),(39,6,'p'),(40,6,'m'),(41,6,'t'),(42,7,'i'),(43,4,'h'),(44,3,'d'),
-(45,2,'b'),(46,1,'o'),(47,2,'j'),(48,6,'s'),(49,5,'q'),(50,6,'l'),(51,9,'j'),
-(52,6,'y'),(53,0,'i'),(54,7,'x'),(55,2,'u'),(56,6,'t'),(57,4,'b'),(58,5,'m'),
-(59,4,'x'),(60,8,'x'),(61,6,'v'),(62,8,'m'),(63,4,'j'),(64,8,'z'),(65,2,'a'),
-(66,9,'i'),(67,4,'g'),(68,8,'h'),(69,1,'p'),(70,8,'a'),(71,0,'x'),(72,2,'s'),
-(73,6,'k'),(74,0,'m'),(75,6,'e'),(76,9,'y'),(77,7,'d'),(78,7,'w'),(79,6,'y'),
-(80,9,'s'),(81,9,'x'),(82,6,'l'),(83,9,'f'),(84,8,'x'),(85,1,'p'),(86,7,'y'),
-(87,6,'p'),(88,1,'g'),(89,3,'c'),(90,5,'h'),(91,3,'p'),(92,2,'b'),(93,1,NULL),
-(94,3,NULL),(95,2,'y'),(96,7,'s'),(97,7,'x'),(98,6,'i'),(99,9,'t'),(100,5,'j'),
-(101,0,'u'),(102,7,'r'),(103,2,'x'),(104,8,'e'),(105,8,'i'),(106,5,'q'),
-(107,8,'z'),(108,3,'k'),(109,65,NULL);
-CREATE TABLE t2 (pk2 INT PRIMARY KEY, a2 INT, b2 VARCHAR(1)) ENGINE=MyISAM;
-INSERT INTO t2 VALUES (1,1,'i');
-INSERT INTO t2 SELECT * FROM t1;
-INSERT INTO t1 SELECT pk1+200, a1, b1 FROM t1;
-INSERT INTO t1 SELECT pk1+400, a1, b1 FROM t1;
-ANALYZE TABLE t1,t2 PERSISTENT FOR ALL;
-Table Op Msg_type Msg_text
-test.t1 analyze status Engine-independent statistics collected
-test.t1 analyze status OK
-test.t2 analyze status Engine-independent statistics collected
-test.t2 analyze status OK
-SELECT * FROM t1 INNER JOIN t2 ON ( pk1+1 = pk2+2 AND a1 = a2 )
-WHERE b1 <= ( SELECT MAX(b2) FROM t2 WHERE pk2 <= 1 );
-pk1 a1 b1 pk2 a2 b2
-17 1 f 16 1 j
-37 3 g 36 3 a
-105 8 i 104 8 e
-EXPLAIN EXTENDED SELECT * FROM t1 INNER JOIN t2 ON ( pk1+1 = pk2+2 AND a1 = a2 )
-WHERE b1 <= ( SELECT MAX(b2) FROM t2 WHERE pk2 <= 1 );
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2 ALL NULL NULL NULL NULL 101 100.00 Using where
-1 PRIMARY t1 ref a1,b1 a1 5 test.t2.a2 36 28.75 Using where
-2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 100.00 Using index condition
-Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,`test`.`t2`.`pk2` AS `pk2`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b2` AS `b2` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a1` = `test`.`t2`.`a2` and `test`.`t1`.`b1` <= (/* select#2 */ select max(`test`.`t2`.`b2`) from `test`.`t2` where `test`.`t2`.`pk2` <= 1) and `test`.`t1`.`pk1` + 1 = `test`.`t2`.`pk2` + 2
-EXPLAIN FORMAT=JSON SELECT * FROM t1 INNER JOIN t2 ON ( pk1+1 = pk2+2 AND a1 = a2 )
-WHERE b1 <= ( SELECT MAX(b2) FROM t2 WHERE pk2 <= 1 );
-EXPLAIN
-{
- "query_block": {
- "select_id": 1,
- "nested_loop": [
- {
- "table": {
- "table_name": "t2",
- "access_type": "ALL",
- "rows": 101,
- "filtered": 100,
- "attached_condition": "t2.a2 is not null"
- }
- },
- {
- "table": {
- "table_name": "t1",
- "access_type": "ref",
- "possible_keys": ["a1", "b1"],
- "key": "a1",
- "key_length": "5",
- "used_key_parts": ["a1"],
- "ref": ["test.t2.a2"],
- "rows": 36,
- "filtered": 28.75,
- "attached_condition": "t1.b1 <= (subquery#2) and t1.pk1 + 1 = t2.pk2 + 2"
- }
- }
- ],
- "subqueries": [
- {
- "query_block": {
- "select_id": 2,
- "nested_loop": [
- {
- "table": {
- "table_name": "t2",
- "access_type": "range",
- "possible_keys": ["PRIMARY"],
- "key": "PRIMARY",
- "key_length": "4",
- "used_key_parts": ["pk2"],
- "rows": 1,
- "filtered": 100,
- "index_condition": "t2.pk2 <= 1"
- }
- }
- ]
- }
- }
- ]
- }
-}
-DROP TABLE t1,t2;
-#
-# MDEV-21794: Optimizer flag rowid_filter leads to long query
-#
-create table t10(a int);
-insert into t10 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
-create table t11(a int);
-insert into t11 select A.a + B.a* 10 + C.a * 100 from t10 A, t10 B, t10 C;
-CREATE TABLE t1 (
-el_id int(10) unsigned NOT NULL ,
-el_index blob NOT NULL,
-el_index_60 varbinary(60) NOT NULL,
-filler blob,
-PRIMARY KEY (el_id),
-KEY el_index (el_index(60)),
-KEY el_index_60 (el_index_60,el_id)
-);
-insert into t1
-select
-A.a+1000*B.a,
-A.a+1000*B.a + 10000,
-A.a+1000*B.a + 10000,
-'filler-data-filler-data'
-from
-t11 A, t10 B;
-analyze table t1 persistent for all;
-Table Op Msg_type Msg_text
-test.t1 analyze status Engine-independent statistics collected
-test.t1 analyze Warning Engine-independent statistics are not collected for column 'el_index'
-test.t1 analyze Warning Engine-independent statistics are not collected for column 'filler'
-test.t1 analyze status OK
-# This must not use rowid_filter with key=el_index|el_index_60:
-explain
-select * from t1
-where el_index like '10%' and (el_index_60 like '10%' or el_index_60 like '20%');
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range el_index,el_index_60 el_index 62 NULL 1000 Using where
-drop table t10, t11, t1;
-#
-# MDEV-22160: SIGSEGV in st_join_table::save_explain_data on SELECT
-#
-set @save_optimizer_switch= @@optimizer_switch;
-SET @@optimizer_switch="index_merge_sort_union=OFF";
-CREATE TABLE t1 (a INT, b INT, INDEX(a), INDEX(b));
-INSERT INTO t1 VALUES (0,0),(1,0),(-1,1), (-2,1), (-2,3), (-3,4), (-2,4);
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-INSERT INTO t1 SELECT * FROM t1;
-ANALYZE table t1 PERSISTENT FOR ALL;
-Table Op Msg_type Msg_text
-test.t1 analyze status Engine-independent statistics collected
-test.t1 analyze status OK
-explain
-SELECT * FROM t1 WHERE a > 0 AND b=0;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range|filter a,b a|b 5|5 NULL 64 (29%) Using index condition; Using where; Using rowid filter
-SELECT * FROM t1 WHERE a > 0 AND b=0;
-a b
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-1 0
-drop table t1;
-SET @@optimizer_switch=@save_optimizer_switch;
-#
-# MDEV-28846: Poor performance when rowid filter contains no elements
-#
-create table t1 (
-pk int primary key auto_increment,
-nm varchar(32),
-fl1 tinyint default 0,
-fl2 tinyint default 0,
-index idx1(nm, fl1),
-index idx2(fl2)
-) engine=myisam;
-create table name (
-pk int primary key auto_increment,
-nm bigint
-) engine=myisam;
-create table flag2 (
-pk int primary key auto_increment,
-fl2 tinyint
-) engine=myisam;
-insert into name(nm) select seq from seq_1_to_1000 order by rand(17);
-insert into flag2(fl2) select seq mod 2 from seq_1_to_1000 order by rand(19);
-insert into t1(nm,fl2)
-select nm, fl2 from name, flag2 where name.pk = flag2.pk;
-analyze table t1 persistent for all;
-Table Op Msg_type Msg_text
-test.t1 analyze status Engine-independent statistics collected
-test.t1 analyze status Table is already up to date
-select '500%' as a;
-a
-500%
-set optimizer_switch='rowid_filter=on';
-explain
-select * from t1 where nm like '500%' AND fl2 = 0;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range idx1,idx2 idx1 35 NULL 1 Using index condition; Using where
-analyze format=json
-select * from t1 where nm like '500%' AND fl2 = 0;
-ANALYZE
-{
- "query_optimization": {
- "r_total_time_ms": "REPLACED"
- },
- "query_block": {
- "select_id": 1,
- "r_loops": 1,
- "r_total_time_ms": "REPLACED",
- "nested_loop": [
- {
- "table": {
- "table_name": "t1",
- "access_type": "range",
- "possible_keys": ["idx1", "idx2"],
- "key": "idx1",
- "key_length": "35",
- "used_key_parts": ["nm"],
- "r_loops": 1,
- "rows": 1,
- "r_rows": 1,
- "r_table_time_ms": "REPLACED",
- "r_other_time_ms": "REPLACED",
- "r_engine_stats": REPLACED,
- "filtered": 49.20000076,
- "r_filtered": 100,
- "index_condition": "t1.nm like '500%'",
- "attached_condition": "t1.fl2 = 0"
- }
- }
- ]
- }
-}
-select * from t1 where nm like '500%' AND fl2 = 0;
-pk nm fl1 fl2
-517 500 0 0
-truncate table name;
-truncate table flag2;
-truncate table t1;
-insert into name(nm) select seq from seq_1_to_1000 order by rand(17);
-insert into flag2(fl2) select seq mod 2 from seq_1_to_1000 order by rand(19);
-insert into t1(nm,fl2)
-select nm, fl2 from name, flag2 where name.pk = flag2.pk;
-analyze table t1 persistent for all;
-Table Op Msg_type Msg_text
-test.t1 analyze status Engine-independent statistics collected
-test.t1 analyze status Table is already up to date
-set optimizer_switch='rowid_filter=off';
-explain
-select * from t1 where nm like '500%' AND fl2 = 0;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range idx1,idx2 idx1 35 NULL 1 Using index condition; Using where
-analyze format=json
-select * from t1 where nm like '500%' AND fl2 = 0;
-ANALYZE
-{
- "query_optimization": {
- "r_total_time_ms": "REPLACED"
- },
- "query_block": {
- "select_id": 1,
- "r_loops": 1,
- "r_total_time_ms": "REPLACED",
- "nested_loop": [
- {
- "table": {
- "table_name": "t1",
- "access_type": "range",
- "possible_keys": ["idx1", "idx2"],
- "key": "idx1",
- "key_length": "35",
- "used_key_parts": ["nm"],
- "r_loops": 1,
- "rows": 1,
- "r_rows": 1,
- "r_table_time_ms": "REPLACED",
- "r_other_time_ms": "REPLACED",
- "r_engine_stats": REPLACED,
- "filtered": 49.20000076,
- "r_filtered": 100,
- "index_condition": "t1.nm like '500%'",
- "attached_condition": "t1.fl2 = 0"
- }
- }
- ]
- }
-}
-select * from t1 where nm like '500%' AND fl2 = 0;
-pk nm fl1 fl2
-517 500 0 0
-truncate table name;
-truncate table flag2;
-truncate table t1;
-insert into name(nm) select seq from seq_1_to_1000 order by rand(17);
-insert into flag2(fl2) select seq mod 10 from seq_1_to_1000 order by rand(19);
-insert into t1(nm,fl2)
-select nm, fl2 from name, flag2 where name.pk = flag2.pk;
-analyze table t1 persistent for all;
-Table Op Msg_type Msg_text
-test.t1 analyze status Engine-independent statistics collected
-test.t1 analyze status Table is already up to date
-select '607%' as a;
-a
-607%
-set optimizer_switch='rowid_filter=on';
-explain
-select * from t1 where nm like '607%' AND fl2 = 0;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range idx1,idx2 idx1 35 NULL 1 Using index condition; Using where
-select * from t1 where nm like '607%' AND fl2 = 0;
-pk nm fl1 fl2
-721 607 0 0
-truncate table name;
-truncate table flag2;
-truncate table t1;
-insert into name(nm) select seq from seq_1_to_10000 order by rand(17);
-insert into flag2(fl2) select seq mod 100 from seq_1_to_10000 order by rand(19);
-insert into t1(nm,fl2)
-select nm, fl2 from name, flag2 where name.pk = flag2.pk;
-analyze table t1 persistent for all;
-Table Op Msg_type Msg_text
-test.t1 analyze status Engine-independent statistics collected
-test.t1 analyze status Table is already up to date
-select '75%' as a;
-a
-75%
-set optimizer_switch='rowid_filter=on';
-explain
-select * from t1 where nm like '75%' AND fl2 = 0;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref|filter idx1,idx2 idx2|idx1 2|35 const 55 (1%) Using where; Using rowid filter
-analyze format=json
-select * from t1 where nm like '75%' AND fl2 = 0;
-ANALYZE
-{
- "query_optimization": {
- "r_total_time_ms": "REPLACED"
- },
- "query_block": {
- "select_id": 1,
- "r_loops": 1,
- "r_total_time_ms": "REPLACED",
- "nested_loop": [
- {
- "table": {
- "table_name": "t1",
- "access_type": "ref",
- "possible_keys": ["idx1", "idx2"],
- "key": "idx2",
- "key_length": "2",
- "used_key_parts": ["fl2"],
- "ref": ["const"],
- "rowid_filter": {
- "range": {
- "key": "idx1",
- "used_key_parts": ["nm"]
- },
- "rows": 115,
- "selectivity_pct": 1.15,
- "r_rows": 111,
- "r_lookups": 100,
- "r_selectivity_pct": 2,
- "r_buffer_size": "REPLACED",
- "r_filling_time_ms": "REPLACED"
- },
- "r_loops": 1,
- "rows": 55,
- "r_rows": 2,
- "r_table_time_ms": "REPLACED",
- "r_other_time_ms": "REPLACED",
- "r_engine_stats": REPLACED,
- "filtered": 1.149999976,
- "r_filtered": 100,
- "attached_condition": "t1.nm like '75%'"
- }
- }
- ]
- }
-}
-select * from t1 where nm like '75%' AND fl2 = 0;
-pk nm fl1 fl2
-4543 7503 0 0
-7373 7518 0 0
-drop table name, flag2;
-drop table t1;
-create table t1 (
-pk int primary key auto_increment,
-nm char(255),
-fl1 tinyint default 0,
-fl2 int default 0,
-index idx1(nm, fl1),
-index idx2(fl2)
-) engine=myisam;
-create table name (
-pk int primary key auto_increment,
-nm bigint
-) engine=myisam;
-create table flag2 (
-pk int primary key auto_increment,
-fl2 int
-) engine=myisam;
-insert into name(nm) select seq from seq_1_to_10000 order by rand(17);
-insert into flag2(fl2) select seq mod 10 from seq_1_to_10000 order by rand(19);
-insert into t1(nm,fl2)
-select nm, fl2 from name, flag2 where name.pk = flag2.pk;
-analyze table t1 persistent for all;
-Table Op Msg_type Msg_text
-test.t1 analyze status Engine-independent statistics collected
-test.t1 analyze status Table is already up to date
-select * from t1
-where
-(
-nm like '3400%' or nm like '3402%' or nm like '3403%' or
-nm like '3404%' or nm like '3405%' or nm like '3406%' or nm like '3407%' or
-nm like '3409%' or
-nm like '3411%' or nm like '3412%' or nm like '3413%' or
-nm like '3414%' or nm like '3415%' or nm like '3416%' or nm like '3417%' or
-nm like '3418%' or nm like '3419%' or
-nm like '3421%' or nm like '3422%' or nm like '3423%' or
-nm like '3424%' or nm like '3425%' or nm like '3426%' or nm like '3427%' or
-nm like '3428%' or nm like '3429%' or
-nm like '3430%' or nm like '3431%' or nm like '3432%' or nm like '3433%' or
-nm like '3434%' or nm like '3435%' or nm like '3436%' or nm like '3437%' or
-nm like '3439%' or
-nm like '3440%' or nm like '3441%' or nm like '3442%' or nm like '3443%' or
-nm like '3444%' or nm like '3445%' or nm like '3446%' or nm like '3447%' or
-nm like '3448%'
-) and fl2 = 0;
-pk nm fl1 fl2
-analyze format=json select * from t1
-where
-(
-nm like '3400%' or nm like '3402%' or nm like '3403%' or
-nm like '3404%' or nm like '3405%' or nm like '3406%' or nm like '3407%' or
-nm like '3409%' or
-nm like '3411%' or nm like '3412%' or nm like '3413%' or
-nm like '3414%' or nm like '3415%' or nm like '3416%' or nm like '3417%' or
-nm like '3418%' or nm like '3419%' or
-nm like '3421%' or nm like '3422%' or nm like '3423%' or
-nm like '3424%' or nm like '3425%' or nm like '3426%' or nm like '3427%' or
-nm like '3428%' or nm like '3429%' or
-nm like '3430%' or nm like '3431%' or nm like '3432%' or nm like '3433%' or
-nm like '3434%' or nm like '3435%' or nm like '3436%' or nm like '3437%' or
-nm like '3439%' or
-nm like '3440%' or nm like '3441%' or nm like '3442%' or nm like '3443%' or
-nm like '3444%' or nm like '3445%' or nm like '3446%' or nm like '3447%' or
-nm like '3448%'
-) and fl2 = 0;
-ANALYZE
-{
- "query_optimization": {
- "r_total_time_ms": "REPLACED"
- },
- "query_block": {
- "select_id": 1,
- "r_loops": 1,
- "r_total_time_ms": "REPLACED",
- "nested_loop": [
- {
- "table": {
- "table_name": "t1",
- "access_type": "ref",
- "possible_keys": ["idx1", "idx2"],
- "key": "idx2",
- "key_length": "5",
- "used_key_parts": ["fl2"],
- "ref": ["const"],
- "rowid_filter": {
- "range": {
- "key": "idx1",
- "used_key_parts": ["nm"]
- },
- "rows": 44,
- "selectivity_pct": 0.44,
- "r_rows": 44,
- "r_lookups": 1000,
- "r_selectivity_pct": 0,
- "r_buffer_size": "REPLACED",
- "r_filling_time_ms": "REPLACED"
- },
- "r_loops": 1,
- "rows": 863,
- "r_rows": 0,
- "r_table_time_ms": "REPLACED",
- "r_other_time_ms": "REPLACED",
- "r_engine_stats": REPLACED,
- "filtered": 0.439999998,
- "r_filtered": 100,
- "attached_condition": "t1.nm like '3400%' or t1.nm like '3402%' or t1.nm like '3403%' or t1.nm like '3404%' or t1.nm like '3405%' or t1.nm like '3406%' or t1.nm like '3407%' or t1.nm like '3409%' or t1.nm like '3411%' or t1.nm like '3412%' or t1.nm like '3413%' or t1.nm like '3414%' or t1.nm like '3415%' or t1.nm like '3416%' or t1.nm like '3417%' or t1.nm like '3418%' or t1.nm like '3419%' or t1.nm like '3421%' or t1.nm like '3422%' or t1.nm like '3423%' or t1.nm like '3424%' or t1.nm like '3425%' or t1.nm like '3426%' or t1.nm like '3427%' or t1.nm like '3428%' or t1.nm like '3429%' or t1.nm like '3430%' or t1.nm like '3431%' or t1.nm like '3432%' or t1.nm like '3433%' or t1.nm like '3434%' or t1.nm like '3435%' or t1.nm like '3436%' or t1.nm like '3437%' or t1.nm like '3439%' or t1.nm like '3440%' or t1.nm like '3441%' or t1.nm like '3442%' or t1.nm like '3443%' or t1.nm like '3444%' or t1.nm like '3445%' or t1.nm like '3446%' or t1.nm like '3447%' or t1.nm like '3448%'"
- }
- }
- ]
- }
-}
-create table t0 select * from t1 where nm like '34%';
-delete from t1 using t1,t0 where t1.nm=t0.nm;
-analyze format=json select * from t1
-where
-(
-nm like '3400%' or nm like '3402%' or nm like '3403%' or
-nm like '3404%' or nm like '3405%' or nm like '3406%' or nm like '3407%' or
-nm like '3409%' or
-nm like '3411%' or nm like '3412%' or nm like '3413%' or
-nm like '3414%' or nm like '3415%' or nm like '3416%' or nm like '3417%' or
-nm like '3418%' or nm like '3419%' or
-nm like '3421%' or nm like '3422%' or nm like '3423%' or
-nm like '3424%' or nm like '3425%' or nm like '3426%' or nm like '3427%' or
-nm like '3428%' or nm like '3429%' or
-nm like '3430%' or nm like '3431%' or nm like '3432%' or nm like '3433%' or
-nm like '3434%' or nm like '3435%' or nm like '3436%' or nm like '3437%' or
-nm like '3439%' or
-nm like '3440%' or nm like '3441%' or nm like '3442%' or nm like '3443%' or
-nm like '3444%' or nm like '3445%' or nm like '3446%' or nm like '3447%' or
-nm like '3448%'
-) and fl2 = 0;
-ANALYZE
-{
- "query_optimization": {
- "r_total_time_ms": "REPLACED"
- },
- "query_block": {
- "select_id": 1,
- "r_loops": 1,
- "r_total_time_ms": "REPLACED",
- "nested_loop": [
- {
- "table": {
- "table_name": "t1",
- "access_type": "ref",
- "possible_keys": ["idx1", "idx2"],
- "key": "idx2",
- "key_length": "5",
- "used_key_parts": ["fl2"],
- "ref": ["const"],
- "rowid_filter": {
- "range": {
- "key": "idx1",
- "used_key_parts": ["nm"]
- },
- "rows": 44,
- "selectivity_pct": 0.44,
- "r_rows": 0,
- "r_lookups": 0,
- "r_selectivity_pct": 0,
- "r_buffer_size": "REPLACED",
- "r_filling_time_ms": "REPLACED"
- },
- "r_loops": 1,
- "rows": 853,
- "r_rows": 0,
- "r_engine_stats": REPLACED,
- "filtered": 0.439999998,
- "r_filtered": 100,
- "attached_condition": "t1.nm like '3400%' or t1.nm like '3402%' or t1.nm like '3403%' or t1.nm like '3404%' or t1.nm like '3405%' or t1.nm like '3406%' or t1.nm like '3407%' or t1.nm like '3409%' or t1.nm like '3411%' or t1.nm like '3412%' or t1.nm like '3413%' or t1.nm like '3414%' or t1.nm like '3415%' or t1.nm like '3416%' or t1.nm like '3417%' or t1.nm like '3418%' or t1.nm like '3419%' or t1.nm like '3421%' or t1.nm like '3422%' or t1.nm like '3423%' or t1.nm like '3424%' or t1.nm like '3425%' or t1.nm like '3426%' or t1.nm like '3427%' or t1.nm like '3428%' or t1.nm like '3429%' or t1.nm like '3430%' or t1.nm like '3431%' or t1.nm like '3432%' or t1.nm like '3433%' or t1.nm like '3434%' or t1.nm like '3435%' or t1.nm like '3436%' or t1.nm like '3437%' or t1.nm like '3439%' or t1.nm like '3440%' or t1.nm like '3441%' or t1.nm like '3442%' or t1.nm like '3443%' or t1.nm like '3444%' or t1.nm like '3445%' or t1.nm like '3446%' or t1.nm like '3447%' or t1.nm like '3448%'"
- }
- }
- ]
- }
-}
-drop table t0;
-set optimizer_switch='rowid_filter=default';
-drop table name, flag2;
-drop table t1;
-set @@use_stat_tables=@save_use_stat_tables;
SET GLOBAL innodb_stats_persistent=@save_stats_persistent;
#
# MDEV-18755: possible RORI-plan and possible plan with range filter
@@ -2893,6 +2267,7 @@ insert into t1 values
(81,'a','a',20),(82,'a','a',0),(83,'a','a',0),(84,'a','a',null),
(85,'a','a',-1),(86,'a','a',5),(87,'a','a',null),(88,'a','a',160),
(89,null,null,null),(90,'a','a',14785),(91,'a','a',0),(92,'a','a',null);
+insert into t1 values (100,null,null,null);
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
@@ -2909,8 +2284,8 @@ union
( select * from t1
where (f1 is null and f2 is null) and (f2 between 'a' and 'z' or f1 in ('a')));
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ref|filter f1,f2 f1|f1 13|13 const 1 (2%) Using index condition; Using where; Using rowid filter
-2 UNION t1 ref|filter f1,f2 f1|f1 13|13 const 1 (2%) Using index condition; Using where; Using rowid filter
+1 PRIMARY t1 ref|filter f1,f2 f1|f1 13|13 const 2 (3%) Using index condition; Using where; Using rowid filter
+2 UNION t1 ref|filter f1,f2 f1|f1 13|13 const 2 (3%) Using index condition; Using where; Using rowid filter
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
explain format=json ( select * from t1
where (f1 is null and f2 is null) and (f2 between 'a' and 'z' or f1 in ('a')))
@@ -2927,6 +2302,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -2942,11 +2318,13 @@ EXPLAIN
"key": "f1",
"used_key_parts": ["f1"]
},
- "rows": 1,
- "selectivity_pct": 1.587301587
+ "rows": 2,
+ "selectivity_pct": 3.125
},
- "rows": 1,
- "filtered": 1.587301612,
+ "loops": 1,
+ "rows": 2,
+ "cost": "COST_REPLACED",
+ "filtered": 3.125,
"index_condition": "t1.f1 is null",
"attached_condition": "t1.f2 is null and (t1.f2 between 'a' and 'z' or t1.f1 = 'a')"
}
@@ -2958,6 +2336,7 @@ EXPLAIN
"query_block": {
"select_id": 2,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -2973,11 +2352,13 @@ EXPLAIN
"key": "f1",
"used_key_parts": ["f1"]
},
- "rows": 1,
- "selectivity_pct": 1.587301587
+ "rows": 2,
+ "selectivity_pct": 3.125
},
- "rows": 1,
- "filtered": 1.587301612,
+ "loops": 1,
+ "rows": 2,
+ "cost": "COST_REPLACED",
+ "filtered": 3.125,
"index_condition": "t1.f1 is null",
"attached_condition": "t1.f2 is null and (t1.f2 between 'a' and 'z' or t1.f1 = 'a')"
}
@@ -3005,8 +2386,8 @@ id y x
1 2 1
explain extended select * from t1 join t2 on t1.id = t2.x where t2.y = 2 and t1.id = 1;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 100.00 Using index
-1 SIMPLE t2 index_merge x,y y,x 5,5 NULL 1 100.00 Using intersect(y,x); Using where; Using index
+1 SIMPLE t1 const PRIMARY PRIMARY 4 const # #
+1 SIMPLE t2 index_merge x,y y,x 5,5 NULL # # Using intersect(y,x); Using where; Using index
Warnings:
Note 1003 select 1 AS `id`,`test`.`t2`.`y` AS `y`,`test`.`t2`.`x` AS `x` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`y` = 2 and `test`.`t2`.`x` = 1
drop table t1, t2;
@@ -3043,7 +2424,7 @@ count(*)
5
explain extended select count(*) from t1 where a between 21 and 30 and b=2;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ref b,a b 5 const 24 9.60 Using where
+1 SIMPLE t1 ref|filter b,a b|a 5|5 const 24 (10%) 9.60 Using where; Using rowid filter
Warnings:
Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` between 21 and 30
select * from t1 where a between 21 and 30 and b=2;
@@ -3080,12 +2461,12 @@ Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
EXPLAIN EXTENDED
-SELECT a FROM t1 WHERE c < 'k' AND b > 't' ORDER BY a;
+SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 range|filter b,c b|c 13|1027 NULL 5 (42%) 41.67 Using index condition; Using where; Using filesort; Using rowid filter
+1 SIMPLE t1 range|filter b,c b|c 13|1027 NULL 5 (21%) 20.83 Using index condition; Using where; Using filesort; Using rowid filter
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`c` < 'k' and `test`.`t1`.`b` > 't' order by `test`.`t1`.`a`
-SELECT a FROM t1 WHERE c < 'k' AND b > 't' ORDER BY a;
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`c` < 'e' and `test`.`t1`.`b` > 't' order by `test`.`t1`.`a`
+SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a;
a
1
5
@@ -3096,25 +2477,25 @@ CREATE TABLE two(tw int) Engine=MyISAM;
INSERT INTO two VALUES (1),(2);
SET GLOBAL innodb_stats_persistent= OFF;
EXPLAIN EXTENDED
-SELECT a FROM t1 WHERE c < 'k' AND b > 't' ORDER BY a FOR UPDATE;
+SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a FOR UPDATE;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 range|filter b,c b|c 13|1027 NULL 5 (42%) 41.67 Using index condition; Using where; Using filesort; Using rowid filter
+1 SIMPLE t1 range|filter b,c b|c 13|1027 NULL 5 (21%) 20.83 Using index condition; Using where; Using filesort; Using rowid filter
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`c` < 'k' and `test`.`t1`.`b` > 't' order by `test`.`t1`.`a` for update
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`c` < 'e' and `test`.`t1`.`b` > 't' order by `test`.`t1`.`a` for update
EXPLAIN EXTENDED
-SELECT a FROM t1,two WHERE c < 'k' AND b > 't' ORDER BY a FOR UPDATE;
+SELECT a FROM t1,two WHERE c < 'e' AND b > 't' ORDER BY a FOR UPDATE;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE two ALL NULL NULL NULL NULL 2 100.00 Using temporary; Using filesort
-1 SIMPLE t1 range|filter b,c b|c 13|1027 NULL 5 (42%) 41.67 Using index condition; Using where; Using join buffer (flat, BNL join); Using rowid filter
+1 SIMPLE t1 range|filter b,c b|c 13|1027 NULL 5 (21%) 20.83 Using index condition; Using where; Using temporary; Using filesort; Using rowid filter
+1 SIMPLE two ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join)
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`two` where `test`.`t1`.`c` < 'k' and `test`.`t1`.`b` > 't' order by `test`.`t1`.`a` for update
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` join `test`.`two` where `test`.`t1`.`c` < 'e' and `test`.`t1`.`b` > 't' order by `test`.`t1`.`a` for update
SET @saved_dbug = @@SESSION.debug_dbug;
SET debug_dbug = '+d,innodb_report_deadlock';
-SELECT a FROM t1 WHERE c < 'k' AND b > 't' ORDER BY a FOR UPDATE;
+SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a FOR UPDATE;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
SET debug_dbug = @saved_dbug;
SET debug_dbug = '+d,innodb_report_deadlock';
-SELECT a FROM t1,two WHERE c < 'k' AND b > 't' ORDER BY a FOR UPDATE;
+SELECT a FROM t1,two WHERE c < 'e' AND b > 't' ORDER BY a FOR UPDATE;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
SET debug_dbug = @saved_dbug;
DROP TABLE two;
@@ -3536,7 +2917,7 @@ ORDER BY timestamp DESC;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL ixEventWhoisDomainDomain,ixEventWhoisDomainTimestamp NULL NULL NULL 60 22.22 Using where; Using filesort
Warnings:
-Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`domain` AS `domain`,`test`.`t1`.`registrant_name` AS `registrant_name`,`test`.`t1`.`registrant_organization` AS `registrant_organization`,`test`.`t1`.`registrant_street1` AS `registrant_street1`,`test`.`t1`.`registrant_street2` AS `registrant_street2`,`test`.`t1`.`registrant_street3` AS `registrant_street3`,`test`.`t1`.`registrant_street4` AS `registrant_street4`,`test`.`t1`.`registrant_street5` AS `registrant_street5`,`test`.`t1`.`registrant_city` AS `registrant_city`,`test`.`t1`.`registrant_postal_code` AS `registrant_postal_code`,`test`.`t1`.`registrant_country` AS `registrant_country`,`test`.`t1`.`registrant_email` AS `registrant_email`,`test`.`t1`.`registrant_telephone` AS `registrant_telephone`,`test`.`t1`.`administrative_name` AS `administrative_name`,`test`.`t1`.`administrative_organization` AS `administrative_organization`,`test`.`t1`.`administrative_street1` AS `administrative_street1`,`test`.`t1`.`administrative_street2` AS `administrative_street2`,`test`.`t1`.`administrative_street3` AS `administrative_street3`,`test`.`t1`.`administrative_street4` AS `administrative_street4`,`test`.`t1`.`administrative_street5` AS `administrative_street5`,`test`.`t1`.`administrative_city` AS `administrative_city`,`test`.`t1`.`administrative_postal_code` AS `administrative_postal_code`,`test`.`t1`.`administrative_country` AS `administrative_country`,`test`.`t1`.`administrative_email` AS `administrative_email`,`test`.`t1`.`administrative_telephone` AS `administrative_telephone`,`test`.`t1`.`technical_name` AS `technical_name`,`test`.`t1`.`technical_organization` AS `technical_organization`,`test`.`t1`.`technical_street1` AS `technical_street1`,`test`.`t1`.`technical_street2` AS `technical_street2`,`test`.`t1`.`technical_street3` AS `technical_street3`,`test`.`t1`.`technical_street4` AS `technical_street4`,`test`.`t1`.`technical_street5` AS `technical_street5`,`test`.`t1`.`technical_city` AS `technical_city`,`test`.`t1`.`technical_postal_code` AS `technical_postal_code`,`test`.`t1`.`technical_country` AS `technical_country`,`test`.`t1`.`technical_email` AS `technical_email`,`test`.`t1`.`technical_telephone` AS `technical_telephone`,`test`.`t1`.`json` AS `json`,`test`.`t1`.`timestamp` AS `timestamp` from `test`.`t1` where `test`.`t1`.`domain` = 'www.mailhost.i-dev.fr' and `test`.`t1`.`timestamp` >= <cache>('2017-01-30 08:24:51' + interval -1 month) order by `test`.`t1`.`timestamp` desc
+Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`domain` AS `domain`,`test`.`t1`.`registrant_name` AS `registrant_name`,`test`.`t1`.`registrant_organization` AS `registrant_organization`,`test`.`t1`.`registrant_street1` AS `registrant_street1`,`test`.`t1`.`registrant_street2` AS `registrant_street2`,`test`.`t1`.`registrant_street3` AS `registrant_street3`,`test`.`t1`.`registrant_street4` AS `registrant_street4`,`test`.`t1`.`registrant_street5` AS `registrant_street5`,`test`.`t1`.`registrant_city` AS `registrant_city`,`test`.`t1`.`registrant_postal_code` AS `registrant_postal_code`,`test`.`t1`.`registrant_country` AS `registrant_country`,`test`.`t1`.`registrant_email` AS `registrant_email`,`test`.`t1`.`registrant_telephone` AS `registrant_telephone`,`test`.`t1`.`administrative_name` AS `administrative_name`,`test`.`t1`.`administrative_organization` AS `administrative_organization`,`test`.`t1`.`administrative_street1` AS `administrative_street1`,`test`.`t1`.`administrative_street2` AS `administrative_street2`,`test`.`t1`.`administrative_street3` AS `administrative_street3`,`test`.`t1`.`administrative_street4` AS `administrative_street4`,`test`.`t1`.`administrative_street5` AS `administrative_street5`,`test`.`t1`.`administrative_city` AS `administrative_city`,`test`.`t1`.`administrative_postal_code` AS `administrative_postal_code`,`test`.`t1`.`administrative_country` AS `administrative_country`,`test`.`t1`.`administrative_email` AS `administrative_email`,`test`.`t1`.`administrative_telephone` AS `administrative_telephone`,`test`.`t1`.`technical_name` AS `technical_name`,`test`.`t1`.`technical_organization` AS `technical_organization`,`test`.`t1`.`technical_street1` AS `technical_street1`,`test`.`t1`.`technical_street2` AS `technical_street2`,`test`.`t1`.`technical_street3` AS `technical_street3`,`test`.`t1`.`technical_street4` AS `technical_street4`,`test`.`t1`.`technical_street5` AS `technical_street5`,`test`.`t1`.`technical_city` AS `technical_city`,`test`.`t1`.`technical_postal_code` AS `technical_postal_code`,`test`.`t1`.`technical_country` AS `technical_country`,`test`.`t1`.`technical_email` AS `technical_email`,`test`.`t1`.`technical_telephone` AS `technical_telephone`,`test`.`t1`.`json` AS `json`,`test`.`t1`.`timestamp` AS `timestamp` from `test`.`t1` where `test`.`t1`.`domain` = 'www.mailhost.i-dev.fr' and `test`.`t1`.`timestamp` >= TIMESTAMP/*WITH LOCAL TIME ZONE*/'2016-12-30 08:24:51' order by `test`.`t1`.`timestamp` desc
SET optimizer_switch=@save_optimizer_switch;
DROP TABLE t1;
#
@@ -3581,7 +2962,7 @@ SELECT * FROM t1
WHERE (a BETWEEN 9 AND 10 OR a IS NULL) AND (b BETWEEN 9 AND 10 OR b = 9)
ORDER BY pk LIMIT 1;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 index a,b PRIMARY 4 NULL 75 54.55 Using where
+1 SIMPLE t1 index a,b PRIMARY 4 NULL 73 56.05 Using where
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a` between 9 and 10 or `test`.`t1`.`a` is null) and (`test`.`t1`.`b` between 9 and 10 or `test`.`t1`.`b` = 9) order by `test`.`t1`.`pk` limit 1
ANALYZE
@@ -3783,7 +3164,7 @@ fi.fh in (6311439873746261694,-397087483897438286,
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t index_merge PRIMARY,acli_rid,acli_tp acli_tp,acli_rid 2,767 NULL 2 100.00 Using intersect(acli_tp,acli_rid); Using where; Using index
1 SIMPLE a ref PRIMARY,acei_aclid acei_aclid 8 test.t.id 1 100.00 Using where
-1 SIMPLE fi ref filt_aceid,filt_fh filt_aceid 8 test.a.id 24 14.46 Using where
+1 SIMPLE fi ref|filter filt_aceid,filt_fh filt_aceid|filt_fh 8|8 test.a.id 24 (14%) 14.46 Using where; Using rowid filter
Warnings:
Note 1003 select `test`.`t`.`id` AS `id`,`test`.`fi`.`id` AS `id`,`test`.`fi`.`aceid` AS `aceid`,`test`.`fi`.`clid` AS `clid`,`test`.`fi`.`fh` AS `fh` from `test`.`acli` `t` join `test`.`acei` `a` join `test`.`filt` `fi` where `test`.`t`.`tp` = 121 and `test`.`a`.`atp` = 1 and `test`.`fi`.`aceid` = `test`.`a`.`id` and `test`.`a`.`aclid` = `test`.`t`.`id` and `test`.`t`.`rid` = 'B5FCC8C7111E4E3CBC21AAF5012F59C2' and `test`.`fi`.`fh` in (6311439873746261694,-397087483897438286,8518228073041491534,-5420422472375069774)
set statement optimizer_switch='rowid_filter=on' for select t.id, fi.*
@@ -3899,7 +3280,7 @@ fi.fh in (6311439873746261694,-397087483897438286,
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t index_merge PRIMARY,acli_rid,acli_tp acli_tp,acli_rid 2,767 NULL 2 100.00 Using intersect(acli_tp,acli_rid); Using where; Using index
1 SIMPLE a ref PRIMARY,acei_aclid acei_aclid 8 test.t.id 1 100.00 Using where; Using join buffer (flat, BKA join); Rowid-ordered scan
-1 SIMPLE fi ref filt_aceid,filt_fh filt_aceid 8 test.a.id 24 14.46 Using where; Using join buffer (incremental, BKA join); Rowid-ordered scan
+1 SIMPLE fi ref|filter filt_aceid,filt_fh filt_aceid|filt_fh 8|8 test.a.id 24 (14%) 14.46 Using where; Using join buffer (incremental, BKA join); Rowid-ordered scan; Using rowid filter
Warnings:
Note 1003 select `test`.`t`.`id` AS `id`,`test`.`fi`.`id` AS `id`,`test`.`fi`.`aceid` AS `aceid`,`test`.`fi`.`clid` AS `clid`,`test`.`fi`.`fh` AS `fh` from `test`.`acli` `t` join `test`.`acei` `a` join `test`.`filt` `fi` where `test`.`t`.`tp` = 121 and `test`.`a`.`atp` = 1 and `test`.`fi`.`aceid` = `test`.`a`.`id` and `test`.`a`.`aclid` = `test`.`t`.`id` and `test`.`t`.`rid` = 'B5FCC8C7111E4E3CBC21AAF5012F59C2' and `test`.`fi`.`fh` in (6311439873746261694,-397087483897438286,8518228073041491534,-5420422472375069774)
set statement optimizer_switch='rowid_filter=on' for select t.id, fi.*
@@ -3960,6 +3341,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -3985,9 +3367,11 @@ ANALYZE
}
]
},
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -4007,9 +3391,11 @@ ANALYZE
"key_length": "8",
"used_key_parts": ["aclid"],
"ref": ["test.t.id"],
+ "loops": 2,
"r_loops": 1,
"rows": 1,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -4038,9 +3424,24 @@ ANALYZE
"key_length": "8",
"used_key_parts": ["aceid"],
"ref": ["test.a.id"],
+ "rowid_filter": {
+ "range": {
+ "key": "filt_fh",
+ "used_key_parts": ["fh"]
+ },
+ "rows": 81,
+ "selectivity_pct": 14.46428571,
+ "r_rows": 80,
+ "r_lookups": 80,
+ "r_selectivity_pct": 40,
+ "r_buffer_size": "REPLACED",
+ "r_filling_time_ms": "REPLACED"
+ },
+ "loops": 3.5384,
"r_loops": 1,
"rows": 24,
- "r_rows": 80,
+ "r_rows": 32,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -4053,10 +3454,10 @@ ANALYZE
"mrr_type": "Rowid-ordered scan",
"attached_condition": "fi.fh in (6311439873746261694,-397087483897438286,8518228073041491534,-5420422472375069774)",
"r_loops": 3,
- "r_filtered": 40,
+ "r_filtered": 100,
"r_unpack_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
- "r_effective_rows": 26.66666667
+ "r_effective_rows": 10.66666667
}
}
]
@@ -4095,6 +3496,16 @@ test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status OK
+EXPLAIN EXTENDED SELECT * FROM t1
+WHERE t1.c1 NOT IN (SELECT t2.c1 FROM t2, t1 AS a1
+WHERE t2.i1 = t1.pk AND t2.i1 BETWEEN 3 AND 5);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 60 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ref|filter c1,i1 c1|i1 3|5 func 38 (25%) 25.00 Using where; Full scan on NULL key; Using rowid filter
+2 DEPENDENT SUBQUERY a1 ALL NULL NULL NULL NULL 60 100.00 Using join buffer (flat, BNL join)
+Warnings:
+Note 1276 Field or reference 'test.t1.pk' of SELECT #2 was resolved in SELECT #1
+Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1` AS `c1` from `test`.`t1` where !<expr_cache><`test`.`t1`.`c1`,`test`.`t1`.`pk`>(<in_optimizer>(`test`.`t1`.`c1`,<exists>(/* select#2 */ select `test`.`t2`.`c1` from `test`.`t2` join `test`.`t1` `a1` where `test`.`t2`.`i1` = `test`.`t1`.`pk` and `test`.`t2`.`i1` between 3 and 5 and trigcond(<cache>(`test`.`t1`.`c1`) = `test`.`t2`.`c1`))))
SELECT * FROM t1
WHERE t1.c1 NOT IN (SELECT t2.c1 FROM t2, t1 AS a1
WHERE t2.i1 = t1.pk AND t2.i1 BETWEEN 3 AND 5);
@@ -4159,16 +3570,6 @@ pk c1
128 y
129 NULL
133 NULL
-EXPLAIN EXTENDED SELECT * FROM t1
-WHERE t1.c1 NOT IN (SELECT t2.c1 FROM t2, t1 AS a1
-WHERE t2.i1 = t1.pk AND t2.i1 BETWEEN 3 AND 5);
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 60 100.00 Using where
-2 DEPENDENT SUBQUERY t2 ref c1,i1 i1 5 test.t1.pk 20 100.00 Using index condition; Using where
-2 DEPENDENT SUBQUERY a1 ALL NULL NULL NULL NULL 60 100.00 Using join buffer (flat, BNL join)
-Warnings:
-Note 1276 Field or reference 'test.t1.pk' of SELECT #2 was resolved in SELECT #1
-Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1` AS `c1` from `test`.`t1` where !<expr_cache><`test`.`t1`.`c1`,`test`.`t1`.`pk`>(<in_optimizer>(`test`.`t1`.`c1`,<exists>(/* select#2 */ select `test`.`t2`.`c1` from `test`.`t2` join `test`.`t1` `a1` where `test`.`t2`.`i1` = `test`.`t1`.`pk` and `test`.`t2`.`i1` between 3 and 5 and trigcond(<cache>(`test`.`t1`.`c1`) = `test`.`t2`.`c1`))))
DROP TABLE t1,t2;
#
# MDEV-31154: Fatal InnoDB error or assertion `!is_v' failure upon multi-update with indexed virtual column
diff --git a/mysql-test/main/rowid_filter_innodb.test b/mysql-test/main/rowid_filter_innodb.test
index b0d65837..d5de649f 100644
--- a/mysql-test/main/rowid_filter_innodb.test
+++ b/mysql-test/main/rowid_filter_innodb.test
@@ -40,6 +40,7 @@ insert into t1 values
(81,'a','a',20),(82,'a','a',0),(83,'a','a',0),(84,'a','a',null),
(85,'a','a',-1),(86,'a','a',5),(87,'a','a',null),(88,'a','a',160),
(89,null,null,null),(90,'a','a',14785),(91,'a','a',0),(92,'a','a',null);
+insert into t1 values (100,null,null,null);
analyze table t1;
@@ -52,6 +53,7 @@ let $q=
eval $q;
eval explain $q;
+--source include/explain-no-costs.inc
eval explain format=json $q;
drop table t1;
@@ -73,6 +75,7 @@ let $q=
select * from t1 join t2 on t1.id = t2.x where t2.y = 2 and t1.id = 1;
eval $q;
+--replace_column 9 # 10 #
eval explain extended $q;
drop table t1, t2;
@@ -135,13 +138,22 @@ INSERT INTO t1 VALUES
ANALYZE TABLE t1;
EXPLAIN EXTENDED
-SELECT a FROM t1 WHERE c < 'k' AND b > 't' ORDER BY a;
+SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a;
-SELECT a FROM t1 WHERE c < 'k' AND b > 't' ORDER BY a;
+SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a;
--echo #
--echo # MDEV-25163 Rowid filter does not process storage engine error correctly.
--echo #
+#INSERT INTO t1 VALUES
+# (100,'z','a'),
+# (100,'z','a'),
+# (100,'z','a'),
+# (100,'z','a');
+
+
+#ANALYZE TABLE t1;
+
CREATE TABLE two(tw int) Engine=MyISAM;
INSERT INTO two VALUES (1),(2);
@@ -150,11 +162,12 @@ INSERT INTO two VALUES (1),(2);
SET GLOBAL innodb_stats_persistent= OFF;
# Make sure it's still rowid filter + filesort
+#--optimizer_trace
EXPLAIN EXTENDED
-SELECT a FROM t1 WHERE c < 'k' AND b > 't' ORDER BY a FOR UPDATE;
+SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a FOR UPDATE;
EXPLAIN EXTENDED
-SELECT a FROM t1,two WHERE c < 'k' AND b > 't' ORDER BY a FOR UPDATE;
+SELECT a FROM t1,two WHERE c < 'e' AND b > 't' ORDER BY a FOR UPDATE;
SET @saved_dbug = @@SESSION.debug_dbug;
# Deadlock error should be returned from InnoDB during rowid filter container
@@ -163,13 +176,13 @@ SET @saved_dbug = @@SESSION.debug_dbug;
# operation.
SET debug_dbug = '+d,innodb_report_deadlock';
--error ER_LOCK_DEADLOCK
-SELECT a FROM t1 WHERE c < 'k' AND b > 't' ORDER BY a FOR UPDATE;
+SELECT a FROM t1 WHERE c < 'e' AND b > 't' ORDER BY a FOR UPDATE;
SET debug_dbug = @saved_dbug;
# Same as above for the join query:
SET debug_dbug = '+d,innodb_report_deadlock';
--error ER_LOCK_DEADLOCK
-SELECT a FROM t1,two WHERE c < 'k' AND b > 't' ORDER BY a FOR UPDATE;
+SELECT a FROM t1,two WHERE c < 'e' AND b > 't' ORDER BY a FOR UPDATE;
SET debug_dbug = @saved_dbug;
DROP TABLE two;
@@ -680,8 +693,8 @@ SELECT * FROM t1
WHERE t1.c1 NOT IN (SELECT t2.c1 FROM t2, t1 AS a1
WHERE t2.i1 = t1.pk AND t2.i1 BETWEEN 3 AND 5);
-eval $q;
eval EXPLAIN EXTENDED $q;
+eval $q;
DROP TABLE t1,t2;
diff --git a/mysql-test/main/rowid_filter_innodb_debug.result b/mysql-test/main/rowid_filter_innodb_debug.result
index f82b29aa..7e5446c9 100644
--- a/mysql-test/main/rowid_filter_innodb_debug.result
+++ b/mysql-test/main/rowid_filter_innodb_debug.result
@@ -3,7 +3,7 @@ set default_storage_engine=innodb;
# MDEV-22761 KILL QUERY during rowid_filter, crashes
#
create table t2(a int);
-insert into t2 select * from seq_0_to_99;
+insert into t2 select seq from seq_1_to_100;
CREATE TABLE t3 (
key1 int ,
key2 int,
@@ -11,16 +11,11 @@ filler varchar(255),
KEY (key1),
KEY (key2)
);
+insert into t3 select seq,seq, 'filler-data-filler-data' from seq_1_to_2000;
select engine from information_schema.tables
where table_schema=database() and table_name='t3';
engine
InnoDB
-insert into t3
-select
-A.seq,
-B.seq,
-'filler-data-filler-data'
-from seq_0_to_99 A, seq_0_to_99 B;
analyze table t2,t3;
Table Op Msg_type Msg_text
test.t2 analyze status Engine-independent statistics collected
@@ -28,16 +23,16 @@ test.t2 analyze status OK
test.t3 analyze status Engine-independent statistics collected
test.t3 analyze status OK
explain
-select * from t2, t3
+select straight_join * from t2, t3
where
-t3.key1=t2.a and t3.key2 in (2,3);
+t3.key1=t2.a and t3.key2 between 2 and 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 100 Using where
-1 SIMPLE t3 ref|filter key1,key2 key1|key2 5|5 test.t2.a 100 (2%) Using where; Using rowid filter
+1 SIMPLE t3 ref|filter key1,key2 key1|key2 5|5 test.t2.a 1 (0%) Using where; Using rowid filter
set debug_sync='handler_rowid_filter_check SIGNAL at_rowid_filter_check WAIT_FOR go';
-select * from t2, t3
+select straight_join * from t2, t3
where
-t3.key1=t2.a and t3.key2 in (2,3);
+t3.key1=t2.a and t3.key2 between 2 and 10;
connect con1, localhost, root,,;
set debug_sync='now WAIT_FOR at_rowid_filter_check';
kill query $target_id;
diff --git a/mysql-test/main/rowid_filter_innodb_debug.test b/mysql-test/main/rowid_filter_innodb_debug.test
index 60381658..99d32f96 100644
--- a/mysql-test/main/rowid_filter_innodb_debug.test
+++ b/mysql-test/main/rowid_filter_innodb_debug.test
@@ -1,7 +1,9 @@
--source include/have_innodb.inc
+--source include/have_sequence.inc
--source include/no_valgrind_without_big.inc
set default_storage_engine=innodb;
--source include/rowid_filter_debug_kill.inc
set default_storage_engine=default;
+
diff --git a/mysql-test/main/rowid_filter_myisam.result b/mysql-test/main/rowid_filter_myisam.result
index 927257d2..ecc6a9f3 100644
--- a/mysql-test/main/rowid_filter_myisam.result
+++ b/mysql-test/main/rowid_filter_myisam.result
@@ -1,3 +1,4 @@
+SET optimizer_switch='rowid_filter=on';
#
# MDEV-22553: Assertion `info->lastpos == (~ (my_off_t) 0)' failed in mi_rkey with rowid_filer=on
#
@@ -19,3 +20,683 @@ ALTER TABLE t1 ENABLE KEYS;
SELECT * FROM t1 WHERE ( a BETWEEN 255 AND 270 OR f = 200 ) AND f IN ( 1, 4, 112, 143 ) AND d IN ('Montana', 'South Dakota');
a b c d e f
DROP TABLE t1;
+use test;
+#
+# MDEV-18816: potential range filter for one join table with
+# impossible WHERE for another
+#
+create table t1 (
+pk int not null primary key, c2 varchar(10) , i1 int,key (c2)
+) engine=myisam;
+insert into t1 values (1,'a',-5),(2,'a',null);
+create table t2 (
+pk int, i1 int, c1 varchar(30) , key c1 (c1(30)), key i1 (i1)
+) engine=myisam;
+insert into t2 values
+(1,-5,'a'),(2,null,'a'),(3,null,'a'),(4,null,'a'),(5,5,'a'),(6,null,'a'),
+(7,4,'a'),(8,55,'a'),(9,null,'a'),(10,null,'a'),(11,null,'a'),(12,-5,'a'),
+(13,-5,'a'),(14,null,'a'),(15,null,'a'),(16,-5,'a'),(17,-5,'a');
+select 1
+from t1
+left join
+t2 join t1 as t1_a on t2.i1 = t1_a.pk
+on t1.c2 = t2.c1
+where t1_a.pk is null and t1_a.i1 != 3;
+1
+explain extended select 1
+from t1
+left join
+t2 join t1 as t1_a on t2.i1 = t1_a.pk
+on t1.c2 = t2.c1
+where t1_a.pk is null and t1_a.i1 != 3;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+Warnings:
+Note 1003 select 1 AS `1` from `test`.`t1` join `test`.`t2` join `test`.`t1` `t1_a` where 0
+drop table t1,t2;
+#
+# MDEV-18640: TABLE::prune_range_rowid_filters: Conditional jump or
+# move depends on uninitialized value
+#
+CREATE TABLE t1 (
+pk INT, i INT, PRIMARY KEY (pk), KEY (pk,i)
+) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,10), (7,70), (2,20);
+SELECT * FROM t1 WHERE pk < 5;
+pk i
+1 10
+2 20
+DROP TABLE t1;
+#
+# MDEV-18956: Possible rowid filter for subquery for which
+# in_to_exists strategy has been chosen
+#
+CREATE TABLE t1 (pk int) engine=myisam ;
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (
+pk int auto_increment PRIMARY KEY,
+i1 int, i2 int, c2 varchar(1),
+KEY (i1), KEY (i2)
+) engine=myisam;
+INSERT INTO t2 VALUES
+(1,8,6,'t'),(2,5,7,'i'),(3,4,4,'h'),(4,207,38,'d'),(5,183,206,'b'),
+(6,7,null,'o'),(7,1,2,'j'),(8,17,36,'s'),(9,4,5,'q'),(10,0,6,'l'),
+(11,1,9,'j'),(12,5,6,'y'),(13,null,0,'i'),(14,7,7,'x'),(15,5,2,'u');
+SELECT * FROM t1 HAVING (7, 9) IN (SELECT t2.i1, t2.i2 FROM t2 WHERE t2.i1 = 3);
+pk
+EXPLAIN EXTENDED
+SELECT * FROM t1 HAVING (7, 9) IN (SELECT t2.i1, t2.i2 FROM t2 WHERE t2.i1 = 3);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING
+2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk` from `test`.`t1` having 0
+DROP TABLE t1,t2;
+#
+# MDEV-19255: rowid range filter built for range condition
+# that uses in expensive subquery
+#
+CREATE TABLE t1 (
+pk1 INT PRIMARY KEY, a1 INT, b1 VARCHAR(1), KEY(b1)
+) ENGINE=MyISAM;
+INSERT INTO t1 VALUES
+(10,0,'z'),(11,3,'j'),(12,8,'f'),(13,8,'p'),(14,6,'w'),(15,0,'c'),(16,1,'j'),
+(17,1,'f'),(18,5,'v'),(19,3,'f'),(20,2,'q'),(21,8,'y'),(22,0,'a'),(23,9,'w'),
+(24,3,'e'),(25,1,'b'),(26,9,'r'),(27,2,'k'),(28,5,'c'),(29,3,'k'),(30,9,'b'),
+(31,8,'j'),(32,1,'t'),(33,8,'n'),(34,3,'z'),(35,0,'u'),(36,3,'a'),(37,3,'g'),
+(38,1,'f'),(39,6,'p'),(40,6,'m'),(41,6,'t'),(42,7,'i'),(43,4,'h'),(44,3,'d'),
+(45,2,'b'),(46,1,'o'),(47,2,'j'),(48,6,'s'),(49,5,'q'),(50,6,'l'),(51,9,'j'),
+(52,6,'y'),(53,0,'i'),(54,7,'x'),(55,2,'u'),(56,6,'t'),(57,4,'b'),(58,5,'m'),
+(59,4,'x'),(60,8,'x'),(61,6,'v'),(62,8,'m'),(63,4,'j'),(64,8,'z'),(65,2,'a'),
+(66,9,'i'),(67,4,'g'),(68,8,'h'),(69,1,'p'),(70,8,'a'),(71,0,'x'),(72,2,'s'),
+(73,6,'k'),(74,0,'m'),(75,6,'e'),(76,9,'y'),(77,7,'d'),(78,7,'w'),(79,6,'y'),
+(80,9,'s'),(81,9,'x'),(82,6,'l'),(83,9,'f'),(84,8,'x'),(85,1,'p'),(86,7,'y'),
+(87,6,'p'),(88,1,'g'),(89,3,'c'),(90,5,'h'),(91,3,'p'),(92,2,'b'),(93,1,NULL),
+(94,3,NULL),(95,2,'y'),(96,7,'s'),(97,7,'x'),(98,6,'i'),(99,9,'t'),(100,5,'j'),
+(101,0,'u'),(102,7,'r'),(103,2,'x'),(104,8,'e'),(105,8,'i'),(106,5,'q'),
+(107,8,'z'),(108,3,'k'),(109,65,NULL);
+CREATE TABLE t2 (pk2 INT PRIMARY KEY, a2 INT, b2 VARCHAR(1)) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1,1,'x');
+INSERT INTO t2 SELECT * FROM t1;
+SELECT * FROM t1 INNER JOIN t2 ON ( pk1 <> pk2 AND pk1 = a2 )
+WHERE b1 <= ( SELECT MAX(b2) FROM t2 WHERE pk2 <= 1 );
+pk1 a1 b1 pk2 a2 b2
+65 2 a 109 65 NULL
+EXPLAIN EXTENDED SELECT * FROM t1 INNER JOIN t2 ON ( pk1 <> pk2 AND pk1 = a2 )
+WHERE b1 <= ( SELECT MAX(b2) FROM t2 WHERE pk2 <= 1 );
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t2 ALL NULL NULL NULL NULL 101 100.00 Using where
+1 PRIMARY t1 eq_ref PRIMARY,b1 PRIMARY 4 test.t2.a2 1 87.00 Using where
+2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 100.00 Using index condition
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,`test`.`t2`.`pk2` AS `pk2`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b2` AS `b2` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`pk1` = `test`.`t2`.`a2` and `test`.`t1`.`b1` <= (/* select#2 */ select max(`test`.`t2`.`b2`) from `test`.`t2` where `test`.`t2`.`pk2` <= 1) and `test`.`t2`.`a2` <> `test`.`t2`.`pk2`
+EXPLAIN FORMAT=JSON SELECT * FROM t1 INNER JOIN t2 ON ( pk1 <> pk2 AND pk1 = a2 )
+WHERE b1 <= ( SELECT MAX(b2) FROM t2 WHERE pk2 <= 1 );
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": "COST_REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 101,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "attached_condition": "t2.a2 <> t2.pk2 and t2.a2 is not null"
+ }
+ },
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "eq_ref",
+ "possible_keys": ["PRIMARY", "b1"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["pk1"],
+ "ref": ["test.t2.a2"],
+ "loops": 101,
+ "rows": 1,
+ "cost": "COST_REPLACED",
+ "filtered": 87,
+ "attached_condition": "t1.b1 <= (subquery#2)"
+ }
+ }
+ ],
+ "subqueries": [
+ {
+ "query_block": {
+ "select_id": 2,
+ "cost": "COST_REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["PRIMARY"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["pk2"],
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "index_condition": "t2.pk2 <= 1"
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+DROP TABLE t1,t2;
+#
+# MDEV-21794: Optimizer flag rowid_filter leads to long query
+#
+create table t10(a int);
+insert into t10 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t11(a int);
+insert into t11 select A.a + B.a* 10 + C.a * 100 from t10 A, t10 B, t10 C;
+CREATE TABLE t1 (
+el_id int(10) unsigned NOT NULL ,
+el_index blob NOT NULL,
+el_index_60 varbinary(60) NOT NULL,
+filler blob,
+PRIMARY KEY (el_id),
+KEY el_index (el_index(60)),
+KEY el_index_60 (el_index_60,el_id)
+);
+insert into t1
+select
+A.a+1000*B.a,
+A.a+1000*B.a + 10000,
+A.a+1000*B.a + 10000,
+'filler-data-filler-data'
+from
+t11 A, t10 B;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze Warning Engine-independent statistics are not collected for column 'el_index'
+test.t1 analyze Warning Engine-independent statistics are not collected for column 'filler'
+test.t1 analyze status Table is already up to date
+# This must not use rowid_filter with key=el_index|el_index_60:
+explain
+select * from t1
+where el_index like '10%' and (el_index_60 like '10%' or el_index_60 like '20%');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range el_index,el_index_60 el_index 62 NULL 645 Using where
+drop table t10, t11, t1;
+#
+# MDEV-22160: SIGSEGV in st_join_table::save_explain_data on SELECT
+#
+set @save_optimizer_switch= @@optimizer_switch;
+SET @@optimizer_switch="index_merge_sort_union=OFF";
+CREATE TABLE t1 (a INT, b INT, INDEX(a), INDEX(b));
+INSERT INTO t1 VALUES (0,0),(0,0),(1,0),(-1,1), (-2,1), (-2,3), (-3,4), (-2,4),(3,3),(3,4),(3,5),(8,8),(8,9),(1,0),(2,0),(0,0),(0,0);
+explain
+SELECT * FROM t1 WHERE a > 0 AND b=0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref|filter a,b b|a 5|5 const 7 (47%) Using where; Using rowid filter
+SELECT * FROM t1 WHERE a > 0 AND b=0;
+a b
+1 0
+1 0
+2 0
+drop table t1;
+SET @@optimizer_switch=@save_optimizer_switch;
+#
+# MDEV-21633
+# Assertion `tmp >= 0' failed in best_access_path with rowid_filter=ON
+#
+set @save_optimizer_switch= @@optimizer_switch;
+SET optimizer_switch='rowid_filter=on';
+CREATE TABLE t1 (
+pk INT AUTO_INCREMENT,
+a INT,
+b VARCHAR(8),
+KEY(a),
+PRIMARY KEY(pk),
+KEY (a,pk)
+) ENGINE=MyISAM;
+INSERT INTO t1 (a,b) VALUES
+(NULL,'d'),(9,'b'),(2,'x'),(5,'k'),(NULL,'d'),(3,'s'),(5,'k'),(1,'r'),
+(8,'l'),(3,'z'),(1,'c'),(1,'q'),(NULL,'x'),(NULL,'p'),(NULL,'z'),(7,'a'),
+(0,'i'),(3,'s'),(NULL,'h'),(4,'p'),(1,'i'),(4,'f'),(1,'c'),(NULL,'a'),
+(NULL,'x'),(1,'b'),(NULL,'n'),(NULL,'h'),(5,'i'),(6,'e'),(NULL,'i'),
+(7,'e'),(1,'r'),(NULL,'z'),(1,'i'),(14,'c'),(6,'u'),(3,'b'),(4,'z'),
+(2,'c'),(70,'d'),(NULL,'p'),(21,'j'),(6,'e'),(5,'c'),(13,'i'),(42,'d'),
+(80,'s'),(14,'t'),(9,'a'),(0,'2'),(0,NULL),(0,NULL),(0,NULL),(0,''),
+(0,''),(0,'1'),(0,''),(0,''),(0,''),(0,''),(0,NULL),(0,''),(0,''),(0,''),
+(0,NULL),(0,''),(0,''),(0,''),(0,''),(0,''),(0,''),(0,NULL),(0,NULL),
+(0,NULL),(0,''),(0,''),(0,''),(0,''),(0,NULL),(0,''),(0,NULL),(0,NULL),
+(0,''),(0,''),(0,''),(0,NULL),(0,''),(0,NULL),(0,''),(0,''),(0,''),(0,''),
+(0,''),(0,''),(0,''),(0,NULL),(0,''),(0,NULL),(0,'');
+CREATE TABLE t2 (c INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1),(2),(3),(4),(5),(6);
+SELECT * FROM t1 JOIN t2 WHERE a = c AND pk BETWEEN 4 AND 7 AND a BETWEEN 2 AND 12 AND b != 'foo';
+pk a b c
+6 3 s 3
+4 5 k 5
+7 5 k 5
+explain SELECT * FROM t1 JOIN t2 WHERE a = c AND pk BETWEEN 4 AND 7 AND a BETWEEN 2 AND 12 AND b != 'foo';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range|filter PRIMARY,a,a_2 PRIMARY|a 4|5 NULL 4 (11%) Using index condition; Using where; Using rowid filter
+1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join)
+SET optimizer_switch='rowid_filter=off';
+SELECT * FROM t1 JOIN t2 WHERE a = c AND pk BETWEEN 4 AND 7 AND a BETWEEN 2 AND 12 AND b != 'foo';
+pk a b c
+6 3 s 3
+4 5 k 5
+7 5 k 5
+SET @@optimizer_switch=@save_optimizer_switch;
+DROP TABLE t1, t2;
+#
+# MDEV-28846: Poor performance when rowid filter contains no elements
+#
+create table t1 (
+pk int primary key auto_increment,
+nm varchar(32),
+fl1 tinyint default 0,
+fl2 tinyint default 0,
+index idx1(nm, fl1),
+index idx2(fl2)
+) engine=myisam;
+create table name (
+pk int primary key auto_increment,
+nm bigint
+) engine=myisam;
+create table flag2 (
+pk int primary key auto_increment,
+fl2 tinyint
+) engine=myisam;
+insert into name(nm) select seq from seq_1_to_1000 order by rand(17);
+insert into flag2(fl2) select seq mod 2 from seq_1_to_1000 order by rand(19);
+insert into t1(nm,fl2)
+select nm, fl2 from name, flag2 where name.pk = flag2.pk;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
+select '500%' as a;
+a
+500%
+set optimizer_switch='rowid_filter=on';
+explain
+select * from t1 where nm like '500%' AND fl2 = 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range idx1,idx2 idx1 35 NULL 1 Using index condition; Using where
+analyze format=json
+select * from t1 where nm like '500%' AND fl2 = 0;
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "range",
+ "possible_keys": ["idx1", "idx2"],
+ "key": "idx1",
+ "key_length": "35",
+ "used_key_parts": ["nm"],
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 1,
+ "r_rows": 1,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 49.20000076,
+ "r_filtered": 100,
+ "index_condition": "t1.nm like '500%'",
+ "attached_condition": "t1.fl2 = 0"
+ }
+ }
+ ]
+ }
+}
+select * from t1 where nm like '500%' AND fl2 = 0;
+pk nm fl1 fl2
+517 500 0 0
+truncate table name;
+truncate table flag2;
+truncate table t1;
+insert into name(nm) select seq from seq_1_to_1000 order by rand(17);
+insert into flag2(fl2) select seq mod 2 from seq_1_to_1000 order by rand(19);
+insert into t1(nm,fl2)
+select nm, fl2 from name, flag2 where name.pk = flag2.pk;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
+set optimizer_switch='rowid_filter=off';
+explain
+select * from t1 where nm like '500%' AND fl2 = 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range idx1,idx2 idx1 35 NULL 1 Using index condition; Using where
+analyze format=json
+select * from t1 where nm like '500%' AND fl2 = 0;
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "range",
+ "possible_keys": ["idx1", "idx2"],
+ "key": "idx1",
+ "key_length": "35",
+ "used_key_parts": ["nm"],
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 1,
+ "r_rows": 1,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 49.20000076,
+ "r_filtered": 100,
+ "index_condition": "t1.nm like '500%'",
+ "attached_condition": "t1.fl2 = 0"
+ }
+ }
+ ]
+ }
+}
+select * from t1 where nm like '500%' AND fl2 = 0;
+pk nm fl1 fl2
+517 500 0 0
+truncate table name;
+truncate table flag2;
+truncate table t1;
+insert into name(nm) select seq from seq_1_to_1000 order by rand(17);
+insert into flag2(fl2) select seq mod 10 from seq_1_to_1000 order by rand(19);
+insert into t1(nm,fl2)
+select nm, fl2 from name, flag2 where name.pk = flag2.pk;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
+select '607%' as a;
+a
+607%
+set optimizer_switch='rowid_filter=on';
+explain
+select * from t1 where nm like '607%' AND fl2 = 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range idx1,idx2 idx1 35 NULL 1 Using index condition; Using where
+select * from t1 where nm like '607%' AND fl2 = 0;
+pk nm fl1 fl2
+721 607 0 0
+truncate table name;
+truncate table flag2;
+truncate table t1;
+insert into name(nm) select seq from seq_1_to_10000 order by rand(17);
+insert into flag2(fl2) select seq mod 100 from seq_1_to_10000 order by rand(19);
+insert into t1(nm,fl2)
+select nm, fl2 from name, flag2 where name.pk = flag2.pk;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
+select '75%' as a;
+a
+75%
+set optimizer_switch='rowid_filter=on';
+explain
+select * from t1 where nm like '75%' AND fl2 = 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref|filter idx1,idx2 idx2|idx1 2|35 const 55 (1%) Using where; Using rowid filter
+analyze format=json
+select * from t1 where nm like '75%' AND fl2 = 0;
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ref",
+ "possible_keys": ["idx1", "idx2"],
+ "key": "idx2",
+ "key_length": "2",
+ "used_key_parts": ["fl2"],
+ "ref": ["const"],
+ "rowid_filter": {
+ "range": {
+ "key": "idx1",
+ "used_key_parts": ["nm"]
+ },
+ "rows": 115,
+ "selectivity_pct": 1.15,
+ "r_rows": 111,
+ "r_lookups": 100,
+ "r_selectivity_pct": 2,
+ "r_buffer_size": "REPLACED",
+ "r_filling_time_ms": "REPLACED"
+ },
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 55,
+ "r_rows": 2,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 1.149999976,
+ "r_filtered": 100,
+ "attached_condition": "t1.nm like '75%'"
+ }
+ }
+ ]
+ }
+}
+select * from t1 where nm like '75%' AND fl2 = 0;
+pk nm fl1 fl2
+4543 7503 0 0
+7373 7518 0 0
+drop table name, flag2;
+drop table t1;
+create table t1 (
+pk int primary key auto_increment,
+nm char(255),
+fl1 tinyint default 0,
+fl2 int default 0,
+index idx1(nm, fl1),
+index idx2(fl2)
+) engine=myisam;
+create table name (
+pk int primary key auto_increment,
+nm bigint
+) engine=myisam;
+create table flag2 (
+pk int primary key auto_increment,
+fl2 int
+) engine=myisam;
+insert into name(nm) select seq from seq_1_to_10000 order by rand(17);
+insert into flag2(fl2) select seq mod 10 from seq_1_to_10000 order by rand(19);
+insert into t1(nm,fl2)
+select nm, fl2 from name, flag2 where name.pk = flag2.pk;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
+select * from t1
+where
+(
+nm like '3400%' or nm like '3402%' or nm like '3403%' or
+nm like '3404%' or nm like '3405%' or nm like '3406%' or nm like '3407%' or
+nm like '3409%' or
+nm like '3411%' or nm like '3412%' or nm like '3413%' or
+nm like '3414%' or nm like '3415%' or nm like '3416%' or nm like '3417%' or
+nm like '3418%' or nm like '3419%' or
+nm like '3421%' or nm like '3422%' or nm like '3423%' or
+nm like '3424%' or nm like '3425%' or nm like '3426%' or nm like '3427%' or
+nm like '3428%' or nm like '3429%' or
+nm like '3430%' or nm like '3431%' or nm like '3432%' or nm like '3433%' or
+nm like '3434%' or nm like '3435%' or nm like '3436%' or nm like '3437%' or
+nm like '3439%' or
+nm like '3440%' or nm like '3441%' or nm like '3442%' or nm like '3443%' or
+nm like '3444%' or nm like '3445%' or nm like '3446%' or nm like '3447%' or
+nm like '3448%'
+) and fl2 = 0;
+pk nm fl1 fl2
+analyze format=json select * from t1
+where
+(
+nm like '3400%' or nm like '3402%' or nm like '3403%' or
+nm like '3404%' or nm like '3405%' or nm like '3406%' or nm like '3407%' or
+nm like '3409%' or
+nm like '3411%' or nm like '3412%' or nm like '3413%' or
+nm like '3414%' or nm like '3415%' or nm like '3416%' or nm like '3417%' or
+nm like '3418%' or nm like '3419%' or
+nm like '3421%' or nm like '3422%' or nm like '3423%' or
+nm like '3424%' or nm like '3425%' or nm like '3426%' or nm like '3427%' or
+nm like '3428%' or nm like '3429%' or
+nm like '3430%' or nm like '3431%' or nm like '3432%' or nm like '3433%' or
+nm like '3434%' or nm like '3435%' or nm like '3436%' or nm like '3437%' or
+nm like '3439%' or
+nm like '3440%' or nm like '3441%' or nm like '3442%' or nm like '3443%' or
+nm like '3444%' or nm like '3445%' or nm like '3446%' or nm like '3447%' or
+nm like '3448%'
+) and fl2 = 0;
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "range",
+ "possible_keys": ["idx1", "idx2"],
+ "key": "idx1",
+ "key_length": "256",
+ "used_key_parts": ["nm"],
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 44,
+ "r_rows": 44,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 8.630000114,
+ "r_filtered": 0,
+ "index_condition": "t1.nm like '3400%' or t1.nm like '3402%' or t1.nm like '3403%' or t1.nm like '3404%' or t1.nm like '3405%' or t1.nm like '3406%' or t1.nm like '3407%' or t1.nm like '3409%' or t1.nm like '3411%' or t1.nm like '3412%' or t1.nm like '3413%' or t1.nm like '3414%' or t1.nm like '3415%' or t1.nm like '3416%' or t1.nm like '3417%' or t1.nm like '3418%' or t1.nm like '3419%' or t1.nm like '3421%' or t1.nm like '3422%' or t1.nm like '3423%' or t1.nm like '3424%' or t1.nm like '3425%' or t1.nm like '3426%' or t1.nm like '3427%' or t1.nm like '3428%' or t1.nm like '3429%' or t1.nm like '3430%' or t1.nm like '3431%' or t1.nm like '3432%' or t1.nm like '3433%' or t1.nm like '3434%' or t1.nm like '3435%' or t1.nm like '3436%' or t1.nm like '3437%' or t1.nm like '3439%' or t1.nm like '3440%' or t1.nm like '3441%' or t1.nm like '3442%' or t1.nm like '3443%' or t1.nm like '3444%' or t1.nm like '3445%' or t1.nm like '3446%' or t1.nm like '3447%' or t1.nm like '3448%'",
+ "attached_condition": "t1.fl2 = 0"
+ }
+ }
+ ]
+ }
+}
+create table t0 select * from t1 where nm like '34%';
+delete from t1 using t1,t0 where t1.nm=t0.nm;
+analyze format=json select * from t1
+where
+(
+nm like '3400%' or nm like '3402%' or nm like '3403%' or
+nm like '3404%' or nm like '3405%' or nm like '3406%' or nm like '3407%' or
+nm like '3409%' or
+nm like '3411%' or nm like '3412%' or nm like '3413%' or
+nm like '3414%' or nm like '3415%' or nm like '3416%' or nm like '3417%' or
+nm like '3418%' or nm like '3419%' or
+nm like '3421%' or nm like '3422%' or nm like '3423%' or
+nm like '3424%' or nm like '3425%' or nm like '3426%' or nm like '3427%' or
+nm like '3428%' or nm like '3429%' or
+nm like '3430%' or nm like '3431%' or nm like '3432%' or nm like '3433%' or
+nm like '3434%' or nm like '3435%' or nm like '3436%' or nm like '3437%' or
+nm like '3439%' or
+nm like '3440%' or nm like '3441%' or nm like '3442%' or nm like '3443%' or
+nm like '3444%' or nm like '3445%' or nm like '3446%' or nm like '3447%' or
+nm like '3448%'
+) and fl2 = 0;
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "select_id": 1,
+ "cost": "REPLACED",
+ "r_loops": 1,
+ "r_total_time_ms": "REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "range",
+ "possible_keys": ["idx1", "idx2"],
+ "key": "idx1",
+ "key_length": "256",
+ "used_key_parts": ["nm"],
+ "loops": 1,
+ "r_loops": 1,
+ "rows": 44,
+ "r_rows": 0,
+ "cost": "REPLACED",
+ "r_table_time_ms": "REPLACED",
+ "r_other_time_ms": "REPLACED",
+ "r_engine_stats": REPLACED,
+ "filtered": 8.529999733,
+ "r_filtered": 100,
+ "index_condition": "t1.nm like '3400%' or t1.nm like '3402%' or t1.nm like '3403%' or t1.nm like '3404%' or t1.nm like '3405%' or t1.nm like '3406%' or t1.nm like '3407%' or t1.nm like '3409%' or t1.nm like '3411%' or t1.nm like '3412%' or t1.nm like '3413%' or t1.nm like '3414%' or t1.nm like '3415%' or t1.nm like '3416%' or t1.nm like '3417%' or t1.nm like '3418%' or t1.nm like '3419%' or t1.nm like '3421%' or t1.nm like '3422%' or t1.nm like '3423%' or t1.nm like '3424%' or t1.nm like '3425%' or t1.nm like '3426%' or t1.nm like '3427%' or t1.nm like '3428%' or t1.nm like '3429%' or t1.nm like '3430%' or t1.nm like '3431%' or t1.nm like '3432%' or t1.nm like '3433%' or t1.nm like '3434%' or t1.nm like '3435%' or t1.nm like '3436%' or t1.nm like '3437%' or t1.nm like '3439%' or t1.nm like '3440%' or t1.nm like '3441%' or t1.nm like '3442%' or t1.nm like '3443%' or t1.nm like '3444%' or t1.nm like '3445%' or t1.nm like '3446%' or t1.nm like '3447%' or t1.nm like '3448%'",
+ "attached_condition": "t1.fl2 = 0"
+ }
+ }
+ ]
+ }
+}
+drop table t0;
+set optimizer_switch='rowid_filter=default';
+drop table name, flag2;
+drop table t1;
+#
+# MDEV-30944 Range_rowid_filter::fill() leaves file->keyread at MAX_KEY
+#
+CREATE TABLE t1 ( a varchar(30) , i int , id int, UNIQUE KEY id (id), KEY (i ,id ,a), KEY (a(1),i)) engine=myisam;
+INSERT INTO t1 VALUES('fej',NULL,1),('jeyw',8,2),(NULL,181,3),('wrkovd',9,4),('',NULL,5),('ko',NULL,6),('vdgzyxkop',217,7),('',7,8),('zy',0,9),('yxkopv',8,10),('kopv',1,11),('opv',4,12),('vc',9,13),('ri',1,14),('tkcn',1,15),('cnm',6,16),('m',0,17),('d',9,18),('e',28,19),(NULL,0,20);
+explain SELECT i, MAX( id ) FROM t1 WHERE ( a IS NULL OR a IN ('o','h') ) AND ( id BETWEEN 6 AND 7 OR id IN ( 8, 1) ) GROUP BY i;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index id,a i 43 NULL 20 Using where; Using index
+SELECT i, MAX( id ) FROM t1 WHERE ( a IS NULL OR a IN ('o','h') ) AND ( id BETWEEN 6 AND 7 OR id IN ( 8, 1) ) GROUP BY i;
+i MAX( id )
+drop table t1;
+#
+# End of 11.0 tests
+#
diff --git a/mysql-test/main/rowid_filter_myisam.test b/mysql-test/main/rowid_filter_myisam.test
index 3ea4dc26..064c8964 100644
--- a/mysql-test/main/rowid_filter_myisam.test
+++ b/mysql-test/main/rowid_filter_myisam.test
@@ -1,3 +1,5 @@
+SET optimizer_switch='rowid_filter=on';
+
--echo #
--echo # MDEV-22553: Assertion `info->lastpos == (~ (my_off_t) 0)' failed in mi_rkey with rowid_filer=on
--echo #
@@ -1623,3 +1625,420 @@ ALTER TABLE t1 ENABLE KEYS;
--echo # Must not crash:
SELECT * FROM t1 WHERE ( a BETWEEN 255 AND 270 OR f = 200 ) AND f IN ( 1, 4, 112, 143 ) AND d IN ('Montana', 'South Dakota');
DROP TABLE t1;
+
+
+
+use test;
+
+--echo #
+--echo # MDEV-18816: potential range filter for one join table with
+--echo # impossible WHERE for another
+--echo #
+
+create table t1 (
+ pk int not null primary key, c2 varchar(10) , i1 int,key (c2)
+) engine=myisam;
+insert into t1 values (1,'a',-5),(2,'a',null);
+
+create table t2 (
+ pk int, i1 int, c1 varchar(30) , key c1 (c1(30)), key i1 (i1)
+) engine=myisam;
+insert into t2 values
+ (1,-5,'a'),(2,null,'a'),(3,null,'a'),(4,null,'a'),(5,5,'a'),(6,null,'a'),
+ (7,4,'a'),(8,55,'a'),(9,null,'a'),(10,null,'a'),(11,null,'a'),(12,-5,'a'),
+ (13,-5,'a'),(14,null,'a'),(15,null,'a'),(16,-5,'a'),(17,-5,'a');
+
+let $q=
+select 1
+ from t1
+ left join
+ t2 join t1 as t1_a on t2.i1 = t1_a.pk
+ on t1.c2 = t2.c1
+where t1_a.pk is null and t1_a.i1 != 3;
+
+eval $q;
+eval explain extended $q;
+
+drop table t1,t2;
+
+--echo #
+--echo # MDEV-18640: TABLE::prune_range_rowid_filters: Conditional jump or
+--echo # move depends on uninitialized value
+--echo #
+
+CREATE TABLE t1 (
+ pk INT, i INT, PRIMARY KEY (pk), KEY (pk,i)
+) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,10), (7,70), (2,20);
+
+SELECT * FROM t1 WHERE pk < 5;
+
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-18956: Possible rowid filter for subquery for which
+--echo # in_to_exists strategy has been chosen
+--echo #
+
+CREATE TABLE t1 (pk int) engine=myisam ;
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE TABLE t2 (
+ pk int auto_increment PRIMARY KEY,
+ i1 int, i2 int, c2 varchar(1),
+ KEY (i1), KEY (i2)
+) engine=myisam;
+
+INSERT INTO t2 VALUES
+ (1,8,6,'t'),(2,5,7,'i'),(3,4,4,'h'),(4,207,38,'d'),(5,183,206,'b'),
+ (6,7,null,'o'),(7,1,2,'j'),(8,17,36,'s'),(9,4,5,'q'),(10,0,6,'l'),
+ (11,1,9,'j'),(12,5,6,'y'),(13,null,0,'i'),(14,7,7,'x'),(15,5,2,'u');
+
+SELECT * FROM t1 HAVING (7, 9) IN (SELECT t2.i1, t2.i2 FROM t2 WHERE t2.i1 = 3);
+EXPLAIN EXTENDED
+SELECT * FROM t1 HAVING (7, 9) IN (SELECT t2.i1, t2.i2 FROM t2 WHERE t2.i1 = 3);
+
+DROP TABLE t1,t2;
+
+--echo #
+--echo # MDEV-19255: rowid range filter built for range condition
+--echo # that uses in expensive subquery
+--echo #
+
+CREATE TABLE t1 (
+ pk1 INT PRIMARY KEY, a1 INT, b1 VARCHAR(1), KEY(b1)
+) ENGINE=MyISAM;
+INSERT INTO t1 VALUES
+(10,0,'z'),(11,3,'j'),(12,8,'f'),(13,8,'p'),(14,6,'w'),(15,0,'c'),(16,1,'j'),
+(17,1,'f'),(18,5,'v'),(19,3,'f'),(20,2,'q'),(21,8,'y'),(22,0,'a'),(23,9,'w'),
+(24,3,'e'),(25,1,'b'),(26,9,'r'),(27,2,'k'),(28,5,'c'),(29,3,'k'),(30,9,'b'),
+(31,8,'j'),(32,1,'t'),(33,8,'n'),(34,3,'z'),(35,0,'u'),(36,3,'a'),(37,3,'g'),
+(38,1,'f'),(39,6,'p'),(40,6,'m'),(41,6,'t'),(42,7,'i'),(43,4,'h'),(44,3,'d'),
+(45,2,'b'),(46,1,'o'),(47,2,'j'),(48,6,'s'),(49,5,'q'),(50,6,'l'),(51,9,'j'),
+(52,6,'y'),(53,0,'i'),(54,7,'x'),(55,2,'u'),(56,6,'t'),(57,4,'b'),(58,5,'m'),
+(59,4,'x'),(60,8,'x'),(61,6,'v'),(62,8,'m'),(63,4,'j'),(64,8,'z'),(65,2,'a'),
+(66,9,'i'),(67,4,'g'),(68,8,'h'),(69,1,'p'),(70,8,'a'),(71,0,'x'),(72,2,'s'),
+(73,6,'k'),(74,0,'m'),(75,6,'e'),(76,9,'y'),(77,7,'d'),(78,7,'w'),(79,6,'y'),
+(80,9,'s'),(81,9,'x'),(82,6,'l'),(83,9,'f'),(84,8,'x'),(85,1,'p'),(86,7,'y'),
+(87,6,'p'),(88,1,'g'),(89,3,'c'),(90,5,'h'),(91,3,'p'),(92,2,'b'),(93,1,NULL),
+(94,3,NULL),(95,2,'y'),(96,7,'s'),(97,7,'x'),(98,6,'i'),(99,9,'t'),(100,5,'j'),
+(101,0,'u'),(102,7,'r'),(103,2,'x'),(104,8,'e'),(105,8,'i'),(106,5,'q'),
+(107,8,'z'),(108,3,'k'),(109,65,NULL);
+
+CREATE TABLE t2 (pk2 INT PRIMARY KEY, a2 INT, b2 VARCHAR(1)) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1,1,'x');
+INSERT INTO t2 SELECT * FROM t1;
+
+let $q=
+SELECT * FROM t1 INNER JOIN t2 ON ( pk1 <> pk2 AND pk1 = a2 )
+ WHERE b1 <= ( SELECT MAX(b2) FROM t2 WHERE pk2 <= 1 );
+
+eval $q;
+eval EXPLAIN EXTENDED $q;
+--source include/explain-no-costs.inc
+eval EXPLAIN FORMAT=JSON $q;
+
+DROP TABLE t1,t2;
+
+--echo #
+--echo # MDEV-21794: Optimizer flag rowid_filter leads to long query
+--echo #
+create table t10(a int);
+insert into t10 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t11(a int);
+insert into t11 select A.a + B.a* 10 + C.a * 100 from t10 A, t10 B, t10 C;
+
+CREATE TABLE t1 (
+ el_id int(10) unsigned NOT NULL ,
+ el_index blob NOT NULL,
+ el_index_60 varbinary(60) NOT NULL,
+ filler blob,
+
+ PRIMARY KEY (el_id),
+ KEY el_index (el_index(60)),
+ KEY el_index_60 (el_index_60,el_id)
+);
+
+insert into t1
+select
+ A.a+1000*B.a,
+ A.a+1000*B.a + 10000,
+ A.a+1000*B.a + 10000,
+ 'filler-data-filler-data'
+from
+ t11 A, t10 B;
+analyze table t1 persistent for all;
+
+--echo # This must not use rowid_filter with key=el_index|el_index_60:
+explain
+select * from t1
+where el_index like '10%' and (el_index_60 like '10%' or el_index_60 like '20%');
+
+drop table t10, t11, t1;
+
+
+--echo #
+--echo # MDEV-22160: SIGSEGV in st_join_table::save_explain_data on SELECT
+--echo #
+
+set @save_optimizer_switch= @@optimizer_switch;
+SET @@optimizer_switch="index_merge_sort_union=OFF";
+CREATE TABLE t1 (a INT, b INT, INDEX(a), INDEX(b));
+INSERT INTO t1 VALUES (0,0),(0,0),(1,0),(-1,1), (-2,1), (-2,3), (-3,4), (-2,4),(3,3),(3,4),(3,5),(8,8),(8,9),(1,0),(2,0),(0,0),(0,0);
+explain
+SELECT * FROM t1 WHERE a > 0 AND b=0;
+SELECT * FROM t1 WHERE a > 0 AND b=0;
+drop table t1;
+SET @@optimizer_switch=@save_optimizer_switch;
+
+--echo #
+--echo # MDEV-21633
+--echo # Assertion `tmp >= 0' failed in best_access_path with rowid_filter=ON
+--echo #
+
+set @save_optimizer_switch= @@optimizer_switch;
+SET optimizer_switch='rowid_filter=on';
+
+CREATE TABLE t1 (
+ pk INT AUTO_INCREMENT,
+ a INT,
+ b VARCHAR(8),
+ KEY(a),
+ PRIMARY KEY(pk),
+ KEY (a,pk)
+) ENGINE=MyISAM;
+
+INSERT INTO t1 (a,b) VALUES
+ (NULL,'d'),(9,'b'),(2,'x'),(5,'k'),(NULL,'d'),(3,'s'),(5,'k'),(1,'r'),
+ (8,'l'),(3,'z'),(1,'c'),(1,'q'),(NULL,'x'),(NULL,'p'),(NULL,'z'),(7,'a'),
+ (0,'i'),(3,'s'),(NULL,'h'),(4,'p'),(1,'i'),(4,'f'),(1,'c'),(NULL,'a'),
+ (NULL,'x'),(1,'b'),(NULL,'n'),(NULL,'h'),(5,'i'),(6,'e'),(NULL,'i'),
+ (7,'e'),(1,'r'),(NULL,'z'),(1,'i'),(14,'c'),(6,'u'),(3,'b'),(4,'z'),
+ (2,'c'),(70,'d'),(NULL,'p'),(21,'j'),(6,'e'),(5,'c'),(13,'i'),(42,'d'),
+ (80,'s'),(14,'t'),(9,'a'),(0,'2'),(0,NULL),(0,NULL),(0,NULL),(0,''),
+ (0,''),(0,'1'),(0,''),(0,''),(0,''),(0,''),(0,NULL),(0,''),(0,''),(0,''),
+ (0,NULL),(0,''),(0,''),(0,''),(0,''),(0,''),(0,''),(0,NULL),(0,NULL),
+ (0,NULL),(0,''),(0,''),(0,''),(0,''),(0,NULL),(0,''),(0,NULL),(0,NULL),
+ (0,''),(0,''),(0,''),(0,NULL),(0,''),(0,NULL),(0,''),(0,''),(0,''),(0,''),
+ (0,''),(0,''),(0,''),(0,NULL),(0,''),(0,NULL),(0,'');
+
+CREATE TABLE t2 (c INT) ENGINE=MyISAM;
+INSERT INTO t2 VALUES (1),(2),(3),(4),(5),(6);
+
+SELECT * FROM t1 JOIN t2 WHERE a = c AND pk BETWEEN 4 AND 7 AND a BETWEEN 2 AND 12 AND b != 'foo';
+
+explain SELECT * FROM t1 JOIN t2 WHERE a = c AND pk BETWEEN 4 AND 7 AND a BETWEEN 2 AND 12 AND b != 'foo';
+
+SET optimizer_switch='rowid_filter=off';
+
+SELECT * FROM t1 JOIN t2 WHERE a = c AND pk BETWEEN 4 AND 7 AND a BETWEEN 2 AND 12 AND b != 'foo';
+
+SET @@optimizer_switch=@save_optimizer_switch;
+
+# Cleanup
+DROP TABLE t1, t2;
+
+--echo #
+--echo # MDEV-28846: Poor performance when rowid filter contains no elements
+--echo #
+
+--source include/have_sequence.inc
+
+create table t1 (
+ pk int primary key auto_increment,
+ nm varchar(32),
+ fl1 tinyint default 0,
+ fl2 tinyint default 0,
+ index idx1(nm, fl1),
+ index idx2(fl2)
+) engine=myisam;
+
+create table name (
+ pk int primary key auto_increment,
+ nm bigint
+) engine=myisam;
+
+create table flag2 (
+ pk int primary key auto_increment,
+ fl2 tinyint
+) engine=myisam;
+
+insert into name(nm) select seq from seq_1_to_1000 order by rand(17);
+insert into flag2(fl2) select seq mod 2 from seq_1_to_1000 order by rand(19);
+
+insert into t1(nm,fl2)
+ select nm, fl2 from name, flag2 where name.pk = flag2.pk;
+
+analyze table t1 persistent for all;
+
+let $a=
+`select concat((select nm from t1 where fl2=0 order by RAND(13) limit 1),'%')`;
+eval select '$a' as a;
+
+set optimizer_switch='rowid_filter=on';
+eval
+explain
+select * from t1 where nm like '$a' AND fl2 = 0;
+--source include/analyze-format.inc
+eval
+analyze format=json
+select * from t1 where nm like '$a' AND fl2 = 0;
+eval
+select * from t1 where nm like '$a' AND fl2 = 0;
+
+truncate table name;
+truncate table flag2;
+truncate table t1;
+
+insert into name(nm) select seq from seq_1_to_1000 order by rand(17);
+insert into flag2(fl2) select seq mod 2 from seq_1_to_1000 order by rand(19);
+
+insert into t1(nm,fl2)
+ select nm, fl2 from name, flag2 where name.pk = flag2.pk;
+
+analyze table t1 persistent for all;
+
+set optimizer_switch='rowid_filter=off';
+eval
+explain
+select * from t1 where nm like '$a' AND fl2 = 0;
+--source include/analyze-format.inc
+eval
+analyze format=json
+select * from t1 where nm like '$a' AND fl2 = 0;
+eval
+select * from t1 where nm like '$a' AND fl2 = 0;
+
+truncate table name;
+truncate table flag2;
+truncate table t1;
+
+insert into name(nm) select seq from seq_1_to_1000 order by rand(17);
+insert into flag2(fl2) select seq mod 10 from seq_1_to_1000 order by rand(19);
+
+insert into t1(nm,fl2)
+ select nm, fl2 from name, flag2 where name.pk = flag2.pk;
+
+analyze table t1 persistent for all;
+
+let $a=
+`select concat((select nm from t1 where fl2=0 order by RAND(13) limit 1),'%')`;
+eval select '$a' as a;
+
+set optimizer_switch='rowid_filter=on';
+eval
+explain
+select * from t1 where nm like '$a' AND fl2 = 0;
+eval
+select * from t1 where nm like '$a' AND fl2 = 0;
+
+truncate table name;
+truncate table flag2;
+truncate table t1;
+
+insert into name(nm) select seq from seq_1_to_10000 order by rand(17);
+insert into flag2(fl2) select seq mod 100 from seq_1_to_10000 order by rand(19);
+
+insert into t1(nm,fl2)
+ select nm, fl2 from name, flag2 where name.pk = flag2.pk;
+
+analyze table t1 persistent for all;
+
+let $a=
+`select concat(left((select nm from t1 where fl2=0 order by RAND(13) limit 1),2),'%')`;
+eval select '$a' as a;
+
+set optimizer_switch='rowid_filter=on';
+eval
+explain
+select * from t1 where nm like '$a' AND fl2 = 0;
+--source include/analyze-format.inc
+eval
+analyze format=json
+select * from t1 where nm like '$a' AND fl2 = 0;
+eval
+select * from t1 where nm like '$a' AND fl2 = 0;
+
+drop table name, flag2;
+drop table t1;
+
+# This test shows that if the container is empty there are no lookups into it
+
+create table t1 (
+ pk int primary key auto_increment,
+ nm char(255),
+ fl1 tinyint default 0,
+ fl2 int default 0,
+ index idx1(nm, fl1),
+ index idx2(fl2)
+) engine=myisam;
+
+create table name (
+ pk int primary key auto_increment,
+ nm bigint
+) engine=myisam;
+
+create table flag2 (
+ pk int primary key auto_increment,
+ fl2 int
+) engine=myisam;
+
+insert into name(nm) select seq from seq_1_to_10000 order by rand(17);
+insert into flag2(fl2) select seq mod 10 from seq_1_to_10000 order by rand(19);
+
+insert into t1(nm,fl2)
+ select nm, fl2 from name, flag2 where name.pk = flag2.pk;
+
+analyze table t1 persistent for all;
+
+let $q=
+select * from t1
+where
+(
+ nm like '3400%' or nm like '3402%' or nm like '3403%' or
+ nm like '3404%' or nm like '3405%' or nm like '3406%' or nm like '3407%' or
+ nm like '3409%' or
+ nm like '3411%' or nm like '3412%' or nm like '3413%' or
+ nm like '3414%' or nm like '3415%' or nm like '3416%' or nm like '3417%' or
+ nm like '3418%' or nm like '3419%' or
+ nm like '3421%' or nm like '3422%' or nm like '3423%' or
+ nm like '3424%' or nm like '3425%' or nm like '3426%' or nm like '3427%' or
+ nm like '3428%' or nm like '3429%' or
+ nm like '3430%' or nm like '3431%' or nm like '3432%' or nm like '3433%' or
+ nm like '3434%' or nm like '3435%' or nm like '3436%' or nm like '3437%' or
+ nm like '3439%' or
+ nm like '3440%' or nm like '3441%' or nm like '3442%' or nm like '3443%' or
+ nm like '3444%' or nm like '3445%' or nm like '3446%' or nm like '3447%' or
+ nm like '3448%'
+) and fl2 = 0;
+
+eval $q;
+--source include/analyze-format.inc
+eval analyze format=json $q;
+
+create table t0 select * from t1 where nm like '34%';
+delete from t1 using t1,t0 where t1.nm=t0.nm;
+--source include/analyze-format.inc
+eval analyze format=json $q;
+
+drop table t0;
+
+set optimizer_switch='rowid_filter=default';
+
+drop table name, flag2;
+drop table t1;
+
+--echo #
+--echo # MDEV-30944 Range_rowid_filter::fill() leaves file->keyread at MAX_KEY
+--echo #
+
+CREATE TABLE t1 ( a varchar(30) , i int , id int, UNIQUE KEY id (id), KEY (i ,id ,a), KEY (a(1),i)) engine=myisam;
+INSERT INTO t1 VALUES('fej',NULL,1),('jeyw',8,2),(NULL,181,3),('wrkovd',9,4),('',NULL,5),('ko',NULL,6),('vdgzyxkop',217,7),('',7,8),('zy',0,9),('yxkopv',8,10),('kopv',1,11),('opv',4,12),('vc',9,13),('ri',1,14),('tkcn',1,15),('cnm',6,16),('m',0,17),('d',9,18),('e',28,19),(NULL,0,20);
+explain SELECT i, MAX( id ) FROM t1 WHERE ( a IS NULL OR a IN ('o','h') ) AND ( id BETWEEN 6 AND 7 OR id IN ( 8, 1) ) GROUP BY i;
+SELECT i, MAX( id ) FROM t1 WHERE ( a IS NULL OR a IN ('o','h') ) AND ( id BETWEEN 6 AND 7 OR id IN ( 8, 1) ) GROUP BY i;
+drop table t1;
+
+--echo #
+--echo # End of 11.0 tests
+--echo #
diff --git a/mysql-test/main/rowid_filter_myisam_debug.result b/mysql-test/main/rowid_filter_myisam_debug.result
index 75a8fad6..263a8e99 100644
--- a/mysql-test/main/rowid_filter_myisam_debug.result
+++ b/mysql-test/main/rowid_filter_myisam_debug.result
@@ -2,7 +2,7 @@
# MDEV-22761 KILL QUERY during rowid_filter, crashes
#
create table t2(a int);
-insert into t2 select * from seq_0_to_99;
+insert into t2 select seq from seq_1_to_100;
CREATE TABLE t3 (
key1 int ,
key2 int,
@@ -10,16 +10,11 @@ filler varchar(255),
KEY (key1),
KEY (key2)
);
+insert into t3 select seq,seq, 'filler-data-filler-data' from seq_1_to_2000;
select engine from information_schema.tables
where table_schema=database() and table_name='t3';
engine
MyISAM
-insert into t3
-select
-A.seq,
-B.seq,
-'filler-data-filler-data'
-from seq_0_to_99 A, seq_0_to_99 B;
analyze table t2,t3;
Table Op Msg_type Msg_text
test.t2 analyze status Engine-independent statistics collected
@@ -27,16 +22,16 @@ test.t2 analyze status OK
test.t3 analyze status Engine-independent statistics collected
test.t3 analyze status Table is already up to date
explain
-select * from t2, t3
+select straight_join * from t2, t3
where
-t3.key1=t2.a and t3.key2 in (2,3);
+t3.key1=t2.a and t3.key2 between 2 and 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 100 Using where
-1 SIMPLE t3 ref|filter key1,key2 key1|key2 5|5 test.t2.a 100 (2%) Using where; Using rowid filter
+1 SIMPLE t3 ref|filter key1,key2 key1|key2 5|5 test.t2.a 1 (0%) Using where; Using rowid filter
set debug_sync='handler_rowid_filter_check SIGNAL at_rowid_filter_check WAIT_FOR go';
-select * from t2, t3
+select straight_join * from t2, t3
where
-t3.key1=t2.a and t3.key2 in (2,3);
+t3.key1=t2.a and t3.key2 between 2 and 10;
connect con1, localhost, root,,;
set debug_sync='now WAIT_FOR at_rowid_filter_check';
kill query $target_id;
diff --git a/mysql-test/main/rpl_mysql_upgrade_slave_repo_check.test b/mysql-test/main/rpl_mysql_upgrade_slave_repo_check.test
index 24b5f029..f91cbaa3 100644
--- a/mysql-test/main/rpl_mysql_upgrade_slave_repo_check.test
+++ b/mysql-test/main/rpl_mysql_upgrade_slave_repo_check.test
@@ -96,7 +96,7 @@ EOF
--connection master
let $datadir= `select @@datadir`;
-remove_file $datadir/mysql_upgrade_info;
+remove_file $datadir/mariadb_upgrade_info;
TRUNCATE TABLE `mysql`.`slave_master_info`;
TRUNCATE TABLE `mysql`.`slave_relay_log_info`;
--remove_file $MYSQLTEST_VARDIR/log/mysql_upgrade_master.log
@@ -117,7 +117,7 @@ TRUNCATE TABLE `mysql`.`slave_relay_log_info`;
--echo "====== Clean up ======"
--connection master
let $datadir= `select @@datadir`;
-remove_file $datadir/mysql_upgrade_info;
+remove_file $datadir/mariadb_upgrade_info;
DROP TABLE `mysql`.`slave_master_info`, `mysql`.`slave_relay_log_info`;
--remove_file $MYSQLTEST_VARDIR/tmp/slave_table_repo_init.sql
diff --git a/mysql-test/main/rpl_mysqldump_slave.result b/mysql-test/main/rpl_mysqldump_slave.result
index 8d6f0994..6d424ade 100644
--- a/mysql-test/main/rpl_mysqldump_slave.result
+++ b/mysql-test/main/rpl_mysqldump_slave.result
@@ -129,7 +129,7 @@ CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
-- Preferably use GTID to start replication from GTID position:
@@ -165,7 +165,7 @@ CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
-- Dump completed
@@ -185,7 +185,7 @@ CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
-- Preferably use GTID to start replication from GTID position:
@@ -216,7 +216,7 @@ CHANGE MASTER TO MASTER_LOG_FILE='slave-bin.000001', MASTER_LOG_POS=BINLOG_START
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
-- Dump completed
connection master;
diff --git a/mysql-test/main/sargable_casefold.result b/mysql-test/main/sargable_casefold.result
new file mode 100644
index 00000000..d9488b98
--- /dev/null
+++ b/mysql-test/main/sargable_casefold.result
@@ -0,0 +1,278 @@
+set
+@tmp_switch_sarg_casefold=@@optimizer_switch,
+optimizer_switch='sargable_casefold=on';
+create table t1 (
+col1 varchar(32),
+col2 varchar(32),
+col3 char(32),
+col4 text,
+key(col1),
+key(col2),
+key(col3),
+key(col4(32))
+) collate utf8mb3_general_ci;
+insert into t1
+select
+concat('A-', seq),
+concat('A-', seq),
+concat('A-', seq),
+concat('A-', seq)
+from seq_1_to_100;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze Warning Engine-independent statistics are not collected for column 'col4'
+test.t1 analyze status Table is already up to date
+# Basic examples. All should use ref(col1):
+explain
+select * from t1 where upper(col1)='A-3';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref col1 col1 99 const 1 Using index condition
+select * from t1 where upper(col1)='A-3';
+col1 col2 col3 col4
+A-3 A-3 A-3 A-3
+explain
+select * from t1 where ucase(col1)='a-3';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref col1 col1 99 const 1 Using index condition
+select * from t1 where ucase(col1)='a-3';
+col1 col2 col3 col4
+A-3 A-3 A-3 A-3
+explain select * from t1 where 'abc'=upper(col1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref col1 col1 99 const 1 Using index condition
+explain select * from t1 where 'xyz'=ucase(col1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref col1 col1 99 const 1 Using index condition
+create view v1 as select * from t1;
+explain select * from v1 where 'abc'=upper(col1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref col1 col1 99 const 1 Using index condition
+drop view v1;
+explain select * from t1 where upper(col3)='a-3';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref col3 col3 97 const 1 Using index condition
+explain select * from t1 where upper(col4)='a-3';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref col4 col4 99 const 1 Using where
+# must not be rewritten:
+explain select * from t1 where ucase(col1 collate utf8mb3_bin)='a-3';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where
+# Will not do the rewrite due to collation mismatch:
+explain select * from t1 where ucase(col1)=_utf8mb3'abc' COLLATE utf8mb3_bin;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where
+drop table t1;
+create table t1 (
+col1 varchar(32),
+col2 varchar(32),
+col3 char(32),
+col4 text,
+key(col1),
+key(col2),
+key(col3),
+key(col4(32))
+) collate utf8mb4_general_ci;
+insert into t1
+select
+concat('A-', seq),
+concat('A-', seq),
+concat('A-', seq),
+concat('A-', seq)
+from seq_1_to_100;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze Warning Engine-independent statistics are not collected for column 'col4'
+test.t1 analyze status Table is already up to date
+# Basic examples. All should use ref(col1):
+explain
+select * from t1 where upper(col1)='A-3';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref col1 col1 131 const 1 Using index condition
+select * from t1 where upper(col1)='A-3';
+col1 col2 col3 col4
+A-3 A-3 A-3 A-3
+explain
+select * from t1 where ucase(col1)='a-3';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref col1 col1 131 const 1 Using index condition
+select * from t1 where ucase(col1)='a-3';
+col1 col2 col3 col4
+A-3 A-3 A-3 A-3
+explain select * from t1 where 'abc'=upper(col1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref col1 col1 131 const 1 Using index condition
+explain select * from t1 where 'xyz'=ucase(col1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref col1 col1 131 const 1 Using index condition
+create view v1 as select * from t1;
+explain select * from v1 where 'abc'=upper(col1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref col1 col1 131 const 1 Using index condition
+drop view v1;
+explain select * from t1 where upper(col3)='a-3';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref col3 col3 129 const 1 Using index condition
+explain select * from t1 where upper(col4)='a-3';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref col4 col4 131 const 1 Using where
+# must not be rewritten:
+explain select * from t1 where ucase(col1 collate utf8mb4_bin)='a-3';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where
+# Will not do the rewrite due to collation mismatch:
+explain select * from t1 where ucase(col1)=_utf8mb4'abc' COLLATE utf8mb4_bin;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where
+#
+# Check if optimizer_switch turns the rewrite off:
+#
+set
+@save_os=@@optimizer_switch,
+optimizer_switch='sargable_casefold=off';
+explain select * from t1 where upper(col1)='A-3';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where
+explain select * from t1 where ucase(col1)='a-3';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where
+set optimizer_switch=@save_os;
+# The following will not do the rewrite because the comparison
+# is done as DOUBLEs. Come to think of it, it won't harm to do
+# the rewrite but it is outside of the scope of this patch:
+explain select * from t1 where ucase(col1)=123.456;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where
+select
+coercibility(upper(col1))
+from t1 limit 1;
+coercibility(upper(col1))
+2
+select coercibility(_utf8mb3'abc' COLLATE utf8mb3_bin);
+coercibility(_utf8mb3'abc' COLLATE utf8mb3_bin)
+0
+# This is transformed too even if it doesn't create any new
+# [potential] access paths:
+explain format=json select * from t1 where upper(col1)=upper(col2);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.0256761,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 100,
+ "cost": 0.0256761,
+ "filtered": 100,
+ "attached_condition": "t1.col2 = t1.col1"
+ }
+ }
+ ]
+ }
+}
+#
+# Check if ref access works
+#
+create table t2 (
+a varchar(32),
+non_key varchar(32),
+key(a)
+) collate utf8mb4_general_ci;
+insert into t2
+select
+concat('A-', seq),
+concat('A-', seq)
+from seq_1_to_10;
+# Must use ref access for t1:
+explain select * from t1, t2 where upper(t1.col1)= t2.non_key;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 10 Using where
+1 SIMPLE t1 ref col1 col1 131 test.t2.non_key 1
+create table t3 (
+a varchar(32),
+b varchar(32),
+key(a),
+key(b)
+) collate utf8mb3_general_ci;
+insert into t3 values ('abc','ABC'), ('xyz','XYZ');
+explain extended
+select a from t3 ignore index(a) where a=b and upper(b)='ABC';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t3 ref b b 99 const 1 100.00 Using index condition; Using where
+Warnings:
+Note 1003 select `test`.`t3`.`a` AS `a` from `test`.`t3` IGNORE INDEX (`a`) where `test`.`t3`.`a` = `test`.`t3`.`b` and `test`.`t3`.`b` = 'ABC'
+#
+# Check that rewrite isn't applied for non-applicable collations
+#
+create table t4 (
+col1 varchar(32) collate utf8mb3_bin,
+col2 varchar(32) collate utf8mb3_czech_ci,
+col3 varchar(32) collate latin1_bin,
+key(col1),
+key(col2),
+key(col3)
+);
+insert into t4
+select
+concat('A-', seq),
+concat('A-', seq),
+concat('A-', seq)
+from seq_1_to_100;
+analyze table t4 persistent for all;
+Table Op Msg_type Msg_text
+test.t4 analyze status Engine-independent statistics collected
+test.t4 analyze status Table is already up to date
+# None should use ref access:
+explain select * from t4 where upper(col1)='A-3';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL NULL NULL NULL NULL 100 Using where
+explain select * from t4 where upper(col2)='a-3';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL NULL NULL NULL NULL 100 Using where
+explain select * from t4 where upper(col3)='a-3';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL NULL NULL NULL NULL 100 Using where
+#
+# Check that rewrite works for UPPER(col) IN (const-list)
+#
+set
+@tmp_ot= @@optimizer_trace,
+optimizer_trace=1;
+# must use range:
+explain
+select * from t1 where upper(col1) IN ('A-3','A-4','a-5');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range col1 col1 131 NULL 3 Using index condition
+select * from t1 where upper(col1) IN ('A-3','A-4','a-5');
+col1 col2 col3 col4
+A-3 A-3 A-3 A-3
+A-4 A-4 A-4 A-4
+A-5 A-5 A-5 A-5
+# Will not use the rewrite:
+explain
+select * from t1 where upper(col1) IN ('A-3','A-4',col2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where
+#
+# MDEV-31946: Optimizer handle UCASE(varchar_col)=... does not work for UPDATE/DELETE
+#
+explain delete from t1 where upper(col1)='A';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range col1 col1 131 NULL 1 Using where
+explain delete from t1 where upper(col1) IN ('A','B');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range col1 col1 131 NULL 2 Using where
+explain update t1 set col2='ABC' where upper(col1)='A';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range col1 col1 131 NULL 1 Using where
+explain update t1 set col2='ABC' where upper(col1) IN ('A','B');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range col1 col1 131 NULL 2 Using where
+drop table t1,t2,t3,t4;
+set optimizer_switch=@tmp_switch_sarg_casefold;
diff --git a/mysql-test/main/sargable_casefold.test b/mysql-test/main/sargable_casefold.test
new file mode 100644
index 00000000..abb95d2b
--- /dev/null
+++ b/mysql-test/main/sargable_casefold.test
@@ -0,0 +1,141 @@
+#
+# MDEV-31496 Make optimizer handle UCASE(varchar_col)=...
+#
+--source include/have_sequence.inc
+
+set
+ @tmp_switch_sarg_casefold=@@optimizer_switch,
+ optimizer_switch='sargable_casefold=on';
+
+let $collation=utf8mb3_general_ci;
+source include/sargable_casefold.inc;
+
+--echo # must not be rewritten:
+explain select * from t1 where ucase(col1 collate utf8mb3_bin)='a-3';
+
+--echo # Will not do the rewrite due to collation mismatch:
+explain select * from t1 where ucase(col1)=_utf8mb3'abc' COLLATE utf8mb3_bin;
+drop table t1;
+
+let $collation=utf8mb4_general_ci;
+source include/sargable_casefold.inc;
+
+--echo # must not be rewritten:
+explain select * from t1 where ucase(col1 collate utf8mb4_bin)='a-3';
+
+--echo # Will not do the rewrite due to collation mismatch:
+explain select * from t1 where ucase(col1)=_utf8mb4'abc' COLLATE utf8mb4_bin;
+
+--echo #
+--echo # Check if optimizer_switch turns the rewrite off:
+--echo #
+
+set
+ @save_os=@@optimizer_switch,
+ optimizer_switch='sargable_casefold=off';
+explain select * from t1 where upper(col1)='A-3';
+explain select * from t1 where ucase(col1)='a-3';
+
+set optimizer_switch=@save_os;
+
+--echo # The following will not do the rewrite because the comparison
+--echo # is done as DOUBLEs. Come to think of it, it won't harm to do
+--echo # the rewrite but it is outside of the scope of this patch:
+explain select * from t1 where ucase(col1)=123.456;
+
+select
+ coercibility(upper(col1))
+from t1 limit 1;
+select coercibility(_utf8mb3'abc' COLLATE utf8mb3_bin);
+
+
+--echo # This is transformed too even if it doesn't create any new
+--echo # [potential] access paths:
+explain format=json select * from t1 where upper(col1)=upper(col2);
+
+
+--echo #
+--echo # Check if ref access works
+--echo #
+create table t2 (
+ a varchar(32),
+ non_key varchar(32),
+ key(a)
+) collate utf8mb4_general_ci;
+
+insert into t2
+select
+ concat('A-', seq),
+ concat('A-', seq)
+from seq_1_to_10;
+
+--echo # Must use ref access for t1:
+explain select * from t1, t2 where upper(t1.col1)= t2.non_key;
+
+# Check the interplay with equality propagation
+
+create table t3 (
+ a varchar(32),
+ b varchar(32),
+ key(a),
+ key(b)
+) collate utf8mb3_general_ci;
+insert into t3 values ('abc','ABC'), ('xyz','XYZ');
+
+explain extended
+select a from t3 ignore index(a) where a=b and upper(b)='ABC';
+
+--echo #
+--echo # Check that rewrite isn't applied for non-applicable collations
+--echo #
+create table t4 (
+ col1 varchar(32) collate utf8mb3_bin,
+ col2 varchar(32) collate utf8mb3_czech_ci,
+ col3 varchar(32) collate latin1_bin,
+ key(col1),
+ key(col2),
+ key(col3)
+);
+
+insert into t4
+select
+ concat('A-', seq),
+ concat('A-', seq),
+ concat('A-', seq)
+from seq_1_to_100;
+
+analyze table t4 persistent for all;
+
+--echo # None should use ref access:
+explain select * from t4 where upper(col1)='A-3';
+explain select * from t4 where upper(col2)='a-3';
+explain select * from t4 where upper(col3)='a-3';
+
+--echo #
+--echo # Check that rewrite works for UPPER(col) IN (const-list)
+--echo #
+set
+ @tmp_ot= @@optimizer_trace,
+ optimizer_trace=1;
+
+--echo # must use range:
+explain
+select * from t1 where upper(col1) IN ('A-3','A-4','a-5');
+select * from t1 where upper(col1) IN ('A-3','A-4','a-5');
+
+--echo # Will not use the rewrite:
+explain
+select * from t1 where upper(col1) IN ('A-3','A-4',col2);
+
+--echo #
+--echo # MDEV-31946: Optimizer handle UCASE(varchar_col)=... does not work for UPDATE/DELETE
+--echo #
+explain delete from t1 where upper(col1)='A';
+explain delete from t1 where upper(col1) IN ('A','B');
+
+explain update t1 set col2='ABC' where upper(col1)='A';
+explain update t1 set col2='ABC' where upper(col1) IN ('A','B');
+
+drop table t1,t2,t3,t4;
+
+set optimizer_switch=@tmp_switch_sarg_casefold;
diff --git a/mysql-test/main/sargable_casefold_notembedded.result b/mysql-test/main/sargable_casefold_notembedded.result
new file mode 100644
index 00000000..1f6e9a32
--- /dev/null
+++ b/mysql-test/main/sargable_casefold_notembedded.result
@@ -0,0 +1,61 @@
+create table t1 (
+col1 varchar(32),
+col2 varchar(32),
+key(col1),
+key(col2)
+) collate utf8mb3_general_ci;
+insert into t1
+select
+concat('A-', seq),
+concat('A-', seq)
+from seq_1_to_100;
+set
+@tmp_ot= @@optimizer_trace,
+@tmp_os=@@optimizer_switch,
+optimizer_switch='sargable_casefold=on',
+optimizer_trace=1;
+explain select * from t1 where 'abc'=upper(col1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref col1 col1 99 const 1 Using index condition
+select
+json_detailed(json_extract(trace, '$**.sargable_casefold_removal')) as JS
+from information_schema.optimizer_trace;
+JS
+[
+ {
+ "before": "'abc' = ucase(t1.col1)",
+ "after": "'abc' = t1.col1"
+ }
+]
+explain select * from t1 where ucase(col2)=upper(col1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 100 Using where
+select
+json_detailed(json_extract(trace, '$**.sargable_casefold_removal')) as JS
+from information_schema.optimizer_trace;
+JS
+[
+ {
+ "before": "ucase(t1.col2) = ucase(t1.col1)",
+ "after": "t1.col2 = t1.col1"
+ }
+]
+explain
+select * from t1 where upper(col1) IN ('A-3','A-4','a-5');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range col1 col1 99 NULL 3 Using index condition
+# Will show the rewrite:
+select
+json_detailed(json_extract(trace, '$**.sargable_casefold_removal')) as JS
+from information_schema.optimizer_trace;
+JS
+[
+ {
+ "before": "ucase(t1.col1) in ('A-3','A-4','a-5')",
+ "after": "t1.col1 in ('A-3','A-4','a-5')"
+ }
+]
+set
+optimizer_trace=@tmp_ot,
+optimizer_switch=@tmp_os;
+drop table t1;
diff --git a/mysql-test/main/sargable_casefold_notembedded.test b/mysql-test/main/sargable_casefold_notembedded.test
new file mode 100644
index 00000000..b04e25f1
--- /dev/null
+++ b/mysql-test/main/sargable_casefold_notembedded.test
@@ -0,0 +1,51 @@
+#
+# MDEV-31496 Make optimizer handle UCASE(varchar_col)=...
+# Check the coverage in optimizer trace.
+#
+
+--source include/not_embedded.inc
+--source include/have_sequence.inc
+
+
+create table t1 (
+ col1 varchar(32),
+ col2 varchar(32),
+ key(col1),
+ key(col2)
+) collate utf8mb3_general_ci;
+
+insert into t1
+select
+ concat('A-', seq),
+ concat('A-', seq)
+from seq_1_to_100;
+
+set
+ @tmp_ot= @@optimizer_trace,
+ @tmp_os=@@optimizer_switch,
+ optimizer_switch='sargable_casefold=on',
+ optimizer_trace=1;
+
+explain select * from t1 where 'abc'=upper(col1);
+select
+ json_detailed(json_extract(trace, '$**.sargable_casefold_removal')) as JS
+from information_schema.optimizer_trace;
+
+explain select * from t1 where ucase(col2)=upper(col1);
+select
+ json_detailed(json_extract(trace, '$**.sargable_casefold_removal')) as JS
+from information_schema.optimizer_trace;
+
+explain
+select * from t1 where upper(col1) IN ('A-3','A-4','a-5');
+--echo # Will show the rewrite:
+select
+ json_detailed(json_extract(trace, '$**.sargable_casefold_removal')) as JS
+from information_schema.optimizer_trace;
+
+set
+ optimizer_trace=@tmp_ot,
+ optimizer_switch=@tmp_os;
+
+drop table t1;
+
diff --git a/mysql-test/main/sargable_casefold_part.result b/mysql-test/main/sargable_casefold_part.result
new file mode 100644
index 00000000..7311be1c
--- /dev/null
+++ b/mysql-test/main/sargable_casefold_part.result
@@ -0,0 +1,58 @@
+set
+@tmp_switch_sarg_casefold=@@optimizer_switch,
+optimizer_switch='sargable_casefold=on';
+create table t1 (
+s1 varchar(15) collate utf8mb3_bin,
+s2 varchar(15) collate utf8mb3_general_ci
+) partition by key (s2) partitions 4;
+insert into t1 values ('aa','aa'),('bb','bb');
+explain format=json select * from t1 where upper(s2)='AA';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "partitions": ["p2"],
+ "access_type": "system",
+ "rows": 1,
+ "filtered": 100
+ }
+ }
+ ]
+ }
+}
+explain format=json delete from t1 where upper(s2)='AA';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "delete": 1,
+ "table_name": "t1",
+ "partitions": ["p2"],
+ "access_type": "ALL",
+ "rows": 1,
+ "attached_condition": "t1.s2 = 'AA'"
+ }
+ }
+}
+explain format=json update t1 set s1='aaa' where upper(s2)='AA';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "update": 1,
+ "table_name": "t1",
+ "partitions": ["p2"],
+ "access_type": "ALL",
+ "rows": 1,
+ "attached_condition": "t1.s2 = 'AA'"
+ }
+ }
+}
+drop table t1;
+set optimizer_switch=@tmp_switch_sarg_casefold;
diff --git a/mysql-test/main/sargable_casefold_part.test b/mysql-test/main/sargable_casefold_part.test
new file mode 100644
index 00000000..0c6db1d0
--- /dev/null
+++ b/mysql-test/main/sargable_casefold_part.test
@@ -0,0 +1,22 @@
+--source include/have_partition.inc
+#
+# MDEV-31975: UCASE(varchar_col)=... not handled for partition tables
+#
+
+set
+ @tmp_switch_sarg_casefold=@@optimizer_switch,
+ optimizer_switch='sargable_casefold=on';
+
+create table t1 (
+ s1 varchar(15) collate utf8mb3_bin,
+ s2 varchar(15) collate utf8mb3_general_ci
+) partition by key (s2) partitions 4;
+insert into t1 values ('aa','aa'),('bb','bb');
+
+explain format=json select * from t1 where upper(s2)='AA';
+explain format=json delete from t1 where upper(s2)='AA';
+explain format=json update t1 set s1='aaa' where upper(s2)='AA';
+
+drop table t1;
+
+set optimizer_switch=@tmp_switch_sarg_casefold;
diff --git a/mysql-test/main/sargable_date_cond.result b/mysql-test/main/sargable_date_cond.result
new file mode 100644
index 00000000..2b859cf8
--- /dev/null
+++ b/mysql-test/main/sargable_date_cond.result
@@ -0,0 +1,2007 @@
+drop table if exists t0,t1,t2,t3;
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1(a int);
+insert into t1 select A.a + B.a* 10 from t0 A, t0 B;
+create table t2 (pk int primary key, a datetime, b date, key(a), key(b));
+insert into t2
+select
+A.a*10+B.a,
+date_add(date_add('2017-01-01', interval A.a*8 day), interval B.a hour),
+date_add('2017-01-01', interval A.a*7 day)
+from t1 A, t0 B;
+analyze table t2;
+Table Op Msg_type Msg_text
+test.t2 analyze status Engine-independent statistics collected
+test.t2 analyze status Table is already up to date
+#
+# "YEAR(datetime_col) CMP year_value", basic checks
+#
+select count(*) from t2 where year(a) < 2018;
+count(*)
+460
+# Compare the results, they must be equal:
+select count(*) from t2 where a < '2018-01-01';
+count(*)
+460
+explain format=json select count(*) from t2 where year(a) < 2018;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.063940854,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 451,
+ "cost": 0.063940854,
+ "filtered": 100,
+ "attached_condition": "t2.a < '2018-01-01 00:00:00'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+# Check rewrite for a prepared statement:
+execute immediate
+"explain format=json select * from t2 where year(a) < ?"
+ using 2018;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.1671618,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "possible_keys": ["a"],
+ "loops": 1,
+ "rows": 1000,
+ "cost": 0.1671618,
+ "filtered": 45.09999847,
+ "attached_condition": "t2.a < '2018-01-01 00:00:00'"
+ }
+ }
+ ]
+ }
+}
+prepare stmt from "select count(*) from t2 where year(a) < 2018";
+execute stmt;
+count(*)
+460
+execute stmt;
+count(*)
+460
+create or replace view v1 as select count(*) from t2 where year(a) < 2018;
+select * from v1;
+count(*)
+460
+create or replace procedure sp() select count(*) from t2 where year(a) < 2018;
+call sp();
+count(*)
+460
+call sp();
+count(*)
+460
+# Prepared statement with a placeholder
+prepare stmt from "select count(*) from t2 where year(a) < ?";
+execute stmt using 2018;
+count(*)
+460
+execute stmt using 2017;
+count(*)
+0
+select count(*) from t2 where year(a) <= 2018;
+count(*)
+920
+select count(*) from t2 where a < '2019-01-01';
+count(*)
+920
+explain format=json select count(*) from t2 where year(a) <= 2018;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.126438894,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 903,
+ "cost": 0.126438894,
+ "filtered": 100,
+ "attached_condition": "t2.a <= '2018-12-31 23:59:59'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+select count(*) from t2 where year(a) > 2018;
+count(*)
+80
+select count(*) from t2 where a > '2018-12-31 23:59:59.999999';
+count(*)
+80
+explain format=json select count(*) from t2 where year(a) > 2018;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.014752874,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 97,
+ "cost": 0.014752874,
+ "filtered": 100,
+ "attached_condition": "t2.a > '2018-12-31 23:59:59'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+select count(*) from t2 where year(a) >= 2018;
+count(*)
+540
+select count(*) from t2 where a >= '2018-01-01';
+count(*)
+540
+explain format=json select count(*) from t2 where year(a) >= 2018;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.077250914,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 549,
+ "cost": 0.077250914,
+ "filtered": 100,
+ "attached_condition": "t2.a >= '2018-01-01 00:00:00'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+select count(*) from t2 where year(a) = 2017;
+count(*)
+460
+select count(*) from t2 where a >= '2017-01-01' and a < '2018-01-01';
+count(*)
+460
+explain format=json select count(*) from t2 where year(a) = 2017;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.063940854,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 451,
+ "cost": 0.063940854,
+ "filtered": 100,
+ "attached_condition": "t2.a between '2017-01-01 00:00:00' and '2017-12-31 23:59:59'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+#
+# "YEAR(datetime_col) CMP year_value", reverse argument order
+#
+select count(*) from t2 where 2017 < year(a);
+count(*)
+540
+select count(*) from t2 where a >= '2018-01-01';
+count(*)
+540
+explain format=json select count(*) from t2 where 2017 < year(a);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.077250914,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 549,
+ "cost": 0.077250914,
+ "filtered": 100,
+ "attached_condition": "t2.a > '2017-12-31 23:59:59'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+select count(*) from t2 where a >= '2018-01-01';
+count(*)
+540
+explain format=json select count(*) from t2 where 2018 <= year(a);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.077250914,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 549,
+ "cost": 0.077250914,
+ "filtered": 100,
+ "attached_condition": "t2.a >= '2018-01-01 00:00:00'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+select count(*) from t2 where 2018 > year(a);
+count(*)
+460
+select count(*) from t2 where a < '2018-01-01';
+count(*)
+460
+explain format=json select count(*) from t2 where 2018 > year(a);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.063940854,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 451,
+ "cost": 0.063940854,
+ "filtered": 100,
+ "attached_condition": "t2.a < '2018-01-01 00:00:00'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+select count(*) from t2 where a < '2019-01-01';
+count(*)
+920
+explain format=json select count(*) from t2 where 2018 >= year(a);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.126438894,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 903,
+ "cost": 0.126438894,
+ "filtered": 100,
+ "attached_condition": "t2.a <= '2018-12-31 23:59:59'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+select count(*) from t2 where 2018 = year(a);
+count(*)
+460
+select count(*) from t2 where a >= '2018-01-01' and a < '2019-01-01';
+count(*)
+460
+explain format=json select count(*) from t2 where 2018 = year(a);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.064079124,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 452,
+ "cost": 0.064079124,
+ "filtered": 100,
+ "attached_condition": "t2.a between '2018-01-01 00:00:00' and '2018-12-31 23:59:59'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+#
+# "DATE(datetime_col) CMP date_value", basic checks
+#
+select count(*) from t2 where date(a) < '2017-06-01';
+count(*)
+190
+select count(*) from t2 where a < '2017-06-01';
+count(*)
+190
+explain format=json select count(*) from t2 where date(a) < '2017-06-01';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.027058904,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 186,
+ "cost": 0.027058904,
+ "filtered": 100,
+ "attached_condition": "t2.a < '2017-06-01 00:00:00'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+select count(*) from t2 where date(a) <= '2017-06-03';
+count(*)
+200
+select count(*) from t2 where a < '2017-06-04';
+count(*)
+200
+explain format=json select count(*) from t2 where date(a) <= '2017-06-03';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.028441604,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 196,
+ "cost": 0.028441604,
+ "filtered": 100,
+ "attached_condition": "t2.a <= '2017-06-03 23:59:59'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+select count(*) from t2 where date(a) > '2018-06-01';
+count(*)
+350
+select count(*) from t2 where a >= '2018-06-02';
+count(*)
+350
+explain format=json select count(*) from t2 where date(a) > '2018-06-01';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.051773094,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 363,
+ "cost": 0.051773094,
+ "filtered": 100,
+ "attached_condition": "t2.a > '2018-06-01 23:59:59'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+select count(*) from t2 where date(a) >= '2018-06-01';
+count(*)
+350
+select count(*) from t2 where a >= '2018-06-01';
+count(*)
+350
+explain format=json select count(*) from t2 where date(a) >= '2018-06-01';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.051773094,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 363,
+ "cost": 0.051773094,
+ "filtered": 100,
+ "attached_condition": "t2.a >= '2018-06-01 00:00:00'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+select count(*) from t2 where date(a) = '2017-06-02';
+count(*)
+10
+select count(*) from t2 where a >= '2017-06-02' and a < '2017-06-03';
+count(*)
+10
+explain format=json select count(*) from t2 where date(a) = '2017-06-02';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.002723384,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 10,
+ "cost": 0.002723384,
+ "filtered": 100,
+ "attached_condition": "t2.a between '2017-06-02 00:00:00' and '2017-06-02 23:59:59'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+#
+# "DATE(datetime_col) CMP date_value", reverse order
+#
+select count(*) from t2 where '2017-06-01' > date(a);
+count(*)
+190
+select count(*) from t2 where '2017-06-01' > a;
+count(*)
+190
+explain format=json select count(*) from t2 where '2017-06-01' > date(a);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.027058904,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 186,
+ "cost": 0.027058904,
+ "filtered": 100,
+ "attached_condition": "t2.a < '2017-06-01 00:00:00'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+select count(*) from t2 where '2017-06-03' >= date(a);
+count(*)
+200
+select count(*) from t2 where '2017-06-03' >= a;
+count(*)
+200
+explain format=json select count(*) from t2 where '2017-06-03' >= date(a);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.028441604,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 196,
+ "cost": 0.028441604,
+ "filtered": 100,
+ "attached_condition": "t2.a <= '2017-06-03 23:59:59'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+select count(*) from t2 where '2018-06-01' < date(a);
+count(*)
+350
+select count(*) from t2 where '2018-06-02' <= a;
+count(*)
+350
+explain format=json select count(*) from t2 where '2018-06-01' < date(a);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.051773094,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 363,
+ "cost": 0.051773094,
+ "filtered": 100,
+ "attached_condition": "t2.a > '2018-06-01 23:59:59'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+select count(*) from t2 where '2018-06-01' <= date(a);
+count(*)
+350
+select count(*) from t2 where '2018-06-01' <= a;
+count(*)
+350
+explain format=json select count(*) from t2 where '2018-06-01' <= date(a);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.051773094,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 363,
+ "cost": 0.051773094,
+ "filtered": 100,
+ "attached_condition": "t2.a >= '2018-06-01 00:00:00'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+select count(*) from t2 where '2017-06-02' = date(a);
+count(*)
+10
+select count(*) from t2 where a >= '2017-06-02' and a < '2017-06-03';
+count(*)
+10
+explain format=json select count(*) from t2 where '2017-06-02' = date(a);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.002723384,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 10,
+ "cost": 0.002723384,
+ "filtered": 100,
+ "attached_condition": "t2.a between '2017-06-02 00:00:00' and '2017-06-02 23:59:59'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+# Check rewrite of a more complicated query
+explain format=json select * from t2 as t21 force index(a),
+t2 as t22 force index(a)
+where year(t21.a) < 2018 and t21.b > '2017-11-01'
+ and date(t22.a) >= '2017-02-01' and t22.b > '2017-11-01';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 24.30051963,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t21",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 451,
+ "cost": 0.558056003,
+ "filtered": 56,
+ "index_condition": "t21.a < '2018-01-01 00:00:00'",
+ "attached_condition": "t21.b > '2017-11-01'"
+ }
+ },
+ {
+ "block-nl-join": {
+ "table": {
+ "table_name": "t22",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 252.56,
+ "rows": 961,
+ "cost": 23.74246363,
+ "filtered": 56,
+ "index_condition": "t22.a >= '2017-02-01 00:00:00'",
+ "attached_condition": "t22.a >= '2017-02-01 00:00:00' and t22.b > '2017-11-01'"
+ },
+ "buffer_type": "flat",
+ "buffer_size": "7Kb",
+ "join_type": "BNL",
+ "attached_condition": "t22.b > '2017-11-01'"
+ }
+ }
+ ]
+ }
+}
+#
+# Incorrect const values processing (no rewrite is possible)
+#
+explain format=json select * from t2 where year(a) = -1;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.1671618,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 1000,
+ "cost": 0.1671618,
+ "filtered": 100,
+ "attached_condition": "year(t2.a) = -1"
+ }
+ }
+ ]
+ }
+}
+explain format=json select * from t2 where year(a) > -5;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.1671618,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 1000,
+ "cost": 0.1671618,
+ "filtered": 100,
+ "attached_condition": "year(t2.a) > -5"
+ }
+ }
+ ]
+ }
+}
+explain format=json select * from t2 where year(a) < -1;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.1671618,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 1000,
+ "cost": 0.1671618,
+ "filtered": 100,
+ "attached_condition": "year(t2.a) < -1"
+ }
+ }
+ ]
+ }
+}
+explain format=json select * from t2 where year(a) <= 10000;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.1671618,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 1000,
+ "cost": 0.1671618,
+ "filtered": 100,
+ "attached_condition": "year(t2.a) <= 10000"
+ }
+ }
+ ]
+ }
+}
+explain format=json select * from t2 where year(a) >= 10020;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.1671618,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 1000,
+ "cost": 0.1671618,
+ "filtered": 100,
+ "attached_condition": "year(t2.a) >= 10020"
+ }
+ }
+ ]
+ }
+}
+explain format=json select * from t2 where date(a) = '10000-01-01';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.1671618,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 1000,
+ "cost": 0.1671618,
+ "filtered": 100,
+ "attached_condition": "cast(t2.a as date) = '10000-01-01'"
+ }
+ }
+ ]
+ }
+}
+Warnings:
+Warning 1292 Incorrect datetime value: '10000-01-01'
+explain format=json select * from t2 where date(a) < '-1-01-01';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.1671618,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 1000,
+ "cost": 0.1671618,
+ "filtered": 100,
+ "attached_condition": "cast(t2.a as date) < '-1-01-01'"
+ }
+ }
+ ]
+ }
+}
+Warnings:
+Warning 1292 Incorrect datetime value: '-1-01-01'
+#
+# Try DATE function and DATE (not DATETIME) column:
+#
+select count(*) from t2 where date(b)< '2017-06-03';
+count(*)
+220
+select count(*) from t2 where b < '2017-06-03';
+count(*)
+220
+explain format=json select count(*) from t2 where date(b)< '2017-06-03';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.031207004,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["b"],
+ "key": "b",
+ "key_length": "4",
+ "used_key_parts": ["b"],
+ "loops": 1,
+ "rows": 216,
+ "cost": 0.031207004,
+ "filtered": 100,
+ "attached_condition": "t2.b < '2017-06-03'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+select count(*) from t2 where date(b)= '2017-06-04';
+count(*)
+10
+select count(*) from t2 where b >= '2017-06-04' and b < '2017-06-05';
+count(*)
+10
+explain format=json select count(*) from t2 where date(b)= '2017-06-04';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.002723384,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["b"],
+ "key": "b",
+ "key_length": "4",
+ "used_key_parts": ["b"],
+ "loops": 1,
+ "rows": 10,
+ "cost": 0.002723384,
+ "filtered": 100,
+ "attached_condition": "t2.b between '2017-06-04' and '2017-06-04'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+#
+# Check actual query results
+#
+insert into t2 values (10001,'2006-12-31 23:59:59','2006-12-31');
+insert into t2 values (10002,'2007-01-01 00:00:00','2007-01-01');
+insert into t2 values (10003,'2007-12-31 23:59:59','2007-12-31');
+insert into t2 values (10004,'2008-01-01 00:00:00','2008-01-01');
+explain format=json
+select * from t2 force index(b) where year(b)=2007;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.005042291,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["b"],
+ "key": "b",
+ "key_length": "4",
+ "used_key_parts": ["b"],
+ "loops": 1,
+ "rows": 3,
+ "cost": 0.005042291,
+ "filtered": 100,
+ "index_condition": "t2.b between '2007-01-01' and '2007-12-31'"
+ }
+ }
+ ]
+ }
+}
+select * from t2 force index(b) where year(b)=2007;
+pk a b
+10002 2007-01-01 00:00:00 2007-01-01
+10003 2007-12-31 23:59:59 2007-12-31
+insert into t2 values (10010,'2006-12-31 00:00:00','2006-12-31');
+insert into t2 values (10011,'2006-12-30 23:59:59','2006-12-30');
+explain format=json
+select * from t2 force index(a) where date(a)='2006-12-31';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.005042291,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 3,
+ "cost": 0.005042291,
+ "filtered": 100,
+ "index_condition": "t2.a between '2006-12-31 00:00:00' and '2006-12-31 23:59:59'"
+ }
+ }
+ ]
+ }
+}
+select * from t2 force index(a) where date(a)='2006-12-31';
+pk a b
+10010 2006-12-31 00:00:00 2006-12-31
+10001 2006-12-31 23:59:59 2006-12-31
+#
+# Test the TIMESTAMP column
+#
+create table t3 (a timestamp, b date, key(a));
+# Insert data starting from 2016 since that year had a leap second
+# (https://en.wikipedia.org/wiki/Leap_second)
+set time_zone="UTC";
+insert into t3
+select
+timestampadd(hour, B.a, date_add('2016-01-01', interval A.a*8 day)),
+date_add('2016-01-01', interval A.a*7 day)
+from t1 A, t0 B;
+# Results of those two queries must be equal:
+select count(*) from t3 force index(a) where year(a)= 2016;
+count(*)
+460
+# The result must be the same as this query's:
+select count(*) from t3 force index(a) where a >= '2016-01-01 00:00:00'
+ and a <= '2016-12-31 23:59:59.999999';
+count(*)
+460
+explain format=json
+select count(*) from t3 force index(a) where year(a)= 2016;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.064493934,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t3",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "5",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 455,
+ "cost": 0.064493934,
+ "filtered": 100,
+ "attached_condition": "t3.a between '2016-01-01 00:00:00' and '2016-12-31 23:59:59'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+set time_zone= @@global.time_zone;
+#
+# Incorrect const values processing (no rewrite is possible)
+#
+explain format=json select * from t2 where year(a) = -1;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.1671618,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 1000,
+ "cost": 0.1671618,
+ "filtered": 100,
+ "attached_condition": "year(t2.a) = -1"
+ }
+ }
+ ]
+ }
+}
+explain format=json select * from t2 where year(a) > -5;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.1671618,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 1000,
+ "cost": 0.1671618,
+ "filtered": 100,
+ "attached_condition": "year(t2.a) > -5"
+ }
+ }
+ ]
+ }
+}
+explain format=json select * from t2 where year(a) < -1;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.1671618,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 1000,
+ "cost": 0.1671618,
+ "filtered": 100,
+ "attached_condition": "year(t2.a) < -1"
+ }
+ }
+ ]
+ }
+}
+explain format=json select * from t2 where year(a) <= 10000;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.1671618,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 1000,
+ "cost": 0.1671618,
+ "filtered": 100,
+ "attached_condition": "year(t2.a) <= 10000"
+ }
+ }
+ ]
+ }
+}
+explain format=json select * from t2 where year(a) >= 10020;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.1671618,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 1000,
+ "cost": 0.1671618,
+ "filtered": 100,
+ "attached_condition": "year(t2.a) >= 10020"
+ }
+ }
+ ]
+ }
+}
+explain format=json select * from t2 where date(a) = '10000-01-01';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.1671618,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 1000,
+ "cost": 0.1671618,
+ "filtered": 100,
+ "attached_condition": "cast(t2.a as date) = '10000-01-01'"
+ }
+ }
+ ]
+ }
+}
+Warnings:
+Warning 1292 Incorrect datetime value: '10000-01-01'
+explain format=json select * from t2 where date(a) < '-1-01-01';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.1671618,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 1000,
+ "cost": 0.1671618,
+ "filtered": 100,
+ "attached_condition": "cast(t2.a as date) < '-1-01-01'"
+ }
+ }
+ ]
+ }
+}
+Warnings:
+Warning 1292 Incorrect datetime value: '-1-01-01'
+#
+# Composite indexes
+#
+create table t4 (a datetime, b int, key(a, b)) ;
+insert into t4 values ('2009-11-29 13:43:32', 2);
+insert into t4 values ('2009-10-15 12:15:11', 2);
+insert into t4 values ('2009-09-01 15:55:00', 3);
+insert into t4 values ('2009-08-23 12:07:47', 4);
+explain format=json select * from t4 where year(a) = 2009;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.001893764,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t4",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 4,
+ "cost": 0.001893764,
+ "filtered": 100,
+ "attached_condition": "t4.a between '2009-01-01 00:00:00' and '2009-12-31 23:59:59'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+explain format=json select * from t4 where year(a) >= 2009;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.001893764,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t4",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 4,
+ "cost": 0.001893764,
+ "filtered": 100,
+ "attached_condition": "t4.a >= '2009-01-01 00:00:00'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+explain format=json select * from t4 where year(a) < 2018;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.001893764,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t4",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 4,
+ "cost": 0.001893764,
+ "filtered": 100,
+ "attached_condition": "t4.a < '2018-01-01 00:00:00'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+explain format=json select * from t4 where date(a) = '2009-12-01';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.001478954,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t4",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 1,
+ "cost": 0.001478954,
+ "filtered": 100,
+ "attached_condition": "t4.a between '2009-12-01 00:00:00' and '2009-12-01 23:59:59'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+explain format=json select * from t4 where b = 2 and year(a) = 2009;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.001893764,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t4",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "11",
+ "used_key_parts": ["a", "b"],
+ "loops": 1,
+ "rows": 4,
+ "cost": 0.001893764,
+ "filtered": 100,
+ "attached_condition": "t4.b = 2 and t4.a between '2009-01-01 00:00:00' and '2009-12-31 23:59:59'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+explain format=json select * from t4 where b = 10 and year(a) > 2001;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.001893764,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t4",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 4,
+ "cost": 0.001893764,
+ "filtered": 100,
+ "attached_condition": "t4.b = 10 and t4.a > '2001-12-31 23:59:59'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+explain format=json select * from t4 where b = 2 and date(a) = '2009-11-02';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.001478954,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t4",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "11",
+ "used_key_parts": ["a", "b"],
+ "loops": 1,
+ "rows": 1,
+ "cost": 0.001478954,
+ "filtered": 100,
+ "attached_condition": "t4.b = 2 and t4.a between '2009-11-02 00:00:00' and '2009-11-02 23:59:59'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+# Reverse order of fields in the index
+create table t5 (a datetime, b int, c varchar(20), key(b, a));
+insert into t5 values ('2009-11-29 13:43:32', 2, 'abc');
+insert into t5 values ('2009-10-15 12:15:11', 2, 'def');
+insert into t5 values ('2009-09-01 15:55:00', 3, 'gfd');
+insert into t5 values ('2009-08-23 12:07:47', 4, 'xyz');
+explain format=json select * from t5 where year(a) = 2009;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.01066122,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t5",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 4,
+ "cost": 0.01066122,
+ "filtered": 100,
+ "attached_condition": "t5.a between <cache>('2009-01-01 00:00:00') and <cache>('2009-12-31 23:59:59')"
+ }
+ }
+ ]
+ }
+}
+explain format=json select * from t4 where date(a) = '2009-12-01';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.001478954,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t4",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 1,
+ "cost": 0.001478954,
+ "filtered": 100,
+ "attached_condition": "t4.a between '2009-12-01 00:00:00' and '2009-12-01 23:59:59'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+explain format=json select * from t5 where b = 2 and year(a) = 2009;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.002037211,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t5",
+ "access_type": "range",
+ "possible_keys": ["b"],
+ "key": "b",
+ "key_length": "11",
+ "used_key_parts": ["b", "a"],
+ "loops": 1,
+ "rows": 2,
+ "cost": 0.002037211,
+ "filtered": 70,
+ "index_condition": "t5.b = 2 and t5.a between '2009-01-01 00:00:00' and '2009-12-31 23:59:59'"
+ }
+ }
+ ]
+ }
+}
+explain format=json select * from t5 where b = 10 and year(a) > 2001;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.002574553,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t5",
+ "access_type": "range",
+ "possible_keys": ["b"],
+ "key": "b",
+ "key_length": "11",
+ "used_key_parts": ["b", "a"],
+ "loops": 1,
+ "rows": 1,
+ "cost": 0.002574553,
+ "filtered": 100,
+ "index_condition": "t5.b = 10 and t5.a > '2001-12-31 23:59:59'"
+ }
+ }
+ ]
+ }
+}
+explain format=json select * from t5 where b = 3 and date(a) > '2009-09-01';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.002574553,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t5",
+ "access_type": "range",
+ "possible_keys": ["b"],
+ "key": "b",
+ "key_length": "11",
+ "used_key_parts": ["b", "a"],
+ "loops": 1,
+ "rows": 1,
+ "cost": 0.002574553,
+ "filtered": 100,
+ "index_condition": "t5.b = 3 and t5.a > '2009-09-01 23:59:59'"
+ }
+ }
+ ]
+ }
+}
+#
+# No rewrite for a non-indexed column
+#
+create table t6 (a datetime);
+insert into t6 values ('2009-11-29 13:43:32');
+insert into t6 values ('2009-10-15 12:15:11');
+insert into t6 values ('2009-09-01 15:55:00');
+insert into t6 values ('2009-08-23 12:07:47');
+explain format=json select * from t6 where year(a) = 2009;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.01066122,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t6",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 4,
+ "cost": 0.01066122,
+ "filtered": 100,
+ "attached_condition": "year(t6.a) = 2009"
+ }
+ }
+ ]
+ }
+}
+explain format=json select * from t6 where date(a) = '2009-12-01';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.01066122,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t6",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 4,
+ "cost": 0.01066122,
+ "filtered": 100,
+ "attached_condition": "cast(t6.a as date) = '2009-12-01'"
+ }
+ }
+ ]
+ }
+}
+drop table t0,t1,t2,t3,t4,t5,t6;
+drop view v1;
+drop procedure sp;
+#
+# MDEV-30946 Index usage for DATE(datetime_column) = const
+# does not work for DELETE and UPDATE
+#
+create table t1 (pk int primary key, a datetime, c int, key(a));
+insert into t1 (pk,a,c) values (1,'2009-11-29 13:43:32', 2);
+insert into t1 (pk,a,c) values (2,'2009-11-29 03:23:32', 2);
+insert into t1 (pk,a,c) values (3,'2009-10-16 05:56:32', 2);
+insert into t1 (pk,a,c) values (4,'2010-11-29 13:43:32', 2);
+insert into t1 (pk,a,c) values (5,'2010-10-16 05:56:32', 2);
+insert into t1 (pk,a,c) values (6,'2011-11-29 13:43:32', 2);
+insert into t1 (pk,a,c) values (7,'2012-10-16 05:56:32', 2);
+# YEAR() conditions, UPDATE
+explain format=json update t1 set c = 0 where year(a) = 2010;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "update": 1,
+ "table_name": "t1",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "rows": 2,
+ "attached_condition": "t1.a between '2010-01-01 00:00:00' and '2010-12-31 23:59:59'"
+ }
+ }
+}
+update t1 set c = 0 where year(a) = 2010;
+select * from t1;
+pk a c
+1 2009-11-29 13:43:32 2
+2 2009-11-29 03:23:32 2
+3 2009-10-16 05:56:32 2
+4 2010-11-29 13:43:32 0
+5 2010-10-16 05:56:32 0
+6 2011-11-29 13:43:32 2
+7 2012-10-16 05:56:32 2
+explain format=json update t1 set c = 1
+where c < (select count(*) from t1 where year(a) = 2010);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.011130435,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 7,
+ "cost": 0.011130435,
+ "filtered": 100,
+ "attached_condition": "t1.c < (subquery#2)"
+ }
+ }
+ ],
+ "subqueries": [
+ {
+ "query_block": {
+ "select_id": 2,
+ "cost": 0.001617224,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 2,
+ "cost": 0.001617224,
+ "filtered": 100,
+ "attached_condition": "t1.a between '2010-01-01 00:00:00' and '2010-12-31 23:59:59'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+explain format=json update t1 set c = 0
+where year(a) = 2010 and c < (select count(*) from t1 where year(a) = 2010);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.003808422,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 2,
+ "cost": 0.003808422,
+ "filtered": 100,
+ "index_condition": "t1.a between '2010-01-01 00:00:00' and '2010-12-31 23:59:59'",
+ "attached_condition": "t1.c < (subquery#2)"
+ }
+ }
+ ],
+ "subqueries": [
+ {
+ "query_block": {
+ "select_id": 2,
+ "cost": 0.001617224,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 2,
+ "cost": 0.001617224,
+ "filtered": 100,
+ "attached_condition": "t1.a between '2010-01-01 00:00:00' and '2010-12-31 23:59:59'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+# Multi-table update
+create table t2 (a int);
+insert into t2 values (4),(5),(6);
+explain format=json update t1, t2 set c = 0
+where year(t1.a) = 2010 and t1.c = t2.a;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.014992165,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 2,
+ "cost": 0.003808422,
+ "filtered": 100,
+ "attached_condition": "t1.a between '2010-01-01 00:00:00' and '2010-12-31 23:59:59'"
+ }
+ },
+ {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "loops": 2,
+ "rows": 3,
+ "cost": 0.011183743,
+ "filtered": 100,
+ "attached_condition": "t2.a = t1.c"
+ }
+ }
+ ]
+ }
+}
+prepare stmt from "update t1 set c = 0 where year(a) = 2010";
+execute stmt;
+execute stmt;
+# YEAR() conditions, DELETE
+explain format=json delete from t1 where year(a) = 2010;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "delete": 1,
+ "table_name": "t1",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "rows": 2,
+ "attached_condition": "t1.a between '2010-01-01 00:00:00' and '2010-12-31 23:59:59'"
+ }
+ }
+}
+delete from t1 where year(a) = 2010;
+select * from t1;
+pk a c
+1 2009-11-29 13:43:32 2
+2 2009-11-29 03:23:32 2
+3 2009-10-16 05:56:32 2
+6 2011-11-29 13:43:32 2
+7 2012-10-16 05:56:32 2
+explain format=json delete from t1
+where c < (select count(*) from t1 where year(a) = 2010);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.010817625,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "loops": 1,
+ "rows": 5,
+ "cost": 0.010817625,
+ "filtered": 100,
+ "attached_condition": "t1.c < (subquery#2)"
+ }
+ }
+ ],
+ "subqueries": [
+ {
+ "query_block": {
+ "select_id": 2,
+ "cost": 0.001478954,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "t1",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "loops": 1,
+ "rows": 1,
+ "cost": 0.001478954,
+ "filtered": 100,
+ "attached_condition": "t1.a between '2010-01-01 00:00:00' and '2010-12-31 23:59:59'",
+ "using_index": true
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+}
+delete from t1 where c < (select count(*) from t1 where year(a) = 2010);
+prepare stmt from "delete from t1 where year(a) = 2009";
+execute stmt;
+execute stmt;
+select * from t1;
+pk a c
+6 2011-11-29 13:43:32 2
+7 2012-10-16 05:56:32 2
+# DATE() conditions, UPDATE
+explain format=json update t1 set c = 0 where date(a) = '2010-10-16';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "update": 1,
+ "table_name": "t1",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "rows": 1,
+ "attached_condition": "t1.a between '2010-10-16 00:00:00' and '2010-10-16 23:59:59'"
+ }
+ }
+}
+explain format=json update t1 set c = 0 where date(a) <= '2011-10-16';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "update": 1,
+ "table_name": "t1",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "rows": 1,
+ "attached_condition": "t1.a <= '2011-10-16 23:59:59'"
+ }
+ }
+}
+prepare stmt from "update t1 set c = 3 where date(a) = '2011-11-29'";
+execute stmt;
+execute stmt;
+select * from t1;
+pk a c
+6 2011-11-29 13:43:32 3
+7 2012-10-16 05:56:32 2
+# DATE() conditions, DELETE
+explain format=json delete from t1 where date(a) = '2010-10-16';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "delete": 1,
+ "table_name": "t1",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "rows": 1,
+ "attached_condition": "t1.a between '2010-10-16 00:00:00' and '2010-10-16 23:59:59'"
+ }
+ }
+}
+explain format=json delete from t1 where date(a) <= '2011-10-16';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "delete": 1,
+ "table_name": "t1",
+ "access_type": "range",
+ "possible_keys": ["a"],
+ "key": "a",
+ "key_length": "6",
+ "used_key_parts": ["a"],
+ "rows": 1,
+ "attached_condition": "t1.a <= '2011-10-16 23:59:59'"
+ }
+ }
+}
+prepare stmt from "delete from t1 where date(a) <= '2012-01-01'";
+execute stmt;
+execute stmt;
+select * from t1;
+pk a c
+7 2012-10-16 05:56:32 2
+# Test partition pruning
+create table t3 (
+a datetime,
+key(a)
+) partition by range(year(a)) (
+partition p0 values less than (2022),
+partition p1 values less than (MAXVALUE)
+);
+insert into t3
+select date_add('2020-01-01', interval seq*10 day)
+from seq_1_to_100;
+# Must be only "p0" partition
+explain partitions select * from t3 where year(a) = 2020;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t3 p0 range a a 6 NULL 36 Using where; Using index
+explain partitions delete from t3 where year(a) = 2020;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t3 p0 ALL a NULL NULL NULL 73 Using where
+explain partitions update t3 set a = a + 1 where year(a) = 2020;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t3 p0 ALL a NULL NULL NULL 73 Using where; Using buffer
+drop tables t1,t2,t3;
diff --git a/mysql-test/main/sargable_date_cond.test b/mysql-test/main/sargable_date_cond.test
new file mode 100644
index 00000000..e1fa0817
--- /dev/null
+++ b/mysql-test/main/sargable_date_cond.test
@@ -0,0 +1,363 @@
+--source include/have_partition.inc
+--source include/have_sequence.inc
+
+#
+# MDEV-8320: Allow index usage for DATE(datetime_column) = const
+#
+
+--disable_warnings
+drop table if exists t0,t1,t2,t3;
+--enable_warnings
+
+create table t0(a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+create table t1(a int);
+insert into t1 select A.a + B.a* 10 from t0 A, t0 B;
+
+create table t2 (pk int primary key, a datetime, b date, key(a), key(b));
+insert into t2
+select
+ A.a*10+B.a,
+ date_add(date_add('2017-01-01', interval A.a*8 day), interval B.a hour),
+ date_add('2017-01-01', interval A.a*7 day)
+from t1 A, t0 B;
+
+analyze table t2;
+
+--echo #
+--echo # "YEAR(datetime_col) CMP year_value", basic checks
+--echo #
+let $q= select count(*) from t2 where year(a) < 2018;
+eval $q;
+--echo # Compare the results, they must be equal:
+select count(*) from t2 where a < '2018-01-01';
+eval explain format=json $q;
+--echo # Check rewrite for a prepared statement:
+execute immediate
+ "explain format=json select * from t2 where year(a) < ?"
+ using 2018;
+eval prepare stmt from "$q";
+execute stmt;
+execute stmt;
+eval create or replace view v1 as $q;
+select * from v1;
+eval create or replace procedure sp() $q;
+call sp();
+call sp();
+--echo # Prepared statement with a placeholder
+prepare stmt from "select count(*) from t2 where year(a) < ?";
+execute stmt using 2018;
+execute stmt using 2017;
+
+let $q= select count(*) from t2 where year(a) <= 2018;
+eval $q;
+select count(*) from t2 where a < '2019-01-01';
+eval explain format=json $q;
+
+let $q= select count(*) from t2 where year(a) > 2018;
+eval $q;
+select count(*) from t2 where a > '2018-12-31 23:59:59.999999';
+eval explain format=json $q;
+
+let $q= select count(*) from t2 where year(a) >= 2018;
+eval $q;
+select count(*) from t2 where a >= '2018-01-01';
+eval explain format=json $q;
+
+let $q= select count(*) from t2 where year(a) = 2017;
+eval $q;
+select count(*) from t2 where a >= '2017-01-01' and a < '2018-01-01';
+eval explain format=json $q;
+
+--echo #
+--echo # "YEAR(datetime_col) CMP year_value", reverse argument order
+--echo #
+let $q= select count(*) from t2 where 2017 < year(a);
+eval $q;
+select count(*) from t2 where a >= '2018-01-01';
+eval explain format=json $q;
+
+let $q= select count(*) from t2 where 2018 <= year(a);
+select count(*) from t2 where a >= '2018-01-01';
+eval explain format=json $q;
+
+let $q= select count(*) from t2 where 2018 > year(a);
+eval $q;
+select count(*) from t2 where a < '2018-01-01';
+eval explain format=json $q;
+
+let $q= select count(*) from t2 where 2018 >= year(a);
+select count(*) from t2 where a < '2019-01-01';
+eval explain format=json $q;
+
+let $q= select count(*) from t2 where 2018 = year(a);
+eval $q;
+select count(*) from t2 where a >= '2018-01-01' and a < '2019-01-01';
+eval explain format=json $q;
+
+--echo #
+--echo # "DATE(datetime_col) CMP date_value", basic checks
+--echo #
+let $q= select count(*) from t2 where date(a) < '2017-06-01';
+eval $q;
+select count(*) from t2 where a < '2017-06-01';
+eval explain format=json $q;
+
+let $q= select count(*) from t2 where date(a) <= '2017-06-03';
+eval $q;
+select count(*) from t2 where a < '2017-06-04';
+eval explain format=json $q;
+
+let $q= select count(*) from t2 where date(a) > '2018-06-01';
+eval $q;
+select count(*) from t2 where a >= '2018-06-02';
+eval explain format=json $q;
+
+let $q= select count(*) from t2 where date(a) >= '2018-06-01';
+eval $q;
+select count(*) from t2 where a >= '2018-06-01';
+eval explain format=json $q;
+
+let $q= select count(*) from t2 where date(a) = '2017-06-02';
+eval $q;
+select count(*) from t2 where a >= '2017-06-02' and a < '2017-06-03';
+eval explain format=json $q;
+
+--echo #
+--echo # "DATE(datetime_col) CMP date_value", reverse order
+--echo #
+let $q= select count(*) from t2 where '2017-06-01' > date(a);
+eval $q;
+select count(*) from t2 where '2017-06-01' > a;
+eval explain format=json $q;
+
+let $q= select count(*) from t2 where '2017-06-03' >= date(a);
+eval $q;
+select count(*) from t2 where '2017-06-03' >= a;
+eval explain format=json $q;
+
+let $q= select count(*) from t2 where '2018-06-01' < date(a);
+eval $q;
+select count(*) from t2 where '2018-06-02' <= a;
+eval explain format=json $q;
+
+let $q= select count(*) from t2 where '2018-06-01' <= date(a);
+eval $q;
+select count(*) from t2 where '2018-06-01' <= a;
+eval explain format=json $q;
+
+let $q= select count(*) from t2 where '2017-06-02' = date(a);
+eval $q;
+select count(*) from t2 where a >= '2017-06-02' and a < '2017-06-03';
+eval explain format=json $q;
+
+--echo # Check rewrite of a more complicated query
+explain format=json select * from t2 as t21 force index(a),
+ t2 as t22 force index(a)
+ where year(t21.a) < 2018 and t21.b > '2017-11-01'
+ and date(t22.a) >= '2017-02-01' and t22.b > '2017-11-01';
+
+--echo #
+--echo # Incorrect const values processing (no rewrite is possible)
+--echo #
+explain format=json select * from t2 where year(a) = -1;
+explain format=json select * from t2 where year(a) > -5;
+explain format=json select * from t2 where year(a) < -1;
+explain format=json select * from t2 where year(a) <= 10000;
+explain format=json select * from t2 where year(a) >= 10020;
+explain format=json select * from t2 where date(a) = '10000-01-01';
+explain format=json select * from t2 where date(a) < '-1-01-01';
+
+--echo #
+--echo # Try DATE function and DATE (not DATETIME) column:
+--echo #
+let $q= select count(*) from t2 where date(b)< '2017-06-03';
+eval $q;
+select count(*) from t2 where b < '2017-06-03';
+eval explain format=json $q;
+
+let $q= select count(*) from t2 where date(b)= '2017-06-04';
+eval $q;
+select count(*) from t2 where b >= '2017-06-04' and b < '2017-06-05';
+eval explain format=json $q;
+
+--echo #
+--echo # Check actual query results
+--echo #
+insert into t2 values (10001,'2006-12-31 23:59:59','2006-12-31');
+insert into t2 values (10002,'2007-01-01 00:00:00','2007-01-01');
+insert into t2 values (10003,'2007-12-31 23:59:59','2007-12-31');
+insert into t2 values (10004,'2008-01-01 00:00:00','2008-01-01');
+
+explain format=json
+select * from t2 force index(b) where year(b)=2007;
+select * from t2 force index(b) where year(b)=2007;
+
+insert into t2 values (10010,'2006-12-31 00:00:00','2006-12-31');
+insert into t2 values (10011,'2006-12-30 23:59:59','2006-12-30');
+
+explain format=json
+select * from t2 force index(a) where date(a)='2006-12-31';
+select * from t2 force index(a) where date(a)='2006-12-31';
+
+--echo #
+--echo # Test the TIMESTAMP column
+--echo #
+create table t3 (a timestamp, b date, key(a));
+--echo # Insert data starting from 2016 since that year had a leap second
+--echo # (https://en.wikipedia.org/wiki/Leap_second)
+set time_zone="UTC"; # To make sure we avoid daylight saving time shifts
+insert into t3
+ select
+ timestampadd(hour, B.a, date_add('2016-01-01', interval A.a*8 day)),
+ date_add('2016-01-01', interval A.a*7 day)
+ from t1 A, t0 B;
+
+--echo # Results of those two queries must be equal:
+let $q= select count(*) from t3 force index(a) where year(a)= 2016;
+eval $q;
+--echo # The result must be the same as this query's:
+select count(*) from t3 force index(a) where a >= '2016-01-01 00:00:00'
+ and a <= '2016-12-31 23:59:59.999999';
+explain format=json
+ select count(*) from t3 force index(a) where year(a)= 2016;
+set time_zone= @@global.time_zone;
+
+--echo #
+--echo # Incorrect const values processing (no rewrite is possible)
+--echo #
+explain format=json select * from t2 where year(a) = -1;
+explain format=json select * from t2 where year(a) > -5;
+explain format=json select * from t2 where year(a) < -1;
+explain format=json select * from t2 where year(a) <= 10000;
+explain format=json select * from t2 where year(a) >= 10020;
+explain format=json select * from t2 where date(a) = '10000-01-01';
+explain format=json select * from t2 where date(a) < '-1-01-01';
+
+--echo #
+--echo # Composite indexes
+--echo #
+create table t4 (a datetime, b int, key(a, b)) ;
+insert into t4 values ('2009-11-29 13:43:32', 2);
+insert into t4 values ('2009-10-15 12:15:11', 2);
+insert into t4 values ('2009-09-01 15:55:00', 3);
+insert into t4 values ('2009-08-23 12:07:47', 4);
+explain format=json select * from t4 where year(a) = 2009;
+explain format=json select * from t4 where year(a) >= 2009;
+explain format=json select * from t4 where year(a) < 2018;
+explain format=json select * from t4 where date(a) = '2009-12-01';
+explain format=json select * from t4 where b = 2 and year(a) = 2009;
+explain format=json select * from t4 where b = 10 and year(a) > 2001;
+explain format=json select * from t4 where b = 2 and date(a) = '2009-11-02';
+
+--echo # Reverse order of fields in the index
+create table t5 (a datetime, b int, c varchar(20), key(b, a));
+insert into t5 values ('2009-11-29 13:43:32', 2, 'abc');
+insert into t5 values ('2009-10-15 12:15:11', 2, 'def');
+insert into t5 values ('2009-09-01 15:55:00', 3, 'gfd');
+insert into t5 values ('2009-08-23 12:07:47', 4, 'xyz');
+explain format=json select * from t5 where year(a) = 2009;
+explain format=json select * from t4 where date(a) = '2009-12-01';
+explain format=json select * from t5 where b = 2 and year(a) = 2009;
+explain format=json select * from t5 where b = 10 and year(a) > 2001;
+explain format=json select * from t5 where b = 3 and date(a) > '2009-09-01';
+
+--echo #
+--echo # No rewrite for a non-indexed column
+--echo #
+create table t6 (a datetime);
+insert into t6 values ('2009-11-29 13:43:32');
+insert into t6 values ('2009-10-15 12:15:11');
+insert into t6 values ('2009-09-01 15:55:00');
+insert into t6 values ('2009-08-23 12:07:47');
+explain format=json select * from t6 where year(a) = 2009;
+explain format=json select * from t6 where date(a) = '2009-12-01';
+
+drop table t0,t1,t2,t3,t4,t5,t6;
+drop view v1;
+drop procedure sp;
+
+--echo #
+--echo # MDEV-30946 Index usage for DATE(datetime_column) = const
+--echo # does not work for DELETE and UPDATE
+--echo #
+create table t1 (pk int primary key, a datetime, c int, key(a));
+
+insert into t1 (pk,a,c) values (1,'2009-11-29 13:43:32', 2);
+insert into t1 (pk,a,c) values (2,'2009-11-29 03:23:32', 2);
+insert into t1 (pk,a,c) values (3,'2009-10-16 05:56:32', 2);
+insert into t1 (pk,a,c) values (4,'2010-11-29 13:43:32', 2);
+insert into t1 (pk,a,c) values (5,'2010-10-16 05:56:32', 2);
+insert into t1 (pk,a,c) values (6,'2011-11-29 13:43:32', 2);
+insert into t1 (pk,a,c) values (7,'2012-10-16 05:56:32', 2);
+
+--echo # YEAR() conditions, UPDATE
+explain format=json update t1 set c = 0 where year(a) = 2010;
+update t1 set c = 0 where year(a) = 2010;
+select * from t1;
+explain format=json update t1 set c = 1
+ where c < (select count(*) from t1 where year(a) = 2010);
+explain format=json update t1 set c = 0
+ where year(a) = 2010 and c < (select count(*) from t1 where year(a) = 2010);
+
+--echo # Multi-table update
+create table t2 (a int);
+insert into t2 values (4),(5),(6);
+explain format=json update t1, t2 set c = 0
+ where year(t1.a) = 2010 and t1.c = t2.a;
+
+prepare stmt from "update t1 set c = 0 where year(a) = 2010";
+execute stmt;
+execute stmt;
+
+--echo # YEAR() conditions, DELETE
+explain format=json delete from t1 where year(a) = 2010;
+delete from t1 where year(a) = 2010;
+select * from t1;
+explain format=json delete from t1
+ where c < (select count(*) from t1 where year(a) = 2010);
+delete from t1 where c < (select count(*) from t1 where year(a) = 2010);
+
+prepare stmt from "delete from t1 where year(a) = 2009";
+execute stmt;
+execute stmt;
+select * from t1;
+
+--echo # DATE() conditions, UPDATE
+explain format=json update t1 set c = 0 where date(a) = '2010-10-16';
+explain format=json update t1 set c = 0 where date(a) <= '2011-10-16';
+prepare stmt from "update t1 set c = 3 where date(a) = '2011-11-29'";
+execute stmt;
+execute stmt;
+select * from t1;
+
+--echo # DATE() conditions, DELETE
+explain format=json delete from t1 where date(a) = '2010-10-16';
+explain format=json delete from t1 where date(a) <= '2011-10-16';
+prepare stmt from "delete from t1 where date(a) <= '2012-01-01'";
+execute stmt;
+execute stmt;
+select * from t1;
+
+--echo # Test partition pruning
+create table t3 (
+ a datetime,
+ key(a)
+) partition by range(year(a)) (
+partition p0 values less than (2022),
+partition p1 values less than (MAXVALUE)
+);
+
+insert into t3
+select date_add('2020-01-01', interval seq*10 day)
+from seq_1_to_100;
+
+--echo # Must be only "p0" partition
+explain partitions select * from t3 where year(a) = 2020;
+
+explain partitions delete from t3 where year(a) = 2020;
+
+explain partitions update t3 set a = a + 1 where year(a) = 2020;
+
+drop tables t1,t2,t3;
diff --git a/mysql-test/main/secondary_key_costs.result b/mysql-test/main/secondary_key_costs.result
index dbdaaa3e..3c56b50d 100644
--- a/mysql-test/main/secondary_key_costs.result
+++ b/mysql-test/main/secondary_key_costs.result
@@ -28,6 +28,9 @@ set statement optimizer_adjust_secondary_key_costs=0 for
explain select * from t1 where nm like '500%' AND fl2 = 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range idx1,idx2 idx1 35 NULL 1 Using index condition; Using where
+Warnings:
+Warning 1287 '@@optimizer_adjust_secondary_key_costs' is deprecated and will be removed in a future release
+Warning 1287 '@@optimizer_adjust_secondary_key_costs' is deprecated and will be removed in a future release
set @trace=(select trace from information_schema.optimizer_trace);
select json_detailed(json_extract(@trace, '$**.considered_access_paths'));
json_detailed(json_extract(@trace, '$**.considered_access_paths'))
@@ -37,15 +40,51 @@ json_detailed(json_extract(@trace, '$**.considered_access_paths'))
"access_type": "ref",
"index": "idx2",
"used_range_estimates": true,
- "rowid_filter_skipped": "worst/max seeks clipping",
- "rows": 492,
- "cost": 492.3171406,
+ "filter":
+ {
+ "rowid_filter_index": "idx1",
+ "index_only_cost": 0.045598762,
+ "filter_startup_cost": 0.000899465,
+ "find_key_and_filter_lookup_cost": 0.03086808,
+ "filter_selectivity": 0.001,
+ "original_rows": 492,
+ "new_rows": 0.492,
+ "original_access_cost": 0.59235049,
+ "with_filter_access_cost": 0.077013594,
+ "original_found_rows_cost": 0.546751728,
+ "with_filter_found_rows_cost": 5.467517e-4,
+ "org_cost": 0.60809449,
+ "filter_cost": 0.077928803,
+ "filter_used": true
+ },
+ "rows": 0.492,
+ "cost": 0.077928803,
"chosen": true
},
{
+ "filter":
+ {
+ "rowid_filter_index": "idx2",
+ "index_only_cost": 0.000881127,
+ "filter_startup_cost": 0.066293508,
+ "find_key_and_filter_lookup_cost": 8.646449e-5,
+ "filter_selectivity": 0.492,
+ "original_rows": 1,
+ "new_rows": 0.492,
+ "original_access_cost": 0.001992411,
+ "with_filter_access_cost": 0.001514343,
+ "original_found_rows_cost": 0.001111284,
+ "with_filter_found_rows_cost": 5.467517e-4,
+ "org_cost": 0.002024411,
+ "filter_cost": 0.067823595,
+ "filter_used": false
+ },
"access_type": "range",
- "resulting_rows": 0.492,
- "cost": 1.448699097,
+ "range_index": "idx1",
+ "rows": 1,
+ "rows_after_filter": 1,
+ "rows_out": 0.492,
+ "cost": 0.002574553,
"chosen": true
}
]
@@ -57,6 +96,9 @@ set statement optimizer_adjust_secondary_key_costs=2 for
explain select * from t1 where nm like '500%' AND fl2 = 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range idx1,idx2 idx1 35 NULL 1 Using index condition; Using where
+Warnings:
+Warning 1287 '@@optimizer_adjust_secondary_key_costs' is deprecated and will be removed in a future release
+Warning 1287 '@@optimizer_adjust_secondary_key_costs' is deprecated and will be removed in a future release
set @trace=(select trace from information_schema.optimizer_trace);
select json_detailed(json_extract(@trace, '$**.considered_access_paths'));
json_detailed(json_extract(@trace, '$**.considered_access_paths'))
@@ -66,52 +108,53 @@ json_detailed(json_extract(@trace, '$**.considered_access_paths'))
"access_type": "ref",
"index": "idx2",
"used_range_estimates": true,
- "rowid_filter_key": "idx1",
- "rows": 492,
- "cost": 3.814364688,
+ "filter":
+ {
+ "rowid_filter_index": "idx1",
+ "index_only_cost": 0.045598762,
+ "filter_startup_cost": 0.000899465,
+ "find_key_and_filter_lookup_cost": 0.03086808,
+ "filter_selectivity": 0.001,
+ "original_rows": 492,
+ "new_rows": 0.492,
+ "original_access_cost": 0.59235049,
+ "with_filter_access_cost": 0.077013594,
+ "original_found_rows_cost": 0.546751728,
+ "with_filter_found_rows_cost": 5.467517e-4,
+ "org_cost": 0.60809449,
+ "filter_cost": 0.077928803,
+ "filter_used": true
+ },
+ "rows": 0.492,
+ "cost": 0.077928803,
"chosen": true
},
{
+ "filter":
+ {
+ "rowid_filter_index": "idx2",
+ "index_only_cost": 0.000881127,
+ "filter_startup_cost": 0.066293508,
+ "find_key_and_filter_lookup_cost": 8.646449e-5,
+ "filter_selectivity": 0.492,
+ "original_rows": 1,
+ "new_rows": 0.492,
+ "original_access_cost": 0.001992411,
+ "with_filter_access_cost": 0.001514343,
+ "original_found_rows_cost": 0.001111284,
+ "with_filter_found_rows_cost": 5.467517e-4,
+ "org_cost": 0.002024411,
+ "filter_cost": 0.067823595,
+ "filter_used": false
+ },
"access_type": "range",
- "resulting_rows": 0.492,
- "cost": 1.448699097,
+ "range_index": "idx1",
+ "rows": 1,
+ "rows_after_filter": 1,
+ "rows_out": 0.492,
+ "cost": 0.002574553,
"chosen": true
}
]
]
drop table t1, name, flag2;
-select @@optimizer_adjust_secondary_key_costs;
-@@optimizer_adjust_secondary_key_costs
-
-set @@optimizer_adjust_secondary_key_costs=7;
-select @@optimizer_adjust_secondary_key_costs;
-@@optimizer_adjust_secondary_key_costs
-adjust_secondary_key_cost,disable_max_seek,disable_forced_index_in_group_by
-set @@optimizer_adjust_secondary_key_costs=default;
-#
-# MDEV-33306 Optimizer choosing incorrect index in 10.6, 10.5 but not in 10.4
-#
-create table t1 (a int primary key, b int, c int, d int, key(b),key(c)) engine=innodb;
-insert into t1 select seq, mod(seq,10), mod(seq,2), seq from seq_1_to_50000;
-explain select b, sum(d) from t1 where c=0 group by b;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index c b 5 NULL # Using where
-select b, sum(d) from t1 where c=0 group by b;
-b sum(d)
-0 125025000
-2 124985000
-4 124995000
-6 125005000
-8 125015000
-set @@optimizer_adjust_secondary_key_costs="disable_forced_index_in_group_by";
-explain select b, sum(d) from t1 where c=0 group by b;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL c NULL NULL NULL # Using where; Using temporary; Using filesort
-select b, sum(d) from t1 where c=0 group by b;
-b sum(d)
-0 125025000
-2 124985000
-4 124995000
-6 125005000
-8 125015000
-drop table t1;
diff --git a/mysql-test/main/secondary_key_costs.test b/mysql-test/main/secondary_key_costs.test
index bf662d40..d3db1376 100644
--- a/mysql-test/main/secondary_key_costs.test
+++ b/mysql-test/main/secondary_key_costs.test
@@ -1,6 +1,5 @@
--source include/have_sequence.inc
--source include/not_embedded.inc
---source include/have_innodb.inc
#
# Show the costs for rowid filter
@@ -52,23 +51,3 @@ select json_detailed(json_extract(@trace, '$**.considered_access_paths'));
--enable_ps_protocol
drop table t1, name, flag2;
-
-select @@optimizer_adjust_secondary_key_costs;
-set @@optimizer_adjust_secondary_key_costs=7;
-select @@optimizer_adjust_secondary_key_costs;
-set @@optimizer_adjust_secondary_key_costs=default;
-
---echo #
---echo # MDEV-33306 Optimizer choosing incorrect index in 10.6, 10.5 but not in 10.4
---echo #
-
-create table t1 (a int primary key, b int, c int, d int, key(b),key(c)) engine=innodb;
-insert into t1 select seq, mod(seq,10), mod(seq,2), seq from seq_1_to_50000;
---replace_column 9 #
-explain select b, sum(d) from t1 where c=0 group by b;
-select b, sum(d) from t1 where c=0 group by b;
-set @@optimizer_adjust_secondary_key_costs="disable_forced_index_in_group_by";
---replace_column 9 #
-explain select b, sum(d) from t1 where c=0 group by b;
-select b, sum(d) from t1 where c=0 group by b;
-drop table t1;
diff --git a/mysql-test/main/select.result b/mysql-test/main/select.result
index 18602caa..db2c5ba2 100644
--- a/mysql-test/main/select.result
+++ b/mysql-test/main/select.result
@@ -603,6 +603,31 @@ explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index
+#
+# Some test with ORDER BY and limit
+#
+explain select count(*) from t3 as t1,t3 where t1.period=t3.period order by t3.period;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index period period 4 NULL 41810 Using where; Using index
+1 SIMPLE t3 ref period period 4 test.t1.period 4181 Using index
+explain select sum(t1.price+t3.price) from t3 as t1,t3 where t1.period=t3.period order by t3.period;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL period NULL NULL NULL 41810
+1 SIMPLE t3 ALL period NULL NULL NULL 41810 Using where; Using join buffer (flat, BNL join)
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
+1 SIMPLE t3 ALL period NULL NULL NULL 41810 Using where; Using join buffer (flat, BNL join)
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t3 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
+1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using where; Using join buffer (flat, BNL join)
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
+1 SIMPLE t3 ALL period NULL NULL NULL 41810 Using where; Using join buffer (flat, BNL join)
+set @save_join_cache_level=@@join_cache_level;
+set @@join_cache_level=0;
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using filesort
@@ -615,6 +640,10 @@ explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period l
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index period period 4 NULL 1
1 SIMPLE t3 ref period period 4 test.t1.period 4181
+set @@join_cache_level=@save_join_cache_level;
+#
+# Search with a constant table.
+#
select period from t1;
period
9410
@@ -1378,18 +1407,28 @@ explain select companynr,companyname from t4 left join t2 using (companynr) wher
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
delete from t2 where fld1=999999;
+#
+# Test left join optimization
+#
+set @save_join_cache_level=@@join_cache_level;
+set @@join_cache_level=0;
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+set @@join_cache_level=@save_join_cache_level;
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where; Using join buffer (flat, BNL join)
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
@@ -1426,6 +1465,9 @@ explain select companynr,companyname from t4 left join t2 using (companynr) wher
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+#
+# Joins with forms.
+#
select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
companynr companynr
37 36
@@ -2364,16 +2406,16 @@ insert into t1 values (1,2), (2,2), (3,2), (4,2);
insert into t2 values (1,3), (2,3), (3,4), (4,4);
explain select * from t1 left join t2 on a=c where d in (4);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ref c,d d 5 const 2
-1 SIMPLE t1 ALL a NULL NULL NULL 4 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 ref c,d d 5 const 2 Using where
+1 SIMPLE t1 ref a a 5 test.t2.c 1
select * from t1 left join t2 on a=c where d in (4);
a b c d
3 2 3 4
4 2 4 4
explain select * from t1 left join t2 on a=c where d = 4;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ref c,d d 5 const 2
-1 SIMPLE t1 ALL a NULL NULL NULL 4 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 ref c,d d 5 const 2 Using where
+1 SIMPLE t1 ref a a 5 test.t2.c 1
select * from t1 left join t2 on a=c where d = 4;
a b c d
3 2 3 4
@@ -2400,11 +2442,11 @@ INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five');
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
-1 SIMPLE t2 ref a a 23 test.t1.a 2 Using where
+1 SIMPLE t2 ref a a 23 test.t1.a 1 Using where
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
-1 SIMPLE t2 ref a a 23 test.t1.a 2 Using where
+1 SIMPLE t2 ref a a 23 test.t1.a 1 Using where
DROP TABLE t1, t2;
CREATE TABLE t1 ( city char(30) );
INSERT INTO t1 VALUES ('London');
@@ -3597,7 +3639,7 @@ CREATE TABLE t1(id int PRIMARY KEY, b int, e int);
CREATE TABLE t2(i int, a int, INDEX si(i), INDEX ai(a));
CREATE TABLE t3(a int PRIMARY KEY, c char(4), INDEX ci(c));
INSERT INTO t1 VALUES
-(1,10,19), (2,20,22), (4,41,42), (9,93,95), (7, 77,79),
+(1,10,19), (2,20,22), (4,41,42), (9,39,95), (7, 77,79),
(6,63,67), (5,55,58), (3,38,39), (8,81,89);
INSERT INTO t2 VALUES
(21,210), (41,410), (82,820), (83,830), (84,840),
@@ -3625,6 +3667,14 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t2 range si,ai si 5 NULL 4 Using index condition; Using where
1 SIMPLE t3 eq_ref|filter PRIMARY,ci PRIMARY|ci 4|5 test.t2.a 1 (30%) Using where; Using rowid filter
+EXPLAIN
+SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3
+WHERE t1.id = 9 AND t2.i BETWEEN t1.b AND t1.e AND
+t3.a=t2.a AND t3.c IN ('bb','ee');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
+1 SIMPLE t2 range si si 5 NULL 13 Using index condition; Using where
+1 SIMPLE t3 eq_ref|filter PRIMARY,ci PRIMARY|ci 4|5 test.t2.a 1 (30%) Using where; Using rowid filter
EXPLAIN
SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3
WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND
@@ -3632,7 +3682,7 @@ t3.c IN ('bb','ee');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t2 range si si 5 NULL 2 Using index condition; Using where
-1 SIMPLE t3 eq_ref|filter PRIMARY,ci PRIMARY|ci 4|5 test.t2.a 1 (30%) Using where; Using rowid filter
+1 SIMPLE t3 eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 Using where
EXPLAIN
SELECT t3.a FROM t1,t2,t3
WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND
@@ -3640,7 +3690,7 @@ t3.c IN ('bb','ee');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t2 range si,ai si 5 NULL 2 Using index condition; Using where
-1 SIMPLE t3 eq_ref|filter PRIMARY,ci PRIMARY|ci 4|5 test.t2.a 1 (30%) Using where; Using rowid filter
+1 SIMPLE t3 eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 Using where
DROP TABLE t1,t2,t3;
CREATE TABLE t1 ( f1 int primary key, f2 int, f3 int, f4 int, f5 int, f6 int, checked_out int);
CREATE TABLE t2 ( f11 int PRIMARY KEY );
@@ -3717,7 +3767,7 @@ COUNT(*)
EXPLAIN SELECT * FROM t1
WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref|filter idx1,idx2 idx2|idx1 4|10 const 2 (6%) Using where; Using rowid filter
+1 SIMPLE t1 index_merge idx1,idx2 idx2,idx1 4,10 NULL 1 Using intersect(idx2,idx1); Using where; Using index
EXPLAIN SELECT * FROM t1
WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null=3 IS NULL ;
id select_type table type possible_keys key key_len ref rows Extra
@@ -3731,7 +3781,7 @@ CREATE UNIQUE INDEX idx1 ON t1(ID1_with_null,ID2_with_null);
EXPLAIN SELECT * FROM t1
WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref|filter idx1,idx2 idx2|idx1 4|10 const 2 (7%) Using where; Using rowid filter
+1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where
EXPLAIN SELECT * FROM t1
WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null IS NULL ;
id select_type table type possible_keys key key_len ref rows Extra
@@ -3876,7 +3926,7 @@ cc 3 7
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
-1 SIMPLE t2 ref name name 6 test.t1.name 2 Using where
+1 SIMPLE t2 ref name name 6 test.t1.name 1 Using where
SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name;
name name n
ccc NULL NULL
@@ -3969,7 +4019,7 @@ cc 3 7
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
-1 SIMPLE t2 ref name name 6 test.t1.name 2 Using where
+1 SIMPLE t2 ref name name 6 test.t1.name 1 Using where
SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name;
name name n
ccc NULL NULL
diff --git a/mysql-test/main/select.test b/mysql-test/main/select.test
index 8ea52b4e..6ac103f5 100644
--- a/mysql-test/main/select.test
+++ b/mysql-test/main/select.test
@@ -1462,17 +1462,26 @@ select distinct fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr orde
explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2nr order by t3.t2nr,fld3;
-#
-# Some test with ORDER BY and limit
-#
+--echo #
+--echo # Some test with ORDER BY and limit
+--echo #
+
+explain select count(*) from t3 as t1,t3 where t1.period=t3.period order by t3.period;
+explain select sum(t1.price+t3.price) from t3 as t1,t3 where t1.period=t3.period order by t3.period;
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
+set @save_join_cache_level=@@join_cache_level;
+set @@join_cache_level=0;
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
+set @@join_cache_level=@save_join_cache_level;
-#
-# Search with a constant table.
-#
+--echo #
+--echo # Search with a constant table.
+--echo #
select period from t1;
select period from t1 where period=1900;
@@ -1533,7 +1542,6 @@ INSERT INTO t4 (companynr, companyname) VALUES (68,'company 10');
INSERT INTO t4 (companynr, companyname) VALUES (50,'company 11');
INSERT INTO t4 (companynr, companyname) VALUES (00,'Unknown');
--enable_query_log
-
#
# Test of stright join to force a full join.
#
@@ -1565,12 +1573,17 @@ explain select companynr,companyname from t2 left join t4 using (companynr) wher
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr is null;
delete from t2 where fld1=999999;
-#
-# Test left join optimization
+--echo #
+--echo # Test left join optimization
+--echo #
+set @save_join_cache_level=@@join_cache_level;
+set @@join_cache_level=0;
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0;
+set @@join_cache_level=@save_join_cache_level;
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0;
@@ -1584,9 +1597,9 @@ explain select companynr,companyname from t4 left join t2 using (companynr) wher
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0;
explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0;
-#
-# Joins with forms.
-#
+--echo #
+--echo # Joins with forms.
+--echo #
select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
@@ -3143,7 +3156,7 @@ CREATE TABLE t2(i int, a int, INDEX si(i), INDEX ai(a));
CREATE TABLE t3(a int PRIMARY KEY, c char(4), INDEX ci(c));
INSERT INTO t1 VALUES
- (1,10,19), (2,20,22), (4,41,42), (9,93,95), (7, 77,79),
+ (1,10,19), (2,20,22), (4,41,42), (9,39,95), (7, 77,79),
(6,63,67), (5,55,58), (3,38,39), (8,81,89);
INSERT INTO t2 VALUES
(21,210), (41,410), (82,820), (83,830), (84,840),
@@ -3165,6 +3178,11 @@ SELECT t3.a FROM t1,t2,t3
WHERE t1.id = 8 AND t2.i BETWEEN t1.b AND t1.e AND
t3.a=t2.a AND t3.c IN ('bb','ee') ;
+EXPLAIN
+SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3
+ WHERE t1.id = 9 AND t2.i BETWEEN t1.b AND t1.e AND
+ t3.a=t2.a AND t3.c IN ('bb','ee');
+
EXPLAIN
SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3
WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND
diff --git a/mysql-test/main/select_jcl6.result b/mysql-test/main/select_jcl6.result
index 4ec370c0..f683adf5 100644
--- a/mysql-test/main/select_jcl6.result
+++ b/mysql-test/main/select_jcl6.result
@@ -614,18 +614,47 @@ explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index
+#
+# Some test with ORDER BY and limit
+#
+explain select count(*) from t3 as t1,t3 where t1.period=t3.period order by t3.period;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index period period 4 NULL 41810 Using where; Using index
+1 SIMPLE t3 ref period period 4 test.t1.period 4181 Using index
+explain select sum(t1.price+t3.price) from t3 as t1,t3 where t1.period=t3.period order by t3.period;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL period NULL NULL NULL 41810
+1 SIMPLE t3 ALL period NULL NULL NULL 41810 Using where; Using join buffer (flat, BNL join)
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
-1 SIMPLE t3 ref period period 4 test.t1.period 4181 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t3 ALL period NULL NULL NULL 41810 Using where; Using join buffer (flat, BNL join)
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
-1 SIMPLE t1 ref period period 4 test.t3.period 4181 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using where; Using join buffer (flat, BNL join)
explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
-1 SIMPLE t3 ref period period 4 test.t1.period 4181 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t3 ALL period NULL NULL NULL 41810 Using where; Using join buffer (flat, BNL join)
+set @save_join_cache_level=@@join_cache_level;
+set @@join_cache_level=0;
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using filesort
+1 SIMPLE t3 ref period period 4 test.t1.period 4181
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t3 index period period 4 NULL 1
+1 SIMPLE t1 ref period period 4 test.t3.period 4181
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index period period 4 NULL 1
+1 SIMPLE t3 ref period period 4 test.t1.period 4181
+set @@join_cache_level=@save_join_cache_level;
+#
+# Search with a constant table.
+#
select period from t1;
period
9410
@@ -1389,18 +1418,28 @@ explain select companynr,companyname from t4 left join t2 using (companynr) wher
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
delete from t2 where fld1=999999;
+#
+# Test left join optimization
+#
+set @save_join_cache_level=@@join_cache_level;
+set @@join_cache_level=0;
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+set @@join_cache_level=@save_join_cache_level;
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 hash_ALL NULL #hash#$hj 1 test.t4.companynr 1199 Using where; Using join buffer (flat, BNLH join)
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
@@ -1437,6 +1476,9 @@ explain select companynr,companyname from t4 left join t2 using (companynr) wher
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
1 SIMPLE t2 hash_ALL NULL #hash#$hj 1 test.t4.companynr 1199 Using where; Using join buffer (flat, BNLH join)
+#
+# Joins with forms.
+#
select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
companynr companynr
37 36
@@ -2375,16 +2417,16 @@ insert into t1 values (1,2), (2,2), (3,2), (4,2);
insert into t2 values (1,3), (2,3), (3,4), (4,4);
explain select * from t1 left join t2 on a=c where d in (4);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ref c,d d 5 const 2
-1 SIMPLE t1 ALL a NULL NULL NULL 4 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 ref c,d d 5 const 2 Using where
+1 SIMPLE t1 ref a a 5 test.t2.c 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
select * from t1 left join t2 on a=c where d in (4);
a b c d
3 2 3 4
4 2 4 4
explain select * from t1 left join t2 on a=c where d = 4;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ref c,d d 5 const 2
-1 SIMPLE t1 ALL a NULL NULL NULL 4 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 ref c,d d 5 const 2 Using where
+1 SIMPLE t1 ref a a 5 test.t2.c 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
select * from t1 left join t2 on a=c where d = 4;
a b c d
3 2 3 4
@@ -2411,11 +2453,11 @@ INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five');
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
-1 SIMPLE t2 ref a a 23 test.t1.a 2 Using where
+1 SIMPLE t2 ref a a 23 test.t1.a 1 Using where
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
-1 SIMPLE t2 ref a a 23 test.t1.a 2 Using where
+1 SIMPLE t2 ref a a 23 test.t1.a 1 Using where
DROP TABLE t1, t2;
CREATE TABLE t1 ( city char(30) );
INSERT INTO t1 VALUES ('London');
@@ -3608,7 +3650,7 @@ CREATE TABLE t1(id int PRIMARY KEY, b int, e int);
CREATE TABLE t2(i int, a int, INDEX si(i), INDEX ai(a));
CREATE TABLE t3(a int PRIMARY KEY, c char(4), INDEX ci(c));
INSERT INTO t1 VALUES
-(1,10,19), (2,20,22), (4,41,42), (9,93,95), (7, 77,79),
+(1,10,19), (2,20,22), (4,41,42), (9,39,95), (7, 77,79),
(6,63,67), (5,55,58), (3,38,39), (8,81,89);
INSERT INTO t2 VALUES
(21,210), (41,410), (82,820), (83,830), (84,840),
@@ -3636,6 +3678,14 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t2 range si,ai si 5 NULL 4 Using index condition; Using where; Rowid-ordered scan
1 SIMPLE t3 eq_ref|filter PRIMARY,ci PRIMARY|ci 4|5 test.t2.a 1 (30%) Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan; Using rowid filter
+EXPLAIN
+SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3
+WHERE t1.id = 9 AND t2.i BETWEEN t1.b AND t1.e AND
+t3.a=t2.a AND t3.c IN ('bb','ee');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
+1 SIMPLE t3 range PRIMARY,ci ci 5 NULL 6 Using index condition; Rowid-ordered scan
+1 SIMPLE t2 hash_range si #hash#$hj:si 5:5 test.t3.a 13 Using where; Rowid-ordered scan; Using join buffer (flat, BNLH join)
EXPLAIN
SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3
WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND
@@ -3643,7 +3693,7 @@ t3.c IN ('bb','ee');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t2 range si si 5 NULL 2 Using index condition; Using where; Rowid-ordered scan
-1 SIMPLE t3 eq_ref|filter PRIMARY,ci PRIMARY|ci 4|5 test.t2.a 1 (30%) Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan; Using rowid filter
+1 SIMPLE t3 eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
EXPLAIN
SELECT t3.a FROM t1,t2,t3
WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND
@@ -3651,7 +3701,7 @@ t3.c IN ('bb','ee');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t2 range si,ai si 5 NULL 2 Using index condition; Using where; Rowid-ordered scan
-1 SIMPLE t3 eq_ref|filter PRIMARY,ci PRIMARY|ci 4|5 test.t2.a 1 (30%) Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan; Using rowid filter
+1 SIMPLE t3 eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
DROP TABLE t1,t2,t3;
CREATE TABLE t1 ( f1 int primary key, f2 int, f3 int, f4 int, f5 int, f6 int, checked_out int);
CREATE TABLE t2 ( f11 int PRIMARY KEY );
@@ -3728,7 +3778,7 @@ COUNT(*)
EXPLAIN SELECT * FROM t1
WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref|filter idx1,idx2 idx2|idx1 4|10 const 2 (6%) Using where; Using rowid filter
+1 SIMPLE t1 index_merge idx1,idx2 idx2,idx1 4,10 NULL 1 Using intersect(idx2,idx1); Using where; Using index
EXPLAIN SELECT * FROM t1
WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null=3 IS NULL ;
id select_type table type possible_keys key key_len ref rows Extra
@@ -3742,7 +3792,7 @@ CREATE UNIQUE INDEX idx1 ON t1(ID1_with_null,ID2_with_null);
EXPLAIN SELECT * FROM t1
WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref|filter idx1,idx2 idx2|idx1 4|10 const 2 (7%) Using where; Using rowid filter
+1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where
EXPLAIN SELECT * FROM t1
WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null IS NULL ;
id select_type table type possible_keys key key_len ref rows Extra
@@ -3887,7 +3937,7 @@ cc 3 7
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
-1 SIMPLE t2 ref name name 6 test.t1.name 2 Using where
+1 SIMPLE t2 ref name name 6 test.t1.name 1 Using where
SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name;
name name n
ccc NULL NULL
@@ -3980,7 +4030,7 @@ cc 3 7
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
-1 SIMPLE t2 ref name name 6 test.t1.name 2 Using where
+1 SIMPLE t2 ref name name 6 test.t1.name 1 Using where
SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name;
name name n
ccc NULL NULL
diff --git a/mysql-test/main/select_pkeycache.result b/mysql-test/main/select_pkeycache.result
index 18602caa..db2c5ba2 100644
--- a/mysql-test/main/select_pkeycache.result
+++ b/mysql-test/main/select_pkeycache.result
@@ -603,6 +603,31 @@ explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index
+#
+# Some test with ORDER BY and limit
+#
+explain select count(*) from t3 as t1,t3 where t1.period=t3.period order by t3.period;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index period period 4 NULL 41810 Using where; Using index
+1 SIMPLE t3 ref period period 4 test.t1.period 4181 Using index
+explain select sum(t1.price+t3.price) from t3 as t1,t3 where t1.period=t3.period order by t3.period;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL period NULL NULL NULL 41810
+1 SIMPLE t3 ALL period NULL NULL NULL 41810 Using where; Using join buffer (flat, BNL join)
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
+1 SIMPLE t3 ALL period NULL NULL NULL 41810 Using where; Using join buffer (flat, BNL join)
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period limit 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t3 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
+1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using where; Using join buffer (flat, BNL join)
+explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period limit 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using temporary; Using filesort
+1 SIMPLE t3 ALL period NULL NULL NULL 41810 Using where; Using join buffer (flat, BNL join)
+set @save_join_cache_level=@@join_cache_level;
+set @@join_cache_level=0;
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using filesort
@@ -615,6 +640,10 @@ explain select * from t3 as t1,t3 where t1.period=t3.period order by t1.period l
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index period period 4 NULL 1
1 SIMPLE t3 ref period period 4 test.t1.period 4181
+set @@join_cache_level=@save_join_cache_level;
+#
+# Search with a constant table.
+#
select period from t1;
period
9410
@@ -1378,18 +1407,28 @@ explain select companynr,companyname from t4 left join t2 using (companynr) wher
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
delete from t2 where fld1=999999;
+#
+# Test left join optimization
+#
+set @save_join_cache_level=@@join_cache_level;
+set @@join_cache_level=0;
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
-1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
+set @@join_cache_level=@save_join_cache_level;
+explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where; Using join buffer (flat, BNL join)
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
@@ -1426,6 +1465,9 @@ explain select companynr,companyname from t4 left join t2 using (companynr) wher
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
+#
+# Joins with forms.
+#
select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
companynr companynr
37 36
@@ -2364,16 +2406,16 @@ insert into t1 values (1,2), (2,2), (3,2), (4,2);
insert into t2 values (1,3), (2,3), (3,4), (4,4);
explain select * from t1 left join t2 on a=c where d in (4);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ref c,d d 5 const 2
-1 SIMPLE t1 ALL a NULL NULL NULL 4 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 ref c,d d 5 const 2 Using where
+1 SIMPLE t1 ref a a 5 test.t2.c 1
select * from t1 left join t2 on a=c where d in (4);
a b c d
3 2 3 4
4 2 4 4
explain select * from t1 left join t2 on a=c where d = 4;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 ref c,d d 5 const 2
-1 SIMPLE t1 ALL a NULL NULL NULL 4 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 ref c,d d 5 const 2 Using where
+1 SIMPLE t1 ref a a 5 test.t2.c 1
select * from t1 left join t2 on a=c where d = 4;
a b c d
3 2 3 4
@@ -2400,11 +2442,11 @@ INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five');
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
-1 SIMPLE t2 ref a a 23 test.t1.a 2 Using where
+1 SIMPLE t2 ref a a 23 test.t1.a 1 Using where
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
-1 SIMPLE t2 ref a a 23 test.t1.a 2 Using where
+1 SIMPLE t2 ref a a 23 test.t1.a 1 Using where
DROP TABLE t1, t2;
CREATE TABLE t1 ( city char(30) );
INSERT INTO t1 VALUES ('London');
@@ -3597,7 +3639,7 @@ CREATE TABLE t1(id int PRIMARY KEY, b int, e int);
CREATE TABLE t2(i int, a int, INDEX si(i), INDEX ai(a));
CREATE TABLE t3(a int PRIMARY KEY, c char(4), INDEX ci(c));
INSERT INTO t1 VALUES
-(1,10,19), (2,20,22), (4,41,42), (9,93,95), (7, 77,79),
+(1,10,19), (2,20,22), (4,41,42), (9,39,95), (7, 77,79),
(6,63,67), (5,55,58), (3,38,39), (8,81,89);
INSERT INTO t2 VALUES
(21,210), (41,410), (82,820), (83,830), (84,840),
@@ -3625,6 +3667,14 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t2 range si,ai si 5 NULL 4 Using index condition; Using where
1 SIMPLE t3 eq_ref|filter PRIMARY,ci PRIMARY|ci 4|5 test.t2.a 1 (30%) Using where; Using rowid filter
+EXPLAIN
+SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3
+WHERE t1.id = 9 AND t2.i BETWEEN t1.b AND t1.e AND
+t3.a=t2.a AND t3.c IN ('bb','ee');
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
+1 SIMPLE t2 range si si 5 NULL 13 Using index condition; Using where
+1 SIMPLE t3 eq_ref|filter PRIMARY,ci PRIMARY|ci 4|5 test.t2.a 1 (30%) Using where; Using rowid filter
EXPLAIN
SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3
WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND
@@ -3632,7 +3682,7 @@ t3.c IN ('bb','ee');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t2 range si si 5 NULL 2 Using index condition; Using where
-1 SIMPLE t3 eq_ref|filter PRIMARY,ci PRIMARY|ci 4|5 test.t2.a 1 (30%) Using where; Using rowid filter
+1 SIMPLE t3 eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 Using where
EXPLAIN
SELECT t3.a FROM t1,t2,t3
WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND
@@ -3640,7 +3690,7 @@ t3.c IN ('bb','ee');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t2 range si,ai si 5 NULL 2 Using index condition; Using where
-1 SIMPLE t3 eq_ref|filter PRIMARY,ci PRIMARY|ci 4|5 test.t2.a 1 (30%) Using where; Using rowid filter
+1 SIMPLE t3 eq_ref PRIMARY,ci PRIMARY 4 test.t2.a 1 Using where
DROP TABLE t1,t2,t3;
CREATE TABLE t1 ( f1 int primary key, f2 int, f3 int, f4 int, f5 int, f6 int, checked_out int);
CREATE TABLE t2 ( f11 int PRIMARY KEY );
@@ -3717,7 +3767,7 @@ COUNT(*)
EXPLAIN SELECT * FROM t1
WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref|filter idx1,idx2 idx2|idx1 4|10 const 2 (6%) Using where; Using rowid filter
+1 SIMPLE t1 index_merge idx1,idx2 idx2,idx1 4,10 NULL 1 Using intersect(idx2,idx1); Using where; Using index
EXPLAIN SELECT * FROM t1
WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null=3 IS NULL ;
id select_type table type possible_keys key key_len ref rows Extra
@@ -3731,7 +3781,7 @@ CREATE UNIQUE INDEX idx1 ON t1(ID1_with_null,ID2_with_null);
EXPLAIN SELECT * FROM t1
WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref|filter idx1,idx2 idx2|idx1 4|10 const 2 (7%) Using where; Using rowid filter
+1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where
EXPLAIN SELECT * FROM t1
WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null IS NULL ;
id select_type table type possible_keys key key_len ref rows Extra
@@ -3876,7 +3926,7 @@ cc 3 7
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
-1 SIMPLE t2 ref name name 6 test.t1.name 2 Using where
+1 SIMPLE t2 ref name name 6 test.t1.name 1 Using where
SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name;
name name n
ccc NULL NULL
@@ -3969,7 +4019,7 @@ cc 3 7
EXPLAIN SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
-1 SIMPLE t2 ref name name 6 test.t1.name 2 Using where
+1 SIMPLE t2 ref name name 6 test.t1.name 1 Using where
SELECT * FROM t1 LEFT JOIN t2 ON t1.name=t2.name;
name name n
ccc NULL NULL
diff --git a/mysql-test/main/select_safe.result b/mysql-test/main/select_safe.result
index 649e2dc4..a16d5439 100644
--- a/mysql-test/main/select_safe.result
+++ b/mysql-test/main/select_safe.result
@@ -67,6 +67,7 @@ test.t1 analyze status OK
insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a");
insert into t1 values (null,"b"),(null,"b"),(null,"c"),(null,"c"),(null,"d"),(null,"d"),(null,"e"),(null,"e"),(null,"a"),(null,"e");
insert into t1 values (null,"x"),(null,"x"),(null,"y"),(null,"y"),(null,"z"),(null,"z"),(null,"v"),(null,"v"),(null,"a"),(null,"v");
+set @@optimizer_where_cost=0.3;
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL b NULL NULL NULL 11
diff --git a/mysql-test/main/select_safe.test b/mysql-test/main/select_safe.test
index c76e337c..b9788cf2 100644
--- a/mysql-test/main/select_safe.test
+++ b/mysql-test/main/select_safe.test
@@ -60,6 +60,7 @@ analyze table t1;
insert into t1 values (null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a"),(null,"a");
insert into t1 values (null,"b"),(null,"b"),(null,"c"),(null,"c"),(null,"d"),(null,"d"),(null,"e"),(null,"e"),(null,"a"),(null,"e");
insert into t1 values (null,"x"),(null,"x"),(null,"y"),(null,"y"),(null,"z"),(null,"z"),(null,"v"),(null,"v"),(null,"a"),(null,"v");
+set @@optimizer_where_cost=0.3;
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
set MAX_SEEKS_FOR_KEY=1;
explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b;
diff --git a/mysql-test/main/selectivity.result b/mysql-test/main/selectivity.result
index c086a967..f07720bb 100644
--- a/mysql-test/main/selectivity.result
+++ b/mysql-test/main/selectivity.result
@@ -52,7 +52,7 @@ part, supplier, partsupp, nation, region
where
p_partkey = ps_partkey
and s_suppkey = ps_suppkey
-and p_size = 9
+and (p_size = 9 or p_size =19999)
and p_type like '%TIN'
and s_nationkey = n_nationkey
and n_regionkey = r_regionkey
@@ -72,18 +72,18 @@ and r_name = 'ASIA'
order by
s_acctbal desc, n_name, s_name, p_partkey;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 0.31 Using where; Using temporary; Using filesort
-1 PRIMARY partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey i_ps_partkey 4 dbt3_s001.part.p_partkey 3 100.00 Using where
+1 PRIMARY region ALL PRIMARY NULL NULL NULL 5 20.00 Using where; Using temporary; Using filesort
+1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 0.63 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where
1 PRIMARY supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.partsupp.ps_suppkey 1 100.00 Using where
1 PRIMARY nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where
-1 PRIMARY region eq_ref PRIMARY PRIMARY 4 dbt3_s001.nation.n_regionkey 1 20.00 Using where
-2 DEPENDENT SUBQUERY region ALL PRIMARY NULL NULL NULL 5 20.00 Using where
-2 DEPENDENT SUBQUERY partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey i_ps_partkey 4 dbt3_s001.part.p_partkey 3 100.00
+2 DEPENDENT SUBQUERY partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00
2 DEPENDENT SUBQUERY supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.partsupp.ps_suppkey 1 100.00 Using where
2 DEPENDENT SUBQUERY nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where
+2 DEPENDENT SUBQUERY region eq_ref PRIMARY PRIMARY 4 dbt3_s001.nation.n_regionkey 1 20.00 Using where
Warnings:
Note 1276 Field or reference 'dbt3_s001.part.p_partkey' of SELECT #2 was resolved in SELECT #1
-Note 1003 /* select#1 */ select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`part`.`p_size` = 9 and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`region`.`r_regionkey` = `dbt3_s001`.`nation`.`n_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_type` like '%TIN' and `dbt3_s001`.`partsupp`.`ps_supplycost` = <expr_cache><`dbt3_s001`.`part`.`p_partkey`>((/* select#2 */ select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey`
+Note 1003 /* select#1 */ select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and (`dbt3_s001`.`part`.`p_size` = 9 or `dbt3_s001`.`part`.`p_size` = 19999) and `dbt3_s001`.`part`.`p_type` like '%TIN' and `dbt3_s001`.`partsupp`.`ps_supplycost` = <expr_cache><`dbt3_s001`.`part`.`p_partkey`>((/* select#2 */ select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`region`.`r_regionkey` = `dbt3_s001`.`nation`.`n_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey`
set optimizer_use_condition_selectivity=4;
explain extended
select
@@ -118,13 +118,13 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 100.00
1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 2.08 Using where; Using join buffer (flat, BNL join)
1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 100.00 Using where
-2 DEPENDENT SUBQUERY region ALL PRIMARY NULL NULL NULL 5 20.00 Using where
-2 DEPENDENT SUBQUERY partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey i_ps_partkey 4 dbt3_s001.part.p_partkey 3 100.00
+2 DEPENDENT SUBQUERY partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00
2 DEPENDENT SUBQUERY supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.partsupp.ps_suppkey 1 100.00 Using where
2 DEPENDENT SUBQUERY nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where
+2 DEPENDENT SUBQUERY region eq_ref PRIMARY PRIMARY 4 dbt3_s001.nation.n_regionkey 1 20.00 Using where
Warnings:
Note 1276 Field or reference 'dbt3_s001.part.p_partkey' of SELECT #2 was resolved in SELECT #1
-Note 1003 /* select#1 */ select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`part`.`p_size` = 9 and `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_type` like '%TIN' and `dbt3_s001`.`partsupp`.`ps_supplycost` = <expr_cache><`dbt3_s001`.`part`.`p_partkey`>((/* select#2 */ select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey`
+Note 1003 /* select#1 */ select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`part`.`p_size` = 9 and `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_type` like '%TIN' and `dbt3_s001`.`partsupp`.`ps_supplycost` = <expr_cache><`dbt3_s001`.`part`.`p_partkey`>((/* select#2 */ select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`region`.`r_regionkey` = `dbt3_s001`.`nation`.`n_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey`
=== Q15 ===
create view revenue0 (supplier_no, total_revenue) as
select l_suppkey, sum(l_extendedprice * (1 - l_discount))
@@ -490,7 +490,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
2 MATERIALIZED part ALL PRIMARY NULL NULL NULL 200 100.00 Using where
2 MATERIALIZED partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey i_ps_partkey 4 dbt3_s001.part.p_partkey 3 100.00 Using where
-4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 100.00 Using where
+4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 15.14 Using where
Warnings:
Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2
Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2
@@ -541,8 +541,8 @@ limit 10;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY nation ALL PRIMARY NULL NULL NULL 25 4.00 Using where; Using temporary; Using filesort
1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 100.00
-1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 4.17 Using where; Start temporary; Using join buffer (flat, BNL join)
-1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 100.00 Using where; End temporary
+1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 4.17 Using where
+1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 11.99 Using where; FirstMatch(supplier)
4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 15.14 Using where
Warnings:
Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2
@@ -597,7 +597,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY nation ALL PRIMARY NULL NULL NULL 25 4.00 Using where; Using temporary; Using filesort
1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 100.00
1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 7.03 Using where
-1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 100.00 Using where; FirstMatch(supplier)
+1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 7.11 Using where; FirstMatch(supplier)
4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 15.14 Using where
Warnings:
Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2
@@ -652,7 +652,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY nation ALL PRIMARY NULL NULL NULL 25 4.00 Using where; Using temporary; Using filesort
1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 100.00
1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 7.81 Using where
-1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 100.00 Using where; FirstMatch(supplier)
+1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 6.40 Using where; FirstMatch(supplier)
4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 15.14 Using where
Warnings:
Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2
@@ -707,7 +707,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY nation ALL PRIMARY NULL NULL NULL 25 4.00 Using where; Using temporary; Using filesort
1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 100.00
1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 7.81 Using where
-1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 100.00 Using where; FirstMatch(supplier)
+1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 6.40 Using where; FirstMatch(supplier)
4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 15.14 Using where
Warnings:
Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2
@@ -755,7 +755,7 @@ EXPLAIN EXTENDED
SELECT * FROM v1 INNER JOIN t2 ON ( a = c AND b = d );
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
-1 SIMPLE t2 ref idx idx 5 test.t1.b 2 100.00 Using where
+1 SIMPLE t2 ref idx idx 5 test.t1.b 1 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`c` = `test`.`t1`.`a` and `test`.`t2`.`d` = `test`.`t1`.`b`
SELECT * FROM v1 INNER JOIN t2 ON ( a = c AND b = d );
@@ -1641,27 +1641,51 @@ drop function f1;
#
create table t1 (a int, b int, key (b), key (a));
insert into t1
-select (rand(1)*1000)/10, (rand(1001)*1000)/20 from seq_1_to_1000;
-analyze table t1 persistent for all;
+select (rand(1)*1000)/30, (rand(1001)*1000)/40 from seq_1_to_1000;
+analyze table t1 ;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status Table is already up to date
+select count(*) from t1 where b=2;
+count(*)
+42
+select count(*) from t1 where a in (17,51,5);
+count(*)
+62
# Check what info the optimizer has about selectivities
explain extended select * from t1 use index () where a in (17,51,5);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 2.90 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 6.20 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` USE INDEX () where `test`.`t1`.`a` in (17,51,5)
explain extended select * from t1 use index () where b=2;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 2.40 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 4.20 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` USE INDEX () where `test`.`t1`.`b` = 2
# Now, the equality is used for ref access, while the range condition
# gives selectivity data
explain extended select * from t1 where a in (17,51,5) and b=2;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ref b,a b 5 const 24 2.90 Using where
+1 SIMPLE t1 ref|filter b,a b|a 5|5 const 42 (6%) 6.30 Using where; Using rowid filter
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` in (17,51,5)
+truncate table t1;
+insert into t1
+select (rand(1)*1000)/10, (rand(1001)*1000)/50 from seq_1_to_1000;
+analyze table t1 ;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
+select count(*) from t1 where b=2;
+count(*)
+59
+select count(*) from t1 where a in (17,51,5);
+count(*)
+29
+explain extended select * from t1 where a in (17,51,5) and b=2;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 range|filter b,a a|b 5|5 NULL 29 (6%) 5.80 Using index condition; Using where; Using rowid filter
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` in (17,51,5)
drop table t1;
@@ -1790,7 +1814,7 @@ set optimizer_use_condition_selectivity=2;
explain extended select t1.b,t2.a,t3.a,t3.b from t1,t2,t3
where t1.c = t2.a AND t1.d = t3.a and t1.a = 50 and t1.b <= 100;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 range a a 10 NULL 9 9.00 Using index condition; Using where
+1 SIMPLE t1 range a a 10 NULL 9 100.00 Using index condition; Using where
1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 Using index
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.d 1 100.00
Warnings:
@@ -1808,6 +1832,18 @@ b a a b
7 7 8 8
8 8 9 9
9 9 10 10
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain extended select t1.b,t2.a,t3.a,t3.b from t1,t2,t3
+where t1.c = t2.a AND t1.d = t3.a and t1.a = 50 and t1.b <= 100;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 range a a 10 NULL 9 100.00 Using index condition; Using where
+1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 Using index
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.d 1 100.00
+Warnings:
+Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t2`.`a` = `test`.`t1`.`c` and `test`.`t3`.`a` = `test`.`t1`.`d` and `test`.`t1`.`a` = 50 and `test`.`t1`.`b` <= 100
set optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
drop table t1,t2,t3;
#
@@ -1855,7 +1891,7 @@ WHERE A.a=t1.a AND t2.b < 20);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 100 Using where
3 DEPENDENT SUBQUERY A ref PRIMARY,a a 5 test.t1.a 1
-3 DEPENDENT SUBQUERY t2 ref|filter a,b a|b 5|5 test.A.id 1 (10%) Using where; Using rowid filter
+3 DEPENDENT SUBQUERY t2 ref a,b a 5 test.A.id 1 Using where
set statement optimizer_use_condition_selectivity=4 for explain SELECT * FROM t1
WHERE
EXISTS (SELECT * FROM t1 A INNER JOIN t2 ON t2.a = A.id
@@ -1863,7 +1899,7 @@ WHERE A.a=t1.a AND t2.b < 20);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 100 Using where
3 DEPENDENT SUBQUERY A ref PRIMARY,a a 5 test.t1.a 1
-3 DEPENDENT SUBQUERY t2 ref|filter a,b a|b 5|5 test.A.id 1 (10%) Using where; Using rowid filter
+3 DEPENDENT SUBQUERY t2 ref a,b a 5 test.A.id 1 Using where
set @query="EXPLAIN SELECT * FROM t1 A, t1 B WHERE A.a = B.a and A.id = 65";
set statement optimizer_use_condition_selectivity=2 for explain SELECT * FROM t1
WHERE
@@ -1872,7 +1908,7 @@ WHERE A.a=t1.a AND t2.b < 20);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 100 Using where
3 DEPENDENT SUBQUERY A ref PRIMARY,a a 5 test.t1.a 1
-3 DEPENDENT SUBQUERY t2 ref|filter a,b a|b 5|5 test.A.id 1 (10%) Using where; Using rowid filter
+3 DEPENDENT SUBQUERY t2 ref a,b a 5 test.A.id 1 Using where
set statement optimizer_use_condition_selectivity=4 for explain SELECT * FROM t1
WHERE
EXISTS (SELECT * FROM t1 A INNER JOIN t2 ON t2.a = A.id
@@ -1880,7 +1916,7 @@ WHERE A.a=t1.a AND t2.b < 20);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 100 Using where
3 DEPENDENT SUBQUERY A ref PRIMARY,a a 5 test.t1.a 1
-3 DEPENDENT SUBQUERY t2 ref|filter a,b a|b 5|5 test.A.id 1 (10%) Using where; Using rowid filter
+3 DEPENDENT SUBQUERY t2 ref a,b a 5 test.A.id 1 Using where
explain SELECT * FROM t1
WHERE
EXISTS (SELECT * FROM t1 A INNER JOIN t2 ON t2.a = A.id
@@ -1888,7 +1924,7 @@ WHERE A.a=t1.a AND t2.b < 20);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 100 Using where
2 DEPENDENT SUBQUERY A ref PRIMARY,a a 5 test.t1.a 1
-2 DEPENDENT SUBQUERY t2 ref|filter a,b a|b 5|5 test.A.id 1 (10%) Using where; Using rowid filter
+2 DEPENDENT SUBQUERY t2 ref a,b a 5 test.A.id 1 Using where
set optimizer_switch= @save_optimizer_switch;
drop table t1,t2;
#
@@ -1966,3 +2002,114 @@ set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivi
set histogram_size=@save_histogram_size;
set use_stat_tables= @save_use_stat_tables;
set @@global.histogram_size=@save_histogram_size;
+#
+# MDEV-20595
+# Assertion `0 < sel && sel <= 2.0' failed in table_cond_selectivity
+#
+create table t1 (id int, a int, PRIMARY KEY(id), key(a));
+insert into t1 select seq,seq from seq_1_to_100;
+create table t2 (id int, a int, b int, PRIMARY KEY(id), key(a), key(b));
+insert into t2 select seq,seq,seq from seq_1_to_100;
+set optimizer_use_condition_selectivity=2;
+EXPLAIN SELECT * FROM t1 A, t1 B WHERE A.a = B.a and A.id = 65;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE A const PRIMARY,a PRIMARY 4 const 1
+1 SIMPLE B ref a a 5 const 1
+set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
+drop table t1,t2;
+#
+# MDEV-30360 Assertion `cond_selectivity <= 1.000000001' failed in get_range_limit_read_cost
+# with LIMIT .. OFFSET
+#
+CREATE TABLE t1 (a INT, b VARCHAR(1), KEY(b), KEY(a)) engine=myisam;
+INSERT INTO t1 VALUES
+(3,'a'),(2,'g'),(5,'v'),(9,'n'),(6,'u'),
+(7,'s'),(0,'z'),(3,'z'),(NULL,'m'),(6,'r');
+CREATE TABLE t2 (pk INT PRIMARY KEY);
+INSERT INTO t2 VALUES (1),(2);
+SELECT STRAIGHT_JOIN pk FROM t1 JOIN t2 ON a = pk WHERE b >= 'A' ORDER BY t2.pk LIMIT 8 OFFSET 1;
+pk
+DROP TABLE t1, t2;
+#
+# MDEV-30659 Server crash on EXPLAIN SELECT/SELECT on table with
+# engine Aria for LooseScan Strategy
+#
+create table t1 (old_c1 integer, old_c2 integer, c1 integer,
+c2 integer, c3 integer) engine=aria;
+insert into t1(c1,c2,c3)
+values (1,1,1), (1,2,2), (1,3,3),
+(2,1,4), (2,2,5), (2,3,6),
+(2,4,7), (2,5,8);
+create index t1_c2 on t1 (c2,c1);
+explain select * from t1 where t1.c2 in (select a.c2 from t1 a) and
+c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a range t1_c2 t1_c2 5 NULL 5 Using where; Using index; LooseScan
+1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 1
+drop table t1;
+create table t1 (old_c1 integer, old_c2 integer, c1 integer,
+c2 integer, c3 integer) engine=aria;
+create trigger trg_t1 before update on t1 for each row
+begin
+set new.old_c1=old.c1;
+set new.old_c2=old.c2;
+end;
+/
+insert into t1 (c1,c2,c3) values
+(1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+create index t1_c2 on t1 (c2,c1);
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table t2 as select * from t1;
+truncate table t1;
+insert into t1 select * from t2;
+explain select * from t1 where t1.c2 in (select a.c2 from t1 a) and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a range t1_c2 t1_c2 5 NULL 5 Using where; Using index; LooseScan
+1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 1
+drop trigger trg_t1;
+drop table t1,t2;
+create table t1 (old_c1 integer, old_c2 integer, c1 integer,
+c2 integer, c3 integer) engine=aria;
+insert into t1 (c1,c2,c3) values
+(1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+create index t1_c2 on t1 (c2,c1);
+create table t2 as select * from t1;
+truncate table t1;
+insert into t1 select * from t2;
+explain select * from t1 where t1.c2 in (select a.c2 from t1 a) and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a range t1_c2 t1_c2 5 NULL 5 Using where; Using index; LooseScan
+1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 2
+drop table t1,t2;
+#
+# MDEV-31864 Assertion `d >= 0' failed in COST_ADD with join_cache_level
+# > 2 and partitions
+#
+SET join_cache_level= 3;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (b INT, c INT);
+INSERT INTO t2 VALUES (3,4),(5,6);
+CREATE TABLE t3 (d INT, e INT) PARTITION BY RANGE COLUMNS (d) (p1 VALUES LESS THAN (1000), pn VALUES LESS THAN (MAXVALUE));
+ANALYZE TABLE t1, t2, t3 PERSISTENT FOR ALL;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+test.t2 analyze status Engine-independent statistics collected
+test.t2 analyze status OK
+test.t3 analyze status Engine-independent statistics collected
+test.t3 analyze status OK
+explain SELECT * FROM t1 LEFT JOIN (t2 JOIN t3 ON t2.b = t3.e) ON t2.c = 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where
+1 SIMPLE t3 ALL NULL NULL NULL NULL 0 Using where
+SELECT * FROM t1 LEFT JOIN (t2 JOIN t3 ON t2.b = t3.e) ON t2.c = 1;
+a b c d e
+1 NULL NULL NULL NULL
+2 NULL NULL NULL NULL
+set join_cache_level= default;
+DROP TABLE t1, t2, t3;
diff --git a/mysql-test/main/selectivity.test b/mysql-test/main/selectivity.test
index bcaf599e..9c68dbe5 100644
--- a/mysql-test/main/selectivity.test
+++ b/mysql-test/main/selectivity.test
@@ -2,6 +2,7 @@
--source include/have_stat_tables.inc
--source include/have_sequence.inc
--source include/default_charset.inc
+--source include/have_partition.inc
--disable_warnings
drop table if exists t0,t1,t2,t3;
@@ -67,7 +68,9 @@ customer, lineitem, nation, orders, part, partsupp, region, supplier;
--enable_query_log
--echo === Q2 ===
-
+# "or p_size =19999" is added to avoid symmetry between
+# region (5 rows * 20% selectivity) = 1 and
+# part (200 rows * 0.5% selectivity) = 1
set optimizer_use_condition_selectivity=5;
explain extended
select
@@ -77,7 +80,7 @@ from
where
p_partkey = ps_partkey
and s_suppkey = ps_suppkey
- and p_size = 9
+ and (p_size = 9 or p_size =19999)
and p_type like '%TIN'
and s_nationkey = n_nationkey
and n_regionkey = r_regionkey
@@ -1115,8 +1118,10 @@ drop function f1;
--echo #
create table t1 (a int, b int, key (b), key (a));
insert into t1
-select (rand(1)*1000)/10, (rand(1001)*1000)/20 from seq_1_to_1000;
-analyze table t1 persistent for all;
+select (rand(1)*1000)/30, (rand(1001)*1000)/40 from seq_1_to_1000;
+analyze table t1 ;
+select count(*) from t1 where b=2;
+select count(*) from t1 where a in (17,51,5);
--echo # Check what info the optimizer has about selectivities
explain extended select * from t1 use index () where a in (17,51,5);
@@ -1125,6 +1130,13 @@ explain extended select * from t1 use index () where b=2;
--echo # Now, the equality is used for ref access, while the range condition
--echo # gives selectivity data
explain extended select * from t1 where a in (17,51,5) and b=2;
+truncate table t1;
+insert into t1
+select (rand(1)*1000)/10, (rand(1001)*1000)/50 from seq_1_to_1000;
+analyze table t1 ;
+select count(*) from t1 where b=2;
+select count(*) from t1 where a in (17,51,5);
+explain extended select * from t1 where a in (17,51,5) and b=2;
drop table t1;
set use_stat_tables= @save_use_stat_tables;
@@ -1236,6 +1248,8 @@ eval $query;
set optimizer_use_condition_selectivity=2;
eval explain extended $query;
eval $query;
+analyze table t1;
+eval explain extended $query;
set optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
drop table t1,t2,t3;
@@ -1337,3 +1351,106 @@ set histogram_size=@save_histogram_size;
set use_stat_tables= @save_use_stat_tables;
--source include/restore_charset.inc
set @@global.histogram_size=@save_histogram_size;
+
+--echo #
+--echo # MDEV-20595
+--echo # Assertion `0 < sel && sel <= 2.0' failed in table_cond_selectivity
+--echo #
+
+create table t1 (id int, a int, PRIMARY KEY(id), key(a));
+insert into t1 select seq,seq from seq_1_to_100;
+create table t2 (id int, a int, b int, PRIMARY KEY(id), key(a), key(b));
+insert into t2 select seq,seq,seq from seq_1_to_100;
+
+set optimizer_use_condition_selectivity=2;
+EXPLAIN SELECT * FROM t1 A, t1 B WHERE A.a = B.a and A.id = 65;
+set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
+drop table t1,t2;
+
+--echo #
+--echo # MDEV-30360 Assertion `cond_selectivity <= 1.000000001' failed in get_range_limit_read_cost
+--echo # with LIMIT .. OFFSET
+--echo #
+
+CREATE TABLE t1 (a INT, b VARCHAR(1), KEY(b), KEY(a)) engine=myisam;
+INSERT INTO t1 VALUES
+(3,'a'),(2,'g'),(5,'v'),(9,'n'),(6,'u'),
+(7,'s'),(0,'z'),(3,'z'),(NULL,'m'),(6,'r');
+
+CREATE TABLE t2 (pk INT PRIMARY KEY);
+INSERT INTO t2 VALUES (1),(2);
+
+SELECT STRAIGHT_JOIN pk FROM t1 JOIN t2 ON a = pk WHERE b >= 'A' ORDER BY t2.pk LIMIT 8 OFFSET 1;
+
+DROP TABLE t1, t2;
+
+--echo #
+--echo # MDEV-30659 Server crash on EXPLAIN SELECT/SELECT on table with
+--echo # engine Aria for LooseScan Strategy
+--echo #
+
+create table t1 (old_c1 integer, old_c2 integer, c1 integer,
+ c2 integer, c3 integer) engine=aria;
+insert into t1(c1,c2,c3)
+ values (1,1,1), (1,2,2), (1,3,3),
+ (2,1,4), (2,2,5), (2,3,6),
+ (2,4,7), (2,5,8);
+create index t1_c2 on t1 (c2,c1);
+
+explain select * from t1 where t1.c2 in (select a.c2 from t1 a) and
+c2 >= 3 order by c2;
+drop table t1;
+
+create table t1 (old_c1 integer, old_c2 integer, c1 integer,
+ c2 integer, c3 integer) engine=aria;
+
+delimiter /;
+create trigger trg_t1 before update on t1 for each row
+begin
+ set new.old_c1=old.c1;
+ set new.old_c2=old.c2;
+end;
+/
+delimiter ;/
+
+insert into t1 (c1,c2,c3) values
+ (1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+create index t1_c2 on t1 (c2,c1);
+analyze table t1 persistent for all;
+create table t2 as select * from t1;
+truncate table t1;
+insert into t1 select * from t2;
+explain select * from t1 where t1.c2 in (select a.c2 from t1 a) and c2 >= 3 order by c2;
+drop trigger trg_t1;
+drop table t1,t2;
+
+create table t1 (old_c1 integer, old_c2 integer, c1 integer,
+ c2 integer, c3 integer) engine=aria;
+insert into t1 (c1,c2,c3) values
+ (1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+create index t1_c2 on t1 (c2,c1);
+create table t2 as select * from t1;
+truncate table t1;
+insert into t1 select * from t2;
+explain select * from t1 where t1.c2 in (select a.c2 from t1 a) and c2 >= 3 order by c2;
+drop table t1,t2;
+
+--echo #
+--echo # MDEV-31864 Assertion `d >= 0' failed in COST_ADD with join_cache_level
+--echo # > 2 and partitions
+--echo #
+
+SET join_cache_level= 3;
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (b INT, c INT);
+INSERT INTO t2 VALUES (3,4),(5,6);
+CREATE TABLE t3 (d INT, e INT) PARTITION BY RANGE COLUMNS (d) (p1 VALUES LESS THAN (1000), pn VALUES LESS THAN (MAXVALUE));
+ANALYZE TABLE t1, t2, t3 PERSISTENT FOR ALL;
+
+explain SELECT * FROM t1 LEFT JOIN (t2 JOIN t3 ON t2.b = t3.e) ON t2.c = 1;
+SELECT * FROM t1 LEFT JOIN (t2 JOIN t3 ON t2.b = t3.e) ON t2.c = 1;
+
+set join_cache_level= default;
+DROP TABLE t1, t2, t3; \ No newline at end of file
diff --git a/mysql-test/main/selectivity_innodb.result b/mysql-test/main/selectivity_innodb.result
index c7eb4ac2..102242dc 100644
--- a/mysql-test/main/selectivity_innodb.result
+++ b/mysql-test/main/selectivity_innodb.result
@@ -57,7 +57,7 @@ part, supplier, partsupp, nation, region
where
p_partkey = ps_partkey
and s_suppkey = ps_suppkey
-and p_size = 9
+and (p_size = 9 or p_size =19999)
and p_type like '%TIN'
and s_nationkey = n_nationkey
and n_regionkey = r_regionkey
@@ -77,18 +77,18 @@ and r_name = 'ASIA'
order by
s_acctbal desc, n_name, s_name, p_partkey;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 0.31 Using where; Using temporary; Using filesort
-1 PRIMARY region ALL PRIMARY NULL NULL NULL 5 20.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY region ALL PRIMARY NULL NULL NULL 5 20.00 Using where; Using temporary; Using filesort
+1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 0.63 Using where; Using join buffer (flat, BNL join)
1 PRIMARY partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where
1 PRIMARY supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.partsupp.ps_suppkey 1 100.00 Using where
1 PRIMARY nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where
-2 DEPENDENT SUBQUERY region ALL PRIMARY NULL NULL NULL 5 20.00 Using where
2 DEPENDENT SUBQUERY partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00
2 DEPENDENT SUBQUERY supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.partsupp.ps_suppkey 1 100.00 Using where
2 DEPENDENT SUBQUERY nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where
+2 DEPENDENT SUBQUERY region eq_ref PRIMARY PRIMARY 4 dbt3_s001.nation.n_regionkey 1 20.00 Using where
Warnings:
Note 1276 Field or reference 'dbt3_s001.part.p_partkey' of SELECT #2 was resolved in SELECT #1
-Note 1003 /* select#1 */ select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`part`.`p_size` = 9 and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_type` like '%TIN' and `dbt3_s001`.`partsupp`.`ps_supplycost` = <expr_cache><`dbt3_s001`.`part`.`p_partkey`>((/* select#2 */ select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey`
+Note 1003 /* select#1 */ select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and (`dbt3_s001`.`part`.`p_size` = 9 or `dbt3_s001`.`part`.`p_size` = 19999) and `dbt3_s001`.`part`.`p_type` like '%TIN' and `dbt3_s001`.`partsupp`.`ps_supplycost` = <expr_cache><`dbt3_s001`.`part`.`p_partkey`>((/* select#2 */ select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`region`.`r_regionkey` = `dbt3_s001`.`nation`.`n_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey`
set optimizer_use_condition_selectivity=4;
explain extended
select
@@ -123,13 +123,13 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where
1 PRIMARY supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.partsupp.ps_suppkey 1 100.00 Using where
1 PRIMARY nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where
-2 DEPENDENT SUBQUERY region ALL PRIMARY NULL NULL NULL 5 20.00 Using where
2 DEPENDENT SUBQUERY partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00
2 DEPENDENT SUBQUERY supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.partsupp.ps_suppkey 1 100.00 Using where
2 DEPENDENT SUBQUERY nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where
+2 DEPENDENT SUBQUERY region eq_ref PRIMARY PRIMARY 4 dbt3_s001.nation.n_regionkey 1 20.00 Using where
Warnings:
Note 1276 Field or reference 'dbt3_s001.part.p_partkey' of SELECT #2 was resolved in SELECT #1
-Note 1003 /* select#1 */ select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`part`.`p_size` = 9 and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_type` like '%TIN' and `dbt3_s001`.`partsupp`.`ps_supplycost` = <expr_cache><`dbt3_s001`.`part`.`p_partkey`>((/* select#2 */ select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey`
+Note 1003 /* select#1 */ select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`part`.`p_size` = 9 and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_type` like '%TIN' and `dbt3_s001`.`partsupp`.`ps_supplycost` = <expr_cache><`dbt3_s001`.`part`.`p_partkey`>((/* select#2 */ select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`region`.`r_regionkey` = `dbt3_s001`.`nation`.`n_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey`
=== Q15 ===
create view revenue0 (supplier_no, total_revenue) as
select l_suppkey, sum(l_extendedprice * (1 - l_discount))
@@ -171,7 +171,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY supplier index PRIMARY PRIMARY 4 NULL 10 100.00
1 PRIMARY <derived3> ref key0 key0 5 dbt3_s001.supplier.s_suppkey 10 100.00 Using where
3 DERIVED lineitem range i_l_shipdate,i_l_suppkey i_l_shipdate 4 NULL 229 100.00 Using where; Using temporary; Using filesort
-2 SUBQUERY <derived4> ALL NULL NULL NULL NULL 228 100.00
+2 SUBQUERY <derived4> ALL NULL NULL NULL NULL 229 100.00
4 DERIVED lineitem range i_l_shipdate i_l_shipdate 4 NULL 229 100.00 Using where; Using temporary; Using filesort
Warnings:
Note 1003 /* select#1 */ select `dbt3_s001`.`supplier`.`s_suppkey` AS `s_suppkey`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`revenue0`.`total_revenue` AS `total_revenue` from `dbt3_s001`.`supplier` join `dbt3_s001`.`revenue0` where `revenue0`.`supplier_no` = `dbt3_s001`.`supplier`.`s_suppkey` and `revenue0`.`total_revenue` = (/* select#2 */ select max(`revenue0`.`total_revenue`) from `dbt3_s001`.`revenue0`) order by `dbt3_s001`.`supplier`.`s_suppkey`
@@ -334,7 +334,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY customer eq_ref PRIMARY PRIMARY 4 dbt3_s001.orders.o_custkey 1 100.00
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 dbt3_s001.orders.o_orderkey 1 100.00
1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey_quantity 4 dbt3_s001.orders.o_orderkey 4 100.00 Using index
-2 MATERIALIZED lineitem index NULL PRIMARY 8 NULL 6005 100.00
+2 MATERIALIZED lineitem index NULL i_l_orderkey_quantity 13 NULL 6005 100.00 Using index
Warnings:
Note 1003 /* select#1 */ select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from <materialize> (/* select#2 */ select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where `dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey` and `<subquery2>`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` and `dbt3_s001`.`lineitem`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE`
select
@@ -368,7 +368,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY customer eq_ref PRIMARY PRIMARY 4 dbt3_s001.orders.o_custkey 1 100.00
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 dbt3_s001.orders.o_orderkey 1 100.00
1 PRIMARY lineitem ref PRIMARY,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey_quantity 4 dbt3_s001.orders.o_orderkey 4 100.00 Using index
-2 MATERIALIZED lineitem index NULL PRIMARY 8 NULL 6005 100.00
+2 MATERIALIZED lineitem index NULL i_l_orderkey_quantity 13 NULL 6005 100.00 Using index
Warnings:
Note 1003 /* select#1 */ select `dbt3_s001`.`customer`.`c_name` AS `c_name`,`dbt3_s001`.`customer`.`c_custkey` AS `c_custkey`,`dbt3_s001`.`orders`.`o_orderkey` AS `o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE` AS `o_orderdate`,`dbt3_s001`.`orders`.`o_totalprice` AS `o_totalprice`,sum(`dbt3_s001`.`lineitem`.`l_quantity`) AS `sum(l_quantity)` from <materialize> (/* select#2 */ select `dbt3_s001`.`lineitem`.`l_orderkey` from `dbt3_s001`.`lineitem` group by `dbt3_s001`.`lineitem`.`l_orderkey` having sum(`dbt3_s001`.`lineitem`.`l_quantity`) > 250) join `dbt3_s001`.`customer` join `dbt3_s001`.`orders` join `dbt3_s001`.`lineitem` where `dbt3_s001`.`customer`.`c_custkey` = `dbt3_s001`.`orders`.`o_custkey` and `<subquery2>`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` and `dbt3_s001`.`lineitem`.`l_orderkey` = `dbt3_s001`.`orders`.`o_orderkey` group by `dbt3_s001`.`customer`.`c_name`,`dbt3_s001`.`customer`.`c_custkey`,`dbt3_s001`.`orders`.`o_orderkey`,`dbt3_s001`.`orders`.`o_orderDATE`,`dbt3_s001`.`orders`.`o_totalprice` order by `dbt3_s001`.`orders`.`o_totalprice` desc,`dbt3_s001`.`orders`.`o_orderDATE`
select
@@ -495,7 +495,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
2 MATERIALIZED part ALL PRIMARY NULL NULL NULL 200 100.00 Using where
2 MATERIALIZED partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where
-4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 100.00 Using where
+4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 14.40 Using where
Warnings:
Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2
Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2
@@ -546,14 +546,13 @@ limit 10;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY nation ALL PRIMARY NULL NULL NULL 25 4.00 Using where; Using temporary; Using filesort
1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED part ALL PRIMARY NULL NULL NULL 200 4.17 Using where
-2 MATERIALIZED partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where
+1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 4.17 Using where
+1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 11.99 Using where; FirstMatch(supplier)
4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 14.40 Using where
Warnings:
Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2
Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2
-Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <expr_cache><`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= <cache>(cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < <cache>(cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10
+Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <expr_cache><`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= <cache>(cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < <cache>(cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10
select sql_calc_found_rows
s_name, s_address
from supplier, nation
@@ -602,14 +601,13 @@ limit 10;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY nation ALL PRIMARY NULL NULL NULL 25 4.00 Using where; Using temporary; Using filesort
1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED part ALL PRIMARY NULL NULL NULL 200 7.03 Using where
-2 MATERIALIZED partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where
+1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 7.03 Using where
+1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 7.11 Using where; FirstMatch(supplier)
4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 14.40 Using where
Warnings:
Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2
Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2
-Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <expr_cache><`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= <cache>(cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < <cache>(cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10
+Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <expr_cache><`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= <cache>(cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < <cache>(cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10
select sql_calc_found_rows
s_name, s_address
from supplier, nation
@@ -658,14 +656,13 @@ limit 10;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY nation ALL PRIMARY NULL NULL NULL 25 4.00 Using where; Using temporary; Using filesort
1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED part ALL PRIMARY NULL NULL NULL 200 7.81 Using where
-2 MATERIALIZED partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where
+1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 7.81 Using where
+1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 6.40 Using where; FirstMatch(supplier)
4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 14.40 Using where
Warnings:
Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2
Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2
-Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <expr_cache><`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= <cache>(cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < <cache>(cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10
+Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <expr_cache><`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= <cache>(cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < <cache>(cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10
select sql_calc_found_rows
s_name, s_address
from supplier, nation
@@ -714,14 +711,13 @@ limit 10;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY nation ALL PRIMARY NULL NULL NULL 25 4.00 Using where; Using temporary; Using filesort
1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED part ALL PRIMARY NULL NULL NULL 200 7.81 Using where
-2 MATERIALIZED partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where
+1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 7.81 Using where
+1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 6.40 Using where; FirstMatch(supplier)
4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 14.40 Using where
Warnings:
Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2
Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2
-Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <expr_cache><`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= <cache>(cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < <cache>(cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10
+Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <expr_cache><`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= <cache>(cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < <cache>(cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10
select sql_calc_found_rows
s_name, s_address
from supplier, nation
@@ -808,10 +804,9 @@ explain extended
select * from t1 where a in ( select b from t2 ) AND ( a > 3 );
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 1 100.00 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2 50.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t1`.`a` > 3
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`a` and `test`.`t1`.`a` > 3
select * from t1 where a in ( select b from t2 ) AND ( a > 3 );
a
drop table t1,t2;
@@ -946,7 +941,7 @@ set optimizer_switch='index_condition_pushdown=off';
EXPLAIN EXTENDED
SELECT * FROM t1, t2 WHERE a > 9;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 range a a 5 NULL 1 0.00 Using where
+1 SIMPLE t1 range a a 5 NULL 1 100.00 Using where
1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` > 9
@@ -1653,27 +1648,51 @@ drop function f1;
#
create table t1 (a int, b int, key (b), key (a));
insert into t1
-select (rand(1)*1000)/10, (rand(1001)*1000)/20 from seq_1_to_1000;
-analyze table t1 persistent for all;
+select (rand(1)*1000)/30, (rand(1001)*1000)/40 from seq_1_to_1000;
+analyze table t1 ;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
+select count(*) from t1 where b=2;
+count(*)
+42
+select count(*) from t1 where a in (17,51,5);
+count(*)
+62
# Check what info the optimizer has about selectivities
explain extended select * from t1 use index () where a in (17,51,5);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 2.90 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 6.20 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` USE INDEX () where `test`.`t1`.`a` in (17,51,5)
explain extended select * from t1 use index () where b=2;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 2.40 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 4.20 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` USE INDEX () where `test`.`t1`.`b` = 2
# Now, the equality is used for ref access, while the range condition
# gives selectivity data
explain extended select * from t1 where a in (17,51,5) and b=2;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ref b,a b 5 const 24 2.90 Using where
+1 SIMPLE t1 ref|filter b,a b|a 5|5 const 42 (6%) 6.30 Using where; Using rowid filter
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` in (17,51,5)
+truncate table t1;
+insert into t1
+select (rand(1)*1000)/10, (rand(1001)*1000)/50 from seq_1_to_1000;
+analyze table t1 ;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+select count(*) from t1 where b=2;
+count(*)
+59
+select count(*) from t1 where a in (17,51,5);
+count(*)
+29
+explain extended select * from t1 where a in (17,51,5) and b=2;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 range|filter b,a a|b 5|5 NULL 29 (6%) 5.90 Using index condition; Using where; Using rowid filter
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` in (17,51,5)
drop table t1;
@@ -1781,7 +1800,7 @@ explain extended select t1.b,t2.a,t3.a,t3.b from t1,t2,t3
where t1.c = t2.a AND t1.d = t3.a and t1.a = 50 and t1.b <= 100;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range a a 10 NULL 11 100.00 Using index condition; Using where
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 Using index
+1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.c 1 100.00
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.d 1 100.00
Warnings:
Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t2`.`a` = `test`.`t1`.`c` and `test`.`t3`.`a` = `test`.`t1`.`d` and `test`.`t1`.`a` = 50 and `test`.`t1`.`b` <= 100
@@ -1802,8 +1821,8 @@ set optimizer_use_condition_selectivity=2;
explain extended select t1.b,t2.a,t3.a,t3.b from t1,t2,t3
where t1.c = t2.a AND t1.d = t3.a and t1.a = 50 and t1.b <= 100;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 range a a 10 NULL 11 11.00 Using index condition; Using where
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 Using index
+1 SIMPLE t1 range a a 10 NULL 11 100.00 Using index condition; Using where
+1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.c 1 100.00
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.d 1 100.00
Warnings:
Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t2`.`a` = `test`.`t1`.`c` and `test`.`t3`.`a` = `test`.`t1`.`d` and `test`.`t1`.`a` = 50 and `test`.`t1`.`b` <= 100
@@ -1820,6 +1839,18 @@ b a a b
7 7 8 8
8 8 9 9
9 9 10 10
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain extended select t1.b,t2.a,t3.a,t3.b from t1,t2,t3
+where t1.c = t2.a AND t1.d = t3.a and t1.a = 50 and t1.b <= 100;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 range a a 10 NULL 11 100.00 Using index condition; Using where
+1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.c 1 100.00
+1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.d 1 100.00
+Warnings:
+Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t2`.`a` = `test`.`t1`.`c` and `test`.`t3`.`a` = `test`.`t1`.`d` and `test`.`t1`.`a` = 50 and `test`.`t1`.`b` <= 100
set optimizer_use_condition_selectivity= @@optimizer_use_condition_selectivity;
drop table t1,t2,t3;
#
@@ -1867,7 +1898,7 @@ WHERE A.a=t1.a AND t2.b < 20);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL a 5 NULL 100 Using where; Using index
3 DEPENDENT SUBQUERY A ref PRIMARY,a a 5 test.t1.a 1 Using index
-3 DEPENDENT SUBQUERY t2 ref|filter a,b a|b 5|5 test.A.id 1 (19%) Using where; Using rowid filter
+3 DEPENDENT SUBQUERY t2 ref a,b a 5 test.A.id 1 Using where
set statement optimizer_use_condition_selectivity=4 for explain SELECT * FROM t1
WHERE
EXISTS (SELECT * FROM t1 A INNER JOIN t2 ON t2.a = A.id
@@ -1875,7 +1906,7 @@ WHERE A.a=t1.a AND t2.b < 20);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL a 5 NULL 100 Using where; Using index
3 DEPENDENT SUBQUERY A ref PRIMARY,a a 5 test.t1.a 1 Using index
-3 DEPENDENT SUBQUERY t2 ref|filter a,b a|b 5|5 test.A.id 1 (19%) Using where; Using rowid filter
+3 DEPENDENT SUBQUERY t2 ref a,b a 5 test.A.id 1 Using where
set @query="EXPLAIN SELECT * FROM t1 A, t1 B WHERE A.a = B.a and A.id = 65";
set statement optimizer_use_condition_selectivity=2 for explain SELECT * FROM t1
WHERE
@@ -1884,7 +1915,7 @@ WHERE A.a=t1.a AND t2.b < 20);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL a 5 NULL 100 Using where; Using index
3 DEPENDENT SUBQUERY A ref PRIMARY,a a 5 test.t1.a 1 Using index
-3 DEPENDENT SUBQUERY t2 ref|filter a,b a|b 5|5 test.A.id 1 (19%) Using where; Using rowid filter
+3 DEPENDENT SUBQUERY t2 ref a,b a 5 test.A.id 1 Using where
set statement optimizer_use_condition_selectivity=4 for explain SELECT * FROM t1
WHERE
EXISTS (SELECT * FROM t1 A INNER JOIN t2 ON t2.a = A.id
@@ -1892,7 +1923,7 @@ WHERE A.a=t1.a AND t2.b < 20);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL a 5 NULL 100 Using where; Using index
3 DEPENDENT SUBQUERY A ref PRIMARY,a a 5 test.t1.a 1 Using index
-3 DEPENDENT SUBQUERY t2 ref|filter a,b a|b 5|5 test.A.id 1 (19%) Using where; Using rowid filter
+3 DEPENDENT SUBQUERY t2 ref a,b a 5 test.A.id 1 Using where
explain SELECT * FROM t1
WHERE
EXISTS (SELECT * FROM t1 A INNER JOIN t2 ON t2.a = A.id
@@ -1900,7 +1931,7 @@ WHERE A.a=t1.a AND t2.b < 20);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL a 5 NULL 100 Using where; Using index
2 DEPENDENT SUBQUERY A ref PRIMARY,a a 5 test.t1.a 1 Using index
-2 DEPENDENT SUBQUERY t2 ref|filter a,b a|b 5|5 test.A.id 1 (19%) Using where; Using rowid filter
+2 DEPENDENT SUBQUERY t2 ref a,b a 5 test.A.id 1 Using where
set optimizer_switch= @save_optimizer_switch;
drop table t1,t2;
#
@@ -1978,6 +2009,117 @@ set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivi
set histogram_size=@save_histogram_size;
set use_stat_tables= @save_use_stat_tables;
set @@global.histogram_size=@save_histogram_size;
+#
+# MDEV-20595
+# Assertion `0 < sel && sel <= 2.0' failed in table_cond_selectivity
+#
+create table t1 (id int, a int, PRIMARY KEY(id), key(a));
+insert into t1 select seq,seq from seq_1_to_100;
+create table t2 (id int, a int, b int, PRIMARY KEY(id), key(a), key(b));
+insert into t2 select seq,seq,seq from seq_1_to_100;
+set optimizer_use_condition_selectivity=2;
+EXPLAIN SELECT * FROM t1 A, t1 B WHERE A.a = B.a and A.id = 65;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE A const PRIMARY,a PRIMARY 4 const 1
+1 SIMPLE B ref a a 5 const 1 Using index
+set optimizer_use_condition_selectivity= @save_optimizer_use_condition_selectivity;
+drop table t1,t2;
+#
+# MDEV-30360 Assertion `cond_selectivity <= 1.000000001' failed in get_range_limit_read_cost
+# with LIMIT .. OFFSET
+#
+CREATE TABLE t1 (a INT, b VARCHAR(1), KEY(b), KEY(a)) engine=myisam;
+INSERT INTO t1 VALUES
+(3,'a'),(2,'g'),(5,'v'),(9,'n'),(6,'u'),
+(7,'s'),(0,'z'),(3,'z'),(NULL,'m'),(6,'r');
+CREATE TABLE t2 (pk INT PRIMARY KEY);
+INSERT INTO t2 VALUES (1),(2);
+SELECT STRAIGHT_JOIN pk FROM t1 JOIN t2 ON a = pk WHERE b >= 'A' ORDER BY t2.pk LIMIT 8 OFFSET 1;
+pk
+DROP TABLE t1, t2;
+#
+# MDEV-30659 Server crash on EXPLAIN SELECT/SELECT on table with
+# engine Aria for LooseScan Strategy
+#
+create table t1 (old_c1 integer, old_c2 integer, c1 integer,
+c2 integer, c3 integer) engine=aria;
+insert into t1(c1,c2,c3)
+values (1,1,1), (1,2,2), (1,3,3),
+(2,1,4), (2,2,5), (2,3,6),
+(2,4,7), (2,5,8);
+create index t1_c2 on t1 (c2,c1);
+explain select * from t1 where t1.c2 in (select a.c2 from t1 a) and
+c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a range t1_c2 t1_c2 5 NULL 5 Using where; Using index; LooseScan
+1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 1
+drop table t1;
+create table t1 (old_c1 integer, old_c2 integer, c1 integer,
+c2 integer, c3 integer) engine=aria;
+create trigger trg_t1 before update on t1 for each row
+begin
+set new.old_c1=old.c1;
+set new.old_c2=old.c2;
+end;
+/
+insert into t1 (c1,c2,c3) values
+(1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+create index t1_c2 on t1 (c2,c1);
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table t2 as select * from t1;
+truncate table t1;
+insert into t1 select * from t2;
+explain select * from t1 where t1.c2 in (select a.c2 from t1 a) and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a range t1_c2 t1_c2 5 NULL 5 Using where; Using index; LooseScan
+1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 1
+drop trigger trg_t1;
+drop table t1,t2;
+create table t1 (old_c1 integer, old_c2 integer, c1 integer,
+c2 integer, c3 integer) engine=aria;
+insert into t1 (c1,c2,c3) values
+(1,1,1), (1,2,2), (1,3,3), (2,1,4), (2,2,5), (2,3,6), (2,4,7), (2,5,8);
+create index t1_c2 on t1 (c2,c1);
+create table t2 as select * from t1;
+truncate table t1;
+insert into t1 select * from t2;
+explain select * from t1 where t1.c2 in (select a.c2 from t1 a) and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY a range t1_c2 t1_c2 5 NULL 5 Using where; Using index; LooseScan
+1 PRIMARY t1 ref t1_c2 t1_c2 5 test.a.c2 2
+drop table t1,t2;
+#
+# MDEV-31864 Assertion `d >= 0' failed in COST_ADD with join_cache_level
+# > 2 and partitions
+#
+SET join_cache_level= 3;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (b INT, c INT);
+INSERT INTO t2 VALUES (3,4),(5,6);
+CREATE TABLE t3 (d INT, e INT) PARTITION BY RANGE COLUMNS (d) (p1 VALUES LESS THAN (1000), pn VALUES LESS THAN (MAXVALUE));
+ANALYZE TABLE t1, t2, t3 PERSISTENT FOR ALL;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+test.t2 analyze status Engine-independent statistics collected
+test.t2 analyze status OK
+test.t3 analyze status Engine-independent statistics collected
+test.t3 analyze status OK
+explain SELECT * FROM t1 LEFT JOIN (t2 JOIN t3 ON t2.b = t3.e) ON t2.c = 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where
+1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where
+SELECT * FROM t1 LEFT JOIN (t2 JOIN t3 ON t2.b = t3.e) ON t2.c = 1;
+a b c d e
+1 NULL NULL NULL NULL
+2 NULL NULL NULL NULL
+set join_cache_level= default;
+DROP TABLE t1, t2, t3;
set optimizer_switch=@save_optimizer_switch_for_selectivity_test;
set @tmp_ust= @@use_stat_tables;
set @tmp_oucs= @@optimizer_use_condition_selectivity;
@@ -2181,3 +2323,61 @@ set optimizer_use_condition_selectivity= @tmp_oucs;
set @@global.histogram_size=@save_histogram_size;
SET SESSION DEFAULT_STORAGE_ENGINE=DEFAULT;
SET GLOBAL innodb_stats_persistent=@save_stats_persistent;
+#
+# MDEV-30313 Sporadic assertion `cond_selectivity <= 1.0' failure in get_range_limit_read_cost
+#
+CREATE TABLE t (a CHAR(8), b INT, c TIMESTAMP, KEY(b,c)) ENGINE=InnoDB;
+INSERT INTO t VALUES
+('g',1,'1980-09-26'),('l',2,'1979-10-07'),('e',3,'1992-04-22'),
+('v',9,'1975-09-21'),('w',3,'1973-10-06'),('y',8,'1986-10-28'),
+('a',4,'2015-02-15'),('v',9,'1980-01-13'),('f',1,'1972-02-27'),
+('z',7,'1981-05-25'),('z',8,'1980-06-14'),('c',9,'1985-01-24'),
+('x',5,'1999-12-14'),('h',3,'1994-12-18'),('j',6,'1985-08-17'),
+('b',6,'1989-08-02'),('h',6,'2024-07-06'),('h',4,'2024-02-10'),
+('s',1,'1981-07-21'),('c',2,'1988-09-16'),('e',3,'1981-08-26'),
+('a',2,'1986-05-23'),('l',0,'1997-12-19'),('b',5,'2018-05-01'),
+('q',2,'1990-01-01'),('v',9,'1982-10-12'),('x',2,'2005-04-29'),
+('f',8,'2005-08-20'),('d',3,'2002-01-24'),('b',9,'1982-02-04'),
+('a',4,'1978-04-12'),('c',9,'1984-06-08'),('n',9,'1983-10-19'),
+('l',1,'2023-01-05'),('f',2,'1988-11-18'),('a',9,'1977-11-11'),
+('k',2,'1980-09-27'),('i',7,'1988-08-09'),('e',4,'1992-07-30'),
+('l',5,'1980-01-01'),('h',5,'2011-12-24'),('d',6,'2035-03-28'),
+('h',7,'1994-05-14'),('y',1,'1990-01-01'),('x',6,'1981-09-12'),
+('x',9,'1980-01-01'),('s',9,'1995-11-09'),('i',4,'1980-01-01'),
+('p',4,'1980-01-01'),('a',6,'2026-05-05'),('c',6,'1991-09-23'),
+('l',8,'1980-01-01'),('n',4,'1999-09-15'),('b',1,'2011-07-23'),
+('a',9,'1980-01-01'),('a',0,'1977-12-21'),('v',6,'1986-10-29'),
+('r',0,'1997-03-27'),('a',9,'2000-05-05'),('x',1,'1990-01-01'),
+('n',7,'1985-08-01'),('m',6,'1994-09-14'),('s',9,'2009-09-27'),
+('r',8,'2028-10-30'),('e',6,'1982-08-31'),('x',0,'1989-12-21'),
+('d',0,'1984-06-24'),('r',6,'1982-02-11'),('a',3,'1997-10-22'),
+('s',9,'2007-08-29'),('a',3,'1990-01-01'),('o',1,'2015-02-10'),
+('x',0,'1978-08-30'),('k',5,'1989-06-15'),('b',0,'1984-08-21'),
+('v',0,'1990-01-01'),('a',9,'1993-06-23'),('n',5,'1979-11-10'),
+('o',8,'2024-08-31'),('k',6,'1983-12-25'),('y',5,'2013-02-19'),
+('a',9,'1989-12-03'),('k',4,'1973-08-07'),('o',7,'1988-03-19'),
+('o',3,'2007-01-07'),('t',6,'1990-02-22'),('f',4,'2032-10-22'),
+('p',0,'1977-09-12'),('f',3,'2036-11-26'),('a',9,'2008-06-26'),
+('k',2,'2004-09-11'),('x',1,'2005-07-28'),('s',8,'2027-08-28'),
+('a',8,'2000-06-11'),('a',7,'2005-05-20'),('u',9,'1980-01-01'),
+('v',5,'1990-01-01'),('x',7,'1984-11-01'),('a',1,'2006-05-14');
+SELECT b FROM t WHERE a > 'a' GROUP BY b HAVING b >= 6 OR b <= 0;
+b
+0
+6
+7
+8
+9
+DROP TABLE t;
+#
+# MDEV-30693: Assertion `dbl_records <= s->records' failed in apply_selectivity_for_table on SELECT
+#
+set @tmp_oucs= @@optimizer_use_condition_selectivity;
+CREATE TABLE t1 (c INT KEY) ENGINE=InnoDB;
+SELECT * FROM (SELECT * FROM t1) a JOIN (SELECT * FROM (SELECT * FROM t1 GROUP BY c) d WHERE c>1) b ON a.c=b.c;
+c c
+DROP TABLE t1;
+SET optimizer_use_condition_selectivity=@tmp_oucs;
+#
+# End of 11.0 tests
+#
diff --git a/mysql-test/main/selectivity_innodb.test b/mysql-test/main/selectivity_innodb.test
index c970e7d8..f8ffca73 100644
--- a/mysql-test/main/selectivity_innodb.test
+++ b/mysql-test/main/selectivity_innodb.test
@@ -236,3 +236,61 @@ set optimizer_use_condition_selectivity= @tmp_oucs;
set @@global.histogram_size=@save_histogram_size;
SET SESSION DEFAULT_STORAGE_ENGINE=DEFAULT;
SET GLOBAL innodb_stats_persistent=@save_stats_persistent;
+
+--echo #
+--echo # MDEV-30313 Sporadic assertion `cond_selectivity <= 1.0' failure in get_range_limit_read_cost
+--echo #
+
+CREATE TABLE t (a CHAR(8), b INT, c TIMESTAMP, KEY(b,c)) ENGINE=InnoDB;
+INSERT INTO t VALUES
+('g',1,'1980-09-26'),('l',2,'1979-10-07'),('e',3,'1992-04-22'),
+('v',9,'1975-09-21'),('w',3,'1973-10-06'),('y',8,'1986-10-28'),
+('a',4,'2015-02-15'),('v',9,'1980-01-13'),('f',1,'1972-02-27'),
+('z',7,'1981-05-25'),('z',8,'1980-06-14'),('c',9,'1985-01-24'),
+('x',5,'1999-12-14'),('h',3,'1994-12-18'),('j',6,'1985-08-17'),
+('b',6,'1989-08-02'),('h',6,'2024-07-06'),('h',4,'2024-02-10'),
+('s',1,'1981-07-21'),('c',2,'1988-09-16'),('e',3,'1981-08-26'),
+('a',2,'1986-05-23'),('l',0,'1997-12-19'),('b',5,'2018-05-01'),
+('q',2,'1990-01-01'),('v',9,'1982-10-12'),('x',2,'2005-04-29'),
+('f',8,'2005-08-20'),('d',3,'2002-01-24'),('b',9,'1982-02-04'),
+('a',4,'1978-04-12'),('c',9,'1984-06-08'),('n',9,'1983-10-19'),
+('l',1,'2023-01-05'),('f',2,'1988-11-18'),('a',9,'1977-11-11'),
+('k',2,'1980-09-27'),('i',7,'1988-08-09'),('e',4,'1992-07-30'),
+('l',5,'1980-01-01'),('h',5,'2011-12-24'),('d',6,'2035-03-28'),
+('h',7,'1994-05-14'),('y',1,'1990-01-01'),('x',6,'1981-09-12'),
+('x',9,'1980-01-01'),('s',9,'1995-11-09'),('i',4,'1980-01-01'),
+('p',4,'1980-01-01'),('a',6,'2026-05-05'),('c',6,'1991-09-23'),
+('l',8,'1980-01-01'),('n',4,'1999-09-15'),('b',1,'2011-07-23'),
+('a',9,'1980-01-01'),('a',0,'1977-12-21'),('v',6,'1986-10-29'),
+('r',0,'1997-03-27'),('a',9,'2000-05-05'),('x',1,'1990-01-01'),
+('n',7,'1985-08-01'),('m',6,'1994-09-14'),('s',9,'2009-09-27'),
+('r',8,'2028-10-30'),('e',6,'1982-08-31'),('x',0,'1989-12-21'),
+('d',0,'1984-06-24'),('r',6,'1982-02-11'),('a',3,'1997-10-22'),
+('s',9,'2007-08-29'),('a',3,'1990-01-01'),('o',1,'2015-02-10'),
+('x',0,'1978-08-30'),('k',5,'1989-06-15'),('b',0,'1984-08-21'),
+('v',0,'1990-01-01'),('a',9,'1993-06-23'),('n',5,'1979-11-10'),
+('o',8,'2024-08-31'),('k',6,'1983-12-25'),('y',5,'2013-02-19'),
+('a',9,'1989-12-03'),('k',4,'1973-08-07'),('o',7,'1988-03-19'),
+('o',3,'2007-01-07'),('t',6,'1990-02-22'),('f',4,'2032-10-22'),
+('p',0,'1977-09-12'),('f',3,'2036-11-26'),('a',9,'2008-06-26'),
+('k',2,'2004-09-11'),('x',1,'2005-07-28'),('s',8,'2027-08-28'),
+('a',8,'2000-06-11'),('a',7,'2005-05-20'),('u',9,'1980-01-01'),
+('v',5,'1990-01-01'),('x',7,'1984-11-01'),('a',1,'2006-05-14');
+
+SELECT b FROM t WHERE a > 'a' GROUP BY b HAVING b >= 6 OR b <= 0;
+
+# Cleanup
+DROP TABLE t;
+
+--echo #
+--echo # MDEV-30693: Assertion `dbl_records <= s->records' failed in apply_selectivity_for_table on SELECT
+--echo #
+set @tmp_oucs= @@optimizer_use_condition_selectivity;
+CREATE TABLE t1 (c INT KEY) ENGINE=InnoDB;
+SELECT * FROM (SELECT * FROM t1) a JOIN (SELECT * FROM (SELECT * FROM t1 GROUP BY c) d WHERE c>1) b ON a.c=b.c;
+DROP TABLE t1;
+SET optimizer_use_condition_selectivity=@tmp_oucs;
+
+--echo #
+--echo # End of 11.0 tests
+--echo #
diff --git a/mysql-test/main/selectivity_innodb_notembedded.result b/mysql-test/main/selectivity_innodb_notembedded.result
index a387d241..f2b7e939 100644
--- a/mysql-test/main/selectivity_innodb_notembedded.result
+++ b/mysql-test/main/selectivity_innodb_notembedded.result
@@ -120,12 +120,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": 0.0322836,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 100,
+ "cost": 0.0322836,
"filtered": 53.32928848,
"attached_condition": "t1.col0 > 1 and t1.col1 > 1 and t1.col2 > 1 and t1.col3 > 1 and t1.col4 > 1 and t1.col5 > 1 and t1.col6 > 1 and t1.col7 > 1 and t1.col8 > 1 and t1.col9 > 1 and t1.col10 > 1 and t1.col11 > 1 and t1.col12 > 1 and t1.col13 > 1 and t1.col14 > 1 and t1.col15 > 1 and t1.col16 > 1 and t1.col17 > 1 and t1.col18 > 1 and t1.col19 > 1 and t1.col20 > 1 and t1.col21 > 1 and t1.col22 > 1 and t1.col23 > 1 and t1.col24 > 1 and t1.col25 > 1 and t1.col26 > 1 and t1.col27 > 1 and t1.col28 > 1 and t1.col29 > 1 and t1.col30 > 1 and t1.col31 > 1 and t1.col32 > 1 and t1.col33 > 1 and t1.col34 > 1 and t1.col35 > 1 and t1.col36 > 1 and t1.col37 > 1 and t1.col38 > 1 and t1.col39 > 1 and t1.col40 > 1 and t1.col41 > 1 and t1.col42 > 1 and t1.col43 > 1 and t1.col44 > 1 and t1.col45 > 1 and t1.col46 > 1 and t1.col47 > 1 and t1.col48 > 1 and t1.col49 > 1 and t1.col50 > 1 and t1.col51 > 1 and t1.col52 > 1 and t1.col53 > 1 and t1.col54 > 1 and t1.col55 > 1 and t1.col56 > 1 and t1.col57 > 1 and t1.col58 > 1 and t1.col59 > 1 and t1.col60 > 1 and t1.col61 > 1 and t1.col62 > 1 and t1.col63 > 1 and t1.col64 > 1 and t1.col65 > 1 and t1.col66 > 1 and t1.col67 > 1 and t1.col68 > 1 and t1.col69 > 1 and t1.col70 > 1 and t1.col71 > 1 and t1.col72 > 1 and t1.col73 > 1 and t1.col74 > 1 and t1.col75 > 1 and t1.col76 > 1 and t1.col77 > 1 and t1.col78 > 1 and t1.col79 > 1 and t1.col80 > 1 and t1.col81 > 1 and t1.col82 > 1 and t1.col83 > 1 and t1.col84 > 1 and t1.col85 > 1 and t1.col86 > 1 and t1.col87 > 1 and t1.col88 > 1 and t1.col89 > 1 and t1.col90 > 1 and t1.col91 > 1 and t1.col92 > 1 and t1.col93 > 1 and t1.col94 > 1 and t1.col95 > 1 and t1.col96 > 1 and t1.col97 > 1 and t1.col98 > 1 and t1.col99 > 1 and t1.col100 > 1 and t1.col101 > 1 and t1.col102 > 1 and t1.col103 > 1 and t1.col104 > 1 and t1.col105 > 1 and t1.col106 > 1 and t1.col107 > 1 and t1.col108 > 1 and t1.col109 > 1 and t1.col110 > 1 and t1.col111 > 1 and t1.col112 > 1 and t1.col113 > 1 and t1.col114 > 1 and t1.col115 > 1 and t1.col116 > 1 and t1.col117 > 1 and t1.col118 > 1 and t1.col119 > 1 and t1.col120 > 1 and t1.col121 > 1 and t1.col122 > 1 and t1.col123 > 1 and t1.col124 > 1 and t1.col125 > 1 and t1.col126 > 1 and t1.col127 > 1 and t1.col128 > 1 and t1.col129 > 1 and t1.col130 > 1 and t1.col131 > 1 and t1.col132 > 1 and t1.col133 > 1 and t1.col134 > 1 and t1.col135 > 1 and t1.col136 > 1 and t1.col137 > 1 and t1.col138 > 1 and t1.col139 > 1 and t1.col140 > 1 and t1.col141 > 1 and t1.col142 > 1 and t1.col143 > 1 and t1.col144 > 1 and t1.col145 > 1 and t1.col146 > 1 and t1.col147 > 1 and t1.col148 > 1 and t1.col149 > 1 and t1.col150 > 1 and t1.col151 > 1 and t1.col152 > 1 and t1.col153 > 1 and t1.col154 > 1 and t1.col155 > 1 and t1.col156 > 1 and t1.col157 > 1 and t1.col158 > 1 and t1.col159 > 1"
}
@@ -151,12 +154,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": 0.0322836,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 100,
+ "cost": 0.0322836,
"filtered": 53.32928848,
"attached_condition": "t1.col0 > 1 and t1.col1 > 1 and t1.col2 > 1 and t1.col3 > 1 and t1.col4 > 1 and t1.col5 > 1 and t1.col6 > 1 and t1.col7 > 1 and t1.col8 > 1 and t1.col9 > 1 and t1.col10 > 1 and t1.col11 > 1 and t1.col12 > 1 and t1.col13 > 1 and t1.col14 > 1 and t1.col15 > 1 and t1.col16 > 1 and t1.col17 > 1 and t1.col18 > 1 and t1.col19 > 1 and t1.col20 > 1 and t1.col21 > 1 and t1.col22 > 1 and t1.col23 > 1 and t1.col24 > 1 and t1.col25 > 1 and t1.col26 > 1 and t1.col27 > 1 and t1.col28 > 1 and t1.col29 > 1 and t1.col30 > 1 and t1.col31 > 1 and t1.col32 > 1 and t1.col33 > 1 and t1.col34 > 1 and t1.col35 > 1 and t1.col36 > 1 and t1.col37 > 1 and t1.col38 > 1 and t1.col39 > 1 and t1.col40 > 1 and t1.col41 > 1 and t1.col42 > 1 and t1.col43 > 1 and t1.col44 > 1 and t1.col45 > 1 and t1.col46 > 1 and t1.col47 > 1 and t1.col48 > 1 and t1.col49 > 1 and t1.col50 > 1 and t1.col51 > 1 and t1.col52 > 1 and t1.col53 > 1 and t1.col54 > 1 and t1.col55 > 1 and t1.col56 > 1 and t1.col57 > 1 and t1.col58 > 1 and t1.col59 > 1 and t1.col60 > 1 and t1.col61 > 1 and t1.col62 > 1 and t1.col63 > 1 and t1.col64 > 1 and t1.col65 > 1 and t1.col66 > 1 and t1.col67 > 1 and t1.col68 > 1 and t1.col69 > 1 and t1.col70 > 1 and t1.col71 > 1 and t1.col72 > 1 and t1.col73 > 1 and t1.col74 > 1 and t1.col75 > 1 and t1.col76 > 1 and t1.col77 > 1 and t1.col78 > 1 and t1.col79 > 1 and t1.col80 > 1 and t1.col81 > 1 and t1.col82 > 1 and t1.col83 > 1 and t1.col84 > 1 and t1.col85 > 1 and t1.col86 > 1 and t1.col87 > 1 and t1.col88 > 1 and t1.col89 > 1 and t1.col90 > 1 and t1.col91 > 1 and t1.col92 > 1 and t1.col93 > 1 and t1.col94 > 1 and t1.col95 > 1 and t1.col96 > 1 and t1.col97 > 1 and t1.col98 > 1 and t1.col99 > 1 and t1.col100 > 1 and t1.col101 > 1 and t1.col102 > 1 and t1.col103 > 1 and t1.col104 > 1 and t1.col105 > 1 and t1.col106 > 1 and t1.col107 > 1 and t1.col108 > 1 and t1.col109 > 1 and t1.col110 > 1 and t1.col111 > 1 and t1.col112 > 1 and t1.col113 > 1 and t1.col114 > 1 and t1.col115 > 1 and t1.col116 > 1 and t1.col117 > 1 and t1.col118 > 1 and t1.col119 > 1 and t1.col120 > 1 and t1.col121 > 1 and t1.col122 > 1 and t1.col123 > 1 and t1.col124 > 1 and t1.col125 > 1 and t1.col126 > 1 and t1.col127 > 1 and t1.col128 > 1 and t1.col129 > 1 and t1.col130 > 1 and t1.col131 > 1 and t1.col132 > 1 and t1.col133 > 1 and t1.col134 > 1 and t1.col135 > 1 and t1.col136 > 1 and t1.col137 > 1 and t1.col138 > 1 and t1.col139 > 1 and t1.col140 > 1 and t1.col141 > 1 and t1.col142 > 1 and t1.col143 > 1 and t1.col144 > 1 and t1.col145 > 1 and t1.col146 > 1 and t1.col147 > 1 and t1.col148 > 1 and t1.col149 > 1 and t1.col150 > 1 and t1.col151 > 1 and t1.col152 > 1 and t1.col153 > 1 and t1.col154 > 1 and t1.col155 > 1 and t1.col156 > 1 and t1.col157 > 1 and t1.col158 > 1 and t1.col159 > 1"
}
@@ -189,12 +195,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": 0.0322836,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 100,
+ "cost": 0.0322836,
"filtered": 99.60784149,
"attached_condition": "(t1.col1 > 1 or t1.col2 > 1 or t1.col3 > 1 or t1.col4 > 1 or t1.col5 > 1 or t1.col6 > 1 or t1.col7 > 1 or t1.col8 > 1 or t1.col9 > 1 or t1.col10 > 1 or t1.col11 > 1 or t1.col12 > 1 or t1.col13 > 1 or t1.col14 > 1 or t1.col15 > 1 or t1.col16 > 1 or t1.col17 > 1 or t1.col18 > 1 or t1.col19 > 1 or t1.col20 > 1 or t1.col21 > 1 or t1.col22 > 1 or t1.col23 > 1 or t1.col24 > 1 or t1.col25 > 1 or t1.col26 > 1 or t1.col27 > 1 or t1.col28 > 1 or t1.col29 > 1 or t1.col30 > 1 or t1.col31 > 1 or t1.col32 > 1 or t1.col33 > 1 or t1.col34 > 1 or t1.col35 > 1 or t1.col36 > 1 or t1.col37 > 1 or t1.col38 > 1 or t1.col39 > 1 or t1.col40 > 1 or t1.col41 > 1 or t1.col42 > 1 or t1.col43 > 1 or t1.col44 > 1 or t1.col45 > 1 or t1.col46 > 1 or t1.col47 > 1 or t1.col48 > 1 or t1.col49 > 1 or t1.col50 > 1 or t1.col51 > 1 or t1.col52 > 1 or t1.col53 > 1 or t1.col54 > 1 or t1.col55 > 1 or t1.col56 > 1 or t1.col57 > 1 or t1.col58 > 1 or t1.col59 > 1 or t1.col60 > 1 or t1.col61 > 1 or t1.col62 > 1 or t1.col63 > 1 or t1.col64 > 1 or t1.col65 > 1 or t1.col66 > 1 or t1.col67 > 1 or t1.col68 > 1 or t1.col69 > 1 or t1.col70 > 1 or t1.col71 > 1 or t1.col72 > 1 or t1.col73 > 1 or t1.col74 > 1 or t1.col75 > 1 or t1.col76 > 1 or t1.col77 > 1 or t1.col78 > 1 or t1.col79 > 1 or t1.col80 > 1 or t1.col81 > 1 or t1.col82 > 1 or t1.col83 > 1 or t1.col84 > 1 or t1.col85 > 1 or t1.col86 > 1 or t1.col87 > 1 or t1.col88 > 1 or t1.col89 > 1 or t1.col90 > 1 or t1.col91 > 1 or t1.col92 > 1 or t1.col93 > 1 or t1.col94 > 1 or t1.col95 > 1 or t1.col96 > 1 or t1.col97 > 1 or t1.col98 > 1 or t1.col99 > 1 or t1.col100 > 1 or t1.col101 > 1 or t1.col102 > 1 or t1.col103 > 1 or t1.col104 > 1 or t1.col105 > 1 or t1.col106 > 1 or t1.col107 > 1 or t1.col108 > 1 or t1.col109 > 1 or t1.col110 > 1 or t1.col111 > 1 or t1.col112 > 1 or t1.col113 > 1 or t1.col114 > 1 or t1.col115 > 1 or t1.col116 > 1 or t1.col117 > 1 or t1.col118 > 1 or t1.col119 > 1 or t1.col120 > 1 or t1.col121 > 1 or t1.col122 > 1 or t1.col123 > 1 or t1.col124 > 1 or t1.col125 > 1 or t1.col126 > 1 or t1.col127 > 1 or t1.col128 > 1 or t1.col129 > 1 or t1.col130 > 1 or t1.col131 > 1 or t1.col132 > 1 or t1.col133 > 1 or t1.col134 > 1 or t1.col135 > 1 or t1.col136 > 1 or t1.col137 > 1 or t1.col138 > 1 or t1.col139 > 1 or t1.col140 > 1 or t1.col141 > 1 or t1.col142 > 1 or t1.col143 > 1 or t1.col144 > 1 or t1.col145 > 1 or t1.col146 > 1 or t1.col147 > 1 or t1.col148 > 1 or t1.col149 > 1 or t1.col150 > 1 or t1.col151 > 1 or t1.col152 > 1 or t1.col153 > 1 or t1.col154 > 1 or t1.col155 > 1 or t1.col156 > 1 or t1.col157 > 1 or t1.col158 > 1) and t1.col159 > 1"
}
diff --git a/mysql-test/main/selectivity_no_engine.result b/mysql-test/main/selectivity_no_engine.result
index 00e2b8fc..3f23b579 100644
--- a/mysql-test/main/selectivity_no_engine.result
+++ b/mysql-test/main/selectivity_no_engine.result
@@ -315,6 +315,25 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE b hash_ALL NULL #hash#$hj 1341 test.a.Host,test.a.User,test.a.Password,test.a.Select_priv,test.a.Insert_priv,test.a.Update_priv,test.a.Delete_priv,test.a.Create_priv,test.a.Drop_priv,test.a.Reload_priv,test.a.Shutdown_priv,test.a.Process_priv,test.a.File_priv,test.a.Grant_priv,test.a.References_priv,test.a.Index_priv,test.a.Alter_priv,test.a.Show_db_priv,test.a.Super_priv,test.a.Create_tmp_table_priv,test.a.Lock_tables_priv,test.a.Execute_priv,test.a.Repl_slave_priv,test.a.Repl_client_priv,test.a.Create_view_priv,test.a.Show_view_priv,test.a.Create_routine_priv,test.a.Alter_routine_priv,test.a.Create_user_priv,test.a.Event_priv,test.a.Trigger_priv,test.a.Create_tablespace_priv,test.a.Delete_history_priv,test.a.ssl_type,test.a.ssl_cipher,test.a.x509_issuer,test.a.x509_subject,test.a.max_questions,test.a.max_updates,test.a.max_connections,test.a.max_user_connections,test.a.plugin,test.a.authentication_string,test.a.password_expired,test.a.is_role,test.a.default_role,test.a.max_statement_time 5 Using where; Using join buffer (flat, BNLH join)
DROP TABLE t1,t2,t3;
#
+# MDEV-30529: Assertion `rnd_records <= s->found_records' failed in best_access_path
+#
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (b VARCHAR(1), c INT, d VARCHAR(1), e VARCHAR(1), KEY(b), KEY(d), KEY(e)) ENGINE=MyISAM;
+INSERT INTO t2 VALUES ('x',0,'-','-'),
+('x',0,'-','-'),('x',5,'-','-'),('x',0,'-','-'),('x',0,'-','-'),
+('x',0,'-','-'),('x',0,'w','-'),('x',0,'-','-'),('x',0,'-','-'),
+('x',0,'-','-'),('x',0,'-','-'),('x',0,'-','u'),('x',0,'-','-'),
+('x',0,'-','-'),('x',0,'-','t'),('x',0,'-','-'),('x',0,'-','-'),
+('x',0,'-','-'),('x',0,'-','-'),('x',0,'-','-'),('x',0,'-','p'),
+('x',0,'z','-'),('x',0,'-','-'),('x',0,'-','-'),('x',0,'-','v');
+set @tmp_jcl=@@join_cache_level;
+SET JOIN_CACHE_LEVEL= 3;
+SELECT * FROM t1 JOIN t2 ON t1.a = t2.c WHERE t2.b IN ('o') OR t2.e >= 'f' OR t2.d > 'p';
+a b c d e
+set join_cache_level=@tmp_jcl;
+drop table t1,t2;
+#
# MDEV-31199: Assertion `field->table->stats_is_read' fails with hash_join_cardinality=on
#
CREATE TABLE t1 (a VARCHAR(255));
diff --git a/mysql-test/main/selectivity_no_engine.test b/mysql-test/main/selectivity_no_engine.test
index 47bac21a..4d050513 100644
--- a/mysql-test/main/selectivity_no_engine.test
+++ b/mysql-test/main/selectivity_no_engine.test
@@ -251,6 +251,28 @@ SELECT * FROM t1 AS a NATURAL JOIN t1 AS b;
DROP TABLE t1,t2,t3;
--echo #
+--echo # MDEV-30529: Assertion `rnd_records <= s->found_records' failed in best_access_path
+--echo #
+CREATE TABLE t1 (a INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE TABLE t2 (b VARCHAR(1), c INT, d VARCHAR(1), e VARCHAR(1), KEY(b), KEY(d), KEY(e)) ENGINE=MyISAM;
+INSERT INTO t2 VALUES ('x',0,'-','-'),
+('x',0,'-','-'),('x',5,'-','-'),('x',0,'-','-'),('x',0,'-','-'),
+('x',0,'-','-'),('x',0,'w','-'),('x',0,'-','-'),('x',0,'-','-'),
+('x',0,'-','-'),('x',0,'-','-'),('x',0,'-','u'),('x',0,'-','-'),
+('x',0,'-','-'),('x',0,'-','t'),('x',0,'-','-'),('x',0,'-','-'),
+('x',0,'-','-'),('x',0,'-','-'),('x',0,'-','-'),('x',0,'-','p'),
+('x',0,'z','-'),('x',0,'-','-'),('x',0,'-','-'),('x',0,'-','v');
+
+set @tmp_jcl=@@join_cache_level;
+SET JOIN_CACHE_LEVEL= 3;
+SELECT * FROM t1 JOIN t2 ON t1.a = t2.c WHERE t2.b IN ('o') OR t2.e >= 'f' OR t2.d > 'p';
+set join_cache_level=@tmp_jcl;
+
+drop table t1,t2;
+
+--echo #
--echo # MDEV-31199: Assertion `field->table->stats_is_read' fails with hash_join_cardinality=on
--echo #
CREATE TABLE t1 (a VARCHAR(255));
diff --git a/mysql-test/main/selectivity_notembedded.result b/mysql-test/main/selectivity_notembedded.result
index ac8922a2..d47154fd 100644
--- a/mysql-test/main/selectivity_notembedded.result
+++ b/mysql-test/main/selectivity_notembedded.result
@@ -115,12 +115,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": 0.0295225,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 100,
+ "cost": 0.0295225,
"filtered": 53.32928848,
"attached_condition": "t1.col0 > 1 and t1.col1 > 1 and t1.col2 > 1 and t1.col3 > 1 and t1.col4 > 1 and t1.col5 > 1 and t1.col6 > 1 and t1.col7 > 1 and t1.col8 > 1 and t1.col9 > 1 and t1.col10 > 1 and t1.col11 > 1 and t1.col12 > 1 and t1.col13 > 1 and t1.col14 > 1 and t1.col15 > 1 and t1.col16 > 1 and t1.col17 > 1 and t1.col18 > 1 and t1.col19 > 1 and t1.col20 > 1 and t1.col21 > 1 and t1.col22 > 1 and t1.col23 > 1 and t1.col24 > 1 and t1.col25 > 1 and t1.col26 > 1 and t1.col27 > 1 and t1.col28 > 1 and t1.col29 > 1 and t1.col30 > 1 and t1.col31 > 1 and t1.col32 > 1 and t1.col33 > 1 and t1.col34 > 1 and t1.col35 > 1 and t1.col36 > 1 and t1.col37 > 1 and t1.col38 > 1 and t1.col39 > 1 and t1.col40 > 1 and t1.col41 > 1 and t1.col42 > 1 and t1.col43 > 1 and t1.col44 > 1 and t1.col45 > 1 and t1.col46 > 1 and t1.col47 > 1 and t1.col48 > 1 and t1.col49 > 1 and t1.col50 > 1 and t1.col51 > 1 and t1.col52 > 1 and t1.col53 > 1 and t1.col54 > 1 and t1.col55 > 1 and t1.col56 > 1 and t1.col57 > 1 and t1.col58 > 1 and t1.col59 > 1 and t1.col60 > 1 and t1.col61 > 1 and t1.col62 > 1 and t1.col63 > 1 and t1.col64 > 1 and t1.col65 > 1 and t1.col66 > 1 and t1.col67 > 1 and t1.col68 > 1 and t1.col69 > 1 and t1.col70 > 1 and t1.col71 > 1 and t1.col72 > 1 and t1.col73 > 1 and t1.col74 > 1 and t1.col75 > 1 and t1.col76 > 1 and t1.col77 > 1 and t1.col78 > 1 and t1.col79 > 1 and t1.col80 > 1 and t1.col81 > 1 and t1.col82 > 1 and t1.col83 > 1 and t1.col84 > 1 and t1.col85 > 1 and t1.col86 > 1 and t1.col87 > 1 and t1.col88 > 1 and t1.col89 > 1 and t1.col90 > 1 and t1.col91 > 1 and t1.col92 > 1 and t1.col93 > 1 and t1.col94 > 1 and t1.col95 > 1 and t1.col96 > 1 and t1.col97 > 1 and t1.col98 > 1 and t1.col99 > 1 and t1.col100 > 1 and t1.col101 > 1 and t1.col102 > 1 and t1.col103 > 1 and t1.col104 > 1 and t1.col105 > 1 and t1.col106 > 1 and t1.col107 > 1 and t1.col108 > 1 and t1.col109 > 1 and t1.col110 > 1 and t1.col111 > 1 and t1.col112 > 1 and t1.col113 > 1 and t1.col114 > 1 and t1.col115 > 1 and t1.col116 > 1 and t1.col117 > 1 and t1.col118 > 1 and t1.col119 > 1 and t1.col120 > 1 and t1.col121 > 1 and t1.col122 > 1 and t1.col123 > 1 and t1.col124 > 1 and t1.col125 > 1 and t1.col126 > 1 and t1.col127 > 1 and t1.col128 > 1 and t1.col129 > 1 and t1.col130 > 1 and t1.col131 > 1 and t1.col132 > 1 and t1.col133 > 1 and t1.col134 > 1 and t1.col135 > 1 and t1.col136 > 1 and t1.col137 > 1 and t1.col138 > 1 and t1.col139 > 1 and t1.col140 > 1 and t1.col141 > 1 and t1.col142 > 1 and t1.col143 > 1 and t1.col144 > 1 and t1.col145 > 1 and t1.col146 > 1 and t1.col147 > 1 and t1.col148 > 1 and t1.col149 > 1 and t1.col150 > 1 and t1.col151 > 1 and t1.col152 > 1 and t1.col153 > 1 and t1.col154 > 1 and t1.col155 > 1 and t1.col156 > 1 and t1.col157 > 1 and t1.col158 > 1 and t1.col159 > 1"
}
@@ -146,12 +149,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": 0.0295225,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 100,
+ "cost": 0.0295225,
"filtered": 53.32928848,
"attached_condition": "t1.col0 > 1 and t1.col1 > 1 and t1.col2 > 1 and t1.col3 > 1 and t1.col4 > 1 and t1.col5 > 1 and t1.col6 > 1 and t1.col7 > 1 and t1.col8 > 1 and t1.col9 > 1 and t1.col10 > 1 and t1.col11 > 1 and t1.col12 > 1 and t1.col13 > 1 and t1.col14 > 1 and t1.col15 > 1 and t1.col16 > 1 and t1.col17 > 1 and t1.col18 > 1 and t1.col19 > 1 and t1.col20 > 1 and t1.col21 > 1 and t1.col22 > 1 and t1.col23 > 1 and t1.col24 > 1 and t1.col25 > 1 and t1.col26 > 1 and t1.col27 > 1 and t1.col28 > 1 and t1.col29 > 1 and t1.col30 > 1 and t1.col31 > 1 and t1.col32 > 1 and t1.col33 > 1 and t1.col34 > 1 and t1.col35 > 1 and t1.col36 > 1 and t1.col37 > 1 and t1.col38 > 1 and t1.col39 > 1 and t1.col40 > 1 and t1.col41 > 1 and t1.col42 > 1 and t1.col43 > 1 and t1.col44 > 1 and t1.col45 > 1 and t1.col46 > 1 and t1.col47 > 1 and t1.col48 > 1 and t1.col49 > 1 and t1.col50 > 1 and t1.col51 > 1 and t1.col52 > 1 and t1.col53 > 1 and t1.col54 > 1 and t1.col55 > 1 and t1.col56 > 1 and t1.col57 > 1 and t1.col58 > 1 and t1.col59 > 1 and t1.col60 > 1 and t1.col61 > 1 and t1.col62 > 1 and t1.col63 > 1 and t1.col64 > 1 and t1.col65 > 1 and t1.col66 > 1 and t1.col67 > 1 and t1.col68 > 1 and t1.col69 > 1 and t1.col70 > 1 and t1.col71 > 1 and t1.col72 > 1 and t1.col73 > 1 and t1.col74 > 1 and t1.col75 > 1 and t1.col76 > 1 and t1.col77 > 1 and t1.col78 > 1 and t1.col79 > 1 and t1.col80 > 1 and t1.col81 > 1 and t1.col82 > 1 and t1.col83 > 1 and t1.col84 > 1 and t1.col85 > 1 and t1.col86 > 1 and t1.col87 > 1 and t1.col88 > 1 and t1.col89 > 1 and t1.col90 > 1 and t1.col91 > 1 and t1.col92 > 1 and t1.col93 > 1 and t1.col94 > 1 and t1.col95 > 1 and t1.col96 > 1 and t1.col97 > 1 and t1.col98 > 1 and t1.col99 > 1 and t1.col100 > 1 and t1.col101 > 1 and t1.col102 > 1 and t1.col103 > 1 and t1.col104 > 1 and t1.col105 > 1 and t1.col106 > 1 and t1.col107 > 1 and t1.col108 > 1 and t1.col109 > 1 and t1.col110 > 1 and t1.col111 > 1 and t1.col112 > 1 and t1.col113 > 1 and t1.col114 > 1 and t1.col115 > 1 and t1.col116 > 1 and t1.col117 > 1 and t1.col118 > 1 and t1.col119 > 1 and t1.col120 > 1 and t1.col121 > 1 and t1.col122 > 1 and t1.col123 > 1 and t1.col124 > 1 and t1.col125 > 1 and t1.col126 > 1 and t1.col127 > 1 and t1.col128 > 1 and t1.col129 > 1 and t1.col130 > 1 and t1.col131 > 1 and t1.col132 > 1 and t1.col133 > 1 and t1.col134 > 1 and t1.col135 > 1 and t1.col136 > 1 and t1.col137 > 1 and t1.col138 > 1 and t1.col139 > 1 and t1.col140 > 1 and t1.col141 > 1 and t1.col142 > 1 and t1.col143 > 1 and t1.col144 > 1 and t1.col145 > 1 and t1.col146 > 1 and t1.col147 > 1 and t1.col148 > 1 and t1.col149 > 1 and t1.col150 > 1 and t1.col151 > 1 and t1.col152 > 1 and t1.col153 > 1 and t1.col154 > 1 and t1.col155 > 1 and t1.col156 > 1 and t1.col157 > 1 and t1.col158 > 1 and t1.col159 > 1"
}
@@ -184,12 +190,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": 0.0295225,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 100,
+ "cost": 0.0295225,
"filtered": 99.60784149,
"attached_condition": "(t1.col1 > 1 or t1.col2 > 1 or t1.col3 > 1 or t1.col4 > 1 or t1.col5 > 1 or t1.col6 > 1 or t1.col7 > 1 or t1.col8 > 1 or t1.col9 > 1 or t1.col10 > 1 or t1.col11 > 1 or t1.col12 > 1 or t1.col13 > 1 or t1.col14 > 1 or t1.col15 > 1 or t1.col16 > 1 or t1.col17 > 1 or t1.col18 > 1 or t1.col19 > 1 or t1.col20 > 1 or t1.col21 > 1 or t1.col22 > 1 or t1.col23 > 1 or t1.col24 > 1 or t1.col25 > 1 or t1.col26 > 1 or t1.col27 > 1 or t1.col28 > 1 or t1.col29 > 1 or t1.col30 > 1 or t1.col31 > 1 or t1.col32 > 1 or t1.col33 > 1 or t1.col34 > 1 or t1.col35 > 1 or t1.col36 > 1 or t1.col37 > 1 or t1.col38 > 1 or t1.col39 > 1 or t1.col40 > 1 or t1.col41 > 1 or t1.col42 > 1 or t1.col43 > 1 or t1.col44 > 1 or t1.col45 > 1 or t1.col46 > 1 or t1.col47 > 1 or t1.col48 > 1 or t1.col49 > 1 or t1.col50 > 1 or t1.col51 > 1 or t1.col52 > 1 or t1.col53 > 1 or t1.col54 > 1 or t1.col55 > 1 or t1.col56 > 1 or t1.col57 > 1 or t1.col58 > 1 or t1.col59 > 1 or t1.col60 > 1 or t1.col61 > 1 or t1.col62 > 1 or t1.col63 > 1 or t1.col64 > 1 or t1.col65 > 1 or t1.col66 > 1 or t1.col67 > 1 or t1.col68 > 1 or t1.col69 > 1 or t1.col70 > 1 or t1.col71 > 1 or t1.col72 > 1 or t1.col73 > 1 or t1.col74 > 1 or t1.col75 > 1 or t1.col76 > 1 or t1.col77 > 1 or t1.col78 > 1 or t1.col79 > 1 or t1.col80 > 1 or t1.col81 > 1 or t1.col82 > 1 or t1.col83 > 1 or t1.col84 > 1 or t1.col85 > 1 or t1.col86 > 1 or t1.col87 > 1 or t1.col88 > 1 or t1.col89 > 1 or t1.col90 > 1 or t1.col91 > 1 or t1.col92 > 1 or t1.col93 > 1 or t1.col94 > 1 or t1.col95 > 1 or t1.col96 > 1 or t1.col97 > 1 or t1.col98 > 1 or t1.col99 > 1 or t1.col100 > 1 or t1.col101 > 1 or t1.col102 > 1 or t1.col103 > 1 or t1.col104 > 1 or t1.col105 > 1 or t1.col106 > 1 or t1.col107 > 1 or t1.col108 > 1 or t1.col109 > 1 or t1.col110 > 1 or t1.col111 > 1 or t1.col112 > 1 or t1.col113 > 1 or t1.col114 > 1 or t1.col115 > 1 or t1.col116 > 1 or t1.col117 > 1 or t1.col118 > 1 or t1.col119 > 1 or t1.col120 > 1 or t1.col121 > 1 or t1.col122 > 1 or t1.col123 > 1 or t1.col124 > 1 or t1.col125 > 1 or t1.col126 > 1 or t1.col127 > 1 or t1.col128 > 1 or t1.col129 > 1 or t1.col130 > 1 or t1.col131 > 1 or t1.col132 > 1 or t1.col133 > 1 or t1.col134 > 1 or t1.col135 > 1 or t1.col136 > 1 or t1.col137 > 1 or t1.col138 > 1 or t1.col139 > 1 or t1.col140 > 1 or t1.col141 > 1 or t1.col142 > 1 or t1.col143 > 1 or t1.col144 > 1 or t1.col145 > 1 or t1.col146 > 1 or t1.col147 > 1 or t1.col148 > 1 or t1.col149 > 1 or t1.col150 > 1 or t1.col151 > 1 or t1.col152 > 1 or t1.col153 > 1 or t1.col154 > 1 or t1.col155 > 1 or t1.col156 > 1 or t1.col157 > 1 or t1.col158 > 1) and t1.col159 > 1"
}
diff --git a/mysql-test/main/set_operation.result b/mysql-test/main/set_operation.result
index fa0fe21d..f01b6835 100644
--- a/mysql-test/main/set_operation.result
+++ b/mysql-test/main/set_operation.result
@@ -221,7 +221,7 @@ NULL UNIT RESULT <unit8,9,12> ALL NULL NULL NULL NULL NULL NULL
16 EXCEPT NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNIT RESULT <unit1,15,16> ALL NULL NULL NULL NULL NULL NULL
Warnings:
-Note 1003 /* select#1 */ select `__14`.`1` AS `1` from (/* select#8 */ select `__7`.`1` AS `1` from (/* select#2 */ select 1 AS `1` except /* select#3 */ select 5 AS `5` union /* select#4 */ select 6 AS `6`) `__7` union /* select#9 */ select `__8`.`2` AS `2` from (/* select#5 */ select 2 AS `2` intersect /* select#6 */ select 3 AS `3` intersect /* select#7 */ select 4 AS `4`) `__8` except /* select#12 */ select `__11`.`7` AS `7` from (/* select#10 */ select 7 AS `7` intersect /* select#11 */ select 8 AS `8`) `__11`) `__14` union all /* select#15 */ select `__15`.`9` AS `9` from (/* select#13 */ select 9 AS `9` union all /* select#14 */ select 10 AS `10`) `__15` except all /* select#16 */ select 11 AS `11`
+Note 1003 /* select#1 */ select `__14`.`1` AS `1` from (/* select#8 */ select `__7`.`1` AS `1` from (/* select#2 */ select 1 AS `1` except /* select#3 */ select 5 AS `5` union all /* select#4 */ select 6 AS `6`) `__7` union /* select#9 */ select `__8`.`2` AS `2` from (/* select#5 */ select 2 AS `2` intersect /* select#6 */ select 3 AS `3` intersect /* select#7 */ select 4 AS `4`) `__8` except /* select#12 */ select `__11`.`7` AS `7` from (/* select#10 */ select 7 AS `7` intersect /* select#11 */ select 8 AS `8`) `__11`) `__14` union all /* select#15 */ select `__15`.`9` AS `9` from (/* select#13 */ select 9 AS `9` union all /* select#14 */ select 10 AS `10`) `__15` except all /* select#16 */ select 11 AS `11`
(select 1 union all select 2)
union
(select 3 union all select 4);
@@ -242,7 +242,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
5 UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union1,6> ALL NULL NULL NULL NULL NULL NULL
Warnings:
-Note 1003 /* select#1 */ select `__5`.`1` AS `1` from (/* select#2 */ select 1 AS `1` union /* select#3 */ select 2 AS `2`) `__5` union /* select#6 */ select `__6`.`3` AS `3` from (/* select#4 */ select 3 AS `3` union /* select#5 */ select 4 AS `4`) `__6`
+Note 1003 /* select#1 */ select `__5`.`1` AS `1` from (/* select#2 */ select 1 AS `1` union all /* select#3 */ select 2 AS `2`) `__5` union /* select#6 */ select `__6`.`3` AS `3` from (/* select#4 */ select 3 AS `3` union /* select#5 */ select 4 AS `4`) `__6`
(select 1 intersect all select 2)
except
select 3;
@@ -258,7 +258,7 @@ NULL INTERSECT RESULT <intersect2,3> ALL NULL NULL NULL NULL NULL NULL
4 EXCEPT NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL EXCEPT RESULT <except1,4> ALL NULL NULL NULL NULL NULL NULL
Warnings:
-Note 1003 /* select#1 */ select `__4`.`1` AS `1` from (/* select#2 */ select 1 AS `1` intersect /* select#3 */ select 2 AS `2`) `__4` except /* select#4 */ select 3 AS `3`
+Note 1003 /* select#1 */ select `__4`.`1` AS `1` from (/* select#2 */ select 1 AS `1` intersect all /* select#3 */ select 2 AS `2`) `__4` except /* select#4 */ select 3 AS `3`
(select 1 intersect all select 2 intersect all select 3)
intersect
(select 4 intersect all select 5);
@@ -278,7 +278,7 @@ NULL INTERSECT RESULT <intersect2,3,4> ALL NULL NULL NULL NULL NULL NULL
NULL INTERSECT RESULT <intersect5,6> ALL NULL NULL NULL NULL NULL NULL
NULL INTERSECT RESULT <intersect1,7> ALL NULL NULL NULL NULL NULL NULL
Warnings:
-Note 1003 /* select#1 */ select `__6`.`1` AS `1` from (/* select#2 */ select 1 AS `1` intersect /* select#3 */ select 2 AS `2` intersect /* select#4 */ select 3 AS `3`) `__6` intersect /* select#7 */ select `__7`.`4` AS `4` from (/* select#5 */ select 4 AS `4` intersect /* select#6 */ select 5 AS `5`) `__7`
+Note 1003 /* select#1 */ select `__6`.`1` AS `1` from (/* select#2 */ select 1 AS `1` intersect all /* select#3 */ select 2 AS `2` intersect all /* select#4 */ select 3 AS `3`) `__6` intersect /* select#7 */ select `__7`.`4` AS `4` from (/* select#5 */ select 4 AS `4` intersect /* select#6 */ select 5 AS `5`) `__7`
# test set operations with table value constructor
(values (1,1),(1,1),(1,1),(2,2),(2,2),(3,3),(9,9))
INTERSECT ALL
@@ -571,12 +571,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "REPLACED",
"filtered": 100
}
}
@@ -587,12 +590,15 @@ EXPLAIN
"query_block": {
"select_id": 8,
"operation": "UNION",
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
@@ -603,12 +609,15 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 6,
+ "cost": "REPLACED",
"filtered": 100
}
}
@@ -628,12 +637,15 @@ EXPLAIN
"query_block": {
"select_id": 4,
"operation": "INTERSECT",
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "<derived5>",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
@@ -642,12 +654,15 @@ EXPLAIN
{
"query_block": {
"select_id": 5,
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "REPLACED",
"filtered": 100
}
}
@@ -658,12 +673,15 @@ EXPLAIN
"query_block": {
"select_id": 6,
"operation": "UNION",
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "REPLACED",
"filtered": 100
}
}
@@ -692,12 +710,15 @@ EXPLAIN
"query_block": {
"select_id": 7,
"operation": "EXCEPT",
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "REPLACED",
"filtered": 100
}
}
@@ -708,12 +729,15 @@ EXPLAIN
"query_block": {
"select_id": 9,
"operation": "UNION",
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 6,
+ "cost": "REPLACED",
"filtered": 100
}
}
@@ -724,12 +748,15 @@ EXPLAIN
"query_block": {
"select_id": 10,
"operation": "UNION",
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "REPLACED",
"filtered": 100
}
}
@@ -740,12 +767,15 @@ EXPLAIN
"query_block": {
"select_id": 11,
"operation": "EXCEPT",
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "REPLACED",
"filtered": 100
}
},
@@ -754,7 +784,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 5,
"rows": 6,
+ "cost": "REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -769,12 +801,15 @@ EXPLAIN
"query_block": {
"select_id": 12,
"operation": "UNION",
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 4"
}
@@ -784,7 +819,9 @@ EXPLAIN
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 5,
"rows": 6,
+ "cost": "REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -799,12 +836,15 @@ EXPLAIN
"query_block": {
"select_id": 13,
"operation": "UNION",
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 5,
+ "cost": "REPLACED",
"filtered": 100
}
}
diff --git a/mysql-test/main/set_operation.test b/mysql-test/main/set_operation.test
index c422042f..e9f71a7e 100644
--- a/mysql-test/main/set_operation.test
+++ b/mysql-test/main/set_operation.test
@@ -272,6 +272,7 @@ select * from v0 where g < 4
UNION ALL
select * from t3;
+--source include/analyze-format.inc
EXPLAIN format=json
select * from t1
UNION ALL
diff --git a/mysql-test/main/set_password.result b/mysql-test/main/set_password.result
index 19ca628f..b49574fb 100644
--- a/mysql-test/main/set_password.result
+++ b/mysql-test/main/set_password.result
@@ -42,17 +42,17 @@ select current_user();
current_user()
newpassnat@localhost
disconnect con;
-connect con,localhost,oldauth,test,;
+connect con,localhost,oldauth,test,,,,auth=mysql_old_password:mysql_native_password;
select current_user();
current_user()
oldauth@localhost
disconnect con;
-connect con,localhost,oldpass,test,;
+connect con,localhost,oldpass,test,,,,auth=mysql_old_password:mysql_native_password;
select current_user();
current_user()
oldpass@localhost
disconnect con;
-connect con,localhost,oldpassold,test,;
+connect con,localhost,oldpassold,test,,,,auth=mysql_old_password:mysql_native_password;
select current_user();
current_user()
oldpassold@localhost
@@ -74,17 +74,17 @@ select current_user();
current_user()
newpassnat@localhost
disconnect con;
-connect con,localhost,oldauth,test,;
+connect con,localhost,oldauth,test,,,,auth=mysql_old_password:mysql_native_password;
select current_user();
current_user()
oldauth@localhost
disconnect con;
-connect con,localhost,oldpass,test,;
+connect con,localhost,oldpass,test,,,,auth=mysql_old_password:mysql_native_password;
select current_user();
current_user()
oldpass@localhost
disconnect con;
-connect con,localhost,oldpassold,test,;
+connect con,localhost,oldpassold,test,,,,auth=mysql_old_password:mysql_native_password;
select current_user();
current_user()
oldpassold@localhost
diff --git a/mysql-test/main/set_password.test b/mysql-test/main/set_password.test
index 071b2d05..e3d35d1f 100644
--- a/mysql-test/main/set_password.test
+++ b/mysql-test/main/set_password.test
@@ -47,13 +47,13 @@ select current_user();
--connect(con,localhost,newpassnat,test,)
select current_user();
--disconnect con
---connect(con,localhost,oldauth,test,)
+--connect(con,localhost,oldauth,test,,,,auth=mysql_old_password:mysql_native_password)
select current_user();
--disconnect con
---connect(con,localhost,oldpass,test,)
+--connect(con,localhost,oldpass,test,,,,auth=mysql_old_password:mysql_native_password)
select current_user();
--disconnect con
---connect(con,localhost,oldpassold,test,)
+--connect(con,localhost,oldpassold,test,,,,auth=mysql_old_password:mysql_native_password)
select current_user();
--disconnect con
@@ -70,13 +70,13 @@ select current_user();
--connect(con,localhost,newpassnat,test,)
select current_user();
--disconnect con
---connect(con,localhost,oldauth,test,)
+--connect(con,localhost,oldauth,test,,,,auth=mysql_old_password:mysql_native_password)
select current_user();
--disconnect con
---connect(con,localhost,oldpass,test,)
+--connect(con,localhost,oldpass,test,,,,auth=mysql_old_password:mysql_native_password)
select current_user();
--disconnect con
---connect(con,localhost,oldpassold,test,)
+--connect(con,localhost,oldpassold,test,,,,auth=mysql_old_password:mysql_native_password)
select current_user();
--disconnect con
diff --git a/mysql-test/main/set_statement.result b/mysql-test/main/set_statement.result
index cbfee8b8..810ec32e 100644
--- a/mysql-test/main/set_statement.result
+++ b/mysql-test/main/set_statement.result
@@ -1215,8 +1215,6 @@ set @@long_query_time= @save_long_query_time;
truncate table mysql.slow_log;
set statement autocommit=default for select 1;
ERROR 42000: The system variable autocommit cannot be set in SET STATEMENT.
-set statement tx_isolation=default for select 1;
-ERROR 42000: The system variable tx_isolation cannot be set in SET STATEMENT.
set statement skip_replication=default for select 1;
ERROR 42000: The system variable skip_replication cannot be set in SET STATEMENT.
set statement sql_log_off=default for select 1;
diff --git a/mysql-test/main/set_statement.test b/mysql-test/main/set_statement.test
index afe39c00..b8df5b17 100644
--- a/mysql-test/main/set_statement.test
+++ b/mysql-test/main/set_statement.test
@@ -1065,8 +1065,6 @@ truncate table mysql.slow_log;
--error ER_SET_STATEMENT_NOT_SUPPORTED
set statement autocommit=default for select 1;
--error ER_SET_STATEMENT_NOT_SUPPORTED
-set statement tx_isolation=default for select 1;
---error ER_SET_STATEMENT_NOT_SUPPORTED
set statement skip_replication=default for select 1;
--error ER_SET_STATEMENT_NOT_SUPPORTED
set statement sql_log_off=default for select 1;
diff --git a/mysql-test/main/show_analyze.result b/mysql-test/main/show_analyze.result
index cc427b45..f55a8be7 100644
--- a/mysql-test/main/show_analyze.result
+++ b/mysql-test/main/show_analyze.result
@@ -1,6 +1,6 @@
drop table if exists t0, t1, t2, t3, t4;
drop view if exists v1;
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
set debug_sync='RESET';
create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
@@ -18,7 +18,7 @@ show analyze for (select a from t0 limit 1);
ERROR HY000: You may only use constant expressions in this statement
connect con1, localhost, root,,;
connection con1;
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
connection default;
show analyze for $thr2;
ERROR HY000: Target is not executing an operation with a query plan
@@ -409,6 +409,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"filesort": {
@@ -425,9 +426,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
diff --git a/mysql-test/main/show_analyze.test b/mysql-test/main/show_analyze.test
index c55aacda..e7ddea53 100644
--- a/mysql-test/main/show_analyze.test
+++ b/mysql-test/main/show_analyze.test
@@ -12,7 +12,7 @@
drop table if exists t0, t1, t2, t3, t4;
drop view if exists v1;
--enable_warnings
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
#
# Testcases in this file do not work with embedded server. The reason for this
@@ -61,7 +61,7 @@ let $thr1=`select connection_id()`;
connect (con1, localhost, root,,);
connection con1;
let $thr2=`select connection_id()`;
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
connection default;
# SHOW ANALYZE FOR <idle thread>
diff --git a/mysql-test/main/show_analyze_json.result b/mysql-test/main/show_analyze_json.result
index f24d32f1..66b94a6b 100644
--- a/mysql-test/main/show_analyze_json.result
+++ b/mysql-test/main/show_analyze_json.result
@@ -1,6 +1,6 @@
drop table if exists t0, t1, t2, t3, t4;
drop view if exists v1;
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
set debug_sync='RESET';
create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
@@ -20,7 +20,7 @@ show analyze format=JSON for (select a from t0 limit 1);
ERROR HY000: You may only use constant expressions in this statement
connect con1, localhost, root,,;
connection con1;
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
connection default;
show analyze format = JSON for $thr2;
ERROR HY000: Target is not executing an operation with a query plan
@@ -44,15 +44,18 @@ SHOW ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 1000,
"r_rows": 1000,
+ "cost": "REPLACED",
"filtered": 50,
"r_filtered": 50,
"attached_condition": "t1.c < 500"
@@ -77,15 +80,18 @@ SHOW ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 1000,
"r_rows": 1000,
+ "cost": "REPLACED",
"filtered": 10,
"r_filtered": 10,
"attached_condition": "t1.c < 10"
@@ -111,6 +117,7 @@ SHOW ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -119,9 +126,11 @@ SHOW ANALYZE
"table_name": "t1",
"access_type": "ALL",
"possible_keys": ["a"],
+ "loops": 1,
"r_loops": 1,
"rows": 1000,
"r_rows": 1000,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -161,15 +170,18 @@ SHOW ANALYZE
{
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"nested_loop": [
{
"table": {
"table_name": "a",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"filtered": 100,
"r_filtered": 60,
"attached_condition": "a.a <= 5"
@@ -182,14 +194,17 @@ SHOW ANALYZE
"query_block": {
"select_id": 2,
"operation": "UNION",
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "b",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 0,
"rows": 10,
"r_rows": null,
+ "cost": "REPLACED",
"filtered": 100,
"r_filtered": null,
"attached_condition": "b.a >= 9"
@@ -230,15 +245,18 @@ SHOW ANALYZE
{
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"nested_loop": [
{
"table": {
"table_name": "a",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"filtered": 100,
"r_filtered": 60,
"attached_condition": "a.a <= 5"
@@ -251,15 +269,18 @@ SHOW ANALYZE
"query_block": {
"select_id": 2,
"operation": "UNION",
+ "cost": "REPLACED",
"r_loops": 1,
"nested_loop": [
{
"table": {
"table_name": "b",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"filtered": 100,
"r_filtered": 10,
"attached_condition": "b.a >= 9"
@@ -300,6 +321,7 @@ SHOW ANALYZE
{
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -307,9 +329,11 @@ SHOW ANALYZE
"table": {
"table_name": "a",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -325,14 +349,17 @@ SHOW ANALYZE
"query_block": {
"select_id": 2,
"operation": "UNION",
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "b",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 0,
"rows": 10,
"r_rows": null,
+ "cost": "REPLACED",
"r_engine_stats": REPLACED,
"filtered": 100,
"r_filtered": null,
@@ -374,6 +401,7 @@ SHOW ANALYZE
{
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -381,9 +409,11 @@ SHOW ANALYZE
"table": {
"table_name": "a",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -399,6 +429,7 @@ SHOW ANALYZE
"query_block": {
"select_id": 2,
"operation": "UNION",
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -406,9 +437,11 @@ SHOW ANALYZE
"table": {
"table_name": "b",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -446,15 +479,18 @@ SHOW ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"nested_loop": [
{
"table": {
"table_name": "a",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"filtered": 100,
"r_filtered": 20,
"attached_condition": "a.a < 2"
@@ -465,15 +501,18 @@ SHOW ANALYZE
{
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 1,
"nested_loop": [
{
"table": {
"table_name": "b",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"filtered": 100,
"r_filtered": 30,
"attached_condition": "b.a > 6"
@@ -506,6 +545,7 @@ SHOW ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -513,9 +553,11 @@ SHOW ANALYZE
"table": {
"table_name": "a",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -529,6 +571,7 @@ SHOW ANALYZE
{
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -536,9 +579,11 @@ SHOW ANALYZE
"table": {
"table_name": "b",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -574,14 +619,17 @@ SHOW ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "a",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 0,
"rows": 10,
"r_rows": null,
+ "cost": "REPLACED",
"filtered": 100,
"r_filtered": null,
"attached_condition": "a.a < 2"
@@ -595,14 +643,17 @@ SHOW ANALYZE
"r_loops": 0,
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "b",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 0,
"rows": 10,
"r_rows": null,
+ "cost": "REPLACED",
"filtered": 100,
"r_filtered": null,
"attached_condition": "b.a + a.a < 10"
@@ -636,15 +687,18 @@ SHOW ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"nested_loop": [
{
"table": {
"table_name": "a",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"filtered": 100,
"r_filtered": 20,
"attached_condition": "a.a < 2"
@@ -658,15 +712,18 @@ SHOW ANALYZE
"r_hit_ratio": 0,
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 2,
"nested_loop": [
{
"table": {
"table_name": "b",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 2,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"filtered": 100,
"r_filtered": 95,
"attached_condition": "b.a + a.a < 10"
@@ -700,6 +757,7 @@ SHOW ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -707,9 +765,11 @@ SHOW ANALYZE
"table": {
"table_name": "a",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -726,6 +786,7 @@ SHOW ANALYZE
"r_hit_ratio": 0,
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 2,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -733,9 +794,11 @@ SHOW ANALYZE
"table": {
"table_name": "b",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 2,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -800,14 +863,17 @@ SHOW ANALYZE
{
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 0,
"rows": 10,
"r_rows": null,
+ "cost": "REPLACED",
"filtered": 100,
"r_filtered": null,
"attached_condition": "t2.a + t0.a < 3"
@@ -843,15 +909,18 @@ SHOW ANALYZE
{
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 1,
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"filtered": 100,
"r_filtered": 30,
"attached_condition": "t2.a + t0.a < 3"
@@ -898,14 +967,17 @@ SHOW ANALYZE
{
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 0,
"rows": 10,
"r_rows": null,
+ "cost": "REPLACED",
"filtered": 100,
"r_filtered": null,
"attached_condition": "t2.a + t0.a < 3"
@@ -941,15 +1013,18 @@ SHOW ANALYZE
{
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 1,
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"filtered": 100,
"r_filtered": 30,
"attached_condition": "t2.a + t0.a < 3"
@@ -983,15 +1058,18 @@ SHOW ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 3,
"r_rows": 1,
+ "cost": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
@@ -1004,14 +1082,17 @@ SHOW ANALYZE
"r_hit_ratio": 0,
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 0,
"rows": 10,
"r_rows": null,
+ "cost": "REPLACED",
"filtered": 100,
"r_filtered": null,
"attached_condition": "t2.a + t0.a < 3"
@@ -1035,15 +1116,18 @@ SHOW ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 3,
"r_rows": 2,
+ "cost": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
@@ -1056,15 +1140,18 @@ SHOW ANALYZE
"r_hit_ratio": 0,
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 1,
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"filtered": 100,
"r_filtered": 30,
"attached_condition": "t2.a + t0.a < 3"
@@ -1088,15 +1175,18 @@ SHOW ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
+ "cost": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
@@ -1109,15 +1199,18 @@ SHOW ANALYZE
"r_hit_ratio": 0,
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 2,
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 2,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"filtered": 100,
"r_filtered": 25,
"attached_condition": "t2.a + t0.a < 3"
@@ -1155,6 +1248,7 @@ SHOW ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"nested_loop": [
{
@@ -1170,9 +1264,11 @@ SHOW ANALYZE
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
@@ -1214,6 +1310,7 @@ SHOW ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"temporary_table": {
"nested_loop": [
@@ -1221,9 +1318,11 @@ SHOW ANALYZE
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
@@ -1263,6 +1362,7 @@ SHOW ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"temporary_table": {
"nested_loop": [
@@ -1270,9 +1370,11 @@ SHOW ANALYZE
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"filtered": 100,
"r_filtered": 100
}
diff --git a/mysql-test/main/show_analyze_json.test b/mysql-test/main/show_analyze_json.test
index cd221854..b0847d86 100644
--- a/mysql-test/main/show_analyze_json.test
+++ b/mysql-test/main/show_analyze_json.test
@@ -12,7 +12,7 @@
drop table if exists t0, t1, t2, t3, t4;
drop view if exists v1;
--enable_warnings
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
#
# Testcases in this file do not work with embedded server. The reason for this
@@ -67,7 +67,7 @@ let $thr1=`select connection_id()`;
connect (con1, localhost, root,,);
connection con1;
let $thr2=`select connection_id()`;
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
connection default;
# SHOW ANALYZE FOR <idle thread>
diff --git a/mysql-test/main/show_explain.result b/mysql-test/main/show_explain.result
index 22ac7de6..7d41a58e 100644
--- a/mysql-test/main/show_explain.result
+++ b/mysql-test/main/show_explain.result
@@ -1,6 +1,6 @@
drop table if exists t0, t1, t2, t3, t4;
drop view if exists v1;
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
set debug_sync='RESET';
create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
@@ -23,7 +23,7 @@ explain for connection (select max(a) from t0);
ERROR HY000: You may only use constant expressions in this statement
connect con1, localhost, root,,;
connection con1;
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
connection default;
show explain for $thr2;
ERROR HY000: Target is not executing an operation with a query plan
@@ -1267,7 +1267,7 @@ explain
SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 system NULL NULL NULL NULL 1
-1 SIMPLE t1 range b b 6 NULL 107 Using where; Using index
+1 SIMPLE t1 index b b 6 NULL 107 Using where; Using index
1 SIMPLE t3 ref PRIMARY PRIMARY 5 test.t1.b 1 Using index
set @show_explain_probe_select_id=1;
SET debug_dbug='+d,show_explain_probe_do_select';
@@ -1276,7 +1276,7 @@ connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 system NULL NULL NULL NULL 1
-1 SIMPLE t1 range b b 6 NULL 107 Using where; Using index
+1 SIMPLE t1 index b b 6 NULL 107 Using where; Using index
1 SIMPLE t3 ref PRIMARY PRIMARY 5 test.t1.b 1 Using index
Warnings:
Note 1003 SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2
diff --git a/mysql-test/main/show_explain.test b/mysql-test/main/show_explain.test
index 749c08b1..d10c4eeb 100644
--- a/mysql-test/main/show_explain.test
+++ b/mysql-test/main/show_explain.test
@@ -16,7 +16,7 @@
drop table if exists t0, t1, t2, t3, t4;
drop view if exists v1;
--enable_warnings
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
#
# Testcases in this file do not work with embedded server. The reason for this
@@ -84,7 +84,7 @@ let $thr1=`select connection_id()`;
connect (con1, localhost, root,,);
connection con1;
let $thr2=`select connection_id()`;
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
connection default;
# SHOW EXPLAIN FOR <idle thread>
diff --git a/mysql-test/main/show_explain_json.result b/mysql-test/main/show_explain_json.result
index 1a816597..1768406c 100644
--- a/mysql-test/main/show_explain_json.result
+++ b/mysql-test/main/show_explain_json.result
@@ -1,6 +1,6 @@
drop table if exists t0, t1, t2, t3, t4;
drop view if exists v1;
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
set debug_sync='RESET';
create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
@@ -23,7 +23,7 @@ explain FORMAT=json for connection (select max(a) from t0);
ERROR HY000: You may only use constant expressions in this statement
connect con1, localhost, root,,;
connection con1;
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
connection default;
show explain format=JSON for $thr2;
ERROR HY000: Target is not executing an operation with a query plan
@@ -47,6 +47,7 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -56,7 +57,9 @@ SHOW EXPLAIN
"key": "a",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 999,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.a < 100000",
"using_index": true
@@ -77,6 +80,7 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -86,7 +90,9 @@ SHOW EXPLAIN
"key": "a",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t1.a < 10"
}
@@ -106,6 +112,7 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -115,7 +122,9 @@ SHOW EXPLAIN
"key": "a",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t1.a < 10"
}
@@ -138,6 +147,7 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -147,7 +157,9 @@ SHOW EXPLAIN
"key": "a",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t1.a < 10",
"mrr_type": "Rowid-ordered scan"
@@ -169,6 +181,7 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
@@ -178,7 +191,9 @@ SHOW EXPLAIN
"key": "a",
"key_length": "5",
"used_key_parts": ["a"],
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"index_condition": "t1.a < 10",
"mrr_type": "Rowid-ordered scan"
@@ -210,12 +225,15 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "A",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -226,12 +244,15 @@ SHOW EXPLAIN
"query_block": {
"select_id": 2,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "B",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -266,12 +287,15 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "A",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -282,12 +306,15 @@ SHOW EXPLAIN
"query_block": {
"select_id": 2,
"operation": "UNION",
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "B",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -378,12 +405,15 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "a",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "a.a < 1"
}
@@ -394,12 +424,15 @@ SHOW EXPLAIN
"expression_cache": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "b",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "b.a + a.a < 10"
}
@@ -427,12 +460,15 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "a",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "a.a < 1"
}
@@ -443,12 +479,15 @@ SHOW EXPLAIN
"expression_cache": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "b",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "b.a + a.a < 10"
}
@@ -476,12 +515,15 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "a",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "a.a < 1"
}
@@ -492,12 +534,15 @@ SHOW EXPLAIN
"expression_cache": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "b",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "b.a + a.a < 10"
}
@@ -556,12 +601,15 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a + t0.a < 3"
}
@@ -590,12 +638,15 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a + t0.a < 3"
}
@@ -632,12 +683,15 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a + t0.a < 3"
}
@@ -666,12 +720,15 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a + t0.a < 3"
}
@@ -711,12 +768,15 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a + t0.a < 3"
}
@@ -745,12 +805,15 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a + t0.a < 3"
}
@@ -790,12 +853,15 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a + t0.a < 3"
}
@@ -824,12 +890,15 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a + t0.a < 3"
}
@@ -858,12 +927,15 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -873,12 +945,15 @@ SHOW EXPLAIN
"expression_cache": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a + t0.a < 3"
}
@@ -897,12 +972,15 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -912,12 +990,15 @@ SHOW EXPLAIN
"expression_cache": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a + t0.a < 3"
}
@@ -936,12 +1017,15 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -951,12 +1035,15 @@ SHOW EXPLAIN
"expression_cache": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a + t0.a < 3"
}
@@ -990,12 +1077,15 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1005,12 +1095,15 @@ SHOW EXPLAIN
"expression_cache": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a + t0.a < 3"
}
@@ -1029,12 +1122,15 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1044,12 +1140,15 @@ SHOW EXPLAIN
"expression_cache": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a + t0.a < 3"
}
@@ -1068,12 +1167,15 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1083,12 +1185,15 @@ SHOW EXPLAIN
"expression_cache": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t2.a + t0.a < 3"
}
@@ -1124,6 +1229,7 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"read_sorted_file": {
@@ -1132,7 +1238,9 @@ SHOW EXPLAIN
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1173,13 +1281,16 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1219,13 +1330,16 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"temporary_table": {
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1268,12 +1382,15 @@ SHOW EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t0.a = <cache>(octet_length('гы'))"
}
diff --git a/mysql-test/main/show_explain_json.test b/mysql-test/main/show_explain_json.test
index 2426e095..c29bfade 100644
--- a/mysql-test/main/show_explain_json.test
+++ b/mysql-test/main/show_explain_json.test
@@ -14,7 +14,7 @@
drop table if exists t0, t1, t2, t3, t4;
drop view if exists v1;
--enable_warnings
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
#
# Testcases in this file do not work with embedded server. The reason for this
@@ -82,7 +82,7 @@ let $thr1=`select connection_id()`;
connect (con1, localhost, root,,);
connection con1;
let $thr2=`select connection_id()`;
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
connection default;
# SHOW EXPLAIN FOR <idle thread>
@@ -118,6 +118,7 @@ send select count(*) from t1 where a < 100000;
connection default;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp show explain FORMAT=JSON for $thr2;
connection con1;
reap;
@@ -126,6 +127,7 @@ reap;
send select max(c) from t1 where a < 10;
connection default;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp explain FORMAT=JSON for connection $thr2;
connection con1;
reap;
@@ -134,6 +136,7 @@ reap;
send select max(c) from t1 where a < 10;
connection default;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp explain format=JSON for connection $thr2;
connection con1;
reap;
@@ -145,6 +148,7 @@ set optimizer_switch='index_condition_pushdown=on,mrr=on,mrr_sort_keys=on';
send explain select max(c) from t1 where a < 10;
connection default;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp show explain format=json for $thr2;
connection con1;
reap;
@@ -153,6 +157,7 @@ reap;
send explain select max(c) from t1 where a < 10;
connection default;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp explain format=JSON for connection $thr2;
connection con1;
reap;
@@ -165,6 +170,7 @@ SET debug_dbug='+d,show_explain_probe_join_exec_start';
send explain select a from t0 A union select a+1 from t0 B;
connection default;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp show explain format = JSON for $thr2;
connection con1;
reap;
@@ -177,6 +183,7 @@ SET debug_dbug='+d,show_explain_probe_join_exec_start';
send explain select a from t0 A union select a+1 from t0 B;
connection default;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp show explain format=JSON for $thr2;
connection con1;
reap;
@@ -234,6 +241,7 @@ SET debug_dbug='+d,show_explain_probe_join_exec_start';
send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp show explain format=JSON for $thr2;
connection con1;
reap;
@@ -245,6 +253,7 @@ SET debug_dbug='+d,show_explain_probe_join_exec_start';
send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp show explain format=JSON for $thr2;
connection con1;
reap;
@@ -256,6 +265,7 @@ SET debug_dbug='+d,show_explain_probe_join_exec_end';
send select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
connection default;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp show explain format=JSON for $thr2;
connection con1;
reap;
@@ -301,8 +311,10 @@ SET debug_dbug='+d,show_explain_probe_join_exec_start';
send update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3 ;
connection default;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp show explain format=JSON for $thr2;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp show explain format=JSON for $thr2;
connection con1;
reap;
@@ -316,8 +328,10 @@ SET debug_dbug='+d,show_explain_probe_join_exec_start';
send update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3 ;
connection default;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp explain format=JSON for connection $thr2;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp explain format=JSON for connection $thr2;
connection con1;
reap;
@@ -334,8 +348,10 @@ SET debug_dbug='+d,show_explain_probe_join_exec_start';
send delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3 ;
connection default;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp show explain format=JSON for $thr2;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp show explain format=JSON for $thr2;
connection con1;
reap;
@@ -351,8 +367,10 @@ SET debug_dbug='+d,show_explain_probe_join_exec_start';
send delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3 ;
connection default;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp explain format=JSON for connection $thr2;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp explain format=JSON for connection $thr2;
connection con1;
reap;
@@ -368,10 +386,13 @@ SET debug_dbug='+d,show_explain_probe_join_exec_start';
send select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2;
connection default;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp show explain format=json for $thr2;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp show explain format=json for $thr2;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp show explain format=json for $thr2;
connection con1;
reap;
@@ -388,10 +409,13 @@ SET debug_dbug='+d,show_explain_probe_join_exec_start';
send select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2;
connection default;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp explain format=JSON for connection $thr2;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp explain format=JSON for connection $thr2;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp explain format=JSON for connection $thr2;
connection con1;
reap;
@@ -408,6 +432,7 @@ set @show_explain_probe_select_id=1;
send select * from t0 order by a;
connection default;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp show explain format=json for $thr2;
connection con1;
reap;
@@ -425,6 +450,7 @@ set @show_explain_probe_select_id=1;
send select distinct a from t0;
connection default;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp show explain format=json for $thr2;
connection con1;
reap;
@@ -443,6 +469,7 @@ set @show_explain_probe_select_id=1;
send select distinct a from t0;
connection default;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp show explain format=json for $thr2;
connection con1;
reap;
@@ -469,6 +496,7 @@ select * from t0 where length('ãû') = a;
connection default;
set names utf8;
--source include/wait_condition.inc
+--source include/explain-no-costs.inc
evalp show explain format=JSON for $thr2;
set names default;
diff --git a/mysql-test/main/show_explain_non_select.result b/mysql-test/main/show_explain_non_select.result
index 8d96056c..33b512bc 100644
--- a/mysql-test/main/show_explain_non_select.result
+++ b/mysql-test/main/show_explain_non_select.result
@@ -1,5 +1,5 @@
drop table if exists t0, t1;
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
set debug_sync='RESET';
connect con2, localhost, root,,;
connection con2;
diff --git a/mysql-test/main/show_explain_non_select.test b/mysql-test/main/show_explain_non_select.test
index 92b3c978..6a64d056 100644
--- a/mysql-test/main/show_explain_non_select.test
+++ b/mysql-test/main/show_explain_non_select.test
@@ -10,7 +10,7 @@
drop table if exists t0, t1;
--enable_warnings
-SET @old_debug= @@session.debug;
+SET @old_debug= @@session.debug_dbug;
set debug_sync='RESET';
#
diff --git a/mysql-test/main/signal_demo1.result b/mysql-test/main/signal_demo1.result
index d919f484..752f23a4 100644
--- a/mysql-test/main/signal_demo1.result
+++ b/mysql-test/main/signal_demo1.result
@@ -75,9 +75,6 @@ end;
end case;
end
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create procedure check_pk_inventory(in id integer)
begin
declare x integer;
@@ -95,8 +92,6 @@ MYSQL_ERRNO = 10000;
end if;
end
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create procedure check_pk_order(in id integer)
begin
declare x integer;
@@ -113,8 +108,6 @@ MYSQL_ERRNO = 10000;
end if;
end
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create trigger po_order_bi before insert on po_order
for each row
begin
diff --git a/mysql-test/main/single_delete_update.result b/mysql-test/main/single_delete_update.result
index 85e79f53..6a17895e 100644
--- a/mysql-test/main/single_delete_update.result
+++ b/mysql-test/main/single_delete_update.result
@@ -129,21 +129,21 @@ a b c d
SHOW SESSION STATUS LIKE 'Sort%';
Variable_name Value
Sort_merge_passes 0
-Sort_priority_queue_sorts 1
+Sort_priority_queue_sorts 0
Sort_range 0
-Sort_rows 1
-Sort_scan 1
+Sort_rows 0
+Sort_scan 0
SHOW STATUS LIKE 'Handler_read_%';
Variable_name Value
-Handler_read_first 0
+Handler_read_first 1
Handler_read_key 0
Handler_read_last 0
-Handler_read_next 0
+Handler_read_next 16
Handler_read_prev 0
Handler_read_retry 0
Handler_read_rnd 0
Handler_read_rnd_deleted 0
-Handler_read_rnd_next 17
+Handler_read_rnd_next 0
FLUSH STATUS;
DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5;
SHOW SESSION STATUS LIKE 'Sort%';
@@ -151,19 +151,19 @@ Variable_name Value
Sort_merge_passes 0
Sort_priority_queue_sorts 0
Sort_range 0
-Sort_rows 1
-Sort_scan 1
+Sort_rows 0
+Sort_scan 0
SHOW STATUS LIKE 'Handler_read_%';
Variable_name Value
-Handler_read_first 0
+Handler_read_first 1
Handler_read_key 0
Handler_read_last 0
-Handler_read_next 0
+Handler_read_next 16
Handler_read_prev 0
Handler_read_retry 0
-Handler_read_rnd 1
+Handler_read_rnd 0
Handler_read_rnd_deleted 0
-Handler_read_rnd_next 17
+Handler_read_rnd_next 0
## should be 5 (previous LIMIT)
SELECT 1 - COUNT(*) FROM t2 WHERE b = 10;
1 - COUNT(*)
@@ -332,6 +332,7 @@ DROP TABLE t2;
#
CREATE TABLE t2 (i INT, key1 INT, key2 INT, INDEX (key1), INDEX (key2));
INSERT INTO t2 (key1, key2) SELECT i, i FROM t1;
+INSERT INTO t2 (key1, key2) SELECT i+100, i+100 FROM t1;
FLUSH STATUS;
SELECT * FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1;
i key1 key2
@@ -734,41 +735,41 @@ a b c d
SHOW SESSION STATUS LIKE 'Sort%';
Variable_name Value
Sort_merge_passes 0
-Sort_priority_queue_sorts 1
+Sort_priority_queue_sorts 0
Sort_range 0
-Sort_rows 1
-Sort_scan 1
+Sort_rows 0
+Sort_scan 0
SHOW STATUS LIKE 'Handler_read_%';
Variable_name Value
-Handler_read_first 0
+Handler_read_first 1
Handler_read_key 0
Handler_read_last 0
-Handler_read_next 0
+Handler_read_next 16
Handler_read_prev 0
Handler_read_retry 0
Handler_read_rnd 0
Handler_read_rnd_deleted 0
-Handler_read_rnd_next 17
+Handler_read_rnd_next 0
FLUSH STATUS;
UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5;
SHOW SESSION STATUS LIKE 'Sort%';
Variable_name Value
Sort_merge_passes 0
-Sort_priority_queue_sorts 1
+Sort_priority_queue_sorts 0
Sort_range 0
-Sort_rows 1
-Sort_scan 1
+Sort_rows 0
+Sort_scan 0
SHOW STATUS LIKE 'Handler_read_%';
Variable_name Value
-Handler_read_first 0
+Handler_read_first 1
Handler_read_key 0
Handler_read_last 0
-Handler_read_next 0
+Handler_read_next 16
Handler_read_prev 0
Handler_read_retry 0
Handler_read_rnd 1
Handler_read_rnd_deleted 0
-Handler_read_rnd_next 17
+Handler_read_rnd_next 0
## should be 5 (previous LIMIT)
SELECT COUNT(*) FROM t2 WHERE b = 10 AND d = 10 ORDER BY a, c;
COUNT(*)
@@ -939,6 +940,7 @@ DROP TABLE t2;
#
CREATE TABLE t2 (i INT, key1 INT, key2 INT, INDEX (key1), INDEX (key2));
INSERT INTO t2 (key1, key2) SELECT i, i FROM t1;
+INSERT INTO t2 (key1, key2) SELECT i+100, i+100 FROM t1;
FLUSH STATUS;
SELECT * FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1;
i key1 key2
diff --git a/mysql-test/main/single_delete_update.test b/mysql-test/main/single_delete_update.test
index 0f2dc189..871fd06a 100644
--- a/mysql-test/main/single_delete_update.test
+++ b/mysql-test/main/single_delete_update.test
@@ -148,6 +148,7 @@ DROP TABLE t2;
CREATE TABLE t2 (i INT, key1 INT, key2 INT, INDEX (key1), INDEX (key2));
INSERT INTO t2 (key1, key2) SELECT i, i FROM t1;
+INSERT INTO t2 (key1, key2) SELECT i+100, i+100 FROM t1;
FLUSH STATUS;
SELECT * FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1;
@@ -373,6 +374,7 @@ DROP TABLE t2;
CREATE TABLE t2 (i INT, key1 INT, key2 INT, INDEX (key1), INDEX (key2));
INSERT INTO t2 (key1, key2) SELECT i, i FROM t1;
+INSERT INTO t2 (key1, key2) SELECT i+100, i+100 FROM t1;
FLUSH STATUS;
SELECT * FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1;
diff --git a/mysql-test/main/skip_grants.result b/mysql-test/main/skip_grants.result
index fdd7be41..2b3f42e3 100644
--- a/mysql-test/main/skip_grants.result
+++ b/mysql-test/main/skip_grants.result
@@ -52,7 +52,7 @@ DROP FUNCTION f3;
# Bug #26807 "set global event_scheduler=1" and --skip-grant-tables crashes server
#
set global event_scheduler=1;
-set global event_scheduler=0;
+ERROR HY000: The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement
#
# Bug#26285 Selecting information_schema crahes server
#
diff --git a/mysql-test/main/skip_grants.test b/mysql-test/main/skip_grants.test
index 5af697f6..999a716c 100644
--- a/mysql-test/main/skip_grants.test
+++ b/mysql-test/main/skip_grants.test
@@ -1,5 +1,6 @@
# This tests not performed with embedded server
-- source include/not_embedded.inc
+
-- disable_ps_protocol
use test;
@@ -92,10 +93,8 @@ DROP FUNCTION f3;
--echo #
--echo # Bug #26807 "set global event_scheduler=1" and --skip-grant-tables crashes server
--echo #
---disable_warnings
+--error ER_OPTION_PREVENTS_STATEMENT
set global event_scheduler=1;
---enable_warnings
-set global event_scheduler=0;
--echo #
--echo # Bug#26285 Selecting information_schema crahes server
diff --git a/mysql-test/main/sp-anchor-row-type-cursor.result b/mysql-test/main/sp-anchor-row-type-cursor.result
index e56c51bb..e3c6e1fc 100644
--- a/mysql-test/main/sp-anchor-row-type-cursor.result
+++ b/mysql-test/main/sp-anchor-row-type-cursor.result
@@ -936,8 +936,6 @@ SELECT rec1.a, rec1.b;
END;
END;
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL p1();
ERROR 21000: The used SELECT statements have a different number of columns
DROP TABLE t1;
@@ -957,8 +955,6 @@ SELECT rec1.a, rec1.b;
END;
END;
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL p1();
ERROR 21000: Operand should contain 2 column(s)
DROP TABLE t1;
@@ -976,8 +972,6 @@ SELECT rec1.a, rec1.b;
END;
END;
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL p1();
rec1.a rec1.b
10 b10
diff --git a/mysql-test/main/sp-anchor-row-type-table.result b/mysql-test/main/sp-anchor-row-type-table.result
index f1067222..8b64a25d 100644
--- a/mysql-test/main/sp-anchor-row-type-table.result
+++ b/mysql-test/main/sp-anchor-row-type-table.result
@@ -606,8 +606,6 @@ SELECT 10,'a','b' FROM t1 INTO rec1;
SELECT rec1.a, rec1.b;
END;
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL p1();
ERROR 21000: The used SELECT statements have a different number of columns
DROP TABLE t1;
@@ -624,8 +622,6 @@ SELECT 10,'a' FROM t1 INTO rec1, rec1;
SELECT rec1.a, rec1.b;
END;
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL p1();
ERROR 21000: Operand should contain 2 column(s)
DROP TABLE t1;
@@ -642,8 +638,6 @@ SELECT * FROM t1 INTO rec1;
SELECT rec1.a, rec1.b;
END;
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL p1();
rec1.a rec1.b
10 b10
diff --git a/mysql-test/main/sp-anchor-type.result b/mysql-test/main/sp-anchor-type.result
index 47bbed31..31c8ff74 100644
--- a/mysql-test/main/sp-anchor-type.result
+++ b/mysql-test/main/sp-anchor-type.result
@@ -957,8 +957,6 @@ SELECT * FROM t1 INTO v_a, v_b, v_c;
SELECT v_a, v_b, v_c;
END;
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL p1();
v_a v_b v_c
1 b1 2001-01-01 10:20:30.123
diff --git a/mysql-test/main/sp-big.result b/mysql-test/main/sp-big.result
index ea93f2ca..611ac9b7 100644
--- a/mysql-test/main/sp-big.result
+++ b/mysql-test/main/sp-big.result
@@ -77,8 +77,6 @@ select count(*) as cnt from (select id1 from t1 force index (primary) where id1
set id1_cond = id1_cond + 1;
end while;
end//
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
insert t1 select seq, seq, 1, 1, seq, seq, seq from seq_1_to_2000;
set @before=unix_timestamp();
call select_test();
diff --git a/mysql-test/main/sp-error.result b/mysql-test/main/sp-error.result
index c77f58b6..1c272a03 100644
--- a/mysql-test/main/sp-error.result
+++ b/mysql-test/main/sp-error.result
@@ -1,7 +1,5 @@
drop table if exists t1, t2;
SELECT * FROM mysql.proc INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/proc.txt';
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
delete from mysql.proc;
create procedure syntaxerror(t int)|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
@@ -14,8 +12,6 @@ create table t3 ( x int )|
insert into t3 values (2), (3)|
create procedure bad_into(out param int)
select x from t3 into param|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
call bad_into(@x)|
ERROR 42000: Result consisted of more than one row
drop procedure bad_into|
@@ -1612,15 +1608,6 @@ CALL p1((SELECT * FROM t1))|
ERROR 21000: Subquery returns more than 1 row
DROP PROCEDURE IF EXISTS p1|
DROP TABLE t1|
-drop procedure if exists p1;
-create procedure p1()
-begin
-create table t1 (a int) engine=MyISAM;
-drop table t1;
-end|
-call p1();
-call p1();
-drop procedure p1;
drop procedure if exists proc_8759;
create procedure proc_8759()
begin
@@ -2842,8 +2829,6 @@ DECLARE v VARCHAR(5) DEFAULT -1;
SELECT b FROM t1 WHERE a = 2 INTO v;
RETURN v;
END|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Here we check that the NOT_FOUND condition raised in f1()
# is not visible in the outer function (f2), i.e. the continue
diff --git a/mysql-test/main/sp-error.test b/mysql-test/main/sp-error.test
index c112dd0f..584ef5a6 100644
--- a/mysql-test/main/sp-error.test
+++ b/mysql-test/main/sp-error.test
@@ -2350,24 +2350,6 @@ DROP TABLE t1|
delimiter ;|
#
-# Bug#21801: SQL exception handlers and warnings
-#
-
---disable_warnings
-drop procedure if exists p1;
---enable_warnings
-delimiter |;
-create procedure p1()
-begin
- create table t1 (a int) engine=MyISAM;
- drop table t1;
-end|
-delimiter ;|
-call p1();
-call p1();
-drop procedure p1;
-
-#
# Bug#8759 (Stored Procedures: SQLSTATE '00000' should be illegal)
#
diff --git a/mysql-test/main/sp-package-code.result b/mysql-test/main/sp-package-code.result
new file mode 100644
index 00000000..f69cb7ec
--- /dev/null
+++ b/mysql-test/main/sp-package-code.result
@@ -0,0 +1,260 @@
+#
+# MDEV-32101 CREATE PACKAGE [BODY] for sql_mode=DEFAULT
+#
+CREATE PACKAGE pkg1
+PROCEDURE p1();
+FUNCTION f1() RETURNS INT;
+END;
+$$
+CREATE PACKAGE BODY pkg1
+PROCEDURE p1()
+BEGIN SELECT 1;
+END;
+FUNCTION f1() RETURNS INT RETURN 1;
+END;
+$$
+SHOW PROCEDURE CODE pkg1.p1;
+Pos Instruction
+0 stmt 0 "SELECT 1"
+SHOW FUNCTION CODE pkg1.f1;
+Pos Instruction
+0 freturn int 1
+SHOW PACKAGE BODY CODE pkg1;
+Pos Instruction
+DROP PACKAGE pkg1;
+CREATE PACKAGE pkg1
+PROCEDURE p1();
+FUNCTION f1() RETURNS INT;
+PROCEDURE p2show();
+PROCEDURE p2public();
+FUNCTION f2public() RETURNS TEXT;
+END;
+$$
+CREATE PACKAGE BODY pkg1
+DECLARE a INT DEFAULT 10;
+PROCEDURE p1()
+BEGIN
+DECLARE b INT DEFAULT 20;
+SET b=a;
+SET b=a+1;
+SET a=b;
+SET a=b+1;
+SET a=a+1;
+SET @a=@a+2;
+SELECT f1() FROM DUAL;
+END;
+FUNCTION f1() RETURNS INT
+BEGIN
+RETURN a;
+END;
+PROCEDURE p2private()
+BEGIN
+SELECT 'This is p2private';
+END;
+PROCEDURE p2public()
+BEGIN
+SELECT 'This is p2public';
+END;
+FUNCTION f2private() RETURNS TEXT
+BEGIN
+RETURN 'This is f2private';
+END;
+FUNCTION f2public() RETURNS TEXT
+BEGIN
+RETURN 'This is f2public';
+END;
+PROCEDURE p2show()
+BEGIN
+SHOW FUNCTION CODE f2public;
+SHOW FUNCTION CODE f2private;
+SHOW PROCEDURE CODE p2public;
+SHOW PROCEDURE CODE p2private;
+SHOW PROCEDURE CODE p2show;
+END;
+-- Initialization section
+SET a=a+1;
+BEGIN
+DECLARE b INT;
+SET b=a;
+SET b=a+1;
+SET a=b;
+SET a=b+1;
+END;
+END;
+$$
+SHOW PROCEDURE CODE pkg1.p1;
+Pos Instruction
+0 set b@0 20
+1 set b@0 PACKAGE_BODY.a@0
+2 set b@0 PACKAGE_BODY.a@0 + 1
+3 set PACKAGE_BODY.a@0 b@0
+4 set PACKAGE_BODY.a@0 b@0 + 1
+5 set PACKAGE_BODY.a@0 PACKAGE_BODY.a@0 + 1
+6 stmt 31 "SET @a=@a+2"
+7 stmt 0 "SELECT f1() FROM DUAL"
+SHOW FUNCTION CODE pkg1.f1;
+Pos Instruction
+0 freturn int PACKAGE_BODY.a@0
+SHOW PACKAGE BODY CODE pkg1;
+Pos Instruction
+0 set a@0 10
+1 set a@0 a@0 + 1
+2 set b@1 NULL
+3 set b@1 a@0
+4 set b@1 a@0 + 1
+5 set a@0 b@1
+6 set a@0 b@1 + 1
+CALL pkg1.p2show;
+Pos Instruction
+0 freturn blob 'This is f2public'
+Pos Instruction
+0 freturn blob 'This is f2private'
+Pos Instruction
+0 stmt 0 "SELECT 'This is p2public'"
+Pos Instruction
+0 stmt 0 "SELECT 'This is p2private'"
+Pos Instruction
+0 stmt 110 "SHOW FUNCTION CODE f2public"
+1 stmt 110 "SHOW FUNCTION CODE f2private"
+2 stmt 109 "SHOW PROCEDURE CODE p2public"
+3 stmt 109 "SHOW PROCEDURE CODE p2private"
+4 stmt 109 "SHOW PROCEDURE CODE p2show"
+DROP PACKAGE pkg1;
+CREATE TABLE t1 (a INT);
+CREATE PACKAGE pkg1
+PROCEDURE p1();
+END;
+$$
+CREATE PACKAGE BODY pkg1
+DECLARE a TYPE OF t1.a DEFAULT 10;
+PROCEDURE p1()
+BEGIN
+DECLARE b TYPE OF t1.a DEFAULT 20;
+SET b=a;
+SET b=a+1;
+SET b=b+1;
+SET a=b;
+SET a=b+1;
+SET a=a+1;
+END;
+-- Initialization section
+SET a=a+1;
+BEGIN
+DECLARE b TYPE OF t1.a;
+SET b=a;
+SET b=a+1;
+SET a=b;
+SET a=b+1;
+END;
+END;
+$$
+SHOW PROCEDURE CODE pkg1.p1;
+Pos Instruction
+0 set b@0 20
+1 set b@0 PACKAGE_BODY.a@0
+2 set b@0 PACKAGE_BODY.a@0 + 1
+3 set b@0 b@0 + 1
+4 set PACKAGE_BODY.a@0 b@0
+5 set PACKAGE_BODY.a@0 b@0 + 1
+6 set PACKAGE_BODY.a@0 PACKAGE_BODY.a@0 + 1
+SHOW PACKAGE BODY CODE pkg1;
+Pos Instruction
+0 set a@0 10
+1 set a@0 a@0 + 1
+2 set b@1 NULL
+3 set b@1 a@0
+4 set b@1 a@0 + 1
+5 set a@0 b@1
+6 set a@0 b@1 + 1
+DROP PACKAGE pkg1;
+DROP TABLE t1;
+CREATE PACKAGE pkg1
+PROCEDURE p1();
+END;
+$$
+CREATE PACKAGE BODY pkg1
+DECLARE a ROW(a INT,b TEXT) DEFAULT ROW(10,'x10');
+PROCEDURE p1()
+BEGIN
+DECLARE b ROW(a INT,b TEXT) DEFAULT ROW(20,'x20');
+SET b=a;
+SET a=b;
+SET b.a=a.a+1;
+SET a.a=b.a+1;
+SET a.a=a.a+1;
+END;
+-- Initialization section
+SET a.a:=a.a+1;
+BEGIN
+DECLARE b ROW(a INT,b TEXT) DEFAULT ROW(30,'x30');
+SET b=a;
+SET b.a=a.a+1;
+SET a=b;
+SET a.a=b.a+1;
+END;
+END;
+$$
+SHOW PROCEDURE CODE pkg1.p1;
+Pos Instruction
+0 set b@0 (20,'x20')
+1 set b@0 PACKAGE_BODY.a@0
+2 set PACKAGE_BODY.a@0 b@0
+3 set b.a@0[0] PACKAGE_BODY.a.a@0[0] + 1
+4 set PACKAGE_BODY.a.a@0[0] b.a@0[0] + 1
+5 set PACKAGE_BODY.a.a@0[0] PACKAGE_BODY.a.a@0[0] + 1
+SHOW PACKAGE BODY CODE pkg1;
+Pos Instruction
+0 set a@0 (10,'x10')
+1 set a.a@0[0] a.a@0[0] + 1
+2 set b@1 (30,'x30')
+3 set b@1 a@0
+4 set b.a@1[0] a.a@0[0] + 1
+5 set a@0 b@1
+6 set a.a@0[0] b.a@1[0] + 1
+DROP PACKAGE pkg1;
+CREATE TABLE t1 (a INT, b TEXT);
+CREATE PACKAGE pkg1
+PROCEDURE p1();
+END;
+$$
+CREATE PACKAGE BODY pkg1
+DECLARE a ROW TYPE OF t1 DEFAULT ROW(10,'x10');
+PROCEDURE p1()
+BEGIN
+DECLARE b ROW TYPE OF t1 DEFAULT ROW(20,'x20');
+SET b=a;
+SET a=b;
+SET b.a=a.a+1;
+SET a.a=b.a+1;
+SET a.a=a.a+1;
+END;
+-- Initialization section
+SET a.a=a.a+1;
+BEGIN
+DECLARE b ROW TYPE OF t1 DEFAULT ROW(30,'x30');
+SET b=a;
+SET b.a=a.a+1;
+SET a=b;
+SET a.a=b.a+1;
+END;
+END;
+$$
+SHOW PROCEDURE CODE pkg1.p1;
+Pos Instruction
+0 set b@0 (20,'x20')
+1 set b@0 PACKAGE_BODY.a@0
+2 set PACKAGE_BODY.a@0 b@0
+3 set b.a@0["a"] PACKAGE_BODY.a.a@0["a"] + 1
+4 set PACKAGE_BODY.a.a@0["a"] b.a@0["a"] + 1
+5 set PACKAGE_BODY.a.a@0["a"] PACKAGE_BODY.a.a@0["a"] + 1
+SHOW PACKAGE BODY CODE pkg1;
+Pos Instruction
+0 set a@0 (10,'x10')
+1 set a.a@0["a"] a.a@0["a"] + 1
+2 set b@1 (30,'x30')
+3 set b@1 a@0
+4 set b.a@1["a"] a.a@0["a"] + 1
+5 set a@0 b@1
+6 set a.a@0["a"] b.a@1["a"] + 1
+DROP PACKAGE pkg1;
+DROP TABLE t1;
diff --git a/mysql-test/main/sp-package-code.test b/mysql-test/main/sp-package-code.test
new file mode 100644
index 00000000..e99c25e7
--- /dev/null
+++ b/mysql-test/main/sp-package-code.test
@@ -0,0 +1,200 @@
+-- source include/have_debug.inc
+
+--echo #
+--echo # MDEV-32101 CREATE PACKAGE [BODY] for sql_mode=DEFAULT
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE pkg1
+ PROCEDURE p1();
+ FUNCTION f1() RETURNS INT;
+END;
+$$
+CREATE PACKAGE BODY pkg1
+ PROCEDURE p1()
+ BEGIN SELECT 1;
+ END;
+ FUNCTION f1() RETURNS INT RETURN 1;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE pkg1.p1;
+SHOW FUNCTION CODE pkg1.f1;
+SHOW PACKAGE BODY CODE pkg1;
+DROP PACKAGE pkg1;
+
+DELIMITER $$;
+CREATE PACKAGE pkg1
+ PROCEDURE p1();
+ FUNCTION f1() RETURNS INT;
+ PROCEDURE p2show();
+ PROCEDURE p2public();
+ FUNCTION f2public() RETURNS TEXT;
+END;
+$$
+CREATE PACKAGE BODY pkg1
+ DECLARE a INT DEFAULT 10;
+ PROCEDURE p1()
+ BEGIN
+ DECLARE b INT DEFAULT 20;
+ SET b=a;
+ SET b=a+1;
+ SET a=b;
+ SET a=b+1;
+ SET a=a+1;
+ SET @a=@a+2;
+ SELECT f1() FROM DUAL;
+ END;
+ FUNCTION f1() RETURNS INT
+ BEGIN
+ RETURN a;
+ END;
+ PROCEDURE p2private()
+ BEGIN
+ SELECT 'This is p2private';
+ END;
+ PROCEDURE p2public()
+ BEGIN
+ SELECT 'This is p2public';
+ END;
+ FUNCTION f2private() RETURNS TEXT
+ BEGIN
+ RETURN 'This is f2private';
+ END;
+ FUNCTION f2public() RETURNS TEXT
+ BEGIN
+ RETURN 'This is f2public';
+ END;
+ PROCEDURE p2show()
+ BEGIN
+ SHOW FUNCTION CODE f2public;
+ SHOW FUNCTION CODE f2private;
+ SHOW PROCEDURE CODE p2public;
+ SHOW PROCEDURE CODE p2private;
+ SHOW PROCEDURE CODE p2show;
+ END;
+ -- Initialization section
+ SET a=a+1;
+ BEGIN
+ DECLARE b INT;
+ SET b=a;
+ SET b=a+1;
+ SET a=b;
+ SET a=b+1;
+ END;
+END;
+$$
+DELIMITER ;$$
+
+SHOW PROCEDURE CODE pkg1.p1;
+SHOW FUNCTION CODE pkg1.f1;
+SHOW PACKAGE BODY CODE pkg1;
+CALL pkg1.p2show;
+
+DROP PACKAGE pkg1;
+
+
+CREATE TABLE t1 (a INT);
+DELIMITER $$;
+CREATE PACKAGE pkg1
+ PROCEDURE p1();
+END;
+$$
+CREATE PACKAGE BODY pkg1
+ DECLARE a TYPE OF t1.a DEFAULT 10;
+ PROCEDURE p1()
+ BEGIN
+ DECLARE b TYPE OF t1.a DEFAULT 20;
+ SET b=a;
+ SET b=a+1;
+ SET b=b+1;
+ SET a=b;
+ SET a=b+1;
+ SET a=a+1;
+ END;
+ -- Initialization section
+ SET a=a+1;
+ BEGIN
+ DECLARE b TYPE OF t1.a;
+ SET b=a;
+ SET b=a+1;
+ SET a=b;
+ SET a=b+1;
+ END;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE pkg1.p1;
+SHOW PACKAGE BODY CODE pkg1;
+DROP PACKAGE pkg1;
+DROP TABLE t1;
+
+
+DELIMITER $$;
+CREATE PACKAGE pkg1
+ PROCEDURE p1();
+END;
+$$
+CREATE PACKAGE BODY pkg1
+ DECLARE a ROW(a INT,b TEXT) DEFAULT ROW(10,'x10');
+ PROCEDURE p1()
+ BEGIN
+ DECLARE b ROW(a INT,b TEXT) DEFAULT ROW(20,'x20');
+ SET b=a;
+ SET a=b;
+ SET b.a=a.a+1;
+ SET a.a=b.a+1;
+ SET a.a=a.a+1;
+ END;
+ -- Initialization section
+ SET a.a:=a.a+1;
+ BEGIN
+ DECLARE b ROW(a INT,b TEXT) DEFAULT ROW(30,'x30');
+ SET b=a;
+ SET b.a=a.a+1;
+ SET a=b;
+ SET a.a=b.a+1;
+ END;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE pkg1.p1;
+SHOW PACKAGE BODY CODE pkg1;
+DROP PACKAGE pkg1;
+
+
+CREATE TABLE t1 (a INT, b TEXT);
+DELIMITER $$;
+CREATE PACKAGE pkg1
+ PROCEDURE p1();
+END;
+$$
+CREATE PACKAGE BODY pkg1
+ DECLARE a ROW TYPE OF t1 DEFAULT ROW(10,'x10');
+ PROCEDURE p1()
+ BEGIN
+ DECLARE b ROW TYPE OF t1 DEFAULT ROW(20,'x20');
+ SET b=a;
+ SET a=b;
+ SET b.a=a.a+1;
+ SET a.a=b.a+1;
+ SET a.a=a.a+1;
+ END;
+ -- Initialization section
+ SET a.a=a.a+1;
+ BEGIN
+ DECLARE b ROW TYPE OF t1 DEFAULT ROW(30,'x30');
+ SET b=a;
+ SET b.a=a.a+1;
+ SET a=b;
+ SET a.a=b.a+1;
+ END;
+END;
+$$
+DELIMITER ;$$
+SHOW PROCEDURE CODE pkg1.p1;
+SHOW PACKAGE BODY CODE pkg1;
+DROP PACKAGE pkg1;
+DROP TABLE t1;
+
+
diff --git a/mysql-test/main/sp-package-security.result b/mysql-test/main/sp-package-security.result
new file mode 100644
index 00000000..cd859b04
--- /dev/null
+++ b/mysql-test/main/sp-package-security.result
@@ -0,0 +1,322 @@
+#
+# Start of 11.4 tests
+#
+CREATE DATABASE db1;
+CREATE USER u1@localhost IDENTIFIED BY '';
+GRANT SELECT ON db1.* TO u1@localhost;
+connect conn1,localhost,u1,,db1;
+SELECT CURRENT_USER;
+CURRENT_USER
+u1@localhost
+#
+# User u1 cannot drop PROCEDURE, PACKAGE, PACKAGE BODY by default
+#
+DROP PROCEDURE p1;
+ERROR 42000: alter routine command denied to user 'u1'@'localhost' for routine 'db1.p1'
+DROP PACKAGE pkg1;
+ERROR 42000: alter routine command denied to user 'u1'@'localhost' for routine 'db1.pkg1'
+DROP PACKAGE BODY pkg1;
+ERROR 42000: alter routine command denied to user 'u1'@'localhost' for routine 'db1.pkg1'
+#
+# User u1 cannot create PROCEDURE, PACKAGE, PACKAGE BODY by default
+#
+CREATE PROCEDURE p1()
+BEGIN
+END;
+$$
+ERROR 42000: Access denied for user 'u1'@'localhost' to database 'db1'
+CREATE PACKAGE pkg1
+PROCEDURE p1();
+END;
+$$
+ERROR 42000: Access denied for user 'u1'@'localhost' to database 'db1'
+CREATE PACKAGE BODY pkg1 AS
+PROCEDURE p1() AS BEGIN END;
+END;
+$$
+ERROR 42000: PACKAGE db1.pkg1 does not exist
+#
+# Now create a PACKAGE by root
+#
+connection default;
+USE db1;
+CREATE PROCEDURE p1root()
+BEGIN
+SELECT 1;
+END;
+$$
+CREATE PACKAGE pkg1
+PROCEDURE p1();
+FUNCTION f1() RETURNS TEXT;
+END;
+$$
+SHOW CREATE PACKAGE pkg1;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pkg1 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PACKAGE `pkg1` PROCEDURE p1();
+FUNCTION f1() RETURNS TEXT;
+END latin1 latin1_swedish_ci latin1_swedish_ci
+#
+# u1 cannot SHOW yet:
+# - the standalone procedure earlier created by root
+# - the package specifications earlier create by root
+#
+connection conn1;
+SHOW CREATE PROCEDURE p1root;
+ERROR 42000: PROCEDURE p1root does not exist
+SHOW CREATE PACKAGE pkg1;
+ERROR 42000: PACKAGE pkg1 does not exist
+#
+# User u1 still cannot create a PACKAGE BODY
+#
+connection conn1;
+CREATE PACKAGE BODY pkg1
+PROCEDURE p1() BEGIN END;
+FUNCTION f1() RETURNS TEXT BEGIN RETURN 'This is f1'; END;
+END;
+$$
+ERROR 42000: Access denied for user 'u1'@'localhost' to database 'db1'
+#
+# Now grant EXECUTE:
+# - on the standalone procedure earlier created by root
+# - on the package specification earlier created by root
+#
+connection default;
+GRANT EXECUTE ON PROCEDURE db1.p1root TO u1@localhost;
+GRANT EXECUTE ON PACKAGE db1.pkg1 TO u1@localhost;
+#
+# Now u1 can do SHOW for:
+# - the standalone procedure earlier created by root
+# - the package specification earlier created by root
+#
+disconnect conn1;
+connect conn1,localhost,u1,,db1;
+SHOW CREATE PROCEDURE db1.p1root;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1root STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION NULL latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW CREATE PACKAGE db1.pkg1;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pkg1 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION NULL latin1 latin1_swedish_ci latin1_swedish_ci
+#
+# Now revoke EXECUTE and grant CREATE ROUTINE instead
+#
+connection default;
+REVOKE EXECUTE ON PROCEDURE db1.p1root FROM u1@localhost;
+REVOKE EXECUTE ON PACKAGE db1.pkg1 FROM u1@localhost;
+GRANT CREATE ROUTINE ON db1.* TO u1@localhost;
+#
+# Reconnect u1 to make new grants have effect
+#
+disconnect conn1;
+connect conn1,localhost,u1,,db1;
+#
+# Now u1 can SHOW:
+# - standalone routines earlier created by root
+# - package specifications earlier created by root
+#
+SHOW CREATE PROCEDURE p1root;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+p1root STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION NULL latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW CREATE PACKAGE pkg1;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pkg1 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION NULL latin1 latin1_swedish_ci latin1_swedish_ci
+#
+# Now u1 can CREATE, DROP and EXECUTE its own standalone procedures
+#
+CREATE PROCEDURE p1()
+BEGIN
+END;
+$$
+SHOW GRANTS;
+Grants for u1@localhost
+GRANT USAGE ON *.* TO `u1`@`localhost`
+GRANT SELECT, CREATE ROUTINE ON `db1`.* TO `u1`@`localhost`
+GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `db1`.`p1` TO `u1`@`localhost`
+CALL p1;
+DROP PROCEDURE p1;
+SHOW GRANTS;
+Grants for u1@localhost
+GRANT USAGE ON *.* TO `u1`@`localhost`
+GRANT SELECT, CREATE ROUTINE ON `db1`.* TO `u1`@`localhost`
+#
+# Now u1 can also CREATE, DROP its own package specifications
+#
+CREATE PACKAGE pkg2
+PROCEDURE p1();
+FUNCTION f1() RETURNS TEXT;
+END;
+$$
+SHOW CREATE PACKAGE pkg2;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pkg2 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`u1`@`localhost` PACKAGE `pkg2` PROCEDURE p1();
+FUNCTION f1() RETURNS TEXT;
+END latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW GRANTS;
+Grants for u1@localhost
+GRANT USAGE ON *.* TO `u1`@`localhost`
+GRANT SELECT, CREATE ROUTINE ON `db1`.* TO `u1`@`localhost`
+GRANT EXECUTE, ALTER ROUTINE ON PACKAGE `db1`.`pkg2` TO `u1`@`localhost`
+DROP PACKAGE pkg2;
+SHOW GRANTS;
+Grants for u1@localhost
+GRANT USAGE ON *.* TO `u1`@`localhost`
+GRANT SELECT, CREATE ROUTINE ON `db1`.* TO `u1`@`localhost`
+#
+# Now u1 can also CREATE, DROP package bodies and EXECUTE package body routines
+#
+CREATE PACKAGE BODY pkg1
+PROCEDURE p1() BEGIN SELECT 'This is pkg1.p1' AS `comment`; END;
+FUNCTION f1() RETURNS TEXT BEGIN RETURN 'This is pkg1.f1'; END;
+END;
+$$
+SHOW CREATE PACKAGE pkg1;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pkg1 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION NULL latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW CREATE PACKAGE BODY pkg1;
+Package body sql_mode Create Package Body character_set_client collation_connection Database Collation
+pkg1 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`u1`@`localhost` PACKAGE BODY `pkg1` PROCEDURE p1() BEGIN SELECT 'This is pkg1.p1' AS `comment`; END;
+FUNCTION f1() RETURNS TEXT BEGIN RETURN 'This is pkg1.f1'; END;
+END latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW GRANTS;
+Grants for u1@localhost
+GRANT USAGE ON *.* TO `u1`@`localhost`
+GRANT SELECT, CREATE ROUTINE ON `db1`.* TO `u1`@`localhost`
+GRANT EXECUTE, ALTER ROUTINE ON PACKAGE BODY `db1`.`pkg1` TO `u1`@`localhost`
+CALL pkg1.p1;
+comment
+This is pkg1.p1
+SELECT pkg1.f1();
+pkg1.f1()
+This is pkg1.f1
+DROP PACKAGE BODY pkg1;
+SHOW GRANTS;
+Grants for u1@localhost
+GRANT USAGE ON *.* TO `u1`@`localhost`
+GRANT SELECT, CREATE ROUTINE ON `db1`.* TO `u1`@`localhost`
+#
+# Now create a PACKAGE BODY by root.
+# u1 does not have EXECUTE access by default.
+#
+connection default;
+CREATE PACKAGE BODY pkg1
+PROCEDURE p1() BEGIN SELECT 'This is pkg1.p1' AS `comment`; END;
+FUNCTION f1() RETURNS TEXT RETURN 'This is pkg1.f1';
+END;
+$$
+connection conn1;
+SHOW CREATE PACKAGE pkg1;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pkg1 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION NULL latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW CREATE PACKAGE BODY pkg1;
+Package body sql_mode Create Package Body character_set_client collation_connection Database Collation
+pkg1 STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION NULL latin1 latin1_swedish_ci latin1_swedish_ci
+CALL pkg1.p1;
+ERROR 42000: execute command denied to user 'u1'@'localhost' for routine 'db1.pkg1'
+SELECT pkg1.f1();
+ERROR 42000: execute command denied to user 'u1'@'localhost' for routine 'db1.pkg1'
+#
+# Now grant EXECUTE to u1 on the PACKAGE BODY created by root
+#
+connection default;
+GRANT EXECUTE ON PACKAGE BODY db1.pkg1 TO u1@localhost;
+disconnect conn1;
+connect conn1,localhost,u1,,db1;
+SELECT CURRENT_USER;
+CURRENT_USER
+u1@localhost
+SHOW GRANTS;
+Grants for u1@localhost
+GRANT USAGE ON *.* TO `u1`@`localhost`
+GRANT SELECT, CREATE ROUTINE ON `db1`.* TO `u1`@`localhost`
+GRANT EXECUTE ON PACKAGE BODY `db1`.`pkg1` TO `u1`@`localhost`
+CALL pkg1.p1;
+comment
+This is pkg1.p1
+SELECT pkg1.f1();
+pkg1.f1()
+This is pkg1.f1
+connection default;
+DROP PACKAGE BODY pkg1;
+#
+# u1 still cannot DROP the package specification earlier created by root.
+#
+connection conn1;
+DROP PACKAGE pkg1;
+ERROR 42000: alter routine command denied to user 'u1'@'localhost' for routine 'db1.pkg1'
+#
+# Grant ALTER ROUTINE to u1
+#
+connection default;
+GRANT ALTER ROUTINE ON db1.* TO u1@localhost;
+#
+# Now u1 can DROP:
+# - the standalone procedure earlier created by root
+# - the package specification earlier created by root
+#
+disconnect conn1;
+connect conn1,localhost,u1,,db1;
+DROP PACKAGE pkg1;
+DROP PROCEDURE p1root;
+disconnect conn1;
+connection default;
+DROP USER u1@localhost;
+DROP DATABASE db1;
+USE test;
+#
+# Creator=root, definer=xxx
+#
+CREATE USER xxx@localhost;
+CREATE DEFINER=xxx@localhost PACKAGE p1
+PROCEDURE p1();
+END;
+$$
+CREATE DEFINER=xxx@localhost PACKAGE BODY p1
+PROCEDURE p1()
+BEGIN
+SELECT SESSION_USER(), CURRENT_USER(), 'p1.p1' AS msg;
+END;
+SELECT SESSION_USER(), CURRENT_USER(), 'package body p1' AS msg;
+END;
+$$
+CALL p1.p1;
+ERROR 42000: execute command denied to user 'xxx'@'localhost' for routine 'test.p1'
+GRANT EXECUTE ON PACKAGE BODY test.p1 TO xxx@localhost;
+CALL p1.p1;
+SESSION_USER() CURRENT_USER() msg
+root@localhost xxx@localhost package body p1
+SESSION_USER() CURRENT_USER() msg
+root@localhost xxx@localhost p1.p1
+DROP PACKAGE p1;
+DROP USER xxx@localhost;
+#
+# Creator=root, definer=xxx, SQL SECURITY INVOKER
+#
+CREATE USER xxx@localhost;
+CREATE DEFINER=xxx@localhost PACKAGE p1
+PROCEDURE p1();
+END;
+$$
+CREATE DEFINER=xxx@localhost PACKAGE BODY p1 SQL SECURITY INVOKER
+PROCEDURE p1()
+BEGIN
+SELECT SESSION_USER(), CURRENT_USER(), 'p1.p1' AS msg;
+END;
+SELECT SESSION_USER(), CURRENT_USER(), 'package body p1' AS msg;
+END;
+$$
+CALL p1.p1;
+SESSION_USER() CURRENT_USER() msg
+root@localhost root@localhost package body p1
+SESSION_USER() CURRENT_USER() msg
+root@localhost root@localhost p1.p1
+DROP PACKAGE p1;
+DROP USER xxx@localhost;
+#
+# MDEV-33386 Wrong error message on `GRANT .. ON PACKAGE no_such_package ..`
+#
+GRANT EXECUTE ON PACKAGE no_such_package TO PUBLIC;
+ERROR 42000: PACKAGE no_such_package does not exist
+GRANT EXECUTE ON PACKAGE BODY no_such_package TO PUBLIC;
+ERROR 42000: PACKAGE BODY no_such_package does not exist
+#
+# End of 11.4 tests
+#
diff --git a/mysql-test/main/sp-package-security.test b/mysql-test/main/sp-package-security.test
new file mode 100644
index 00000000..52e986da
--- /dev/null
+++ b/mysql-test/main/sp-package-security.test
@@ -0,0 +1,340 @@
+--source include/not_embedded.inc
+--source include/default_charset.inc
+
+--echo #
+--echo # Start of 11.4 tests
+--echo #
+
+CREATE DATABASE db1;
+CREATE USER u1@localhost IDENTIFIED BY '';
+GRANT SELECT ON db1.* TO u1@localhost;
+
+connect (conn1,localhost,u1,,db1);
+SELECT CURRENT_USER;
+
+--echo #
+--echo # User u1 cannot drop PROCEDURE, PACKAGE, PACKAGE BODY by default
+--echo #
+
+--error ER_PROCACCESS_DENIED_ERROR
+DROP PROCEDURE p1;
+--error ER_PROCACCESS_DENIED_ERROR
+DROP PACKAGE pkg1;
+--error ER_PROCACCESS_DENIED_ERROR
+DROP PACKAGE BODY pkg1;
+
+--echo #
+--echo # User u1 cannot create PROCEDURE, PACKAGE, PACKAGE BODY by default
+--echo #
+
+DELIMITER $$;
+--error ER_DBACCESS_DENIED_ERROR
+CREATE PROCEDURE p1()
+BEGIN
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+--error ER_DBACCESS_DENIED_ERROR
+CREATE PACKAGE pkg1
+ PROCEDURE p1();
+END;
+$$
+DELIMITER ;$$
+
+# TODO: this should probably return ER_DBACCESS_DENIED_ERROR
+# here, and in the same place in compat/oracle.sp-package-security.test
+DELIMITER $$;
+--error ER_SP_DOES_NOT_EXIST
+CREATE PACKAGE BODY pkg1 AS
+ PROCEDURE p1() AS BEGIN END;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # Now create a PACKAGE by root
+--echo #
+
+connection default;
+USE db1;
+
+DELIMITER $$;
+CREATE PROCEDURE p1root()
+BEGIN
+ SELECT 1;
+END;
+$$
+DELIMITER ;$$
+
+DELIMITER $$;
+CREATE PACKAGE pkg1
+ PROCEDURE p1();
+ FUNCTION f1() RETURNS TEXT;
+END;
+$$
+DELIMITER ;$$
+SHOW CREATE PACKAGE pkg1;
+
+--echo #
+--echo # u1 cannot SHOW yet:
+--echo # - the standalone procedure earlier created by root
+--echo # - the package specifications earlier create by root
+--echo #
+
+connection conn1;
+--error ER_SP_DOES_NOT_EXIST
+SHOW CREATE PROCEDURE p1root;
+--error ER_SP_DOES_NOT_EXIST
+SHOW CREATE PACKAGE pkg1;
+
+
+--echo #
+--echo # User u1 still cannot create a PACKAGE BODY
+--echo #
+
+connection conn1;
+DELIMITER $$;
+--error ER_DBACCESS_DENIED_ERROR
+CREATE PACKAGE BODY pkg1
+ PROCEDURE p1() BEGIN END;
+ FUNCTION f1() RETURNS TEXT BEGIN RETURN 'This is f1'; END;
+END;
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # Now grant EXECUTE:
+--echo # - on the standalone procedure earlier created by root
+--echo # - on the package specification earlier created by root
+--echo #
+connection default;
+GRANT EXECUTE ON PROCEDURE db1.p1root TO u1@localhost;
+GRANT EXECUTE ON PACKAGE db1.pkg1 TO u1@localhost;
+
+--echo #
+--echo # Now u1 can do SHOW for:
+--echo # - the standalone procedure earlier created by root
+--echo # - the package specification earlier created by root
+--echo #
+
+disconnect conn1;
+connect (conn1,localhost,u1,,db1);
+SHOW CREATE PROCEDURE db1.p1root;
+SHOW CREATE PACKAGE db1.pkg1;
+
+
+--echo #
+--echo # Now revoke EXECUTE and grant CREATE ROUTINE instead
+--echo #
+
+connection default;
+REVOKE EXECUTE ON PROCEDURE db1.p1root FROM u1@localhost;
+REVOKE EXECUTE ON PACKAGE db1.pkg1 FROM u1@localhost;
+GRANT CREATE ROUTINE ON db1.* TO u1@localhost;
+
+--echo #
+--echo # Reconnect u1 to make new grants have effect
+--echo #
+
+disconnect conn1;
+connect (conn1,localhost,u1,,db1);
+
+--echo #
+--echo # Now u1 can SHOW:
+--echo # - standalone routines earlier created by root
+--echo # - package specifications earlier created by root
+--echo #
+SHOW CREATE PROCEDURE p1root;
+SHOW CREATE PACKAGE pkg1;
+
+--echo #
+--echo # Now u1 can CREATE, DROP and EXECUTE its own standalone procedures
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1()
+BEGIN
+END;
+$$
+DELIMITER ;$$
+SHOW GRANTS;
+CALL p1;
+DROP PROCEDURE p1;
+SHOW GRANTS;
+
+--echo #
+--echo # Now u1 can also CREATE, DROP its own package specifications
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE pkg2
+ PROCEDURE p1();
+ FUNCTION f1() RETURNS TEXT;
+END;
+$$
+DELIMITER ;$$
+SHOW CREATE PACKAGE pkg2;
+SHOW GRANTS;
+DROP PACKAGE pkg2;
+SHOW GRANTS;
+
+
+--echo #
+--echo # Now u1 can also CREATE, DROP package bodies and EXECUTE package body routines
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE BODY pkg1
+ PROCEDURE p1() BEGIN SELECT 'This is pkg1.p1' AS `comment`; END;
+ FUNCTION f1() RETURNS TEXT BEGIN RETURN 'This is pkg1.f1'; END;
+END;
+$$
+DELIMITER ;$$
+SHOW CREATE PACKAGE pkg1;
+SHOW CREATE PACKAGE BODY pkg1;
+SHOW GRANTS;
+CALL pkg1.p1;
+SELECT pkg1.f1();
+DROP PACKAGE BODY pkg1;
+SHOW GRANTS;
+
+--echo #
+--echo # Now create a PACKAGE BODY by root.
+--echo # u1 does not have EXECUTE access by default.
+--echo #
+
+connection default;
+DELIMITER $$;
+CREATE PACKAGE BODY pkg1
+ PROCEDURE p1() BEGIN SELECT 'This is pkg1.p1' AS `comment`; END;
+ FUNCTION f1() RETURNS TEXT RETURN 'This is pkg1.f1';
+END;
+$$
+DELIMITER ;$$
+
+connection conn1;
+SHOW CREATE PACKAGE pkg1;
+SHOW CREATE PACKAGE BODY pkg1;
+--error ER_PROCACCESS_DENIED_ERROR
+CALL pkg1.p1;
+--error ER_PROCACCESS_DENIED_ERROR
+SELECT pkg1.f1();
+
+--echo #
+--echo # Now grant EXECUTE to u1 on the PACKAGE BODY created by root
+--echo #
+
+connection default;
+GRANT EXECUTE ON PACKAGE BODY db1.pkg1 TO u1@localhost;
+disconnect conn1;
+connect (conn1,localhost,u1,,db1);
+SELECT CURRENT_USER;
+SHOW GRANTS;
+CALL pkg1.p1;
+SELECT pkg1.f1();
+
+connection default;
+DROP PACKAGE BODY pkg1;
+
+
+--echo #
+--echo # u1 still cannot DROP the package specification earlier created by root.
+--echo #
+
+connection conn1;
+--error ER_PROCACCESS_DENIED_ERROR
+DROP PACKAGE pkg1;
+
+--echo #
+--echo # Grant ALTER ROUTINE to u1
+--echo #
+
+connection default;
+GRANT ALTER ROUTINE ON db1.* TO u1@localhost;
+
+--echo #
+--echo # Now u1 can DROP:
+--echo # - the standalone procedure earlier created by root
+--echo # - the package specification earlier created by root
+--echo #
+
+disconnect conn1;
+connect (conn1,localhost,u1,,db1);
+DROP PACKAGE pkg1;
+DROP PROCEDURE p1root;
+
+disconnect conn1;
+connection default;
+
+DROP USER u1@localhost;
+DROP DATABASE db1;
+USE test;
+
+
+--echo #
+--echo # Creator=root, definer=xxx
+--echo #
+
+CREATE USER xxx@localhost;
+DELIMITER $$;
+CREATE DEFINER=xxx@localhost PACKAGE p1
+ PROCEDURE p1();
+END;
+$$
+CREATE DEFINER=xxx@localhost PACKAGE BODY p1
+ PROCEDURE p1()
+ BEGIN
+ SELECT SESSION_USER(), CURRENT_USER(), 'p1.p1' AS msg;
+ END;
+ SELECT SESSION_USER(), CURRENT_USER(), 'package body p1' AS msg;
+END;
+$$
+DELIMITER ;$$
+--error ER_PROCACCESS_DENIED_ERROR
+CALL p1.p1;
+GRANT EXECUTE ON PACKAGE BODY test.p1 TO xxx@localhost;
+CALL p1.p1;
+DROP PACKAGE p1;
+DROP USER xxx@localhost;
+
+
+--echo #
+--echo # Creator=root, definer=xxx, SQL SECURITY INVOKER
+--echo #
+
+CREATE USER xxx@localhost;
+DELIMITER $$;
+CREATE DEFINER=xxx@localhost PACKAGE p1
+ PROCEDURE p1();
+END;
+$$
+CREATE DEFINER=xxx@localhost PACKAGE BODY p1 SQL SECURITY INVOKER
+ PROCEDURE p1()
+ BEGIN
+ SELECT SESSION_USER(), CURRENT_USER(), 'p1.p1' AS msg;
+ END;
+ SELECT SESSION_USER(), CURRENT_USER(), 'package body p1' AS msg;
+END;
+$$
+DELIMITER ;$$
+CALL p1.p1;
+DROP PACKAGE p1;
+DROP USER xxx@localhost;
+
+
+--echo #
+--echo # MDEV-33386 Wrong error message on `GRANT .. ON PACKAGE no_such_package ..`
+--echo #
+
+--error ER_SP_DOES_NOT_EXIST
+GRANT EXECUTE ON PACKAGE no_such_package TO PUBLIC;
+--error ER_SP_DOES_NOT_EXIST
+GRANT EXECUTE ON PACKAGE BODY no_such_package TO PUBLIC;
+
+--echo #
+--echo # End of 11.4 tests
+--echo #
diff --git a/mysql-test/main/sp-package.result b/mysql-test/main/sp-package.result
new file mode 100644
index 00000000..88dcd376
--- /dev/null
+++ b/mysql-test/main/sp-package.result
@@ -0,0 +1,123 @@
+#
+# Start of 11.4 tests
+#
+SET sql_mode='';
+CREATE OR REPLACE PACKAGE pkg
+PROCEDURE p1();
+FUNCTION f1() RETURNS INT;
+END;
+$$
+CREATE OR REPLACE PACKAGE BODY pkg
+-- variable declarations
+DECLARE a INT DEFAULT 11;
+DECLARE b INT DEFAULT 10;
+-- routine declarations
+PROCEDURE p1()
+BEGIN
+SELECT CURRENT_USER;
+END;
+FUNCTION f1() RETURNS INT
+BEGIN
+RETURN a;
+END;
+-- initialization section
+SET a=a-b;
+END;
+$$
+SHOW CREATE PACKAGE pkg;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pkg CREATE DEFINER=`root`@`localhost` PACKAGE `pkg` PROCEDURE p1();
+FUNCTION f1() RETURNS INT;
+END latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW CREATE PACKAGE BODY pkg;
+Package body sql_mode Create Package Body character_set_client collation_connection Database Collation
+pkg CREATE DEFINER=`root`@`localhost` PACKAGE BODY `pkg` DECLARE a INT DEFAULT 11;
+DECLARE b INT DEFAULT 10;
+-- routine declarations
+PROCEDURE p1()
+BEGIN
+SELECT CURRENT_USER;
+END;
+FUNCTION f1() RETURNS INT
+BEGIN
+RETURN a;
+END;
+-- initialization section
+SET a=a-b;
+END latin1 latin1_swedish_ci latin1_swedish_ci
+CALL pkg.p1();
+CURRENT_USER
+root@localhost
+SELECT pkg.f1();
+pkg.f1()
+1
+DROP PACKAGE pkg;
+#
+# MDEV-33428 Error messages ER_PACKAGE_ROUTINE_* are not good enough
+#
+#
+# Routines declared in CREATE PACKAGE missing in CREATE PACKAGE BODY
+#
+CREATE PACKAGE test2
+PROCEDURE p1();
+END;
+$$
+CREATE PACKAGE BODY test2
+PROCEDURE p2() BEGIN SELECT 0; END;
+END;
+$$
+ERROR HY000: PROCEDURE `test.test2.p1` is declared in the package specification but is not defined in the package body
+DROP PACKAGE test2;
+CREATE PACKAGE test2
+FUNCTION f1() RETURNS INT;
+END;
+$$
+CREATE PACKAGE BODY test2
+FUNCTION f2() RETURNS INT BEGIN RETURN 10; END;
+END;
+$$
+ERROR HY000: FUNCTION `test.test2.f1` is declared in the package specification but is not defined in the package body
+DROP PACKAGE test2;
+CREATE PACKAGE test2
+PROCEDURE p1();
+END;
+$$
+CREATE PACKAGE BODY test2
+FUNCTION p1() RETURNS INT BEGIN RETURN 10; END;
+END;
+$$
+ERROR HY000: PROCEDURE `test.test2.p1` is declared in the package specification but is not defined in the package body
+DROP PACKAGE test2;
+CREATE PACKAGE test2
+PROCEDURE p1();
+END;
+$$
+CREATE PACKAGE BODY test2
+PROCEDURE p1(a INT) BEGIN SELECT 0; END; -- Notice different prototype
+END;
+$$
+ERROR HY000: PROCEDURE `test.test2.p1` is declared in the package specification but is not defined in the package body
+DROP PACKAGE test2;
+#
+# Forward declarations in CREATE PACKAGE BODY with missing implementations
+#
+CREATE PACKAGE test2
+PROCEDURE p1();
+END;
+$$
+CREATE PACKAGE BODY test2
+PROCEDURE p1() BEGIN SELECT 0; END;
+PROCEDURE p2();
+END;
+$$
+ERROR HY000: PROCEDURE `test.test2.p2` has a forward declaration but is not defined
+CREATE PACKAGE BODY test2
+FUNCTION f1() RETURNS INT;
+PROCEDURE p1() BEGIN SELECT 0; END;
+END;
+$$
+ERROR HY000: FUNCTION `test.test2.f1` has a forward declaration but is not defined
+DROP PACKAGE test2;
+#
+# End of 11.4 tests
+#
diff --git a/mysql-test/main/sp-package.test b/mysql-test/main/sp-package.test
new file mode 100644
index 00000000..31524e3e
--- /dev/null
+++ b/mysql-test/main/sp-package.test
@@ -0,0 +1,140 @@
+--echo #
+--echo # Start of 11.4 tests
+--echo #
+
+#
+# CREATE PACKAGE for sql_mode='';
+# Resebmles SQL Standard 'CREATE MODULE'.
+#
+
+SET sql_mode='';
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE pkg
+ PROCEDURE p1();
+ FUNCTION f1() RETURNS INT;
+END;
+$$
+DELIMITER ;$$
+
+
+DELIMITER $$;
+CREATE OR REPLACE PACKAGE BODY pkg
+ -- variable declarations
+ DECLARE a INT DEFAULT 11;
+ DECLARE b INT DEFAULT 10;
+
+ -- routine declarations
+ PROCEDURE p1()
+ BEGIN
+ SELECT CURRENT_USER;
+ END;
+ FUNCTION f1() RETURNS INT
+ BEGIN
+ RETURN a;
+ END;
+
+ -- initialization section
+ SET a=a-b;
+END;
+$$
+DELIMITER ;$$
+
+
+SHOW CREATE PACKAGE pkg;
+SHOW CREATE PACKAGE BODY pkg;
+
+CALL pkg.p1();
+SELECT pkg.f1();
+
+DROP PACKAGE pkg;
+
+
+--echo #
+--echo # MDEV-33428 Error messages ER_PACKAGE_ROUTINE_* are not good enough
+--echo #
+
+--echo #
+--echo # Routines declared in CREATE PACKAGE missing in CREATE PACKAGE BODY
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2
+ PROCEDURE p1();
+END;
+$$
+--error ER_PACKAGE_ROUTINE_IN_SPEC_NOT_DEFINED_IN_BODY
+CREATE PACKAGE BODY test2
+ PROCEDURE p2() BEGIN SELECT 0; END;
+END;
+$$
+DELIMITER ;$$
+DROP PACKAGE test2;
+
+DELIMITER $$;
+CREATE PACKAGE test2
+ FUNCTION f1() RETURNS INT;
+END;
+$$
+--error ER_PACKAGE_ROUTINE_IN_SPEC_NOT_DEFINED_IN_BODY
+CREATE PACKAGE BODY test2
+ FUNCTION f2() RETURNS INT BEGIN RETURN 10; END;
+END;
+$$
+DELIMITER ;$$
+DROP PACKAGE test2;
+
+DELIMITER $$;
+CREATE PACKAGE test2
+ PROCEDURE p1();
+END;
+$$
+--error ER_PACKAGE_ROUTINE_IN_SPEC_NOT_DEFINED_IN_BODY
+CREATE PACKAGE BODY test2
+ FUNCTION p1() RETURNS INT BEGIN RETURN 10; END;
+END;
+$$
+DELIMITER ;$$
+DROP PACKAGE test2;
+
+DELIMITER $$;
+CREATE PACKAGE test2
+ PROCEDURE p1();
+END;
+$$
+--error ER_PACKAGE_ROUTINE_IN_SPEC_NOT_DEFINED_IN_BODY
+CREATE PACKAGE BODY test2
+ PROCEDURE p1(a INT) BEGIN SELECT 0; END; -- Notice different prototype
+END;
+$$
+DELIMITER ;$$
+DROP PACKAGE test2;
+
+--echo #
+--echo # Forward declarations in CREATE PACKAGE BODY with missing implementations
+--echo #
+
+DELIMITER $$;
+CREATE PACKAGE test2
+ PROCEDURE p1();
+END;
+$$
+--error ER_PACKAGE_ROUTINE_FORWARD_DECLARATION_NOT_DEFINED
+CREATE PACKAGE BODY test2
+ PROCEDURE p1() BEGIN SELECT 0; END;
+ PROCEDURE p2();
+END;
+$$
+--error ER_PACKAGE_ROUTINE_FORWARD_DECLARATION_NOT_DEFINED
+CREATE PACKAGE BODY test2
+ FUNCTION f1() RETURNS INT;
+ PROCEDURE p1() BEGIN SELECT 0; END;
+END;
+$$
+DELIMITER ;$$
+DROP PACKAGE test2;
+
+
+--echo #
+--echo # End of 11.4 tests
+--echo #
diff --git a/mysql-test/main/sp-row.result b/mysql-test/main/sp-row.result
index b66455df..a47f124f 100644
--- a/mysql-test/main/sp-row.result
+++ b/mysql-test/main/sp-row.result
@@ -2136,8 +2136,6 @@ SELECT * FROM t1 INTO rec1;
SELECT rec1.a, rec1.b;
END;
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL p1();
ERROR 21000: The used SELECT statements have a different number of columns
DROP TABLE t1;
@@ -2152,8 +2150,6 @@ SELECT * FROM t1 INTO rec1, rec1;
SELECT rec1.a, rec1.b;
END;
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL p1();
ERROR 21000: Operand should contain 2 column(s)
DROP TABLE t1;
@@ -2168,8 +2164,6 @@ SELECT * FROM t1 INTO rec1;
SELECT rec1.a, rec1.b;
END;
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL p1();
rec1.a rec1.b
10 b10
diff --git a/mysql-test/main/sp-security-debug.result b/mysql-test/main/sp-security-debug.result
new file mode 100644
index 00000000..6ee7f496
--- /dev/null
+++ b/mysql-test/main/sp-security-debug.result
@@ -0,0 +1,294 @@
+set @@global.character_set_server=@@session.character_set_server;
+#
+# MDEV-29167: new db-level SHOW CREATE ROUTINE privilege
+#
+###
+### SHOW-Like commad test
+###
+SET @save_sql_mode=@@sql_mode;
+#
+### Prepare functions for the test and SHOW-like by owner
+#
+create database test_db;
+use test_db;
+create procedure test_db.sp() select 1;
+show procedure code test_db.sp;
+Pos Instruction
+0 stmt 0 "select 1"
+CREATE FUNCTION test_db.fn() RETURNS INT RETURN 1;
+show function code test_db.fn;
+Pos Instruction
+0 freturn int 1
+SET sql_mode=ORACLE;
+CREATE PACKAGE test_db.pk AS
+FUNCTION pkf() RETURN INT;
+PROCEDURE pkp();
+END;
+$$
+CREATE PACKAGE BODY test_db.pk AS
+pkv INT:=1;
+PROCEDURE pkhp() AS
+BEGIN
+SELECT pkv FROM DUAL;
+END;
+FUNCTION pkhf() RETURN INT AS
+BEGIN
+RETURN pkv;
+END;
+PROCEDURE pkp() AS
+BEGIN
+CALL pkhp();
+END;
+FUNCTION pkf() RETURN INT AS
+BEGIN
+RETURN pkhf();
+END;
+BEGIN
+pkv:=2;
+END;
+$$
+SET sql_mode=@save_sql_mode;
+show package code test_db.pk;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'code test_db.pk' at line 1
+show package body code test_db.pk;
+Pos Instruction
+0 set pkv@0 1
+1 set pkv@0 2
+use test;
+###
+### Pre-"SHOW-CREATE-ROUTINE" behaviour tests
+###
+#
+### Rights on mysql.proc
+#
+create user user@localhost;
+grant all privileges on mysql.* to user@localhost;
+grant all privileges on test.* to user@localhost;
+connect conn1, localhost, user, , test;
+show procedure code test_db.sp;
+Pos Instruction
+0 stmt 0 "select 1"
+show function code test_db.fn;
+Pos Instruction
+0 freturn int 1
+show package body code test_db.pk;
+Pos Instruction
+0 set pkv@0 1
+1 set pkv@0 2
+connection default;
+disconnect conn1;
+revoke all privileges on mysql.* from user@localhost;
+#
+### No privileges
+#
+connect conn1, localhost, user, , test;
+show procedure code test_db.sp;
+ERROR 42000: PROCEDURE sp does not exist
+show function code test_db.fn;
+ERROR 42000: FUNCTION fn does not exist
+show package body code test_db.pk;
+ERROR 42000: PACKAGE BODY pk does not exist
+connection default;
+disconnect conn1;
+#
+### Execute provilege PROCEDURE/FUNCTION
+#
+grant execute on procedure test_db.sp to user@localhost;
+grant execute on function test_db.fn to user@localhost;
+connect conn1, localhost, user, , test;
+show procedure code test_db.sp;
+ERROR 42000: PROCEDURE sp does not exist
+show function code test_db.fn;
+ERROR 42000: FUNCTION fn does not exist
+connection default;
+disconnect conn1;
+revoke execute on procedure test_db.sp from user@localhost;
+revoke execute on function test_db.fn from user@localhost;
+#
+### Execute provilege PACKAGE+ PACKAGE BODY-
+#
+SET sql_mode=ORACLE;
+grant execute on package test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+connect conn1, localhost, user, , test;
+show package body code test_db.pk;
+ERROR 42000: PACKAGE BODY pk does not exist
+connection default;
+disconnect conn1;
+SET sql_mode=ORACLE;
+revoke execute on package test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+#
+### Execute provilege PACKAGE- PACKAGE BODY+
+#
+SET sql_mode=ORACLE;
+grant execute on package body test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+connect conn1, localhost, user, , test;
+show package body code test_db.pk;
+ERROR 42000: PACKAGE BODY pk does not exist
+connection default;
+disconnect conn1;
+SET sql_mode=ORACLE;
+revoke execute on package body test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+#
+### Alter routine provilege PROCEDURE/FUNCTION
+#
+grant alter routine on procedure test_db.sp to user@localhost;
+grant alter routine on function test_db.fn to user@localhost;
+connect conn1, localhost, user, , test;
+show procedure code test_db.sp;
+ERROR 42000: PROCEDURE sp does not exist
+show function code test_db.fn;
+ERROR 42000: FUNCTION fn does not exist
+connection default;
+disconnect conn1;
+revoke alter routine on procedure test_db.sp from user@localhost;
+revoke alter routine on function test_db.fn from user@localhost;
+#
+### Alter routine provilege PACKAGE+ PACKAGE BODY-
+#
+SET sql_mode=ORACLE;
+grant alter routine on package test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+connect conn1, localhost, user, , test;
+show package body code test_db.pk;
+ERROR 42000: PACKAGE BODY pk does not exist
+connection default;
+disconnect conn1;
+SET sql_mode=ORACLE;
+revoke alter routine on package test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+#
+### Alter routine provilege PACKAGE+ PACKAGE BODY-
+#
+SET sql_mode=ORACLE;
+grant alter routine on package body test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+connect conn1, localhost, user, , test;
+show package body code test_db.pk;
+ERROR 42000: PACKAGE BODY pk does not exist
+connection default;
+disconnect conn1;
+SET sql_mode=ORACLE;
+revoke alter routine on package body test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+###
+### SHOW CREATE PROCEDURE tests
+###
+#
+### Global "show create routine" test
+#
+grant show create routine on *.* to user@localhost;
+show grants for user@localhost;
+Grants for user@localhost
+GRANT SHOW CREATE ROUTINE ON *.* TO `user`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `user`@`localhost`
+connect conn1, localhost, user, , test;
+show procedure code test_db.sp;
+Pos Instruction
+0 stmt 0 "select 1"
+show function code test_db.fn;
+Pos Instruction
+0 freturn int 1
+show package body code test_db.pk;
+Pos Instruction
+0 set pkv@0 1
+1 set pkv@0 2
+connection default;
+disconnect conn1;
+revoke show create routine on *.* from user@localhost;
+#
+### DB-level "show create routine" but other DB test
+#
+grant show create routine on db_test.* to user@localhost;
+show grants for user@localhost;
+Grants for user@localhost
+GRANT USAGE ON *.* TO `user`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `user`@`localhost`
+GRANT SHOW CREATE ROUTINE ON `db_test`.* TO `user`@`localhost`
+connect conn1, localhost, user, , test;
+show procedure code test_db.sp;
+ERROR 42000: PROCEDURE sp does not exist
+show function code test_db.fn;
+ERROR 42000: FUNCTION fn does not exist
+show package body code test_db.pk;
+ERROR 42000: PACKAGE BODY pk does not exist
+connection default;
+disconnect conn1;
+revoke show create routine on db_test.* from user@localhost;
+#
+### DB-level "show create routine" test
+#
+grant show create routine on test_db.* to user@localhost;
+show grants for user@localhost;
+Grants for user@localhost
+GRANT USAGE ON *.* TO `user`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `user`@`localhost`
+GRANT SHOW CREATE ROUTINE ON `test_db`.* TO `user`@`localhost`
+connect conn1, localhost, user, , test;
+show procedure code test_db.sp;
+Pos Instruction
+0 stmt 0 "select 1"
+show function code test_db.fn;
+Pos Instruction
+0 freturn int 1
+show package body code test_db.pk;
+Pos Instruction
+0 set pkv@0 1
+1 set pkv@0 2
+connection default;
+disconnect conn1;
+revoke show create routine on test_db.* from user@localhost;
+#
+### Routine-level "show create routine" PROCEDURE and FUNCTION
+#
+grant show create routine on procedure test_db.sp to user@localhost;
+grant show create routine on function test_db.fn to user@localhost;
+connect conn1, localhost, user, , test;
+show procedure code test_db.sp;
+Pos Instruction
+0 stmt 0 "select 1"
+show function code test_db.fn;
+Pos Instruction
+0 freturn int 1
+connection default;
+disconnect conn1;
+revoke show create routine on procedure test_db.sp from user@localhost;
+revoke show create routine on function test_db.fn from user@localhost;
+#
+### Routine-level "show create routine" PACKAGE+ PACKAGE BODY-
+#
+SET sql_mode=ORACLE;
+grant show create routine on package test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+connect conn1, localhost, user, , test;
+show package body code test_db.pk;
+ERROR 42000: PACKAGE BODY pk does not exist
+connection default;
+disconnect conn1;
+SET sql_mode=ORACLE;
+revoke show create routine on package test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+#
+### Routine-level "show create routine" PACKAGE- PACKAGE BODY+
+#
+SET sql_mode=ORACLE;
+grant show create routine on package body test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+connect conn1, localhost, user, , test;
+show package body code test_db.pk;
+Pos Instruction
+0 set pkv@0 1
+1 set pkv@0 2
+connection default;
+disconnect conn1;
+SET sql_mode=ORACLE;
+revoke show create routine on package body test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+drop database test_db;
+drop user user@localhost;
+#
+# End of 11.3 tests
+#
diff --git a/mysql-test/main/sp-security-debug.test b/mysql-test/main/sp-security-debug.test
new file mode 100644
index 00000000..58d37a67
--- /dev/null
+++ b/mysql-test/main/sp-security-debug.test
@@ -0,0 +1,368 @@
+#
+# Testing SQL SECURITY of stored procedures (DEBUGG binaries)
+#
+
+--source include/have_debug.inc
+# Can't test with embedded server that doesn't support grants
+--source include/not_embedded.inc
+--source include/default_charset.inc
+set @@global.character_set_server=@@session.character_set_server;
+
+
+--echo #
+--echo # MDEV-29167: new db-level SHOW CREATE ROUTINE privilege
+--echo #
+
+--echo ###
+--echo ### SHOW-Like commad test
+--echo ###
+
+SET @save_sql_mode=@@sql_mode;
+
+--echo #
+--echo ### Prepare functions for the test and SHOW-like by owner
+--echo #
+
+create database test_db;
+use test_db;
+create procedure test_db.sp() select 1;
+show procedure code test_db.sp;
+CREATE FUNCTION test_db.fn() RETURNS INT RETURN 1;
+show function code test_db.fn;
+
+SET sql_mode=ORACLE;
+DELIMITER $$;
+CREATE PACKAGE test_db.pk AS
+ FUNCTION pkf() RETURN INT;
+ PROCEDURE pkp();
+END;
+$$
+CREATE PACKAGE BODY test_db.pk AS
+ pkv INT:=1;
+
+ PROCEDURE pkhp() AS
+ BEGIN
+ SELECT pkv FROM DUAL;
+ END;
+
+ FUNCTION pkhf() RETURN INT AS
+ BEGIN
+ RETURN pkv;
+ END;
+
+ PROCEDURE pkp() AS
+ BEGIN
+ CALL pkhp();
+ END;
+ FUNCTION pkf() RETURN INT AS
+ BEGIN
+ RETURN pkhf();
+ END;
+
+BEGIN
+ pkv:=2;
+END;
+$$
+DELIMITER ;$$
+
+SET sql_mode=@save_sql_mode;
+--error ER_PARSE_ERROR
+show package code test_db.pk;
+show package body code test_db.pk;
+
+use test;
+
+
+--echo ###
+--echo ### Pre-"SHOW-CREATE-ROUTINE" behaviour tests
+--echo ###
+
+
+--echo #
+--echo ### Rights on mysql.proc
+--echo #
+
+create user user@localhost;
+grant all privileges on mysql.* to user@localhost;
+grant all privileges on test.* to user@localhost;
+
+connect conn1, localhost, user, , test;
+
+show procedure code test_db.sp;
+show function code test_db.fn;
+show package body code test_db.pk;
+
+connection default;
+disconnect conn1;
+
+revoke all privileges on mysql.* from user@localhost;
+
+
+--echo #
+--echo ### No privileges
+--echo #
+
+connect conn1, localhost, user, , test;
+
+--error ER_SP_DOES_NOT_EXIST
+show procedure code test_db.sp;
+--error ER_SP_DOES_NOT_EXIST
+show function code test_db.fn;
+--error ER_SP_DOES_NOT_EXIST
+show package body code test_db.pk;
+
+connection default;
+disconnect conn1;
+
+--echo #
+--echo ### Execute provilege PROCEDURE/FUNCTION
+--echo #
+
+grant execute on procedure test_db.sp to user@localhost;
+grant execute on function test_db.fn to user@localhost;
+
+connect conn1, localhost, user, , test;
+
+--error ER_SP_DOES_NOT_EXIST
+show procedure code test_db.sp;
+--error ER_SP_DOES_NOT_EXIST
+show function code test_db.fn;
+
+connection default;
+disconnect conn1;
+
+revoke execute on procedure test_db.sp from user@localhost;
+revoke execute on function test_db.fn from user@localhost;
+
+--echo #
+--echo ### Execute provilege PACKAGE+ PACKAGE BODY-
+--echo #
+
+SET sql_mode=ORACLE;
+grant execute on package test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+
+connect conn1, localhost, user, , test;
+
+--error ER_SP_DOES_NOT_EXIST
+show package body code test_db.pk;
+
+connection default;
+disconnect conn1;
+
+SET sql_mode=ORACLE;
+revoke execute on package test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+
+
+--echo #
+--echo ### Execute provilege PACKAGE- PACKAGE BODY+
+--echo #
+
+SET sql_mode=ORACLE;
+grant execute on package body test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+
+connect conn1, localhost, user, , test;
+
+--error ER_SP_DOES_NOT_EXIST
+show package body code test_db.pk;
+
+connection default;
+disconnect conn1;
+
+SET sql_mode=ORACLE;
+revoke execute on package body test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+
+--echo #
+--echo ### Alter routine provilege PROCEDURE/FUNCTION
+--echo #
+
+grant alter routine on procedure test_db.sp to user@localhost;
+grant alter routine on function test_db.fn to user@localhost;
+
+connect conn1, localhost, user, , test;
+
+--error ER_SP_DOES_NOT_EXIST
+show procedure code test_db.sp;
+--error ER_SP_DOES_NOT_EXIST
+show function code test_db.fn;
+
+connection default;
+disconnect conn1;
+
+
+revoke alter routine on procedure test_db.sp from user@localhost;
+revoke alter routine on function test_db.fn from user@localhost;
+
+--echo #
+--echo ### Alter routine provilege PACKAGE+ PACKAGE BODY-
+--echo #
+
+SET sql_mode=ORACLE;
+grant alter routine on package test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+
+connect conn1, localhost, user, , test;
+
+--error ER_SP_DOES_NOT_EXIST
+show package body code test_db.pk;
+
+connection default;
+disconnect conn1;
+
+SET sql_mode=ORACLE;
+revoke alter routine on package test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+
+
+--echo #
+--echo ### Alter routine provilege PACKAGE+ PACKAGE BODY-
+--echo #
+
+SET sql_mode=ORACLE;
+grant alter routine on package body test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+
+connect conn1, localhost, user, , test;
+
+--error ER_SP_DOES_NOT_EXIST
+show package body code test_db.pk;
+connection default;
+disconnect conn1;
+
+SET sql_mode=ORACLE;
+revoke alter routine on package body test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+
+
+--echo ###
+--echo ### SHOW CREATE PROCEDURE tests
+--echo ###
+
+
+--echo #
+--echo ### Global "show create routine" test
+--echo #
+
+grant show create routine on *.* to user@localhost;
+show grants for user@localhost;
+
+connect conn1, localhost, user, , test;
+
+show procedure code test_db.sp;
+show function code test_db.fn;
+show package body code test_db.pk;
+
+connection default;
+disconnect conn1;
+
+revoke show create routine on *.* from user@localhost;
+
+--echo #
+--echo ### DB-level "show create routine" but other DB test
+--echo #
+
+grant show create routine on db_test.* to user@localhost;
+show grants for user@localhost;
+
+connect conn1, localhost, user, , test;
+
+--error ER_SP_DOES_NOT_EXIST
+show procedure code test_db.sp;
+--error ER_SP_DOES_NOT_EXIST
+show function code test_db.fn;
+--error ER_SP_DOES_NOT_EXIST
+show package body code test_db.pk;
+
+connection default;
+disconnect conn1;
+
+revoke show create routine on db_test.* from user@localhost;
+
+--echo #
+--echo ### DB-level "show create routine" test
+--echo #
+
+grant show create routine on test_db.* to user@localhost;
+show grants for user@localhost;
+
+connect conn1, localhost, user, , test;
+
+show procedure code test_db.sp;
+show function code test_db.fn;
+show package body code test_db.pk;
+
+connection default;
+disconnect conn1;
+
+revoke show create routine on test_db.* from user@localhost;
+
+
+--echo #
+--echo ### Routine-level "show create routine" PROCEDURE and FUNCTION
+--echo #
+
+grant show create routine on procedure test_db.sp to user@localhost;
+grant show create routine on function test_db.fn to user@localhost;
+
+connect conn1, localhost, user, , test;
+
+show procedure code test_db.sp;
+show function code test_db.fn;
+
+connection default;
+disconnect conn1;
+
+revoke show create routine on procedure test_db.sp from user@localhost;
+revoke show create routine on function test_db.fn from user@localhost;
+
+
+--echo #
+--echo ### Routine-level "show create routine" PACKAGE+ PACKAGE BODY-
+--echo #
+
+SET sql_mode=ORACLE;
+grant show create routine on package test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+
+connect conn1, localhost, user, , test;
+
+--error ER_SP_DOES_NOT_EXIST
+show package body code test_db.pk;
+
+connection default;
+disconnect conn1;
+
+SET sql_mode=ORACLE;
+revoke show create routine on package test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+
+
+--echo #
+--echo ### Routine-level "show create routine" PACKAGE- PACKAGE BODY+
+--echo #
+
+SET sql_mode=ORACLE;
+grant show create routine on package body test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+
+
+connect conn1, localhost, user, , test;
+
+show package body code test_db.pk;
+
+connection default;
+disconnect conn1;
+
+SET sql_mode=ORACLE;
+revoke show create routine on package body test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+
+drop database test_db;
+drop user user@localhost;
+
+--echo #
+--echo # End of 11.3 tests
+--echo #
diff --git a/mysql-test/main/sp-security.result b/mysql-test/main/sp-security.result
index eb186dd7..93e05c52 100644
--- a/mysql-test/main/sp-security.result
+++ b/mysql-test/main/sp-security.result
@@ -240,7 +240,7 @@ grant all privileges on procedure sptest.p1 to userc@localhost;
show grants for userc@localhost;
Grants for userc@localhost
GRANT USAGE ON *.* TO `userc`@`localhost`
-GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `sptest`.`p1` TO `userc`@`localhost` WITH GRANT OPTION
+GRANT EXECUTE, ALTER ROUTINE, SHOW CREATE ROUTINE ON PROCEDURE `sptest`.`p1` TO `userc`@`localhost` WITH GRANT OPTION
show grants for userb@localhost;
Grants for userb@localhost
GRANT USAGE ON *.* TO `userb`@`localhost`
@@ -432,9 +432,9 @@ CREATE FUNCTION wl2897_f1() RETURNS INT RETURN 1;
connection mysqltest_1_con;
USE mysqltest;
CREATE DEFINER=root@localhost PROCEDURE wl2897_p2() SELECT 2;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, SET USER privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the SET USER privilege(s) for this operation
CREATE DEFINER=root@localhost FUNCTION wl2897_f2() RETURNS INT RETURN 2;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, SET USER privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the SET USER privilege(s) for this operation
connection mysqltest_2_con;
use mysqltest;
CREATE DEFINER='a @ b @ c'@localhost PROCEDURE wl2897_p3() SELECT 3;
@@ -843,3 +843,890 @@ drop function f;
#
# End of 10.6 tests
#
+#
+# MDEV-29167: new db-level SHOW CREATE ROUTINE privilege
+#
+###
+### SHOW-Like commad test
+###
+SET @save_sql_mode=@@sql_mode;
+#
+### Prepare functions for the test and SHOW-like by root
+#
+create database test_db;
+use test_db;
+create procedure test_db.sp() select 1;
+show create procedure test_db.sp;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+sp STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `sp`()
+select 1 latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW PROCEDURE STATUS WHERE name="sp";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db sp PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="sp";
+ROUTINE_NAME ROUTINE_DEFINITION
+sp select 1
+CREATE FUNCTION test_db.fn() RETURNS INT RETURN 1;
+show create function test_db.fn;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+fn STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `fn`() RETURNS int(11)
+RETURN 1 latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW FUNCTION STATUS WHERE name="fn";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db fn FUNCTION root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="fn";
+ROUTINE_NAME ROUTINE_DEFINITION
+fn RETURN 1
+SET sql_mode=ORACLE;
+CREATE PACKAGE test_db.pk AS
+FUNCTION pkf() RETURN INT;
+PROCEDURE pkp();
+END;
+$$
+CREATE PACKAGE BODY test_db.pk AS
+pkv INT:=1;
+PROCEDURE pkhp() AS
+BEGIN
+SELECT pkv FROM DUAL;
+END;
+FUNCTION pkhf() RETURN INT AS
+BEGIN
+RETURN pkv;
+END;
+PROCEDURE pkp() AS
+BEGIN
+CALL pkhp();
+END;
+FUNCTION pkf() RETURN INT AS
+BEGIN
+RETURN pkhf();
+END;
+BEGIN
+pkv:=2;
+END;
+$$
+SET sql_mode=@save_sql_mode;
+show create package test_db.pk;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pk PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" PACKAGE "pk" AS
+FUNCTION pkf() RETURN INT;
+PROCEDURE pkp();
+END latin1 latin1_swedish_ci latin1_swedish_ci
+show create package body test_db.pk;
+Package body sql_mode Create Package Body character_set_client collation_connection Database Collation
+pk PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" PACKAGE BODY "pk" AS
+pkv INT:=1;
+PROCEDURE pkhp() AS
+BEGIN
+SELECT pkv FROM DUAL;
+END;
+FUNCTION pkhf() RETURN INT AS
+BEGIN
+RETURN pkv;
+END;
+PROCEDURE pkp() AS
+BEGIN
+CALL pkhp();
+END;
+FUNCTION pkf() RETURN INT AS
+BEGIN
+RETURN pkhf();
+END;
+BEGIN
+pkv:=2;
+END latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW PACKAGE STATUS WHERE name="pk";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db pk PACKAGE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+ROUTINE_NAME ROUTINE_TYPE ROUTINE_DEFINITION
+pk PACKAGE AS
+FUNCTION pkf() RETURN INT;
+PROCEDURE pkp();
+END
+pk PACKAGE BODY AS
+pkv INT:=1;
+PROCEDURE pkhp() AS
+BEGIN
+SELECT pkv FROM DUAL;
+END;
+FUNCTION pkhf() RETURN INT AS
+BEGIN
+RETURN pkv;
+END;
+PROCEDURE pkp() AS
+BEGIN
+CALL pkhp();
+END;
+FUNCTION pkf() RETURN INT AS
+BEGIN
+RETURN pkhf();
+END;
+BEGIN
+pkv:=2;
+END
+use test;
+###
+### Pre-"SHOW-CREATE-ROUTINE" behaviour tests
+###
+#
+### Rights on mysql.proc
+#
+create user user@localhost;
+grant all privileges on mysql.* to user@localhost;
+grant all privileges on test.* to user@localhost;
+connect conn1, localhost, user, , test;
+show create procedure test_db.sp;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+sp STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `sp`()
+select 1 latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW PROCEDURE STATUS WHERE name="sp";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db sp PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME from information_schema.ROUTINES where ROUTINE_NAME="sp";
+ROUTINE_NAME
+sp
+show create function test_db.fn;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+fn STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `fn`() RETURNS int(11)
+RETURN 1 latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW FUNCTION STATUS WHERE name="fn";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db fn FUNCTION root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where
+ROUTINE_NAME="fn";
+ROUTINE_NAME ROUTINE_DEFINITION
+fn RETURN 1
+show create package test_db.pk;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pk PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" PACKAGE "pk" AS
+FUNCTION pkf() RETURN INT;
+PROCEDURE pkp();
+END latin1 latin1_swedish_ci latin1_swedish_ci
+show create package body test_db.pk;
+Package body sql_mode Create Package Body character_set_client collation_connection Database Collation
+pk PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" PACKAGE BODY "pk" AS
+pkv INT:=1;
+PROCEDURE pkhp() AS
+BEGIN
+SELECT pkv FROM DUAL;
+END;
+FUNCTION pkhf() RETURN INT AS
+BEGIN
+RETURN pkv;
+END;
+PROCEDURE pkp() AS
+BEGIN
+CALL pkhp();
+END;
+FUNCTION pkf() RETURN INT AS
+BEGIN
+RETURN pkhf();
+END;
+BEGIN
+pkv:=2;
+END latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW PACKAGE STATUS WHERE name="pk";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db pk PACKAGE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+ROUTINE_NAME ROUTINE_TYPE ROUTINE_DEFINITION
+pk PACKAGE AS
+FUNCTION pkf() RETURN INT;
+PROCEDURE pkp();
+END
+pk PACKAGE BODY AS
+pkv INT:=1;
+PROCEDURE pkhp() AS
+BEGIN
+SELECT pkv FROM DUAL;
+END;
+FUNCTION pkhf() RETURN INT AS
+BEGIN
+RETURN pkv;
+END;
+PROCEDURE pkp() AS
+BEGIN
+CALL pkhp();
+END;
+FUNCTION pkf() RETURN INT AS
+BEGIN
+RETURN pkhf();
+END;
+BEGIN
+pkv:=2;
+END
+connection default;
+disconnect conn1;
+revoke all privileges on mysql.* from user@localhost;
+#
+### No privileges
+#
+connect conn1, localhost, user, , test;
+show create procedure test_db.sp;
+ERROR 42000: PROCEDURE sp does not exist
+SHOW PROCEDURE STATUS WHERE name="sp";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+SELECT ROUTINE_NAME from information_schema.ROUTINES where ROUTINE_NAME="sp";
+ROUTINE_NAME
+show create function test_db.fn;
+ERROR 42000: FUNCTION fn does not exist
+SHOW FUNCTION STATUS WHERE name="fn";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where
+ROUTINE_NAME="fn";
+ROUTINE_NAME ROUTINE_DEFINITION
+show create package test_db.pk;
+ERROR 42000: PACKAGE pk does not exist
+show create package body test_db.pk;
+ERROR 42000: PACKAGE BODY pk does not exist
+SHOW PACKAGE STATUS WHERE name="pk";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+ROUTINE_NAME ROUTINE_TYPE ROUTINE_DEFINITION
+connection default;
+disconnect conn1;
+#
+### Execute provilege PROCEDURE/FUNCTION
+#
+grant execute on procedure test_db.sp to user@localhost;
+grant execute on function test_db.fn to user@localhost;
+connect conn1, localhost, user, , test;
+show create procedure test_db.sp;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+sp STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION NULL latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW PROCEDURE STATUS WHERE name="sp";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db sp PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME from information_schema.ROUTINES where ROUTINE_NAME="sp";
+ROUTINE_NAME
+sp
+call test_db.sp();
+1
+1
+show create function test_db.fn;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+fn STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION NULL latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW FUNCTION STATUS WHERE name="fn";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db fn FUNCTION root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where
+ROUTINE_NAME="fn";
+ROUTINE_NAME ROUTINE_DEFINITION
+fn NULL
+select test_db.fn();
+test_db.fn()
+1
+connection default;
+disconnect conn1;
+revoke execute on procedure test_db.sp from user@localhost;
+revoke execute on function test_db.fn from user@localhost;
+#
+### Execute provilege PACKAGE+ PACKAGE BODY-
+#
+SET sql_mode=ORACLE;
+grant execute on package test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+connect conn1, localhost, user, , test;
+show create package test_db.pk;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pk PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT NULL latin1 latin1_swedish_ci latin1_swedish_ci
+show create package body test_db.pk;
+ERROR 42000: PACKAGE BODY pk does not exist
+SHOW PACKAGE STATUS WHERE name="pk";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db pk PACKAGE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+ROUTINE_NAME ROUTINE_TYPE ROUTINE_DEFINITION
+pk PACKAGE NULL
+call test_db.pk.pkp();
+ERROR 42000: execute command denied to user 'user'@'localhost' for routine 'test_db.pk'
+select test_db.pk.pkf();
+ERROR 42000: execute command denied to user 'user'@'localhost' for routine 'test_db.pk'
+connection default;
+disconnect conn1;
+SET sql_mode=ORACLE;
+revoke execute on package test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+#
+### Execute provilege PACKAGE- PACKAGE BODY+
+#
+SET sql_mode=ORACLE;
+grant execute on package body test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+connect conn1, localhost, user, , test;
+show create package test_db.pk;
+ERROR 42000: PACKAGE pk does not exist
+show create package body test_db.pk;
+Package body sql_mode Create Package Body character_set_client collation_connection Database Collation
+pk PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT NULL latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW PACKAGE STATUS WHERE name="pk";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+ROUTINE_NAME ROUTINE_TYPE ROUTINE_DEFINITION
+pk PACKAGE BODY NULL
+call test_db.pk.pkp();
+pkv
+2
+select test_db.pk.pkf();
+test_db.pk.pkf()
+2
+connection default;
+disconnect conn1;
+SET sql_mode=ORACLE;
+revoke execute on package body test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+#
+### Alter routine provilege PROCEDURE/FUNCTION
+#
+grant alter routine on procedure test_db.sp to user@localhost;
+grant alter routine on function test_db.fn to user@localhost;
+connect conn1, localhost, user, , test;
+show create procedure test_db.sp;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+sp STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION NULL latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW PROCEDURE STATUS WHERE name="sp";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db sp PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME from information_schema.ROUTINES where ROUTINE_NAME="sp";
+ROUTINE_NAME
+sp
+show create function test_db.fn;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+fn STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION NULL latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW FUNCTION STATUS WHERE name="fn";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db fn FUNCTION root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where
+ROUTINE_NAME="fn";
+ROUTINE_NAME ROUTINE_DEFINITION
+fn NULL
+connection default;
+disconnect conn1;
+revoke alter routine on procedure test_db.sp from user@localhost;
+revoke alter routine on function test_db.fn from user@localhost;
+#
+### Alter routine provilege PACKAGE+ PACKAGE BODY-
+#
+SET sql_mode=ORACLE;
+grant alter routine on package test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+connect conn1, localhost, user, , test;
+show create package test_db.pk;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pk PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT NULL latin1 latin1_swedish_ci latin1_swedish_ci
+show create package body test_db.pk;
+ERROR 42000: PACKAGE BODY pk does not exist
+SHOW PACKAGE STATUS WHERE name="pk";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db pk PACKAGE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+ROUTINE_NAME ROUTINE_TYPE ROUTINE_DEFINITION
+pk PACKAGE NULL
+connection default;
+disconnect conn1;
+SET sql_mode=ORACLE;
+revoke alter routine on package test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+#
+### Alter routine provilege PACKAGE+ PACKAGE BODY-
+#
+SET sql_mode=ORACLE;
+grant alter routine on package body test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+connect conn1, localhost, user, , test;
+show create package test_db.pk;
+ERROR 42000: PACKAGE pk does not exist
+show create package body test_db.pk;
+Package body sql_mode Create Package Body character_set_client collation_connection Database Collation
+pk PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT NULL latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW PACKAGE STATUS WHERE name="pk";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+ROUTINE_NAME ROUTINE_TYPE ROUTINE_DEFINITION
+pk PACKAGE BODY NULL
+connection default;
+disconnect conn1;
+SET sql_mode=ORACLE;
+revoke alter routine on package body test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+###
+### SHOW CREATE PROCEDURE tests
+###
+#
+### Global "show create routine" test
+#
+grant show create routine on *.* to user@localhost;
+show grants for user@localhost;
+Grants for user@localhost
+GRANT SHOW CREATE ROUTINE ON *.* TO `user`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `user`@`localhost`
+connect conn1, localhost, user, , test;
+show create procedure test_db.sp;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+sp STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `sp`()
+select 1 latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW PROCEDURE STATUS WHERE name="sp";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db sp PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="sp";
+ROUTINE_NAME ROUTINE_DEFINITION
+sp select 1
+show create function test_db.fn;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+fn STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `fn`() RETURNS int(11)
+RETURN 1 latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW FUNCTION STATUS WHERE name="fn";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db fn FUNCTION root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="fn";
+ROUTINE_NAME ROUTINE_DEFINITION
+fn RETURN 1
+show create package test_db.pk;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pk PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" PACKAGE "pk" AS
+FUNCTION pkf() RETURN INT;
+PROCEDURE pkp();
+END latin1 latin1_swedish_ci latin1_swedish_ci
+show create package body test_db.pk;
+Package body sql_mode Create Package Body character_set_client collation_connection Database Collation
+pk PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" PACKAGE BODY "pk" AS
+pkv INT:=1;
+PROCEDURE pkhp() AS
+BEGIN
+SELECT pkv FROM DUAL;
+END;
+FUNCTION pkhf() RETURN INT AS
+BEGIN
+RETURN pkv;
+END;
+PROCEDURE pkp() AS
+BEGIN
+CALL pkhp();
+END;
+FUNCTION pkf() RETURN INT AS
+BEGIN
+RETURN pkhf();
+END;
+BEGIN
+pkv:=2;
+END latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW PACKAGE STATUS WHERE name="pk";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db pk PACKAGE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+ROUTINE_NAME ROUTINE_TYPE ROUTINE_DEFINITION
+pk PACKAGE AS
+FUNCTION pkf() RETURN INT;
+PROCEDURE pkp();
+END
+pk PACKAGE BODY AS
+pkv INT:=1;
+PROCEDURE pkhp() AS
+BEGIN
+SELECT pkv FROM DUAL;
+END;
+FUNCTION pkhf() RETURN INT AS
+BEGIN
+RETURN pkv;
+END;
+PROCEDURE pkp() AS
+BEGIN
+CALL pkhp();
+END;
+FUNCTION pkf() RETURN INT AS
+BEGIN
+RETURN pkhf();
+END;
+BEGIN
+pkv:=2;
+END
+connection default;
+disconnect conn1;
+revoke show create routine on *.* from user@localhost;
+#
+### DB-level "show create routine" but other DB test
+#
+grant show create routine on db_test.* to user@localhost;
+show grants for user@localhost;
+Grants for user@localhost
+GRANT USAGE ON *.* TO `user`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `user`@`localhost`
+GRANT SHOW CREATE ROUTINE ON `db_test`.* TO `user`@`localhost`
+connect conn1, localhost, user, , test;
+show create procedure test_db.sp;
+ERROR 42000: PROCEDURE sp does not exist
+SHOW PROCEDURE STATUS WHERE name="sp";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="sp";
+ROUTINE_NAME ROUTINE_DEFINITION
+show create function test_db.fn;
+ERROR 42000: FUNCTION fn does not exist
+SHOW FUNCTION STATUS WHERE name="fn";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="fn";
+ROUTINE_NAME ROUTINE_DEFINITION
+show create package test_db.pk;
+ERROR 42000: PACKAGE pk does not exist
+show create package body test_db.pk;
+ERROR 42000: PACKAGE BODY pk does not exist
+SHOW PACKAGE STATUS WHERE name="pk";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+ROUTINE_NAME ROUTINE_TYPE ROUTINE_DEFINITION
+connection default;
+disconnect conn1;
+revoke show create routine on db_test.* from user@localhost;
+#
+### DB-level "show create routine" test
+#
+grant show create routine on test_db.* to user@localhost;
+show grants for user@localhost;
+Grants for user@localhost
+GRANT USAGE ON *.* TO `user`@`localhost`
+GRANT ALL PRIVILEGES ON `test`.* TO `user`@`localhost`
+GRANT SHOW CREATE ROUTINE ON `test_db`.* TO `user`@`localhost`
+connect conn1, localhost, user, , test;
+show create procedure test_db.sp;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+sp STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `sp`()
+select 1 latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW PROCEDURE STATUS WHERE name="sp";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db sp PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="sp";
+ROUTINE_NAME ROUTINE_DEFINITION
+sp select 1
+show create function test_db.fn;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+fn STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `fn`() RETURNS int(11)
+RETURN 1 latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW FUNCTION STATUS WHERE name="fn";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db fn FUNCTION root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="fn";
+ROUTINE_NAME ROUTINE_DEFINITION
+fn RETURN 1
+show create package test_db.pk;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pk PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" PACKAGE "pk" AS
+FUNCTION pkf() RETURN INT;
+PROCEDURE pkp();
+END latin1 latin1_swedish_ci latin1_swedish_ci
+show create package body test_db.pk;
+Package body sql_mode Create Package Body character_set_client collation_connection Database Collation
+pk PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" PACKAGE BODY "pk" AS
+pkv INT:=1;
+PROCEDURE pkhp() AS
+BEGIN
+SELECT pkv FROM DUAL;
+END;
+FUNCTION pkhf() RETURN INT AS
+BEGIN
+RETURN pkv;
+END;
+PROCEDURE pkp() AS
+BEGIN
+CALL pkhp();
+END;
+FUNCTION pkf() RETURN INT AS
+BEGIN
+RETURN pkhf();
+END;
+BEGIN
+pkv:=2;
+END latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW PACKAGE STATUS WHERE name="pk";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db pk PACKAGE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+ROUTINE_NAME ROUTINE_TYPE ROUTINE_DEFINITION
+pk PACKAGE AS
+FUNCTION pkf() RETURN INT;
+PROCEDURE pkp();
+END
+pk PACKAGE BODY AS
+pkv INT:=1;
+PROCEDURE pkhp() AS
+BEGIN
+SELECT pkv FROM DUAL;
+END;
+FUNCTION pkhf() RETURN INT AS
+BEGIN
+RETURN pkv;
+END;
+PROCEDURE pkp() AS
+BEGIN
+CALL pkhp();
+END;
+FUNCTION pkf() RETURN INT AS
+BEGIN
+RETURN pkhf();
+END;
+BEGIN
+pkv:=2;
+END
+connection default;
+disconnect conn1;
+revoke show create routine on test_db.* from user@localhost;
+#
+### Routine-level "show create routine" PROCEDURE and FUNCTION
+#
+grant show create routine on procedure test_db.sp to user@localhost;
+grant show create routine on function test_db.fn to user@localhost;
+connect conn1, localhost, user, , test;
+show create procedure test_db.sp;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+sp STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `sp`()
+select 1 latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW PROCEDURE STATUS WHERE name="sp";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db sp PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="sp";
+ROUTINE_NAME ROUTINE_DEFINITION
+sp select 1
+call test_db.sp();
+ERROR 42000: execute command denied to user 'user'@'localhost' for routine 'test_db.sp'
+show create function test_db.fn;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+fn STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `fn`() RETURNS int(11)
+RETURN 1 latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW FUNCTION STATUS WHERE name="fn";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db fn FUNCTION root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where
+ROUTINE_NAME="fn";
+ROUTINE_NAME ROUTINE_DEFINITION
+fn RETURN 1
+select test_db.fn();
+ERROR 42000: execute command denied to user 'user'@'localhost' for routine 'test_db.fn'
+connection default;
+disconnect conn1;
+revoke show create routine on procedure test_db.sp from user@localhost;
+revoke show create routine on function test_db.fn from user@localhost;
+#
+### Routine-level "show create routine" PACKAGE+ PACKAGE BODY-
+#
+SET sql_mode=ORACLE;
+grant show create routine on package test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+connect conn1, localhost, user, , test;
+show create package test_db.pk;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pk PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" PACKAGE "pk" AS
+FUNCTION pkf() RETURN INT;
+PROCEDURE pkp();
+END latin1 latin1_swedish_ci latin1_swedish_ci
+show create package body test_db.pk;
+ERROR 42000: PACKAGE BODY pk does not exist
+SHOW PACKAGE STATUS WHERE name="pk";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db pk PACKAGE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+ROUTINE_NAME ROUTINE_TYPE ROUTINE_DEFINITION
+pk PACKAGE AS
+FUNCTION pkf() RETURN INT;
+PROCEDURE pkp();
+END
+call test_db.pk.pkp();
+ERROR 42000: execute command denied to user 'user'@'localhost' for routine 'test_db.pk'
+select test_db.pk.pkf();
+ERROR 42000: execute command denied to user 'user'@'localhost' for routine 'test_db.pk'
+connection default;
+disconnect conn1;
+SET sql_mode=ORACLE;
+revoke show create routine on package test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+#
+### Routine-level "show create routine" PACKAGE- PACKAGE BODY+
+#
+SET sql_mode=ORACLE;
+grant show create routine on package body test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+connect conn1, localhost, user, , test;
+show create package test_db.pk;
+ERROR 42000: PACKAGE pk does not exist
+show create package body test_db.pk;
+Package body sql_mode Create Package Body character_set_client collation_connection Database Collation
+pk PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="root"@"localhost" PACKAGE BODY "pk" AS
+pkv INT:=1;
+PROCEDURE pkhp() AS
+BEGIN
+SELECT pkv FROM DUAL;
+END;
+FUNCTION pkhf() RETURN INT AS
+BEGIN
+RETURN pkv;
+END;
+PROCEDURE pkp() AS
+BEGIN
+CALL pkhp();
+END;
+FUNCTION pkf() RETURN INT AS
+BEGIN
+RETURN pkhf();
+END;
+BEGIN
+pkv:=2;
+END latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW PACKAGE STATUS WHERE name="pk";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+ROUTINE_NAME ROUTINE_TYPE ROUTINE_DEFINITION
+pk PACKAGE BODY AS
+pkv INT:=1;
+PROCEDURE pkhp() AS
+BEGIN
+SELECT pkv FROM DUAL;
+END;
+FUNCTION pkhf() RETURN INT AS
+BEGIN
+RETURN pkv;
+END;
+PROCEDURE pkp() AS
+BEGIN
+CALL pkhp();
+END;
+FUNCTION pkf() RETURN INT AS
+BEGIN
+RETURN pkhf();
+END;
+BEGIN
+pkv:=2;
+END
+call test_db.pk.pkp();
+ERROR 42000: execute command denied to user 'user'@'localhost' for routine 'test_db.pk'
+select test_db.pk.pkf();
+ERROR 42000: execute command denied to user 'user'@'localhost' for routine 'test_db.pk'
+connection default;
+disconnect conn1;
+SET sql_mode=ORACLE;
+revoke show create routine on package body test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+drop user user@localhost;
+drop database test_db;
+#
+### Check owner only rights
+#
+create user user@localhost;
+create database test_db;
+use test_db;
+create definer=user@localhost procedure test_db.sp() select 1;
+CREATE definer=user@localhost FUNCTION test_db.fn() RETURNS INT RETURN 1;
+SET sql_mode=ORACLE;
+CREATE definer=user@localhost PACKAGE test_db.pk AS
+FUNCTION pkf() RETURN INT;
+PROCEDURE pkp();
+END;
+$$
+CREATE definer=user@localhost PACKAGE BODY test_db.pk AS
+pkv INT:=1;
+PROCEDURE pkhp() AS
+BEGIN
+SELECT pkv FROM DUAL;
+END;
+FUNCTION pkhf() RETURN INT AS
+BEGIN
+RETURN pkv;
+END;
+PROCEDURE pkp() AS
+BEGIN
+CALL pkhp();
+END;
+FUNCTION pkf() RETURN INT AS
+BEGIN
+RETURN pkhf();
+END;
+BEGIN
+pkv:=2;
+END;
+$$
+use test;
+connect conn1, localhost, user, , "*NO-ONE*";
+show create procedure test_db.sp;
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+sp STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user`@`localhost` PROCEDURE `sp`()
+select 1 latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW PROCEDURE STATUS WHERE name="sp";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db sp PROCEDURE user@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME from information_schema.ROUTINES where ROUTINE_NAME="sp";
+ROUTINE_NAME
+sp
+show create function test_db.fn;
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+fn STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user`@`localhost` FUNCTION `fn`() RETURNS int(11)
+RETURN 1 latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW FUNCTION STATUS WHERE name="fn";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db fn FUNCTION user@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where
+ROUTINE_NAME="fn";
+ROUTINE_NAME ROUTINE_DEFINITION
+fn RETURN 1
+show create package test_db.pk;
+Package sql_mode Create Package character_set_client collation_connection Database Collation
+pk PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="user"@"localhost" PACKAGE "pk" AS
+FUNCTION pkf() RETURN INT;
+PROCEDURE pkp();
+END latin1 latin1_swedish_ci latin1_swedish_ci
+show create package body test_db.pk;
+Package body sql_mode Create Package Body character_set_client collation_connection Database Collation
+pk PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT CREATE DEFINER="user"@"localhost" PACKAGE BODY "pk" AS
+pkv INT:=1;
+PROCEDURE pkhp() AS
+BEGIN
+SELECT pkv FROM DUAL;
+END;
+FUNCTION pkhf() RETURN INT AS
+BEGIN
+RETURN pkv;
+END;
+PROCEDURE pkp() AS
+BEGIN
+CALL pkhp();
+END;
+FUNCTION pkf() RETURN INT AS
+BEGIN
+RETURN pkhf();
+END;
+BEGIN
+pkv:=2;
+END latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW PACKAGE STATUS WHERE name="pk";
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test_db pk PACKAGE user@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+ROUTINE_NAME ROUTINE_TYPE ROUTINE_DEFINITION
+pk PACKAGE AS
+FUNCTION pkf() RETURN INT;
+PROCEDURE pkp();
+END
+pk PACKAGE BODY AS
+pkv INT:=1;
+PROCEDURE pkhp() AS
+BEGIN
+SELECT pkv FROM DUAL;
+END;
+FUNCTION pkhf() RETURN INT AS
+BEGIN
+RETURN pkv;
+END;
+PROCEDURE pkp() AS
+BEGIN
+CALL pkhp();
+END;
+FUNCTION pkf() RETURN INT AS
+BEGIN
+RETURN pkhf();
+END;
+BEGIN
+pkv:=2;
+END
+connection default;
+disconnect conn1;
+drop user user@localhost;
+drop database test_db;
+#
+# End of 11.3 tests
+#
diff --git a/mysql-test/main/sp-security.test b/mysql-test/main/sp-security.test
index 85f21835..af9ba61d 100644
--- a/mysql-test/main/sp-security.test
+++ b/mysql-test/main/sp-security.test
@@ -1123,3 +1123,557 @@ drop function f;
--echo #
--echo # End of 10.6 tests
--echo #
+
+--echo #
+--echo # MDEV-29167: new db-level SHOW CREATE ROUTINE privilege
+--echo #
+
+--echo ###
+--echo ### SHOW-Like commad test
+--echo ###
+
+SET @save_sql_mode=@@sql_mode;
+
+--echo #
+--echo ### Prepare functions for the test and SHOW-like by root
+--echo #
+
+create database test_db;
+use test_db;
+create procedure test_db.sp() select 1;
+show create procedure test_db.sp;
+--replace_column 5 # 6 #
+SHOW PROCEDURE STATUS WHERE name="sp";
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="sp";
+CREATE FUNCTION test_db.fn() RETURNS INT RETURN 1;
+show create function test_db.fn;
+--replace_column 5 # 6 #
+SHOW FUNCTION STATUS WHERE name="fn";
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="fn";
+
+SET sql_mode=ORACLE;
+DELIMITER $$;
+CREATE PACKAGE test_db.pk AS
+ FUNCTION pkf() RETURN INT;
+ PROCEDURE pkp();
+END;
+$$
+CREATE PACKAGE BODY test_db.pk AS
+ pkv INT:=1;
+
+ PROCEDURE pkhp() AS
+ BEGIN
+ SELECT pkv FROM DUAL;
+ END;
+
+ FUNCTION pkhf() RETURN INT AS
+ BEGIN
+ RETURN pkv;
+ END;
+
+ PROCEDURE pkp() AS
+ BEGIN
+ CALL pkhp();
+ END;
+ FUNCTION pkf() RETURN INT AS
+ BEGIN
+ RETURN pkhf();
+ END;
+
+BEGIN
+ pkv:=2;
+END;
+$$
+DELIMITER ;$$
+
+SET sql_mode=@save_sql_mode;
+show create package test_db.pk;
+show create package body test_db.pk;
+--replace_column 5 # 6 #
+SHOW PACKAGE STATUS WHERE name="pk";
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+
+
+use test;
+
+
+--echo ###
+--echo ### Pre-"SHOW-CREATE-ROUTINE" behaviour tests
+--echo ###
+
+
+--echo #
+--echo ### Rights on mysql.proc
+--echo #
+
+create user user@localhost;
+grant all privileges on mysql.* to user@localhost;
+grant all privileges on test.* to user@localhost;
+
+connect conn1, localhost, user, , test;
+
+show create procedure test_db.sp;
+--replace_column 5 # 6 #
+SHOW PROCEDURE STATUS WHERE name="sp";
+SELECT ROUTINE_NAME from information_schema.ROUTINES where ROUTINE_NAME="sp";
+show create function test_db.fn;
+--replace_column 5 # 6 #
+SHOW FUNCTION STATUS WHERE name="fn";
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where
+ROUTINE_NAME="fn";
+show create package test_db.pk;
+show create package body test_db.pk;
+--replace_column 5 # 6 #
+SHOW PACKAGE STATUS WHERE name="pk";
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+
+connection default;
+disconnect conn1;
+
+revoke all privileges on mysql.* from user@localhost;
+
+
+--echo #
+--echo ### No privileges
+--echo #
+
+connect conn1, localhost, user, , test;
+
+--error ER_SP_DOES_NOT_EXIST
+show create procedure test_db.sp;
+--replace_column 5 # 6 #
+SHOW PROCEDURE STATUS WHERE name="sp";
+SELECT ROUTINE_NAME from information_schema.ROUTINES where ROUTINE_NAME="sp";
+--error ER_SP_DOES_NOT_EXIST
+show create function test_db.fn;
+--replace_column 5 # 6 #
+SHOW FUNCTION STATUS WHERE name="fn";
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where
+ROUTINE_NAME="fn";
+--error ER_SP_DOES_NOT_EXIST
+show create package test_db.pk;
+--error ER_SP_DOES_NOT_EXIST
+show create package body test_db.pk;
+--replace_column 5 # 6 #
+SHOW PACKAGE STATUS WHERE name="pk";
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+
+connection default;
+disconnect conn1;
+
+--echo #
+--echo ### Execute provilege PROCEDURE/FUNCTION
+--echo #
+
+grant execute on procedure test_db.sp to user@localhost;
+grant execute on function test_db.fn to user@localhost;
+
+connect conn1, localhost, user, , test;
+
+show create procedure test_db.sp;
+--replace_column 5 # 6 #
+SHOW PROCEDURE STATUS WHERE name="sp";
+SELECT ROUTINE_NAME from information_schema.ROUTINES where ROUTINE_NAME="sp";
+call test_db.sp();
+show create function test_db.fn;
+--replace_column 5 # 6 #
+SHOW FUNCTION STATUS WHERE name="fn";
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where
+ROUTINE_NAME="fn";
+select test_db.fn();
+
+connection default;
+disconnect conn1;
+
+revoke execute on procedure test_db.sp from user@localhost;
+revoke execute on function test_db.fn from user@localhost;
+
+--echo #
+--echo ### Execute provilege PACKAGE+ PACKAGE BODY-
+--echo #
+
+SET sql_mode=ORACLE;
+grant execute on package test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+
+connect conn1, localhost, user, , test;
+
+show create package test_db.pk;
+--error ER_SP_DOES_NOT_EXIST
+show create package body test_db.pk;
+--replace_column 5 # 6 #
+SHOW PACKAGE STATUS WHERE name="pk";
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+--error ER_PROCACCESS_DENIED_ERROR
+call test_db.pk.pkp();
+--error ER_PROCACCESS_DENIED_ERROR
+select test_db.pk.pkf();
+
+connection default;
+disconnect conn1;
+
+SET sql_mode=ORACLE;
+revoke execute on package test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+
+
+--echo #
+--echo ### Execute provilege PACKAGE- PACKAGE BODY+
+--echo #
+
+SET sql_mode=ORACLE;
+grant execute on package body test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+
+connect conn1, localhost, user, , test;
+
+--error ER_SP_DOES_NOT_EXIST
+show create package test_db.pk;
+show create package body test_db.pk;
+--replace_column 5 # 6 #
+SHOW PACKAGE STATUS WHERE name="pk";
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+call test_db.pk.pkp();
+select test_db.pk.pkf();
+
+connection default;
+disconnect conn1;
+
+SET sql_mode=ORACLE;
+revoke execute on package body test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+
+--echo #
+--echo ### Alter routine provilege PROCEDURE/FUNCTION
+--echo #
+
+grant alter routine on procedure test_db.sp to user@localhost;
+grant alter routine on function test_db.fn to user@localhost;
+
+connect conn1, localhost, user, , test;
+
+show create procedure test_db.sp;
+--replace_column 5 # 6 #
+SHOW PROCEDURE STATUS WHERE name="sp";
+SELECT ROUTINE_NAME from information_schema.ROUTINES where ROUTINE_NAME="sp";
+show create function test_db.fn;
+--replace_column 5 # 6 #
+SHOW FUNCTION STATUS WHERE name="fn";
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where
+ROUTINE_NAME="fn";
+
+connection default;
+disconnect conn1;
+
+
+revoke alter routine on procedure test_db.sp from user@localhost;
+revoke alter routine on function test_db.fn from user@localhost;
+
+--echo #
+--echo ### Alter routine provilege PACKAGE+ PACKAGE BODY-
+--echo #
+
+SET sql_mode=ORACLE;
+grant alter routine on package test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+
+connect conn1, localhost, user, , test;
+
+show create package test_db.pk;
+--error ER_SP_DOES_NOT_EXIST
+show create package body test_db.pk;
+--replace_column 5 # 6 #
+SHOW PACKAGE STATUS WHERE name="pk";
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+
+connection default;
+disconnect conn1;
+
+SET sql_mode=ORACLE;
+revoke alter routine on package test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+
+
+--echo #
+--echo ### Alter routine provilege PACKAGE+ PACKAGE BODY-
+--echo #
+
+SET sql_mode=ORACLE;
+grant alter routine on package body test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+
+connect conn1, localhost, user, , test;
+
+--error ER_SP_DOES_NOT_EXIST
+show create package test_db.pk;
+show create package body test_db.pk;
+--replace_column 5 # 6 #
+SHOW PACKAGE STATUS WHERE name="pk";
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+
+connection default;
+disconnect conn1;
+
+SET sql_mode=ORACLE;
+revoke alter routine on package body test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+
+
+--echo ###
+--echo ### SHOW CREATE PROCEDURE tests
+--echo ###
+
+
+--echo #
+--echo ### Global "show create routine" test
+--echo #
+
+grant show create routine on *.* to user@localhost;
+show grants for user@localhost;
+
+connect conn1, localhost, user, , test;
+
+show create procedure test_db.sp;
+--replace_column 5 # 6 #
+SHOW PROCEDURE STATUS WHERE name="sp";
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="sp";
+show create function test_db.fn;
+--replace_column 5 # 6 #
+SHOW FUNCTION STATUS WHERE name="fn";
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="fn";
+show create package test_db.pk;
+show create package body test_db.pk;
+--replace_column 5 # 6 #
+SHOW PACKAGE STATUS WHERE name="pk";
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+
+connection default;
+disconnect conn1;
+
+revoke show create routine on *.* from user@localhost;
+
+--echo #
+--echo ### DB-level "show create routine" but other DB test
+--echo #
+
+grant show create routine on db_test.* to user@localhost;
+show grants for user@localhost;
+
+connect conn1, localhost, user, , test;
+
+--error ER_SP_DOES_NOT_EXIST
+show create procedure test_db.sp;
+--replace_column 5 # 6 #
+SHOW PROCEDURE STATUS WHERE name="sp";
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="sp";
+--error ER_SP_DOES_NOT_EXIST
+show create function test_db.fn;
+--replace_column 5 # 6 #
+SHOW FUNCTION STATUS WHERE name="fn";
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="fn";
+--error ER_SP_DOES_NOT_EXIST
+show create package test_db.pk;
+--error ER_SP_DOES_NOT_EXIST
+show create package body test_db.pk;
+--replace_column 5 # 6 #
+SHOW PACKAGE STATUS WHERE name="pk";
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+
+connection default;
+disconnect conn1;
+
+revoke show create routine on db_test.* from user@localhost;
+
+--echo #
+--echo ### DB-level "show create routine" test
+--echo #
+
+grant show create routine on test_db.* to user@localhost;
+show grants for user@localhost;
+
+connect conn1, localhost, user, , test;
+
+show create procedure test_db.sp;
+--replace_column 5 # 6 #
+SHOW PROCEDURE STATUS WHERE name="sp";
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="sp";
+show create function test_db.fn;
+--replace_column 5 # 6 #
+SHOW FUNCTION STATUS WHERE name="fn";
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="fn";
+show create package test_db.pk;
+show create package body test_db.pk;
+--replace_column 5 # 6 #
+SHOW PACKAGE STATUS WHERE name="pk";
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+
+connection default;
+disconnect conn1;
+
+revoke show create routine on test_db.* from user@localhost;
+
+
+--echo #
+--echo ### Routine-level "show create routine" PROCEDURE and FUNCTION
+--echo #
+
+grant show create routine on procedure test_db.sp to user@localhost;
+grant show create routine on function test_db.fn to user@localhost;
+
+connect conn1, localhost, user, , test;
+
+show create procedure test_db.sp;
+--replace_column 5 # 6 #
+SHOW PROCEDURE STATUS WHERE name="sp";
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="sp";
+-- error ER_PROCACCESS_DENIED_ERROR
+call test_db.sp();
+show create function test_db.fn;
+--replace_column 5 # 6 #
+SHOW FUNCTION STATUS WHERE name="fn";
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where
+ROUTINE_NAME="fn";
+-- error ER_PROCACCESS_DENIED_ERROR
+select test_db.fn();
+
+connection default;
+disconnect conn1;
+
+revoke show create routine on procedure test_db.sp from user@localhost;
+revoke show create routine on function test_db.fn from user@localhost;
+
+
+--echo #
+--echo ### Routine-level "show create routine" PACKAGE+ PACKAGE BODY-
+--echo #
+
+SET sql_mode=ORACLE;
+grant show create routine on package test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+
+connect conn1, localhost, user, , test;
+
+show create package test_db.pk;
+--error ER_SP_DOES_NOT_EXIST
+show create package body test_db.pk;
+--replace_column 5 # 6 #
+SHOW PACKAGE STATUS WHERE name="pk";
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+--error ER_PROCACCESS_DENIED_ERROR
+call test_db.pk.pkp();
+--error ER_PROCACCESS_DENIED_ERROR
+select test_db.pk.pkf();
+
+connection default;
+disconnect conn1;
+
+SET sql_mode=ORACLE;
+revoke show create routine on package test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+
+
+--echo #
+--echo ### Routine-level "show create routine" PACKAGE- PACKAGE BODY+
+--echo #
+
+SET sql_mode=ORACLE;
+grant show create routine on package body test_db.pk to user@localhost;
+SET sql_mode=@save_sql_mode;
+
+
+connect conn1, localhost, user, , test;
+
+--error ER_SP_DOES_NOT_EXIST
+show create package test_db.pk;
+show create package body test_db.pk;
+--replace_column 5 # 6 #
+SHOW PACKAGE STATUS WHERE name="pk";
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+--error ER_PROCACCESS_DENIED_ERROR
+call test_db.pk.pkp();
+--error ER_PROCACCESS_DENIED_ERROR
+select test_db.pk.pkf();
+
+connection default;
+disconnect conn1;
+
+SET sql_mode=ORACLE;
+revoke show create routine on package body test_db.pk from user@localhost;
+SET sql_mode=@save_sql_mode;
+
+drop user user@localhost;
+drop database test_db;
+
+--echo #
+--echo ### Check owner only rights
+--echo #
+
+create user user@localhost;
+create database test_db;
+use test_db;
+create definer=user@localhost procedure test_db.sp() select 1;
+CREATE definer=user@localhost FUNCTION test_db.fn() RETURNS INT RETURN 1;
+SET sql_mode=ORACLE;
+DELIMITER $$;
+CREATE definer=user@localhost PACKAGE test_db.pk AS
+ FUNCTION pkf() RETURN INT;
+ PROCEDURE pkp();
+END;
+$$
+CREATE definer=user@localhost PACKAGE BODY test_db.pk AS
+ pkv INT:=1;
+
+ PROCEDURE pkhp() AS
+ BEGIN
+ SELECT pkv FROM DUAL;
+ END;
+
+ FUNCTION pkhf() RETURN INT AS
+ BEGIN
+ RETURN pkv;
+ END;
+
+ PROCEDURE pkp() AS
+ BEGIN
+ CALL pkhp();
+ END;
+ FUNCTION pkf() RETURN INT AS
+ BEGIN
+ RETURN pkhf();
+ END;
+
+BEGIN
+ pkv:=2;
+END;
+$$
+DELIMITER ;$$
+
+use test;
+
+
+connect conn1, localhost, user, , "*NO-ONE*";
+
+show create procedure test_db.sp;
+--replace_column 5 # 6 #
+SHOW PROCEDURE STATUS WHERE name="sp";
+SELECT ROUTINE_NAME from information_schema.ROUTINES where ROUTINE_NAME="sp";
+show create function test_db.fn;
+--replace_column 5 # 6 #
+SHOW FUNCTION STATUS WHERE name="fn";
+SELECT ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES where
+ROUTINE_NAME="fn";
+show create package test_db.pk;
+show create package body test_db.pk;
+--replace_column 5 # 6 #
+SHOW PACKAGE STATUS WHERE name="pk";
+SELECT ROUTINE_NAME, ROUTINE_TYPE, ROUTINE_DEFINITION from information_schema.ROUTINES where ROUTINE_NAME="pk";
+
+connection default;
+disconnect conn1;
+
+drop user user@localhost;
+drop database test_db;
+
+--echo #
+--echo # End of 11.3 tests
+--echo #
diff --git a/mysql-test/main/sp.result b/mysql-test/main/sp.result
index 71268c5d..91405e60 100644
--- a/mysql-test/main/sp.result
+++ b/mysql-test/main/sp.result
@@ -320,8 +320,6 @@ repeat(select 1) into outfile 'b2';
insert into test.t1 values (repeat("b2",3), x);
set x = x-1;
until x = 0 end repeat|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
drop procedure b2|
drop procedure if exists c|
create procedure c(x int)
@@ -4283,9 +4281,6 @@ select i as 'A local variable in a nested compound statement takes precedence o
end;
end;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
call bug5967("a - stored procedure parameter")|
a
a - stored procedure parameter
@@ -5779,8 +5774,6 @@ end;
select 1 from no_such_view limit 1 into x;
return x;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create function func_8407_b() returns int
begin
declare x int default 0;
@@ -6782,7 +6775,7 @@ call p1$
a
alter table t1 add b integer$
call p1$
-a
+a b
drop table t1;
drop procedure p1;
# ------------------------------------------------------------------
@@ -7246,12 +7239,12 @@ create table t1 (a int);
insert into t1 (a) values (1), (2), (3), (4), (5);
#
# Do we correctly resolve identifiers in LIMIT?
-# Since DROP and CREATE did not invalidate
-# the SP cache, we can't test until
-# we drop and re-create the procedure.
+# DROP and CREATE results in SP statement recompilation
+# so second execution of the procedure p1() doesn't lead
+# to issuing an error
#
call p1();
-ERROR 42S22: Unknown column 'test.t1.c1' in 'field list'
+a
#
# Drop and recreate the procedure, then repeat
#
diff --git a/mysql-test/main/sp.test b/mysql-test/main/sp.test
index 2bc71bd1..97626570 100644
--- a/mysql-test/main/sp.test
+++ b/mysql-test/main/sp.test
@@ -8715,11 +8715,10 @@ create table t1 (a int);
insert into t1 (a) values (1), (2), (3), (4), (5);
--echo #
--echo # Do we correctly resolve identifiers in LIMIT?
---echo # Since DROP and CREATE did not invalidate
---echo # the SP cache, we can't test until
---echo # we drop and re-create the procedure.
+--echo # DROP and CREATE results in SP statement recompilation
+--echo # so second execution of the procedure p1() doesn't lead
+--echo # to issuing an error
--echo #
---error ER_BAD_FIELD_ERROR
call p1();
--echo #
--echo # Drop and recreate the procedure, then repeat
diff --git a/mysql-test/main/sp_trans.result b/mysql-test/main/sp_trans.result
index d558442a..10256bf4 100644
--- a/mysql-test/main/sp_trans.result
+++ b/mysql-test/main/sp_trans.result
@@ -506,8 +506,6 @@ insert into t3 select a from t3;
select count(*)*255 from t3 into table_size;
until table_size > max_table_size*2 end repeat;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
call bug14210_fill_table()|
drop procedure bug14210_fill_table|
create table t4 like t3|
diff --git a/mysql-test/main/sp_trans_log.result b/mysql-test/main/sp_trans_log.result
index adc9eafc..b72e8332 100644
--- a/mysql-test/main/sp_trans_log.result
+++ b/mysql-test/main/sp_trans_log.result
@@ -11,8 +11,6 @@ insert into t1 values (null);
select count(*) from t1 into @a;
return @a;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
reset master;
insert into t2 values (bug23333(),1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
diff --git a/mysql-test/main/sp_validation.result b/mysql-test/main/sp_validation.result
new file mode 100644
index 00000000..b95e84aa
--- /dev/null
+++ b/mysql-test/main/sp_validation.result
@@ -0,0 +1,1996 @@
+
+#
+# WL#4179: Stored programs: validation of stored program statements.
+#
+
+SET @orig_debug=@@debug_dbug;
+# The test case below demonstrates that meta-data changes are detected
+# by triggers.
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
+CREATE TABLE t1 (a INT, b INT);
+CREATE TABLE t2 (a INT, b INT);
+CREATE TABLE t3 (a INT);
+INSERT INTO t2 VALUES (11, 12), (21, 22);
+CREATE TRIGGER t3_ai AFTER INSERT ON t3 FOR EACH ROW
+INSERT INTO t1 SELECT * FROM t2;
+INSERT INTO t3 (a) VALUES (1);
+SELECT * FROM t1;
+a b
+11 12
+21 22
+SELECT * FROM t2;
+a b
+11 12
+21 22
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+ALTER TABLE t1 ADD COLUMN c INT;
+ALTER TABLE t2 ADD COLUMN c INT;
+INSERT INTO t2 VALUES (31, 32, 33);
+INSERT INTO t3 (a) VALUES (2);
+SELECT * FROM t1;
+a b c
+11 12 NULL
+21 22 NULL
+11 12 NULL
+21 22 NULL
+31 32 33
+SELECT * FROM t2;
+a b c
+11 12 NULL
+21 22 NULL
+31 32 33
+SET @@debug_dbug=@orig_dbug;
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+
+# Check that NEW/OLD rows work within triggers.
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1(a) VALUES (1);
+CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+SET @a = OLD.a;
+SET @b = NEW.a;
+SELECT OLD.a INTO @c;
+SELECT NEW.a INTO @d;
+SET NEW.a = NEW.a * 2;
+END|
+UPDATE t1 SET a = a * 10;
+SELECT @a, @c, @b, @d;
+@a @c @b @d
+1 1 10 10
+SELECT a FROM t1;
+a
+20
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+CREATE PROCEDURE p1()
+SELECT * FROM t1;
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+CALL p1();
+a
+1
+2
+
+# 1.1 Check if added column into table is recognized correctly
+# in a stored procedure.
+ALTER TABLE t1 ADD COLUMN b INT DEFAULT 0;
+CALL p1();
+a b
+1 0
+2 0
+
+# 1.2 Check if dropped column is not appeared in SELECT query
+# executed inside a stored procedure.
+ALTER TABLE t1 DROP COLUMN a;
+CALL p1();
+b
+0
+0
+
+# 1.3 Check if changed column is picked up properly.
+ALTER TABLE t1 CHANGE COLUMN b b VARCHAR(255) DEFAULT 'n/a';
+DELETE FROM t1;
+INSERT INTO t1 VALUES (b), ('hello');
+CALL p1();
+b
+n/a
+hello
+SET @@debug_dbug=@orig_dbug;
+
+# 1.4 Check if table's recreation is handled correctly
+# inside a call of stored procedure.
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+CREATE PROCEDURE p1()
+SELECT * FROM t1;
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+CALL p1();
+a
+1
+2
+DROP TABLE t1;
+CALL p1();
+ERROR 42S02: Table 'test.t1' doesn't exist
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+CALL p1();
+a
+1
+2
+SET @@debug_dbug=@orig_dbug;
+
+# 1.5 Recreate table t1 with another set of columns and
+# re-call a stored procedure.
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+CREATE PROCEDURE p1()
+SELECT * FROM t1;
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+CALL p1();
+a
+1
+2
+DROP TABLE t1;
+CALL p1();
+ERROR 42S02: Table 'test.t1' doesn't exist
+CREATE TABLE t1 (b VARCHAR(10), c VARCHAR(10));
+INSERT INTO t1 VALUES ('a', 'b'), ('c', 'd');
+CALL p1();
+b c
+a b
+c d
+SET @@debug_dbug=@orig_dbug;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+# 2.1 Stored program that uses query like 'SELECT * FROM v' must be
+# re-executed successfully if some columns were added into the view
+# definition by ALTER VIEW;
+CREATE VIEW v1 AS SELECT 1, 2, 3;
+CREATE PROCEDURE p1()
+SELECT * FROM v1;
+CALL p1();
+1 2 3
+1 2 3
+ALTER VIEW v1 AS SELECT 1, 2, 3, 4, 5;
+CALL p1();
+1 2 3 4 5
+1 2 3 4 5
+
+# 2.2 Stored program that uses query like 'SELECT * FROM v' must be
+# re-executed successfully if some columns were removed from the view
+# definition by ALTER VIEW;
+ALTER VIEW v1 AS SELECT 1, 5;
+CALL p1();
+1 5
+1 5
+
+# 2.3 Stored program that uses query like 'SELECT * FROM v' must be
+# re-executed successfully if a base table for the view being used was
+# extended by new columns (by ALTER TABLE);
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+DROP VIEW v1;
+CREATE VIEW v1 AS SELECT * FROM t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1()
+SELECT * FROM v1;
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+CALL p1();
+a b
+1 2
+ALTER TABLE t1 ADD COLUMN c INT DEFAULT 3;
+CALL p1();
+a b
+1 2
+SET @@debug_dbug=@orig_dbug;
+
+# 2.4 Stored program that uses query like 'SELECT * FROM v' must be
+# re-executed successfully if not used columns were removed from the
+# base table of this view (by ALTER TABLE);
+DROP TABLE t1;
+CREATE TABLE t1(a INT, b INT, c INT);
+INSERT INTO t1 VALUES (1, 2, 3);
+DROP VIEW v1;
+CREATE VIEW v1 AS SELECT b, c FROM t1;
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1()
+SELECT * FROM v1;
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+CALL p1();
+b c
+2 3
+ALTER TABLE t1 DROP COLUMN a;
+CALL p1();
+b c
+2 3
+ALTER TABLE t1 DROP COLUMN b;
+CALL p1();
+ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+SET @@debug_dbug=@orig_dbug;
+
+# 2.5 Stored program that uses query like 'SELECT * FROM v' must be
+# re-executed successfully if a type of some base table's columns were
+# changed (by ALTER TABLE);
+DROP TABLE t1;
+CREATE TABLE t1(a INT, b INT, c INT);
+INSERT INTO t1 VALUES (1, 2, 3);
+DROP VIEW v1;
+CREATE VIEW v1 AS SELECT b, c FROM t1;
+DROP PROCEDURE p1;
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+CREATE PROCEDURE p1()
+SELECT * FROM v1;
+CALL p1();
+b c
+2 3
+ALTER TABLE t1 CHANGE COLUMN b b VARCHAR(255) DEFAULT 'n/a';
+DELETE FROM t1;
+INSERT INTO t1(a, c) VALUES (10, 30);
+CALL p1();
+b c
+n/a 30
+SET @@debug_dbug=@orig_dbug;
+
+# 2.6 Stored program that uses query like 'SELECT * FROM v' must be
+# re-executed successfully if the view 'v' was dropped and created again
+# with the same definition;
+#
+# 2.7 Stored program that uses query like 'SELECT * FROM v' must be
+# re-executed successfully if the view 'v' was dropped and created again
+# with different, but compatible definition.
+DROP VIEW v1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+CREATE VIEW v1 AS SELECT 1, 2, 3;
+CREATE PROCEDURE p1()
+SELECT * FROM v1;
+CALL p1();
+1 2 3
+1 2 3
+DROP VIEW v1;
+CALL p1();
+ERROR 42S02: Table 'test.v1' doesn't exist
+CREATE VIEW v1 AS SELECT 4, 5, 6;
+CALL p1();
+4 5 6
+4 5 6
+
+# 2.8 Stored program that uses query like 'SELECT * FROM v' must be
+# re-executed successfully if the view base tables have been re-created
+# using the same or compatible definition.
+DROP VIEW v1;
+DROP PROCEDURE p1;
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE PROCEDURE p1()
+SELECT * FROM v1;
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+CALL p1();
+a b
+1 2
+DROP TABLE t1;
+CALL p1();
+ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+CREATE TABLE t1(a VARCHAR(255), b VARCHAR(255));
+INSERT INTO t1 VALUES ('a', 'b'), ('c', 'd');
+CALL p1();
+a b
+a b
+c d
+SET @@debug_dbug=@orig_dbug;
+DROP VIEW v1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+# 3.1 Stored program that uses query like 'SELECT * FROM t' must be
+# re-executed successfully if some columns were added into temporary table
+# table 't' (by ALTER TABLE);
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CREATE PROCEDURE p1() SELECT * FROM t1;
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+CALL p1();
+a b
+1 2
+ALTER TABLE t1 ADD COLUMN c INT DEFAULT 3;
+CALL p1();
+a b c
+1 2 3
+
+# 3.2 Stored program that uses query like 'SELECT * FROM t' must be
+# re-executed successfully if some columns were removed from temporary
+# table 't' (by ALTER TABLE);
+ALTER TABLE t1 DROP COLUMN a;
+CALL p1();
+b c
+2 3
+
+# 3.3 Stored program that uses query like 'SELECT * FROM t' must be
+# re-executed successfully if a type of some temporary table's columns were
+# changed (by ALTER TABLE);
+ALTER TABLE t1 CHANGE COLUMN b b VARCHAR(255) DEFAULT 'n/a';
+INSERT INTO t1(c) VALUES (4);
+CALL p1();
+b c
+2 3
+n/a 4
+
+# 3.4 Stored program that uses query like 'SELECT * FROM t' must be
+# re-executed successfully if the temporary table 't' was dropped and
+# created again with the same definition;
+#
+# 3.5 Stored program that uses query like 'SELECT * FROM t' must be
+# re-executed successfully if the temporary table 't' was dropped and
+# created again with different, but compatible definition.
+DROP TEMPORARY TABLE t1;
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CALL p1();
+a b
+1 2
+DROP TEMPORARY TABLE t1;
+CREATE TEMPORARY TABLE t1(a VARCHAR(255), b VARCHAR(255), c VARCHAR(255));
+INSERT INTO t1 VALUES ('aa', 'bb', 'cc');
+CALL p1();
+a b c
+aa bb cc
+SET @@debug_dbug=@orig_dbug;
+DROP TEMPORARY TABLE t1;
+DROP PROCEDURE p1;
+
+# 4.1 Stored program must fail when it is re-executed after a table's column
+# that this program is referenced to has been removed;
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CREATE PROCEDURE p1() SELECT a, b FROM t1;
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+CALL p1();
+a b
+1 2
+ALTER TABLE t1 DROP COLUMN b;
+CALL p1();
+ERROR 42S22: Unknown column 'b' in 'field list'
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+# 4.2 Stored program must fail when it is re-executed after a temporary
+# table's column that this program is referenced to has been removed;
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CREATE PROCEDURE p1() SELECT a, b FROM t1;
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+CALL p1();
+a b
+1 2
+ALTER TABLE t1 DROP COLUMN b;
+CALL p1();
+ERROR 42S22: Unknown column 'b' in 'field list'
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+DROP TEMPORARY TABLE t1;
+
+# 4.3 Stored program must fail when it is re-executed after a view's
+# column that this program is referenced to has been removed;
+CREATE VIEW v1 AS SELECT 1 AS a, 2 AS b;
+CREATE PROCEDURE p1() SELECT a, b FROM v1;
+CALL p1();
+a b
+1 2
+ALTER VIEW v1 AS SELECT 1 AS a;
+CALL p1();
+ERROR 42S22: Unknown column 'b' in 'field list'
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+DROP VIEW v1;
+
+# 4.4 Stored program must fail when it is re-executed after a regular table
+# that this program referenced to was removed;
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CREATE PROCEDURE p1() SELECT a, b FROM t1;
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+CALL p1();
+a b
+1 2
+DROP TABLE t1;
+CALL p1();
+ERROR 42S02: Table 'test.t1' doesn't exist
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+
+# 4.5 Stored program must fail when it is re-executed after a view that
+# this program referenced to was removed;
+CREATE VIEW v1 AS SELECT 1 AS a, 2 AS b;
+CREATE PROCEDURE p1() SELECT a, b FROM v1;
+CALL p1();
+a b
+1 2
+DROP VIEW v1;
+CALL p1();
+ERROR 42S02: Table 'test.v1' doesn't exist
+DROP PROCEDURE p1;
+
+# 4.6 Stored program must fail when it is re-executed after a temporary
+# table that this program referenced to was removed;
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CREATE PROCEDURE p1() SELECT a, b FROM t1;
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+CALL p1();
+a b
+1 2
+DROP TABLE t1;
+CALL p1();
+ERROR 42S02: Table 'test.t1' doesn't exist
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+
+# 4.7 Stored program must fail if the program executes some
+# SQL-statement and afterwards re-executes it again when some table 't'
+# referenced by the statement was dropped in the period between statement
+# execution;
+CREATE TABLE t1(a INT);
+CREATE TABLE t2(a INT);
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE CONTINUE HANDLER FOR 1146
+SELECT 'Table t1 does not exist anymore' as msg;
+SELECT * FROM t1;
+INSERT INTO t2 VALUES (1);
+SELECT GET_LOCK('m1', 10000);
+SELECT * FROM t1;
+END|
+
+# -- connection: con1
+connect con1, localhost, root;
+SELECT GET_LOCK('m1', 0);
+GET_LOCK('m1', 0)
+1
+
+# -- connection: default
+connection default;
+CALL p1();
+
+# -- connection: con1
+connection con1;
+DROP TABLE t1;
+SELECT RELEASE_LOCK('m1');
+RELEASE_LOCK('m1')
+1
+
+# -- connection: default
+connection default;
+a
+GET_LOCK('m1', 10000)
+1
+msg
+Table t1 does not exist anymore
+disconnect con1;
+DROP TABLE t2;
+DROP PROCEDURE p1;
+
+# 5.1 Regular table -> View
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CREATE PROCEDURE p1() SELECT * FROM t1;
+CALL p1();
+a b
+1 2
+DROP TABLE t1;
+CREATE VIEW t1 AS SELECT 1 AS a, 2 AS b;
+CALL p1();
+a b
+1 2
+DROP PROCEDURE p1;
+DROP VIEW t1;
+
+# 5.2 Regular table -> Temporary table
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CREATE PROCEDURE p1() SELECT * FROM t1;
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+CALL p1();
+a b
+1 2
+DROP TABLE t1;
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CALL p1();
+a b
+1 2
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+DROP TEMPORARY TABLE t1;
+
+# 5.3 View -> Regular table
+CREATE VIEW t1 AS SELECT 1 AS a, 2 AS b;
+CREATE PROCEDURE p1() SELECT * FROM t1;
+CALL p1();
+a b
+1 2
+DROP VIEW t1;
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CALL p1();
+a b
+1 2
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+# 5.4 View -> Temporary table
+CREATE VIEW t1 AS SELECT 1 AS a, 2 AS b;
+CREATE PROCEDURE p1() SELECT * FROM t1;
+CALL p1();
+a b
+1 2
+DROP VIEW t1;
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CALL p1();
+a b
+1 2
+DROP PROCEDURE p1;
+DROP TEMPORARY TABLE t1;
+
+# 5.5 Temporary table -> View
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CREATE PROCEDURE p1() SELECT * FROM t1;
+CALL p1();
+a b
+1 2
+DROP TEMPORARY TABLE t1;
+CREATE VIEW t1 AS SELECT 1 AS a, 2 AS b;
+CALL p1();
+a b
+1 2
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+DROP VIEW t1;
+
+# 5.6 Temporary table -> Regular table
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CREATE PROCEDURE p1() SELECT * FROM t1;
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+CALL p1();
+a b
+1 2
+DROP TEMPORARY TABLE t1;
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CALL p1();
+a b
+1 2
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+# 6.1 Trigger that uses column 'a' of table 't' via pseudo-variable NEW
+# must be re-executed successfully if the table definition has been changed
+# in a compatible way. "Compatible way" in this case is that if the table
+# 't' still has a column named 'a' and the column type is compatible with
+# the operation that NEW.a takes part of.
+#
+# 6.2 Trigger that uses column 'a' of table 't' via pseudo-variable OLD
+# must be re-executed successfully if the table definition has been changed
+# in a compatible way. "Compatible way" in this case is that if the table
+# 't' still has a column named 'a' and the column type is compatible with
+# the operation that OLD.a takes part of.
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+SET @x = OLD.a;
+SET @y = NEW.a;
+END|
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+SET @x = 0, @y = 0;
+UPDATE t1 SET a = 3, b = 4;
+SELECT @x, @y;
+@x @y
+1 3
+
+ALTER TABLE t1 ADD COLUMN c INT DEFAULT -1;
+
+SET @x = 0, @y = 0;
+UPDATE t1 SET a = 5, b = 6;
+SELECT @x, @y;
+@x @y
+3 5
+
+ALTER TABLE t1 CHANGE COLUMN a a VARCHAR(255);
+
+SET @x = 0, @y = 0;
+UPDATE t1 SET a = CONCAT('xxx_', a), b = 7;
+SELECT @x, @y;
+@x @y
+5 xxx_5
+SET @@debug_dbug=@orig_dbug;
+
+DROP TABLE t1;
+
+# 6.3 Re-execution of a trigger that uses column 'a' of table 't' via
+# pseudo-variable NEW must fail if the table definition has been changed in
+# the way that the column 'a' does not exist anymore.
+#
+# 6.4 Re-execution of a trigger that uses column 'a' of table 't' via
+# pseudo-variable OLD must fail if the table definition has been changed in
+# the way that the column 'a' does not exist anymore.
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+SET @x = OLD.a;
+SET @y = NEW.b;
+END|
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+UPDATE t1 SET a = 3, b = 4;
+
+ALTER TABLE t1 CHANGE COLUMN a a2 INT;
+
+UPDATE t1 SET a2 = 5, b = 6;
+ERROR 42S22: Unknown column 'a' in 'OLD'
+
+ALTER TABLE t1 CHANGE COLUMN a2 a INT;
+ALTER TABLE t1 CHANGE COLUMN b b2 INT;
+
+UPDATE t1 SET a = 5, b2 = 6;
+ERROR 42S22: Unknown column 'b' in 'NEW'
+SET @@debug_dbug=@orig_dbug;
+
+DROP TABLE t1;
+
+# 7.1 Setup:
+# - stored program 'a', which alters regular table 't' in a compatible
+# way;
+# - stored program 'b', which calls 'a' and uses 't' before and after the
+# call;
+# Stored program 'b' must be executed successfully.
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CREATE PROCEDURE p1()
+ALTER TABLE t1 ADD COLUMN c INT DEFAULT 3|
+CREATE PROCEDURE p2()
+BEGIN
+SELECT a, b FROM t1;
+CALL p1();
+SELECT a, b FROM t1;
+END|
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p2();
+a b
+1 2
+a b
+1 2
+
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP TABLE t1;
+
+# 7.2 Setup:
+# - stored program 'a', which alters temporary table 't' in a compatible
+# way;
+# - stored program 'b', which calls 'a' and uses 't' before and after the
+# call;
+# Stored program 'b' must be executed successfully.
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CREATE PROCEDURE p1()
+ALTER TABLE t1 ADD COLUMN c INT DEFAULT 3|
+CREATE PROCEDURE p2()
+BEGIN
+SELECT a, b FROM t1;
+CALL p1();
+SELECT a, b FROM t1;
+END|
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p2();
+a b
+1 2
+a b
+1 2
+
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP TEMPORARY TABLE t1;
+
+# 7.3 Setup:
+# - stored program 'a', which re-creates regular table 't' in a
+# compatible way;
+# - stored program 'b', which calls 'a' and uses 't' before and after the
+# call;
+# Stored program 'b' must be executed successfully.
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CREATE PROCEDURE p1()
+BEGIN
+DROP TABLE t1;
+CREATE TABLE t1(a INT, b INT, c INT);
+INSERT INTO t1 VALUES (1, 2, 3);
+END|
+CREATE PROCEDURE p2()
+BEGIN
+SELECT a, b FROM t1;
+CALL p1();
+SELECT a, b FROM t1;
+END|
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p2();
+a b
+1 2
+a b
+1 2
+
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP TABLE t1;
+
+# 7.4 Setup:
+# - stored program 'a', which re-creates temporary table 't' in a
+# compatible way;
+# - stored program 'b', which calls 'a' and uses 't' before and after the
+# call;
+# Stored program 'b' must be executed successfully.
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CREATE PROCEDURE p1()
+BEGIN
+DROP TEMPORARY TABLE t1;
+CREATE TEMPORARY TABLE t1(a INT, b INT, c INT);
+INSERT INTO t1 VALUES (1, 2, 3);
+END|
+CREATE PROCEDURE p2()
+BEGIN
+SELECT a, b FROM t1;
+CALL p1();
+SELECT a, b FROM t1;
+END|
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p2();
+a b
+1 2
+a b
+1 2
+
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP TEMPORARY TABLE t1;
+
+# 7.5 Setup:
+# - stored program 'a', which re-creates view 'v' in a compatible way;
+# - stored program 'b', which calls 'a' and uses 'v' before and after the
+# call;
+# Stored program 'b' must be executed successfully.
+CREATE VIEW v1 AS SELECT 1 AS a, 2 AS b;
+CREATE PROCEDURE p1()
+BEGIN
+DROP VIEW v1;
+CREATE VIEW v1 AS SELECT 1 AS a, 2 AS b, 3 AS c;
+END|
+CREATE PROCEDURE p2()
+BEGIN
+SELECT a, b FROM v1;
+CALL p1();
+SELECT a, b FROM v1;
+END|
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p2();
+a b
+1 2
+a b
+1 2
+
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP VIEW v1;
+
+# 7.6 Setup:
+# - stored program 'a', which alters regular table 't' in an incompatible
+# way;
+# - stored program 'b', which calls 'a' and uses 't' before and after the
+# call;
+# Stored program 'b' must fail on access to the table after its
+# modification.
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CREATE PROCEDURE p1()
+ALTER TABLE t1 DROP COLUMN a|
+CREATE PROCEDURE p2()
+BEGIN
+SELECT a, b FROM t1;
+CALL p1();
+SELECT a, b FROM t1;
+END|
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p2();
+a b
+1 2
+ERROR 42S22: Unknown column 'a' in 'field list'
+
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP TABLE t1;
+
+# 7.7 Setup:
+# - stored program 'a', which alters temporary table 't' in an
+# incompatible way;
+# - stored program 'b', which calls 'a' and uses 't' before and after the
+# call;
+# Stored program 'b' must fail on access to the table after its
+# modification.
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CREATE PROCEDURE p1()
+ALTER TABLE t1 DROP COLUMN a|
+CREATE PROCEDURE p2()
+BEGIN
+SELECT a, b FROM t1;
+CALL p1();
+SELECT a, b FROM t1;
+END|
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p2();
+a b
+1 2
+ERROR 42S22: Unknown column 'a' in 'field list'
+
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP TEMPORARY TABLE t1;
+
+# 7.8 Setup:
+# - stored program 'a', which re-creates regular table 't' in an
+# incompatible way;
+# - stored program 'b', which calls 'a' and uses 't' before and after the
+# call;
+# Stored program 'b' must fail on access to the table after its
+# modification.
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CREATE PROCEDURE p1()
+BEGIN
+DROP TABLE t1;
+CREATE TABLE t1(b INT, c INT);
+INSERT INTO t1 VALUES (2, 3);
+END|
+CREATE PROCEDURE p2()
+BEGIN
+SELECT a, b FROM t1;
+CALL p1();
+SELECT a, b FROM t1;
+END|
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p2();
+a b
+1 2
+ERROR 42S22: Unknown column 'a' in 'field list'
+
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP TABLE t1;
+
+# 7.9 Setup:
+# - stored program 'a', which re-creates temporary table 't' in an
+# incompatible way;
+# - stored program 'b', which calls 'a' and uses 't' before and after the
+# call;
+# Stored program 'b' must fail on access to the table after its
+# modification.
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+CREATE PROCEDURE p1()
+BEGIN
+DROP TEMPORARY TABLE t1;
+CREATE TEMPORARY TABLE t1(b INT, c INT);
+INSERT INTO t1 VALUES (2, 3);
+END|
+CREATE PROCEDURE p2()
+BEGIN
+SELECT a, b FROM t1;
+CALL p1();
+SELECT a, b FROM t1;
+END|
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p2();
+a b
+1 2
+ERROR 42S22: Unknown column 'a' in 'field list'
+
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP TEMPORARY TABLE t1;
+
+# 7.10 Setup:
+# - stored program 'a', which re-creates view 'v' in an incompatible way;
+# - stored program 'b', which calls 'a' and uses 'v' before and after the
+# call;
+# Stored program 'b' must fail on access to the view after its
+# modification.
+CREATE VIEW v1 AS SELECT 1 AS a, 2 AS b;
+CREATE PROCEDURE p1()
+BEGIN
+DROP VIEW v1;
+CREATE VIEW v1 AS SELECT 2 AS b, 3 AS c;
+END|
+CREATE PROCEDURE p2()
+BEGIN
+SELECT a, b FROM v1;
+CALL p1();
+SELECT a, b FROM v1;
+END|
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p2();
+a b
+1 2
+ERROR 42S22: Unknown column 'a' in 'field list'
+
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP VIEW v1;
+# 8. Stored program must be executed successfully when:
+# a. the program uses a table/view/temporary table that doesn't exist
+# at the time of start program execution
+# b. failed reference to the missed table/view/temporary table handled
+# by stored program
+# c. this table/view/temporary table is created as part of the
+# program execution
+# d. stored program gets access to newly created table/view/temporary
+# table from some SQL-statement during subsequent stored program execution.
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
+BEGIN
+SELECT 'SQLEXCEPTION caught' AS msg;
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+END;
+SELECT * FROM t1;
+SELECT * FROM t1;
+DROP TABLE t1;
+END|
+CREATE PROCEDURE p2()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
+BEGIN
+SELECT 'SQLEXCEPTION caught' AS msg;
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+END;
+SELECT * FROM t1;
+SELECT * FROM t1;
+DROP TEMPORARY TABLE t1;
+END|
+CREATE PROCEDURE p3()
+BEGIN
+DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
+BEGIN
+SELECT 'SQLEXCEPTION caught' AS msg;
+CREATE VIEW v1 AS SELECT 1 AS a, 2 AS b;
+END;
+SELECT * FROM v1;
+SELECT * FROM v1;
+DROP VIEW v1;
+END|
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+CALL p1();
+msg
+SQLEXCEPTION caught
+a b
+1 2
+CALL p2();
+msg
+SQLEXCEPTION caught
+a b
+1 2
+CALL p3();
+msg
+SQLEXCEPTION caught
+a b
+1 2
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
+
+# 9. Stored program must be executed successfully when
+# - the stored program has an expression in one of the following
+# statements
+# - RETURN
+# - IF
+# - CASE
+# - WHILE
+# - UNTIL
+# - SET
+# - the expression depends on the meta-data of some table/view/temporary table;
+# - the meta-data of dependent object has changed in a compatible way.
+#
+# Note, that CASE-expression must be evaluated once even if (some)
+# CASE-expressions need to be re-parsed.
+#
+# 10. Subsequent executions of a stored program must fail when
+# - the stored program has an expression in one of the following
+# statements
+# - RETURN
+# - IF
+# - CASE
+# - WHILE
+# - UNTIL
+# - SET
+# - the expression depends on the meta-data of some table/view/temporary table;
+# - the meta-data of dependent object has changed in a non-compatible way.
+#
+# Note, that CASE-expression must be evaluated once even if (some)
+# CASE-expressions need to be re-parsed.
+
+# Check IF-statement.
+
+CREATE PROCEDURE p1()
+BEGIN
+IF(SELECT * FROM t1)THEN
+SELECT 1;
+ELSE
+SELECT 2;
+END IF;
+END|
+CREATE PROCEDURE p2()
+BEGIN
+DECLARE v INT DEFAULT 1;
+IF v * (SELECT * FROM t1) THEN
+SELECT 1;
+ELSE
+SELECT 2;
+END IF;
+END|
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+IF (SELECT * FROM t1) THEN
+RETURN 1;
+ELSE
+RETURN 2;
+END IF;
+RETURN 3;
+END|
+CREATE FUNCTION f2() RETURNS INT
+BEGIN
+DECLARE v INT DEFAULT 1;
+IF v * (SELECT * FROM t1) THEN
+RETURN 1;
+ELSE
+RETURN 2;
+END IF;
+RETURN 3;
+END|
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1);
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1();
+1
+1
+CALL p2();
+1
+1
+SELECT f1();
+f1()
+1
+SELECT f2();
+f2()
+1
+
+UPDATE t1 SET a = 0;
+
+CALL p1();
+2
+2
+CALL p2();
+2
+2
+SELECT f1();
+f1()
+2
+SELECT f2();
+f2()
+2
+
+ALTER TABLE t1 ADD COLUMN b INT DEFAULT 1;
+
+CALL p1();
+ERROR 21000: Operand should contain 1 column(s)
+CALL p2();
+ERROR HY000: Illegal parameter data types int and row for operation '*'
+SELECT f1();
+ERROR 21000: Operand should contain 1 column(s)
+SELECT f2();
+ERROR HY000: Illegal parameter data types int and row for operation '*'
+
+ALTER TABLE t1 DROP COLUMN a;
+
+CALL p1();
+1
+1
+CALL p2();
+1
+1
+SELECT f1();
+f1()
+1
+SELECT f2();
+f2()
+1
+
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP FUNCTION f1;
+DROP FUNCTION f2;
+DROP TABLE t1;
+
+# Check WHILE-statement.
+
+CREATE PROCEDURE p1(x INT)
+BEGIN
+WHILE(SELECT * FROM t1)DO
+SELECT x;
+UPDATE t1 SET a = x;
+SET x = x - 1;
+END WHILE;
+END|
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (0);
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+CALL p1(3);
+UPDATE t1 SET a = 1;
+CALL p1(3);
+x
+3
+x
+2
+x
+1
+x
+0
+UPDATE t1 SET a = 1;
+ALTER TABLE t1 ADD COLUMN b INT DEFAULT 1;
+CALL p1(3);
+ERROR 21000: Operand should contain 1 column(s)
+ALTER TABLE t1 DROP COLUMN a;
+CALL p1(3);
+x
+3
+ERROR 42S22: Unknown column 'a' in 'field list'
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+# Check REPEAT-statement.
+
+CREATE PROCEDURE p1(x INT)
+BEGIN
+REPEAT
+SELECT x;
+UPDATE t1 SET a = x;
+SET x = x - 1;
+UNTIL(NOT (SELECT * FROM t1))END REPEAT;
+END|
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (0);
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+CALL p1(3);
+x
+3
+x
+2
+x
+1
+x
+0
+UPDATE t1 SET a = 1;
+CALL p1(3);
+x
+3
+x
+2
+x
+1
+x
+0
+UPDATE t1 SET a = 1;
+ALTER TABLE t1 ADD COLUMN b INT DEFAULT 1;
+CALL p1(3);
+x
+3
+ERROR 21000: Operand should contain 1 column(s)
+ALTER TABLE t1 DROP COLUMN a;
+CALL p1(3);
+x
+3
+ERROR 42S22: Unknown column 'a' in 'field list'
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+# Check CASE-statement (round #1).
+
+CREATE PROCEDURE p1()
+BEGIN
+CASE
+WHEN (SELECT * FROM t1) = 1 THEN SELECT 'a1';
+WHEN (SELECT * FROM t1) = 2 THEN SELECT 'a2';
+WHEN (SELECT * FROM t1) = 3 THEN SELECT 'a3';
+ELSE SELECT 'a4';
+END CASE;
+END|
+CREATE PROCEDURE p2()
+BEGIN
+CASE (SELECT * FROM t1)
+WHEN 1 THEN SELECT 'a1';
+WHEN 2 THEN SELECT 'a2';
+WHEN 3 THEN SELECT 'a3';
+ELSE SELECT 'a4';
+END CASE;
+END|
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (0);
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1();
+a4
+a4
+CALL p2();
+a4
+a4
+
+UPDATE t1 SET a = 3;
+
+CALL p1();
+a3
+a3
+CALL p2();
+a3
+a3
+
+ALTER TABLE t1 ADD COLUMN b INT DEFAULT 2;
+
+CALL p1();
+ERROR HY000: Illegal parameter data types row and int for operation '='
+CALL p2();
+ERROR 21000: Operand should contain 1 column(s)
+
+ALTER TABLE t1 DROP COLUMN a;
+
+CALL p1();
+a2
+a2
+CALL p2();
+a2
+a2
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP TABLE t1;
+
+# Check CASE-statement (round #2).
+#
+# Check that CASE-expression is executed once even if the metadata, used
+# in a WHEN-expression, have changed.
+
+CREATE TABLE t1(a INT);
+CREATE TABLE t2(a INT);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+SET @x = @x + 1;
+RETURN (SELECT a FROM t1);
+END|
+CREATE PROCEDURE p1()
+BEGIN
+CASE f1()
+WHEN 1 THEN SELECT 'a1';
+WHEN 2 THEN SELECT 'a2';
+WHEN (SELECT * FROM t2) THEN SELECT 'subselect';
+ELSE SELECT 'else';
+END CASE;
+END|
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+SET @x = 0;
+CALL p1();
+a1
+a1
+SELECT @x;
+@x
+1
+
+UPDATE t1 SET a = 3;
+ALTER TABLE t2 ADD COLUMN b INT DEFAULT 3;
+
+SET @x = 0;
+CALL p1();
+ERROR HY000: Illegal parameter data types int and row for operation '='
+SELECT @x;
+@x
+1
+
+ALTER TABLE t2 DROP COLUMN a;
+
+SET @x = 0;
+CALL p1();
+subselect
+subselect
+SELECT @x;
+@x
+1
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
+DROP TABLE t1;
+DROP TABLE t2;
+
+# Check DEFAULT clause.
+#
+
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1);
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE v INT DEFAULT (SELECT * FROM t1);
+SELECT v;
+END|
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1();
+v
+1
+
+ALTER TABLE t1 ADD COLUMN b INT DEFAULT 2;
+
+CALL p1();
+ERROR HY000: Cannot cast 'row' as 'int' in assignment of `v`
+
+ALTER TABLE t1 DROP COLUMN a;
+
+CALL p1();
+v
+2
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+# Check SET.
+#
+
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t2(a INT);
+INSERT INTO t2 VALUES (1);
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE x INT;
+SET x = (SELECT * FROM t1);
+SELECT x;
+END|
+CREATE PROCEDURE p2()
+BEGIN
+SET @x = NULL;
+SET @x = (SELECT * FROM t1);
+SELECT @x;
+END|
+CREATE TRIGGER t2_bu BEFORE UPDATE ON t2 FOR EACH ROW
+BEGIN
+SET NEW.a = (SELECT * FROM t1) * 2;
+END|
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1();
+x
+1
+
+CALL p2();
+@x
+1
+
+UPDATE t2 SET a = 10;
+
+ALTER TABLE t1 ADD COLUMN b INT DEFAULT 2;
+
+CALL p1();
+ERROR HY000: Cannot cast 'row' as 'int' in assignment of `x`
+
+CALL p2();
+ERROR 21000: Operand should contain 1 column(s)
+
+UPDATE t2 SET a = 20;
+ERROR HY000: Illegal parameter data types row and int for operation '*'
+
+ALTER TABLE t1 DROP COLUMN a;
+
+CALL p1();
+x
+2
+
+CALL p2();
+@x
+2
+
+UPDATE t2 SET a = 30;
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP TABLE t1;
+DROP TABLE t2;
+
+# 11.1 If metadata of the objects (regular tables, temporary tables,
+# views), used in SELECT-statement changed between DECLARE CURSOR and
+# OPEN statements, the SELECT-statement should be re-parsed to use
+# up-to-date metadata.
+
+
+# - Regular table.
+
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1);
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE v INT;
+DECLARE c CURSOR FOR SELECT * FROM t1;
+ALTER TABLE t1 ADD COLUMN b INT DEFAULT 2;
+ALTER TABLE t1 DROP COLUMN a;
+OPEN c;
+FETCH c INTO v;
+CLOSE c;
+SELECT v;
+END|
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1();
+v
+2
+SET @@debug_dbug=@orig_dbug;
+
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+# - Temporary table.
+
+CREATE TEMPORARY TABLE t1(a INT);
+INSERT INTO t1 VALUES (1);
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE v INT;
+DECLARE c CURSOR FOR SELECT * FROM t1;
+ALTER TABLE t1 ADD COLUMN b INT DEFAULT 2;
+ALTER TABLE t1 DROP COLUMN a;
+OPEN c;
+FETCH c INTO v;
+CLOSE c;
+SELECT v;
+END|
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1();
+v
+2
+SET @@debug_dbug=@orig_dbug;
+
+DROP TEMPORARY TABLE t1;
+DROP PROCEDURE p1;
+
+# 11.2 If the metadata changed between OPEN and FETCH or CLOSE
+# statements, those changes should not be noticed.
+
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1);
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE v INT;
+DECLARE c CURSOR FOR SELECT * FROM t1;
+OPEN c;
+ALTER TABLE t1 ADD COLUMN b INT DEFAULT 2;
+ALTER TABLE t1 DROP COLUMN a;
+FETCH c INTO v;
+CLOSE c;
+SELECT v;
+END|
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1();
+v
+1
+SET @@debug_dbug=@orig_dbug;
+
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+# 11.3 Re-parsing of the SELECT-statement should be made correctly
+# (in the correct parsing context) if the metadata changed between
+# DECLARE CURSOR and OPEN statements, and those statements reside in different
+# parsing contexts.
+
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1);
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE f1 INT;
+DECLARE f2 INT;
+DECLARE f3 INT;
+DECLARE x INT DEFAULT 1;
+DECLARE y INT DEFAULT 2;
+DECLARE c CURSOR FOR SELECT x, y, t1.a FROM t1;
+ALTER TABLE t1 ADD COLUMN b INT;
+BEGIN
+DECLARE x INT DEFAULT 10;
+DECLARE y INT DEFAULT 20;
+OPEN c;
+FETCH c INTO f1, f2, f3;
+SELECT f1, f2, f3;
+CLOSE c;
+END;
+END|
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1();
+f1 f2 f3
+1 2 1
+SET @@debug_dbug=@orig_dbug;
+
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+# Test procedure behaviour after view recreation.
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE PROCEDURE p1()
+SELECT * FROM v1;
+CALL p1();
+a
+1
+2
+# Alter underlying table and recreate the view.
+ALTER TABLE t1 ADD COLUMN (b INT);
+ALTER VIEW v1 AS SELECT * FROM t1;
+# And check whether the call of stored procedure handles it correctly.
+CALL p1();
+a b
+1 NULL
+2 NULL
+DROP VIEW v1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+# Test if metadata changes for temporary table is handled
+# correctly inside a stored procedure.
+CREATE TEMPORARY TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+CREATE PROCEDURE p1()
+SELECT * FROM t1;
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+CALL p1();
+a
+1
+2
+# Test if added temporary table's column is recognized during
+# procedure invocation.
+ALTER TABLE t1 ADD COLUMN (b INT);
+CALL p1();
+a b
+1 NULL
+2 NULL
+# Test if dropped temporary table's column is not appeared
+# in procedure's result.
+ALTER TABLE t1 DROP COLUMN a;
+CALL p1();
+b
+NULL
+NULL
+SET @@debug_dbug=@orig_dbug;
+DROP PROCEDURE p1;
+DROP TABLE t1;
+# Test handle of metadata changes with stored function.
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+CREATE TEMPORARY TABLE t1_result_set AS SELECT * FROM t1;
+RETURN 0;
+END|
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+SELECT f1();
+f1()
+0
+SELECT * FROM t1_result_set;
+a
+1
+2
+DROP TABLE t1_result_set;
+# Check if added column is noticed by invocation of stored function.
+ALTER TABLE t1 ADD COLUMN (b INT);
+SELECT f1();
+f1()
+0
+SELECT * FROM t1_result_set;
+a b
+1 NULL
+2 NULL
+DROP TABLE t1_result_set;
+# Check if dropped column is noticed by invocation of stored function.
+ALTER TABLE t1 DROP COLUMN a;
+SELECT f1();
+f1()
+0
+SELECT * FROM t1_result_set;
+b
+NULL
+NULL
+SET @@debug_dbug=@orig_dbug;
+DROP TABLE t1_result_set;
+DROP TABLE t1;
+DROP FUNCTION f1;
+# Test if table's recreation is handled correctly
+# inside a stored function.
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+CREATE TEMPORARY TABLE t1_result_set AS SELECT * FROM t1;
+RETURN 0;
+END|
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+SELECT f1();
+f1()
+0
+SELECT * FROM t1_result_set;
+a
+1
+2
+DROP TABLE t1_result_set;
+# Recreate table and check if it is handled correctly
+# by function invocation.
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+SELECT f1();
+f1()
+0
+SELECT * FROM t1_result_set;
+a
+1
+2
+SET @@debug_dbug=@orig_dbug;
+DROP TABLE t1_result_set;
+DROP FUNCTION f1;
+DROP TABLE t1;
+# Test if changes in the view's metadata is handled
+# correctly by function call.
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+CREATE TEMPORARY TABLE t1_result_set AS SELECT * FROM v1;
+RETURN 0;
+END|
+SELECT f1();
+f1()
+0
+SELECT * FROM t1_result_set;
+a
+1
+2
+DROP TABLE t1_result_set;
+ALTER TABLE t1 ADD COLUMN (b INT);
+ALTER VIEW v1 AS SELECT * FROM t1;
+SELECT f1();
+f1()
+0
+SELECT * FROM t1_result_set;
+a b
+1 NULL
+2 NULL
+DROP TABLE t1_result_set;
+DROP TABLE t1;
+DROP VIEW v1;
+DROP FUNCTION f1;
+# Check if queried object's type substitution (table->view, view->table,
+# table->temp table, etc.) is handled correctly during invocation of
+# stored function/procedure.
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+CREATE TEMPORARY TABLE t1_result_set AS SELECT * FROM t1;
+RETURN 0;
+END|
+CREATE PROCEDURE p1()
+SELECT * FROM t1|
+CALL p1();
+a
+1
+2
+SELECT f1();
+f1()
+0
+SELECT * FROM t1_result_set;
+a
+1
+2
+DROP TABLE t1_result_set;
+DROP TABLE t1;
+CREATE TEMPORARY TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+CALL p1;
+a
+1
+2
+SELECT f1();
+f1()
+0
+SELECT * FROM t1_result_set;
+a
+1
+2
+DROP TABLE t1_result_set;
+SET @@debug_dbug=@orig_dbug;
+DROP TABLE t1;
+CREATE TABLE t2 (a INT);
+INSERT INTO t2 VALUES (1), (2);
+CREATE VIEW t1 AS SELECT * FROM t2;
+CALL p1;
+a
+1
+2
+SELECT f1();
+f1()
+0
+SELECT * FROM t1_result_set;
+a
+1
+2
+DROP TABLE t1_result_set;
+DROP TABLE t2;
+DROP VIEW t1;
+DROP FUNCTION f1;
+DROP PROCEDURE p1;
+# Test handle of metadata changes with triggers.
+CREATE TABLE t1 (a INT);
+CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+SET new.a = new.a + 100;
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+INSERT INTO t1 VALUES (1), (2);
+SELECT * FROM t1;
+a
+101
+102
+# Check if added table's column is handled correctly inside trigger.
+ALTER TABLE t1 ADD COLUMN (b INT);
+INSERT INTO t1 VALUES (3, 4);
+SELECT * FROM t1;
+a b
+101 NULL
+102 NULL
+103 4
+SET @@debug_dbug=@orig_dbug;
+DROP TRIGGER trg1;
+DROP TABLE t1;
+# Test if deleted column is handled correctly by trigger invocation.
+CREATE TABLE t1 (a INT, b INT);
+CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+SET new.a = new.a + 100;
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+INSERT INTO t1 VALUES (1, 2), (3, 4);
+SELECT * FROM t1;
+a b
+101 2
+103 4
+ALTER TABLE t1 DROP COLUMN b;
+INSERT INTO t1 VALUES (5);
+SELECT * FROM t1;
+a
+101
+103
+105
+SET @@debug_dbug=@orig_dbug;
+DROP TRIGGER trg1;
+DROP TABLE t1;
+# Check if server returns and error when was dropped a column
+# that is used inside a trigger body.
+CREATE TABLE t1 (a INT, b INT);
+CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+SET new.a = new.a + 100;
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+INSERT INTO t1 VALUES (1, 2), (3, 4);
+SELECT * FROM t1;
+a b
+101 2
+103 4
+ALTER TABLE t1 DROP COLUMN a;
+INSERT INTO t1 VALUES (5);
+ERROR 42S22: Unknown column 'a' in 'NEW'
+SET @@debug_dbug=@orig_dbug;
+DROP TRIGGER trg1;
+DROP TABLE t1;
+
+# Check updateable views inside triggers.
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1);
+CREATE TABLE t2(a INT);
+INSERT INTO t2 VALUES (1);
+CREATE VIEW v1 AS SELECT a FROM t1;
+CREATE TRIGGER t2_bu BEFORE UPDATE ON t2 FOR EACH ROW
+BEGIN
+INSERT INTO v1 VALUES (NEW.a);
+SET @x = (SELECT CHARSET(a) FROM v1 LIMIT 1);
+END|
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+SET @x = NULL;
+UPDATE t2 SET a = 10;
+SELECT * FROM v1;
+a
+1
+10
+SELECT @x;
+@x
+binary
+
+ALTER TABLE t1 CHANGE COLUMN a a CHAR(2);
+
+SET @x = NULL;
+UPDATE t2 SET a = 20;
+SELECT * FROM v1;
+a
+1
+10
+20
+SELECT @x;
+@x
+latin1
+SET @@debug_dbug=@orig_dbug;
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP VIEW v1;
+#
+# MDEV-31661: Assertion `thd->lex == sp_instr_lex' failed in LEX* sp_lex_instr::parse_expr(THD*, sp_head*, LEX*)
+#
+CREATE OR REPLACE PROCEDURE p1()
+BEGIN
+DECLARE c CURSOR FOR SELECT * FROM t1;
+OPEN c;
+CLOSE c;
+END;
+$
+CALL p1;
+ERROR 42S02: Table 'test.t1' doesn't exist
+CREATE TABLE t1 (id INT);
+CALL p1;
+# Second execution of the stored procedure p1() after the dependent
+# table t1 has been created resulted in assert failure for server built
+# with debug
+CALL p1;
+# Clean up
+DROP PROCEDURE p1;
+DROP TABLE t1;
+#
+# MDEV-31799 Unexpected ER_TRG_NO_SUCH_ROW_IN_TRG and server crash after ALTER TABLE
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+CREATE TABLE t2 (b INT);
+# Check that AFTER DELETE trigger is re-compiled on changing table's metadata
+CREATE TRIGGER tr AFTER DELETE ON t1 FOR EACH ROW INSERT INTO t2 (b) VALUES (OLD.a);
+DELETE FROM t1 LIMIT 1;
+SELECT * FROM t2;
+b
+1
+ALTER TABLE t2 FORCE;
+DELETE FROM t1 LIMIT 1;
+SELECT * FROM t2;
+b
+1
+2
+DELETE FROM t1 LIMIT 1;
+SELECT * FROM t2;
+b
+1
+2
+3
+DROP TRIGGER tr;
+# Check that AFTER UPDATE trigger is re-compiled on changing table's metadata
+CREATE TRIGGER tr AFTER UPDATE ON t1 FOR EACH ROW INSERT INTO t2 (b) VALUES (OLD.a);
+# Remove records interted by AFTER DELETE trogger
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t2;
+INSERT INTO t1 VALUES (1);
+UPDATE t1 SET a = 2;
+# Above statement should insert the row (1) into the table t2
+# Expected output contains one row: (1)
+SELECT * FROM t2;
+b
+1
+ALTER TABLE t2 FORCE;
+# The following statement should insert the row (2) into the table t2
+UPDATE t1 SET a = 3;
+# Expected output contains two rows: (1), (2)
+SELECT * FROM t2;
+b
+1
+2
+# The following statement should insert the row (3) into the table t2
+UPDATE t1 SET a = 5;
+# Expected output contains three rows: (1), (2), (3)
+SELECT * FROM t2;
+b
+1
+2
+3
+DROP TABLE t1, t2;
+#
+# MDEV-33525: Recreate/reuse temporary table
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1);
+CREATE FUNCTION f1()
+RETURNS INT
+BEGIN
+DECLARE res INT;
+DECLARE t1_cur CURSOR FOR SELECT 100 FROM t1, t1_tmp;
+CREATE TEMPORARY TABLE t1_tmp SELECT 1 a;
+OPEN t1_cur;
+CLOSE t1_cur;
+DROP TEMPORARY TABLE t1_tmp;
+RETURN 0;
+END
+|
+SELECT f1();
+f1()
+0
+# Without the patch, the second call of f1 would result in error:
+# ER_NO_SUCH_TABLE (1146): Table 'test.t1' doesn't exist
+SELECT f1();
+f1()
+0
+# Clean up
+DROP FUNCTION f1;
+DROP TABLE t1;
+SET sql_mode = default;
diff --git a/mysql-test/main/sp_validation.test b/mysql-test/main/sp_validation.test
new file mode 100644
index 00000000..6f095710
--- /dev/null
+++ b/mysql-test/main/sp_validation.test
@@ -0,0 +1,2799 @@
+# This test file was borrowed from Oracle MySQL to validate that
+# observable behaviour on SP's statements re-compilation (MDEV-5816)
+# is identical to one implemented at Oracle MySQL (WL#4179).
+
+# This test file contains a collection of tests developed for
+# WL#4179 (Stored programs: validation of stored program statements).
+#
+# The main idea of the tests here is to check that a stored program
+# properly handles metadata changes of the objects being used by
+# the stored program.
+
+###########################################################################
+###########################################################################
+
+--echo
+--echo #
+--echo # WL#4179: Stored programs: validation of stored program statements.
+--echo #
+--echo
+
+--source include/have_debug.inc
+--disable_ps2_protocol # lots of SELECTs with side effects below
+
+###########################################################################
+###########################################################################
+SET @orig_debug=@@debug_dbug;
+
+--echo # The test case below demonstrates that meta-data changes are detected
+--echo # by triggers.
+SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
+CREATE TABLE t1 (a INT, b INT);
+CREATE TABLE t2 (a INT, b INT);
+CREATE TABLE t3 (a INT);
+
+INSERT INTO t2 VALUES (11, 12), (21, 22);
+
+CREATE TRIGGER t3_ai AFTER INSERT ON t3 FOR EACH ROW
+ INSERT INTO t1 SELECT * FROM t2;
+
+INSERT INTO t3 (a) VALUES (1);
+
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# trigger's body doesn't lead to eviction of the trigger
+# from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+ALTER TABLE t1 ADD COLUMN c INT;
+ALTER TABLE t2 ADD COLUMN c INT;
+INSERT INTO t2 VALUES (31, 32, 33);
+
+INSERT INTO t3 (a) VALUES (2);
+
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP TABLE t1;
+DROP TABLE t2;
+DROP TABLE t3;
+
+###########################################################################
+
+--echo
+--echo # Check that NEW/OLD rows work within triggers.
+--echo
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1(a) VALUES (1);
+
+delimiter |;
+
+CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+ SET @a = OLD.a;
+ SET @b = NEW.a;
+ SELECT OLD.a INTO @c;
+ SELECT NEW.a INTO @d;
+
+ SET NEW.a = NEW.a * 2;
+END|
+
+delimiter ;|
+
+UPDATE t1 SET a = a * 10;
+
+SELECT @a, @c, @b, @d;
+
+SELECT a FROM t1;
+
+DROP TABLE t1;
+
+###########################################################################
+
+--echo
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+
+CREATE PROCEDURE p1()
+ SELECT * FROM t1;
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1();
+
+--echo
+--echo # 1.1 Check if added column into table is recognized correctly
+--echo # in a stored procedure.
+ALTER TABLE t1 ADD COLUMN b INT DEFAULT 0;
+CALL p1();
+
+--echo
+--echo # 1.2 Check if dropped column is not appeared in SELECT query
+--echo # executed inside a stored procedure.
+ALTER TABLE t1 DROP COLUMN a;
+CALL p1();
+
+--echo
+--echo # 1.3 Check if changed column is picked up properly.
+ALTER TABLE t1 CHANGE COLUMN b b VARCHAR(255) DEFAULT 'n/a';
+DELETE FROM t1;
+INSERT INTO t1 VALUES (b), ('hello');
+CALL p1();
+
+SET @@debug_dbug=@orig_dbug;
+
+--echo
+--echo # 1.4 Check if table's recreation is handled correctly
+--echo # inside a call of stored procedure.
+
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+
+CREATE PROCEDURE p1()
+ SELECT * FROM t1;
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1();
+
+DROP TABLE t1;
+
+--error ER_NO_SUCH_TABLE
+CALL p1();
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+
+CALL p1();
+
+SET @@debug_dbug=@orig_dbug;
+
+--echo
+--echo # 1.5 Recreate table t1 with another set of columns and
+--echo # re-call a stored procedure.
+
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+
+CREATE PROCEDURE p1()
+ SELECT * FROM t1;
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1();
+
+DROP TABLE t1;
+
+--error ER_NO_SUCH_TABLE
+CALL p1();
+
+CREATE TABLE t1 (b VARCHAR(10), c VARCHAR(10));
+INSERT INTO t1 VALUES ('a', 'b'), ('c', 'd');
+
+CALL p1();
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo # 2.1 Stored program that uses query like 'SELECT * FROM v' must be
+--echo # re-executed successfully if some columns were added into the view
+--echo # definition by ALTER VIEW;
+
+CREATE VIEW v1 AS SELECT 1, 2, 3;
+
+CREATE PROCEDURE p1()
+ SELECT * FROM v1;
+
+CALL p1();
+
+ALTER VIEW v1 AS SELECT 1, 2, 3, 4, 5;
+
+# In result of dropping/creating a view sp_cache is invalidated.
+# It means that the stored procedure p1 be evicted from sp_cache
+# and loaded again on opening the routine. So, the statement
+# SET @@debug_dbug='+d,check_sp_cache_not_invalidated'
+# shouldn't be run before execution of the statement
+# 'CALL p1();' since it will hit DBUG_SUICIDE in the function
+# sp_cache_flush_obsolete()
+CALL p1();
+
+--echo
+--echo # 2.2 Stored program that uses query like 'SELECT * FROM v' must be
+--echo # re-executed successfully if some columns were removed from the view
+--echo # definition by ALTER VIEW;
+
+ALTER VIEW v1 AS SELECT 1, 5;
+
+CALL p1();
+
+--echo
+--echo # 2.3 Stored program that uses query like 'SELECT * FROM v' must be
+--echo # re-executed successfully if a base table for the view being used was
+--echo # extended by new columns (by ALTER TABLE);
+
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+DROP VIEW v1;
+CREATE VIEW v1 AS SELECT * FROM t1;
+
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1()
+ SELECT * FROM v1;
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1();
+
+ALTER TABLE t1 ADD COLUMN c INT DEFAULT 3;
+
+# NOTE: this behaviour differs from the one of regular tables -- the thing is
+# that "The view definition is “frozen†at creation time, so changes to the
+# underlying tables afterward do not affect the view definition."
+# (http://dev.mysql.com/doc/refman/5.0/en/create-view.html).
+# So, this call should return 2 (not 3) columns.
+CALL p1();
+
+SET @@debug_dbug=@orig_dbug;
+
+--echo
+--echo # 2.4 Stored program that uses query like 'SELECT * FROM v' must be
+--echo # re-executed successfully if not used columns were removed from the
+--echo # base table of this view (by ALTER TABLE);
+
+DROP TABLE t1;
+CREATE TABLE t1(a INT, b INT, c INT);
+INSERT INTO t1 VALUES (1, 2, 3);
+
+DROP VIEW v1;
+CREATE VIEW v1 AS SELECT b, c FROM t1;
+
+DROP PROCEDURE p1;
+CREATE PROCEDURE p1()
+ SELECT * FROM v1;
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1();
+
+ALTER TABLE t1 DROP COLUMN a;
+
+CALL p1();
+
+ALTER TABLE t1 DROP COLUMN b;
+
+# NOTE: see the note above about view specific. Must-have column has been
+# dropped -- the view has become invalid.
+--error ER_VIEW_INVALID
+CALL p1();
+
+SET @@debug_dbug=@orig_dbug;
+
+--echo
+--echo # 2.5 Stored program that uses query like 'SELECT * FROM v' must be
+--echo # re-executed successfully if a type of some base table's columns were
+--echo # changed (by ALTER TABLE);
+
+DROP TABLE t1;
+CREATE TABLE t1(a INT, b INT, c INT);
+INSERT INTO t1 VALUES (1, 2, 3);
+
+DROP VIEW v1;
+CREATE VIEW v1 AS SELECT b, c FROM t1;
+
+DROP PROCEDURE p1;
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CREATE PROCEDURE p1()
+ SELECT * FROM v1;
+
+CALL p1();
+
+ALTER TABLE t1 CHANGE COLUMN b b VARCHAR(255) DEFAULT 'n/a';
+DELETE FROM t1;
+INSERT INTO t1(a, c) VALUES (10, 30);
+
+CALL p1();
+
+SET @@debug_dbug=@orig_dbug;
+
+--echo
+--echo # 2.6 Stored program that uses query like 'SELECT * FROM v' must be
+--echo # re-executed successfully if the view 'v' was dropped and created again
+--echo # with the same definition;
+--echo #
+--echo # 2.7 Stored program that uses query like 'SELECT * FROM v' must be
+--echo # re-executed successfully if the view 'v' was dropped and created again
+--echo # with different, but compatible definition.
+
+DROP VIEW v1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+CREATE VIEW v1 AS SELECT 1, 2, 3;
+
+CREATE PROCEDURE p1()
+ SELECT * FROM v1;
+
+CALL p1();
+
+DROP VIEW v1;
+
+# In result of dropping/creating a view sp_cache is invalidated.
+# It means that the stored procedure p1 be evicted from sp_cache
+# and loaded again on opening the routine. So, the statement
+# SET @@debug_dbug='+d,check_sp_cache_not_invalidated'
+# shouldn't be run before execution of the statement
+# 'CALL p1();' since it will hit DBUG_SUICIDE in the function
+# sp_cache_flush_obsolete()
+--error ER_NO_SUCH_TABLE
+CALL p1();
+
+CREATE VIEW v1 AS SELECT 4, 5, 6;
+
+CALL p1();
+
+--echo
+--echo # 2.8 Stored program that uses query like 'SELECT * FROM v' must be
+--echo # re-executed successfully if the view base tables have been re-created
+--echo # using the same or compatible definition.
+
+DROP VIEW v1;
+DROP PROCEDURE p1;
+
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+CREATE VIEW v1 AS SELECT * FROM t1;
+
+CREATE PROCEDURE p1()
+ SELECT * FROM v1;
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1();
+
+DROP TABLE t1;
+
+--error ER_VIEW_INVALID
+CALL p1();
+
+CREATE TABLE t1(a VARCHAR(255), b VARCHAR(255));
+INSERT INTO t1 VALUES ('a', 'b'), ('c', 'd');
+
+CALL p1();
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP VIEW v1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+--echo
+--echo # 3.1 Stored program that uses query like 'SELECT * FROM t' must be
+--echo # re-executed successfully if some columns were added into temporary table
+--echo # table 't' (by ALTER TABLE);
+
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+CREATE PROCEDURE p1() SELECT * FROM t1;
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1();
+
+ALTER TABLE t1 ADD COLUMN c INT DEFAULT 3;
+
+CALL p1();
+
+--echo
+--echo # 3.2 Stored program that uses query like 'SELECT * FROM t' must be
+--echo # re-executed successfully if some columns were removed from temporary
+--echo # table 't' (by ALTER TABLE);
+
+ALTER TABLE t1 DROP COLUMN a;
+
+CALL p1();
+
+--echo
+--echo # 3.3 Stored program that uses query like 'SELECT * FROM t' must be
+--echo # re-executed successfully if a type of some temporary table's columns were
+--echo # changed (by ALTER TABLE);
+
+ALTER TABLE t1 CHANGE COLUMN b b VARCHAR(255) DEFAULT 'n/a';
+INSERT INTO t1(c) VALUES (4);
+
+CALL p1();
+
+--echo
+--echo # 3.4 Stored program that uses query like 'SELECT * FROM t' must be
+--echo # re-executed successfully if the temporary table 't' was dropped and
+--echo # created again with the same definition;
+--echo #
+--echo # 3.5 Stored program that uses query like 'SELECT * FROM t' must be
+--echo # re-executed successfully if the temporary table 't' was dropped and
+--echo # created again with different, but compatible definition.
+
+DROP TEMPORARY TABLE t1;
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+CALL p1();
+
+DROP TEMPORARY TABLE t1;
+CREATE TEMPORARY TABLE t1(a VARCHAR(255), b VARCHAR(255), c VARCHAR(255));
+INSERT INTO t1 VALUES ('aa', 'bb', 'cc');
+
+CALL p1();
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP TEMPORARY TABLE t1;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo # 4.1 Stored program must fail when it is re-executed after a table's column
+--echo # that this program is referenced to has been removed;
+
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+CREATE PROCEDURE p1() SELECT a, b FROM t1;
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1();
+
+ALTER TABLE t1 DROP COLUMN b;
+
+--error ER_BAD_FIELD_ERROR
+CALL p1();
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+--echo
+--echo # 4.2 Stored program must fail when it is re-executed after a temporary
+--echo # table's column that this program is referenced to has been removed;
+
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+CREATE PROCEDURE p1() SELECT a, b FROM t1;
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1();
+
+ALTER TABLE t1 DROP COLUMN b;
+
+--error ER_BAD_FIELD_ERROR
+CALL p1();
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP TEMPORARY TABLE t1;
+
+--echo
+--echo # 4.3 Stored program must fail when it is re-executed after a view's
+--echo # column that this program is referenced to has been removed;
+
+CREATE VIEW v1 AS SELECT 1 AS a, 2 AS b;
+
+CREATE PROCEDURE p1() SELECT a, b FROM v1;
+
+CALL p1();
+
+# In result of altering a view sp_cache is invalidated.
+# It means that the stored procedure p1 be evicted from sp_cache
+# and loaded again on opening the routine. So, the statement
+# SET @@debug_dbug='+d,check_sp_cache_not_invalidated'
+# shouldn't be run here since it will hit DBUG_SUICIDE in the function
+# sp_cache_flush_obsolete()
+ALTER VIEW v1 AS SELECT 1 AS a;
+
+--error ER_BAD_FIELD_ERROR
+CALL p1();
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP VIEW v1;
+
+--echo
+--echo # 4.4 Stored program must fail when it is re-executed after a regular table
+--echo # that this program referenced to was removed;
+
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+CREATE PROCEDURE p1() SELECT a, b FROM t1;
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1();
+
+DROP TABLE t1;
+
+--error ER_NO_SUCH_TABLE
+CALL p1();
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+
+--echo
+--echo # 4.5 Stored program must fail when it is re-executed after a view that
+--echo # this program referenced to was removed;
+
+CREATE VIEW v1 AS SELECT 1 AS a, 2 AS b;
+
+CREATE PROCEDURE p1() SELECT a, b FROM v1;
+
+CALL p1();
+
+DROP VIEW v1;
+
+# In result of dropping/creating a view sp_cache is invalidated.
+# It means that the stored procedure p1 be evicted from sp_cache
+# and loaded again on opening the routine. So, the statement
+# SET @@debug_dbug='+d,check_sp_cache_not_invalidated'
+# shouldn't be run here since it will hit DBUG_SUICIDE in the function
+# sp_cache_flush_obsolete()
+--error ER_NO_SUCH_TABLE
+CALL p1();
+
+DROP PROCEDURE p1;
+
+--echo
+--echo # 4.6 Stored program must fail when it is re-executed after a temporary
+--echo # table that this program referenced to was removed;
+
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+CREATE PROCEDURE p1() SELECT a, b FROM t1;
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1();
+
+DROP TABLE t1;
+
+--error ER_NO_SUCH_TABLE
+CALL p1();
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+
+--echo
+--echo # 4.7 Stored program must fail if the program executes some
+--echo # SQL-statement and afterwards re-executes it again when some table 't'
+--echo # referenced by the statement was dropped in the period between statement
+--echo # execution;
+
+CREATE TABLE t1(a INT);
+CREATE TABLE t2(a INT);
+
+delimiter |;
+
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR 1146
+ SELECT 'Table t1 does not exist anymore' as msg;
+
+ SELECT * FROM t1;
+ INSERT INTO t2 VALUES (1);
+
+ SELECT GET_LOCK('m1', 10000);
+
+ SELECT * FROM t1;
+END|
+
+delimiter ;|
+
+--echo
+--echo # -- connection: con1
+--connect (con1, localhost, root)
+
+SELECT GET_LOCK('m1', 0);
+
+--echo
+--echo # -- connection: default
+--connection default
+
+--send CALL p1()
+
+--echo
+--echo # -- connection: con1
+--connection con1
+
+let $wait_condition = SELECT COUNT(*) = 1 FROM t2;
+--source include/wait_condition.inc
+
+DROP TABLE t1;
+
+SELECT RELEASE_LOCK('m1');
+
+--echo
+--echo # -- connection: default
+--connection default
+
+--reap
+
+--disconnect con1
+
+DROP TABLE t2;
+DROP PROCEDURE p1;
+
+###########################################################################
+
+--echo
+--echo # 5.1 Regular table -> View
+
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+CREATE PROCEDURE p1() SELECT * FROM t1;
+
+CALL p1();
+
+DROP TABLE t1;
+CREATE VIEW t1 AS SELECT 1 AS a, 2 AS b;
+
+# In result of dropping/creating a view sp_cache is invalidated.
+# It means that the stored procedure p1 be evicted from sp_cache
+# and loaded again on opening the routine. So, the statement
+# SET @@debug_dbug='+d,check_sp_cache_not_invalidated'
+# shouldn't be run here since it will hit DBUG_SUICIDE in the function
+# sp_cache_flush_obsolete()
+CALL p1();
+
+DROP PROCEDURE p1;
+DROP VIEW t1;
+
+--echo
+--echo # 5.2 Regular table -> Temporary table
+
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+CREATE PROCEDURE p1() SELECT * FROM t1;
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1();
+
+DROP TABLE t1;
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+CALL p1();
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP TEMPORARY TABLE t1;
+
+--echo
+--echo # 5.3 View -> Regular table
+
+CREATE VIEW t1 AS SELECT 1 AS a, 2 AS b;
+
+CREATE PROCEDURE p1() SELECT * FROM t1;
+
+CALL p1();
+
+DROP VIEW t1;
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+CALL p1();
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+--echo
+--echo # 5.4 View -> Temporary table
+
+CREATE VIEW t1 AS SELECT 1 AS a, 2 AS b;
+
+CREATE PROCEDURE p1() SELECT * FROM t1;
+
+CALL p1();
+
+DROP VIEW t1;
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+# In result of dropping/creating a view sp_cache is invalidated.
+# It means that the stored procedure p1 be evicted from sp_cache
+# and loaded again on opening the routine. So, the statement
+# SET @@debug_dbug='+d,check_sp_cache_not_invalidated'
+# shouldn't be run here since it will hit DBUG_SUICIDE in the function
+# sp_cache_flush_obsolete()
+CALL p1();
+
+DROP PROCEDURE p1;
+DROP TEMPORARY TABLE t1;
+
+--echo
+--echo # 5.5 Temporary table -> View
+
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+CREATE PROCEDURE p1() SELECT * FROM t1;
+
+CALL p1();
+
+DROP TEMPORARY TABLE t1;
+
+CREATE VIEW t1 AS SELECT 1 AS a, 2 AS b;
+
+CALL p1();
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP VIEW t1;
+
+--echo
+--echo # 5.6 Temporary table -> Regular table
+
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+CREATE PROCEDURE p1() SELECT * FROM t1;
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1();
+
+DROP TEMPORARY TABLE t1;
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+CALL p1();
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+###########################################################################
+
+--echo
+--echo # 6.1 Trigger that uses column 'a' of table 't' via pseudo-variable NEW
+--echo # must be re-executed successfully if the table definition has been changed
+--echo # in a compatible way. "Compatible way" in this case is that if the table
+--echo # 't' still has a column named 'a' and the column type is compatible with
+--echo # the operation that NEW.a takes part of.
+--echo #
+--echo # 6.2 Trigger that uses column 'a' of table 't' via pseudo-variable OLD
+--echo # must be re-executed successfully if the table definition has been changed
+--echo # in a compatible way. "Compatible way" in this case is that if the table
+--echo # 't' still has a column named 'a' and the column type is compatible with
+--echo # the operation that OLD.a takes part of.
+
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+delimiter |;
+
+CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+ SET @x = OLD.a;
+ SET @y = NEW.a;
+END|
+
+delimiter ;|
+
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# trigger's body doesn't lead to eviction of the trigger
+# from sp_cache
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+--echo
+SET @x = 0, @y = 0;
+UPDATE t1 SET a = 3, b = 4;
+SELECT @x, @y;
+
+--echo
+ALTER TABLE t1 ADD COLUMN c INT DEFAULT -1;
+
+--echo
+SET @x = 0, @y = 0;
+UPDATE t1 SET a = 5, b = 6;
+SELECT @x, @y;
+
+--echo
+ALTER TABLE t1 CHANGE COLUMN a a VARCHAR(255);
+
+--echo
+SET @x = 0, @y = 0;
+UPDATE t1 SET a = CONCAT('xxx_', a), b = 7;
+SELECT @x, @y;
+
+SET @@debug_dbug=@orig_dbug;
+
+--echo
+DROP TABLE t1;
+
+--echo
+--echo # 6.3 Re-execution of a trigger that uses column 'a' of table 't' via
+--echo # pseudo-variable NEW must fail if the table definition has been changed in
+--echo # the way that the column 'a' does not exist anymore.
+--echo #
+--echo # 6.4 Re-execution of a trigger that uses column 'a' of table 't' via
+--echo # pseudo-variable OLD must fail if the table definition has been changed in
+--echo # the way that the column 'a' does not exist anymore.
+
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+delimiter |;
+
+CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 FOR EACH ROW
+BEGIN
+ SET @x = OLD.a;
+ SET @y = NEW.b;
+END|
+
+delimiter ;|
+
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# trigger's body doesn't lead to eviction of the trigger
+# from sp_cache
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+--echo
+UPDATE t1 SET a = 3, b = 4;
+
+--echo
+ALTER TABLE t1 CHANGE COLUMN a a2 INT;
+
+--echo
+--error ER_BAD_FIELD_ERROR
+UPDATE t1 SET a2 = 5, b = 6;
+
+--echo
+ALTER TABLE t1 CHANGE COLUMN a2 a INT;
+ALTER TABLE t1 CHANGE COLUMN b b2 INT;
+
+--echo
+--error ER_BAD_FIELD_ERROR
+UPDATE t1 SET a = 5, b2 = 6;
+
+SET @@debug_dbug=@orig_dbug;
+
+--echo
+DROP TABLE t1;
+
+###########################################################################
+
+--echo
+--echo # 7.1 Setup:
+--echo # - stored program 'a', which alters regular table 't' in a compatible
+--echo # way;
+--echo # - stored program 'b', which calls 'a' and uses 't' before and after the
+--echo # call;
+--echo # Stored program 'b' must be executed successfully.
+
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+delimiter |;
+
+CREATE PROCEDURE p1()
+ ALTER TABLE t1 ADD COLUMN c INT DEFAULT 3|
+
+CREATE PROCEDURE p2()
+BEGIN
+ SELECT a, b FROM t1;
+ CALL p1();
+ SELECT a, b FROM t1;
+END|
+
+delimiter ;|
+
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+--echo
+CALL p2();
+--echo
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+
+DROP TABLE t1;
+
+--echo
+--echo # 7.2 Setup:
+--echo # - stored program 'a', which alters temporary table 't' in a compatible
+--echo # way;
+--echo # - stored program 'b', which calls 'a' and uses 't' before and after the
+--echo # call;
+--echo # Stored program 'b' must be executed successfully.
+
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+delimiter |;
+
+CREATE PROCEDURE p1()
+ ALTER TABLE t1 ADD COLUMN c INT DEFAULT 3|
+
+CREATE PROCEDURE p2()
+BEGIN
+ SELECT a, b FROM t1;
+ CALL p1();
+ SELECT a, b FROM t1;
+END|
+
+delimiter ;|
+
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+--echo
+CALL p2();
+--echo
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+
+DROP TEMPORARY TABLE t1;
+
+--echo
+--echo # 7.3 Setup:
+--echo # - stored program 'a', which re-creates regular table 't' in a
+--echo # compatible way;
+--echo # - stored program 'b', which calls 'a' and uses 't' before and after the
+--echo # call;
+--echo # Stored program 'b' must be executed successfully.
+
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+delimiter |;
+
+CREATE PROCEDURE p1()
+BEGIN
+ DROP TABLE t1;
+ CREATE TABLE t1(a INT, b INT, c INT);
+ INSERT INTO t1 VALUES (1, 2, 3);
+END|
+
+CREATE PROCEDURE p2()
+BEGIN
+ SELECT a, b FROM t1;
+ CALL p1();
+ SELECT a, b FROM t1;
+END|
+
+delimiter ;|
+
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+--echo
+CALL p2();
+--echo
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+
+DROP TABLE t1;
+
+--echo
+--echo # 7.4 Setup:
+--echo # - stored program 'a', which re-creates temporary table 't' in a
+--echo # compatible way;
+--echo # - stored program 'b', which calls 'a' and uses 't' before and after the
+--echo # call;
+--echo # Stored program 'b' must be executed successfully.
+
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+delimiter |;
+
+CREATE PROCEDURE p1()
+BEGIN
+ DROP TEMPORARY TABLE t1;
+ CREATE TEMPORARY TABLE t1(a INT, b INT, c INT);
+ INSERT INTO t1 VALUES (1, 2, 3);
+END|
+
+CREATE PROCEDURE p2()
+BEGIN
+ SELECT a, b FROM t1;
+ CALL p1();
+ SELECT a, b FROM t1;
+END|
+
+delimiter ;|
+
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+--echo
+CALL p2();
+--echo
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+
+DROP TEMPORARY TABLE t1;
+
+--echo
+--echo # 7.5 Setup:
+--echo # - stored program 'a', which re-creates view 'v' in a compatible way;
+--echo # - stored program 'b', which calls 'a' and uses 'v' before and after the
+--echo # call;
+--echo # Stored program 'b' must be executed successfully.
+
+CREATE VIEW v1 AS SELECT 1 AS a, 2 AS b;
+
+delimiter |;
+
+CREATE PROCEDURE p1()
+BEGIN
+ DROP VIEW v1;
+ CREATE VIEW v1 AS SELECT 1 AS a, 2 AS b, 3 AS c;
+END|
+
+CREATE PROCEDURE p2()
+BEGIN
+ SELECT a, b FROM v1;
+ CALL p1();
+ SELECT a, b FROM v1;
+END|
+
+delimiter ;|
+
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+--echo
+CALL p2();
+--echo
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+
+DROP VIEW v1;
+
+--echo
+--echo # 7.6 Setup:
+--echo # - stored program 'a', which alters regular table 't' in an incompatible
+--echo # way;
+--echo # - stored program 'b', which calls 'a' and uses 't' before and after the
+--echo # call;
+--echo # Stored program 'b' must fail on access to the table after its
+--echo # modification.
+
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+delimiter |;
+
+CREATE PROCEDURE p1()
+ ALTER TABLE t1 DROP COLUMN a|
+
+CREATE PROCEDURE p2()
+BEGIN
+ SELECT a, b FROM t1;
+ CALL p1();
+ SELECT a, b FROM t1;
+END|
+
+delimiter ;|
+
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+--echo
+--error ER_BAD_FIELD_ERROR
+CALL p2();
+--echo
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+
+DROP TABLE t1;
+
+--echo
+--echo # 7.7 Setup:
+--echo # - stored program 'a', which alters temporary table 't' in an
+--echo # incompatible way;
+--echo # - stored program 'b', which calls 'a' and uses 't' before and after the
+--echo # call;
+--echo # Stored program 'b' must fail on access to the table after its
+--echo # modification.
+
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+delimiter |;
+
+CREATE PROCEDURE p1()
+ ALTER TABLE t1 DROP COLUMN a|
+
+CREATE PROCEDURE p2()
+BEGIN
+ SELECT a, b FROM t1;
+ CALL p1();
+ SELECT a, b FROM t1;
+END|
+
+delimiter ;|
+
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+--echo
+--error ER_BAD_FIELD_ERROR
+CALL p2();
+--echo
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+
+DROP TEMPORARY TABLE t1;
+
+--echo
+--echo # 7.8 Setup:
+--echo # - stored program 'a', which re-creates regular table 't' in an
+--echo # incompatible way;
+--echo # - stored program 'b', which calls 'a' and uses 't' before and after the
+--echo # call;
+--echo # Stored program 'b' must fail on access to the table after its
+--echo # modification.
+
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+delimiter |;
+
+CREATE PROCEDURE p1()
+BEGIN
+ DROP TABLE t1;
+ CREATE TABLE t1(b INT, c INT);
+ INSERT INTO t1 VALUES (2, 3);
+END|
+
+CREATE PROCEDURE p2()
+BEGIN
+ SELECT a, b FROM t1;
+ CALL p1();
+ SELECT a, b FROM t1;
+END|
+
+delimiter ;|
+
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+--echo
+--error ER_BAD_FIELD_ERROR
+CALL p2();
+--echo
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+
+DROP TABLE t1;
+
+--echo
+--echo # 7.9 Setup:
+--echo # - stored program 'a', which re-creates temporary table 't' in an
+--echo # incompatible way;
+--echo # - stored program 'b', which calls 'a' and uses 't' before and after the
+--echo # call;
+--echo # Stored program 'b' must fail on access to the table after its
+--echo # modification.
+
+CREATE TEMPORARY TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1, 2);
+
+delimiter |;
+
+CREATE PROCEDURE p1()
+BEGIN
+ DROP TEMPORARY TABLE t1;
+ CREATE TEMPORARY TABLE t1(b INT, c INT);
+ INSERT INTO t1 VALUES (2, 3);
+END|
+
+CREATE PROCEDURE p2()
+BEGIN
+ SELECT a, b FROM t1;
+ CALL p1();
+ SELECT a, b FROM t1;
+END|
+
+delimiter ;|
+
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+--echo
+--error ER_BAD_FIELD_ERROR
+CALL p2();
+--echo
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+
+DROP TEMPORARY TABLE t1;
+
+--echo
+--echo # 7.10 Setup:
+--echo # - stored program 'a', which re-creates view 'v' in an incompatible way;
+--echo # - stored program 'b', which calls 'a' and uses 'v' before and after the
+--echo # call;
+--echo # Stored program 'b' must fail on access to the view after its
+--echo # modification.
+
+CREATE VIEW v1 AS SELECT 1 AS a, 2 AS b;
+
+delimiter |;
+
+CREATE PROCEDURE p1()
+BEGIN
+ DROP VIEW v1;
+ CREATE VIEW v1 AS SELECT 2 AS b, 3 AS c;
+END|
+
+CREATE PROCEDURE p2()
+BEGIN
+ SELECT a, b FROM v1;
+ CALL p1();
+ SELECT a, b FROM v1;
+END|
+
+delimiter ;|
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+--echo
+--error ER_BAD_FIELD_ERROR
+CALL p2();
+--echo
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+
+DROP VIEW v1;
+
+###########################################################################
+
+--echo # 8. Stored program must be executed successfully when:
+--echo # a. the program uses a table/view/temporary table that doesn't exist
+--echo # at the time of start program execution
+--echo # b. failed reference to the missed table/view/temporary table handled
+--echo # by stored program
+--echo # c. this table/view/temporary table is created as part of the
+--echo # program execution
+--echo # d. stored program gets access to newly created table/view/temporary
+--echo # table from some SQL-statement during subsequent stored program execution.
+
+delimiter |;
+
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
+ BEGIN
+ SELECT 'SQLEXCEPTION caught' AS msg;
+ CREATE TABLE t1(a INT, b INT);
+ INSERT INTO t1 VALUES (1, 2);
+ END;
+
+ SELECT * FROM t1;
+ SELECT * FROM t1;
+
+ DROP TABLE t1;
+END|
+
+CREATE PROCEDURE p2()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
+ BEGIN
+ SELECT 'SQLEXCEPTION caught' AS msg;
+ CREATE TEMPORARY TABLE t1(a INT, b INT);
+ INSERT INTO t1 VALUES (1, 2);
+ END;
+
+ SELECT * FROM t1;
+ SELECT * FROM t1;
+
+ DROP TEMPORARY TABLE t1;
+END|
+
+CREATE PROCEDURE p3()
+BEGIN
+ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
+ BEGIN
+ SELECT 'SQLEXCEPTION caught' AS msg;
+ CREATE VIEW v1 AS SELECT 1 AS a, 2 AS b;
+ END;
+
+ SELECT * FROM v1;
+ SELECT * FROM v1;
+
+ DROP VIEW v1;
+END|
+
+delimiter ;|
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1();
+
+CALL p2();
+
+CALL p3();
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
+
+###########################################################################
+
+--echo
+--echo # 9. Stored program must be executed successfully when
+--echo # - the stored program has an expression in one of the following
+--echo # statements
+--echo # - RETURN
+--echo # - IF
+--echo # - CASE
+--echo # - WHILE
+--echo # - UNTIL
+--echo # - SET
+--echo # - the expression depends on the meta-data of some table/view/temporary table;
+--echo # - the meta-data of dependent object has changed in a compatible way.
+--echo #
+--echo # Note, that CASE-expression must be evaluated once even if (some)
+--echo # CASE-expressions need to be re-parsed.
+--echo #
+--echo # 10. Subsequent executions of a stored program must fail when
+--echo # - the stored program has an expression in one of the following
+--echo # statements
+--echo # - RETURN
+--echo # - IF
+--echo # - CASE
+--echo # - WHILE
+--echo # - UNTIL
+--echo # - SET
+--echo # - the expression depends on the meta-data of some table/view/temporary table;
+--echo # - the meta-data of dependent object has changed in a non-compatible way.
+--echo #
+--echo # Note, that CASE-expression must be evaluated once even if (some)
+--echo # CASE-expressions need to be re-parsed.
+
+###########################################################################
+
+--echo
+--echo # Check IF-statement.
+--echo
+
+delimiter |;
+
+# NOTE: check also that spaces (no spaces) don't matter.
+
+CREATE PROCEDURE p1()
+BEGIN
+ IF(SELECT * FROM t1)THEN
+ SELECT 1;
+ ELSE
+ SELECT 2;
+ END IF;
+END|
+
+CREATE PROCEDURE p2()
+BEGIN
+ DECLARE v INT DEFAULT 1;
+
+ IF v * (SELECT * FROM t1) THEN
+ SELECT 1;
+ ELSE
+ SELECT 2;
+ END IF;
+END|
+
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+ IF (SELECT * FROM t1) THEN
+ RETURN 1;
+ ELSE
+ RETURN 2;
+ END IF;
+
+ RETURN 3;
+END|
+
+CREATE FUNCTION f2() RETURNS INT
+BEGIN
+ DECLARE v INT DEFAULT 1;
+
+ IF v * (SELECT * FROM t1) THEN
+ RETURN 1;
+ ELSE
+ RETURN 2;
+ END IF;
+
+ RETURN 3;
+END|
+
+delimiter ;|
+
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1);
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+--disable_view_protocol
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+--echo
+CALL p1();
+CALL p2();
+SELECT f1();
+SELECT f2();
+--echo
+
+UPDATE t1 SET a = 0;
+
+--echo
+CALL p1();
+CALL p2();
+SELECT f1();
+SELECT f2();
+--echo
+
+ALTER TABLE t1 ADD COLUMN b INT DEFAULT 1;
+
+--echo
+
+--error ER_OPERAND_COLUMNS
+CALL p1();
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+CALL p2();
+
+--error ER_OPERAND_COLUMNS
+SELECT f1();
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+SELECT f2();
+
+--echo
+
+ALTER TABLE t1 DROP COLUMN a;
+
+--echo
+CALL p1();
+CALL p2();
+SELECT f1();
+SELECT f2();
+--echo
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP FUNCTION f1;
+DROP FUNCTION f2;
+DROP TABLE t1;
+
+###########################################################################
+
+--echo
+--echo # Check WHILE-statement.
+--echo
+
+delimiter |;
+
+# NOTE: check also that spaces (no spaces) don't matter.
+
+CREATE PROCEDURE p1(x INT)
+BEGIN
+ WHILE(SELECT * FROM t1)DO
+ SELECT x;
+ UPDATE t1 SET a = x;
+ SET x = x - 1;
+ END WHILE;
+END|
+
+delimiter ;|
+
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (0);
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1(3);
+
+UPDATE t1 SET a = 1;
+
+CALL p1(3);
+
+UPDATE t1 SET a = 1;
+
+ALTER TABLE t1 ADD COLUMN b INT DEFAULT 1;
+
+--error ER_OPERAND_COLUMNS
+CALL p1(3);
+
+ALTER TABLE t1 DROP COLUMN a;
+
+# Column 'a' not found for the UPDATE statememnt.
+--error ER_BAD_FIELD_ERROR
+CALL p1(3);
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+###########################################################################
+
+--echo
+--echo # Check REPEAT-statement.
+--echo
+
+delimiter |;
+
+# NOTE: check also that spaces (no spaces) don't matter.
+
+CREATE PROCEDURE p1(x INT)
+BEGIN
+ REPEAT
+ SELECT x;
+ UPDATE t1 SET a = x;
+ SET x = x - 1;
+ UNTIL(NOT (SELECT * FROM t1))END REPEAT;
+END|
+
+delimiter ;|
+
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (0);
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1(3);
+
+UPDATE t1 SET a = 1;
+
+CALL p1(3);
+
+UPDATE t1 SET a = 1;
+
+ALTER TABLE t1 ADD COLUMN b INT DEFAULT 1;
+
+--error ER_OPERAND_COLUMNS
+CALL p1(3);
+
+ALTER TABLE t1 DROP COLUMN a;
+
+# Column 'a' not found for the UPDATE statememnt.
+--error ER_BAD_FIELD_ERROR
+CALL p1(3);
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+###########################################################################
+
+--echo
+--echo # Check CASE-statement (round #1).
+--echo
+
+delimiter |;
+
+# Check that metadata changes in WHEN-expressions are handled properly.
+CREATE PROCEDURE p1()
+BEGIN
+ CASE
+ WHEN (SELECT * FROM t1) = 1 THEN SELECT 'a1';
+ WHEN (SELECT * FROM t1) = 2 THEN SELECT 'a2';
+ WHEN (SELECT * FROM t1) = 3 THEN SELECT 'a3';
+ ELSE SELECT 'a4';
+ END CASE;
+END|
+
+# Check that metadata changes in CASE-expression, are handled properly.
+CREATE PROCEDURE p2()
+BEGIN
+ CASE (SELECT * FROM t1)
+ WHEN 1 THEN SELECT 'a1';
+ WHEN 2 THEN SELECT 'a2';
+ WHEN 3 THEN SELECT 'a3';
+ ELSE SELECT 'a4';
+ END CASE;
+END|
+
+delimiter ;|
+
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (0);
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+--echo
+
+CALL p1();
+CALL p2();
+
+--echo
+
+UPDATE t1 SET a = 3;
+
+--echo
+
+CALL p1();
+CALL p2();
+
+--echo
+
+ALTER TABLE t1 ADD COLUMN b INT DEFAULT 2;
+
+--echo
+
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+CALL p1();
+
+--error ER_OPERAND_COLUMNS
+CALL p2();
+
+--echo
+
+ALTER TABLE t1 DROP COLUMN a;
+
+--echo
+
+CALL p1();
+CALL p2();
+
+SET @@debug_dbug=@orig_dbug;
+
+--echo
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP TABLE t1;
+
+###########################################################################
+
+--echo
+--echo # Check CASE-statement (round #2).
+--echo #
+--echo # Check that CASE-expression is executed once even if the metadata, used
+--echo # in a WHEN-expression, have changed.
+--echo
+
+CREATE TABLE t1(a INT);
+CREATE TABLE t2(a INT);
+
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1);
+
+delimiter |;
+
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+ SET @x = @x + 1;
+ RETURN (SELECT a FROM t1);
+END|
+
+CREATE PROCEDURE p1()
+BEGIN
+ CASE f1()
+ WHEN 1 THEN SELECT 'a1';
+ WHEN 2 THEN SELECT 'a2';
+ WHEN (SELECT * FROM t2) THEN SELECT 'subselect';
+ ELSE SELECT 'else';
+ END CASE;
+END|
+
+delimiter ;|
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+--echo
+
+SET @x = 0;
+CALL p1();
+SELECT @x;
+
+--echo
+
+UPDATE t1 SET a = 3;
+ALTER TABLE t2 ADD COLUMN b INT DEFAULT 3;
+
+--echo
+
+SET @x = 0;
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+CALL p1();
+SELECT @x;
+
+--echo
+
+ALTER TABLE t2 DROP COLUMN a;
+
+--echo
+
+SET @x = 0;
+CALL p1();
+SELECT @x;
+
+SET @@debug_dbug=@orig_dbug;
+
+--echo
+
+DROP PROCEDURE p1;
+DROP FUNCTION f1;
+DROP TABLE t1;
+DROP TABLE t2;
+
+###########################################################################
+
+--echo
+--echo # Check DEFAULT clause.
+--echo #
+--echo
+
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1);
+
+delimiter |;
+
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE v INT DEFAULT (SELECT * FROM t1);
+ SELECT v;
+END|
+
+delimiter ;|
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+--echo
+CALL p1();
+
+--echo
+
+ALTER TABLE t1 ADD COLUMN b INT DEFAULT 2;
+
+--echo
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+CALL p1();
+
+--echo
+ALTER TABLE t1 DROP COLUMN a;
+
+--echo
+CALL p1();
+
+SET @@debug_dbug=@orig_dbug;
+
+--echo
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+###########################################################################
+
+--echo
+--echo # Check SET.
+--echo #
+--echo
+
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1);
+
+CREATE TABLE t2(a INT);
+INSERT INTO t2 VALUES (1);
+
+delimiter |;
+
+# Check SET for SP-variable.
+
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE x INT;
+ SET x = (SELECT * FROM t1);
+ SELECT x;
+END|
+
+# Check SET for user variable.
+
+CREATE PROCEDURE p2()
+BEGIN
+ SET @x = NULL;
+ SET @x = (SELECT * FROM t1);
+ SELECT @x;
+END|
+
+# Check SET for triggers.
+
+CREATE TRIGGER t2_bu BEFORE UPDATE ON t2 FOR EACH ROW
+BEGIN
+ SET NEW.a = (SELECT * FROM t1) * 2;
+END|
+
+delimiter ;|
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+--echo
+CALL p1();
+--echo
+CALL p2();
+--echo
+UPDATE t2 SET a = 10;
+
+--echo
+
+ALTER TABLE t1 ADD COLUMN b INT DEFAULT 2;
+
+--echo
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+CALL p1();
+--echo
+--error ER_OPERAND_COLUMNS
+CALL p2();
+--echo
+--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
+UPDATE t2 SET a = 20;
+
+--echo
+ALTER TABLE t1 DROP COLUMN a;
+
+--echo
+CALL p1();
+--echo
+CALL p2();
+--echo
+UPDATE t2 SET a = 30;
+
+SET @@debug_dbug=@orig_dbug;
+
+--echo
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP TABLE t1;
+DROP TABLE t2;
+
+###########################################################################
+
+--echo
+--echo # 11.1 If metadata of the objects (regular tables, temporary tables,
+--echo # views), used in SELECT-statement changed between DECLARE CURSOR and
+--echo # OPEN statements, the SELECT-statement should be re-parsed to use
+--echo # up-to-date metadata.
+--echo
+--echo
+--echo # - Regular table.
+--echo
+
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1);
+
+delimiter |;
+
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE v INT;
+ DECLARE c CURSOR FOR SELECT * FROM t1;
+
+ ALTER TABLE t1 ADD COLUMN b INT DEFAULT 2;
+ ALTER TABLE t1 DROP COLUMN a;
+
+ OPEN c;
+ FETCH c INTO v;
+ CLOSE c;
+
+ SELECT v;
+END|
+
+delimiter ;|
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+--echo
+CALL p1();
+
+SET @@debug_dbug=@orig_dbug;
+
+--echo
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+--echo
+--echo # - Temporary table.
+--echo
+
+CREATE TEMPORARY TABLE t1(a INT);
+INSERT INTO t1 VALUES (1);
+
+delimiter |;
+
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE v INT;
+ DECLARE c CURSOR FOR SELECT * FROM t1;
+
+ ALTER TABLE t1 ADD COLUMN b INT DEFAULT 2;
+ ALTER TABLE t1 DROP COLUMN a;
+
+ OPEN c;
+ FETCH c INTO v;
+ CLOSE c;
+
+ SELECT v;
+END|
+
+delimiter ;|
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+--echo
+CALL p1();
+
+SET @@debug_dbug=@orig_dbug;
+
+--echo
+DROP TEMPORARY TABLE t1;
+DROP PROCEDURE p1;
+
+# NOTE: ALTER VIEW is not available within Stored Programs.
+
+--echo
+--echo # 11.2 If the metadata changed between OPEN and FETCH or CLOSE
+--echo # statements, those changes should not be noticed.
+--echo
+
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1);
+
+delimiter |;
+
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE v INT;
+ DECLARE c CURSOR FOR SELECT * FROM t1;
+
+ OPEN c;
+
+ ALTER TABLE t1 ADD COLUMN b INT DEFAULT 2;
+ ALTER TABLE t1 DROP COLUMN a;
+
+ FETCH c INTO v;
+ CLOSE c;
+
+ SELECT v;
+END|
+
+delimiter ;|
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+--echo
+CALL p1();
+
+SET @@debug_dbug=@orig_dbug;
+
+--echo
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+--echo
+--echo # 11.3 Re-parsing of the SELECT-statement should be made correctly
+--echo # (in the correct parsing context) if the metadata changed between
+--echo # DECLARE CURSOR and OPEN statements, and those statements reside in different
+--echo # parsing contexts.
+--echo
+
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1);
+
+delimiter |;
+
+CREATE PROCEDURE p1()
+BEGIN
+ DECLARE f1 INT;
+ DECLARE f2 INT;
+ DECLARE f3 INT;
+
+ DECLARE x INT DEFAULT 1;
+ DECLARE y INT DEFAULT 2;
+
+ DECLARE c CURSOR FOR SELECT x, y, t1.a FROM t1;
+
+ ALTER TABLE t1 ADD COLUMN b INT;
+
+ BEGIN
+ DECLARE x INT DEFAULT 10;
+ DECLARE y INT DEFAULT 20;
+
+ OPEN c;
+
+ FETCH c INTO f1, f2, f3;
+ SELECT f1, f2, f3;
+
+ CLOSE c;
+ END;
+
+END|
+
+delimiter ;|
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+--echo
+CALL p1();
+
+SET @@debug_dbug=@orig_dbug;
+
+--echo
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+###########################################################################
+## Other tests.
+###########################################################################
+
+--echo
+--echo # Test procedure behaviour after view recreation.
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+
+# In result of dropping/creating a view sp_cache is invalidated.
+# It means that the stored procedure p1 be evicted from sp_cache
+# and loaded again on opening the routine. So, the statement
+# SET @@debug_dbug='+d,check_sp_cache_not_invalidated'
+# shouldn't be run here since it will hit DBUG_SUICIDE in the function
+# sp_cache_flush_obsolete()
+CREATE VIEW v1 AS SELECT * FROM t1;
+
+CREATE PROCEDURE p1()
+ SELECT * FROM v1;
+
+CALL p1();
+
+--echo # Alter underlying table and recreate the view.
+ALTER TABLE t1 ADD COLUMN (b INT);
+ALTER VIEW v1 AS SELECT * FROM t1;
+
+--echo # And check whether the call of stored procedure handles it correctly.
+CALL p1();
+
+DROP VIEW v1;
+DROP TABLE t1;
+DROP PROCEDURE p1;
+
+--echo # Test if metadata changes for temporary table is handled
+--echo # correctly inside a stored procedure.
+CREATE TEMPORARY TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+
+CREATE PROCEDURE p1()
+ SELECT * FROM t1;
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+CALL p1();
+
+--echo # Test if added temporary table's column is recognized during
+--echo # procedure invocation.
+ALTER TABLE t1 ADD COLUMN (b INT);
+CALL p1();
+
+--echo # Test if dropped temporary table's column is not appeared
+--echo # in procedure's result.
+ALTER TABLE t1 DROP COLUMN a;
+CALL p1();
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+--echo # Test handle of metadata changes with stored function.
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+
+delimiter |;
+
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+ CREATE TEMPORARY TABLE t1_result_set AS SELECT * FROM t1;
+
+ RETURN 0;
+END|
+
+delimiter ;|
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+SELECT f1();
+SELECT * FROM t1_result_set;
+DROP TABLE t1_result_set;
+
+--echo # Check if added column is noticed by invocation of stored function.
+ALTER TABLE t1 ADD COLUMN (b INT);
+
+SELECT f1();
+SELECT * FROM t1_result_set;
+DROP TABLE t1_result_set;
+
+--echo # Check if dropped column is noticed by invocation of stored function.
+ALTER TABLE t1 DROP COLUMN a;
+
+SELECT f1();
+SELECT * FROM t1_result_set;
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP TABLE t1_result_set;
+
+DROP TABLE t1;
+DROP FUNCTION f1;
+
+--echo # Test if table's recreation is handled correctly
+--echo # inside a stored function.
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+
+delimiter |;
+
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+ CREATE TEMPORARY TABLE t1_result_set AS SELECT * FROM t1;
+
+ RETURN 0;
+END|
+
+delimiter ;|
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+SELECT f1();
+SELECT * FROM t1_result_set;
+DROP TABLE t1_result_set;
+
+--echo # Recreate table and check if it is handled correctly
+--echo # by function invocation.
+DROP TABLE t1;
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+
+SELECT f1();
+SELECT * FROM t1_result_set;
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP TABLE t1_result_set;
+
+DROP FUNCTION f1;
+DROP TABLE t1;
+
+--echo # Test if changes in the view's metadata is handled
+--echo # correctly by function call.
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+CREATE VIEW v1 AS SELECT * FROM t1;
+
+delimiter |;
+
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+ CREATE TEMPORARY TABLE t1_result_set AS SELECT * FROM v1;
+ RETURN 0;
+END|
+
+delimiter ;|
+
+SELECT f1();
+SELECT * FROM t1_result_set;
+DROP TABLE t1_result_set;
+
+ALTER TABLE t1 ADD COLUMN (b INT);
+
+ALTER VIEW v1 AS SELECT * FROM t1;
+
+# In result of altering a view sp_cache is invalidated.
+# It means that the stored function f1 be evicted from sp_cache
+# and loaded again on opening the routine. So, the statement
+# SET @@debug_dbug='+d,check_sp_cache_not_invalidated'
+# shouldn't be run here since it will hit DBUG_SUICIDE in the function
+# sp_cache_flush_obsolete()
+SELECT f1();
+SELECT * FROM t1_result_set;
+
+DROP TABLE t1_result_set;
+DROP TABLE t1;
+DROP VIEW v1;
+
+DROP FUNCTION f1;
+
+--echo # Check if queried object's type substitution (table->view, view->table,
+--echo # table->temp table, etc.) is handled correctly during invocation of
+--echo # stored function/procedure.
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+
+delimiter |;
+
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+ CREATE TEMPORARY TABLE t1_result_set AS SELECT * FROM t1;
+ RETURN 0;
+END|
+
+CREATE PROCEDURE p1()
+ SELECT * FROM t1|
+
+delimiter ;|
+
+CALL p1();
+SELECT f1();
+SELECT * FROM t1_result_set;
+DROP TABLE t1_result_set;
+
+DROP TABLE t1;
+CREATE TEMPORARY TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2);
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# stored routine's body doesn't lead to eviction of
+# the stored routine from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+CALL p1;
+SELECT f1();
+SELECT * FROM t1_result_set;
+DROP TABLE t1_result_set;
+
+SET @@debug_dbug=@orig_dbug;
+--enable_view_protocol
+
+DROP TABLE t1;
+CREATE TABLE t2 (a INT);
+INSERT INTO t2 VALUES (1), (2);
+CREATE VIEW t1 AS SELECT * FROM t2;
+
+CALL p1;
+SELECT f1();
+SELECT * FROM t1_result_set;
+
+DROP TABLE t1_result_set;
+
+DROP TABLE t2;
+DROP VIEW t1;
+
+DROP FUNCTION f1;
+DROP PROCEDURE p1;
+
+--echo # Test handle of metadata changes with triggers.
+
+CREATE TABLE t1 (a INT);
+
+CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+ SET new.a = new.a + 100;
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# trigger's body doesn't lead to eviction of trigger
+# from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+INSERT INTO t1 VALUES (1), (2);
+SELECT * FROM t1;
+
+--echo # Check if added table's column is handled correctly inside trigger.
+ALTER TABLE t1 ADD COLUMN (b INT);
+INSERT INTO t1 VALUES (3, 4);
+
+SELECT * FROM t1;
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP TRIGGER trg1;
+DROP TABLE t1;
+
+--echo # Test if deleted column is handled correctly by trigger invocation.
+CREATE TABLE t1 (a INT, b INT);
+
+CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+ SET new.a = new.a + 100;
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# trigger's body doesn't lead to eviction of trigger
+# from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+INSERT INTO t1 VALUES (1, 2), (3, 4);
+SELECT * FROM t1;
+
+ALTER TABLE t1 DROP COLUMN b;
+
+INSERT INTO t1 VALUES (5);
+SELECT * FROM t1;
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP TRIGGER trg1;
+DROP TABLE t1;
+
+--echo # Check if server returns and error when was dropped a column
+--echo # that is used inside a trigger body.
+CREATE TABLE t1 (a INT, b INT);
+
+CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+ SET new.a = new.a + 100;
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# trigger's body doesn't lead to eviction of trigger
+# from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+INSERT INTO t1 VALUES (1, 2), (3, 4);
+SELECT * FROM t1;
+
+ALTER TABLE t1 DROP COLUMN a;
+
+--error ER_BAD_FIELD_ERROR
+INSERT INTO t1 VALUES (5);
+
+SET @@debug_dbug=@orig_dbug;
+
+DROP TRIGGER trg1;
+DROP TABLE t1;
+
+--echo
+--echo # Check updateable views inside triggers.
+
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1);
+
+CREATE TABLE t2(a INT);
+INSERT INTO t2 VALUES (1);
+
+CREATE VIEW v1 AS SELECT a FROM t1;
+
+delimiter |;
+
+CREATE TRIGGER t2_bu BEFORE UPDATE ON t2 FOR EACH ROW
+BEGIN
+ INSERT INTO v1 VALUES (NEW.a);
+ SET @x = (SELECT CHARSET(a) FROM v1 LIMIT 1);
+END|
+
+delimiter ;|
+
+#
+# Set the debug keyword 'check_sp_cache_not_invalidated'
+# in order to check that re-parsing of statements inside
+# trigger's body doesn't lead to eviction of trigger
+# from sp_cache
+#
+SET @@debug_dbug='+d,check_sp_cache_not_invalidated';
+
+--echo
+SET @x = NULL;
+
+UPDATE t2 SET a = 10;
+
+SELECT * FROM v1;
+SELECT @x;
+
+--echo
+ALTER TABLE t1 CHANGE COLUMN a a CHAR(2);
+
+--echo
+SET @x = NULL;
+
+UPDATE t2 SET a = 20;
+
+SELECT * FROM v1;
+SELECT @x;
+
+SET @@debug_dbug=@orig_dbug;
+
+--echo
+DROP TABLE t1;
+DROP TABLE t2;
+DROP VIEW v1;
+
+--echo #
+--echo # MDEV-31661: Assertion `thd->lex == sp_instr_lex' failed in LEX* sp_lex_instr::parse_expr(THD*, sp_head*, LEX*)
+--echo #
+
+--delimiter $
+
+CREATE OR REPLACE PROCEDURE p1()
+BEGIN
+ DECLARE c CURSOR FOR SELECT * FROM t1;
+ OPEN c;
+ CLOSE c;
+END;
+$
+
+--delimiter ;
+
+--error ER_NO_SUCH_TABLE
+CALL p1;
+CREATE TABLE t1 (id INT);
+
+CALL p1;
+--echo # Second execution of the stored procedure p1() after the dependent
+--echo # table t1 has been created resulted in assert failure for server built
+--echo # with debug
+CALL p1;
+
+--echo # Clean up
+DROP PROCEDURE p1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-31799 Unexpected ER_TRG_NO_SUCH_ROW_IN_TRG and server crash after ALTER TABLE
+--echo #
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+CREATE TABLE t2 (b INT);
+--echo # Check that AFTER DELETE trigger is re-compiled on changing table's metadata
+CREATE TRIGGER tr AFTER DELETE ON t1 FOR EACH ROW INSERT INTO t2 (b) VALUES (OLD.a);
+
+DELETE FROM t1 LIMIT 1;
+SELECT * FROM t2;
+
+ALTER TABLE t2 FORCE;
+
+DELETE FROM t1 LIMIT 1;
+SELECT * FROM t2;
+
+DELETE FROM t1 LIMIT 1;
+SELECT * FROM t2;
+
+DROP TRIGGER tr;
+--echo # Check that AFTER UPDATE trigger is re-compiled on changing table's metadata
+CREATE TRIGGER tr AFTER UPDATE ON t1 FOR EACH ROW INSERT INTO t2 (b) VALUES (OLD.a);
+--echo # Remove records interted by AFTER DELETE trogger
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t2;
+INSERT INTO t1 VALUES (1);
+UPDATE t1 SET a = 2;
+--echo # Above statement should insert the row (1) into the table t2
+--echo # Expected output contains one row: (1)
+SELECT * FROM t2;
+ALTER TABLE t2 FORCE;
+
+--echo # The following statement should insert the row (2) into the table t2
+UPDATE t1 SET a = 3;
+--echo # Expected output contains two rows: (1), (2)
+SELECT * FROM t2;
+--echo # The following statement should insert the row (3) into the table t2
+UPDATE t1 SET a = 5;
+--echo # Expected output contains three rows: (1), (2), (3)
+SELECT * FROM t2;
+
+# Cleanup
+
+DROP TABLE t1, t2;
+
+--echo #
+--echo # MDEV-33525: Recreate/reuse temporary table
+--echo #
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1);
+
+--delimiter |
+CREATE FUNCTION f1()
+RETURNS INT
+BEGIN
+ DECLARE res INT;
+
+ DECLARE t1_cur CURSOR FOR SELECT 100 FROM t1, t1_tmp;
+
+ CREATE TEMPORARY TABLE t1_tmp SELECT 1 a;
+
+ OPEN t1_cur;
+ CLOSE t1_cur;
+
+ DROP TEMPORARY TABLE t1_tmp;
+
+ RETURN 0;
+END
+|
+
+--delimiter ;
+SELECT f1();
+--echo # Without the patch, the second call of f1 would result in error:
+--echo # ER_NO_SUCH_TABLE (1146): Table 'test.t1' doesn't exist
+SELECT f1();
+
+--echo # Clean up
+DROP FUNCTION f1;
+DROP TABLE t1;
+
+SET sql_mode = default;
+--enable_ps2_protocol
diff --git a/mysql-test/main/sql_mode.result b/mysql-test/main/sql_mode.result
index 31308cd6..449534da 100644
--- a/mysql-test/main/sql_mode.result
+++ b/mysql-test/main/sql_mode.result
@@ -535,7 +535,7 @@ SET SESSION SQL_MODE = @OLD_SQL_MODE;
DROP USER 'user_no_PCTFL'@'localhost';
FLUSH PRIVILEGES;
SELECT * FROM mysql.db WHERE Host = 'localhost' AND User LIKE 'user_%PCTFL';
-Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Execute_priv Event_priv Trigger_priv Delete_history_priv
+Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Execute_priv Event_priv Trigger_priv Delete_history_priv Show_create_routine_priv
SELECT * FROM mysql.tables_priv WHERE Host = 'localhost' AND User LIKE 'user_%PCTFL';
Host Db User Table_name Grantor Timestamp Table_priv Column_priv
SELECT * FROM mysql.columns_priv WHERE Host = 'localhost' AND User LIKE 'user_%PCTFL';
diff --git a/mysql-test/main/sql_safe_updates.result b/mysql-test/main/sql_safe_updates.result
index f2944e60..099aaa9b 100644
--- a/mysql-test/main/sql_safe_updates.result
+++ b/mysql-test/main/sql_safe_updates.result
@@ -9,18 +9,23 @@ select @@sql_safe_updates;
#
create table t1 (a int, b int, primary key (a), key (b));
update t1 set b=2 where a=1 or b=2;
-ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
explain update t1 set b=2 where a=1 or b=2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
delete from t1 where a=1 or b=2;
-ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
explain delete from t1 where a=1 or b=2;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
insert into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8);
+explain update t1 set b=2 where a=1 or b=2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index_merge PRIMARY,b PRIMARY,b 4,5 NULL 2 Using union(PRIMARY,b); Using where; Using buffer
update t1 set b=2 where a=1 or b=2;
+set @@optimizer_switch="index_merge=off";
+update t1 set b=2 where a=1 or b=2;
+ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
delete from t1 where a=1 or b=2;
+ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
drop table t1;
#
# End of 10.3 tests
diff --git a/mysql-test/main/sql_safe_updates.test b/mysql-test/main/sql_safe_updates.test
index 25fe4a15..becabb68 100644
--- a/mysql-test/main/sql_safe_updates.test
+++ b/mysql-test/main/sql_safe_updates.test
@@ -7,14 +7,17 @@ select @@sql_safe_updates;
--echo # MDEV-18304 sql_safe_updates does not work with OR clauses
--echo #
create table t1 (a int, b int, primary key (a), key (b));
---error ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE
update t1 set b=2 where a=1 or b=2;
explain update t1 set b=2 where a=1 or b=2;
---error ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE
delete from t1 where a=1 or b=2;
explain delete from t1 where a=1 or b=2;
insert into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8);
+explain update t1 set b=2 where a=1 or b=2;
update t1 set b=2 where a=1 or b=2;
+set @@optimizer_switch="index_merge=off";
+--error ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE
+update t1 set b=2 where a=1 or b=2;
+--error ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE
delete from t1 where a=1 or b=2;
drop table t1;
diff --git a/mysql-test/main/ssl.result b/mysql-test/main/ssl.result
index 4f8ce517..07ba2bba 100644
--- a/mysql-test/main/ssl.result
+++ b/mysql-test/main/ssl.result
@@ -27,6 +27,7 @@ SHOW STATUS LIKE 'Ssl_server_not_after';
Variable_name Value
Ssl_server_not_after Feb 27 03:03:03 2040 GMT
drop table if exists t1,t2,t3,t4;
+set @@default_storage_engine="aria";
CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
@@ -627,6 +628,9 @@ explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index
+#
+# Some test with ORDER BY and limit
+#
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using filesort
@@ -1316,7 +1320,7 @@ companynr tinyint(2) unsigned zerofill NOT NULL default '00',
companyname char(30) NOT NULL default '',
PRIMARY KEY (companynr),
UNIQUE KEY companyname(companyname)
-) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
+) ENGINE=aria MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
companynr companyname
00 Unknown
@@ -1406,6 +1410,9 @@ explain select companynr,companyname from t4 left join t2 using (companynr) wher
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
delete from t2 where fld1=999999;
+#
+# Test left join optimization
+#
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
@@ -1420,15 +1427,15 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null;
id select_type table type possible_keys key key_len ref rows Extra
@@ -1444,11 +1451,11 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0;
id select_type table type possible_keys key key_len ref rows Extra
diff --git a/mysql-test/main/ssl_7937.test b/mysql-test/main/ssl_7937.test
index be3d43ee..444e3ec6 100644
--- a/mysql-test/main/ssl_7937.test
+++ b/mysql-test/main/ssl_7937.test
@@ -14,15 +14,21 @@ create procedure have_ssl()
--disable_abort_on_error
--echo mysql --ssl-ca=cacert.pem -e "call test.have_ssl()"
---exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem -e "call test.have_ssl()" 2>&1
+--exec $MYSQL --protocol tcp --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem -e "call test.have_ssl()" 2>&1
--echo mysql --ssl -e "call test.have_ssl()"
---exec $MYSQL --ssl -e "call test.have_ssl()" 2>&1
+--exec $MYSQL --protocol tcp --ssl -e "call test.have_ssl()" 2>&1
--echo mysql --ssl-ca=cacert.pem --ssl-verify-server-cert -e "call test.have_ssl()"
---exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-verify-server-cert -e "call test.have_ssl()" 2>&1
+--exec $MYSQL --protocol tcp --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-verify-server-cert -e "call test.have_ssl()" 2>&1
+let $is_win = `select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows")`;
+let $host=;
+if($is_win)
+{
+ let $host=--host=127.0.0.2;
+}
--echo mysql --ssl --ssl-verify-server-cert -e "call test.have_ssl()"
--replace_regex /TLS\/SSL error.*certificate[^\n]*/TLS\/SSL error: Failed to verify the server certificate/
---exec $MYSQL --ssl --ssl-verify-server-cert -e "call test.have_ssl()" 2>&1
+--exec $MYSQL --protocol tcp $host --ssl --ssl-verify-server-cert -e "call test.have_ssl()" 2>&1
--echo #
--echo # MDEV-27105 --ssl option set as default for mariadb CLI
diff --git a/mysql-test/main/ssl_and_innodb.result b/mysql-test/main/ssl_and_innodb.result
index 21d98908..ca6fef91 100644
--- a/mysql-test/main/ssl_and_innodb.result
+++ b/mysql-test/main/ssl_and_innodb.result
@@ -6,5 +6,5 @@ FROM t1 ;
d
2
Warnings:
-Note 1287 'des_decrypt' is deprecated and will be removed in a future release
+Warning 1287 'des_decrypt' is deprecated and will be removed in a future release
DROP TABLE t1;
diff --git a/mysql-test/main/ssl_autoverify,win.rdiff b/mysql-test/main/ssl_autoverify,win.rdiff
new file mode 100644
index 00000000..78d1df17
--- /dev/null
+++ b/mysql-test/main/ssl_autoverify,win.rdiff
@@ -0,0 +1,31 @@
+--- ssl_autoverify.result 2024-02-08 23:55:13.779166100 +0100
++++ ssl_autoverify,win.reject 2024-02-08 23:55:46.988212400 +0100
+@@ -22,9 +22,9 @@
+ WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
+ test.have_ssl()
+ yes
+-# mysql --protocol socket -uroot --ssl-verify-server-cert -e "select test.have_ssl()"
++# mysql --protocol pipe -uroot --ssl-verify-server-cert -e "select test.have_ssl()"
+ test.have_ssl()
+-yes
++no
+ # mysql --protocol tcp --host 127.0.0.1 -uroot --ssl-verify-server-cert -e "select test.have_ssl()"
+ test.have_ssl()
+ yes
+@@ -45,16 +45,6 @@
+ # mysql -umulti -ppw2 --ssl-verify-server-cert -e "select test.have_ssl()"
+ test.have_ssl()
+ yes
+->> MitM active <<
+-# mysql -uroot --disable-ssl-verify-server-cert -e "select 'Detecting MitM' as MitM, test.have_ssl()"
+-MitM test.have_ssl()
+-No MitM found! yes
+->> MitM active <<
+-# mysql -unative -pfoo --ssl-verify-server-cert -e "select 'Detecting MitM', test.have_ssl()"
+-ERROR 2026 (HY000): TLS/SSL error: Failed to verify the server certificate
+->> MitM active <<
+-# mysql -ued -pbar --ssl-verify-server-cert -e "select 'Detecting MitM', test.have_ssl()"
+-ERROR 2026 (HY000): TLS/SSL error: Failed to verify the server certificate
+ drop function have_ssl;
+ drop user native@'%';
+ drop user ed@'%';
diff --git a/mysql-test/main/ssl_autoverify.combinations b/mysql-test/main/ssl_autoverify.combinations
new file mode 100644
index 00000000..4b5797a2
--- /dev/null
+++ b/mysql-test/main/ssl_autoverify.combinations
@@ -0,0 +1,8 @@
+[pem]
+loose-enable-named-pipe
+
+[auto]
+ssl-key=
+ssl-cert=
+ssl-ca=
+loose-enable-named-pipe
diff --git a/mysql-test/main/ssl_autoverify.result b/mysql-test/main/ssl_autoverify.result
new file mode 100644
index 00000000..8c78a21d
--- /dev/null
+++ b/mysql-test/main/ssl_autoverify.result
@@ -0,0 +1,64 @@
+install soname 'auth_ed25519';
+install plugin three_attempts soname 'dialog_examples';
+create user native@'%' identified via mysql_native_password using password('foo');
+create user ed@'%' identified via ed25519 using password('bar');
+create user nohash@'%' identified via three_attempts using 'onetwothree';
+create user multi@'%' identified via mysql_native_password using password('pw1')
+or ed25519 using password('pw2');
+grant all privileges on test.* to native@'%';
+grant all privileges on test.* to ed@'%';
+grant all privileges on test.* to nohash@'%';
+grant all privileges on test.* to multi@'%';
+create function have_ssl() returns char(3)
+return (select if(variable_value > '','yes','no') as 'have_ssl'
+ from information_schema.session_status
+where variable_name='ssl_cipher');
+# mysql -uroot --disable-ssl-verify-server-cert -e "select test.have_ssl()"
+test.have_ssl()
+yes
+# mysql -uroot --ssl-verify-server-cert -e "select test.have_ssl()"
+ERROR 2026 (HY000): TLS/SSL error: Failed to verify the server certificate
+# mysql -uroot -e "select test.have_ssl()"
+WARNING: option --ssl-verify-server-cert is disabled, because of an insecure passwordless login.
+test.have_ssl()
+yes
+# mysql --protocol socket -uroot --ssl-verify-server-cert -e "select test.have_ssl()"
+test.have_ssl()
+yes
+# mysql --protocol tcp --host 127.0.0.1 -uroot --ssl-verify-server-cert -e "select test.have_ssl()"
+test.have_ssl()
+yes
+# mysql -unative -pfoo --ssl-verify-server-cert -e "select test.have_ssl()"
+test.have_ssl()
+yes
+# mysql -ued -pbar --ssl-verify-server-cert -e "select test.have_ssl()"
+test.have_ssl()
+yes
+# mysql -unohash -ponetwothree --disable-ssl-verify-server-cert -e "select test.have_ssl()"
+test.have_ssl()
+yes
+# mysql -unohash -ponetwothree --ssl-verify-server-cert -e "select test.have_ssl()"
+ERROR 2026 (HY000): TLS/SSL error: Failed to verify the server certificate
+# mysql -umulti -ppw1 --ssl-verify-server-cert -e "select test.have_ssl()"
+test.have_ssl()
+yes
+# mysql -umulti -ppw2 --ssl-verify-server-cert -e "select test.have_ssl()"
+test.have_ssl()
+yes
+>> MitM active <<
+# mysql -uroot --disable-ssl-verify-server-cert -e "select 'Detecting MitM' as MitM, test.have_ssl()"
+MitM test.have_ssl()
+No MitM found! yes
+>> MitM active <<
+# mysql -unative -pfoo --ssl-verify-server-cert -e "select 'Detecting MitM', test.have_ssl()"
+ERROR 2026 (HY000): TLS/SSL error: Failed to verify the server certificate
+>> MitM active <<
+# mysql -ued -pbar --ssl-verify-server-cert -e "select 'Detecting MitM', test.have_ssl()"
+ERROR 2026 (HY000): TLS/SSL error: Failed to verify the server certificate
+drop function have_ssl;
+drop user native@'%';
+drop user ed@'%';
+drop user nohash@'%';
+drop user multi@'%';
+uninstall plugin ed25519;
+uninstall plugin three_attempts;
diff --git a/mysql-test/main/ssl_autoverify.test b/mysql-test/main/ssl_autoverify.test
new file mode 100644
index 00000000..0417f6eb
--- /dev/null
+++ b/mysql-test/main/ssl_autoverify.test
@@ -0,0 +1,129 @@
+source include/platform.inc;
+source include/not_embedded.inc;
+if (!$AUTH_ED25519_SO) {
+ skip No auth_ed25519 plugin;
+}
+if (!$DIALOG_EXAMPLES_SO) {
+ skip No dialog_examples plugin;
+}
+
+install soname 'auth_ed25519';
+install plugin three_attempts soname 'dialog_examples';
+
+create user native@'%' identified via mysql_native_password using password('foo');
+create user ed@'%' identified via ed25519 using password('bar');
+create user nohash@'%' identified via three_attempts using 'onetwothree';
+create user multi@'%' identified via mysql_native_password using password('pw1')
+ or ed25519 using password('pw2');
+grant all privileges on test.* to native@'%';
+grant all privileges on test.* to ed@'%';
+grant all privileges on test.* to nohash@'%';
+grant all privileges on test.* to multi@'%';
+
+create function have_ssl() returns char(3)
+ return (select if(variable_value > '','yes','no') as 'have_ssl'
+ from information_schema.session_status
+ where variable_name='ssl_cipher');
+
+let host=;
+if ($MTR_COMBINATION_WIN) {
+ # 127.0.0.2 (and generally 127.0.0.0/8) works on Windows the same as 127.0.0.1,
+ # i.e client can connect if server listens on IPv4 loopback
+ #
+ # We use 127.0.0.2 as it does not match any of "localhost","127.0.0.1","::1"
+ # thus it is not considered "secure transport" by the connector/C
+ let host=--host=127.0.0.2;
+}
+#
+# root user, no password, so cannot validate cert.
+#
+--echo # mysql -uroot --disable-ssl-verify-server-cert -e "select test.have_ssl()"
+--exec $MYSQL --protocol tcp -uroot --disable-ssl-verify-server-cert -e "select test.have_ssl()" 2>&1
+--echo # mysql -uroot --ssl-verify-server-cert -e "select test.have_ssl()"
+--replace_regex /TLS\/SSL error.*certificate[^\n]*/TLS\/SSL error: Failed to verify the server certificate/
+--error 1
+--exec $MYSQL --protocol tcp $host -uroot --ssl-verify-server-cert -e "select test.have_ssl()" 2>&1
+#
+# except if ssl-verify-server-cert is left on default (not explicitly enabled)
+#
+--let $csd=`select @@character_sets_dir`
+--echo # mysql -uroot -e "select test.have_ssl()"
+--exec $EXE_MYSQL --no-defaults --character-sets-dir=$csd --protocol tcp $host --port $MASTER_MYPORT -uroot -e "select test.have_ssl()" 2>&1
+#
+# or unless using a secure transport, like unix_socket or named pipes
+#
+# note that SSL works over unix_socket, and it doesn't work over named pipes
+# but the connection is allowed either way, as the transport is secure
+#
+let proto=socket;
+if ($MTR_COMBINATION_WIN) {
+ let proto=pipe;
+}
+--echo # mysql --protocol $proto -uroot --ssl-verify-server-cert -e "select test.have_ssl()"
+--exec $MYSQL --protocol $proto -uroot --ssl-verify-server-cert -e "select test.have_ssl()" 2>&1
+
+#
+# same for tcp via localhost
+#
+--echo # mysql --protocol tcp --host 127.0.0.1 -uroot --ssl-verify-server-cert -e "select test.have_ssl()"
+--exec $MYSQL --protocol tcp --host 127.0.0.1 -uroot --ssl-verify-server-cert -e "select test.have_ssl()" 2>&1
+
+#
+# mysql_native_password with password works fine
+#
+--echo # mysql -unative -pfoo --ssl-verify-server-cert -e "select test.have_ssl()"
+--exec $MYSQL --protocol tcp $host -unative -pfoo --ssl-verify-server-cert -e "select test.have_ssl()" 2>&1
+#
+# ed25519 with password works fine
+#
+--echo # mysql -ued -pbar --ssl-verify-server-cert -e "select test.have_ssl()"
+--exec $MYSQL --protocol tcp $host -ued -pbar --ssl-verify-server-cert -e "select test.have_ssl()" 2>&1
+#
+# three_attempts uses auth string as is, doesn't hash.
+# so it's not safe over untrusted connection and thus cannot validate cert
+#
+--echo # mysql -unohash -ponetwothree --disable-ssl-verify-server-cert -e "select test.have_ssl()"
+--exec $MYSQL --protocol tcp $host -unohash -ponetwothree --disable-ssl-verify-server-cert -e "select test.have_ssl()" 2>&1
+--echo # mysql -unohash -ponetwothree --ssl-verify-server-cert -e "select test.have_ssl()"
+--replace_regex /TLS\/SSL error.*certificate[^\n]*/TLS\/SSL error: Failed to verify the server certificate/
+--error 1
+--exec $MYSQL --protocol tcp $host -unohash -ponetwothree --ssl-verify-server-cert -e "select test.have_ssl()" 2>&1
+#
+# multi-auth case, both client and server must use
+# the same plugin for cert validation
+#
+--echo # mysql -umulti -ppw1 --ssl-verify-server-cert -e "select test.have_ssl()"
+--exec $MYSQL --protocol tcp $host -umulti -ppw1 --ssl-verify-server-cert -e "select test.have_ssl()" 2>&1
+--echo # mysql -umulti -ppw2 --ssl-verify-server-cert -e "select test.have_ssl()"
+--exec $MYSQL --protocol tcp $host -umulti -ppw2 --ssl-verify-server-cert -e "select test.have_ssl()" 2>&1
+
+#
+# Now try MitM
+#
+if (!$MTR_COMBINATION_WIN) {
+let mitm_port=$MASTER_MYPORT;
+inc $mitm_port;
+--exec perl lib/ssl-mitm.pl --listen-on $mitm_port --connect-to $MASTER_MYPORT --ssl-ca std_data/cacert.pem --ssl-key std_data/server-new-key.pem --ssl-cert std_data/server-new-cert.pem
+--echo # mysql -uroot --disable-ssl-verify-server-cert -e "select 'Detecting MitM' as MitM, test.have_ssl()"
+--exec $MYSQL --port $mitm_port --disable-ssl-verify-server-cert -uroot -e "select 'Detecting MitM' as MitM, test.have_ssl()" 2>&1
+
+--exec perl lib/ssl-mitm.pl --listen-on $mitm_port --connect-to $MASTER_MYPORT --ssl-ca std_data/cacert.pem --ssl-key std_data/server-new-key.pem --ssl-cert std_data/server-new-cert.pem
+--echo # mysql -unative -pfoo --ssl-verify-server-cert -e "select 'Detecting MitM', test.have_ssl()"
+--replace_regex /TLS\/SSL error.*certificate[^\n]*/TLS\/SSL error: Failed to verify the server certificate/
+--error 1
+--exec $MYSQL --port $mitm_port -unative -pfoo --ssl-verify-server-cert -e "select 'Detecting MitM', test.have_ssl()" 2>&1
+
+--exec perl lib/ssl-mitm.pl --listen-on $mitm_port --connect-to $MASTER_MYPORT --ssl-ca std_data/cacert.pem --ssl-key std_data/server-new-key.pem --ssl-cert std_data/server-new-cert.pem
+--echo # mysql -ued -pbar --ssl-verify-server-cert -e "select 'Detecting MitM', test.have_ssl()"
+--replace_regex /TLS\/SSL error.*certificate[^\n]*/TLS\/SSL error: Failed to verify the server certificate/
+--error 1
+--exec $MYSQL --port $mitm_port -ued -pbar --ssl-verify-server-cert -e "select 'Detecting MitM', test.have_ssl()" 2>&1
+}
+
+drop function have_ssl;
+drop user native@'%';
+drop user ed@'%';
+drop user nohash@'%';
+drop user multi@'%';
+uninstall plugin ed25519;
+uninstall plugin three_attempts;
diff --git a/mysql-test/main/ssl_compress.result b/mysql-test/main/ssl_compress.result
index 69de425c..beb21ce8 100644
--- a/mysql-test/main/ssl_compress.result
+++ b/mysql-test/main/ssl_compress.result
@@ -6,6 +6,7 @@ SHOW STATUS LIKE 'Compression';
Variable_name Value
Compression ON
drop table if exists t1,t2,t3,t4;
+set @@default_storage_engine="aria";
CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
@@ -606,6 +607,9 @@ explain select t3.t2nr,fld3 from t2,t3 where t2.companynr = 34 and t2.fld1=t3.t2
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL fld1 NULL NULL NULL 1199 Using where; Using temporary; Using filesort
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.fld1 1 Using where; Using index
+#
+# Some test with ORDER BY and limit
+#
explain select * from t3 as t1,t3 where t1.period=t3.period order by t3.period;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL period NULL NULL NULL 41810 Using filesort
@@ -1295,7 +1299,7 @@ companynr tinyint(2) unsigned zerofill NOT NULL default '00',
companyname char(30) NOT NULL default '',
PRIMARY KEY (companynr),
UNIQUE KEY companyname(companyname)
-) ENGINE=MyISAM MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
+) ENGINE=aria MAX_ROWS=50 PACK_KEYS=1 COMMENT='companynames';
select STRAIGHT_JOIN t2.companynr,companyname from t4,t2 where t2.companynr=t4.companynr group by t2.companynr;
companynr companyname
00 Unknown
@@ -1385,6 +1389,9 @@ explain select companynr,companyname from t4 left join t2 using (companynr) wher
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
delete from t2 where fld1=999999;
+#
+# Test left join optimization
+#
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
@@ -1399,15 +1406,15 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 and companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr is null;
id select_type table type possible_keys key key_len ref rows Extra
@@ -1423,11 +1430,11 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr is null;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0 or companynr < 0 or companynr > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where
+1 SIMPLE t4 range PRIMARY PRIMARY 1 NULL 12 Using index condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
explain select companynr,companyname from t4 left join t2 using (companynr) where ifnull(companynr,1)>0;
id select_type table type possible_keys key key_len ref rows Extra
diff --git a/mysql-test/main/ssl_fp.result b/mysql-test/main/ssl_fp.result
new file mode 100644
index 00000000..fe15e5f5
--- /dev/null
+++ b/mysql-test/main/ssl_fp.result
@@ -0,0 +1,12 @@
+create function have_ssl() returns char(3)
+return (select if(variable_value > '','yes','no') as 'have_ssl'
+ from information_schema.session_status
+where variable_name='ssl_cipher');
+# mysql --protocol tcp -uroot --ssl-verify-server-cert -e "select test.have_ssl()"
+ERROR 2026 (HY000): TLS/SSL error: Failed to verify the server certificate
+# mysql --protocol tcp -uroot --ssl-fp=F1:D0:08:AF:A1:D2:F4:15:79:B4:39:06:41:F4:20:96:F1:90:A9:65 --ssl-verify-server-cert -e "select test.have_ssl()"
+test.have_ssl()
+yes
+# mysql --protocol tcp -uroot --ssl-fp=00:11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF:00:11:22:33 --disable-ssl-verify-server-cert -e "select test.have_ssl()"
+ERROR 2026 (HY000): TLS/SSL error: Fingerprint verification of server certificate failed
+drop function have_ssl;
diff --git a/mysql-test/main/ssl_fp.test b/mysql-test/main/ssl_fp.test
new file mode 100644
index 00000000..9f3685c4
--- /dev/null
+++ b/mysql-test/main/ssl_fp.test
@@ -0,0 +1,33 @@
+source include/not_embedded.inc;
+
+create function have_ssl() returns char(3)
+ return (select if(variable_value > '','yes','no') as 'have_ssl'
+ from information_schema.session_status
+ where variable_name='ssl_cipher');
+
+let $is_win = `select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows")`;
+let $host=;
+if($is_win)
+{
+ let $host=--host=127.0.0.2;
+}
+#
+# passwordless root cannot connect w/o fingerprint:
+#
+--echo # mysql --protocol tcp -uroot --ssl-verify-server-cert -e "select test.have_ssl()"
+--replace_regex /TLS\/SSL error.*certificate[^\n]*/TLS\/SSL error: Failed to verify the server certificate/
+--error 1
+--exec $MYSQL --protocol tcp $host -uroot --ssl-verify-server-cert -e "select test.have_ssl()" 2>&1
+#
+# fingerprint based cert verification:
+#
+--echo # mysql --protocol tcp -uroot --ssl-fp=F1:D0:08:AF:A1:D2:F4:15:79:B4:39:06:41:F4:20:96:F1:90:A9:65 --ssl-verify-server-cert -e "select test.have_ssl()"
+--exec $MYSQL --protocol tcp $host -uroot --ssl-fp=F1:D0:08:AF:A1:D2:F4:15:79:B4:39:06:41:F4:20:96:F1:90:A9:65 --ssl-verify-server-cert -e "select test.have_ssl()" 2>&1
+#
+# wrong fingerprint fails even with --disable-ssl-verify-server-cert
+#
+--echo # mysql --protocol tcp -uroot --ssl-fp=00:11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF:00:11:22:33 --disable-ssl-verify-server-cert -e "select test.have_ssl()"
+--error 1
+--exec $MYSQL --protocol tcp $host -uroot --ssl-fp=00:11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF:00:11:22:33 --disable-ssl-verify-server-cert -e "select test.have_ssl()" 2>&1
+
+drop function have_ssl;
diff --git a/mysql-test/main/stat_tables.result b/mysql-test/main/stat_tables.result
index 0cb9ef43..be1a88e9 100644
--- a/mysql-test/main/stat_tables.result
+++ b/mysql-test/main/stat_tables.result
@@ -214,7 +214,7 @@ order by o_year;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE region ALL PRIMARY NULL NULL NULL 5 Using where; Using temporary; Using filesort
1 SIMPLE part ALL PRIMARY NULL NULL NULL 200 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity i_l_partkey 5 dbt3_s001.part.p_partkey 30 Using where
+1 SIMPLE lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity i_l_suppkey_partkey 5 dbt3_s001.part.p_partkey 30 Using index condition
1 SIMPLE supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.lineitem.l_suppkey 1 Using where
1 SIMPLE n2 eq_ref PRIMARY PRIMARY 4 dbt3_s001.supplier.s_nationkey 1
1 SIMPLE orders eq_ref PRIMARY,i_o_orderdate,i_o_custkey PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 Using where
@@ -257,6 +257,26 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE part eq_ref PRIMARY PRIMARY 4 dbt3_s001.partsupp.ps_partkey 1 Using where
1 SIMPLE lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.supplier.s_suppkey 8
1 SIMPLE orders eq_ref PRIMARY PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1
+EXPLAIN EXTENDED select nation, o_year, sum(amount) as sum_profit
+from (select n_name as nation,
+extract(year from o_orderdate) as o_year,
+l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount
+from part, supplier, lineitem, partsupp, orders, nation
+where s_suppkey = l_suppkey and ps_suppkey = l_suppkey
+and ps_partkey = l_partkey and p_partkey = l_partkey
+and o_orderkey = l_orderkey and s_nationkey = n_nationkey
+and p_name like '%green%') as profit
+group by nation, o_year
+order by nation, o_year desc;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE supplier ALL PRIMARY,i_s_nationkey NULL NULL NULL 10 100.00 Using where; Using temporary; Using filesort
+1 SIMPLE nation eq_ref PRIMARY PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00
+1 SIMPLE partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey i_ps_suppkey 4 dbt3_s001.supplier.s_suppkey 70 100.00
+1 SIMPLE part eq_ref PRIMARY PRIMARY 4 dbt3_s001.partsupp.ps_partkey 1 100.00 Using where
+1 SIMPLE lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.supplier.s_suppkey 8 100.00
+1 SIMPLE orders eq_ref PRIMARY PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 100.00
+Warnings:
+Note 1003 select `dbt3_s001`.`nation`.`n_name` AS `nation`,extract(year from `dbt3_s001`.`orders`.`o_orderDATE`) AS `o_year`,sum(`dbt3_s001`.`lineitem`.`l_extendedprice` * (1 - `dbt3_s001`.`lineitem`.`l_discount`) - `dbt3_s001`.`partsupp`.`ps_supplycost` * `dbt3_s001`.`lineitem`.`l_quantity`) AS `sum_profit` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`lineitem` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`orders` join `dbt3_s001`.`nation` where `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`orders`.`o_orderkey` = `dbt3_s001`.`lineitem`.`l_orderkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`part`.`p_name` like '%green%' group by `dbt3_s001`.`nation`.`n_name`,extract(year from `dbt3_s001`.`orders`.`o_orderDATE`) desc order by `dbt3_s001`.`nation`.`n_name`,extract(year from `dbt3_s001`.`orders`.`o_orderDATE`) desc
select nation, o_year, sum(amount) as sum_profit
from (select n_name as nation,
extract(year from o_orderdate) as o_year,
@@ -337,7 +357,7 @@ and o_orderkey=l_orderkey and p_partkey=l_partkey;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE part range PRIMARY,i_p_retailprice i_p_retailprice 9 NULL 1 Using index condition
1 SIMPLE orders ref PRIMARY,i_o_orderdate i_o_orderdate 4 const 1
-1 SIMPLE lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey 4 dbt3_s001.orders.o_orderkey 4 Using where
+1 SIMPLE lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where
select o_orderkey, p_partkey
from part, lineitem, orders
where p_retailprice > 1100 and o_orderdate='1997-01-01'
@@ -412,7 +432,7 @@ EXPLAIN
SELECT * FROM t1 STRAIGHT_JOIN t2 WHERE name IN ( 'AUS','YEM' ) AND id = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index
-1 SIMPLE t2 ALL NULL NULL NULL NULL 0 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where
ANALYZE TABLE t2;
Table Op Msg_type Msg_text
test.t2 analyze status Engine-independent statistics collected
@@ -591,8 +611,8 @@ set @@use_stat_tables= PREFERABLY;
explain
SELECT * FROM INFORMATION_SCHEMA.PROFILING, mysql.user;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE PROFILING ALL NULL NULL NULL NULL NULL
-1 SIMPLE global_priv ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
+1 SIMPLE global_priv ALL NULL NULL NULL NULL 5
+1 SIMPLE PROFILING ALL NULL NULL NULL NULL NULL Using join buffer (flat, BNL join)
set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set use_stat_tables=@save_use_stat_tables;
#
diff --git a/mysql-test/main/stat_tables.test b/mysql-test/main/stat_tables.test
index 4d4a969f..8333613d 100644
--- a/mysql-test/main/stat_tables.test
+++ b/mysql-test/main/stat_tables.test
@@ -125,7 +125,6 @@ order by o_year;
eval EXPLAIN $Q8;
eval $Q8;
-
let $Q9=
select nation, o_year, sum(amount) as sum_profit
from (select n_name as nation,
@@ -140,6 +139,7 @@ group by nation, o_year
order by nation, o_year desc;
eval EXPLAIN $Q9;
+eval EXPLAIN EXTENDED $Q9;
eval $Q9;
diff --git a/mysql-test/main/stat_tables_flush.result b/mysql-test/main/stat_tables_flush.result
index 496e9d74..36d84797 100644
--- a/mysql-test/main/stat_tables_flush.result
+++ b/mysql-test/main/stat_tables_flush.result
@@ -101,12 +101,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": 0.027083745,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 109,
+ "cost": 0.027083745,
"filtered": 3.669724703,
"attached_condition": "t1.a between 2 and 5"
}
@@ -119,12 +122,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": 0.027083745,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 109,
+ "cost": 0.027083745,
"filtered": 33.02752304,
"attached_condition": "t1.a between 12 and 15"
}
@@ -139,12 +145,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": 0.027083745,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 109,
+ "cost": 0.027083745,
"filtered": 15.78947353,
"attached_condition": "t1.a between 2 and 5"
}
@@ -158,12 +167,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": 0.027083745,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 109,
+ "cost": 0.027083745,
"filtered": 3.669724703,
"attached_condition": "t1.a between 2 and 5"
}
diff --git a/mysql-test/main/stat_tables_innodb.result b/mysql-test/main/stat_tables_innodb.result
index bce9e884..a7901c99 100644
--- a/mysql-test/main/stat_tables_innodb.result
+++ b/mysql-test/main/stat_tables_innodb.result
@@ -77,12 +77,12 @@ and r_name = 'AMERICA' and o_orderdate >= date '1995-01-01'
group by n_name
order by revenue desc;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE region ALL PRIMARY NULL NULL NULL 5 Using where; Using temporary; Using filesort
-1 SIMPLE nation ref PRIMARY,i_n_regionkey i_n_regionkey 5 dbt3_s001.region.r_regionkey 5
-1 SIMPLE supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 Using index
-1 SIMPLE customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6 Using index
+1 SIMPLE supplier index PRIMARY,i_s_nationkey i_s_nationkey 5 NULL 10 Using where; Using index; Using temporary; Using filesort
+1 SIMPLE nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 Using where
+1 SIMPLE region eq_ref PRIMARY PRIMARY 4 dbt3_s001.nation.n_regionkey 1 Using where
+1 SIMPLE customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.supplier.s_nationkey 6 Using index
1 SIMPLE orders ref|filter PRIMARY,i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (14%) Using where; Using rowid filter
-1 SIMPLE lineitem ref PRIMARY,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity i_l_suppkey 9 dbt3_s001.supplier.s_suppkey,dbt3_s001.orders.o_orderkey 1
+1 SIMPLE lineitem ref PRIMARY,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where
select n_name, sum(l_extendedprice * (1 - l_discount)) as revenue
from customer, orders, lineitem, supplier, nation, region
where c_custkey = o_custkey and l_orderkey = o_orderkey
@@ -208,12 +208,12 @@ and r_name = 'AMERICA' and o_orderdate >= date '1995-01-01'
group by n_name
order by revenue desc;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE region ALL PRIMARY NULL NULL NULL 5 Using where; Using temporary; Using filesort
-1 SIMPLE nation ref PRIMARY,i_n_regionkey i_n_regionkey 5 dbt3_s001.region.r_regionkey 5
-1 SIMPLE supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 Using index
-1 SIMPLE customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6 Using index
+1 SIMPLE supplier index PRIMARY,i_s_nationkey i_s_nationkey 5 NULL 10 Using where; Using index; Using temporary; Using filesort
+1 SIMPLE nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 Using where
+1 SIMPLE region eq_ref PRIMARY PRIMARY 4 dbt3_s001.nation.n_regionkey 1 Using where
+1 SIMPLE customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.supplier.s_nationkey 6 Using index
1 SIMPLE orders ref|filter PRIMARY,i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (14%) Using where; Using rowid filter
-1 SIMPLE lineitem ref PRIMARY,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity i_l_suppkey 9 dbt3_s001.supplier.s_suppkey,dbt3_s001.orders.o_orderkey 1
+1 SIMPLE lineitem ref PRIMARY,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where
select n_name, sum(l_extendedprice * (1 - l_discount)) as revenue
from customer, orders, lineitem, supplier, nation, region
where c_custkey = o_custkey and l_orderkey = o_orderkey
@@ -246,12 +246,12 @@ order by o_year;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE region ALL PRIMARY NULL NULL NULL 5 Using where; Using temporary; Using filesort
1 SIMPLE part ALL PRIMARY NULL NULL NULL 200 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity i_l_partkey 5 dbt3_s001.part.p_partkey 30 Using where
+1 SIMPLE lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity i_l_suppkey_partkey 5 dbt3_s001.part.p_partkey 30 Using index condition
1 SIMPLE supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.lineitem.l_suppkey 1 Using where
1 SIMPLE n2 eq_ref PRIMARY PRIMARY 4 dbt3_s001.supplier.s_nationkey 1
1 SIMPLE orders eq_ref PRIMARY,i_o_orderdate,i_o_custkey PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 Using where
1 SIMPLE customer eq_ref PRIMARY,i_c_nationkey PRIMARY 4 dbt3_s001.orders.o_custkey 1 Using where
-1 SIMPLE n1 eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.customer.c_nationkey 1 Using where
+1 SIMPLE n1 eq_ref PRIMARY,i_n_regionkey i_n_regionkey 9 dbt3_s001.region.r_regionkey,dbt3_s001.customer.c_nationkey 1 Using index
select o_year,
sum(case when nation = 'UNITED STATES' then volume else 0 end) /
sum(volume) as mkt_share
@@ -289,6 +289,26 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE part eq_ref PRIMARY PRIMARY 4 dbt3_s001.partsupp.ps_partkey 1 Using where
1 SIMPLE lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.supplier.s_suppkey 8
1 SIMPLE orders eq_ref PRIMARY PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1
+EXPLAIN EXTENDED select nation, o_year, sum(amount) as sum_profit
+from (select n_name as nation,
+extract(year from o_orderdate) as o_year,
+l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount
+from part, supplier, lineitem, partsupp, orders, nation
+where s_suppkey = l_suppkey and ps_suppkey = l_suppkey
+and ps_partkey = l_partkey and p_partkey = l_partkey
+and o_orderkey = l_orderkey and s_nationkey = n_nationkey
+and p_name like '%green%') as profit
+group by nation, o_year
+order by nation, o_year desc;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE supplier index PRIMARY,i_s_nationkey i_s_nationkey 5 NULL 10 100.00 Using where; Using index; Using temporary; Using filesort
+1 SIMPLE nation eq_ref PRIMARY PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00
+1 SIMPLE partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey i_ps_suppkey 4 dbt3_s001.supplier.s_suppkey 70 100.00
+1 SIMPLE part eq_ref PRIMARY PRIMARY 4 dbt3_s001.partsupp.ps_partkey 1 100.00 Using where
+1 SIMPLE lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.supplier.s_suppkey 8 100.00
+1 SIMPLE orders eq_ref PRIMARY PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 100.00
+Warnings:
+Note 1003 select `dbt3_s001`.`nation`.`n_name` AS `nation`,extract(year from `dbt3_s001`.`orders`.`o_orderDATE`) AS `o_year`,sum(`dbt3_s001`.`lineitem`.`l_extendedprice` * (1 - `dbt3_s001`.`lineitem`.`l_discount`) - `dbt3_s001`.`partsupp`.`ps_supplycost` * `dbt3_s001`.`lineitem`.`l_quantity`) AS `sum_profit` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`lineitem` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`orders` join `dbt3_s001`.`nation` where `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`orders`.`o_orderkey` = `dbt3_s001`.`lineitem`.`l_orderkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`part`.`p_name` like '%green%' group by `dbt3_s001`.`nation`.`n_name`,extract(year from `dbt3_s001`.`orders`.`o_orderDATE`) desc order by `dbt3_s001`.`nation`.`n_name`,extract(year from `dbt3_s001`.`orders`.`o_orderDATE`) desc
select nation, o_year, sum(amount) as sum_profit
from (select n_name as nation,
extract(year from o_orderdate) as o_year,
@@ -444,7 +464,7 @@ EXPLAIN
SELECT * FROM t1 STRAIGHT_JOIN t2 WHERE name IN ( 'AUS','YEM' ) AND id = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index
-1 SIMPLE t2 ALL NULL NULL NULL NULL 0 Using where
+1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where
ANALYZE TABLE t2;
Table Op Msg_type Msg_text
test.t2 analyze status Engine-independent statistics collected
@@ -623,8 +643,8 @@ set @@use_stat_tables= PREFERABLY;
explain
SELECT * FROM INFORMATION_SCHEMA.PROFILING, mysql.user;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE PROFILING ALL NULL NULL NULL NULL NULL
-1 SIMPLE global_priv ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
+1 SIMPLE global_priv ALL NULL NULL NULL NULL 5
+1 SIMPLE PROFILING ALL NULL NULL NULL NULL NULL Using join buffer (flat, BNL join)
set @@optimizer_use_condition_selectivity=@save_optimizer_use_condition_selectivity;
set use_stat_tables=@save_use_stat_tables;
#
diff --git a/mysql-test/main/statistics_json.result b/mysql-test/main/statistics_json.result
index 7a6ed6d2..0d1953e9 100644
--- a/mysql-test/main/statistics_json.result
+++ b/mysql-test/main/statistics_json.result
@@ -7782,12 +7782,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 18,
+ "cost": "COST_REPLACED",
"filtered": 5.555555344,
"attached_condition": "t1.a > 'y'"
}
diff --git a/mysql-test/main/statistics_json.test b/mysql-test/main/statistics_json.test
index 5263a98f..b9a5c3db 100644
--- a/mysql-test/main/statistics_json.test
+++ b/mysql-test/main/statistics_json.test
@@ -477,6 +477,7 @@ INSERT INTO t1 VALUES ('o'),('s'),('j'),('s'),('y'),('s'),('l'),
set histogram_type=json_hb;
analyze table t1 persistent for all;
--echo # filtered must not be negative:
+--source include/explain-no-costs.inc
explain format=json select * from t1 where a > 'y';
drop table t1;
diff --git a/mysql-test/main/statistics_upgrade.test b/mysql-test/main/statistics_upgrade.test
index 9f47ab1a..72de08be 100644
--- a/mysql-test/main/statistics_upgrade.test
+++ b/mysql-test/main/statistics_upgrade.test
@@ -44,8 +44,8 @@ alter table t3 rename mysql.column_stats;
--exec $MYSQL_UPGRADE --upgrade-system-tables --force --silent 2>&1
let $MYSQLD_DATADIR= `select @@datadir`;
---file_exists $MYSQLD_DATADIR/mysql_upgrade_info
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--file_exists $MYSQLD_DATADIR/mariadb_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
--echo #
--echo # Table definition after upgrade:
diff --git a/mysql-test/main/statistics_upgrade_not_done.test b/mysql-test/main/statistics_upgrade_not_done.test
index a74a5f35..d38a387b 100644
--- a/mysql-test/main/statistics_upgrade_not_done.test
+++ b/mysql-test/main/statistics_upgrade_not_done.test
@@ -50,8 +50,8 @@ select * from mysql.column_stats where table_name='t2' and db_name='test';
--exec $MYSQL_UPGRADE --upgrade-system-tables --force --silent 2>&1
let $MYSQLD_DATADIR= `select @@datadir`;
---file_exists $MYSQLD_DATADIR/mysql_upgrade_info
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--file_exists $MYSQLD_DATADIR/mariadb_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
analyze select * from t0 where a<3;
drop table t0, t1, t2;
diff --git a/mysql-test/main/status.result b/mysql-test/main/status.result
index d17bd9c6..9a4dd7c9 100644
--- a/mysql-test/main/status.result
+++ b/mysql-test/main/status.result
@@ -71,10 +71,10 @@ a
6
show status like 'last_query_cost';
Variable_name Value
-Last_query_cost 12.084449
+Last_query_cost 0.017856
show status like 'last_query_cost';
Variable_name Value
-Last_query_cost 12.084449
+Last_query_cost 0.017856
select 1;
1
1
@@ -134,20 +134,20 @@ a
1
SHOW SESSION STATUS LIKE 'Last_query_cost';
Variable_name Value
-Last_query_cost 2.402418
+Last_query_cost 0.010348
EXPLAIN SELECT a FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
SHOW SESSION STATUS LIKE 'Last_query_cost';
Variable_name Value
-Last_query_cost 2.402418
+Last_query_cost 0.010348
SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY a;
a
1
2
SHOW SESSION STATUS LIKE 'Last_query_cost';
Variable_name Value
-Last_query_cost 0.000000
+Last_query_cost 0.010348
EXPLAIN SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
@@ -155,25 +155,25 @@ id select_type table type possible_keys key key_len ref rows Extra
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL Using filesort
SHOW SESSION STATUS LIKE 'Last_query_cost';
Variable_name Value
-Last_query_cost 0.000000
+Last_query_cost 0.010348
SELECT a IN (SELECT a FROM t1) FROM t1 LIMIT 1;
a IN (SELECT a FROM t1)
1
SHOW SESSION STATUS LIKE 'Last_query_cost';
Variable_name Value
-Last_query_cost 0.000000
+Last_query_cost 0.010348
SELECT (SELECT a FROM t1 LIMIT 1) x FROM t1 LIMIT 1;
x
1
SHOW SESSION STATUS LIKE 'Last_query_cost';
Variable_name Value
-Last_query_cost 0.000000
+Last_query_cost 0.010348
SELECT * FROM t1 a, t1 b LIMIT 1;
a a
1 1
SHOW SESSION STATUS LIKE 'Last_query_cost';
Variable_name Value
-Last_query_cost 5.205836
+Last_query_cost 0.021190
DROP TABLE t1;
connect con1,localhost,root,,;
show status like 'com_show_status';
@@ -447,3 +447,22 @@ Feature_json 2
connection default;
set @@global.concurrent_insert= @old_concurrent_insert;
SET GLOBAL log_output = @old_log_output;
+#
+# MDEV-30543 New status variable: Max_used_connections_time
+#
+FLUSH STATUS;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
+disconnect con2;
+SELECT 'DTVALUE' = 'DTVALUE' AS expect_1;
+expect_1
+1
+connect con3,localhost,root,,;
+connect con4,localhost,root,,;
+SELECT 'DTVALUE' < 'DTVALUE' as expect_1;
+expect_1
+1
+disconnect con4;
+disconnect con3;
+disconnect con1;
diff --git a/mysql-test/main/status.test b/mysql-test/main/status.test
index a1baa36b..acf29f35 100644
--- a/mysql-test/main/status.test
+++ b/mysql-test/main/status.test
@@ -442,3 +442,34 @@ SET GLOBAL log_output = @old_log_output;
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
+--echo #
+--echo # MDEV-30543 New status variable: Max_used_connections_time
+--echo #
+
+FLUSH STATUS;
+
+connect (con1,localhost,root,,);
+--sleep 1
+connect (con2,localhost,root,,);
+--sleep 1
+let $time_1=`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections_time'`;
+--sleep 1
+connection con1;
+disconnect con2;
+--sleep 1
+let $time_2=`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections_time'`;
+--replace_regex /[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*/DTVALUE/
+eval SELECT '$time_1' = '$time_2' AS expect_1;
+--sleep 1
+connect (con3,localhost,root,,);
+--sleep 1
+connect (con4,localhost,root,,);
+--sleep 1
+let $time_3=`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections_time'`;
+--replace_regex /[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*/DTVALUE/
+eval SELECT '$time_1' < '$time_3' as expect_1;
+
+disconnect con4;
+disconnect con3;
+disconnect con1;
+
diff --git a/mysql-test/main/status2.result b/mysql-test/main/status2.result
index 60309e14..78d658a7 100644
--- a/mysql-test/main/status2.result
+++ b/mysql-test/main/status2.result
@@ -83,3 +83,121 @@ variable_value < 1024*1024*1024
#
# End of 10.2 tests
#
+#
+# MDEV-32441 SENT_ROWS shows random wrong values when stored function
+# is selected
+#
+create table t1 (a int) engine=aria;
+insert into t1 values (1),(2),(3),(4),(5),(6),(7);
+flush status;
+create function if not exists f() returns int return
+(
+select sum(a) > 0 from t1
+);
+select f() from seq_1_to_10 where seq%5 = 0;
+f()
+1
+1
+show status like "rows_sent";
+Variable_name Value
+Rows_sent 2
+# Test simple query
+set debug_sync='RESET';
+connect con1,localhost,root,,;
+set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go';
+select f() from seq_1_to_10 where seq%5 = 0;
+connection default;
+set debug_sync='now WAIT_FOR parked';
+# Result should be 2, 10+7*2=24
+select sent_rows, examined_rows from information_schema.processlist where id=#;
+sent_rows examined_rows
+2 24
+set debug_sync='now signal go';
+connection con1;
+f()
+1
+1
+# Test union
+set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go';
+select a from t1 where a not in (1,2,3,4) union select a from t1 where a not in (4,5,6,7);
+connection default;
+set debug_sync='now WAIT_FOR parked';
+# Result should be 6, 7+7+6=20 (2 scans of 7 rows + 6 rows in union)
+select sent_rows, examined_rows from information_schema.processlist where id=#;
+sent_rows examined_rows
+6 20
+set debug_sync='now signal go';
+connection con1;
+a
+5
+6
+7
+1
+2
+3
+# Test handler calls
+handler t1 open;
+set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go';
+handler t1 read NEXT LIMIT 2,4;
+connection default;
+set debug_sync='now WAIT_FOR parked';
+# Result should be 2, 10+7*2=24
+select sent_rows, examined_rows from information_schema.processlist where id=#;
+sent_rows examined_rows
+4 6
+set debug_sync='now signal go';
+connection con1;
+a
+3
+4
+5
+6
+handler t1 close;
+connection default;
+drop function f;
+drop table t1;
+# Test Stored procedures
+create or replace table t (a int primary key);
+insert into t select seq from seq_1_to_100;
+create procedure pr()
+begin
+select * from t where a between 1 and 2 ;
+select * from t where a between 4 and 6 ;
+end $
+connection con1;
+flush status;
+set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go EXECUTE 2';
+call pr();
+connection default;
+set debug_sync='now WAIT_FOR parked';
+select examined_rows, sent_rows, info from information_schema.processlist where id=#;
+examined_rows sent_rows info
+2 2 select * from t where a between 1 and 2
+set debug_sync='now signal go';
+select examined_rows, sent_rows, info from information_schema.processlist where id=#;
+examined_rows sent_rows info
+3 3 select * from t where a between 4 and 6
+set debug_sync='now signal go';
+connection con1;
+a
+1
+2
+a
+4
+5
+6
+show status like '%rows%';
+Variable_name Value
+Not_flushed_delayed_rows 0
+Rows_read 8
+Rows_sent 5
+Rows_tmp_read 0
+Sort_rows 0
+connection default;
+drop table t;
+drop procedure pr;
+disconnect con1;
+set debug_sync= RESET;
+#
+# End of 11.3 tests
+#
diff --git a/mysql-test/main/status2.test b/mysql-test/main/status2.test
index 339e853f..1cc53b2b 100644
--- a/mysql-test/main/status2.test
+++ b/mysql-test/main/status2.test
@@ -1,4 +1,7 @@
--source include/not_embedded.inc
+--source include/have_sequence.inc
+--source include/have_debug_sync.inc
+--source include/have_sequence.inc
--echo #
--echo # Bug#24289 Status Variable "Questions" gets wrong values with Stored Routines
@@ -77,3 +80,112 @@ select variable_value < 1024*1024*1024 from information_schema.global_status whe
--echo # End of 10.2 tests
--echo #
+--echo #
+--echo # MDEV-32441 SENT_ROWS shows random wrong values when stored function
+--echo # is selected
+--echo #
+
+create table t1 (a int) engine=aria;
+insert into t1 values (1),(2),(3),(4),(5),(6),(7);
+flush status;
+create function if not exists f() returns int return
+(
+ select sum(a) > 0 from t1
+);
+
+--disable_ps_protocol
+select f() from seq_1_to_10 where seq%5 = 0;
+show status like "rows_sent";
+--enable_ps_protocol
+
+--echo # Test simple query
+
+set debug_sync='RESET';
+--connect(con1,localhost,root,,)
+--let $conid= `select connection_id()`
+--let $replace_conid=id=$conid
+set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go';
+--send select f() from seq_1_to_10 where seq%5 = 0
+
+--connection default
+set debug_sync='now WAIT_FOR parked';
+--echo # Result should be 2, 10+7*2=24
+--replace_result $replace_conid id=#
+eval select sent_rows, examined_rows from information_schema.processlist where id=$conid;
+set debug_sync='now signal go';
+--connection con1
+--reap
+
+--echo # Test union
+
+set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go';
+--send select a from t1 where a not in (1,2,3,4) union select a from t1 where a not in (4,5,6,7)
+--connection default
+set debug_sync='now WAIT_FOR parked';
+--echo # Result should be 6, 7+7+6=20 (2 scans of 7 rows + 6 rows in union)
+--replace_result $replace_conid id=#
+eval select sent_rows, examined_rows from information_schema.processlist where id=$conid;
+set debug_sync='now signal go';
+--connection con1
+--reap
+
+--echo # Test handler calls
+handler t1 open;
+set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go';
+--send handler t1 read NEXT LIMIT 2,4
+--connection default
+set debug_sync='now WAIT_FOR parked';
+--echo # Result should be 2, 10+7*2=24
+--replace_result $replace_conid id=#
+eval select sent_rows, examined_rows from information_schema.processlist where id=$conid;
+set debug_sync='now signal go';
+--connection con1
+--reap
+handler t1 close;
+
+--connection default
+drop function f;
+drop table t1;
+
+--echo # Test Stored procedures
+
+create or replace table t (a int primary key);
+insert into t select seq from seq_1_to_100;
+--delimiter $
+create procedure pr()
+begin
+ select * from t where a between 1 and 2 ;
+ select * from t where a between 4 and 6 ;
+end $
+--delimiter ;
+
+--connection con1
+flush status;
+set debug_sync='end_of_statement SIGNAL parked WAIT_FOR go EXECUTE 2';
+
+--send call pr()
+
+--connection default
+set debug_sync='now WAIT_FOR parked';
+--replace_result $replace_conid id=#
+eval select examined_rows, sent_rows, info from information_schema.processlist where id=$conid;
+set debug_sync='now signal go';
+--replace_result $replace_conid id=#
+eval select examined_rows, sent_rows, info from information_schema.processlist where id=$conid;
+set debug_sync='now signal go';
+
+--connection con1
+--reap
+show status like '%rows%';
+
+connection default;
+# Cleanup
+drop table t;
+drop procedure pr;
+
+--disconnect con1
+set debug_sync= RESET;
+
+--echo #
+--echo # End of 11.3 tests
+--echo #
diff --git a/mysql-test/main/subselect.result b/mysql-test/main/subselect.result
index 9fbf36e3..62709070 100644
--- a/mysql-test/main/subselect.result
+++ b/mysql-test/main/subselect.result
@@ -365,7 +365,7 @@ patient_uq clinic_uq
explain extended select * from t6 where exists (select * from t7 where uq = clinic_uq);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t7 index PRIMARY PRIMARY 4 NULL 2 100.00 Using index
-1 PRIMARY t6 ALL i1 NULL NULL NULL 4 100.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t6 ref i1 i1 5 test.t7.uq 1 100.00
Warnings:
Note 1276 Field or reference 'test.t6.clinic_uq' of SELECT #2 was resolved in SELECT #1
Note 1003 select `test`.`t6`.`patient_uq` AS `patient_uq`,`test`.`t6`.`clinic_uq` AS `clinic_uq` from `test`.`t7` join `test`.`t6` where `test`.`t6`.`clinic_uq` = `test`.`t7`.`uq`
@@ -660,7 +660,18 @@ a b
22 11
2 12
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t12 where t11.a = t12.a);
-ERROR HY000: Table 't12' is specified twice, both as a target for 'DELETE' and as a separate source for data
+select * from t11;
+a b
+0 10
+1 11
+select * from t12;
+a b
+33 10
+22 11
+delete from t11;
+delete from t12;
+insert into t11 values (0, 10),(1, 11),(2, 12);
+insert into t12 values (33, 10),(22, 11),(2, 12);
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2);
ERROR 21000: Subquery returns more than 1 row
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2 where t11.a = t2.a);
@@ -954,6 +965,9 @@ select (select a+1) from t1;
NULL
4.5
drop table t1;
+#
+# Null with keys
+#
CREATE TABLE t1 (a int(11) NOT NULL default '0', PRIMARY KEY (a));
CREATE TABLE t2 (a int(11) default '0', INDEX (a));
INSERT INTO t1 VALUES (1),(2),(3),(4);
@@ -1485,6 +1499,9 @@ drop table if exists t1;
(SELECT 1 as a) UNION (SELECT 1) ORDER BY (SELECT a+0);
a
1
+#
+# IN subselect optimization test
+#
create table t1 (a int not null, b int, primary key (a));
create table t2 (a int not null, primary key (a));
create table t3 (a int not null, b int, primary key (a));
@@ -1508,21 +1525,21 @@ a
4
explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index
-1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1 100.00 Using where
+1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where
+1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index
Warnings:
-Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30
+Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t1`.`b` <> 30
select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
a
2
3
explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index
-1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1 100.00
-1 PRIMARY t3 index PRIMARY PRIMARY 4 NULL 3 100.00 Using where; Using index; Using join buffer (flat, BNL join)
+1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where
+1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index
+1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index
Warnings:
-Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t1`.`a` = `test`.`t2`.`a`
+Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t2`.`a` = `test`.`t1`.`a`
drop table t1, t2, t3;
create table t1 (a int, b int, index a (a,b));
create table t2 (a int, index a (a));
@@ -1531,42 +1548,48 @@ insert into t1 values (1,10), (2,20), (3,30), (4,40);
create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
insert into t1
-select rand()*100000+200,rand()*100000 from t0 A, t0 B, t0 C, t0 D;
+select rand()*100000+200,rand(1)*100000 from t0 A, t0 B, t0 C, t0 D;
insert into t2 values (2), (3), (4), (5);
insert into t3 values (10,3), (20,4), (30,5);
-select * from t2 where t2.a in (select a from t1);
-a
-2
-3
-4
explain extended select * from t2 where t2.a in (select a from t1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index
-1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using index; FirstMatch(t2)
+1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using index; FirstMatch(t2)
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a`
-select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
+select * from t2 where t2.a in (select a from t1);
a
2
+3
4
explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index
-1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using where; Using index; FirstMatch(t2)
+1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using where; Using index; FirstMatch(t2)
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30
-select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
+select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
a
2
-3
+4
explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index
1 PRIMARY t3 range a a 5 NULL 3 100.00 Using where; Using index
-1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 100.00 Using index; FirstMatch(t2)
+1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 0.29 Using index; FirstMatch(t2)
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where `test`.`t1`.`b` = `test`.`t3`.`a` and `test`.`t1`.`a` = `test`.`t2`.`a`
+select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
+a
+2
+3
insert into t1 values (3,31);
+explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index
+1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using where; Using index; FirstMatch(t2)
+Warnings:
+Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30
select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
a
2
@@ -1576,12 +1599,6 @@ select * from t2 where t2.a in (select a from t1 where t1.b <> 30 and t1.b <> 31
a
2
4
-explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index
-1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using where; Using index; FirstMatch(t2)
-Warnings:
-Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30
drop table t0, t1, t2, t3;
create table t1 (a int, b int);
create table t2 (a int, b int);
@@ -1643,6 +1660,9 @@ Note 1003 (select 'tttt' AS `s1` from dual)
s1
tttt
drop table t1;
+#
+# IN optimisation test results
+#
create table t1 (s1 char(5), index s1(s1));
create table t2 (s1 char(5), index s1(s1));
insert into t1 values ('a1'),('a2'),('a3');
@@ -2476,20 +2496,23 @@ a
1
3
DROP TABLE t1;
+#
+# SELECT(EXISTS * ...)optimisation
+#
create table t1 (a int, b int);
-insert into t1 values (1,2),(3,4);
-select * from t1 up where exists (select * from t1 where t1.a=up.a);
-a b
-1 2
-3 4
-explain extended select * from t1 up where exists (select * from t1 where t1.a=up.a);
+insert into t1 values (1,2),(3,4),(5,6),(7,8);
+insert into t1 select seq,seq from seq_20_to_40;
+select sum(a+b) from t1 up where exists (select * from t1 where t1.a=up.a);
+sum(a+b)
+1296
+explain extended select sum(a+b) from t1 up where exists (select * from t1 where t1.a=up.a);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY up ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY up ALL NULL NULL NULL NULL 25 100.00
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00
+2 MATERIALIZED t1 ALL NULL NULL NULL NULL 25 100.00
Warnings:
Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1
-Note 1003 select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` semi join (`test`.`t1`) where 1
+Note 1003 select sum(`test`.`up`.`a` + `test`.`up`.`b`) AS `sum(a+b)` from `test`.`t1` `up` semi join (`test`.`t1`) where 1
drop table t1;
CREATE TABLE t1 (t1_a int);
INSERT INTO t1 VALUES (1);
@@ -3157,9 +3180,13 @@ retailerID statusID changed
0048 1 2006-01-06 12:37:50
0059 1 2006-01-06 12:37:50
drop table t1;
+#
+# Bug#21180 Subselect with index for both WHERE and ORDER BY
+# produces empty result
+#
create table t1(a int, primary key (a));
insert into t1 values (10);
-create table t2 (a int primary key, b varchar(32), c int, unique key b(c, b));
+create table t2 (a int primary key, b varchar(32), c int, unique key cb(c, b));
insert into t2(a, c, b) values (1,10,'359'), (2,10,'35988'), (3,10,'35989');
insert into t2(a, c, b) values (4,10,'360'), (5,10,'35998'), (6,10,'35999');
analyze table t1;
@@ -3172,7 +3199,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system PRIMARY NULL NULL NULL 1
1 PRIMARY r const PRIMARY PRIMARY 4 const 1
-2 SUBQUERY t2 range b b 40 NULL 3 Using where
+2 SUBQUERY t2 range cb cb 40 NULL 3 Using where
SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r
ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10;
@@ -3184,7 +3211,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system PRIMARY NULL NULL NULL 1
1 PRIMARY r const PRIMARY PRIMARY 4 const 1
-2 SUBQUERY t2 range b b 40 NULL 3 Using index condition
+2 SUBQUERY t2 range cb cb 40 NULL 3 Using index condition
SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r
ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10;
@@ -4279,8 +4306,8 @@ INSERT INTO t2 VALUES (7), (5), (1), (3);
SELECT id, st FROM t1
WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id);
id st
-3 FL
1 GA
+3 FL
7 FL
SELECT id, st FROM t1
WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id)
@@ -4381,6 +4408,9 @@ SELECT ((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL FROM t1;
0
0
DROP TABLE t1, t2;
+#
+# Bug#28076 inconsistent binary/varbinary comparison
+#
CREATE TABLE t1 (s1 BINARY(5), s2 VARBINARY(5));
INSERT INTO t1 VALUES (0x41,0x41), (0x42,0x42), (0x43,0x43);
SELECT s1, s2 FROM t1 WHERE s2 IN (SELECT s1 FROM t1);
@@ -4442,8 +4472,8 @@ CREATE INDEX I1 ON t1 (a);
CREATE INDEX I2 ON t1 (b);
EXPLAIN SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL I2 NULL NULL NULL 2 Using where
-1 PRIMARY t1 ref I1 I1 2 test.t1.b 2 Using where; Using index; FirstMatch(t1)
+1 PRIMARY t1 index I1 I1 2 NULL 2 Using where; Using index; LooseScan
+1 PRIMARY t1 ref I2 I2 13 test.t1.a 1 Using index condition
SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1);
a b
CREATE TABLE t2 (a VARCHAR(1), b VARCHAR(10));
@@ -4452,15 +4482,15 @@ CREATE INDEX I1 ON t2 (a);
CREATE INDEX I2 ON t2 (b);
EXPLAIN SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 ALL I2 NULL NULL NULL 2 Using where
-1 PRIMARY t2 ref I1 I1 4 test.t2.b 2 Using where; Using index; FirstMatch(t2)
+1 PRIMARY t2 index I1 I1 4 NULL 2 Using where; Using index; LooseScan
+1 PRIMARY t2 ref I2 I2 13 test.t2.a 1 Using index condition
SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2);
a b
EXPLAIN
SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL I2 NULL NULL NULL 2 Using where
-1 PRIMARY t1 ref I1 I1 2 test.t1.b 2 Using where; Using index; FirstMatch(t1)
+1 PRIMARY t1 index I1 I1 2 NULL 2 Using where; Using index; LooseScan
+1 PRIMARY t1 ref I2 I2 13 test.t1.a 1 Using index condition
SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500);
a b
DROP TABLE t1,t2;
@@ -4490,10 +4520,13 @@ out_a MIN(b)
1 2
2 4
DROP TABLE t1;
+#
+# Bug#32036 EXISTS within a WHERE clause with a UNION crashes MySQL 5.122
+#
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
-INSERT INTO t1 VALUES (1),(2);
-INSERT INTO t2 VALUES (1),(2);
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+INSERT INTO t2 VALUES (1),(2),(1000);
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
2
2
@@ -4501,19 +4534,18 @@ SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
EXPLAIN EXTENDED
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 33.33 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
-Note 1003 select 2 AS `2` from `test`.`t1` semi join (`test`.`t2`) where 1
+Note 1003 select 2 AS `2` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`a` = `test`.`t1`.`a`
EXPLAIN EXTENDED
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION
(SELECT 1 FROM t2 WHERE t1.a = t2.a));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
-2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
-3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where
+3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 3 100.00 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
@@ -5752,7 +5784,8 @@ DROP TABLE IF EXISTS ot1, ot4, it2, it3;
CREATE TABLE t1 (a int) ;
INSERT INTO t1 VALUES (NULL), (1), (NULL), (2);
CREATE TABLE t2 (a int, INDEX idx(a)) ;
-INSERT INTO t2 VALUES (NULL), (1), (NULL);
+INSERT INTO t2 VALUES (NULL), (1), (NULL),(1000);
+insert into t2 select seq from seq_3_to_500;
SELECT * FROM t1
WHERE EXISTS (SELECT a FROM t2 USE INDEX () WHERE t2.a = t1.a);
a
@@ -5763,7 +5796,7 @@ WHERE EXISTS (SELECT a FROM t2 USE INDEX() WHERE t2.a = t1.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 502
SELECT * FROM t1
WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a);
a
@@ -5772,9 +5805,8 @@ EXPLAIN
SELECT * FROM t1
WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 index idx idx 5 NULL 3 Using index
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
+1 PRIMARY t2 ref idx idx 5 test.t1.a 11 Using index; FirstMatch(t1)
DROP TABLE t1,t2;
#
# BUG#752992: Wrong results for a subquery with 'semijoin=on'
@@ -5791,9 +5823,9 @@ SET @save_join_cache_level=@@join_cache_level;
SET join_cache_level=0;
EXPLAIN SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 3
-1 PRIMARY it eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 Using index
-1 PRIMARY t2 index NULL PRIMARY 4 NULL 3 Using index; FirstMatch(it)
+1 PRIMARY it index PRIMARY PRIMARY 4 NULL 3 Using index
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.it.pk 1
+1 PRIMARY t2 index NULL PRIMARY 4 NULL 3 Using index; FirstMatch(t1)
SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1);
pk i
11 0
@@ -6134,8 +6166,7 @@ WHERE col_varchar_nokey IN
(SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY ot system NULL NULL NULL NULL 1
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED it1 ref idx_cvk_cik idx_cvk_cik 9 const,const 1 Using where; Using index
+1 PRIMARY it1 ref idx_cvk_cik idx_cvk_cik 9 const,const 1 Using where; Using index; FirstMatch(ot)
SELECT col_int_nokey FROM ot
WHERE col_varchar_nokey IN
(SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL);
@@ -6147,8 +6178,7 @@ WHERE (col_varchar_nokey, 'x') IN
(SELECT col_varchar_key, col_varchar_key2 FROM it2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY ot system NULL NULL NULL NULL 1
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1
-2 MATERIALIZED it2 ref idx_cvk_cvk2_cik,idx_cvk_cik idx_cvk_cvk2_cik 8 const,const 1 Using where; Using index
+1 PRIMARY it2 ref idx_cvk_cvk2_cik,idx_cvk_cik idx_cvk_cvk2_cik 8 const,const 1 Using where; Using index; FirstMatch(ot)
SELECT col_int_nokey FROM ot
WHERE (col_varchar_nokey, 'x') IN
(SELECT col_varchar_key, col_varchar_key2 FROM it2);
@@ -6718,7 +6748,7 @@ SET @@optimizer_switch='semijoin=off,materialization=off,in_to_exists=on,subquer
EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL a 4 NULL 2 Using where; Using index
-2 DEPENDENT SUBQUERY t1 index_subquery a a 4 func 2 Using index
+2 DEPENDENT SUBQUERY t1 index_subquery a a 4 func 1 Using index
SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1);
a
2009-01-01
@@ -6923,7 +6953,7 @@ FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias1 index a a 19 NULL 11 Using where; Using index
-1 PRIMARY alias2 ref a a 19 test.alias1.a 2 Using index
+1 PRIMARY alias2 ref a a 19 test.alias1.a 1 Using index
1 PRIMARY alias3 index NULL a 19 NULL 11 Using index; Using join buffer (flat, BNL join)
2 SUBQUERY t1 index_subquery a a 19 const 1 Using index; Using where
SELECT MAX( alias2.a )
@@ -7082,7 +7112,7 @@ WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where
-1 PRIMARY t3 ref d d 5 test.t2.b 2 Using index
+1 PRIMARY t3 ref d d 5 test.t2.b 1 Using index
3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
set @tmp_mdev410=@@global.userstat;
set global userstat=on;
@@ -7114,7 +7144,7 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP B
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
-2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
+2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index
DROP TABLE t1,t2;
#
# MDEV-435: Expensive subqueries may be evaluated during optimization in merge_key_fields
@@ -7148,7 +7178,7 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP B
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
-2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
+2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index
DROP TABLE t1,t2;
#
# MDEV-5991: crash in Item_field::used_tables
@@ -7561,3 +7591,45 @@ drop table t1, t2, t3;
#
# End of 10.6 tests
#
+#
+# MDEV-32656: ASAN errors in base_list_iterator::next /
+# setup_table_map upon 2nd execution of PS
+# (10.10 part)
+#
+CREATE TABLE t1 (id BIGINT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE TABLE t2 (a INT);
+INSERT INTO t2 VALUES (2),(3);
+CREATE TABLE t3 (b INT);
+INSERT INTO t3 VALUES (3),(4);
+PREPARE stmt FROM "UPDATE t2 SET a = 1 WHERE (select 1 where ('e','e') IN (SELECT v1.id, v1.id FROM v1 JOIN t3)) <> 0";
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+PREPARE stmt FROM "UPDATE t2 SET a = 1 WHERE ('e') IN (SELECT v1.id FROM v1 JOIN t3)";
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+PREPARE stmt FROM "UPDATE t2 SET a = 1 WHERE ('e','e') IN (SELECT v1.id, v1.id FROM v1 JOIN t3)";
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+DROP VIEW v1;
+DROP TABLE t1, t2, t3;
+#
+# End of 10.10 tests
+#
diff --git a/mysql-test/main/subselect.test b/mysql-test/main/subselect.test
index 002d5ced..5ad1aabd 100644
--- a/mysql-test/main/subselect.test
+++ b/mysql-test/main/subselect.test
@@ -7,6 +7,7 @@
# as possible.
#
# Initialise
+--source include/have_sequence.inc
--disable_warnings
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t11,t12;
drop view if exists v2;
@@ -398,8 +399,13 @@ insert into t12 values (33, 10),(22, 11),(2, 12);
insert into t2 values (1, 21),(2, 12),(3, 23);
select * from t11;
select * from t12;
--- error ER_UPDATE_TABLE_USED
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t12 where t11.a = t12.a);
+select * from t11;
+select * from t12;
+delete from t11;
+delete from t12;
+insert into t11 values (0, 10),(1, 11),(2, 12);
+insert into t12 values (33, 10),(22, 11),(2, 12);
-- error ER_SUBQUERY_NO_1_ROW
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2);
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2 where t11.a = t2.a);
@@ -559,9 +565,9 @@ explain extended select (select a+1) from t1;
select (select a+1) from t1;
drop table t1;
-#
-# Null with keys
-#
+--echo #
+--echo # Null with keys
+--echo #
CREATE TABLE t1 (a int(11) NOT NULL default '0', PRIMARY KEY (a));
CREATE TABLE t2 (a int(11) default '0', INDEX (a));
@@ -928,9 +934,9 @@ drop table if exists t1;
(SELECT 1 as a) UNION (SELECT 1) ORDER BY (SELECT a+0);
-#
-# IN subselect optimization test
-#
+--echo #
+--echo # IN subselect optimization test
+--echo #
create table t1 (a int not null, b int, primary key (a));
create table t2 (a int not null, primary key (a));
create table t3 (a int not null, b int, primary key (a));
@@ -952,20 +958,20 @@ insert into t1 values (1,10), (2,20), (3,30), (4,40);
create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
insert into t1
-select rand()*100000+200,rand()*100000 from t0 A, t0 B, t0 C, t0 D;
+select rand()*100000+200,rand(1)*100000 from t0 A, t0 B, t0 C, t0 D;
insert into t2 values (2), (3), (4), (5);
insert into t3 values (10,3), (20,4), (30,5);
-select * from t2 where t2.a in (select a from t1);
explain extended select * from t2 where t2.a in (select a from t1);
-select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
+select * from t2 where t2.a in (select a from t1);
explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
-select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
+select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
+select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
insert into t1 values (3,31);
+explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
select * from t2 where t2.a in (select a from t1 where t1.b <> 30 and t1.b <> 31);
-explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
drop table t0, t1, t2, t3;
#
@@ -1036,13 +1042,14 @@ explain extended (select * from t1);
(select * from t1);
drop table t1;
-#
-# IN optimisation test results
-#
+--echo #
+--echo # IN optimisation test results
+--echo #
create table t1 (s1 char(5), index s1(s1));
create table t2 (s1 char(5), index s1(s1));
insert into t1 values ('a1'),('a2'),('a3');
insert into t2 values ('a1'),('a2');
+
select s1, s1 NOT IN (SELECT s1 FROM t2) from t1;
select s1, s1 = ANY (SELECT s1 FROM t2) from t1;
select s1, s1 <> ALL (SELECT s1 FROM t2) from t1;
@@ -1471,15 +1478,16 @@ SELECT a FROM t1 WHERE a <> ALL (SELECT a FROM t1 WHERE b = '2');
DROP TABLE t1;
-#
-# SELECT(EXISTS * ...)optimisation
-#
+--echo #
+--echo # SELECT(EXISTS * ...)optimisation
+--echo #
#--view-protocol is disabled because view gives another query plan
--disable_view_protocol
create table t1 (a int, b int);
-insert into t1 values (1,2),(3,4);
-select * from t1 up where exists (select * from t1 where t1.a=up.a);
-explain extended select * from t1 up where exists (select * from t1 where t1.a=up.a);
+insert into t1 values (1,2),(3,4),(5,6),(7,8);
+insert into t1 select seq,seq from seq_20_to_40;
+select sum(a+b) from t1 up where exists (select * from t1 where t1.a=up.a);
+explain extended select sum(a+b) from t1 up where exists (select * from t1 where t1.a=up.a);
drop table t1;
--enable_view_protocol
@@ -2080,14 +2088,14 @@ select * from t1 r1
drop table t1;
-#
-# Bug#21180 Subselect with index for both WHERE and ORDER BY
-# produces empty result
-#
+--echo #
+--echo # Bug#21180 Subselect with index for both WHERE and ORDER BY
+--echo # produces empty result
+--echo #
create table t1(a int, primary key (a));
insert into t1 values (10);
-create table t2 (a int primary key, b varchar(32), c int, unique key b(c, b));
+create table t2 (a int primary key, b varchar(32), c int, unique key cb(c, b));
insert into t2(a, c, b) values (1,10,'359'), (2,10,'35988'), (3,10,'35989');
insert into t2(a, c, b) values (4,10,'360'), (5,10,'35998'), (6,10,'35999');
analyze table t1;
@@ -3105,6 +3113,7 @@ INSERT INTO t1 VALUES
CREATE TABLE t2 (id int NOT NULL, INDEX idx(id));
INSERT INTO t2 VALUES (7), (5), (1), (3);
+--sorted_result
SELECT id, st FROM t1
WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id);
SELECT id, st FROM t1
@@ -3273,9 +3282,9 @@ DROP TABLE t1, t2;
#--enable_query_log
#drop table t1;
-#
-# Bug#28076 inconsistent binary/varbinary comparison
-#
+--echo #
+--echo # Bug#28076 inconsistent binary/varbinary comparison
+--echo #
CREATE TABLE t1 (s1 BINARY(5), s2 VARBINARY(5));
INSERT INTO t1 VALUES (0x41,0x41), (0x42,0x42), (0x43,0x43);
@@ -3377,15 +3386,15 @@ GROUP BY a;
DROP TABLE t1;
-#
-# Bug#32036 EXISTS within a WHERE clause with a UNION crashes MySQL 5.122
-#
+--echo #
+--echo # Bug#32036 EXISTS within a WHERE clause with a UNION crashes MySQL 5.122
+--echo #
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
-INSERT INTO t1 VALUES (1),(2);
-INSERT INTO t2 VALUES (1),(2);
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+INSERT INTO t2 VALUES (1),(2),(1000);
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
EXPLAIN EXTENDED
@@ -4854,7 +4863,8 @@ CREATE TABLE t1 (a int) ;
INSERT INTO t1 VALUES (NULL), (1), (NULL), (2);
CREATE TABLE t2 (a int, INDEX idx(a)) ;
-INSERT INTO t2 VALUES (NULL), (1), (NULL);
+INSERT INTO t2 VALUES (NULL), (1), (NULL),(1000);
+insert into t2 select seq from seq_3_to_500;
SELECT * FROM t1
WHERE EXISTS (SELECT a FROM t2 USE INDEX () WHERE t2.a = t1.a);
@@ -6431,3 +6441,39 @@ drop table t1, t2, t3;
--echo #
--echo # End of 10.6 tests
--echo #
+
+--echo #
+--echo # MDEV-32656: ASAN errors in base_list_iterator::next /
+--echo # setup_table_map upon 2nd execution of PS
+--echo # (10.10 part)
+--echo #
+
+CREATE TABLE t1 (id BIGINT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE VIEW v1 AS SELECT * FROM t1;
+
+CREATE TABLE t2 (a INT);
+INSERT INTO t2 VALUES (2),(3);
+
+CREATE TABLE t3 (b INT);
+INSERT INTO t3 VALUES (3),(4);
+
+PREPARE stmt FROM "UPDATE t2 SET a = 1 WHERE (select 1 where ('e','e') IN (SELECT v1.id, v1.id FROM v1 JOIN t3)) <> 0";
+EXECUTE stmt;
+EXECUTE stmt;
+
+PREPARE stmt FROM "UPDATE t2 SET a = 1 WHERE ('e') IN (SELECT v1.id FROM v1 JOIN t3)";
+EXECUTE stmt;
+EXECUTE stmt;
+
+PREPARE stmt FROM "UPDATE t2 SET a = 1 WHERE ('e','e') IN (SELECT v1.id, v1.id FROM v1 JOIN t3)";
+EXECUTE stmt;
+EXECUTE stmt;
+
+# Cleanup
+DROP VIEW v1;
+DROP TABLE t1, t2, t3;
+
+--echo #
+--echo # End of 10.10 tests
+--echo #
diff --git a/mysql-test/main/subselect2.result b/mysql-test/main/subselect2.result
index db6c8590..0d2f7372 100644
--- a/mysql-test/main/subselect2.result
+++ b/mysql-test/main/subselect2.result
@@ -132,7 +132,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3_b eq_ref PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX PRIMARY 34 test.t3_a.PARENTID 1 Using where
1 PRIMARY t3_c eq_ref PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX PRIMARY 34 test.t3_b.PARENTID 1 Using where
1 PRIMARY t3_d eq_ref PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX PRIMARY 34 test.t3_c.PARENTID 1 Using where
-1 PRIMARY t3_e ref|filter PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX FFOLDERID_IDX|CMFLDRPARNT_IDX 34|35 test.t3_d.PARENTID 1 (29%) Using where; Using rowid filter
+1 PRIMARY t3_e eq_ref PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX PRIMARY 34 test.t3_d.PARENTID 1 Using where
drop table t1, t2, t3, t4;
CREATE TABLE t1 (a int(10) , PRIMARY KEY (a)) Engine=InnoDB;
INSERT INTO t1 VALUES (1),(2);
@@ -162,8 +162,8 @@ EXPLAIN
SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM t1) OR a = b;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 index a a 5 NULL 2 Using where; Using index
-1 PRIMARY t3 ref b b 5 test.t2.a 2 Using index
-2 SUBQUERY t1 const PRIMARY,a PRIMARY 4 const 1 Using where
+1 PRIMARY t3 ref b b 5 test.t2.a 1 Using index
+2 SUBQUERY t1 const PRIMARY,a a 9 const,const 1 Using where; Using index
SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM t1) OR a = b;
pk a b
0 4 4
@@ -171,8 +171,8 @@ EXPLAIN
SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM v1) OR a = b;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 index a a 5 NULL 2 Using where; Using index
-1 PRIMARY t3 ref b b 5 test.t2.a 2 Using index
-2 SUBQUERY t1 const PRIMARY,a PRIMARY 4 const 1 Using where
+1 PRIMARY t3 ref b b 5 test.t2.a 1 Using index
+2 SUBQUERY t1 const PRIMARY,a a 9 const,const 1 Using where; Using index
SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM v1) OR a = b;
pk a b
0 4 4
@@ -277,7 +277,7 @@ KEY `date` (`date`)
INSERT INTO `t1` VALUES (2085,'2012-01-01 00:00:00','2013-01-01 00:00:00');
INSERT INTO `t1` VALUES (2084,'2012-02-01 00:00:00','2013-01-01 00:00:00');
INSERT INTO `t1` VALUES (2088,'2012-03-01 00:00:00','2013-01-01 00:00:00');
-explain
+set statement optimizer_scan_setup_cost=0 for explain
SELECT * FROM (
SELECT node_uid, date, mirror_date, @result := 0 AS result
FROM t1
@@ -286,9 +286,9 @@ WHERE date < '2012-12-12 12:12:12'
ORDER BY mirror_date ASC
) AS calculated_result;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3
-2 DERIVED t1 range date date 6 NULL 3 Using index condition; Using where; Rowid-ordered scan; Using filesort
-SELECT * FROM (
+1 PRIMARY <derived3> ALL NULL NULL NULL NULL 3
+3 DERIVED t1 ALL date NULL NULL NULL 3 Using where; Using filesort
+set statement optimizer_scan_setup_cost=0 FOR SELECT * FROM (
SELECT node_uid, date, mirror_date, @result := 0 AS result
FROM t1
WHERE date < '2012-12-12 12:12:12'
@@ -339,7 +339,7 @@ where t1.a = t2.a and ( t1.a = ( select min(a) from t1 ) or 0 );
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
-1 PRIMARY t3 ref idx idx 6 func 2 100.00 Using where; Using index
+1 PRIMARY t3 ref idx idx 6 func 1 100.00 Using where; Using index
2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t2`.`a` AS `a`,`test`.`t3`.`a` AS `a` from `test`.`t1` join `test`.`t2` left join `test`.`t3` on(`test`.`t3`.`a` = `test`.`t1`.`a`) where `test`.`t1`.`a` = (/* select#2 */ select min(`test`.`t1`.`a`) from `test`.`t1`) and `test`.`t2`.`a` = (/* select#2 */ select min(`test`.`t1`.`a`) from `test`.`t1`)
diff --git a/mysql-test/main/subselect2.test b/mysql-test/main/subselect2.test
index b341e516..0780a5b9 100644
--- a/mysql-test/main/subselect2.test
+++ b/mysql-test/main/subselect2.test
@@ -303,7 +303,7 @@ INSERT INTO `t1` VALUES (2085,'2012-01-01 00:00:00','2013-01-01 00:00:00');
INSERT INTO `t1` VALUES (2084,'2012-02-01 00:00:00','2013-01-01 00:00:00');
INSERT INTO `t1` VALUES (2088,'2012-03-01 00:00:00','2013-01-01 00:00:00');
-explain
+set statement optimizer_scan_setup_cost=0 for explain
SELECT * FROM (
SELECT node_uid, date, mirror_date, @result := 0 AS result
FROM t1
@@ -312,7 +312,7 @@ SELECT * FROM (
ORDER BY mirror_date ASC
) AS calculated_result;
-SELECT * FROM (
+set statement optimizer_scan_setup_cost=0 FOR SELECT * FROM (
SELECT node_uid, date, mirror_date, @result := 0 AS result
FROM t1
WHERE date < '2012-12-12 12:12:12'
diff --git a/mysql-test/main/subselect3.inc b/mysql-test/main/subselect3.inc
index 2258456f..8bb84eb2 100644
--- a/mysql-test/main/subselect3.inc
+++ b/mysql-test/main/subselect3.inc
@@ -246,8 +246,9 @@ from t2;
drop table t1,t2,t3,t4;
-# More tests for tricky multi-column cases, where some of pushed-down
-# equalities are used for index lookups and some arent.
+--echo # More tests for tricky multi-column cases, where some of pushed-down
+--echo # equalities are used for index lookups and some are not.
+
create table t1 (oref char(4), grp int, ie1 int, ie2 int);
insert into t1 (oref, grp, ie1, ie2) values
('aa', 10, 2, 1),
@@ -474,8 +475,11 @@ explain select oref, a, a in (select ie from t1 where oref=t2.oref) Z from t2;
select oref, a, a in (select ie from t1 where oref=t2.oref) Z from t2;
+explain select oref, a from t2 where a in (select ie from t1 where oref=t2.oref);
+
select oref, a from t2 where a in (select ie from t1 where oref=t2.oref);
+explain select oref, a from t2 where a not in (select ie from t1 where oref=t2.oref);
select oref, a from t2 where a not in (select ie from t1 where oref=t2.oref);
explain
@@ -1022,7 +1026,6 @@ explain select * from t1 where a in (select a from t1);
drop table t1;
set @@optimizer_switch=@save_optimizer_switch;
-set @@optimizer_switch=@save_optimizer_switch;
set @@optimizer_switch='materialization=off';
#
@@ -1044,9 +1047,9 @@ explain select * from t2 where a in (select straight_join A.a from t1 A, t1 B);
explain select straight_join * from t2 X, t2 Y
where X.a in (select straight_join A.a from t1 A, t1 B);
-#
-# SJ-Materialization scan + first table being system const table
-#
+--echo #
+--echo # SJ-Materialization scan + first table being system const table
+--echo #
create table t0 (a int, b int);
insert into t0 values(1,1);
explain select * from t0, t3 where t3.a in (select a from t2) and (t3.a < 10 or t3.a >30);
@@ -1054,9 +1057,12 @@ create table t4 as select a as x, a as y from t1;
explain select * from t0, t3 where (t3.a, t3.b) in (select x,y from t4) and (t3.a < 10 or t3.a >30);
drop table t0,t1,t2,t3,t4;
-#
-# LooseScan with ref access
-#
+--echo #
+--echo # LooseScan with ref access
+--echo #
+
+set @@optimizer_switch='join_cache_hashed=off';
+
create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 (a int, b int, filler char(100), key(a,b));
@@ -1092,9 +1098,9 @@ drop table t0, t1, t2;
set @@optimizer_switch='materialization=off';
-#
-# Primitive SJ-Materialization tests for DECIMAL and DATE
-#
+--echo #
+--echo # Primitive SJ-Materialization tests for DECIMAL and DATE
+--echo #
create table t0 (a decimal(4,2));
insert into t0 values (10.24), (22.11);
create table t1 as select * from t0;
@@ -1120,6 +1126,7 @@ insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 as select a as a, a as b, a as c from t0 where a < 3;
create table t2 as select a as a, a as b from t0 where a < 3;
insert into t2 select * from t2;
+select count(*) from t2;
explain select * from t1 where (a,b,c) in (select X.a, Y.a, Z.a from t2 X, t2 Y, t2 Z where X.b=33);
@@ -1165,7 +1172,7 @@ drop table t0, t1;
create table t1 (
idIndividual int primary key
);
-insert into t1 values (1),(2);
+insert into t1 values (1),(2),(1000);
create table t2 (
idContact int primary key,
@@ -1180,7 +1187,7 @@ create table t3 (
postalStripped varchar(100)
);
-insert into t3 values (1,1, 'foo'), (2,2,'bar');
+insert into t3 values (1,1, 'foo'), (2,2,'T2H3B2');
--echo The following must be converted to a semi-join:
set @save_optimizer_switch=@@optimizer_switch;
@@ -1191,6 +1198,12 @@ WHERE a.idIndividual IN
INNER JOIN t2 c ON c.idContact=cona.idContact
WHERE cona.postalStripped='T2H3B2'
);
+SELECT a.idIndividual FROM t1 a
+WHERE a.idIndividual IN
+ ( SELECT c.idObj FROM t3 cona
+ INNER JOIN t2 c ON c.idContact=cona.idContact
+ WHERE cona.postalStripped='T2H3B2'
+ );
set @@optimizer_switch=@save_optimizer_switch;
drop table t1,t2,t3;
@@ -1218,7 +1231,6 @@ CREATE PROCEDURE p1 () BEGIN SELECT f1 FROM t1 WHERE f1 IN (SELECT f1 FROM t2);
delimiter ;|
CALL p1;
ALTER TABLE t2 CHANGE COLUMN f1 my_column INT;
---error ER_BAD_FIELD_ERROR
CALL p1;
DROP PROCEDURE p1;
DROP TABLE t1, t2;
diff --git a/mysql-test/main/subselect3.result b/mysql-test/main/subselect3.result
index 9b9193aa..4c654cb7 100644
--- a/mysql-test/main/subselect3.result
+++ b/mysql-test/main/subselect3.result
@@ -62,7 +62,7 @@ a in (select max(ie) from t1 where oref=4 group by grp)
0
show status like 'Handler_read_rnd_next';
Variable_name Value
-Handler_read_rnd_next 11
+Handler_read_rnd_next 19
select ' ^ This must show 11' Z;
Z
^ This must show 11
@@ -96,10 +96,10 @@ explain extended
select oref, a, a in (select a from t1 where oref=t2.oref) Z from t2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 4 100.00
-2 DEPENDENT SUBQUERY t1 ALL a NULL NULL NULL 8 100.00 Using where
+2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 3 100.00 Using where; Full scan on NULL key
Warnings:
Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1
-Note 1003 /* select#1 */ select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,<expr_cache><`test`.`t2`.`a`,`test`.`t2`.`oref`>(<in_optimizer>(`test`.`t2`.`a`,<exists>(/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` where `test`.`t1`.`oref` = `test`.`t2`.`oref` and trigcond(<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a` or `test`.`t1`.`a` is null) having trigcond(`test`.`t1`.`a` is null)))) AS `Z` from `test`.`t2`
+Note 1003 /* select#1 */ select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,<expr_cache><`test`.`t2`.`a`,`test`.`t2`.`oref`>(<in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a checking NULL where `test`.`t1`.`oref` = `test`.`t2`.`oref` having trigcond(`test`.`t1`.`a` is null))))) AS `Z` from `test`.`t2`
flush status;
select oref, a from t2 where a in (select a from t1 where oref=t2.oref);
oref a
@@ -193,7 +193,7 @@ t3.a in (select t1.a from t1, t2 where t1.b=t2.a and t2.b=t3.oref) Z
from t3;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00
-2 DEPENDENT SUBQUERY t1 ref a a 4 func 2 100.00 Using where; Full scan on NULL key
+2 DEPENDENT SUBQUERY t1 ref a a 4 func 1 100.00 Using where; Full scan on NULL key
2 DEPENDENT SUBQUERY t2 ref a a 4 test.t1.b 1 100.00 Using where
Warnings:
Note 1276 Field or reference 'test.t3.oref' of SELECT #2 was resolved in SELECT #1
@@ -278,6 +278,8 @@ a b oref Z
NULL 1 100 0
NULL 2 100 NULL
drop table t1,t2,t3,t4;
+# More tests for tricky multi-column cases, where some of pushed-down
+# equalities are used for index lookups and some are not.
create table t1 (oref char(4), grp int, ie1 int, ie2 int);
insert into t1 (oref, grp, ie1, ie2) values
('aa', 10, 2, 1),
@@ -617,10 +619,18 @@ cc 2 0
cc NULL NULL
aa 1 1
bb NULL NULL
+explain select oref, a from t2 where a in (select ie from t1 where oref=t2.oref);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t2 ALL NULL NULL NULL NULL 7 Using where
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1 Using where
select oref, a from t2 where a in (select ie from t1 where oref=t2.oref);
oref a
cc 5
aa 1
+explain select oref, a from t2 where a not in (select ie from t1 where oref=t2.oref);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t2 ALL NULL NULL NULL NULL 7 Using where
+2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using where; Full scan on NULL key
select oref, a from t2 where a not in (select ie from t1 where oref=t2.oref);
oref a
ee NULL
@@ -1157,9 +1167,9 @@ set @@optimizer_switch='firstmatch=off,materialization=off';
set @@max_heap_table_size= 16384;
explain select count(*) from t0 A, t0 B, t0 C, t0 D where D.a in (select a from t1 E where a+1 < 10000 + A.a + B.a +C.a+D.a);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY A ALL NULL NULL NULL NULL 10
+1 PRIMARY E ALL NULL NULL NULL NULL 5 Start temporary
+1 PRIMARY A ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join)
1 PRIMARY B ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join)
-1 PRIMARY E ALL NULL NULL NULL NULL 5 Start temporary; Using join buffer (flat, BNL join)
1 PRIMARY C ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join)
1 PRIMARY D ALL NULL NULL NULL NULL 10 Using where; End temporary; Using join buffer (flat, BNL join)
flush status;
@@ -1180,9 +1190,8 @@ create table t3 ( a int , filler char(100), key(a));
insert into t3 select A.a + 10*B.a, 'filler' from t0 A, t0 B;
explain select * from t3 where a in (select a from t2) and (a > 5 or a < 10);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2
-1 PRIMARY t3 ref a a 5 test.t2.a 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 Using where
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Start temporary
+1 PRIMARY t3 ref a a 5 test.t2.a 1 End temporary
select * from t3 where a in (select a from t2);
a filler
1 filler
@@ -1221,7 +1230,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
drop table t1;
set @@optimizer_switch=@save_optimizer_switch;
-set @@optimizer_switch=@save_optimizer_switch;
set @@optimizer_switch='materialization=off';
create table t1 (a int);
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
@@ -1255,6 +1263,9 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY Y ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join)
2 DEPENDENT SUBQUERY A ALL NULL NULL NULL NULL 10 Using where
2 DEPENDENT SUBQUERY B ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join)
+#
+# SJ-Materialization scan + first table being system const table
+#
create table t0 (a int, b int);
insert into t0 values(1,1);
explain select * from t0, t3 where t3.a in (select a from t2) and (t3.a < 10 or t3.a >30);
@@ -1269,6 +1280,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t4 ALL NULL NULL NULL NULL 10 Using where; Start temporary
1 PRIMARY t3 ref a a 5 test.t4.x 10 Using where; End temporary
drop table t0,t1,t2,t3,t4;
+#
+# LooseScan with ref access
+#
+set @@optimizer_switch='join_cache_hashed=off';
create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 (a int, b int, filler char(100), key(a,b));
@@ -1305,6 +1320,9 @@ set @@optimizer_search_depth=@save_optimizer_search_depth;
set @@optimizer_switch=@save_optimizer_switch;
drop table t0, t1, t2;
set @@optimizer_switch='materialization=off';
+#
+# Primitive SJ-Materialization tests for DECIMAL and DATE
+#
create table t0 (a decimal(4,2));
insert into t0 values (10.24), (22.11);
create table t1 as select * from t0;
@@ -1336,6 +1354,9 @@ insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 as select a as a, a as b, a as c from t0 where a < 3;
create table t2 as select a as a, a as b from t0 where a < 3;
insert into t2 select * from t2;
+select count(*) from t2;
+count(*)
+6
explain select * from t1 where (a,b,c) in (select X.a, Y.a, Z.a from t2 X, t2 Y, t2 Z where X.b=33);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3
@@ -1391,7 +1412,7 @@ drop table t0, t1;
create table t1 (
idIndividual int primary key
);
-insert into t1 values (1),(2);
+insert into t1 values (1),(2),(1000);
create table t2 (
idContact int primary key,
contactType int,
@@ -1403,7 +1424,7 @@ idAddress int primary key,
idContact int,
postalStripped varchar(100)
);
-insert into t3 values (1,1, 'foo'), (2,2,'bar');
+insert into t3 values (1,1, 'foo'), (2,2,'T2H3B2');
The following must be converted to a semi-join:
set @save_optimizer_switch=@@optimizer_switch;
set @@optimizer_switch='materialization=off';
@@ -1416,9 +1437,17 @@ WHERE cona.postalStripped='T2H3B2'
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY cona ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary
1 PRIMARY c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 Using where
-1 PRIMARY a eq_ref PRIMARY PRIMARY 4 test.c.idObj 1 100.00 Using index; End temporary
+1 PRIMARY a eq_ref PRIMARY PRIMARY 4 test.c.idObj 1 50.00 Using index; End temporary
Warnings:
Note 1003 select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where `test`.`cona`.`postalStripped` = 'T2H3B2' and `test`.`a`.`idIndividual` = `test`.`c`.`idObj` and `test`.`c`.`idContact` = `test`.`cona`.`idContact`
+SELECT a.idIndividual FROM t1 a
+WHERE a.idIndividual IN
+( SELECT c.idObj FROM t3 cona
+INNER JOIN t2 c ON c.idContact=cona.idContact
+WHERE cona.postalStripped='T2H3B2'
+ );
+idIndividual
+2
set @@optimizer_switch=@save_optimizer_switch;
drop table t1,t2,t3;
#
@@ -1443,7 +1472,7 @@ CALL p1;
f1
ALTER TABLE t2 CHANGE COLUMN f1 my_column INT;
CALL p1;
-ERROR 42S22: Unknown column 'f1' in 'where clause'
+f1
DROP PROCEDURE p1;
DROP TABLE t1, t2;
#
diff --git a/mysql-test/main/subselect3_jcl6.result b/mysql-test/main/subselect3_jcl6.result
index 5d326674..b606f0a5 100644
--- a/mysql-test/main/subselect3_jcl6.result
+++ b/mysql-test/main/subselect3_jcl6.result
@@ -65,7 +65,7 @@ a in (select max(ie) from t1 where oref=4 group by grp)
0
show status like 'Handler_read_rnd_next';
Variable_name Value
-Handler_read_rnd_next 11
+Handler_read_rnd_next 19
select ' ^ This must show 11' Z;
Z
^ This must show 11
@@ -99,10 +99,10 @@ explain extended
select oref, a, a in (select a from t1 where oref=t2.oref) Z from t2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 4 100.00
-2 DEPENDENT SUBQUERY t1 ALL a NULL NULL NULL 8 100.00 Using where
+2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 3 100.00 Using where; Full scan on NULL key
Warnings:
Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1
-Note 1003 /* select#1 */ select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,<expr_cache><`test`.`t2`.`a`,`test`.`t2`.`oref`>(<in_optimizer>(`test`.`t2`.`a`,<exists>(/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` where `test`.`t1`.`oref` = `test`.`t2`.`oref` and trigcond(<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a` or `test`.`t1`.`a` is null) having trigcond(`test`.`t1`.`a` is null)))) AS `Z` from `test`.`t2`
+Note 1003 /* select#1 */ select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,<expr_cache><`test`.`t2`.`a`,`test`.`t2`.`oref`>(<in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a checking NULL where `test`.`t1`.`oref` = `test`.`t2`.`oref` having trigcond(`test`.`t1`.`a` is null))))) AS `Z` from `test`.`t2`
flush status;
select oref, a from t2 where a in (select a from t1 where oref=t2.oref);
oref a
@@ -196,7 +196,7 @@ t3.a in (select t1.a from t1, t2 where t1.b=t2.a and t2.b=t3.oref) Z
from t3;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00
-2 DEPENDENT SUBQUERY t1 ref a a 4 func 2 100.00 Using where; Full scan on NULL key
+2 DEPENDENT SUBQUERY t1 ref a a 4 func 1 100.00 Using where; Full scan on NULL key
2 DEPENDENT SUBQUERY t2 ref a a 4 test.t1.b 1 100.00 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
Warnings:
Note 1276 Field or reference 'test.t3.oref' of SELECT #2 was resolved in SELECT #1
@@ -281,6 +281,8 @@ a b oref Z
NULL 1 100 0
NULL 2 100 NULL
drop table t1,t2,t3,t4;
+# More tests for tricky multi-column cases, where some of pushed-down
+# equalities are used for index lookups and some are not.
create table t1 (oref char(4), grp int, ie1 int, ie2 int);
insert into t1 (oref, grp, ie1, ie2) values
('aa', 10, 2, 1),
@@ -620,10 +622,18 @@ cc 2 0
cc NULL NULL
aa 1 1
bb NULL NULL
+explain select oref, a from t2 where a in (select ie from t1 where oref=t2.oref);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 6 Using where
+1 PRIMARY t2 hash_ALL NULL #hash#$hj 10 test.t1.oref,test.t1.ie 7 Using where; Using join buffer (flat, BNLH join)
select oref, a from t2 where a in (select ie from t1 where oref=t2.oref);
oref a
-aa 1
cc 5
+aa 1
+explain select oref, a from t2 where a not in (select ie from t1 where oref=t2.oref);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t2 ALL NULL NULL NULL NULL 7 Using where
+2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using where; Full scan on NULL key
select oref, a from t2 where a not in (select ie from t1 where oref=t2.oref);
oref a
ee NULL
@@ -1128,8 +1138,8 @@ set @tmp_optimizer_switch=@@optimizer_switch;
set optimizer_switch='derived_merge=off,derived_with_keys=off';
explain select * from (select a from t0) X where a in (select a from t1);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 11
-1 PRIMARY t1 ALL NULL NULL NULL NULL 20 Using where; FirstMatch(<derived2>); Using join buffer (flat, BNL join)
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 11 Using where
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 X.a 20 Using where; FirstMatch(<derived2>); Using join buffer (flat, BNLH join)
2 DERIVED t0 ALL NULL NULL NULL NULL 11
drop table t0, t1;
set optimizer_switch=@tmp_optimizer_switch;
@@ -1161,10 +1171,10 @@ set @@max_heap_table_size= 16384;
explain select count(*) from t0 A, t0 B, t0 C, t0 D where D.a in (select a from t1 E where a+1 < 10000 + A.a + B.a +C.a+D.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY A ALL NULL NULL NULL NULL 10
-1 PRIMARY B ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join)
-1 PRIMARY E ALL NULL NULL NULL NULL 5 Using where; Start temporary; Using join buffer (incremental, BNL join)
-1 PRIMARY C ALL NULL NULL NULL NULL 10 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY D hash_ALL NULL #hash#$hj 5 test.E.a 10 Using where; End temporary; Using join buffer (incremental, BNLH join)
+1 PRIMARY E ALL NULL NULL NULL NULL 5 Using where; Start temporary; Using join buffer (flat, BNL join)
+1 PRIMARY D hash_ALL NULL #hash#$hj 5 test.E.a 10 Using where; Using join buffer (incremental, BNLH join)
+1 PRIMARY B ALL NULL NULL NULL NULL 10 Using join buffer (incremental, BNL join)
+1 PRIMARY C ALL NULL NULL NULL NULL 10 Using where; End temporary; Using join buffer (incremental, BNL join)
flush status;
select count(*) from t0 A, t0 B, t0 C, t0 D where D.a in (select a from t1 E where a+1 < 10000 + A.a + B.a +C.a+D.a);
count(*)
@@ -1183,9 +1193,8 @@ create table t3 ( a int , filler char(100), key(a));
insert into t3 select A.a + 10*B.a, 'filler' from t0 A, t0 B;
explain select * from t3 where a in (select a from t2) and (a > 5 or a < 10);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2
-1 PRIMARY t3 ref a a 5 test.t2.a 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 Using where
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Start temporary
+1 PRIMARY t3 ref a a 5 test.t2.a 1 End temporary; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
select * from t3 where a in (select a from t2);
a filler
1 filler
@@ -1224,7 +1233,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 hash_ALL NULL #hash#$hj 6 test.t1.a 2 Using where; Start temporary; End temporary; Using join buffer (flat, BNLH join)
drop table t1;
set @@optimizer_switch=@save_optimizer_switch;
-set @@optimizer_switch=@save_optimizer_switch;
set @@optimizer_switch='materialization=off';
create table t1 (a int);
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
@@ -1258,6 +1266,9 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY Y ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join)
2 DEPENDENT SUBQUERY A ALL NULL NULL NULL NULL 10 Using where
2 DEPENDENT SUBQUERY B ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join)
+#
+# SJ-Materialization scan + first table being system const table
+#
create table t0 (a int, b int);
insert into t0 values(1,1);
explain select * from t0, t3 where t3.a in (select a from t2) and (t3.a < 10 or t3.a >30);
@@ -1272,6 +1283,10 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t4 ALL NULL NULL NULL NULL 10 Using where; Start temporary
1 PRIMARY t3 ref a a 5 test.t4.x 10 Using where; End temporary; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
drop table t0,t1,t2,t3,t4;
+#
+# LooseScan with ref access
+#
+set @@optimizer_switch='join_cache_hashed=off';
create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 (a int, b int, filler char(100), key(a,b));
@@ -1308,14 +1323,17 @@ set @@optimizer_search_depth=@save_optimizer_search_depth;
set @@optimizer_switch=@save_optimizer_switch;
drop table t0, t1, t2;
set @@optimizer_switch='materialization=off';
+#
+# Primitive SJ-Materialization tests for DECIMAL and DATE
+#
create table t0 (a decimal(4,2));
insert into t0 values (10.24), (22.11);
create table t1 as select * from t0;
insert into t1 select * from t0;
explain select * from t0 where a in (select a from t1);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t0 ALL NULL NULL NULL NULL 2
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where; FirstMatch(t0); Using join buffer (flat, BNL join)
+1 PRIMARY t0 ALL NULL NULL NULL NULL 2 Using where
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 3 test.t0.a 4 Using where; FirstMatch(t0); Using join buffer (flat, BNLH join)
select * from t0 where a in (select a from t1);
a
10.24
@@ -1327,8 +1345,8 @@ create table t1 as select * from t0;
insert into t1 select * from t0;
explain select * from t0 where a in (select a from t1);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t0 ALL NULL NULL NULL NULL 2
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where; FirstMatch(t0); Using join buffer (flat, BNL join)
+1 PRIMARY t0 ALL NULL NULL NULL NULL 2 Using where
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 4 test.t0.a 4 Using where; FirstMatch(t0); Using join buffer (flat, BNLH join)
select * from t0 where a in (select a from t1);
a
2008-01-01
@@ -1339,6 +1357,9 @@ insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 as select a as a, a as b, a as c from t0 where a < 3;
create table t2 as select a as a, a as b from t0 where a < 3;
insert into t2 select * from t2;
+select count(*) from t2;
+count(*)
+6
explain select * from t1 where (a,b,c) in (select X.a, Y.a, Z.a from t2 X, t2 Y, t2 Z where X.b=33);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where
@@ -1394,7 +1415,7 @@ drop table t0, t1;
create table t1 (
idIndividual int primary key
);
-insert into t1 values (1),(2);
+insert into t1 values (1),(2),(1000);
create table t2 (
idContact int primary key,
contactType int,
@@ -1406,7 +1427,7 @@ idAddress int primary key,
idContact int,
postalStripped varchar(100)
);
-insert into t3 values (1,1, 'foo'), (2,2,'bar');
+insert into t3 values (1,1, 'foo'), (2,2,'T2H3B2');
The following must be converted to a semi-join:
set @save_optimizer_switch=@@optimizer_switch;
set @@optimizer_switch='materialization=off';
@@ -1419,9 +1440,17 @@ WHERE cona.postalStripped='T2H3B2'
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY cona ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary
1 PRIMARY c eq_ref PRIMARY PRIMARY 4 test.cona.idContact 1 100.00 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
-1 PRIMARY a eq_ref PRIMARY PRIMARY 4 test.c.idObj 1 100.00 Using index; End temporary
+1 PRIMARY a eq_ref PRIMARY PRIMARY 4 test.c.idObj 1 50.00 Using index; End temporary
Warnings:
Note 1003 select `test`.`a`.`idIndividual` AS `idIndividual` from `test`.`t1` `a` semi join (`test`.`t3` `cona` join `test`.`t2` `c`) where `test`.`cona`.`postalStripped` = 'T2H3B2' and `test`.`a`.`idIndividual` = `test`.`c`.`idObj` and `test`.`c`.`idContact` = `test`.`cona`.`idContact`
+SELECT a.idIndividual FROM t1 a
+WHERE a.idIndividual IN
+( SELECT c.idObj FROM t3 cona
+INNER JOIN t2 c ON c.idContact=cona.idContact
+WHERE cona.postalStripped='T2H3B2'
+ );
+idIndividual
+2
set @@optimizer_switch=@save_optimizer_switch;
drop table t1,t2,t3;
#
@@ -1446,7 +1475,7 @@ CALL p1;
f1
ALTER TABLE t2 CHANGE COLUMN f1 my_column INT;
CALL p1;
-ERROR 42S22: Unknown column 'f1' in 'where clause'
+f1
DROP PROCEDURE p1;
DROP TABLE t1, t2;
#
diff --git a/mysql-test/main/subselect4.result b/mysql-test/main/subselect4.result
index 1e65bfc8..e15d488e 100644
--- a/mysql-test/main/subselect4.result
+++ b/mysql-test/main/subselect4.result
@@ -265,7 +265,7 @@ EXPLAIN
SELECT * FROM t1 WHERE NULL NOT IN (SELECT t2c.i FROM t2c WHERE t2c.pk = t1.pk);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
-2 DEPENDENT SUBQUERY t2c index_subquery it2c it2c 8 const,test.t1.pk 2 Using index; Using where; Full scan on NULL key
+2 DEPENDENT SUBQUERY t2c index_subquery it2c it2c 8 const,test.t1.pk 1 Using index; Using where; Full scan on NULL key
SELECT * FROM t1 WHERE NULL NOT IN (SELECT t2c.i FROM t2c WHERE t2c.pk = t1.pk);
pk i
SELECT * FROM t1 WHERE NULL IN (SELECT t2c.i FROM t2c WHERE t2c.pk = t1.pk) IS UNKNOWN;
@@ -335,7 +335,7 @@ EXPLAIN
SELECT * FROM t1 WHERE (NULL, 1) NOT IN (SELECT t2c.i, t2c.pk FROM t2c WHERE t2c.pk = t1.pk);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
-2 DEPENDENT SUBQUERY t2c index_subquery it2c it2c 8 const,test.t1.pk 2 Using index; Using where; Full scan on NULL key
+2 DEPENDENT SUBQUERY t2c index_subquery it2c it2c 8 const,test.t1.pk 1 Using index; Using where; Full scan on NULL key
SELECT * FROM t1 WHERE (NULL, 1) NOT IN (SELECT t2c.i, t2c.pk FROM t2c WHERE t2c.pk = t1.pk);
pk i
0 10
@@ -413,29 +413,6 @@ Note 1276 Field or reference 'test.t1.c' of SELECT #2 was resolved in SELECT #1
Note 1003 /* select#1 */ select (/* select#2 */ select 1 from `test`.`t2` where 0) AS `RESULT` from dual group by NULL
DROP TABLE t1,t2;
#
-# BUG#45928 "Differing query results depending on MRR and
-# engine_condition_pushdown settings"
-#
-CREATE TABLE `t1` (
-`pk` int(11) NOT NULL AUTO_INCREMENT,
-`time_nokey` time NOT NULL,
-`varchar_key` varchar(1) NOT NULL,
-`varchar_nokey` varchar(1) NOT NULL,
-PRIMARY KEY (`pk`),
-KEY `varchar_key` (`varchar_key`)
-) AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;
-INSERT INTO `t1` VALUES (10,'00:00:00','i','i'),(11,'00:00:00','','');
-set @old_optimizer_switch = @@session.optimizer_switch;
-SET SESSION OPTIMIZER_SWITCH = 'materialization=off,semijoin=off,loosescan=off,firstmatch=off,mrr=on,engine_condition_pushdown=on';
-Warnings:
-Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release
-SELECT `time_nokey` G1 FROM t1 WHERE ( `varchar_nokey` , `varchar_key` ) IN (
-SELECT `varchar_nokey` , `varchar_nokey` ) AND `varchar_key` >= 'c' HAVING G1 ORDER
-BY `pk` ;
-G1
-set @@session.optimizer_switch = @old_optimizer_switch;
-DROP TABLE t1;
-#
# During work with BUG#45863 I had problems with a query that was
# optimized differently in regular and prepared mode.
# Because there was a bug in one of the selected strategies, I became
@@ -616,9 +593,7 @@ PRIMARY KEY (pk)
INSERT INTO t2 VALUES (9,1);
# Enable Index condition pushdown
set @old_icp=@@optimizer_switch;
-SET SESSION optimizer_switch="engine_condition_pushdown=on";
-Warnings:
-Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release
+SET SESSION optimizer_switch="index_condition_pushdown=on";
SELECT pk
FROM t2
@@ -714,8 +689,7 @@ WHERE ( t1.f10 ) IN ( SELECT f11 FROM t2 GROUP BY f11 ));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 SUBQUERY t1 ALL NULL NULL NULL NULL 2
-2 SUBQUERY <subquery3> eq_ref distinct_key distinct_key 4 func 1
-3 MATERIALIZED t2 ALL NULL NULL NULL NULL 2
+2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
SELECT * FROM t1
WHERE f3 = (
SELECT t1.f3 FROM t1
@@ -729,8 +703,7 @@ WHERE ( f10, f10 ) IN ( SELECT f11, f11 FROM t2 GROUP BY f11 ));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
2 SUBQUERY t1 ALL NULL NULL NULL NULL 2
-2 SUBQUERY <subquery3> eq_ref distinct_key distinct_key 8 func,func 1
-3 MATERIALIZED t2 ALL NULL NULL NULL NULL 2
+2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
SELECT * FROM t1
WHERE f3 = (
SELECT f3 FROM t1
@@ -1172,7 +1145,7 @@ WHERE (t2.pk = t1.pk) AND t2.pk IN (SELECT f2 FROM t1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 system PRIMARY NULL NULL NULL 1
1 PRIMARY t1 const PRIMARY PRIMARY 4 const 1
-2 DEPENDENT SUBQUERY t1 index_subquery f2 f2 4 func 2 Using index
+2 DEPENDENT SUBQUERY t1 index_subquery f2 f2 4 func 1 Using index
SELECT t1.f3, MAX(t1.f2)
FROM t1, t2
WHERE (t2.pk = t1.pk) AND t2.pk IN (SELECT f2 FROM t1);
@@ -1249,7 +1222,7 @@ drop table t1, t2;
#
CREATE TABLE t1 (c1 varchar(1) DEFAULT NULL);
CREATE TABLE t2 (c1 varchar(1) DEFAULT NULL);
-INSERT INTO t2 VALUES ('k'), ('d');
+INSERT INTO t2 VALUES ('k'), ('d'),('x');
CREATE TABLE t3 (c1 varchar(1) DEFAULT NULL);
INSERT INTO t3 VALUES ('a'), ('b'), ('c');
CREATE TABLE t4 (c1 varchar(1) primary key);
@@ -1262,16 +1235,16 @@ EXPLAIN
SELECT * FROM t1 RIGHT JOIN t2 ON t1.c1 WHERE 's' IN (SELECT c1 FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found
-1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; FirstMatch(t1)
-1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
SELECT * FROM t1 RIGHT JOIN t2 ON t1.c1 WHERE 's' IN (SELECT c1 FROM t2);
c1 c1
EXPLAIN
SELECT * FROM t2 LEFT JOIN t1 ON t1.c1 WHERE 's' IN (SELECT c1 FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found
-1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; FirstMatch(t1)
-1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
SELECT * FROM t2 LEFT JOIN t1 ON t1.c1 WHERE 's' IN (SELECT c1 FROM t2);
c1 c1
SET optimizer_switch='materialization=on';
@@ -1279,19 +1252,18 @@ EXPLAIN
SELECT * FROM (t2 LEFT JOIN t1 ON t1.c1) LEFT JOIN t3 on t3.c1 WHERE 's' IN (SELECT c1 FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; Start temporary; End temporary
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 Using where
SELECT * FROM (t2 LEFT JOIN t1 ON t1.c1) LEFT JOIN t3 on t3.c1 WHERE 's' IN (SELECT c1 FROM t2);
c1 c1 c1
EXPLAIN
SELECT * FROM t4 LEFT JOIN t2 ON t4.c1 WHERE 's' IN (SELECT c1 FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t4 index NULL PRIMARY 3 NULL 2 Using index
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-1 PRIMARY t4 index NULL PRIMARY 3 NULL 2 Using index; Using join buffer (flat, BNL join)
-1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 Using where
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
SELECT * FROM t4 LEFT JOIN t2 ON t4.c1 WHERE 's' IN (SELECT c1 FROM t2);
c1 c1
SET optimizer_switch=@save_optimizer_switch;
@@ -1370,8 +1342,8 @@ GROUP BY SQ1_t1.f4));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where
-3 SUBQUERY SQ1_t3 range f4 f4 5 NULL 2 Using where; Using index; Using temporary
-3 SUBQUERY SQ1_t1 index NULL f4 5 NULL 2 Using index; Using join buffer (flat, BNL join)
+3 SUBQUERY SQ1_t1 index NULL f4 5 NULL 2 Using index; Using temporary
+3 SUBQUERY SQ1_t3 range f4 f4 5 NULL 2 Using where; Using index; Using join buffer (flat, BNL join)
SELECT * FROM t1 WHERE
(SELECT f2 FROM t2
WHERE f4 <= ALL
@@ -1542,7 +1514,7 @@ EXPLAIN
SELECT 'bug' FROM DUAL WHERE ( 5 ) IN ( SELECT * FROM v1 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
-2 SUBQUERY <derived3> ALL NULL NULL NULL NULL 2 Using where
+2 SUBQUERY <derived3> const NULL distinct_key 4 const 1 Using where
3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
4 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
@@ -1552,7 +1524,7 @@ EXPLAIN
SELECT ( 5 ) IN ( SELECT * FROM v1 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
-2 SUBQUERY <derived3> ALL NULL NULL NULL NULL 2 Using where
+2 SUBQUERY <derived3> const NULL distinct_key 4 const 1 Using where
3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
4 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
@@ -1563,7 +1535,7 @@ EXPLAIN
SELECT 'bug' FROM DUAL WHERE ( 5 ) IN (SELECT * FROM v2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
-2 SUBQUERY <derived3> ALL NULL NULL NULL NULL 2 Using where
+2 SUBQUERY <derived3> const NULL distinct_key 5 const 1 Using where
3 DERIVED t1 system NULL NULL NULL NULL 1
4 UNION t2 system NULL NULL NULL NULL 1
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
@@ -1583,7 +1555,7 @@ EXPLAIN
SELECT ( 5 ) IN ( SELECT * FROM v2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
-2 SUBQUERY <derived3> ALL NULL NULL NULL NULL 2 Using where
+2 SUBQUERY <derived3> index_subquery NULL distinct_key 5 const 2
3 DERIVED t1 system NULL NULL NULL NULL 1
4 UNION t2 system NULL NULL NULL NULL 1
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
@@ -1595,7 +1567,7 @@ EXPLAIN
SELECT 'bug' FROM DUAL WHERE ( 5 ) IN ( SELECT * FROM v1 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
-2 SUBQUERY <derived3> ALL NULL NULL NULL NULL 2 Using where
+2 SUBQUERY <derived3> const NULL distinct_key 4 const 1 Using where
3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
4 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
@@ -1605,7 +1577,7 @@ EXPLAIN
SELECT ( 5 ) IN ( SELECT * FROM v1 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
-2 SUBQUERY <derived3> ALL NULL NULL NULL NULL 2 Using where
+2 SUBQUERY <derived3> const NULL distinct_key 4 const 1 Using where
3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
4 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
@@ -1616,7 +1588,7 @@ EXPLAIN
SELECT 'bug' FROM DUAL WHERE ( 5 ) IN (SELECT * FROM v2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
-2 SUBQUERY <derived3> ALL NULL NULL NULL NULL 2 Using where
+2 SUBQUERY <derived3> const NULL distinct_key 5 const 1 Using where
3 DERIVED t1 system NULL NULL NULL NULL 1
4 UNION t2 system NULL NULL NULL NULL 1
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
@@ -1626,7 +1598,7 @@ EXPLAIN
SELECT 'bug' FROM t3 WHERE ( 5 ) IN (SELECT * FROM v2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 system NULL NULL NULL NULL 1
-2 SUBQUERY <derived3> ALL NULL NULL NULL NULL 2 Using where
+2 SUBQUERY <derived3> const NULL distinct_key 5 const 1 Using where
3 DERIVED t1 system NULL NULL NULL NULL 1
4 UNION t2 system NULL NULL NULL NULL 1
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
@@ -1636,7 +1608,7 @@ EXPLAIN
SELECT ( 5 ) IN ( SELECT * FROM v2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL No tables used
-2 SUBQUERY <derived3> ALL NULL NULL NULL NULL 2 Using where
+2 SUBQUERY <derived3> index_subquery NULL distinct_key 5 const 2
3 DERIVED t1 system NULL NULL NULL NULL 1
4 UNION t2 system NULL NULL NULL NULL 1
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
@@ -2757,12 +2729,21 @@ INSERT INTO t4 VALUES
('w'),('w'),('x'),('x'), (NULL),(NULL);
SET @save_join_cache_level=@@join_cache_level;
SET join_cache_level=0;
+explain select 1
+from t2 join t1 on
+('i','w') not in (select t1.v1,t4.v2 from t4,t1,t3 where t3.v2 = t1.v1) LIMIT ROWS EXAMINED 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2
+1 PRIMARY t1 index NULL v1 9 NULL 5 Using index
+2 MATERIALIZED t3 ALL NULL NULL NULL NULL 4 Using where
+2 MATERIALIZED t1 ref v1 v1 4 test.t3.v2 1 Using index
+2 MATERIALIZED t4 ALL NULL NULL NULL NULL 50
select 1
from t2 join t1 on
-('i','w') not in (select t1.v1,t4.v2 from t4,t1,t3 where t3.v2 = t1.v1) LIMIT ROWS EXAMINED 500;
+('i','w') not in (select t1.v1,t4.v2 from t4,t1,t3 where t3.v2 = t1.v1) LIMIT ROWS EXAMINED 10;
1
Warnings:
-Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 500. The query result may be incomplete
+Warning 1931 Query execution was interrupted. The query exceeded LIMIT ROWS EXAMINED 10. The query result may be incomplete
SET join_cache_level= @save_join_cache_level;
DROP TABLE t1,t2,t3,t4;
#
@@ -2792,9 +2773,8 @@ set names 'utf8';
EXPLAIN
SELECT * FROM t2 WHERE (t2.a,t2.b) IN (('abc',1), ('def', 2));
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 ALL NULL NULL NULL NULL 5
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 16 func,func 1 Using where
-2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where
+1 PRIMARY <derived3> ref key1,distinct_key key1 4 test.t2.b 1 Using where; FirstMatch(t2)
3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
set names default;
set @@in_predicate_conversion_threshold= @save_in_predicate_conversion_threshold;
@@ -2886,8 +2866,8 @@ WHERE tn.key1 IN ('1','2','3','4','5','6','7','8','9','10')
);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY hist ALL NULL NULL NULL NULL 100 Using where
-2 DEPENDENT SUBQUERY tms range PRIMARY PRIMARY 32 NULL 10 Using where; Using index
-2 DEPENDENT SUBQUERY tn eq_ref PRIMARY PRIMARY 32 test.tms.key1 1 Using where
+2 DEPENDENT SUBQUERY tn range PRIMARY PRIMARY 32 NULL 10 Using index condition; Using where
+2 DEPENDENT SUBQUERY tms eq_ref PRIMARY PRIMARY 32 test.tn.key1 1 Using index
set optimizer_switch=@tmp_os;
drop table t1, t10, t11;
#
@@ -2906,6 +2886,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"duplicate_removal": {
@@ -2915,9 +2896,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -2933,6 +2916,7 @@ ANALYZE
"r_loops": 0,
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -2940,9 +2924,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -2956,6 +2942,7 @@ ANALYZE
{
"query_block": {
"select_id": 3,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -2963,9 +2950,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 2,
"r_rows": 2,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -3278,12 +3267,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": 0.012403489,
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": 0.010504815,
"filtered": 100,
"attached_condition": "t1.a = <cache>((<in_optimizer>((subquery#2),<exists>(subquery#3))) + 1)"
}
@@ -3293,13 +3285,16 @@ EXPLAIN
{
"query_block": {
"select_id": 3,
+ "cost": 0.01034841,
"having_condition": "trigcond(t3.c is null)",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": 0.01034841,
"filtered": 100,
"attached_condition": "trigcond(1 = t3.c or t3.c is null)"
}
@@ -3310,12 +3305,15 @@ EXPLAIN
{
"query_block": {
"select_id": 2,
+ "cost": 0.01034841,
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": 0.01034841,
"filtered": 100,
"attached_condition": "t2.b = 1"
}
diff --git a/mysql-test/main/subselect4.test b/mysql-test/main/subselect4.test
index 854b3736..49484c4e 100644
--- a/mysql-test/main/subselect4.test
+++ b/mysql-test/main/subselect4.test
@@ -291,33 +291,6 @@ EXPLAIN EXTENDED SELECT (SELECT 1 FROM t2 WHERE d = c) AS RESULT FROM t1 GROUP B
DROP TABLE t1,t2;
--echo #
---echo # BUG#45928 "Differing query results depending on MRR and
---echo # engine_condition_pushdown settings"
---echo #
-
-CREATE TABLE `t1` (
- `pk` int(11) NOT NULL AUTO_INCREMENT,
- `time_nokey` time NOT NULL,
- `varchar_key` varchar(1) NOT NULL,
- `varchar_nokey` varchar(1) NOT NULL,
- PRIMARY KEY (`pk`),
- KEY `varchar_key` (`varchar_key`)
-) AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;
-INSERT INTO `t1` VALUES (10,'00:00:00','i','i'),(11,'00:00:00','','');
-
-set @old_optimizer_switch = @@session.optimizer_switch;
-
-SET SESSION OPTIMIZER_SWITCH = 'materialization=off,semijoin=off,loosescan=off,firstmatch=off,mrr=on,engine_condition_pushdown=on';
-
- SELECT `time_nokey` G1 FROM t1 WHERE ( `varchar_nokey` , `varchar_key` ) IN (
-SELECT `varchar_nokey` , `varchar_nokey` ) AND `varchar_key` >= 'c' HAVING G1 ORDER
-BY `pk` ;
-
-set @@session.optimizer_switch = @old_optimizer_switch;
-
-DROP TABLE t1;
-
---echo #
--echo # During work with BUG#45863 I had problems with a query that was
--echo # optimized differently in regular and prepared mode.
--echo # Because there was a bug in one of the selected strategies, I became
@@ -481,7 +454,7 @@ INSERT INTO t2 VALUES (9,1);
--echo # Enable Index condition pushdown
--replace_column 1 #
set @old_icp=@@optimizer_switch;
-SET SESSION optimizer_switch="engine_condition_pushdown=on";
+SET SESSION optimizer_switch="index_condition_pushdown=on";
--echo
SELECT pk
@@ -944,7 +917,7 @@ drop table t1, t2;
CREATE TABLE t1 (c1 varchar(1) DEFAULT NULL);
CREATE TABLE t2 (c1 varchar(1) DEFAULT NULL);
-INSERT INTO t2 VALUES ('k'), ('d');
+INSERT INTO t2 VALUES ('k'), ('d'),('x');
CREATE TABLE t3 (c1 varchar(1) DEFAULT NULL);
INSERT INTO t3 VALUES ('a'), ('b'), ('c');
CREATE TABLE t4 (c1 varchar(1) primary key);
@@ -2284,9 +2257,13 @@ INSERT INTO t4 VALUES
SET @save_join_cache_level=@@join_cache_level;
SET join_cache_level=0;
+explain select 1
+from t2 join t1 on
+('i','w') not in (select t1.v1,t4.v2 from t4,t1,t3 where t3.v2 = t1.v1) LIMIT ROWS EXAMINED 10;
+
select 1
from t2 join t1 on
-('i','w') not in (select t1.v1,t4.v2 from t4,t1,t3 where t3.v2 = t1.v1) LIMIT ROWS EXAMINED 500;
+('i','w') not in (select t1.v1,t4.v2 from t4,t1,t3 where t3.v2 = t1.v1) LIMIT ROWS EXAMINED 10;
SET join_cache_level= @save_join_cache_level;
DROP TABLE t1,t2,t3,t4;
diff --git a/mysql-test/main/subselect_cache.result b/mysql-test/main/subselect_cache.result
index bbfc2281..97c4ef04 100644
--- a/mysql-test/main/subselect_cache.result
+++ b/mysql-test/main/subselect_cache.result
@@ -49,6 +49,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -56,9 +57,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -74,6 +77,7 @@ ANALYZE
"r_hit_ratio": 60,
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 4,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -81,9 +85,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 4,
"rows": 4,
"r_rows": 4,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -108,6 +114,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -115,9 +122,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 10,
"r_rows": 10,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -141,6 +150,7 @@ ANALYZE
{
"query_block": {
"select_id": 3,
+ "cost": "REPLACED",
"r_loops": 4,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -148,9 +158,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 4,
"rows": 4,
"r_rows": 4,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -182,6 +194,7 @@ ANALYZE
"r_hit_ratio": 60,
"query_block": {
"select_id": 2,
+ "cost": "REPLACED",
"r_loops": 4,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -189,9 +202,11 @@ ANALYZE
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 4,
"rows": 4,
"r_rows": 4,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -213,12 +228,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -229,12 +247,15 @@ EXPLAIN
"state": "uninitialized",
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = t2.c"
}
@@ -252,12 +273,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -274,12 +298,15 @@ EXPLAIN
{
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = t2.c"
}
@@ -306,12 +333,15 @@ EXPLAIN
"state": "uninitialized",
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t2",
"access_type": "ALL",
+ "loops": 1,
"rows": 4,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "t1.b = t2.c"
}
diff --git a/mysql-test/main/subselect_cache.test b/mysql-test/main/subselect_cache.test
index 1af28257..2149df2b 100644
--- a/mysql-test/main/subselect_cache.test
+++ b/mysql-test/main/subselect_cache.test
@@ -35,8 +35,10 @@ select a, (select d from t2 where b=c) from t1;
--source include/analyze-format.inc
analyze format=json
select a, (select d from t2 where b=c), (select d from t2 where b=c union select 1 order by 1 limit 1) from t1;
+--source include/explain-no-costs.inc
explain format=json
select a, (select d from t2 where b=c) from t1;
+--source include/explain-no-costs.inc
explain format=json
select a, (select d from t2 where b=c), (select d from t2 where b=c union select 1 order by 1 limit 1) from t1;
set optimizer_switch='subquery_cache=off';
diff --git a/mysql-test/main/subselect_debug.result b/mysql-test/main/subselect_debug.result
index 9be53ae0..cc1bfb44 100644
--- a/mysql-test/main/subselect_debug.result
+++ b/mysql-test/main/subselect_debug.result
@@ -1,7 +1,7 @@
CREATE TABLE t1(id INT);
INSERT INTO t1 VALUES (1),(2),(3),(4);
INSERT INTO t1 SELECT a.id FROM t1 a,t1 b,t1 c,t1 d;
-SET @orig_debug=@@debug;
+SET @orig_debug=@@debug_dbug;
SET GLOBAL debug_dbug="d,subselect_exec_fail";
SELECT SUM(EXISTS(SELECT RAND() FROM t1)) FROM t1;
SUM(EXISTS(SELECT RAND() FROM t1))
diff --git a/mysql-test/main/subselect_debug.test b/mysql-test/main/subselect_debug.test
index f27867dc..964f5aef 100644
--- a/mysql-test/main/subselect_debug.test
+++ b/mysql-test/main/subselect_debug.test
@@ -9,7 +9,7 @@ CREATE TABLE t1(id INT);
INSERT INTO t1 VALUES (1),(2),(3),(4);
INSERT INTO t1 SELECT a.id FROM t1 a,t1 b,t1 c,t1 d;
# Setup the mysqld to crash at certain point
-SET @orig_debug=@@debug;
+SET @orig_debug=@@debug_dbug;
SET GLOBAL debug_dbug="d,subselect_exec_fail";
SELECT SUM(EXISTS(SELECT RAND() FROM t1)) FROM t1;
SELECT REVERSE(EXISTS(SELECT RAND() FROM t1));
diff --git a/mysql-test/main/subselect_exists2in.result b/mysql-test/main/subselect_exists2in.result
index 9c2246b3..90d8dcef 100644
--- a/mysql-test/main/subselect_exists2in.result
+++ b/mysql-test/main/subselect_exists2in.result
@@ -51,8 +51,8 @@ c
explain extended
SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t3 WHERE t3.b = t1.a);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 index aa aa 4 NULL 2 100.00 Using index
-1 PRIMARY t3 ALL bb NULL NULL NULL 2 100.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+1 PRIMARY t1 index aa aa 4 NULL 2 100.00 Using where; Using index
+1 PRIMARY t3 ref bb bb 4 test.t1.a 1 100.00 FirstMatch(t1)
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t3`) where `test`.`t3`.`b` = `test`.`t1`.`a`
@@ -65,10 +65,10 @@ explain extended
SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t3 WHERE t3.b = t1.a);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 index NULL aa 4 NULL 2 100.00 Using where; Using index
-2 DEPENDENT SUBQUERY t3 ALL bb NULL NULL NULL 2 100.00 Using where
+2 DEPENDENT SUBQUERY t3 index_subquery bb bb 4 func 1 100.00
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where <in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#2 */ select `test`.`t3`.`b` from `test`.`t3` where <cache>(`test`.`t1`.`a`) = `test`.`t3`.`b`))
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where <in_optimizer>(`test`.`t1`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`a`) in t3 on bb)))
-- EXIST2IN then MATERIALIZATION
set optimizer_switch='exists_to_in=on,in_to_exists=off,semijoin=off,materialization=on,subquery_cache=off';
SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t3 WHERE t3.b = t1.a);
@@ -91,7 +91,7 @@ explain extended
SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t3 WHERE t3.b = t1.a);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 index NULL aa 4 NULL 2 100.00 Using where; Using index
-2 DEPENDENT SUBQUERY t3 ALL bb NULL NULL NULL 2 100.00 Using where
+2 DEPENDENT SUBQUERY t3 ref bb bb 4 test.t1.a 1 100.00
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where exists(/* select#2 */ select `test`.`t3`.`a` from `test`.`t3` where `test`.`t3`.`b` = `test`.`t1`.`a` limit 1)
@@ -297,23 +297,28 @@ d a b e412 e412 h412
d b a i421 i421 l421
d b b m422 m422 o422
drop table t1, t2, t3;
+#
+# LP BUG#901835 - incorrect semi-join conversion after exists2in
+#
CREATE TABLE t1 ( a INT );
-INSERT INTO t1 VALUES (7),(0);
+INSERT INTO t1 VALUES (7),(0),(100);
CREATE TABLE t2 ( b INT );
-INSERT INTO t2 VALUES (0),(8);
+INSERT INTO t2 VALUES (0),(8),(1000),(2000),(3000),(4000),(5000);
+insert into t2 select seq from seq_6000_to_6100;
SELECT * FROM t1 WHERE
EXISTS ( SELECT * FROM t2 WHERE b = a )
OR a > 0;
a
7
0
+100
explain extended
SELECT * FROM t1 WHERE
EXISTS ( SELECT * FROM t2 WHERE b = a )
OR a > 0;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 108 100.00
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where <expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,`test`.`t1`.`a` in ( <materialize> (/* select#2 */ select `test`.`t2`.`b` from `test`.`t2` where 1 ), <primary_index_lookup>(`test`.`t1`.`a` in <temporary table> on distinct_key where `test`.`t1`.`a` = `<subquery2>`.`b`)))) or `test`.`t1`.`a` > 0
@@ -386,7 +391,7 @@ explain extended
SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t3 WHERE t3.b = t1.a and t3.b1 = t1.a1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t3 index bb bb 8 NULL 2 100.00 Using where; Using index; LooseScan
-1 PRIMARY t1 ref aa aa 8 test.t3.b,test.t3.b1 2 100.00 Using index
+1 PRIMARY t1 ref aa aa 8 test.t3.b,test.t3.b1 1 50.00 Using index
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.t1.a1' of SELECT #2 was resolved in SELECT #1
@@ -400,7 +405,7 @@ explain extended
SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t3 WHERE t3.b = t1.a and t3.b1 = t1.a1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 index NULL aa 8 NULL 2 100.00 Using where; Using index
-2 DEPENDENT SUBQUERY t3 index_subquery bb bb 8 func,func 2 100.00 Using index; Using where
+2 DEPENDENT SUBQUERY t3 index_subquery bb bb 8 func,func 1 100.00 Using index; Using where
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.t1.a1' of SELECT #2 was resolved in SELECT #1
@@ -428,7 +433,7 @@ explain extended
SELECT * FROM t1 WHERE EXISTS ( SELECT * FROM t3 WHERE t3.b = t1.a and t3.b1 = t1.a1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 index NULL aa 8 NULL 2 100.00 Using where; Using index
-2 DEPENDENT SUBQUERY t3 ref bb bb 8 test.t1.a,test.t1.a1 2 100.00 Using index
+2 DEPENDENT SUBQUERY t3 ref bb bb 8 test.t1.a,test.t1.a1 1 100.00 Using index
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.t1.a1' of SELECT #2 was resolved in SELECT #1
@@ -579,7 +584,7 @@ set optimizer_switch='exists_to_in=on';
# MDEV-243 Wrong result (extra or missing rows) with
# exists_to_in + materialization, EXISTS subquery
#
-SET optimizer_switch='index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=on';
+SET optimizer_switch='index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=on';
CREATE TABLE t1 ( a VARCHAR(1), b VARCHAR(1) );
INSERT INTO t1 VALUES ('v','v'),('s','v');
SELECT * FROM t1 AS alias
@@ -591,7 +596,7 @@ SELECT * FROM t1 AS alias
WHERE EXISTS ( SELECT * FROM t1 WHERE a > alias.a AND a = alias.b );
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY alias ALL NULL NULL NULL NULL 2 100.00 Using where
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch(alias); Using join buffer (flat, BNL join)
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 50.00 Using where; FirstMatch(alias); Using join buffer (flat, BNL join)
Warnings:
Note 1276 Field or reference 'test.alias.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.alias.b' of SELECT #2 was resolved in SELECT #1
@@ -622,7 +627,7 @@ SELECT * FROM t1 AS alias
WHERE EXISTS ( SELECT * FROM t1 WHERE a > alias.a AND a = alias.b );
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY alias ALL NULL NULL NULL NULL 2 100.00 Using where
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary; End temporary
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 50.00 Using where; Start temporary; End temporary
Warnings:
Note 1276 Field or reference 'test.alias.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.alias.b' of SELECT #2 was resolved in SELECT #1
@@ -713,14 +718,15 @@ set optimizer_switch='exists_to_in=on';
# correct calculation of reserved items (postreview-fix)
#
create table t1 (col1 int, col2 int, col3 int);
-insert into t1 values (1,2,3),(2,3,4),(4,5,6);
+insert into t1 values (1,2,3),(2,3,4),(4,5,6),(7,8,9);
create table t2 as select * from t1;
+insert into t2 select seq,seq,seq from seq_1000_to_1200;
explain extended
select * from t1 where exists (select col2 from t2 where t2.col1=t1.col1 and t2.col2=t1.col2);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1 100.00
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 205 100.00
Warnings:
Note 1276 Field or reference 'test.t1.col1' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.t1.col2' of SELECT #2 was resolved in SELECT #1
@@ -730,6 +736,7 @@ col1 col2 col3
1 2 3
2 3 4
4 5 6
+7 8 9
drop table t1,t2;
#
# MDEV-3879: Exists2In: Wrong result (extra row) and unexpected
@@ -902,9 +909,8 @@ WHERE EXISTS ( SELECT * FROM t1 AS sq2
WHERE sq1.`pk` IN ( SELECT f1 FROM t1 ) AND sq2.f1 = sq1.f1 );
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
-3 DEPENDENT SUBQUERY <subquery4> eq_ref distinct_key distinct_key 4 func 1 100.00
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 50.00 Using where; FirstMatch
3 DEPENDENT SUBQUERY sq2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
-4 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00
Warnings:
Note 1276 Field or reference 'sq1.pk' of SELECT #3 was resolved in SELECT #1
Note 1276 Field or reference 'sq1.f1' of SELECT #3 was resolved in SELECT #1
@@ -922,9 +928,8 @@ WHERE EXISTS ( SELECT * FROM t1 AS sq2
WHERE sq1.`pk` IN ( SELECT f1 FROM t1 ) AND sq2.f1 = sq1.f1 );
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
-3 DEPENDENT SUBQUERY <subquery4> eq_ref distinct_key distinct_key 4 func 1 100.00
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 50.00 Using where; FirstMatch
3 DEPENDENT SUBQUERY sq2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
-4 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00
Warnings:
Note 1276 Field or reference 'sq1.pk' of SELECT #3 was resolved in SELECT #1
Note 1276 Field or reference 'sq1.f1' of SELECT #3 was resolved in SELECT #1
diff --git a/mysql-test/main/subselect_exists2in.test b/mysql-test/main/subselect_exists2in.test
index 89b37cff..d8210d83 100644
--- a/mysql-test/main/subselect_exists2in.test
+++ b/mysql-test/main/subselect_exists2in.test
@@ -1,4 +1,5 @@
--source include/default_optimizer_switch.inc
+--source include/have_sequence.inc
--disable_warnings
drop table if exists t1,t2,t3;
@@ -238,13 +239,14 @@ group by a1,a2,b;
drop table t1, t2, t3;
-#
-# LP BUG#901835 - incorrect semi-join conversion after exists2in
-#
+--echo #
+--echo # LP BUG#901835 - incorrect semi-join conversion after exists2in
+--echo #
CREATE TABLE t1 ( a INT );
-INSERT INTO t1 VALUES (7),(0);
+INSERT INTO t1 VALUES (7),(0),(100);
CREATE TABLE t2 ( b INT );
-INSERT INTO t2 VALUES (0),(8);
+INSERT INTO t2 VALUES (0),(8),(1000),(2000),(3000),(4000),(5000);
+insert into t2 select seq from seq_6000_to_6100;
SELECT * FROM t1 WHERE
EXISTS ( SELECT * FROM t2 WHERE b = a )
@@ -458,7 +460,7 @@ set optimizer_switch='exists_to_in=on';
--echo # exists_to_in + materialization, EXISTS subquery
--echo #
-SET optimizer_switch='index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=on';
+SET optimizer_switch='index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=off,exists_to_in=on';
CREATE TABLE t1 ( a VARCHAR(1), b VARCHAR(1) );
INSERT INTO t1 VALUES ('v','v'),('s','v');
@@ -567,8 +569,10 @@ set optimizer_switch='exists_to_in=on';
--echo # correct calculation of reserved items (postreview-fix)
--echo #
create table t1 (col1 int, col2 int, col3 int);
-insert into t1 values (1,2,3),(2,3,4),(4,5,6);
+insert into t1 values (1,2,3),(2,3,4),(4,5,6),(7,8,9);
create table t2 as select * from t1;
+insert into t2 select seq,seq,seq from seq_1000_to_1200;
+
explain extended
select * from t1 where exists (select col2 from t2 where t2.col1=t1.col1 and t2.col2=t1.col2);
select * from t1 where exists (select col2 from t2 where t2.col1=t1.col1 and t2.col2=t1.col2);
diff --git a/mysql-test/main/subselect_exists2in_costmat.result b/mysql-test/main/subselect_exists2in_costmat.result
index 1c9574aa..6aecfeaf 100644
--- a/mysql-test/main/subselect_exists2in_costmat.result
+++ b/mysql-test/main/subselect_exists2in_costmat.result
@@ -37,8 +37,6 @@ create index Language on CountryLanguage(Language);
create index CityName on City(Name);
alter table City change population population int(11) null default 0;
select max(id) from City into @max_city_id;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
insert into City values (@max_city_id + 1,'Kilifarevo','BGR',NULL);
SELECT COUNT(*) FROM Country;
COUNT(*)
diff --git a/mysql-test/main/subselect_exists2in_costmat.test b/mysql-test/main/subselect_exists2in_costmat.test
index 371f0936..dd389049 100644
--- a/mysql-test/main/subselect_exists2in_costmat.test
+++ b/mysql-test/main/subselect_exists2in_costmat.test
@@ -67,6 +67,7 @@ set @@optimizer_switch = 'exists_to_in=on,in_to_exists=on,semijoin=on,materializ
-- echo Q1.1m:
-- echo MATERIALIZATION: there are too many rows in the outer query
-- echo to be looked up in the inner table.
+
EXPLAIN
SELECT Name FROM Country
WHERE (EXISTS (select 1 from City where City.Population > 100000 and
diff --git a/mysql-test/main/subselect_extra.result b/mysql-test/main/subselect_extra.result
index c654fdfc..247b36db 100644
--- a/mysql-test/main/subselect_extra.result
+++ b/mysql-test/main/subselect_extra.result
@@ -68,7 +68,7 @@ select * from t1
where id in (select id from t1 as x1 where (t1.cur_date is null));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
-1 PRIMARY x1 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+1 PRIMARY x1 ALL NULL NULL NULL NULL 2 50.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
Warnings:
Note 1276 Field or reference 'test.t1.cur_date' of SELECT #2 was resolved in SELECT #1
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`cur_date` AS `cur_date` from `test`.`t1` semi join (`test`.`t1` `x1`) where `test`.`x1`.`id` = `test`.`t1`.`id` and `test`.`t1`.`cur_date` = 0
@@ -80,7 +80,7 @@ select * from t2
where id in (select id from t2 as x1 where (t2.cur_date is null));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
-1 PRIMARY x1 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch(t2); Using join buffer (flat, BNL join)
+1 PRIMARY x1 ALL NULL NULL NULL NULL 2 50.00 Using where; FirstMatch(t2); Using join buffer (flat, BNL join)
Warnings:
Note 1276 Field or reference 'test.t2.cur_date' of SELECT #2 was resolved in SELECT #1
Note 1003 select `test`.`t2`.`id` AS `id`,`test`.`t2`.`cur_date` AS `cur_date` from `test`.`t2` semi join (`test`.`t2` `x1`) where `test`.`x1`.`id` = `test`.`t2`.`id` and `test`.`t2`.`cur_date` = 0
@@ -393,7 +393,7 @@ EXPLAIN
SELECT a FROM t1 WHERE (a,b) IN (SELECT * FROM v1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
-1 PRIMARY <derived3> ref key0 key0 10 test.t1.a,test.t1.b 2 FirstMatch(t1)
+1 PRIMARY <derived3> ref key0 key0 10 test.t1.a,test.t1.b 1 FirstMatch(t1)
3 DERIVED t2 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort
SELECT * FROM v2;
a b
@@ -413,7 +413,7 @@ EXPLAIN
SELECT a FROM t1 WHERE (a,b) IN (SELECT * FROM v2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
-1 PRIMARY <derived3> ref key0 key0 10 test.t1.a,test.t1.b 1 FirstMatch(t1)
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 10 test.t1.a,test.t1.b 1
3 DERIVED t2 ALL NULL NULL NULL NULL 6
4 UNION t3 ALL NULL NULL NULL NULL 4
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
@@ -451,8 +451,8 @@ WHERE t3.b IN (SELECT v1.b FROM v1, t2
WHERE t2.c = v1.c AND t2.c = v1.b AND v1.b = t3.c);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 system NULL NULL NULL NULL 1
-1 PRIMARY <derived3> ref key1 key1 8 const,const 0 Start temporary
-1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where
+1 PRIMARY <derived3> ref key1 key1 8 const,const 0 FirstMatch(t3)
3 DERIVED t1 ALL NULL NULL NULL NULL 3 Using where
SELECT * FROM t3
WHERE t3.b IN (SELECT v1.b FROM v1, t2
@@ -474,7 +474,7 @@ EXPLAIN
SELECT * FROM t1 WHERE t1.b IN (SELECT v2.a FROM v2 WHERE v2.b = t1.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
-1 PRIMARY <derived3> ref key0 key0 10 test.t1.b,test.t1.a 2 FirstMatch(t1)
+1 PRIMARY <derived3> ref key0 key0 10 test.t1.b,test.t1.a 1 FirstMatch(t1)
3 DERIVED t2 ALL NULL NULL NULL NULL 2
SELECT * FROM t1 WHERE t1.b IN (SELECT v2.a FROM v2 WHERE v2.b = t1.a);
a b
diff --git a/mysql-test/main/subselect_extra_no_semijoin.result b/mysql-test/main/subselect_extra_no_semijoin.result
index faeaf75c..ead53edf 100644
--- a/mysql-test/main/subselect_extra_no_semijoin.result
+++ b/mysql-test/main/subselect_extra_no_semijoin.result
@@ -395,7 +395,7 @@ EXPLAIN
SELECT a FROM t1 WHERE (a,b) IN (SELECT * FROM v1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
-2 DEPENDENT SUBQUERY <derived3> index_subquery key0 key0 10 func,func 2 Using where
+2 DEPENDENT SUBQUERY <derived3> index_subquery key0 key0 10 func,func 1 Using where
3 DERIVED t2 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort
SELECT * FROM v2;
a b
@@ -415,7 +415,7 @@ EXPLAIN
SELECT a FROM t1 WHERE (a,b) IN (SELECT * FROM v2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
-2 DEPENDENT SUBQUERY <derived3> index_subquery key0 key0 10 func,func 1 Using where
+2 DEPENDENT SUBQUERY <derived3> unique_subquery distinct_key distinct_key 10 func,func 1 Using where
3 DERIVED t2 ALL NULL NULL NULL NULL 6
4 UNION t3 ALL NULL NULL NULL NULL 4
NULL UNION RESULT <union3,4> ALL NULL NULL NULL NULL NULL
@@ -476,7 +476,7 @@ EXPLAIN
SELECT * FROM t1 WHERE t1.b IN (SELECT v2.a FROM v2 WHERE v2.b = t1.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
-2 DEPENDENT SUBQUERY <derived3> ref key0 key0 5 test.t1.a 2 Using where
+2 DEPENDENT SUBQUERY <derived3> ref key0 key0 5 test.t1.a 1 Using where
3 DERIVED t2 ALL NULL NULL NULL NULL 2
SELECT * FROM t1 WHERE t1.b IN (SELECT v2.a FROM v2 WHERE v2.b = t1.a);
a b
diff --git a/mysql-test/main/subselect_firstmatch.result b/mysql-test/main/subselect_firstmatch.result
new file mode 100644
index 00000000..86a3dd1b
--- /dev/null
+++ b/mysql-test/main/subselect_firstmatch.result
@@ -0,0 +1,30 @@
+#
+# Check that firstmatch works with HASH
+#
+create table t1 (a int, b int);
+insert into t1 select seq, seq from seq_1_to_10;
+create table t2 (a int, b int);
+insert into t2 select A.seq,A.seq from seq_1_to_10 A, seq_1_to_10 B;
+set @save_join_cache_level=@@join_cache_level;
+set join_cache_level=6;
+explain select * from t1 where t1.a in (select t2.a from t2 where t1.b=t2.b);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 10 Using where
+1 PRIMARY t2 hash_ALL NULL #hash#$hj 10 test.t1.a,test.t1.b 100 Using where; FirstMatch(t1); Using join buffer (flat, BNLH join)
+select * from t1 where t1.a in (select t2.a from t2 where t1.b=t2.b);
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+6 6
+7 7
+8 8
+9 9
+10 10
+set @@join_cache_level=@save_join_cache_level;
+drop table t1,t2;
+#
+# End of 11.0 tests
+#
diff --git a/mysql-test/main/subselect_firstmatch.test b/mysql-test/main/subselect_firstmatch.test
new file mode 100644
index 00000000..54da8bf0
--- /dev/null
+++ b/mysql-test/main/subselect_firstmatch.test
@@ -0,0 +1,28 @@
+#
+# Test for semijoins that don't need to be run for a lot of combinations
+#
+--source include/have_sequence.inc
+
+--echo #
+--echo # Check that firstmatch works with HASH
+--echo #
+
+create table t1 (a int, b int);
+insert into t1 select seq, seq from seq_1_to_10;
+
+create table t2 (a int, b int);
+insert into t2 select A.seq,A.seq from seq_1_to_10 A, seq_1_to_10 B;
+
+set @save_join_cache_level=@@join_cache_level;
+set join_cache_level=6;
+
+explain select * from t1 where t1.a in (select t2.a from t2 where t1.b=t2.b);
+select * from t1 where t1.a in (select t2.a from t2 where t1.b=t2.b);
+
+set @@join_cache_level=@save_join_cache_level;
+
+drop table t1,t2;
+
+--echo #
+--echo # End of 11.0 tests
+--echo #
diff --git a/mysql-test/main/subselect_innodb.result b/mysql-test/main/subselect_innodb.result
index 242b01f8..94f62231 100644
--- a/mysql-test/main/subselect_innodb.result
+++ b/mysql-test/main/subselect_innodb.result
@@ -314,7 +314,7 @@ EXPLAIN SELECT 1 FROM t1 WHERE NOT EXISTS
(SELECT 1 FROM t2 WHERE d = (SELECT d FROM t2 WHERE a >= 1) ORDER BY d);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 1 Using where
-2 DEPENDENT SUBQUERY t2 unique_subquery PRIMARY,d PRIMARY 1 func 1 Using where
+2 DEPENDENT SUBQUERY t2 unique_subquery PRIMARY,d d 2 func 1 Using index; Using where
3 DEPENDENT SUBQUERY t2 index NULL d 2 NULL 1 Using index
DROP TABLE t2;
CREATE TABLE t2 (b INT, c INT, UNIQUE KEY (b), UNIQUE KEY (b, c )) ENGINE=INNODB;
@@ -462,7 +462,7 @@ EXPLAIN
SELECT * FROM t1 WHERE EXISTS ( SELECT b FROM t2, t3 GROUP BY b HAVING b != 3 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
-2 SUBQUERY t2 index NULL PRIMARY 4 NULL 1 Using index; Using temporary
+2 SUBQUERY t2 ALL NULL NULL NULL NULL 1 Using temporary
2 SUBQUERY t3 ALL NULL NULL NULL NULL 1 Using join buffer (flat, BNL join)
SELECT * FROM t1 WHERE EXISTS ( SELECT b FROM t2, t3 GROUP BY b HAVING b != 3 );
a
@@ -560,6 +560,7 @@ id select_type table type possible_keys key key_len ref rows Extra
#
# MDEV-6081: ORDER BY+ref(const): selectivity is very incorrect (MySQL Bug#14338686)
#
+insert into t2 select seq,seq,seq from seq_10000_to_11000;
alter table t2 add key2 int;
update t2 set key2=key1;
alter table t2 add key(key2);
@@ -580,6 +581,25 @@ t1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL #
2 DEPENDENT SUBQUERY t2 ref key1 key1 5 test.t1.a # Using where; Using filesort
+select
+(SELECT
+concat(id, '-', key1, '-', col1)
+FROM t2
+WHERE t2.key1 = t1.a
+ORDER BY t2.key2 ASC LIMIT 1) as subq
+from
+t1;
+subq
+100-0-123456
+101-1-123456
+102-2-123456
+103-3-123456
+104-4-123456
+105-5-123456
+106-6-123456
+107-7-123456
+108-8-123456
+109-9-123456
drop table t1,t2;
#
# MDEV-12931: semi-join in ON expression of STRAIGHT_JOIN
@@ -612,11 +632,10 @@ INNER JOIN
ON ( 1 IN ( SELECT f4 FROM t4 ) ) )
ON ( f1 >= f2 );
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00
+1 PRIMARY t4 ALL NULL NULL NULL NULL 2 50.00 Using where; FirstMatch
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join)
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (incremental, BNL join)
-3 MATERIALIZED t4 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t2`.`f2` AS `f2`,`test`.`t3`.`f3` AS `f3` from `test`.`t1` join `test`.`t2` semi join (`test`.`t4`) join `test`.`t3` where `test`.`t4`.`f4` = 1 and `test`.`t1`.`f1` >= `test`.`t2`.`f2`
DROP TABLE t1,t2,t3,t4;
diff --git a/mysql-test/main/subselect_innodb.test b/mysql-test/main/subselect_innodb.test
index e354ddc4..840e0adf 100644
--- a/mysql-test/main/subselect_innodb.test
+++ b/mysql-test/main/subselect_innodb.test
@@ -1,5 +1,6 @@
-- source include/no_valgrind_without_big.inc
-- source include/have_innodb.inc
+-- source include/have_sequence.inc
# Note: the tests uses only non-semijoin subqueries so semi-join switch
# settings are not relevant.
@@ -568,6 +569,11 @@ from
--echo # MDEV-6081: ORDER BY+ref(const): selectivity is very incorrect (MySQL Bug#14338686)
--echo #
+
+# Table t2 has 100 equal values / key value, which causes it to prefer index scan instead of ref
+# Fix it by adding more different values to key1
+insert into t2 select seq,seq,seq from seq_10000_to_11000;
+
alter table t2 add key2 int;
update t2 set key2=key1;
alter table t2 add key(key2);
@@ -583,6 +589,14 @@ explain select
ORDER BY t2.key2 ASC LIMIT 1)
from
t1;
+select
+ (SELECT
+ concat(id, '-', key1, '-', col1)
+ FROM t2
+ WHERE t2.key1 = t1.a
+ ORDER BY t2.key2 ASC LIMIT 1) as subq
+from
+ t1;
drop table t1,t2;
diff --git a/mysql-test/main/subselect_mat.result b/mysql-test/main/subselect_mat.result
index 1f20e1bd..e964413d 100644
--- a/mysql-test/main/subselect_mat.result
+++ b/mysql-test/main/subselect_mat.result
@@ -1142,7 +1142,7 @@ a
explain extended
select a from t1 group by a having a in (select c from t2 where d >= 20);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 range NULL it1a 4 NULL 8 100.00 Using index for group-by
+1 PRIMARY t1 range NULL it1a 4 NULL 7 100.00 Using index for group-by
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 7 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` group by `test`.`t1`.`a` having <expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,`test`.`t1`.`a` in ( <materialize> (/* select#2 */ select `test`.`t2`.`c` from `test`.`t2` where `test`.`t2`.`d` >= 20 ), <primary_index_lookup>(`test`.`t1`.`a` in <temporary table> on distinct_key where `test`.`t1`.`a` = `<subquery2>`.`c`))))
@@ -1154,7 +1154,7 @@ create index iab on t1(a, b);
explain extended
select a from t1 group by a having a in (select c from t2 where d >= 20);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 range NULL it1a 4 NULL 8 100.00 Using index for group-by
+1 PRIMARY t1 range NULL it1a 4 NULL 7 100.00 Using index for group-by
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 7 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` group by `test`.`t1`.`a` having <expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,`test`.`t1`.`a` in ( <materialize> (/* select#2 */ select `test`.`t2`.`c` from `test`.`t2` where `test`.`t2`.`d` >= 20 ), <primary_index_lookup>(`test`.`t1`.`a` in <temporary table> on distinct_key where `test`.`t1`.`a` = `<subquery2>`.`c`))))
@@ -1166,7 +1166,7 @@ explain extended
select a from t1 group by a
having a in (select c from t2 where d >= some(select e from t3 where max(b)=e));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 range NULL iab 4 NULL 8 100.00 Using index for group-by
+1 PRIMARY t1 range NULL iab 4 NULL 7 100.00 Using index for group-by
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 7 100.00 Using where
3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 4 100.00 Using where
Warnings:
@@ -1510,13 +1510,15 @@ SET @@optimizer_switch='semijoin=on,materialization=on';
EXPLAIN SELECT COUNT(*) FROM t1 WHERE (f1,f2) IN (SELECT f1,f2 FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 7 func,func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
SELECT COUNT(*) FROM t1 WHERE (f1,f2) IN (SELECT f1,f2 FROM t2);
COUNT(*)
2
set @@optimizer_switch= @local_optimizer_switch;
DROP TABLE t1, t2;
+#
+# BUG#46548 IN-subqueries return 0 rows with materialization=on
+#
CREATE TABLE t1 (
pk int,
a varchar(1),
@@ -1526,16 +1528,19 @@ d varchar(4),
PRIMARY KEY (pk)
);
INSERT INTO t1 VALUES (1,'o','ffff','ffff','ffoo'),(2,'f','ffff','ffff','ffff');
+insert into t1 select seq,'x','xxxx','xxxx','xxxx' from seq_10_to_40;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES (1,'i','iiii','iiii','iiii'),(2,'f','ffff','ffff','ffff');
+insert into t2 select -seq,'a','aaaa','aaaa','aaaa' from seq_1_to_20;
+insert into t2 select seq,'b','bbbb','bbbb','bbbb' from seq_100_to_200;
set @local_optimizer_switch=@@optimizer_switch;
set @@optimizer_switch=@optimizer_switch_local_default;
SET @@optimizer_switch='semijoin=on,materialization=on';
EXPLAIN SELECT pk FROM t1 WHERE (a) IN (SELECT a FROM t2 WHERE pk > 0);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2
+1 PRIMARY t1 ALL NULL NULL NULL NULL 33
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 2 Using index condition; Using where; Rowid-ordered scan
+2 MATERIALIZED t2 ALL PRIMARY NULL NULL NULL 123 Using where
SELECT pk FROM t1 WHERE (a) IN (SELECT a FROM t2 WHERE pk > 0);
pk
2
@@ -1890,19 +1895,20 @@ WHERE alias4.c = alias3.b
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
3 MATERIALIZED alias3 ALL NULL NULL NULL NULL 2 Using where
-3 MATERIALIZED alias4 ref c c 11 test.alias3.b 2 Using where; Using index
+3 MATERIALIZED alias4 ref c c 11 test.alias3.b 1 Using where; Using index
DROP TABLE t1,t2;
#
# BUG#928048: Query containing IN subquery with OR in the where clause returns a wrong result
#
create table t1 (a int, b int);
insert into t1 values (7,5), (3,3), (5,4), (9,3);
+insert into t1 select seq,seq from seq_100_to_200;
create table t2 (a int, b int, index i_a(a));
insert into t2 values
(4,2), (7,9), (7,4), (3,1), (5,3), (3,1), (9,4), (8,1);
explain select * from t1 where t1.a in (select a from t2 where t2.a=7 or t2.b<=1);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 105 Using where
2 MATERIALIZED t2 ALL i_a NULL NULL NULL 8 Using where
select * from t1 where t1.a in (select a from t2 where t2.a=7 or t2.b<=1);
a b
@@ -2194,9 +2200,8 @@ mysqltest1
EXPLAIN EXTENDED
SELECT db FROM t1 WHERE db IN (SELECT SCHEMA_NAME FROM information_schema.schemata) ORDER BY db DESC;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2 100.00 Using temporary; Using filesort
-1 PRIMARY t1 eq_ref db db 764 information_schema.schemata.SCHEMA_NAME 1 100.00 Using where; Using index
-2 MATERIALIZED schemata ALL NULL NULL NULL NULL NULL NULL
+1 PRIMARY t1 index db db 764 NULL 4 100.00 Using index; Using temporary; Using filesort
+1 PRIMARY schemata ALL NULL NULL NULL NULL NULL NULL Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`db` AS `db` from `test`.`t1` semi join (`information_schema`.`schemata`) where `test`.`t1`.`db` = `information_schema`.`schemata`.`SCHEMA_NAME` order by `test`.`t1`.`db` desc
drop table t1;
@@ -2228,8 +2233,10 @@ drop table t1;
CREATE TABLE t1 (
pk INT, f1 INT NOT NULL, f2 VARCHAR(3), f3 INT NULL, PRIMARY KEY(pk)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,1,'foo',8), (2,5,'bar',7);
+create table t2 like t1;
+insert into t2 select * from t1;
SELECT sq1.f2 FROM t1 AS sq1
-WHERE EXISTS ( SELECT * FROM t1 AS sq2
+WHERE EXISTS ( SELECT * FROM t2 AS sq2
WHERE sq1.`pk` IN ( SELECT f1 FROM t1 ) AND sq2.f1 = sq1.f1 );
f2
foo
@@ -2241,18 +2248,17 @@ WHERE EXISTS ( SELECT * FROM t1 AS sq2
WHERE sq1.`pk` IN ( SELECT f1 FROM t1 ) AND sq2.f1 = sq1.f1 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY sq1 ALL NULL NULL NULL NULL 2 Using where
-2 DEPENDENT SUBQUERY <subquery3> eq_ref distinct_key distinct_key 4 func 1
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where; FirstMatch
2 DEPENDENT SUBQUERY sq2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-3 MATERIALIZED t1 ALL NULL NULL NULL NULL 2
# this checks the result set above
set optimizer_switch= 'materialization=off,semijoin=off';
SELECT sq1.f2 FROM t1 AS sq1
-WHERE EXISTS ( SELECT * FROM t1 AS sq2
+WHERE EXISTS ( SELECT * FROM t2 AS sq2
WHERE sq1.`pk` IN ( SELECT f1 FROM t1 ) AND sq2.f1 = sq1.f1 );
f2
foo
set optimizer_switch= @local_optimizer_switch;
-DROP TABLE t1;
+DROP TABLE t1,t2;
#
# MDEV-12145: IN subquery used in WHERE of EXISTS subquery
#
@@ -2275,10 +2281,9 @@ WHERE EXISTS ( SELECT * FROM t2, t3
WHERE i3 = i2 AND f1 IN ( SELECT f3 FROM t3 ) );
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
-2 DEPENDENT SUBQUERY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 8 12.50 Using where; FirstMatch
2 DEPENDENT SUBQUERY t2 range i2 i2 5 NULL 3 100.00 Using where; Using index; Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY t3 ref i3 i3 5 test.t2.i2 2 100.00 Using index
-3 MATERIALIZED t3 ALL NULL NULL NULL NULL 8 100.00
+2 DEPENDENT SUBQUERY t3 ref i3 i3 5 test.t2.i2 1 100.00 Using index
Warnings:
Note 1276 Field or reference 'test.t1.f1' of SELECT #2 was resolved in SELECT #1
Note 1003 /* select#1 */ select `test`.`t1`.`f1` AS `f1` from `test`.`t1` where <expr_cache><`test`.`t1`.`f1`>(exists(/* select#2 */ select 1 from `test`.`t2` semi join (`test`.`t3`) join `test`.`t3` where `test`.`t3`.`i3` = `test`.`t2`.`i2` and `test`.`t1`.`f1` = `test`.`t3`.`f3` limit 1))
@@ -2314,9 +2319,8 @@ SELECT pk, f1, ( SELECT COUNT(*) FROM t2
WHERE t1.pk IN ( SELECT f2 FROM t2 ) ) AS sq FROM t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00
-2 DEPENDENT SUBQUERY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 20.00 Using where; FirstMatch
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (flat, BNL join)
-3 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00
Warnings:
Note 1276 Field or reference 'test.t1.pk' of SELECT #2 was resolved in SELECT #1
Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`f1` AS `f1`,<expr_cache><`test`.`t1`.`pk`>((/* select#2 */ select count(0) from `test`.`t2` semi join (`test`.`t2`) where `test`.`t1`.`pk` = `test`.`t2`.`f2`)) AS `sq` from `test`.`t1`
@@ -2399,11 +2403,10 @@ WHERE t2.ugroup = t3_i.sys_id AND
t3_i.type LIKE '59e22fb137032000158bbfc8bcbe5d52' AND
t2.user = '86826bf03710200044e0bfc8bcbe5d79');
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2
-1 PRIMARY t1 ref idx1,idx2 idx1 35 test.t2.ugroup 2 Using where
+1 PRIMARY t2 ref idx3,idx4 idx4 35 const 2 Using index condition; Using where; Start temporary
+1 PRIMARY t3_i eq_ref PRIMARY PRIMARY 32 test.t2.ugroup 1 Using index condition; Using where
+1 PRIMARY t1 ref idx1,idx2 idx1 35 test.t3_i.sys_id 2 Using index condition; Using where; End temporary
1 PRIMARY t3 eq_ref PRIMARY PRIMARY 32 test.t1.assignment_group 1 Using where; Using index
-2 MATERIALIZED t2 ref idx3,idx4 idx4 35 const 2 Using index condition; Using where
-2 MATERIALIZED t3_i eq_ref PRIMARY PRIMARY 32 test.t2.ugroup 1 Using index condition; Using where
set statement optimizer_prune_level=1 for explain SELECT t1.assignment_group
FROM t1, t3
WHERE t1.assignment_group = t3.sys_id AND
@@ -2414,11 +2417,10 @@ WHERE t2.ugroup = t3_i.sys_id AND
t3_i.type LIKE '59e22fb137032000158bbfc8bcbe5d52' AND
t2.user = '86826bf03710200044e0bfc8bcbe5d79');
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <subquery3> ALL distinct_key NULL NULL NULL 2
-1 PRIMARY t1 ref idx1,idx2 idx1 35 test.t2.ugroup 2 Using where
+1 PRIMARY t2 ref idx3,idx4 idx4 35 const 2 Using index condition; Using where; Start temporary
+1 PRIMARY t3_i eq_ref PRIMARY PRIMARY 32 test.t2.ugroup 1 Using index condition; Using where
+1 PRIMARY t1 ref idx1,idx2 idx1 35 test.t3_i.sys_id 2 Using index condition; Using where; End temporary
1 PRIMARY t3 eq_ref PRIMARY PRIMARY 32 test.t1.assignment_group 1 Using where; Using index
-3 MATERIALIZED t2 ref idx3,idx4 idx4 35 const 2 Using index condition; Using where
-3 MATERIALIZED t3_i eq_ref PRIMARY PRIMARY 32 test.t2.ugroup 1 Using index condition; Using where
SELECT t1.assignment_group
FROM t1, t3
WHERE t1.assignment_group = t3.sys_id AND
@@ -2450,8 +2452,7 @@ explain
SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 9
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
+1 PRIMARY t2 hash_ALL NULL #hash#$hj 8 test.t1.id,test.t1.id 3 Using where; FirstMatch(t1); Using join buffer (flat, BNLH join)
SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2);
1
1
@@ -2463,8 +2464,7 @@ explain
SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index id id 4 NULL 9 Using index
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2);
1
1
@@ -2513,20 +2513,17 @@ drop procedure prepare_data;
set @@optimizer_switch= @local_optimizer_switch;
drop table t1,t2,t3;
CREATE TABLE t1 ( id int NOT NULL, key(id));
-INSERT INTO t1 VALUES (11),(12),(13),(14),(15),(16),(17),(18),(19);
+INSERT INTO t1 select seq from seq_11_to_39;
CREATE TABLE t2 (i1 int NOT NULL, i2 int NOT NULL);
-INSERT INTO t2 VALUES (11,11),(12,12),(13,13);
+INSERT INTO t2 select seq,seq+1 from seq_11_to_50;
CREATE VIEW v1 AS SELECT t2.i1 FROM t2 where t2.i1 = t2.i2;
explain SELECT 1 FROM t1 where t1.id IN (SELECT v1.i1 from v1);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 index id id 4 NULL 9 Using index
+1 PRIMARY t1 index id id 4 NULL 29 Using index
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 40 Using where
SELECT 1 FROM t1 where t1.id IN (SELECT v1.i1 from v1);
1
-1
-1
-1
drop table t1,t2;
drop view v1;
#
@@ -2859,12 +2856,12 @@ PRIMARY KEY (pk)
INSERT INTO t1 VALUES (1,'o','ffff','ffff','ffoo'),(2,'f','ffff','ffff','ffff');
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES (1,'i','iiii','iiii','iiii'),(2,'f','ffff','ffff','ffff');
+insert into t2 select -seq,"","","","" from seq_1_to_10;
SET @@optimizer_switch='default,semijoin=on,materialization=on';
EXPLAIN SELECT pk FROM t1 WHERE (a) IN (SELECT a FROM t2 WHERE pk > 0);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 2 Using index condition; Using where
+1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 Using index condition; Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
SELECT pk FROM t1 WHERE (a) IN (SELECT a FROM t2 WHERE pk > 0);
pk
2
diff --git a/mysql-test/main/subselect_mat.test b/mysql-test/main/subselect_mat.test
index cacafb00..58548d18 100644
--- a/mysql-test/main/subselect_mat.test
+++ b/mysql-test/main/subselect_mat.test
@@ -2,7 +2,7 @@
# Hash semi-join regression tests
# (WL#1110: Subquery optimization: materialization)
#
-
+--source include/have_sequence.inc
# force the use of materialization
set @subselect_mat_test_optimizer_switch_value='materialization=on,in_to_exists=off,semijoin=off';
@@ -111,6 +111,7 @@ INSERT INTO t1 VALUES (1,'o','ffff','ffff','ffoo'),(2,'f','ffff','ffff','ffff');
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES (1,'i','iiii','iiii','iiii'),(2,'f','ffff','ffff','ffff');
+insert into t2 select -seq,"","","","" from seq_1_to_10;
SET @@optimizer_switch='default,semijoin=on,materialization=on';
EXPLAIN SELECT pk FROM t1 WHERE (a) IN (SELECT a FROM t2 WHERE pk > 0);
diff --git a/mysql-test/main/subselect_mat_cost-master.opt b/mysql-test/main/subselect_mat_cost.opt
index cb4a9db9..cb4a9db9 100644
--- a/mysql-test/main/subselect_mat_cost-master.opt
+++ b/mysql-test/main/subselect_mat_cost.opt
diff --git a/mysql-test/main/subselect_mat_cost.result b/mysql-test/main/subselect_mat_cost.result
index 66d48b54..240332f3 100644
--- a/mysql-test/main/subselect_mat_cost.result
+++ b/mysql-test/main/subselect_mat_cost.result
@@ -39,8 +39,6 @@ create index Language on CountryLanguage(Language);
create index CityName on City(Name);
alter table City change population population int(11) null default 0;
select max(id) from City into @max_city_id;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
insert into City values (@max_city_id + 1,'Kilifarevo','BGR',NULL);
SELECT COUNT(*) FROM Country;
COUNT(*)
@@ -60,47 +58,19 @@ Q1.1m:
MATERIALIZATION: there are too many rows in the outer query
to be looked up in the inner table.
EXPLAIN
-SELECT Name FROM Country
+SELECT count(*) FROM Country
WHERE (Code IN (select Country from City where City.Population > 100000) OR
Name LIKE 'L%') AND
-surfacearea > 1000000;
+surfacearea > 100000;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY Country ALL Name,SurfaceArea NULL NULL NULL 239 Using where
2 MATERIALIZED City ALL Population,Country NULL NULL NULL 4079 Using where
-SELECT Name FROM Country
+SELECT count(*) FROM Country
WHERE (Code IN (select Country from City where City.Population > 100000) OR
Name LIKE 'L%') AND
-surfacearea > 1000000;
-Name
-Algeria
-Angola
-Argentina
-Australia
-Bolivia
-Brazil
-Egypt
-South Africa
-Ethiopia
-Indonesia
-India
-Iran
-Canada
-Kazakstan
-China
-Colombia
-Congo, The Democratic Republic of the
-Libyan Arab Jamahiriya
-Mali
-Mauritania
-Mexico
-Mongolia
-Niger
-Peru
-Saudi Arabia
-Sudan
-Chad
-Russian Federation
-United States
+surfacearea > 100000;
+count(*)
+107
Q1.1e:
IN-EXISTS: the materialization cost is the same as above, but
there are much fewer outer rows to be looked up, thus the
@@ -136,10 +106,22 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY Country ALL PRIMARY,SurfaceArea NULL NULL NULL 239 Using where
1 PRIMARY City ref Country Country 3 world.Country.Code 17 Using where
2 MATERIALIZED CountryLanguage ALL Percentage,Language NULL NULL NULL 984 Using where
+EXPLAIN
SELECT *
FROM Country, City
WHERE City.Country = Country.Code AND
-Country.SurfaceArea < 3000 AND Country.SurfaceArea > 10 AND
+Country.SurfaceArea < 500 AND Country.SurfaceArea > 10 AND
+(City.Name IN
+(select Language from CountryLanguage where Percentage > 50) OR
+City.name LIKE '%Island%');
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY Country range PRIMARY,SurfaceArea SurfaceArea 4 NULL 32 Using index condition; Rowid-ordered scan
+1 PRIMARY City ref Country Country 3 world.Country.Code 17 Using where
+2 MATERIALIZED CountryLanguage ALL Percentage,Language NULL NULL NULL 984 Using where
+SELECT *
+FROM Country, City
+WHERE City.Country = Country.Code AND
+Country.SurfaceArea < 500 AND Country.SurfaceArea > 10 AND
(City.Name IN
(select Language from CountryLanguage where Percentage > 50) OR
City.name LIKE '%Island%');
@@ -515,9 +497,30 @@ FROM City JOIN Country ON City.Country = Country.Code
GROUP BY City.Name
HAVING City.Name IN (select Name from Country where population < 1000000);
id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY City ALL Country NULL NULL NULL 4079 Using temporary; Using filesort
+1 PRIMARY Country eq_ref PRIMARY PRIMARY 3 world.City.Country 1 Using index
+2 MATERIALIZED Country ALL Name NULL NULL NULL 239 Using where
+Last_query_cost 5.934845
+EXPLAIN
+SELECT straight_join City.Name, City.Population
+FROM Country JOIN City ON City.Country = Country.Code
+GROUP BY City.Name
+HAVING City.Name IN (select Name from Country where population < 1000000);
+id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY Country index PRIMARY PRIMARY 3 NULL 239 Using index; Using temporary; Using filesort
1 PRIMARY City ref Country Country 3 world.Country.Code 17
2 MATERIALIZED Country ALL Name NULL NULL NULL 239 Using where
+Last_query_cost 7.972882
+EXPLAIN
+SELECT City.Name, City.Population
+FROM Country LEFT JOIN City ON City.Country = Country.Code
+GROUP BY City.Name
+HAVING City.Name IN (select Name from Country where population < 1000000);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY Country index NULL PRIMARY 3 NULL 239 Using index; Using temporary; Using filesort
+1 PRIMARY City ref Country Country 3 world.Country.Code 17
+2 MATERIALIZED Country ALL Name NULL NULL NULL 239 Using where
+Last_query_cost 7.972882
SELECT City.Name, City.Population
FROM City JOIN Country ON City.Country = Country.Code
GROUP BY City.Name
diff --git a/mysql-test/main/subselect_mat_cost.test b/mysql-test/main/subselect_mat_cost.test
index 8fe38849..60763076 100644
--- a/mysql-test/main/subselect_mat_cost.test
+++ b/mysql-test/main/subselect_mat_cost.test
@@ -74,15 +74,15 @@ set @@optimizer_switch = 'in_to_exists=on,semijoin=on,materialization=on,partial
-- echo MATERIALIZATION: there are too many rows in the outer query
-- echo to be looked up in the inner table.
EXPLAIN
-SELECT Name FROM Country
+SELECT count(*) FROM Country
WHERE (Code IN (select Country from City where City.Population > 100000) OR
Name LIKE 'L%') AND
- surfacearea > 1000000;
+ surfacearea > 100000;
-SELECT Name FROM Country
+SELECT count(*) FROM Country
WHERE (Code IN (select Country from City where City.Population > 100000) OR
Name LIKE 'L%') AND
- surfacearea > 1000000;
+ surfacearea > 100000;
-- echo Q1.1e:
-- echo IN-EXISTS: the materialization cost is the same as above, but
@@ -113,10 +113,19 @@ SELECT *
(select Language from CountryLanguage where Percentage > 50) OR
City.name LIKE '%Island%');
+EXPLAIN
SELECT *
FROM Country, City
WHERE City.Country = Country.Code AND
- Country.SurfaceArea < 3000 AND Country.SurfaceArea > 10 AND
+ Country.SurfaceArea < 500 AND Country.SurfaceArea > 10 AND
+ (City.Name IN
+ (select Language from CountryLanguage where Percentage > 50) OR
+ City.name LIKE '%Island%');
+
+SELECT *
+ FROM Country, City
+ WHERE City.Country = Country.Code AND
+ Country.SurfaceArea < 500 AND Country.SurfaceArea > 10 AND
(City.Name IN
(select Language from CountryLanguage where Percentage > 50) OR
City.name LIKE '%Island%');
@@ -210,7 +219,6 @@ WHERE Code NOT IN (SELECT Country FROM CountryLanguage WHERE Language = 'English
-- echo MATERIALIZATION because the outer query filters less rows than Q5-a,
-- echo so there are more lookups.
-
set statement optimizer_switch='rowid_filter=off' for
EXPLAIN
SELECT Country.Name
@@ -369,17 +377,32 @@ drop index CountryCapital on Country;
# TODO: the cost estimates for subqueries in the HAVING clause need to be changed
# to take into account that the subquery predicate is executed #times ~ to the
# number of groups, not number of rows
+
EXPLAIN
SELECT City.Name, City.Population
FROM City JOIN Country ON City.Country = Country.Code
GROUP BY City.Name
HAVING City.Name IN (select Name from Country where population < 1000000);
+--source include/last_query_cost.inc
+
+EXPLAIN
+SELECT straight_join City.Name, City.Population
+FROM Country JOIN City ON City.Country = Country.Code
+GROUP BY City.Name
+HAVING City.Name IN (select Name from Country where population < 1000000);
+--source include/last_query_cost.inc
+EXPLAIN
SELECT City.Name, City.Population
-FROM City JOIN Country ON City.Country = Country.Code
+FROM Country LEFT JOIN City ON City.Country = Country.Code
GROUP BY City.Name
HAVING City.Name IN (select Name from Country where population < 1000000);
+--source include/last_query_cost.inc
+SELECT City.Name, City.Population
+FROM City JOIN Country ON City.Country = Country.Code
+GROUP BY City.Name
+HAVING City.Name IN (select Name from Country where population < 1000000);
-- echo
-- echo 5. Subqueries with UNION
diff --git a/mysql-test/main/subselect_mat_cost_bugs.result b/mysql-test/main/subselect_mat_cost_bugs.result
index d8ee3f9e..5df4cf8a 100644
--- a/mysql-test/main/subselect_mat_cost_bugs.result
+++ b/mysql-test/main/subselect_mat_cost_bugs.result
@@ -95,9 +95,9 @@ t1a ON (t1a.c2 = t1b.pk AND 2)
WHERE t1.pk) ;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 9 100.00 Using where
-2 DEPENDENT SUBQUERY t1b ALL NULL NULL NULL NULL 9 100.00
+2 DEPENDENT SUBQUERY t1b ALL NULL NULL NULL NULL 9 100.00 Using where
2 DEPENDENT SUBQUERY t1a ref c2 c2 5 test.t1b.pk 1 100.00 Using where
-2 DEPENDENT SUBQUERY t2 index c3 c3 9 NULL 2 100.00 Using where; Using index; Using join buffer (flat, BNL join)
+2 DEPENDENT SUBQUERY t2 ref c3 c3 4 test.t1b.c4 1 100.00 Using index
Warnings:
Note 1276 Field or reference 'test.t1.pk' of SELECT #2 was resolved in SELECT #1
Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk` from `test`.`t1` where <expr_cache><`test`.`t1`.`c1`,`test`.`t1`.`pk`>(<in_optimizer>(`test`.`t1`.`c1`,<exists>(/* select#2 */ select `test`.`t1a`.`c1` from `test`.`t1b` join `test`.`t2` left join `test`.`t1a` on(`test`.`t1a`.`c2` = `test`.`t1b`.`pk` and 2) where `test`.`t2`.`c3` = `test`.`t1b`.`c4` and `test`.`t1`.`pk` <> 0 and <cache>(`test`.`t1`.`c1`) = `test`.`t1a`.`c1`)))
@@ -196,8 +196,8 @@ ORDER BY field1 ;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 Using where; Using filesort
1 PRIMARY alias1 eq_ref PRIMARY PRIMARY 4 alias2.f3 1 Using index
-3 DEPENDENT SUBQUERY t1 range PRIMARY PRIMARY 4 NULL 2 Using where; Using index
-3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join)
+3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2
+3 DEPENDENT SUBQUERY t1 range PRIMARY PRIMARY 4 NULL 2 Using where; Using index; Using join buffer (flat, BNL join)
2 DERIVED t2 ALL NULL NULL NULL NULL 2
SELECT alias2.f2 AS field1
FROM t1 AS alias1 JOIN ( SELECT * FROM t2 ) AS alias2 ON alias2.f3 = alias1.f1
@@ -263,8 +263,8 @@ WHERE alias1.f11 OR alias1.f3 = 50 AND alias1.f10
);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
-2 MATERIALIZED alias1 ALL NULL NULL NULL NULL 2 Using where
-2 MATERIALIZED alias2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+2 DEPENDENT SUBQUERY alias1 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY alias2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
SELECT * FROM t2
WHERE ( f12 ) IN (
SELECT alias2.f3
@@ -275,6 +275,8 @@ f12 f13
Warnings:
Warning 1292 Truncated incorrect DECIMAL value: 'f'
Warning 1292 Truncated incorrect DECIMAL value: 'd'
+Warning 1292 Truncated incorrect DECIMAL value: 'f'
+Warning 1292 Truncated incorrect DECIMAL value: 'd'
EXPLAIN
SELECT * FROM t2
WHERE ( f12 ) IN (
@@ -283,8 +285,8 @@ FROM t1 AS alias1, t1 AS alias2
WHERE (alias2.f10 = alias1.f11) AND (alias1.f11 OR alias1.f3 = 50 AND alias1.f10));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
-2 MATERIALIZED alias1 ALL NULL NULL NULL NULL 2 Using where
-2 MATERIALIZED alias2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
+2 DEPENDENT SUBQUERY alias1 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY alias2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
SELECT * FROM t2
WHERE ( f12 ) IN (
SELECT alias2.f3
@@ -294,6 +296,8 @@ f12 f13
Warnings:
Warning 1292 Truncated incorrect DECIMAL value: 'f'
Warning 1292 Truncated incorrect DECIMAL value: 'd'
+Warning 1292 Truncated incorrect DECIMAL value: 'f'
+Warning 1292 Truncated incorrect DECIMAL value: 'd'
set @@optimizer_switch=@save_optimizer_switch;
drop table t1, t2;
#
@@ -316,7 +320,7 @@ explain
select c1 from t1 where c1 in (select kp1 from t2 where kp2 = 10 and c2 = 4) or c1 > 7;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where
-2 DEPENDENT SUBQUERY t2 ref key1,key2,key3 key3 5 const 1 Using where
+2 DEPENDENT SUBQUERY t2 index_subquery key1,key2,key3 key1 10 func,const 1 Using where
select c1 from t1 where c1 in (select kp1 from t2 where kp2 = 10 and c2 = 4) or c1 > 7;
c1
set @@optimizer_switch='default';
diff --git a/mysql-test/main/subselect_no_exists_to_in.result b/mysql-test/main/subselect_no_exists_to_in.result
index 0fdd573b..d3f5e6d6 100644
--- a/mysql-test/main/subselect_no_exists_to_in.result
+++ b/mysql-test/main/subselect_no_exists_to_in.result
@@ -664,7 +664,18 @@ a b
22 11
2 12
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t12 where t11.a = t12.a);
-ERROR HY000: Table 't12' is specified twice, both as a target for 'DELETE' and as a separate source for data
+select * from t11;
+a b
+0 10
+1 11
+select * from t12;
+a b
+33 10
+22 11
+delete from t11;
+delete from t12;
+insert into t11 values (0, 10),(1, 11),(2, 12);
+insert into t12 values (33, 10),(22, 11),(2, 12);
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2);
ERROR 21000: Subquery returns more than 1 row
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2 where t11.a = t2.a);
@@ -958,6 +969,9 @@ select (select a+1) from t1;
NULL
4.5
drop table t1;
+#
+# Null with keys
+#
CREATE TABLE t1 (a int(11) NOT NULL default '0', PRIMARY KEY (a));
CREATE TABLE t2 (a int(11) default '0', INDEX (a));
INSERT INTO t1 VALUES (1),(2),(3),(4);
@@ -1489,6 +1503,9 @@ drop table if exists t1;
(SELECT 1 as a) UNION (SELECT 1) ORDER BY (SELECT a+0);
a
1
+#
+# IN subselect optimization test
+#
create table t1 (a int not null, b int, primary key (a));
create table t2 (a int not null, primary key (a));
create table t3 (a int not null, b int, primary key (a));
@@ -1512,21 +1529,21 @@ a
4
explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index
-1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1 100.00 Using where
+1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where
+1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index
Warnings:
-Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30
+Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t1`.`b` <> 30
select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
a
2
3
explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index
-1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1 100.00
-1 PRIMARY t3 index PRIMARY PRIMARY 4 NULL 3 100.00 Using where; Using index; Using join buffer (flat, BNL join)
+1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where
+1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index
+1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index
Warnings:
-Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t1`.`a` = `test`.`t2`.`a`
+Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t2`.`a` = `test`.`t1`.`a`
drop table t1, t2, t3;
create table t1 (a int, b int, index a (a,b));
create table t2 (a int, index a (a));
@@ -1535,42 +1552,48 @@ insert into t1 values (1,10), (2,20), (3,30), (4,40);
create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
insert into t1
-select rand()*100000+200,rand()*100000 from t0 A, t0 B, t0 C, t0 D;
+select rand()*100000+200,rand(1)*100000 from t0 A, t0 B, t0 C, t0 D;
insert into t2 values (2), (3), (4), (5);
insert into t3 values (10,3), (20,4), (30,5);
-select * from t2 where t2.a in (select a from t1);
-a
-2
-3
-4
explain extended select * from t2 where t2.a in (select a from t1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index
-1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using index; FirstMatch(t2)
+1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using index; FirstMatch(t2)
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a`
-select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
+select * from t2 where t2.a in (select a from t1);
a
2
+3
4
explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index
-1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using where; Using index; FirstMatch(t2)
+1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using where; Using index; FirstMatch(t2)
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30
-select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
+select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
a
2
-3
+4
explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index
1 PRIMARY t3 range a a 5 NULL 3 100.00 Using where; Using index
-1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 100.00 Using index; FirstMatch(t2)
+1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 0.29 Using index; FirstMatch(t2)
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where `test`.`t1`.`b` = `test`.`t3`.`a` and `test`.`t1`.`a` = `test`.`t2`.`a`
+select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
+a
+2
+3
insert into t1 values (3,31);
+explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index
+1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using where; Using index; FirstMatch(t2)
+Warnings:
+Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30
select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
a
2
@@ -1580,12 +1603,6 @@ select * from t2 where t2.a in (select a from t1 where t1.b <> 30 and t1.b <> 31
a
2
4
-explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index
-1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using where; Using index; FirstMatch(t2)
-Warnings:
-Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30
drop table t0, t1, t2, t3;
create table t1 (a int, b int);
create table t2 (a int, b int);
@@ -1647,6 +1664,9 @@ Note 1003 (select 'tttt' AS `s1` from dual)
s1
tttt
drop table t1;
+#
+# IN optimisation test results
+#
create table t1 (s1 char(5), index s1(s1));
create table t2 (s1 char(5), index s1(s1));
insert into t1 values ('a1'),('a2'),('a3');
@@ -2480,19 +2500,22 @@ a
1
3
DROP TABLE t1;
+#
+# SELECT(EXISTS * ...)optimisation
+#
create table t1 (a int, b int);
-insert into t1 values (1,2),(3,4);
-select * from t1 up where exists (select * from t1 where t1.a=up.a);
-a b
-1 2
-3 4
-explain extended select * from t1 up where exists (select * from t1 where t1.a=up.a);
+insert into t1 values (1,2),(3,4),(5,6),(7,8);
+insert into t1 select seq,seq from seq_20_to_40;
+select sum(a+b) from t1 up where exists (select * from t1 where t1.a=up.a);
+sum(a+b)
+1296
+explain extended select sum(a+b) from t1 up where exists (select * from t1 where t1.a=up.a);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY up ALL NULL NULL NULL NULL 2 100.00 Using where
-2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+1 PRIMARY up ALL NULL NULL NULL NULL 25 100.00 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 25 100.00 Using where
Warnings:
Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1
-Note 1003 /* select#1 */ select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` where <expr_cache><`test`.`up`.`a`>(exists(/* select#2 */ select 1 from `test`.`t1` where `test`.`t1`.`a` = `test`.`up`.`a` limit 1))
+Note 1003 /* select#1 */ select sum(`test`.`up`.`a` + `test`.`up`.`b`) AS `sum(a+b)` from `test`.`t1` `up` where <expr_cache><`test`.`up`.`a`>(exists(/* select#2 */ select 1 from `test`.`t1` where `test`.`t1`.`a` = `test`.`up`.`a` limit 1))
drop table t1;
CREATE TABLE t1 (t1_a int);
INSERT INTO t1 VALUES (1);
@@ -3160,9 +3183,13 @@ retailerID statusID changed
0048 1 2006-01-06 12:37:50
0059 1 2006-01-06 12:37:50
drop table t1;
+#
+# Bug#21180 Subselect with index for both WHERE and ORDER BY
+# produces empty result
+#
create table t1(a int, primary key (a));
insert into t1 values (10);
-create table t2 (a int primary key, b varchar(32), c int, unique key b(c, b));
+create table t2 (a int primary key, b varchar(32), c int, unique key cb(c, b));
insert into t2(a, c, b) values (1,10,'359'), (2,10,'35988'), (3,10,'35989');
insert into t2(a, c, b) values (4,10,'360'), (5,10,'35998'), (6,10,'35999');
analyze table t1;
@@ -3175,7 +3202,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system PRIMARY NULL NULL NULL 1
1 PRIMARY r const PRIMARY PRIMARY 4 const 1
-2 SUBQUERY t2 range b b 40 NULL 3 Using where
+2 SUBQUERY t2 range cb cb 40 NULL 3 Using where
SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r
ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10;
@@ -3187,7 +3214,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system PRIMARY NULL NULL NULL 1
1 PRIMARY r const PRIMARY PRIMARY 4 const 1
-2 SUBQUERY t2 range b b 40 NULL 3 Using index condition
+2 SUBQUERY t2 range cb cb 40 NULL 3 Using index condition
SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r
ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10;
@@ -4282,8 +4309,8 @@ INSERT INTO t2 VALUES (7), (5), (1), (3);
SELECT id, st FROM t1
WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id);
id st
-3 FL
1 GA
+3 FL
7 FL
SELECT id, st FROM t1
WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id)
@@ -4384,6 +4411,9 @@ SELECT ((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL FROM t1;
0
0
DROP TABLE t1, t2;
+#
+# Bug#28076 inconsistent binary/varbinary comparison
+#
CREATE TABLE t1 (s1 BINARY(5), s2 VARBINARY(5));
INSERT INTO t1 VALUES (0x41,0x41), (0x42,0x42), (0x43,0x43);
SELECT s1, s2 FROM t1 WHERE s2 IN (SELECT s1 FROM t1);
@@ -4445,8 +4475,8 @@ CREATE INDEX I1 ON t1 (a);
CREATE INDEX I2 ON t1 (b);
EXPLAIN SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL I2 NULL NULL NULL 2 Using where
-1 PRIMARY t1 ref I1 I1 2 test.t1.b 2 Using where; Using index; FirstMatch(t1)
+1 PRIMARY t1 index I1 I1 2 NULL 2 Using where; Using index; LooseScan
+1 PRIMARY t1 ref I2 I2 13 test.t1.a 1 Using index condition
SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1);
a b
CREATE TABLE t2 (a VARCHAR(1), b VARCHAR(10));
@@ -4455,15 +4485,15 @@ CREATE INDEX I1 ON t2 (a);
CREATE INDEX I2 ON t2 (b);
EXPLAIN SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 ALL I2 NULL NULL NULL 2 Using where
-1 PRIMARY t2 ref I1 I1 4 test.t2.b 2 Using where; Using index; FirstMatch(t2)
+1 PRIMARY t2 index I1 I1 4 NULL 2 Using where; Using index; LooseScan
+1 PRIMARY t2 ref I2 I2 13 test.t2.a 1 Using index condition
SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2);
a b
EXPLAIN
SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL I2 NULL NULL NULL 2 Using where
-1 PRIMARY t1 ref I1 I1 2 test.t1.b 2 Using where; Using index; FirstMatch(t1)
+1 PRIMARY t1 index I1 I1 2 NULL 2 Using where; Using index; LooseScan
+1 PRIMARY t1 ref I2 I2 13 test.t1.a 1 Using index condition
SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500);
a b
DROP TABLE t1,t2;
@@ -4493,10 +4523,13 @@ out_a MIN(b)
1 2
2 4
DROP TABLE t1;
+#
+# Bug#32036 EXISTS within a WHERE clause with a UNION crashes MySQL 5.122
+#
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
-INSERT INTO t1 VALUES (1),(2);
-INSERT INTO t2 VALUES (1),(2);
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+INSERT INTO t2 VALUES (1),(2),(1000);
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
2
2
@@ -4504,8 +4537,8 @@ SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
EXPLAIN EXTENDED
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
-2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
Note 1003 /* select#1 */ select 2 AS `2` from `test`.`t1` where <expr_cache><`test`.`t1`.`a`>(exists(/* select#2 */ select 1 from `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` limit 1))
@@ -4513,9 +4546,9 @@ EXPLAIN EXTENDED
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION
(SELECT 1 FROM t2 WHERE t1.a = t2.a));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
-2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
-3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where
+3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 3 100.00 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
@@ -5754,7 +5787,8 @@ DROP TABLE IF EXISTS ot1, ot4, it2, it3;
CREATE TABLE t1 (a int) ;
INSERT INTO t1 VALUES (NULL), (1), (NULL), (2);
CREATE TABLE t2 (a int, INDEX idx(a)) ;
-INSERT INTO t2 VALUES (NULL), (1), (NULL);
+INSERT INTO t2 VALUES (NULL), (1), (NULL),(1000);
+insert into t2 select seq from seq_3_to_500;
SELECT * FROM t1
WHERE EXISTS (SELECT a FROM t2 USE INDEX () WHERE t2.a = t1.a);
a
@@ -5764,7 +5798,7 @@ SELECT * FROM t1
WHERE EXISTS (SELECT a FROM t2 USE INDEX() WHERE t2.a = t1.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
-2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 502 Using where
SELECT * FROM t1
WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a);
a
@@ -5774,7 +5808,7 @@ SELECT * FROM t1
WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
-2 DEPENDENT SUBQUERY t2 ref idx idx 5 test.t1.a 2 Using index
+2 DEPENDENT SUBQUERY t2 ref idx idx 5 test.t1.a 58 Using index
DROP TABLE t1,t2;
#
# BUG#752992: Wrong results for a subquery with 'semijoin=on'
@@ -5791,9 +5825,9 @@ SET @save_join_cache_level=@@join_cache_level;
SET join_cache_level=0;
EXPLAIN SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 3
-1 PRIMARY it eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 Using index
-1 PRIMARY t2 index NULL PRIMARY 4 NULL 3 Using index; FirstMatch(it)
+1 PRIMARY it index PRIMARY PRIMARY 4 NULL 3 Using index
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.it.pk 1
+1 PRIMARY t2 index NULL PRIMARY 4 NULL 3 Using index; FirstMatch(t1)
SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1);
pk i
11 0
@@ -6134,8 +6168,7 @@ WHERE col_varchar_nokey IN
(SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY ot system NULL NULL NULL NULL 1
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED it1 ref idx_cvk_cik idx_cvk_cik 9 const,const 1 Using where; Using index
+1 PRIMARY it1 ref idx_cvk_cik idx_cvk_cik 9 const,const 1 Using where; Using index; FirstMatch(ot)
SELECT col_int_nokey FROM ot
WHERE col_varchar_nokey IN
(SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL);
@@ -6147,8 +6180,7 @@ WHERE (col_varchar_nokey, 'x') IN
(SELECT col_varchar_key, col_varchar_key2 FROM it2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY ot system NULL NULL NULL NULL 1
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1
-2 MATERIALIZED it2 ref idx_cvk_cvk2_cik,idx_cvk_cik idx_cvk_cvk2_cik 8 const,const 1 Using where; Using index
+1 PRIMARY it2 ref idx_cvk_cvk2_cik,idx_cvk_cik idx_cvk_cvk2_cik 8 const,const 1 Using where; Using index; FirstMatch(ot)
SELECT col_int_nokey FROM ot
WHERE (col_varchar_nokey, 'x') IN
(SELECT col_varchar_key, col_varchar_key2 FROM it2);
@@ -6718,7 +6750,7 @@ SET @@optimizer_switch='semijoin=off,materialization=off,in_to_exists=on,subquer
EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL a 4 NULL 2 Using where; Using index
-2 DEPENDENT SUBQUERY t1 index_subquery a a 4 func 2 Using index
+2 DEPENDENT SUBQUERY t1 index_subquery a a 4 func 1 Using index
SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1);
a
2009-01-01
@@ -6923,7 +6955,7 @@ FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias1 index a a 19 NULL 11 Using where; Using index
-1 PRIMARY alias2 ref a a 19 test.alias1.a 2 Using index
+1 PRIMARY alias2 ref a a 19 test.alias1.a 1 Using index
1 PRIMARY alias3 index NULL a 19 NULL 11 Using index; Using join buffer (flat, BNL join)
2 SUBQUERY t1 index_subquery a a 19 const 1 Using index; Using where
SELECT MAX( alias2.a )
@@ -7082,7 +7114,7 @@ WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where
-1 PRIMARY t3 ref d d 5 test.t2.b 2 Using index
+1 PRIMARY t3 ref d d 5 test.t2.b 1 Using index
3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
set @tmp_mdev410=@@global.userstat;
set global userstat=on;
@@ -7114,7 +7146,7 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP B
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
-2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
+2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index
DROP TABLE t1,t2;
#
# MDEV-435: Expensive subqueries may be evaluated during optimization in merge_key_fields
@@ -7148,7 +7180,7 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP B
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
-2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
+2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index
DROP TABLE t1,t2;
#
# MDEV-5991: crash in Item_field::used_tables
@@ -7561,6 +7593,48 @@ drop table t1, t2, t3;
#
# End of 10.6 tests
#
+#
+# MDEV-32656: ASAN errors in base_list_iterator::next /
+# setup_table_map upon 2nd execution of PS
+# (10.10 part)
+#
+CREATE TABLE t1 (id BIGINT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE TABLE t2 (a INT);
+INSERT INTO t2 VALUES (2),(3);
+CREATE TABLE t3 (b INT);
+INSERT INTO t3 VALUES (3),(4);
+PREPARE stmt FROM "UPDATE t2 SET a = 1 WHERE (select 1 where ('e','e') IN (SELECT v1.id, v1.id FROM v1 JOIN t3)) <> 0";
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+PREPARE stmt FROM "UPDATE t2 SET a = 1 WHERE ('e') IN (SELECT v1.id FROM v1 JOIN t3)";
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+PREPARE stmt FROM "UPDATE t2 SET a = 1 WHERE ('e','e') IN (SELECT v1.id, v1.id FROM v1 JOIN t3)";
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+DROP VIEW v1;
+DROP TABLE t1, t2, t3;
+#
+# End of 10.10 tests
+#
set optimizer_switch=default;
select @@optimizer_switch like '%exists_to_in=off%';
@@optimizer_switch like '%exists_to_in=off%'
diff --git a/mysql-test/main/subselect_no_mat.result b/mysql-test/main/subselect_no_mat.result
index 5183d50c..25924f3d 100644
--- a/mysql-test/main/subselect_no_mat.result
+++ b/mysql-test/main/subselect_no_mat.result
@@ -372,7 +372,7 @@ patient_uq clinic_uq
explain extended select * from t6 where exists (select * from t7 where uq = clinic_uq);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t7 index PRIMARY PRIMARY 4 NULL 2 100.00 Using index
-1 PRIMARY t6 ALL i1 NULL NULL NULL 4 100.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t6 ref i1 i1 5 test.t7.uq 1 100.00
Warnings:
Note 1276 Field or reference 'test.t6.clinic_uq' of SELECT #2 was resolved in SELECT #1
Note 1003 select `test`.`t6`.`patient_uq` AS `patient_uq`,`test`.`t6`.`clinic_uq` AS `clinic_uq` from `test`.`t7` join `test`.`t6` where `test`.`t6`.`clinic_uq` = `test`.`t7`.`uq`
@@ -667,7 +667,18 @@ a b
22 11
2 12
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t12 where t11.a = t12.a);
-ERROR HY000: Table 't12' is specified twice, both as a target for 'DELETE' and as a separate source for data
+select * from t11;
+a b
+0 10
+1 11
+select * from t12;
+a b
+33 10
+22 11
+delete from t11;
+delete from t12;
+insert into t11 values (0, 10),(1, 11),(2, 12);
+insert into t12 values (33, 10),(22, 11),(2, 12);
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2);
ERROR 21000: Subquery returns more than 1 row
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2 where t11.a = t2.a);
@@ -961,6 +972,9 @@ select (select a+1) from t1;
NULL
4.5
drop table t1;
+#
+# Null with keys
+#
CREATE TABLE t1 (a int(11) NOT NULL default '0', PRIMARY KEY (a));
CREATE TABLE t2 (a int(11) default '0', INDEX (a));
INSERT INTO t1 VALUES (1),(2),(3),(4);
@@ -1492,6 +1506,9 @@ drop table if exists t1;
(SELECT 1 as a) UNION (SELECT 1) ORDER BY (SELECT a+0);
a
1
+#
+# IN subselect optimization test
+#
create table t1 (a int not null, b int, primary key (a));
create table t2 (a int not null, primary key (a));
create table t3 (a int not null, b int, primary key (a));
@@ -1515,21 +1532,21 @@ a
4
explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index
-1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1 100.00 Using where
+1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where
+1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index
Warnings:
-Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30
+Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t1`.`b` <> 30
select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
a
2
3
explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index
-1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1 100.00
-1 PRIMARY t3 index PRIMARY PRIMARY 4 NULL 3 100.00 Using where; Using index; Using join buffer (flat, BNL join)
+1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where
+1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index
+1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index
Warnings:
-Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t1`.`a` = `test`.`t2`.`a`
+Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t2`.`a` = `test`.`t1`.`a`
drop table t1, t2, t3;
create table t1 (a int, b int, index a (a,b));
create table t2 (a int, index a (a));
@@ -1538,42 +1555,48 @@ insert into t1 values (1,10), (2,20), (3,30), (4,40);
create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
insert into t1
-select rand()*100000+200,rand()*100000 from t0 A, t0 B, t0 C, t0 D;
+select rand()*100000+200,rand(1)*100000 from t0 A, t0 B, t0 C, t0 D;
insert into t2 values (2), (3), (4), (5);
insert into t3 values (10,3), (20,4), (30,5);
-select * from t2 where t2.a in (select a from t1);
-a
-2
-3
-4
explain extended select * from t2 where t2.a in (select a from t1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index
-1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using index; FirstMatch(t2)
+1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using index; FirstMatch(t2)
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a`
-select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
+select * from t2 where t2.a in (select a from t1);
a
2
+3
4
explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index
-1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using where; Using index; FirstMatch(t2)
+1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using where; Using index; FirstMatch(t2)
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30
-select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
+select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
a
2
-3
+4
explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index
1 PRIMARY t3 range a a 5 NULL 3 100.00 Using where; Using index
-1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 100.00 Using index; FirstMatch(t2)
+1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 0.29 Using index; FirstMatch(t2)
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where `test`.`t1`.`b` = `test`.`t3`.`a` and `test`.`t1`.`a` = `test`.`t2`.`a`
+select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
+a
+2
+3
insert into t1 values (3,31);
+explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index
+1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using where; Using index; FirstMatch(t2)
+Warnings:
+Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30
select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
a
2
@@ -1583,12 +1606,6 @@ select * from t2 where t2.a in (select a from t1 where t1.b <> 30 and t1.b <> 31
a
2
4
-explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index
-1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using where; Using index; FirstMatch(t2)
-Warnings:
-Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30
drop table t0, t1, t2, t3;
create table t1 (a int, b int);
create table t2 (a int, b int);
@@ -1650,6 +1667,9 @@ Note 1003 (select 'tttt' AS `s1` from dual)
s1
tttt
drop table t1;
+#
+# IN optimisation test results
+#
create table t1 (s1 char(5), index s1(s1));
create table t2 (s1 char(5), index s1(s1));
insert into t1 values ('a1'),('a2'),('a3');
@@ -2483,19 +2503,22 @@ a
1
3
DROP TABLE t1;
+#
+# SELECT(EXISTS * ...)optimisation
+#
create table t1 (a int, b int);
-insert into t1 values (1,2),(3,4);
-select * from t1 up where exists (select * from t1 where t1.a=up.a);
-a b
-1 2
-3 4
-explain extended select * from t1 up where exists (select * from t1 where t1.a=up.a);
+insert into t1 values (1,2),(3,4),(5,6),(7,8);
+insert into t1 select seq,seq from seq_20_to_40;
+select sum(a+b) from t1 up where exists (select * from t1 where t1.a=up.a);
+sum(a+b)
+1296
+explain extended select sum(a+b) from t1 up where exists (select * from t1 where t1.a=up.a);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY up ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch(up); Using join buffer (flat, BNL join)
+1 PRIMARY up ALL NULL NULL NULL NULL 25 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 25 4.00 Using where; FirstMatch(up); Using join buffer (flat, BNL join)
Warnings:
Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1
-Note 1003 select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`up`.`a`
+Note 1003 select sum(`test`.`up`.`a` + `test`.`up`.`b`) AS `sum(a+b)` from `test`.`t1` `up` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`up`.`a`
drop table t1;
CREATE TABLE t1 (t1_a int);
INSERT INTO t1 VALUES (1);
@@ -3046,7 +3069,7 @@ Note 1003 /* select#1 */ select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS
explain extended SELECT one,two from t1 where ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = 'N');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 8 100.00
-1 PRIMARY t2 ALL NULL NULL NULL NULL 9 100.00 Using where; FirstMatch(t1)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 9 11.11 Using where; Start temporary; End temporary
Warnings:
Note 1003 select `test`.`t1`.`one` AS `one`,`test`.`t1`.`two` AS `two` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`flag` = 'N' and `test`.`t2`.`one` = `test`.`t1`.`one` and `test`.`t2`.`two` = `test`.`t1`.`two`
explain extended SELECT one,two,ROW(one,two) IN (SELECT one,two FROM t2 WHERE flag = '0' group by one,two) as 'test' from t1;
@@ -3162,9 +3185,13 @@ retailerID statusID changed
0048 1 2006-01-06 12:37:50
0059 1 2006-01-06 12:37:50
drop table t1;
+#
+# Bug#21180 Subselect with index for both WHERE and ORDER BY
+# produces empty result
+#
create table t1(a int, primary key (a));
insert into t1 values (10);
-create table t2 (a int primary key, b varchar(32), c int, unique key b(c, b));
+create table t2 (a int primary key, b varchar(32), c int, unique key cb(c, b));
insert into t2(a, c, b) values (1,10,'359'), (2,10,'35988'), (3,10,'35989');
insert into t2(a, c, b) values (4,10,'360'), (5,10,'35998'), (6,10,'35999');
analyze table t1;
@@ -3177,7 +3204,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system PRIMARY NULL NULL NULL 1
1 PRIMARY r const PRIMARY PRIMARY 4 const 1
-2 SUBQUERY t2 range b b 40 NULL 3 Using where
+2 SUBQUERY t2 range cb cb 40 NULL 3 Using where
SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r
ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10;
@@ -3189,7 +3216,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system PRIMARY NULL NULL NULL 1
1 PRIMARY r const PRIMARY PRIMARY 4 const 1
-2 SUBQUERY t2 range b b 40 NULL 3 Using index condition
+2 SUBQUERY t2 range cb cb 40 NULL 3 Using index condition
SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r
ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10;
@@ -4282,8 +4309,8 @@ INSERT INTO t2 VALUES (7), (5), (1), (3);
SELECT id, st FROM t1
WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id);
id st
-3 FL
1 GA
+3 FL
7 FL
SELECT id, st FROM t1
WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id)
@@ -4384,6 +4411,9 @@ SELECT ((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL FROM t1;
0
0
DROP TABLE t1, t2;
+#
+# Bug#28076 inconsistent binary/varbinary comparison
+#
CREATE TABLE t1 (s1 BINARY(5), s2 VARBINARY(5));
INSERT INTO t1 VALUES (0x41,0x41), (0x42,0x42), (0x43,0x43);
SELECT s1, s2 FROM t1 WHERE s2 IN (SELECT s1 FROM t1);
@@ -4445,8 +4475,8 @@ CREATE INDEX I1 ON t1 (a);
CREATE INDEX I2 ON t1 (b);
EXPLAIN SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL I2 NULL NULL NULL 2 Using where
-1 PRIMARY t1 ref I1 I1 2 test.t1.b 2 Using where; Using index; FirstMatch(t1)
+1 PRIMARY t1 index I1 I1 2 NULL 2 Using where; Using index; LooseScan
+1 PRIMARY t1 ref I2 I2 13 test.t1.a 1 Using index condition
SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1);
a b
CREATE TABLE t2 (a VARCHAR(1), b VARCHAR(10));
@@ -4455,15 +4485,15 @@ CREATE INDEX I1 ON t2 (a);
CREATE INDEX I2 ON t2 (b);
EXPLAIN SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 ALL I2 NULL NULL NULL 2 Using where
-1 PRIMARY t2 ref I1 I1 4 test.t2.b 2 Using where; Using index; FirstMatch(t2)
+1 PRIMARY t2 index I1 I1 4 NULL 2 Using where; Using index; LooseScan
+1 PRIMARY t2 ref I2 I2 13 test.t2.a 1 Using index condition
SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2);
a b
EXPLAIN
SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL I2 NULL NULL NULL 2 Using where
-1 PRIMARY t1 ref I1 I1 2 test.t1.b 2 Using where; Using index; FirstMatch(t1)
+1 PRIMARY t1 index I1 I1 2 NULL 2 Using where; Using index; LooseScan
+1 PRIMARY t1 ref I2 I2 13 test.t1.a 1 Using index condition
SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500);
a b
DROP TABLE t1,t2;
@@ -4493,10 +4523,13 @@ out_a MIN(b)
1 2
2 4
DROP TABLE t1;
+#
+# Bug#32036 EXISTS within a WHERE clause with a UNION crashes MySQL 5.122
+#
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
-INSERT INTO t1 VALUES (1),(2);
-INSERT INTO t2 VALUES (1),(2);
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+INSERT INTO t2 VALUES (1),(2),(1000);
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
2
2
@@ -4504,8 +4537,8 @@ SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
EXPLAIN EXTENDED
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 33.33 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
Note 1003 select 2 AS `2` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`a` = `test`.`t1`.`a`
@@ -4513,9 +4546,9 @@ EXPLAIN EXTENDED
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION
(SELECT 1 FROM t2 WHERE t1.a = t2.a));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
-2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
-3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where
+3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 3 100.00 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
@@ -5751,7 +5784,8 @@ DROP TABLE IF EXISTS ot1, ot4, it2, it3;
CREATE TABLE t1 (a int) ;
INSERT INTO t1 VALUES (NULL), (1), (NULL), (2);
CREATE TABLE t2 (a int, INDEX idx(a)) ;
-INSERT INTO t2 VALUES (NULL), (1), (NULL);
+INSERT INTO t2 VALUES (NULL), (1), (NULL),(1000);
+insert into t2 select seq from seq_3_to_500;
SELECT * FROM t1
WHERE EXISTS (SELECT a FROM t2 USE INDEX () WHERE t2.a = t1.a);
a
@@ -5761,7 +5795,7 @@ SELECT * FROM t1
WHERE EXISTS (SELECT a FROM t2 USE INDEX() WHERE t2.a = t1.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
-1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 502 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
SELECT * FROM t1
WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a);
a
@@ -5771,7 +5805,7 @@ SELECT * FROM t1
WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
-1 PRIMARY t2 ref idx idx 5 test.t1.a 2 Using index; FirstMatch(t1)
+1 PRIMARY t2 ref idx idx 5 test.t1.a 11 Using index; FirstMatch(t1)
DROP TABLE t1,t2;
#
# BUG#752992: Wrong results for a subquery with 'semijoin=on'
@@ -5788,9 +5822,9 @@ SET @save_join_cache_level=@@join_cache_level;
SET join_cache_level=0;
EXPLAIN SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 3
-1 PRIMARY it eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 Using index
-1 PRIMARY t2 index NULL PRIMARY 4 NULL 3 Using index; FirstMatch(it)
+1 PRIMARY it index PRIMARY PRIMARY 4 NULL 3 Using index
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.it.pk 1
+1 PRIMARY t2 index NULL PRIMARY 4 NULL 3 Using index; FirstMatch(t1)
SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1);
pk i
11 0
@@ -6713,7 +6747,7 @@ SET @@optimizer_switch='semijoin=off,materialization=off,in_to_exists=on,subquer
EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL a 4 NULL 2 Using where; Using index
-2 DEPENDENT SUBQUERY t1 index_subquery a a 4 func 2 Using index
+2 DEPENDENT SUBQUERY t1 index_subquery a a 4 func 1 Using index
SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1);
a
2009-01-01
@@ -6918,7 +6952,7 @@ FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias1 index a a 19 NULL 11 Using where; Using index
-1 PRIMARY alias2 ref a a 19 test.alias1.a 2 Using index
+1 PRIMARY alias2 ref a a 19 test.alias1.a 1 Using index
1 PRIMARY alias3 index NULL a 19 NULL 11 Using index; Using join buffer (flat, BNL join)
2 SUBQUERY t1 index_subquery a a 19 const 1 Using index; Using where
SELECT MAX( alias2.a )
@@ -7076,7 +7110,7 @@ WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where
-1 PRIMARY t3 ref d d 5 test.t2.b 2 Using index
+1 PRIMARY t3 ref d d 5 test.t2.b 1 Using index
3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
set @tmp_mdev410=@@global.userstat;
set global userstat=on;
@@ -7108,7 +7142,7 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP B
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
-2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
+2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index
DROP TABLE t1,t2;
#
# MDEV-435: Expensive subqueries may be evaluated during optimization in merge_key_fields
@@ -7141,7 +7175,7 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP B
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
-2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
+2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index
DROP TABLE t1,t2;
#
# MDEV-5991: crash in Item_field::used_tables
@@ -7554,6 +7588,48 @@ drop table t1, t2, t3;
#
# End of 10.6 tests
#
+#
+# MDEV-32656: ASAN errors in base_list_iterator::next /
+# setup_table_map upon 2nd execution of PS
+# (10.10 part)
+#
+CREATE TABLE t1 (id BIGINT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE TABLE t2 (a INT);
+INSERT INTO t2 VALUES (2),(3);
+CREATE TABLE t3 (b INT);
+INSERT INTO t3 VALUES (3),(4);
+PREPARE stmt FROM "UPDATE t2 SET a = 1 WHERE (select 1 where ('e','e') IN (SELECT v1.id, v1.id FROM v1 JOIN t3)) <> 0";
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+PREPARE stmt FROM "UPDATE t2 SET a = 1 WHERE ('e') IN (SELECT v1.id FROM v1 JOIN t3)";
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+PREPARE stmt FROM "UPDATE t2 SET a = 1 WHERE ('e','e') IN (SELECT v1.id, v1.id FROM v1 JOIN t3)";
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+DROP VIEW v1;
+DROP TABLE t1, t2, t3;
+#
+# End of 10.10 tests
+#
set optimizer_switch=default;
select @@optimizer_switch like '%materialization=on%';
@@optimizer_switch like '%materialization=on%'
diff --git a/mysql-test/main/subselect_no_opts.result b/mysql-test/main/subselect_no_opts.result
index 603958d2..191dfc82 100644
--- a/mysql-test/main/subselect_no_opts.result
+++ b/mysql-test/main/subselect_no_opts.result
@@ -663,7 +663,18 @@ a b
22 11
2 12
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t12 where t11.a = t12.a);
-ERROR HY000: Table 't12' is specified twice, both as a target for 'DELETE' and as a separate source for data
+select * from t11;
+a b
+0 10
+1 11
+select * from t12;
+a b
+33 10
+22 11
+delete from t11;
+delete from t12;
+insert into t11 values (0, 10),(1, 11),(2, 12);
+insert into t12 values (33, 10),(22, 11),(2, 12);
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2);
ERROR 21000: Subquery returns more than 1 row
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2 where t11.a = t2.a);
@@ -957,6 +968,9 @@ select (select a+1) from t1;
NULL
4.5
drop table t1;
+#
+# Null with keys
+#
CREATE TABLE t1 (a int(11) NOT NULL default '0', PRIMARY KEY (a));
CREATE TABLE t2 (a int(11) default '0', INDEX (a));
INSERT INTO t1 VALUES (1),(2),(3),(4);
@@ -1488,6 +1502,9 @@ drop table if exists t1;
(SELECT 1 as a) UNION (SELECT 1) ORDER BY (SELECT a+0);
a
1
+#
+# IN subselect optimization test
+#
create table t1 (a int not null, b int, primary key (a));
create table t2 (a int not null, primary key (a));
create table t3 (a int not null, b int, primary key (a));
@@ -1534,23 +1551,19 @@ insert into t1 values (1,10), (2,20), (3,30), (4,40);
create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
insert into t1
-select rand()*100000+200,rand()*100000 from t0 A, t0 B, t0 C, t0 D;
+select rand()*100000+200,rand(1)*100000 from t0 A, t0 B, t0 C, t0 D;
insert into t2 values (2), (3), (4), (5);
insert into t3 values (10,3), (20,4), (30,5);
-select * from t2 where t2.a in (select a from t1);
-a
-2
-3
-4
explain extended select * from t2 where t2.a in (select a from t1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index
2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index
Warnings:
Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a)))
-select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
+select * from t2 where t2.a in (select a from t1);
a
2
+3
4
explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
id select_type table type possible_keys key key_len ref rows filtered Extra
@@ -1558,18 +1571,28 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index; Using where
Warnings:
Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a where `test`.`t1`.`b` <> 30 and <cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`)))
-select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
+select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
a
2
-3
+4
explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index
-2 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 100.00 Using where; Using index
-2 DEPENDENT SUBQUERY t1 ref a a 10 func,test.t3.a 1167 100.00 Using index
+2 DEPENDENT SUBQUERY t1 ref a a 5 func 1001 100.00 Using index
+2 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 33.33 Using where; Using index; Using join buffer (flat, BNL join)
Warnings:
-Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` join `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`a` and <cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))
+Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` join `test`.`t3` where `test`.`t3`.`a` = `test`.`t1`.`b` and <cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))
+select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
+a
+2
+3
insert into t1 values (3,31);
+explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index
+2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index; Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a where `test`.`t1`.`b` <> 30 and <cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`)))
select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
a
2
@@ -1579,12 +1602,6 @@ select * from t2 where t2.a in (select a from t1 where t1.b <> 30 and t1.b <> 31
a
2
4
-explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index
-2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index; Using where
-Warnings:
-Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a where `test`.`t1`.`b` <> 30 and <cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`)))
drop table t0, t1, t2, t3;
create table t1 (a int, b int);
create table t2 (a int, b int);
@@ -1646,6 +1663,9 @@ Note 1003 (select 'tttt' AS `s1` from dual)
s1
tttt
drop table t1;
+#
+# IN optimisation test results
+#
create table t1 (s1 char(5), index s1(s1));
create table t2 (s1 char(5), index s1(s1));
insert into t1 values ('a1'),('a2'),('a3');
@@ -2479,19 +2499,22 @@ a
1
3
DROP TABLE t1;
+#
+# SELECT(EXISTS * ...)optimisation
+#
create table t1 (a int, b int);
-insert into t1 values (1,2),(3,4);
-select * from t1 up where exists (select * from t1 where t1.a=up.a);
-a b
-1 2
-3 4
-explain extended select * from t1 up where exists (select * from t1 where t1.a=up.a);
+insert into t1 values (1,2),(3,4),(5,6),(7,8);
+insert into t1 select seq,seq from seq_20_to_40;
+select sum(a+b) from t1 up where exists (select * from t1 where t1.a=up.a);
+sum(a+b)
+1296
+explain extended select sum(a+b) from t1 up where exists (select * from t1 where t1.a=up.a);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY up ALL NULL NULL NULL NULL 2 100.00 Using where
-2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+1 PRIMARY up ALL NULL NULL NULL NULL 25 100.00 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 25 100.00 Using where
Warnings:
Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1
-Note 1003 /* select#1 */ select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` where <in_optimizer>(`test`.`up`.`a`,<exists>(/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` where <cache>(`test`.`up`.`a`) = `test`.`t1`.`a`))
+Note 1003 /* select#1 */ select sum(`test`.`up`.`a` + `test`.`up`.`b`) AS `sum(a+b)` from `test`.`t1` `up` where <in_optimizer>(`test`.`up`.`a`,<exists>(/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` where <cache>(`test`.`up`.`a`) = `test`.`t1`.`a`))
drop table t1;
CREATE TABLE t1 (t1_a int);
INSERT INTO t1 VALUES (1);
@@ -3158,9 +3181,13 @@ retailerID statusID changed
0048 1 2006-01-06 12:37:50
0059 1 2006-01-06 12:37:50
drop table t1;
+#
+# Bug#21180 Subselect with index for both WHERE and ORDER BY
+# produces empty result
+#
create table t1(a int, primary key (a));
insert into t1 values (10);
-create table t2 (a int primary key, b varchar(32), c int, unique key b(c, b));
+create table t2 (a int primary key, b varchar(32), c int, unique key cb(c, b));
insert into t2(a, c, b) values (1,10,'359'), (2,10,'35988'), (3,10,'35989');
insert into t2(a, c, b) values (4,10,'360'), (5,10,'35998'), (6,10,'35999');
analyze table t1;
@@ -3173,7 +3200,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system PRIMARY NULL NULL NULL 1
1 PRIMARY r const PRIMARY PRIMARY 4 const 1
-2 SUBQUERY t2 range b b 40 NULL 3 Using where
+2 SUBQUERY t2 range cb cb 40 NULL 3 Using where
SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r
ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10;
@@ -3185,7 +3212,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system PRIMARY NULL NULL NULL 1
1 PRIMARY r const PRIMARY PRIMARY 4 const 1
-2 SUBQUERY t2 range b b 40 NULL 3 Using index condition
+2 SUBQUERY t2 range cb cb 40 NULL 3 Using index condition
SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r
ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10;
@@ -4278,8 +4305,8 @@ INSERT INTO t2 VALUES (7), (5), (1), (3);
SELECT id, st FROM t1
WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id);
id st
-3 FL
1 GA
+3 FL
7 FL
SELECT id, st FROM t1
WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id)
@@ -4380,6 +4407,9 @@ SELECT ((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL FROM t1;
0
0
DROP TABLE t1, t2;
+#
+# Bug#28076 inconsistent binary/varbinary comparison
+#
CREATE TABLE t1 (s1 BINARY(5), s2 VARBINARY(5));
INSERT INTO t1 VALUES (0x41,0x41), (0x42,0x42), (0x43,0x43);
SELECT s1, s2 FROM t1 WHERE s2 IN (SELECT s1 FROM t1);
@@ -4442,7 +4472,7 @@ CREATE INDEX I2 ON t1 (b);
EXPLAIN SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
-2 DEPENDENT SUBQUERY t1 index_subquery I1 I1 2 func 2 Using index; Using where
+2 DEPENDENT SUBQUERY t1 index_subquery I1 I1 2 func 1 Using index; Using where
SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1);
a b
CREATE TABLE t2 (a VARCHAR(1), b VARCHAR(10));
@@ -4452,14 +4482,14 @@ CREATE INDEX I2 ON t2 (b);
EXPLAIN SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
-2 DEPENDENT SUBQUERY t2 index_subquery I1 I1 4 func 2 Using index; Using where
+2 DEPENDENT SUBQUERY t2 index_subquery I1 I1 4 func 1 Using index; Using where
SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2);
a b
EXPLAIN
SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
-2 DEPENDENT SUBQUERY t1 index_subquery I1 I1 2 func 2 Using index; Using where
+2 DEPENDENT SUBQUERY t1 index_subquery I1 I1 2 func 1 Using index; Using where
SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500);
a b
DROP TABLE t1,t2;
@@ -4489,10 +4519,13 @@ out_a MIN(b)
1 2
2 4
DROP TABLE t1;
+#
+# Bug#32036 EXISTS within a WHERE clause with a UNION crashes MySQL 5.122
+#
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
-INSERT INTO t1 VALUES (1),(2);
-INSERT INTO t2 VALUES (1),(2);
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+INSERT INTO t2 VALUES (1),(2),(1000);
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
2
2
@@ -4500,8 +4533,8 @@ SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
EXPLAIN EXTENDED
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
-2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
Note 1003 /* select#1 */ select 2 AS `2` from `test`.`t1` where <in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#2 */ select `test`.`t2`.`a` from `test`.`t2` where <cache>(`test`.`t1`.`a`) = `test`.`t2`.`a`))
@@ -4509,9 +4542,9 @@ EXPLAIN EXTENDED
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION
(SELECT 1 FROM t2 WHERE t1.a = t2.a));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
-2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
-3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where
+3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 3 100.00 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
@@ -5747,7 +5780,8 @@ DROP TABLE IF EXISTS ot1, ot4, it2, it3;
CREATE TABLE t1 (a int) ;
INSERT INTO t1 VALUES (NULL), (1), (NULL), (2);
CREATE TABLE t2 (a int, INDEX idx(a)) ;
-INSERT INTO t2 VALUES (NULL), (1), (NULL);
+INSERT INTO t2 VALUES (NULL), (1), (NULL),(1000);
+insert into t2 select seq from seq_3_to_500;
SELECT * FROM t1
WHERE EXISTS (SELECT a FROM t2 USE INDEX () WHERE t2.a = t1.a);
a
@@ -5757,7 +5791,7 @@ SELECT * FROM t1
WHERE EXISTS (SELECT a FROM t2 USE INDEX() WHERE t2.a = t1.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
-2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 502 Using where
SELECT * FROM t1
WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a);
a
@@ -5767,7 +5801,7 @@ SELECT * FROM t1
WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
-2 DEPENDENT SUBQUERY t2 index_subquery idx idx 5 func 2 Using index
+2 DEPENDENT SUBQUERY t2 index_subquery idx idx 5 func 58 Using index
DROP TABLE t1,t2;
#
# BUG#752992: Wrong results for a subquery with 'semijoin=on'
@@ -6127,7 +6161,7 @@ WHERE col_varchar_nokey IN
(SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY ot system NULL NULL NULL NULL 1
-2 DEPENDENT SUBQUERY it1 index_subquery idx_cvk_cik idx_cvk_cik 9 func,const 2 Using index; Using where
+2 DEPENDENT SUBQUERY it1 index_subquery idx_cvk_cik idx_cvk_cik 9 func,const 1 Using index; Using where
SELECT col_int_nokey FROM ot
WHERE col_varchar_nokey IN
(SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL);
@@ -6709,7 +6743,7 @@ SET @@optimizer_switch='semijoin=off,materialization=off,in_to_exists=on,subquer
EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL a 4 NULL 2 Using where; Using index
-2 DEPENDENT SUBQUERY t1 index_subquery a a 4 func 2 Using index
+2 DEPENDENT SUBQUERY t1 index_subquery a a 4 func 1 Using index
SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1);
a
2009-01-01
@@ -6914,7 +6948,7 @@ FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias1 index a a 19 NULL 11 Using where; Using index
-1 PRIMARY alias2 ref a a 19 test.alias1.a 2 Using index
+1 PRIMARY alias2 ref a a 19 test.alias1.a 1 Using index
1 PRIMARY alias3 index NULL a 19 NULL 11 Using index; Using join buffer (flat, BNL join)
2 SUBQUERY t1 index_subquery a a 19 const 1 Using index; Using where
SELECT MAX( alias2.a )
@@ -7073,7 +7107,7 @@ WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where
-1 PRIMARY t3 ref d d 5 test.t2.b 2 Using index
+1 PRIMARY t3 ref d d 5 test.t2.b 1 Using index
3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
set @tmp_mdev410=@@global.userstat;
set global userstat=on;
@@ -7105,7 +7139,7 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP B
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
-2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
+2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index
DROP TABLE t1,t2;
#
# MDEV-435: Expensive subqueries may be evaluated during optimization in merge_key_fields
@@ -7139,7 +7173,7 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP B
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
-2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
+2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index
DROP TABLE t1,t2;
#
# MDEV-5991: crash in Item_field::used_tables
@@ -7552,4 +7586,46 @@ drop table t1, t2, t3;
#
# End of 10.6 tests
#
+#
+# MDEV-32656: ASAN errors in base_list_iterator::next /
+# setup_table_map upon 2nd execution of PS
+# (10.10 part)
+#
+CREATE TABLE t1 (id BIGINT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE TABLE t2 (a INT);
+INSERT INTO t2 VALUES (2),(3);
+CREATE TABLE t3 (b INT);
+INSERT INTO t3 VALUES (3),(4);
+PREPARE stmt FROM "UPDATE t2 SET a = 1 WHERE (select 1 where ('e','e') IN (SELECT v1.id, v1.id FROM v1 JOIN t3)) <> 0";
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+PREPARE stmt FROM "UPDATE t2 SET a = 1 WHERE ('e') IN (SELECT v1.id FROM v1 JOIN t3)";
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+PREPARE stmt FROM "UPDATE t2 SET a = 1 WHERE ('e','e') IN (SELECT v1.id, v1.id FROM v1 JOIN t3)";
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+DROP VIEW v1;
+DROP TABLE t1, t2, t3;
+#
+# End of 10.10 tests
+#
set @optimizer_switch_for_subselect_test=null;
diff --git a/mysql-test/main/subselect_no_scache.result b/mysql-test/main/subselect_no_scache.result
index 67d738a8..0d18c5cc 100644
--- a/mysql-test/main/subselect_no_scache.result
+++ b/mysql-test/main/subselect_no_scache.result
@@ -371,7 +371,7 @@ patient_uq clinic_uq
explain extended select * from t6 where exists (select * from t7 where uq = clinic_uq);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t7 index PRIMARY PRIMARY 4 NULL 2 100.00 Using index
-1 PRIMARY t6 ALL i1 NULL NULL NULL 4 100.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t6 ref i1 i1 5 test.t7.uq 1 100.00
Warnings:
Note 1276 Field or reference 'test.t6.clinic_uq' of SELECT #2 was resolved in SELECT #1
Note 1003 select `test`.`t6`.`patient_uq` AS `patient_uq`,`test`.`t6`.`clinic_uq` AS `clinic_uq` from `test`.`t7` join `test`.`t6` where `test`.`t6`.`clinic_uq` = `test`.`t7`.`uq`
@@ -666,7 +666,18 @@ a b
22 11
2 12
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t12 where t11.a = t12.a);
-ERROR HY000: Table 't12' is specified twice, both as a target for 'DELETE' and as a separate source for data
+select * from t11;
+a b
+0 10
+1 11
+select * from t12;
+a b
+33 10
+22 11
+delete from t11;
+delete from t12;
+insert into t11 values (0, 10),(1, 11),(2, 12);
+insert into t12 values (33, 10),(22, 11),(2, 12);
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2);
ERROR 21000: Subquery returns more than 1 row
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2 where t11.a = t2.a);
@@ -960,6 +971,9 @@ select (select a+1) from t1;
NULL
4.5
drop table t1;
+#
+# Null with keys
+#
CREATE TABLE t1 (a int(11) NOT NULL default '0', PRIMARY KEY (a));
CREATE TABLE t2 (a int(11) default '0', INDEX (a));
INSERT INTO t1 VALUES (1),(2),(3),(4);
@@ -1491,6 +1505,9 @@ drop table if exists t1;
(SELECT 1 as a) UNION (SELECT 1) ORDER BY (SELECT a+0);
a
1
+#
+# IN subselect optimization test
+#
create table t1 (a int not null, b int, primary key (a));
create table t2 (a int not null, primary key (a));
create table t3 (a int not null, b int, primary key (a));
@@ -1514,21 +1531,21 @@ a
4
explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index
-1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1 100.00 Using where
+1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where
+1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index
Warnings:
-Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30
+Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t1`.`b` <> 30
select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
a
2
3
explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index
-1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1 100.00
-1 PRIMARY t3 index PRIMARY PRIMARY 4 NULL 3 100.00 Using where; Using index; Using join buffer (flat, BNL join)
+1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where
+1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index
+1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index
Warnings:
-Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t1`.`a` = `test`.`t2`.`a`
+Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t2`.`a` = `test`.`t1`.`a`
drop table t1, t2, t3;
create table t1 (a int, b int, index a (a,b));
create table t2 (a int, index a (a));
@@ -1537,42 +1554,48 @@ insert into t1 values (1,10), (2,20), (3,30), (4,40);
create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
insert into t1
-select rand()*100000+200,rand()*100000 from t0 A, t0 B, t0 C, t0 D;
+select rand()*100000+200,rand(1)*100000 from t0 A, t0 B, t0 C, t0 D;
insert into t2 values (2), (3), (4), (5);
insert into t3 values (10,3), (20,4), (30,5);
-select * from t2 where t2.a in (select a from t1);
-a
-2
-3
-4
explain extended select * from t2 where t2.a in (select a from t1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index
-1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using index; FirstMatch(t2)
+1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using index; FirstMatch(t2)
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a`
-select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
+select * from t2 where t2.a in (select a from t1);
a
2
+3
4
explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index
-1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using where; Using index; FirstMatch(t2)
+1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using where; Using index; FirstMatch(t2)
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30
-select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
+select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
a
2
-3
+4
explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index
1 PRIMARY t3 range a a 5 NULL 3 100.00 Using where; Using index
-1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 100.00 Using index; FirstMatch(t2)
+1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 0.29 Using index; FirstMatch(t2)
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where `test`.`t1`.`b` = `test`.`t3`.`a` and `test`.`t1`.`a` = `test`.`t2`.`a`
+select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
+a
+2
+3
insert into t1 values (3,31);
+explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index
+1 PRIMARY t1 ref a a 5 test.t2.a 101 0.99 Using where; Using index; FirstMatch(t2)
+Warnings:
+Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30
select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
a
2
@@ -1582,12 +1605,6 @@ select * from t2 where t2.a in (select a from t1 where t1.b <> 30 and t1.b <> 31
a
2
4
-explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index
-1 PRIMARY t1 ref a a 5 test.t2.a 101 100.00 Using where; Using index; FirstMatch(t2)
-Warnings:
-Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30
drop table t0, t1, t2, t3;
create table t1 (a int, b int);
create table t2 (a int, b int);
@@ -1649,6 +1666,9 @@ Note 1003 (select 'tttt' AS `s1` from dual)
s1
tttt
drop table t1;
+#
+# IN optimisation test results
+#
create table t1 (s1 char(5), index s1(s1));
create table t2 (s1 char(5), index s1(s1));
insert into t1 values ('a1'),('a2'),('a3');
@@ -2482,20 +2502,23 @@ a
1
3
DROP TABLE t1;
+#
+# SELECT(EXISTS * ...)optimisation
+#
create table t1 (a int, b int);
-insert into t1 values (1,2),(3,4);
-select * from t1 up where exists (select * from t1 where t1.a=up.a);
-a b
-1 2
-3 4
-explain extended select * from t1 up where exists (select * from t1 where t1.a=up.a);
+insert into t1 values (1,2),(3,4),(5,6),(7,8);
+insert into t1 select seq,seq from seq_20_to_40;
+select sum(a+b) from t1 up where exists (select * from t1 where t1.a=up.a);
+sum(a+b)
+1296
+explain extended select sum(a+b) from t1 up where exists (select * from t1 where t1.a=up.a);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY up ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY up ALL NULL NULL NULL NULL 25 100.00
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00
+2 MATERIALIZED t1 ALL NULL NULL NULL NULL 25 100.00
Warnings:
Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1
-Note 1003 select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` semi join (`test`.`t1`) where 1
+Note 1003 select sum(`test`.`up`.`a` + `test`.`up`.`b`) AS `sum(a+b)` from `test`.`t1` `up` semi join (`test`.`t1`) where 1
drop table t1;
CREATE TABLE t1 (t1_a int);
INSERT INTO t1 VALUES (1);
@@ -3163,9 +3186,13 @@ retailerID statusID changed
0048 1 2006-01-06 12:37:50
0059 1 2006-01-06 12:37:50
drop table t1;
+#
+# Bug#21180 Subselect with index for both WHERE and ORDER BY
+# produces empty result
+#
create table t1(a int, primary key (a));
insert into t1 values (10);
-create table t2 (a int primary key, b varchar(32), c int, unique key b(c, b));
+create table t2 (a int primary key, b varchar(32), c int, unique key cb(c, b));
insert into t2(a, c, b) values (1,10,'359'), (2,10,'35988'), (3,10,'35989');
insert into t2(a, c, b) values (4,10,'360'), (5,10,'35998'), (6,10,'35999');
analyze table t1;
@@ -3178,7 +3205,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system PRIMARY NULL NULL NULL 1
1 PRIMARY r const PRIMARY PRIMARY 4 const 1
-2 SUBQUERY t2 range b b 40 NULL 3 Using where
+2 SUBQUERY t2 range cb cb 40 NULL 3 Using where
SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r
ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10;
@@ -3190,7 +3217,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system PRIMARY NULL NULL NULL 1
1 PRIMARY r const PRIMARY PRIMARY 4 const 1
-2 SUBQUERY t2 range b b 40 NULL 3 Using index condition
+2 SUBQUERY t2 range cb cb 40 NULL 3 Using index condition
SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r
ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10;
@@ -4285,8 +4312,8 @@ INSERT INTO t2 VALUES (7), (5), (1), (3);
SELECT id, st FROM t1
WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id);
id st
-3 FL
1 GA
+3 FL
7 FL
SELECT id, st FROM t1
WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id)
@@ -4387,6 +4414,9 @@ SELECT ((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL FROM t1;
0
0
DROP TABLE t1, t2;
+#
+# Bug#28076 inconsistent binary/varbinary comparison
+#
CREATE TABLE t1 (s1 BINARY(5), s2 VARBINARY(5));
INSERT INTO t1 VALUES (0x41,0x41), (0x42,0x42), (0x43,0x43);
SELECT s1, s2 FROM t1 WHERE s2 IN (SELECT s1 FROM t1);
@@ -4448,8 +4478,8 @@ CREATE INDEX I1 ON t1 (a);
CREATE INDEX I2 ON t1 (b);
EXPLAIN SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL I2 NULL NULL NULL 2 Using where
-1 PRIMARY t1 ref I1 I1 2 test.t1.b 2 Using where; Using index; FirstMatch(t1)
+1 PRIMARY t1 index I1 I1 2 NULL 2 Using where; Using index; LooseScan
+1 PRIMARY t1 ref I2 I2 13 test.t1.a 1 Using index condition
SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1);
a b
CREATE TABLE t2 (a VARCHAR(1), b VARCHAR(10));
@@ -4458,15 +4488,15 @@ CREATE INDEX I1 ON t2 (a);
CREATE INDEX I2 ON t2 (b);
EXPLAIN SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 ALL I2 NULL NULL NULL 2 Using where
-1 PRIMARY t2 ref I1 I1 4 test.t2.b 2 Using where; Using index; FirstMatch(t2)
+1 PRIMARY t2 index I1 I1 4 NULL 2 Using where; Using index; LooseScan
+1 PRIMARY t2 ref I2 I2 13 test.t2.a 1 Using index condition
SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2);
a b
EXPLAIN
SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL I2 NULL NULL NULL 2 Using where
-1 PRIMARY t1 ref I1 I1 2 test.t1.b 2 Using where; Using index; FirstMatch(t1)
+1 PRIMARY t1 index I1 I1 2 NULL 2 Using where; Using index; LooseScan
+1 PRIMARY t1 ref I2 I2 13 test.t1.a 1 Using index condition
SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500);
a b
DROP TABLE t1,t2;
@@ -4496,10 +4526,13 @@ out_a MIN(b)
1 2
2 4
DROP TABLE t1;
+#
+# Bug#32036 EXISTS within a WHERE clause with a UNION crashes MySQL 5.122
+#
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
-INSERT INTO t1 VALUES (1),(2);
-INSERT INTO t2 VALUES (1),(2);
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+INSERT INTO t2 VALUES (1),(2),(1000);
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
2
2
@@ -4507,19 +4540,18 @@ SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
EXPLAIN EXTENDED
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 33.33 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
-Note 1003 select 2 AS `2` from `test`.`t1` semi join (`test`.`t2`) where 1
+Note 1003 select 2 AS `2` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`a` = `test`.`t1`.`a`
EXPLAIN EXTENDED
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION
(SELECT 1 FROM t2 WHERE t1.a = t2.a));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
-2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
-3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where
+3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 3 100.00 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
@@ -5758,7 +5790,8 @@ DROP TABLE IF EXISTS ot1, ot4, it2, it3;
CREATE TABLE t1 (a int) ;
INSERT INTO t1 VALUES (NULL), (1), (NULL), (2);
CREATE TABLE t2 (a int, INDEX idx(a)) ;
-INSERT INTO t2 VALUES (NULL), (1), (NULL);
+INSERT INTO t2 VALUES (NULL), (1), (NULL),(1000);
+insert into t2 select seq from seq_3_to_500;
SELECT * FROM t1
WHERE EXISTS (SELECT a FROM t2 USE INDEX () WHERE t2.a = t1.a);
a
@@ -5769,7 +5802,7 @@ WHERE EXISTS (SELECT a FROM t2 USE INDEX() WHERE t2.a = t1.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 502
SELECT * FROM t1
WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a);
a
@@ -5778,9 +5811,8 @@ EXPLAIN
SELECT * FROM t1
WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 index idx idx 5 NULL 3 Using index
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
+1 PRIMARY t2 ref idx idx 5 test.t1.a 11 Using index; FirstMatch(t1)
DROP TABLE t1,t2;
#
# BUG#752992: Wrong results for a subquery with 'semijoin=on'
@@ -5797,9 +5829,9 @@ SET @save_join_cache_level=@@join_cache_level;
SET join_cache_level=0;
EXPLAIN SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 3
-1 PRIMARY it eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 Using index
-1 PRIMARY t2 index NULL PRIMARY 4 NULL 3 Using index; FirstMatch(it)
+1 PRIMARY it index PRIMARY PRIMARY 4 NULL 3 Using index
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.it.pk 1
+1 PRIMARY t2 index NULL PRIMARY 4 NULL 3 Using index; FirstMatch(t1)
SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1);
pk i
11 0
@@ -6140,8 +6172,7 @@ WHERE col_varchar_nokey IN
(SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY ot system NULL NULL NULL NULL 1
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED it1 ref idx_cvk_cik idx_cvk_cik 9 const,const 1 Using where; Using index
+1 PRIMARY it1 ref idx_cvk_cik idx_cvk_cik 9 const,const 1 Using where; Using index; FirstMatch(ot)
SELECT col_int_nokey FROM ot
WHERE col_varchar_nokey IN
(SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL);
@@ -6153,8 +6184,7 @@ WHERE (col_varchar_nokey, 'x') IN
(SELECT col_varchar_key, col_varchar_key2 FROM it2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY ot system NULL NULL NULL NULL 1
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1
-2 MATERIALIZED it2 ref idx_cvk_cvk2_cik,idx_cvk_cik idx_cvk_cvk2_cik 8 const,const 1 Using where; Using index
+1 PRIMARY it2 ref idx_cvk_cvk2_cik,idx_cvk_cik idx_cvk_cvk2_cik 8 const,const 1 Using where; Using index; FirstMatch(ot)
SELECT col_int_nokey FROM ot
WHERE (col_varchar_nokey, 'x') IN
(SELECT col_varchar_key, col_varchar_key2 FROM it2);
@@ -6724,7 +6754,7 @@ SET @@optimizer_switch='semijoin=off,materialization=off,in_to_exists=on,subquer
EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL a 4 NULL 2 Using where; Using index
-2 DEPENDENT SUBQUERY t1 index_subquery a a 4 func 2 Using index
+2 DEPENDENT SUBQUERY t1 index_subquery a a 4 func 1 Using index
SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1);
a
2009-01-01
@@ -6929,7 +6959,7 @@ FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias1 index a a 19 NULL 11 Using where; Using index
-1 PRIMARY alias2 ref a a 19 test.alias1.a 2 Using index
+1 PRIMARY alias2 ref a a 19 test.alias1.a 1 Using index
1 PRIMARY alias3 index NULL a 19 NULL 11 Using index; Using join buffer (flat, BNL join)
2 SUBQUERY t1 index_subquery a a 19 const 1 Using index; Using where
SELECT MAX( alias2.a )
@@ -7088,7 +7118,7 @@ WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where
-1 PRIMARY t3 ref d d 5 test.t2.b 2 Using index
+1 PRIMARY t3 ref d d 5 test.t2.b 1 Using index
3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
set @tmp_mdev410=@@global.userstat;
set global userstat=on;
@@ -7120,7 +7150,7 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP B
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
-2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
+2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index
DROP TABLE t1,t2;
#
# MDEV-435: Expensive subqueries may be evaluated during optimization in merge_key_fields
@@ -7154,7 +7184,7 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP B
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
-2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
+2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index
DROP TABLE t1,t2;
#
# MDEV-5991: crash in Item_field::used_tables
@@ -7567,6 +7597,48 @@ drop table t1, t2, t3;
#
# End of 10.6 tests
#
+#
+# MDEV-32656: ASAN errors in base_list_iterator::next /
+# setup_table_map upon 2nd execution of PS
+# (10.10 part)
+#
+CREATE TABLE t1 (id BIGINT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE TABLE t2 (a INT);
+INSERT INTO t2 VALUES (2),(3);
+CREATE TABLE t3 (b INT);
+INSERT INTO t3 VALUES (3),(4);
+PREPARE stmt FROM "UPDATE t2 SET a = 1 WHERE (select 1 where ('e','e') IN (SELECT v1.id, v1.id FROM v1 JOIN t3)) <> 0";
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+PREPARE stmt FROM "UPDATE t2 SET a = 1 WHERE ('e') IN (SELECT v1.id FROM v1 JOIN t3)";
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+PREPARE stmt FROM "UPDATE t2 SET a = 1 WHERE ('e','e') IN (SELECT v1.id, v1.id FROM v1 JOIN t3)";
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+DROP VIEW v1;
+DROP TABLE t1, t2, t3;
+#
+# End of 10.10 tests
+#
set optimizer_switch=default;
select @@optimizer_switch like '%subquery_cache=on%';
@@optimizer_switch like '%subquery_cache=on%'
diff --git a/mysql-test/main/subselect_no_semijoin.result b/mysql-test/main/subselect_no_semijoin.result
index 09073c99..0e2b6a9d 100644
--- a/mysql-test/main/subselect_no_semijoin.result
+++ b/mysql-test/main/subselect_no_semijoin.result
@@ -368,10 +368,10 @@ patient_uq clinic_uq
explain extended select * from t6 where exists (select * from t7 where uq = clinic_uq);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t6 ALL NULL NULL NULL NULL 4 100.00 Using where
-2 MATERIALIZED t7 index PRIMARY PRIMARY 4 NULL 2 100.00 Using index
+2 DEPENDENT SUBQUERY t7 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index
Warnings:
Note 1276 Field or reference 'test.t6.clinic_uq' of SELECT #2 was resolved in SELECT #1
-Note 1003 /* select#1 */ select `test`.`t6`.`patient_uq` AS `patient_uq`,`test`.`t6`.`clinic_uq` AS `clinic_uq` from `test`.`t6` where <expr_cache><`test`.`t6`.`clinic_uq`>(<in_optimizer>(`test`.`t6`.`clinic_uq`,`test`.`t6`.`clinic_uq` in ( <materialize> (/* select#2 */ select `test`.`t7`.`uq` from `test`.`t7` where 1 ), <primary_index_lookup>(`test`.`t6`.`clinic_uq` in <temporary table> on distinct_key where `test`.`t6`.`clinic_uq` = `<subquery2>`.`uq`))))
+Note 1003 /* select#1 */ select `test`.`t6`.`patient_uq` AS `patient_uq`,`test`.`t6`.`clinic_uq` AS `clinic_uq` from `test`.`t6` where <expr_cache><`test`.`t6`.`clinic_uq`>(<in_optimizer>(`test`.`t6`.`clinic_uq`,<exists>(<primary_index_lookup>(<cache>(`test`.`t6`.`clinic_uq`) in t7 on PRIMARY))))
select * from t1 where a= (select a from t2,t4 where t2.b=t4.b);
ERROR 23000: Column 'a' in field list is ambiguous
drop table t1,t2,t3;
@@ -663,7 +663,18 @@ a b
22 11
2 12
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t12 where t11.a = t12.a);
-ERROR HY000: Table 't12' is specified twice, both as a target for 'DELETE' and as a separate source for data
+select * from t11;
+a b
+0 10
+1 11
+select * from t12;
+a b
+33 10
+22 11
+delete from t11;
+delete from t12;
+insert into t11 values (0, 10),(1, 11),(2, 12);
+insert into t12 values (33, 10),(22, 11),(2, 12);
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2);
ERROR 21000: Subquery returns more than 1 row
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2 where t11.a = t2.a);
@@ -957,6 +968,9 @@ select (select a+1) from t1;
NULL
4.5
drop table t1;
+#
+# Null with keys
+#
CREATE TABLE t1 (a int(11) NOT NULL default '0', PRIMARY KEY (a));
CREATE TABLE t2 (a int(11) default '0', INDEX (a));
INSERT INTO t1 VALUES (1),(2),(3),(4);
@@ -970,9 +984,9 @@ a t1.a in (select t2.a from t2)
explain extended SELECT t1.a, t1.a in (select t2.a from t2) FROM t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 100.00 Using index
-2 MATERIALIZED t2 index a a 5 NULL 3 100.00 Using index
+2 SUBQUERY t2 index_subquery a a 5 func 2 100.00 Using index
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,<expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,`test`.`t1`.`a` in ( <materialize> (/* select#2 */ select `test`.`t2`.`a` from `test`.`t2` ), <primary_index_lookup>(`test`.`t1`.`a` in <temporary table> on distinct_key where `test`.`t1`.`a` = `<subquery2>`.`a`)))) AS `t1.a in (select t2.a from t2)` from `test`.`t1`
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,<expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`a`) in t2 on a checking NULL having `test`.`t2`.`a` is null)))) AS `t1.a in (select t2.a from t2)` from `test`.`t1`
CREATE TABLE t3 (a int(11) default '0');
INSERT INTO t3 VALUES (1),(2),(3);
SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1;
@@ -984,10 +998,10 @@ a t1.a in (select t2.a from t2,t3 where t3.a=t2.a)
explain extended SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 100.00 Using index
-2 MATERIALIZED t2 index a a 5 NULL 3 100.00 Using index
-2 MATERIALIZED t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
+2 MATERIALIZED t3 ALL NULL NULL NULL NULL 3 100.00 Using where
+2 MATERIALIZED t2 ref a a 5 test.t3.a 1 100.00 Using index
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,<expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,`test`.`t1`.`a` in ( <materialize> (/* select#2 */ select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where `test`.`t3`.`a` = `test`.`t2`.`a` ), <primary_index_lookup>(`test`.`t1`.`a` in <temporary table> on distinct_key where `test`.`t1`.`a` = `<subquery2>`.`a`)))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1`
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,<expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,`test`.`t1`.`a` in ( <materialize> (/* select#2 */ select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where `test`.`t2`.`a` = `test`.`t3`.`a` ), <primary_index_lookup>(`test`.`t1`.`a` in <temporary table> on distinct_key where `test`.`t1`.`a` = `<subquery2>`.`a`)))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1`
drop table t1,t2,t3;
# check correct NULL Processing for normal IN/ALL/ANY
# and 2 ways of max/min optimization
@@ -1488,6 +1502,9 @@ drop table if exists t1;
(SELECT 1 as a) UNION (SELECT 1) ORDER BY (SELECT a+0);
a
1
+#
+# IN subselect optimization test
+#
create table t1 (a int not null, b int, primary key (a));
create table t2 (a int not null, primary key (a));
create table t3 (a int not null, b int, primary key (a));
@@ -1502,9 +1519,9 @@ a
explain extended select * from t2 where t2.a in (select a from t1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 100.00 Using where; Using index
-2 MATERIALIZED t1 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index
+2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index
Warnings:
-Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <expr_cache><`test`.`t2`.`a`>(<in_optimizer>(`test`.`t2`.`a`,`test`.`t2`.`a` in ( <materialize> (/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` ), <primary_index_lookup>(`test`.`t2`.`a` in <temporary table> on distinct_key where `test`.`t2`.`a` = `<subquery2>`.`a`))))
+Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <expr_cache><`test`.`t2`.`a`>(<in_optimizer>(`test`.`t2`.`a`,<exists>(<primary_index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on PRIMARY))))
select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
a
2
@@ -1512,9 +1529,9 @@ a
explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 100.00 Using where; Using index
-2 MATERIALIZED t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where
+2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using where
Warnings:
-Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <expr_cache><`test`.`t2`.`a`>(<in_optimizer>(`test`.`t2`.`a`,`test`.`t2`.`a` in ( <materialize> (/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` where `test`.`t1`.`b` <> 30 ), <primary_index_lookup>(`test`.`t2`.`a` in <temporary table> on distinct_key where `test`.`t2`.`a` = `<subquery2>`.`a`))))
+Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <expr_cache><`test`.`t2`.`a`>(<in_optimizer>(`test`.`t2`.`a`,<exists>(<primary_index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on PRIMARY where `test`.`t1`.`b` <> 30 and <cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))))
select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
a
2
@@ -1522,10 +1539,10 @@ a
explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 100.00 Using where; Using index
-2 MATERIALIZED t3 index PRIMARY PRIMARY 4 NULL 3 100.00 Using index
-2 MATERIALIZED t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where; Using join buffer (flat, BNL join)
+2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 func 1 100.00 Using where
+2 DEPENDENT SUBQUERY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index
Warnings:
-Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <expr_cache><`test`.`t2`.`a`>(<in_optimizer>(`test`.`t2`.`a`,`test`.`t2`.`a` in ( <materialize> (/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` join `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`a` ), <primary_index_lookup>(`test`.`t2`.`a` in <temporary table> on distinct_key where `test`.`t2`.`a` = `<subquery2>`.`a`))))
+Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <expr_cache><`test`.`t2`.`a`>(<in_optimizer>(`test`.`t2`.`a`,<exists>(/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` join `test`.`t3` where `test`.`t3`.`a` = `test`.`t1`.`b` and <cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`)))
drop table t1, t2, t3;
create table t1 (a int, b int, index a (a,b));
create table t2 (a int, index a (a));
@@ -1534,23 +1551,19 @@ insert into t1 values (1,10), (2,20), (3,30), (4,40);
create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
insert into t1
-select rand()*100000+200,rand()*100000 from t0 A, t0 B, t0 C, t0 D;
+select rand()*100000+200,rand(1)*100000 from t0 A, t0 B, t0 C, t0 D;
insert into t2 values (2), (3), (4), (5);
insert into t3 values (10,3), (20,4), (30,5);
-select * from t2 where t2.a in (select a from t1);
-a
-2
-3
-4
explain extended select * from t2 where t2.a in (select a from t1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index
2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index
Warnings:
Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <expr_cache><`test`.`t2`.`a`>(<in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a))))
-select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
+select * from t2 where t2.a in (select a from t1);
a
2
+3
4
explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
id select_type table type possible_keys key key_len ref rows filtered Extra
@@ -1558,18 +1571,28 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index; Using where
Warnings:
Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <expr_cache><`test`.`t2`.`a`>(<in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a where `test`.`t1`.`b` <> 30 and <cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))))
-select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
+select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
a
2
-3
+4
explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index
-2 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 100.00 Using where; Using index
-2 DEPENDENT SUBQUERY t1 ref a a 10 func,test.t3.a 1167 100.00 Using index
+2 DEPENDENT SUBQUERY t1 ref a a 5 func 1001 100.00 Using index
+2 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 33.33 Using where; Using index; Using join buffer (flat, BNL join)
Warnings:
-Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <expr_cache><`test`.`t2`.`a`>(<in_optimizer>(`test`.`t2`.`a`,<exists>(/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` join `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`a` and <cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`)))
+Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <expr_cache><`test`.`t2`.`a`>(<in_optimizer>(`test`.`t2`.`a`,<exists>(/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` join `test`.`t3` where `test`.`t3`.`a` = `test`.`t1`.`b` and <cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`)))
+select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
+a
+2
+3
insert into t1 values (3,31);
+explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index
+2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index; Using where
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <expr_cache><`test`.`t2`.`a`>(<in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a where `test`.`t1`.`b` <> 30 and <cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))))
select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
a
2
@@ -1579,12 +1602,6 @@ select * from t2 where t2.a in (select a from t1 where t1.b <> 30 and t1.b <> 31
a
2
4
-explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30);
-id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2 index NULL a 5 NULL 4 100.00 Using where; Using index
-2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 1001 100.00 Using index; Using where
-Warnings:
-Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <expr_cache><`test`.`t2`.`a`>(<in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a where `test`.`t1`.`b` <> 30 and <cache>(`test`.`t2`.`a`) = `test`.`t1`.`a`))))
drop table t0, t1, t2, t3;
create table t1 (a int, b int);
create table t2 (a int, b int);
@@ -1646,6 +1663,9 @@ Note 1003 (select 'tttt' AS `s1` from dual)
s1
tttt
drop table t1;
+#
+# IN optimisation test results
+#
create table t1 (s1 char(5), index s1(s1));
create table t2 (s1 char(5), index s1(s1));
insert into t1 values ('a1'),('a2'),('a3');
@@ -1673,27 +1693,27 @@ a3 1
explain extended select s1, s1 NOT IN (SELECT s1 FROM t2) from t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index
-2 MATERIALIZED t2 index s1 s1 6 NULL 2 100.00 Using index
+2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,`test`.`t1`.`s1` in ( <materialize> (/* select#2 */ select `test`.`t2`.`s1` from `test`.`t2` ), <primary_index_lookup>(`test`.`t1`.`s1` in <temporary table> on distinct_key where `test`.`t1`.`s1` = `<subquery2>`.`s1`)))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1`
+Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1`
explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index
-2 MATERIALIZED t2 index s1 s1 6 NULL 2 100.00 Using index
+2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,`test`.`t1`.`s1` in ( <materialize> (/* select#2 */ select `test`.`t2`.`s1` from `test`.`t2` ), <primary_index_lookup>(`test`.`t1`.`s1` in <temporary table> on distinct_key where `test`.`t1`.`s1` = `<subquery2>`.`s1`)))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1`
+Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1`
explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index
-2 MATERIALIZED t2 index s1 s1 6 NULL 2 100.00 Using index
+2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,`test`.`t1`.`s1` in ( <materialize> (/* select#2 */ select `test`.`t2`.`s1` from `test`.`t2` ), <primary_index_lookup>(`test`.`t1`.`s1` in <temporary table> on distinct_key where `test`.`t1`.`s1` = `<subquery2>`.`s1`)))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1`
+Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1`
explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index
-2 MATERIALIZED t2 range s1 s1 6 NULL 1 100.00 Using where; Using index
+2 SUBQUERY t2 index_subquery s1 s1 6 func 2 50.00 Using index; Using where; Full scan on NULL key
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,`test`.`t1`.`s1` in ( <materialize> (/* select#2 */ select `test`.`t2`.`s1` from `test`.`t2` where `test`.`t2`.`s1` < 'a2' ), <primary_index_lookup>(`test`.`t1`.`s1` in <temporary table> on distinct_key where `test`.`t1`.`s1` = `<subquery2>`.`s1`)))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1`
+Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL where `test`.`t2`.`s1` < 'a2' having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1`
drop table t1,t2;
create table t2 (a int, b int not null);
create table t3 (a int);
@@ -1946,9 +1966,9 @@ id text
explain extended select * from t1 where id not in (select id from t1 where id < 8);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 12 100.00 Using where
-2 MATERIALIZED t1 range PRIMARY PRIMARY 4 NULL 7 100.00 Using where; Using index
+2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 100.00 Using index; Using where
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where !<expr_cache><`test`.`t1`.`id`>(<in_optimizer>(`test`.`t1`.`id`,`test`.`t1`.`id` in ( <materialize> (/* select#2 */ select `test`.`t1`.`id` from `test`.`t1` where `test`.`t1`.`id` < 8 ), <primary_index_lookup>(`test`.`t1`.`id` in <temporary table> on distinct_key where `test`.`t1`.`id` = `<subquery2>`.`id`))))
+Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`text` AS `text` from `test`.`t1` where !<expr_cache><`test`.`t1`.`id`>(<in_optimizer>(`test`.`t1`.`id`,<exists>(<primary_index_lookup>(<cache>(`test`.`t1`.`id`) in t1 on PRIMARY where `test`.`t1`.`id` < 8 and <cache>(`test`.`t1`.`id`) = `test`.`t1`.`id`))))
explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY tt ALL NULL NULL NULL NULL 12 100.00 Using where
@@ -2479,19 +2499,22 @@ a
1
3
DROP TABLE t1;
+#
+# SELECT(EXISTS * ...)optimisation
+#
create table t1 (a int, b int);
-insert into t1 values (1,2),(3,4);
-select * from t1 up where exists (select * from t1 where t1.a=up.a);
-a b
-1 2
-3 4
-explain extended select * from t1 up where exists (select * from t1 where t1.a=up.a);
+insert into t1 values (1,2),(3,4),(5,6),(7,8);
+insert into t1 select seq,seq from seq_20_to_40;
+select sum(a+b) from t1 up where exists (select * from t1 where t1.a=up.a);
+sum(a+b)
+1296
+explain extended select sum(a+b) from t1 up where exists (select * from t1 where t1.a=up.a);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY up ALL NULL NULL NULL NULL 2 100.00 Using where
-2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY up ALL NULL NULL NULL NULL 25 100.00 Using where
+2 MATERIALIZED t1 ALL NULL NULL NULL NULL 25 100.00
Warnings:
Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1
-Note 1003 /* select#1 */ select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` where <expr_cache><`test`.`up`.`a`>(<in_optimizer>(`test`.`up`.`a`,`test`.`up`.`a` in ( <materialize> (/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` where 1 ), <primary_index_lookup>(`test`.`up`.`a` in <temporary table> on distinct_key where `test`.`up`.`a` = `<subquery2>`.`a`))))
+Note 1003 /* select#1 */ select sum(`test`.`up`.`a` + `test`.`up`.`b`) AS `sum(a+b)` from `test`.`t1` `up` where <expr_cache><`test`.`up`.`a`>(<in_optimizer>(`test`.`up`.`a`,`test`.`up`.`a` in ( <materialize> (/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` where 1 ), <primary_index_lookup>(`test`.`up`.`a` in <temporary table> on distinct_key where `test`.`up`.`a` = `<subquery2>`.`a`))))
drop table t1;
CREATE TABLE t1 (t1_a int);
INSERT INTO t1 VALUES (1);
@@ -3158,9 +3181,13 @@ retailerID statusID changed
0048 1 2006-01-06 12:37:50
0059 1 2006-01-06 12:37:50
drop table t1;
+#
+# Bug#21180 Subselect with index for both WHERE and ORDER BY
+# produces empty result
+#
create table t1(a int, primary key (a));
insert into t1 values (10);
-create table t2 (a int primary key, b varchar(32), c int, unique key b(c, b));
+create table t2 (a int primary key, b varchar(32), c int, unique key cb(c, b));
insert into t2(a, c, b) values (1,10,'359'), (2,10,'35988'), (3,10,'35989');
insert into t2(a, c, b) values (4,10,'360'), (5,10,'35998'), (6,10,'35999');
analyze table t1;
@@ -3173,7 +3200,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system PRIMARY NULL NULL NULL 1
1 PRIMARY r const PRIMARY PRIMARY 4 const 1
-2 SUBQUERY t2 range b b 40 NULL 3 Using where
+2 SUBQUERY t2 range cb cb 40 NULL 3 Using where
SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r
ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10;
@@ -3185,7 +3212,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system PRIMARY NULL NULL NULL 1
1 PRIMARY r const PRIMARY PRIMARY 4 const 1
-2 SUBQUERY t2 range b b 40 NULL 3 Using index condition
+2 SUBQUERY t2 range cb cb 40 NULL 3 Using index condition
SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r
ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899'
ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10;
@@ -3236,7 +3263,7 @@ INSERT INTO t2 VALUES (1),(2),(3);
EXPLAIN SELECT a, a IN (SELECT a FROM t1) FROM t2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 3
-2 MATERIALIZED t1 index a a 5 NULL 5 Using index
+2 SUBQUERY t1 index_subquery a a 5 func 3 Using index; Full scan on NULL key
SELECT a, a IN (SELECT a FROM t1) FROM t2;
a a IN (SELECT a FROM t1)
1 1
@@ -4278,8 +4305,8 @@ INSERT INTO t2 VALUES (7), (5), (1), (3);
SELECT id, st FROM t1
WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id);
id st
-3 FL
1 GA
+3 FL
7 FL
SELECT id, st FROM t1
WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id)
@@ -4380,6 +4407,9 @@ SELECT ((a1,a2) IN (SELECT * FROM t2 WHERE b2 > 0)) IS NULL FROM t1;
0
0
DROP TABLE t1, t2;
+#
+# Bug#28076 inconsistent binary/varbinary comparison
+#
CREATE TABLE t1 (s1 BINARY(5), s2 VARBINARY(5));
INSERT INTO t1 VALUES (0x41,0x41), (0x42,0x42), (0x43,0x43);
SELECT s1, s2 FROM t1 WHERE s2 IN (SELECT s1 FROM t1);
@@ -4442,7 +4472,7 @@ CREATE INDEX I2 ON t1 (b);
EXPLAIN SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
-2 DEPENDENT SUBQUERY t1 index_subquery I1 I1 2 func 2 Using index; Using where
+2 DEPENDENT SUBQUERY t1 index_subquery I1 I1 2 func 1 Using index; Using where
SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1);
a b
CREATE TABLE t2 (a VARCHAR(1), b VARCHAR(10));
@@ -4452,14 +4482,14 @@ CREATE INDEX I2 ON t2 (b);
EXPLAIN SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
-2 DEPENDENT SUBQUERY t2 index_subquery I1 I1 4 func 2 Using index; Using where
+2 DEPENDENT SUBQUERY t2 index_subquery I1 I1 4 func 1 Using index; Using where
SELECT a,b FROM t2 WHERE b IN (SELECT a FROM t2);
a b
EXPLAIN
SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
-2 DEPENDENT SUBQUERY t1 index_subquery I1 I1 2 func 2 Using index; Using where
+2 DEPENDENT SUBQUERY t1 index_subquery I1 I1 2 func 1 Using index; Using where
SELECT a,b FROM t1 WHERE b IN (SELECT a FROM t1 WHERE LENGTH(a)<500);
a b
DROP TABLE t1,t2;
@@ -4489,10 +4519,13 @@ out_a MIN(b)
1 2
2 4
DROP TABLE t1;
+#
+# Bug#32036 EXISTS within a WHERE clause with a UNION crashes MySQL 5.122
+#
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
-INSERT INTO t1 VALUES (1),(2);
-INSERT INTO t2 VALUES (1),(2);
+INSERT INTO t1 VALUES (1),(2),(3),(4);
+INSERT INTO t2 VALUES (1),(2),(1000);
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
2
2
@@ -4500,8 +4533,8 @@ SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
EXPLAIN EXTENDED
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
Note 1003 /* select#1 */ select 2 AS `2` from `test`.`t1` where <expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,`test`.`t1`.`a` in ( <materialize> (/* select#2 */ select `test`.`t2`.`a` from `test`.`t2` where 1 ), <primary_index_lookup>(`test`.`t1`.`a` in <temporary table> on distinct_key where `test`.`t1`.`a` = `<subquery2>`.`a`))))
@@ -4509,9 +4542,9 @@ EXPLAIN EXTENDED
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION
(SELECT 1 FROM t2 WHERE t1.a = t2.a));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
-2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
-3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 3 100.00 Using where
+3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 3 100.00 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
@@ -4669,7 +4702,7 @@ WHERE outr.int_key NOT IN (SELECT t1.pk FROM t1, t2)
ORDER BY outr.pk;
id select_type table type possible_keys key key_len ref rows Extra
x x outr ALL x x x x x x
-x x t1 index x x x x x x
+x x t1 eq_ref x x x x x x
x x t2 index x x x x x x
# should not crash on debug binaries
SELECT * FROM t2 outr
@@ -5747,7 +5780,8 @@ DROP TABLE IF EXISTS ot1, ot4, it2, it3;
CREATE TABLE t1 (a int) ;
INSERT INTO t1 VALUES (NULL), (1), (NULL), (2);
CREATE TABLE t2 (a int, INDEX idx(a)) ;
-INSERT INTO t2 VALUES (NULL), (1), (NULL);
+INSERT INTO t2 VALUES (NULL), (1), (NULL),(1000);
+insert into t2 select seq from seq_3_to_500;
SELECT * FROM t1
WHERE EXISTS (SELECT a FROM t2 USE INDEX () WHERE t2.a = t1.a);
a
@@ -5757,7 +5791,7 @@ SELECT * FROM t1
WHERE EXISTS (SELECT a FROM t2 USE INDEX() WHERE t2.a = t1.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 502
SELECT * FROM t1
WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a);
a
@@ -5767,7 +5801,7 @@ SELECT * FROM t1
WHERE EXISTS (SELECT a FROM t2 WHERE t2.a = t1.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
-2 MATERIALIZED t2 index idx idx 5 NULL 3 Using index
+2 DEPENDENT SUBQUERY t2 index_subquery idx idx 5 func 58 Using index
DROP TABLE t1,t2;
#
# BUG#752992: Wrong results for a subquery with 'semijoin=on'
@@ -5785,8 +5819,8 @@ SET join_cache_level=0;
EXPLAIN SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where
-2 MATERIALIZED t2 index NULL PRIMARY 4 NULL 3 Using index
-2 MATERIALIZED it index PRIMARY PRIMARY 4 NULL 3 Using index
+2 DEPENDENT SUBQUERY it eq_ref PRIMARY PRIMARY 4 func 1 Using index
+2 DEPENDENT SUBQUERY t2 index NULL PRIMARY 4 NULL 3 Using index
SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1);
pk i
11 0
@@ -6127,7 +6161,7 @@ WHERE col_varchar_nokey IN
(SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY ot system NULL NULL NULL NULL 1
-2 DEPENDENT SUBQUERY it1 index_subquery idx_cvk_cik idx_cvk_cik 9 func,const 2 Using index; Using where
+2 DEPENDENT SUBQUERY it1 index_subquery idx_cvk_cik idx_cvk_cik 9 func,const 1 Using index; Using where
SELECT col_int_nokey FROM ot
WHERE col_varchar_nokey IN
(SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL);
@@ -6709,7 +6743,7 @@ SET @@optimizer_switch='semijoin=off,materialization=off,in_to_exists=on,subquer
EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL a 4 NULL 2 Using where; Using index
-2 DEPENDENT SUBQUERY t1 index_subquery a a 4 func 2 Using index
+2 DEPENDENT SUBQUERY t1 index_subquery a a 4 func 1 Using index
SELECT * FROM t1 WHERE a IN (SELECT a AS field1 FROM t1 GROUP BY field1);
a
2009-01-01
@@ -6914,7 +6948,7 @@ FROM t1 AS alias1, t1 AS alias2, t1 AS alias3
WHERE alias1.a = alias2.a OR ('Moscow') IN ( SELECT a FROM t1 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias1 index a a 19 NULL 11 Using where; Using index
-1 PRIMARY alias2 ref a a 19 test.alias1.a 2 Using index
+1 PRIMARY alias2 ref a a 19 test.alias1.a 1 Using index
1 PRIMARY alias3 index NULL a 19 NULL 11 Using index; Using join buffer (flat, BNL join)
2 SUBQUERY t1 index_subquery a a 19 const 1 Using index; Using where
SELECT MAX( alias2.a )
@@ -7073,7 +7107,7 @@ WHERE SLEEP(0.1) OR c < 'p' OR b = ( SELECT MIN(b) FROM t2 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
1 PRIMARY t2 ALL b NULL NULL NULL 2 Using where
-1 PRIMARY t3 ref d d 5 test.t2.b 2 Using index
+1 PRIMARY t3 ref d d 5 test.t2.b 1 Using index
3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
set @tmp_mdev410=@@global.userstat;
set global userstat=on;
@@ -7105,7 +7139,7 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP B
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
-2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
+2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index
DROP TABLE t1,t2;
#
# MDEV-435: Expensive subqueries may be evaluated during optimization in merge_key_fields
@@ -7139,7 +7173,7 @@ EXPLAIN SELECT * FROM t1 WHERE EXISTS ( SELECT a FROM t1, t2 WHERE b = a GROUP B
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index
-2 SUBQUERY t2 ref b b 5 test.t1.a 2 Using index
+2 SUBQUERY t2 ref b b 5 test.t1.a 1 Using index
DROP TABLE t1,t2;
#
# MDEV-5991: crash in Item_field::used_tables
@@ -7553,6 +7587,48 @@ drop table t1, t2, t3;
# End of 10.6 tests
#
#
+# MDEV-32656: ASAN errors in base_list_iterator::next /
+# setup_table_map upon 2nd execution of PS
+# (10.10 part)
+#
+CREATE TABLE t1 (id BIGINT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE TABLE t2 (a INT);
+INSERT INTO t2 VALUES (2),(3);
+CREATE TABLE t3 (b INT);
+INSERT INTO t3 VALUES (3),(4);
+PREPARE stmt FROM "UPDATE t2 SET a = 1 WHERE (select 1 where ('e','e') IN (SELECT v1.id, v1.id FROM v1 JOIN t3)) <> 0";
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+PREPARE stmt FROM "UPDATE t2 SET a = 1 WHERE ('e') IN (SELECT v1.id FROM v1 JOIN t3)";
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+PREPARE stmt FROM "UPDATE t2 SET a = 1 WHERE ('e','e') IN (SELECT v1.id, v1.id FROM v1 JOIN t3)";
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+EXECUTE stmt;
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+Warning 1292 Truncated incorrect DECIMAL value: 'e'
+DROP VIEW v1;
+DROP TABLE t1, t2, t3;
+#
+# End of 10.10 tests
+#
+#
# MDEV-19714: JOIN::pseudo_bits_cond is not visible in EXPLAIN FORMAT=JSON
#
CREATE TABLE t1 ( a INT );
@@ -7569,12 +7645,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -7598,12 +7677,15 @@ EXPLAIN
{
"query_block": {
"select_id": 3,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "1 = t3.c"
}
diff --git a/mysql-test/main/subselect_no_semijoin.test b/mysql-test/main/subselect_no_semijoin.test
index 84d312c0..83488829 100644
--- a/mysql-test/main/subselect_no_semijoin.test
+++ b/mysql-test/main/subselect_no_semijoin.test
@@ -24,6 +24,7 @@ INSERT INTO t3 VALUES (4),(5);
SET @tmp19714=@@optimizer_switch;
SET optimizer_switch='subquery_cache=off';
+--source include/explain-no-costs.inc
explain format=json
SELECT ( SELECT b FROM t2 WHERE b = a OR EXISTS ( SELECT c FROM t3 WHERE c = b ) ) FROM t1;
diff --git a/mysql-test/main/subselect_partial_match.result b/mysql-test/main/subselect_partial_match.result
index 52c30492..16a48744 100644
--- a/mysql-test/main/subselect_partial_match.result
+++ b/mysql-test/main/subselect_partial_match.result
@@ -760,20 +760,19 @@ drop table t1,t2;
# LP BUG#601156
#
CREATE TABLE t1 (a1 int DEFAULT NULL, a2 int DEFAULT NULL);
-INSERT INTO t1 VALUES (NULL,2);
-INSERT INTO t1 VALUES (4,NULL);
+INSERT INTO t1 VALUES (NULL,2), (4,NULL),(100,100);
CREATE TABLE t2 (b1 int DEFAULT NULL, b2 int DEFAULT NULL);
-INSERT INTO t2 VALUES (6,NULL);
-INSERT INTO t2 VALUES (NULL,0);
+INSERT INTO t2 VALUES (6,NULL), (NULL,0),(1000,1000);
+insert into t2 select seq,seq from seq_2000_to_2100;
set @@optimizer_switch='materialization=on,semijoin=off,partial_match_rowid_merge=on,partial_match_table_scan=on';
set @tmp_optimizer_switch=@@optimizer_switch;
set optimizer_switch='derived_merge=off,derived_with_keys=off';
EXPLAIN EXTENDED
SELECT * FROM (SELECT * FROM t1 WHERE a1 NOT IN (SELECT b2 FROM t2)) table1;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 100.00
-2 DERIVED t1 ALL NULL NULL NULL NULL 2 100.00 Using where
-3 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 100.00
+2 DERIVED t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+3 MATERIALIZED t2 ALL NULL NULL NULL NULL 104 100.00
Warnings:
Note 1003 /* select#1 */ select `table1`.`a1` AS `a1`,`table1`.`a2` AS `a2` from (/* select#2 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where !(<in_optimizer>(`test`.`t1`.`a1`,`test`.`t1`.`a1` in ( <materialize> (/* select#3 */ select `test`.`t2`.`b2` from `test`.`t2` ), <primary_index_lookup>(`test`.`t1`.`a1` in <temporary table> on distinct_key where `test`.`t1`.`a1` = `<subquery3>`.`b2`))))) `table1`
set optimizer_switch=@tmp_optimizer_switch;
@@ -782,12 +781,13 @@ DROP TABLE t1, t2;
# LP BUG#613009 Crash in Ordered_key::get_field_idx
#
set @@optimizer_switch='materialization=on,semijoin=off,partial_match_rowid_merge=on,partial_match_table_scan=off';
-create table t1 (a1 char(3) DEFAULT NULL, a2 char(3) DEFAULT NULL);
-insert into t1 values (NULL, 'a21'), (NULL, 'a22');
+create table t1 (a1 char(4) DEFAULT NULL, a2 char(4) DEFAULT NULL);
+insert into t1 values (NULL, 'a21'), (NULL, 'a22'), ('xxx','xxx');
+insert into t1 select seq,seq from seq_2000_to_2100;
explain select * from t1 where (a1, a2) not in (select a1, a2 from t1);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
-2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2
+1 PRIMARY t1 ALL NULL NULL NULL NULL 104 Using where
+2 MATERIALIZED t1 ALL NULL NULL NULL NULL 104
select * from t1 where (a1, a2) not in (select a1, a2 from t1);
a1 a2
drop table t1;
diff --git a/mysql-test/main/subselect_partial_match.test b/mysql-test/main/subselect_partial_match.test
index fd1e6de7..9a32ef54 100644
--- a/mysql-test/main/subselect_partial_match.test
+++ b/mysql-test/main/subselect_partial_match.test
@@ -2,6 +2,7 @@
# Tests for
# MWL#68: Subquery optimization: Efficient NOT IN execution with NULLs
#
+--source include/have_sequence.inc
set @save_optimizer_switch=@@optimizer_switch;
@@ -614,11 +615,11 @@ drop table t1,t2;
--echo #
CREATE TABLE t1 (a1 int DEFAULT NULL, a2 int DEFAULT NULL);
-INSERT INTO t1 VALUES (NULL,2);
-INSERT INTO t1 VALUES (4,NULL);
+INSERT INTO t1 VALUES (NULL,2), (4,NULL),(100,100);
CREATE TABLE t2 (b1 int DEFAULT NULL, b2 int DEFAULT NULL);
-INSERT INTO t2 VALUES (6,NULL);
-INSERT INTO t2 VALUES (NULL,0);
+INSERT INTO t2 VALUES (6,NULL), (NULL,0),(1000,1000);
+
+insert into t2 select seq,seq from seq_2000_to_2100;
set @@optimizer_switch='materialization=on,semijoin=off,partial_match_rowid_merge=on,partial_match_table_scan=on';
@@ -636,8 +637,9 @@ DROP TABLE t1, t2;
set @@optimizer_switch='materialization=on,semijoin=off,partial_match_rowid_merge=on,partial_match_table_scan=off';
-create table t1 (a1 char(3) DEFAULT NULL, a2 char(3) DEFAULT NULL);
-insert into t1 values (NULL, 'a21'), (NULL, 'a22');
+create table t1 (a1 char(4) DEFAULT NULL, a2 char(4) DEFAULT NULL);
+insert into t1 values (NULL, 'a21'), (NULL, 'a22'), ('xxx','xxx');
+insert into t1 select seq,seq from seq_2000_to_2100;
explain select * from t1 where (a1, a2) not in (select a1, a2 from t1);
select * from t1 where (a1, a2) not in (select a1, a2 from t1);
drop table t1;
diff --git a/mysql-test/main/subselect_sj.result b/mysql-test/main/subselect_sj.result
index b69471ed..054c7135 100644
--- a/mysql-test/main/subselect_sj.result
+++ b/mysql-test/main/subselect_sj.result
@@ -76,24 +76,24 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t10` join `test`.`t12` join `test`.`t1` where `test`.`t12`.`pk` = `test`.`t10`.`a` and `test`.`t10`.`pk` = `test`.`t1`.`a`
subqueries within outer joins go into ON expr.
-explAin extended
+explain extended
select * from t1 left join (t2 A, t2 B) on ( A.A= t1.A And B.A in (select pk from t10));
-id select_type tABle type possiBle_keys key key_len ref rows filtered ExtrA
+id select_type table type possible_keys key key_len ref rows filtered ExtrA
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00
1 PRIMARY A ALL NULL NULL NULL NULL 3 100.00 Using where
1 PRIMARY B ALL NULL NULL NULL NULL 3 100.00 Using where
-2 MATERIALIZED t10 index PRIMARY PRIMARY 4 NULL 10 100.00 Using index
+2 DEPENDENT SUBQUERY t10 unique_suBquery PRIMARY PRIMARY 4 func 1 100.00 Using index
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`A`.`A` AS `A`,`test`.`A`.`B` AS `B`,`test`.`B`.`A` AS `A`,`test`.`B`.`B` AS `B` from `test`.`t1` left join (`test`.`t2` `A` join `test`.`t2` `B`) on(`test`.`A`.`A` = `test`.`t1`.`A` And <in_optimizer>(`test`.`B`.`A`,`test`.`B`.`A` in ( <mAteriAlize> (/* select#2 */ select `test`.`t10`.`pk` from `test`.`t10` ), <primAry_index_lookup>(`test`.`B`.`A` in <temporAry tABle> on distinct_key where `test`.`B`.`A` = `<suBquery2>`.`pk`)))) where 1
+Note 1003 /* select#1 */ select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`A`.`A` AS `A`,`test`.`A`.`B` AS `B`,`test`.`B`.`A` AS `A`,`test`.`B`.`B` AS `B` from `test`.`t1` left join (`test`.`t2` `A` join `test`.`t2` `B`) on(`test`.`A`.`A` = `test`.`t1`.`A` And <in_optimizer>(`test`.`B`.`A`,<exists>(<primAry_index_lookup>(<cAche>(`test`.`B`.`A`) in t10 on PRIMARY)))) where 1
t2 should be wrapped into OJ-nest, so we have "t1 LJ (t2 J t10)"
-explAin extended
+explain extended
select * from t1 left join t2 on (t2.A= t1.A And t2.A in (select pk from t10));
-id select_type tABle type possiBle_keys key key_len ref rows filtered ExtrA
+id select_type table type possible_keys key key_len ref rows filtered ExtrA
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00
1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Using where
-2 MATERIALIZED t10 index PRIMARY PRIMARY 4 NULL 10 100.00 Using index
+2 DEPENDENT SUBQUERY t10 unique_suBquery PRIMARY PRIMARY 4 func 1 100.00 Using index
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`t2`.`A` AS `A`,`test`.`t2`.`B` AS `B` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`A` = `test`.`t1`.`A` And <in_optimizer>(`test`.`t1`.`A`,`test`.`t1`.`A` in ( <mAteriAlize> (/* select#2 */ select `test`.`t10`.`pk` from `test`.`t10` ), <primAry_index_lookup>(`test`.`t1`.`A` in <temporAry tABle> on distinct_key where `test`.`t1`.`A` = `<suBquery2>`.`pk`)))) where 1
+Note 1003 /* select#1 */ select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`t2`.`A` AS `A`,`test`.`t2`.`B` AS `B` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`A` = `test`.`t1`.`A` And <in_optimizer>(`test`.`t1`.`A`,<exists>(<primAry_index_lookup>(<cAche>(`test`.`t2`.`A`) in t10 on PRIMARY)))) where 1
set @save_join_buffer_size=@@join_buffer_size;
set join_buffer_size=8*1024;
we shouldn't flatten if we're going to get a join of > MAX_TABLES.
@@ -160,26 +160,26 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY s47 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
1 PRIMARY s48 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
1 PRIMARY s49 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY m00 ALL NULL NULL NULL NULL 3 Using where
-2 DEPENDENT SUBQUERY m01 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY m02 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY m03 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY m04 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY m05 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY m06 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY m07 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY m08 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY m09 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY m10 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY m11 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY m12 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY m13 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY m14 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY m15 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY m16 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY m17 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY m18 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY m19 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
+2 MATERIALIZED m00 ALL NULL NULL NULL NULL 3
+2 MATERIALIZED m01 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
+2 MATERIALIZED m02 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
+2 MATERIALIZED m03 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
+2 MATERIALIZED m04 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
+2 MATERIALIZED m05 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
+2 MATERIALIZED m06 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
+2 MATERIALIZED m07 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
+2 MATERIALIZED m08 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
+2 MATERIALIZED m09 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
+2 MATERIALIZED m10 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
+2 MATERIALIZED m11 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
+2 MATERIALIZED m12 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
+2 MATERIALIZED m13 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
+2 MATERIALIZED m14 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
+2 MATERIALIZED m15 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
+2 MATERIALIZED m16 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
+2 MATERIALIZED m17 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
+2 MATERIALIZED m18 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
+2 MATERIALIZED m19 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
select * from
t1 left join t2 on (t2.a= t1.a and t2.a in (select pk from t10))
where t1.a < 5;
@@ -344,8 +344,8 @@ WHERE PNUM IN
(SELECT PNUM FROM PROJ));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY STAFF ALL NULL NULL NULL NULL 5
-1 PRIMARY PROJ ALL NULL NULL NULL NULL 6
-1 PRIMARY WORKS ALL NULL NULL NULL NULL 12 Using where; FirstMatch(STAFF)
+1 PRIMARY PROJ ALL NULL NULL NULL NULL 6 Start temporary
+1 PRIMARY WORKS ALL NULL NULL NULL NULL 12 Using where; End temporary
SELECT EMPNUM, EMPNAME
FROM STAFF
WHERE EMPNUM IN
@@ -502,7 +502,7 @@ EXPLAIN EXTENDED SELECT vkey FROM t0 WHERE pk IN
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t0 ALL PRIMARY NULL NULL NULL 5 100.00
1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t0.pk 1 100.00 Using where
-1 PRIMARY t2 ref vkey vkey 4 test.t1.vnokey 2 100.00 Using index; FirstMatch(t1)
+1 PRIMARY t2 ref vkey vkey 4 test.t1.vnokey 1 100.00 Using index; FirstMatch(t1)
Warnings:
Note 1003 select `test`.`t0`.`vkey` AS `vkey` from `test`.`t0` `t1` semi join (`test`.`t0` `t2`) join `test`.`t0` where `test`.`t1`.`pk` = `test`.`t0`.`pk` and `test`.`t2`.`vkey` = `test`.`t1`.`vnokey`
SELECT vkey FROM t0 WHERE pk IN
@@ -763,16 +763,16 @@ explain extended
select a from t1
where a in (select c from t2 where d >= some(select e from t3 where b=e));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 7 100.00
-1 PRIMARY t2 ALL NULL NULL NULL NULL 6 100.00 Using where; FirstMatch(t1)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 6 100.00 Start temporary
+1 PRIMARY t1 ALL NULL NULL NULL NULL 7 16.67 Using where; End temporary; Using join buffer (flat, BNL join)
3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 4 100.00 Using where
Warnings:
Note 1276 Field or reference 'test.t1.b' of SELECT #3 was resolved in SELECT #1
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`c` = `test`.`t1`.`a` and <nop>(<expr_cache><`test`.`t2`.`d`,`test`.`t1`.`b`>(<in_optimizer>(`test`.`t2`.`d`,<exists>(/* select#3 */ select `test`.`t3`.`e` from `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`e` and <cache>(`test`.`t2`.`d`) >= `test`.`t3`.`e`))))
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t1`.`a` = `test`.`t2`.`c` and <nop>(<expr_cache><`test`.`t2`.`d`,`test`.`t1`.`b`>(<in_optimizer>(`test`.`t2`.`d`,<exists>(/* select#3 */ select `test`.`t3`.`e` from `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`e` and <cache>(`test`.`t2`.`d`) >= `test`.`t3`.`e`))))
show warnings;
Level Code Message
Note 1276 Field or reference 'test.t1.b' of SELECT #3 was resolved in SELECT #1
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`c` = `test`.`t1`.`a` and <nop>(<expr_cache><`test`.`t2`.`d`,`test`.`t1`.`b`>(<in_optimizer>(`test`.`t2`.`d`,<exists>(/* select#3 */ select `test`.`t3`.`e` from `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`e` and <cache>(`test`.`t2`.`d`) >= `test`.`t3`.`e`))))
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t1`.`a` = `test`.`t2`.`c` and <nop>(<expr_cache><`test`.`t2`.`d`,`test`.`t1`.`b`>(<in_optimizer>(`test`.`t2`.`d`,<exists>(/* select#3 */ select `test`.`t3`.`e` from `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`e` and <cache>(`test`.`t2`.`d`) >= `test`.`t3`.`e`))))
select a from t1
where a in (select c from t2 where d >= some(select e from t3 where b=e));
a
@@ -802,20 +802,20 @@ PRIMARY KEY (pk)
INSERT INTO t1 VALUES (1,'o','ffff','ffff','ffoo','ffff','ffff','ffff','ffff','ffff','ffff',GeomFromText('POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))')), (2,'f','ffff','ffff','ffff', 'ffff','ffff','ffff','ffff','ffff','ffff',GeomFromText('POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))'));
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES (1,'i','iiii','iiii','iiii','iiii','ffff','ffff','ffff','ffff','ffff',GeomFromText('POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))')), (2,'f','ffff','ffff','ffff','ffff','ffff','ffff','ffff','ffff','ffff',GeomFromText('POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))'));
+insert into t2 (pk) values (-1),(0);
EXPLAIN EXTENDED SELECT pk FROM t1 WHERE (a, b) IN (SELECT a, b FROM t2 WHERE pk > 0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 11 func,func 1 100.00
-2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan
+1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 50.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1)
Warnings:
-Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`pk` > 0
+Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`pk` > 0
SELECT pk FROM t1 WHERE (a, b) IN (SELECT a, b FROM t2 WHERE pk > 0);
pk
2
EXPLAIN EXTENDED SELECT pk FROM t1 WHERE (b, c) IN (SELECT b, c FROM t2 WHERE pk > 0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1)
+1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 50.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`c` = `test`.`t1`.`c` and `test`.`t2`.`pk` > 0
SELECT pk FROM t1 WHERE (b, c) IN (SELECT b, c FROM t2 WHERE pk > 0);
@@ -825,7 +825,7 @@ pk
EXPLAIN EXTENDED SELECT pk FROM t1 WHERE (b, d) IN (SELECT b, d FROM t2 WHERE pk > 0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1)
+1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 50.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`d` = `test`.`t1`.`d` and `test`.`t2`.`pk` > 0
SELECT pk FROM t1 WHERE (b, d) IN (SELECT b, d FROM t2 WHERE pk > 0);
@@ -834,7 +834,7 @@ pk
EXPLAIN EXTENDED SELECT pk FROM t1 WHERE (b, e) IN (SELECT b, e FROM t2 WHERE pk > 0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1)
+1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 50.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`e` = `test`.`t1`.`e` and `test`.`t2`.`pk` > 0
SELECT pk FROM t1 WHERE (b, e) IN (SELECT b, e FROM t2 WHERE pk > 0);
@@ -844,7 +844,7 @@ pk
EXPLAIN EXTENDED SELECT pk FROM t1 WHERE (b, f) IN (SELECT b, f FROM t2 WHERE pk > 0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1)
+1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 50.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`f` = `test`.`t1`.`f` and `test`.`t2`.`pk` > 0
SELECT pk FROM t1 WHERE (b, f) IN (SELECT b, f FROM t2 WHERE pk > 0);
@@ -854,7 +854,7 @@ pk
EXPLAIN EXTENDED SELECT pk FROM t1 WHERE (b, g) IN (SELECT b, g FROM t2 WHERE pk > 0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1)
+1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 50.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`g` = `test`.`t1`.`g` and `test`.`t2`.`pk` > 0
SELECT pk FROM t1 WHERE (b, g) IN (SELECT b, g FROM t2 WHERE pk > 0);
@@ -864,7 +864,7 @@ pk
EXPLAIN EXTENDED SELECT pk FROM t1 WHERE (b, h) IN (SELECT b, h FROM t2 WHERE pk > 0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1)
+1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 50.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`h` = `test`.`t1`.`h` and `test`.`t2`.`pk` > 0
SELECT pk FROM t1 WHERE (b, h) IN (SELECT b, h FROM t2 WHERE pk > 0);
@@ -874,7 +874,7 @@ pk
EXPLAIN EXTENDED SELECT pk FROM t1 WHERE (b, i) IN (SELECT b, i FROM t2 WHERE pk > 0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1)
+1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 50.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`i` = `test`.`t1`.`i` and `test`.`t2`.`pk` > 0
SELECT pk FROM t1 WHERE (b, i) IN (SELECT b, i FROM t2 WHERE pk > 0);
@@ -884,7 +884,7 @@ pk
EXPLAIN EXTENDED SELECT pk FROM t1 WHERE (b, j) IN (SELECT b, j FROM t2 WHERE pk > 0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1)
+1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 50.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`j` = `test`.`t1`.`j` and `test`.`t2`.`pk` > 0
SELECT pk FROM t1 WHERE (b, j) IN (SELECT b, j FROM t2 WHERE pk > 0);
@@ -894,7 +894,7 @@ pk
EXPLAIN EXTENDED SELECT pk FROM t1 WHERE (b, k) IN (SELECT b, k FROM t2 WHERE pk > 0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1)
+1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 50.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`k` = `test`.`t1`.`k` and `test`.`t2`.`pk` > 0
SELECT pk FROM t1 WHERE (b, k) IN (SELECT b, k FROM t2 WHERE pk > 0);
@@ -1249,8 +1249,8 @@ INSERT INTO t2 VALUES (1, 0), (1, 1), (2, 0), (2, 1);
EXPLAIN
SELECT * FROM t1 WHERE (i) IN (SELECT i FROM t2 where j > 0);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 index k k 10 NULL 4 Using where; Using index; Start temporary
-1 PRIMARY t1 ALL NULL NULL NULL NULL 5 Using where; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 Using where
+1 PRIMARY t2 ref k k 5 test.t1.i 1 Using where; Using index; Start temporary; End temporary
SELECT * FROM t1 WHERE (i) IN (SELECT i FROM t2 where j > 0);
i
1
@@ -1612,7 +1612,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY A index PRIMARY PRIMARY 4 NULL 3 Using index
1 PRIMARY C eq_ref PRIMARY PRIMARY 4 test.A.t1field 1 Using index
1 PRIMARY D eq_ref PRIMARY PRIMARY 4 test.A.t1field 1 Using index
-1 PRIMARY B index NULL PRIMARY 4 NULL 3 Using index; Start temporary; End temporary
+1 PRIMARY B index NULL PRIMARY 4 NULL 3 Using index; FirstMatch(D)
SELECT * FROM t1 A
WHERE
A.t1field IN (SELECT A.t1field FROM t2 B) AND
@@ -1626,7 +1626,7 @@ drop table t1,t2;
# BUG#787299: Valgrind complains on a join query with two IN subqueries
#
create table t1 (a int);
-insert into t1 values (1), (2), (3);
+insert into t1 values (1), (2), (3),(1000),(2000);
create table t2 as select * from t1;
select * from t1 A, t1 B
where A.a = B.a and A.a in (select a from t2 C) and B.a in (select a from t2 D);
@@ -1634,16 +1634,18 @@ a a
1 1
2 2
3 3
+1000 1000
+2000 2000
explain
select * from t1 A, t1 B
where A.a = B.a and A.a in (select a from t2 C) and B.a in (select a from t2 D);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY A ALL NULL NULL NULL NULL 3
+1 PRIMARY A ALL NULL NULL NULL NULL 5
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-1 PRIMARY B ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY B ALL NULL NULL NULL NULL 5 Using where; Using join buffer (flat, BNL join)
1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED C ALL NULL NULL NULL NULL 3
-3 MATERIALIZED D ALL NULL NULL NULL NULL 3
+2 MATERIALIZED C ALL NULL NULL NULL NULL 5
+3 MATERIALIZED D ALL NULL NULL NULL NULL 5
drop table t1, t2;
#
# BUG#784441: Abort on semijoin with a view as the inner table
@@ -1980,7 +1982,7 @@ f1 f3 f4 f2 f4
DROP TABLE t1,t2,t3;
#
# BUG#803457: Wrong result with semijoin + view + outer join in maria-5.3-subqueries-mwl90
-# (Original testcase)
+# (Original, slightly modified testcase)
#
CREATE TABLE t1 (f1 int, f2 int );
INSERT INTO t1 VALUES (2,0),(4,0),(0,NULL);
@@ -1990,24 +1992,22 @@ CREATE TABLE t3 ( f1 int, f3 int );
INSERT INTO t3 VALUES (2,0),(4,0),(0,NULL),(4,0),(8,0);
CREATE TABLE t4 ( f2 int, KEY (f2) );
INSERT INTO t4 VALUES (0),(NULL);
-CREATE VIEW v4 AS SELECT DISTINCT f2 FROM t4 ;
+INSERT INTO t4 VALUES (0),(NULL),(-1),(-2),(-3);
# The following must not have outer joins:
explain extended
-SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4);
+SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4 where f2 = 0 or f2 IS NULL);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+1 PRIMARY t4 ref_or_null f2 f2 5 const 4 25.00 Using where; Using index; FirstMatch(t2)
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
-2 MATERIALIZED t4 index f2 f2 5 NULL 2 100.00 Using index
Warnings:
-Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2`,`test`.`t2`.`f3` AS `f3`,`test`.`t3`.`f3` AS `f3` from `test`.`t1` semi join (`test`.`t4`) join `test`.`t2` join `test`.`t3` where `test`.`t3`.`f1` = `test`.`t1`.`f1` and `test`.`t1`.`f2` = `test`.`t2`.`f2`
-SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4);
+Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2`,`test`.`t2`.`f3` AS `f3`,`test`.`t3`.`f3` AS `f3` from `test`.`t1` semi join (`test`.`t4`) join `test`.`t2` join `test`.`t3` where `test`.`t4`.`f2` = `test`.`t2`.`f3` and `test`.`t3`.`f1` = `test`.`t1`.`f1` and `test`.`t1`.`f2` = `test`.`t2`.`f2` and (`test`.`t2`.`f3` = 0 or `test`.`t2`.`f3` is null)
+SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4 where f2 = 0 or f2 IS NULL);
f1 f2 f3 f3
2 0 0 0
4 0 0 0
4 0 0 0
-drop view v4;
drop table t1, t2, t3, t4;
#
# BUG#803303: Wrong result with semijoin=on, outer join in maria-5.3-subqueries-mwl90
@@ -2153,9 +2153,9 @@ INSERT INTO t3 VALUES (6,5),(6,2),(8,0),(9,1),(6,5);
explain
SELECT * FROM t1, t2 WHERE (t2.a , t1.b) IN (SELECT a, b FROM t3);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2
-1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 2 Using index; Using join buffer (flat, BNL join)
-1 PRIMARY t3 ALL b NULL NULL NULL 5 Using where; Start temporary; End temporary
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
+1 PRIMARY t3 ref b b 5 test.t1.b 1 Using where; Start temporary
+1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 Using index; End temporary
SELECT * FROM t1, t2 WHERE (t2.a , t1.b) IN (SELECT a, b FROM t3);
b a
5 6
@@ -2178,10 +2178,10 @@ INSERT INTO t5 VALUES (7,0),(9,0);
explain
SELECT * FROM t3 WHERE t3.a IN (SELECT t5.a FROM t2, t4, t5 WHERE t2.c = t5.a AND t2.b = t5.b);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t5 index a a 10 NULL 2 Using where; Using index; LooseScan
-1 PRIMARY t2 ref b b 5 test.t5.b 2 Using where
-1 PRIMARY t4 ALL NULL NULL NULL NULL 3 FirstMatch(t5)
-1 PRIMARY t3 ALL NULL NULL NULL NULL 15 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t5 index a a 10 NULL 2 Using where; Using index; Start temporary
+1 PRIMARY t2 ref b b 5 test.t5.b 1 Using where
+1 PRIMARY t4 ALL NULL NULL NULL NULL 3
+1 PRIMARY t3 ALL NULL NULL NULL NULL 15 Using where; End temporary; Using join buffer (flat, BNL join)
SELECT * FROM t3 WHERE t3.a IN (SELECT t5.a FROM t2, t4, t5 WHERE t2.c = t5.a AND t2.b = t5.b);
a
0
@@ -2260,10 +2260,10 @@ alias1.c IN (SELECT SQ3_alias1.b
FROM t2 AS SQ3_alias1 STRAIGHT_JOIN t2 AS SQ3_alias2)
LIMIT 100;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 20
-1 PRIMARY alias2 ALL NULL NULL NULL NULL 20 Using join buffer (flat, BNL join)
+1 PRIMARY alias2 ALL NULL NULL NULL NULL 20
1 PRIMARY t2 ALL NULL NULL NULL NULL 20 Using join buffer (flat, BNL join)
-1 PRIMARY SQ3_alias1 ALL NULL NULL NULL NULL 20 Using where; Start temporary
+1 PRIMARY SQ3_alias1 ALL NULL NULL NULL NULL 20 Start temporary
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 20 Using where; Using join buffer (flat, BNL join)
1 PRIMARY SQ3_alias2 index NULL PRIMARY 4 NULL 20 Using index; End temporary
2 DERIVED t2 ALL NULL NULL NULL NULL 20
create table t3 as
@@ -2436,9 +2436,9 @@ SET SESSION optimizer_switch='loosescan=off';
EXPLAIN
SELECT * FROM t1 WHERE a IN (SELECT t2.a FROM t2,t3 WHERE t2.b = t3.b);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 index idx idx 9 NULL 2 Using where; Using index; Start temporary
-1 PRIMARY t3 ref idx idx 4 test.t2.b 1 Using index
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4
+1 PRIMARY t2 range idx idx 4 NULL 2 Using where; Using index
+1 PRIMARY t3 ref idx idx 4 test.t2.b 1 Using index; FirstMatch(t1)
SELECT * FROM t1 WHERE a IN (SELECT t2.a FROM t2,t3 WHERE t2.b = t3.b);
a
5
@@ -2446,9 +2446,9 @@ SET SESSION optimizer_switch='loosescan=on';
EXPLAIN
SELECT * FROM t1 WHERE a IN (SELECT t2.a FROM t2,t3 WHERE t2.b = t3.b);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 index idx idx 9 NULL 2 Using where; Using index; Start temporary
-1 PRIMARY t3 ref idx idx 4 test.t2.b 1 Using index
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4
+1 PRIMARY t2 range idx idx 4 NULL 2 Using where; Using index
+1 PRIMARY t3 ref idx idx 4 test.t2.b 1 Using index; FirstMatch(t1)
SELECT * FROM t1 WHERE a IN (SELECT t2.a FROM t2,t3 WHERE t2.b = t3.b);
a
5
@@ -2499,10 +2499,9 @@ SELECT * FROM t1, t2
WHERE t1.a = t2.a AND t2.a IN (SELECT b FROM t3 STRAIGHT_JOIN t4);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 system NULL NULL NULL NULL 1
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 1
1 PRIMARY t1 ref a a 5 const 1 Using index
1 PRIMARY t2 ref a a 5 func 1 Using index
-2 MATERIALIZED t4 ALL NULL NULL NULL NULL 0
+1 PRIMARY t4 ALL NULL NULL NULL NULL 0 FirstMatch(t2); Using join buffer (flat, BNL join)
SELECT * FROM t1, t2
WHERE t1.a = t2.a AND t2.a IN (SELECT b FROM t3 STRAIGHT_JOIN t4);
a a
@@ -2562,7 +2561,7 @@ INSERT INTO t1 VALUES
(6,3),(7,1),(8,4),(9,3),(10,2);
CREATE TABLE t2 ( c INT, d INT, KEY(c) );
INSERT INTO t2 VALUES
-(1,2),(2,1),(3,3),(4,2),(5,5),(6,3),(7,1);
+(1,2),(2,1),(3,3),(4,2),(5,5),(6,3),(7,1),(11,11);
analyze table t1,t2;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
@@ -2572,35 +2571,35 @@ test.t2 analyze status OK
explain
SELECT a, b, d FROM t1, t2
WHERE ( b, d ) IN
-( SELECT b, d FROM t1, t2 WHERE b = c );
+( SELECT b, d FROM t1 as t3, t2 as t4 WHERE b = c );
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 ALL NULL NULL NULL NULL 7
-1 PRIMARY t1 index b b 5 NULL 10 Using where; Using index; LooseScan
-1 PRIMARY t2 ref c c 5 test.t1.b 1 Using where; FirstMatch(t1)
-1 PRIMARY t1 ref b b 5 test.t1.b 2
+1 PRIMARY t3 index b b 5 NULL 10 Using where; Using index; Start temporary
+1 PRIMARY t4 ref c c 5 test.t3.b 1
+1 PRIMARY t1 ALL b NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 8 Using where; End temporary; Using join buffer (flat, BNL join)
SELECT a, b, d FROM t1, t2
WHERE ( b, d ) IN
-( SELECT b, d FROM t1, t2 WHERE b = c );
+( SELECT b, d FROM t1 as t3, t2 as t4 WHERE b = c );
a b d
-2 1 2
-7 1 2
-8 4 2
1 2 1
-4 2 1
+1 2 1
10 2 1
+10 2 1
+2 1 2
+2 1 2
3 3 3
+3 3 3
+4 2 1
+4 2 1
+5 5 5
6 3 3
-9 3 3
-2 1 2
+6 3 3
+7 1 2
7 1 2
8 4 2
-5 5 5
-3 3 3
-6 3 3
+8 4 2
+9 3 3
9 3 3
-1 2 1
-4 2 1
-10 2 1
DROP TABLE t1, t2;
# Another testcase for the above that still uses LooseScan:
create table t0(a int primary key);
@@ -2769,21 +2768,21 @@ WHERE (t1_1.a, t1_2.a) IN ( SELECT a, b FROM v1 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1_1 ALL NULL NULL NULL NULL 11 Using where
1 PRIMARY t1_2 ALL NULL NULL NULL NULL 11
-1 PRIMARY <derived3> ref key0 key0 5 test.t1_1.a 2 Using where; FirstMatch(t1_2)
+1 PRIMARY <derived3> ref key0 key0 5 test.t1_1.a 1 Using where; FirstMatch(t1_2)
3 DERIVED t1 ALL NULL NULL NULL NULL 11
SELECT * FROM t1 AS t1_1, t1 AS t1_2
WHERE (t1_1.a, t1_2.a) IN ( SELECT a, b FROM v1 );
a b a b
-3 1 9 1
-5 8 4 0
-3 9 9 1
2 4 4 0
2 4 6 8
2 6 4 0
2 6 6 8
+3 1 9 1
+3 9 9 1
5 4 4 0
-7 7 7 7
5 4 4 0
+5 8 4 0
+7 7 7 7
DROP VIEW v1;
DROP TABLE t1;
set @@join_cache_level= @tmp_jcl_978479;
@@ -2927,9 +2926,9 @@ alias2.col_int_key = alias1.col_int_key
WHERE alias1.pk = 58 OR alias1.col_varchar_key = 'o'
);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY alias1 index_merge PRIMARY,col_int_key,col_varchar_key PRIMARY,col_varchar_key 4,4 NULL 2 Using sort_union(PRIMARY,col_varchar_key); Using where; Start temporary
-1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-1 PRIMARY alias2 ALL col_int_key NULL NULL NULL 12 Range checked for each record (index map: 0x2); End temporary
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2
+1 PRIMARY alias1 index_merge PRIMARY,col_int_key,col_varchar_key PRIMARY,col_varchar_key 4,4 NULL 2 Using sort_union(PRIMARY,col_varchar_key); Using where
+1 PRIMARY alias2 ALL col_int_key NULL NULL NULL 12 Range checked for each record (index map: 0x2); FirstMatch(t2)
SELECT *
FROM t2
WHERE (field1) IN (SELECT alias1.col_varchar_nokey AS field1
@@ -3037,7 +3036,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 system NULL NULL NULL NULL 1 100.00 Using temporary; Using filesort
1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 5 100.00 Start temporary
1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 100.00
-1 PRIMARY t3 ALL NULL NULL NULL NULL 2 100.00 Using where; End temporary
+1 PRIMARY t3 ALL NULL NULL NULL NULL 2 10.00 Using where; End temporary
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1` AS `c1`,'x' AS `c2` from `test`.`t1` semi join (`test`.`t1` left join `test`.`t3` on(`test`.`t1`.`c1` = `test`.`t3`.`c3`)) where `test`.`t1`.`pk` = `test`.`t1`.`pk` order by 'x',`test`.`t1`.`c1`
DROP TABLE t1,t2,t3;
@@ -3289,8 +3288,7 @@ explain extended
SELECT Id FROM t1 WHERE Id in (SELECT t1_Id FROM t2 WHERE t2.col1 IS NULL);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED t2 ref col1 col1 5 const 2 100.00 Using index condition; Using where
+1 PRIMARY t2 ref col1 col1 5 const 2 50.00 Using index condition; Using where; FirstMatch(t1)
Warnings:
Note 1003 select 1 AS `Id` from (`test`.`t2`) where `test`.`t2`.`t1_Id` = 1 and `test`.`t2`.`col1` is null
DROP TABLE t1, t2;
diff --git a/mysql-test/main/subselect_sj.test b/mysql-test/main/subselect_sj.test
index e4d02ed6..b4aff756 100644
--- a/mysql-test/main/subselect_sj.test
+++ b/mysql-test/main/subselect_sj.test
@@ -70,13 +70,13 @@ explain extended select * from t1 where a in (select t10.pk from t10, t12 where
--echo subqueries within outer joins go into ON expr.
# TODO: psergey: check if case conversions like those are ok (it broke on windows)
---replace_result a A b B
+--replace_result a A b B explain explain table table possible possible
explain extended
select * from t1 left join (t2 A, t2 B) on ( A.a= t1.a and B.a in (select pk from t10));
# TODO: psergey: check if case conversions like those are ok (it broke on windows)
--echo t2 should be wrapped into OJ-nest, so we have "t1 LJ (t2 J t10)"
---replace_result a A b B
+--replace_result a A b B explain explain table table possible possible
explain extended
select * from t1 left join t2 on (t2.a= t1.a and t2.a in (select pk from t10));
@@ -739,6 +739,7 @@ INSERT INTO t1 VALUES (1,'o','ffff','ffff','ffoo','ffff','ffff','ffff','ffff','f
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES (1,'i','iiii','iiii','iiii','iiii','ffff','ffff','ffff','ffff','ffff',GeomFromText('POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))')), (2,'f','ffff','ffff','ffff','ffff','ffff','ffff','ffff','ffff','ffff',GeomFromText('POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))'));
+insert into t2 (pk) values (-1),(0);
# Test that materialization is skipped for semijoins where materialized
# table would contain GEOMETRY or different kinds of BLOB/TEXT columns
@@ -779,7 +780,13 @@ eval $query;
let $query=
SELECT pk FROM t1 WHERE (b, i) IN (SELECT b, i FROM t2 WHERE pk > 0);
+#set optimizer_trace=1;
+#select @@optimizer_switch;
+#select @@join_cache_level;
+#select @@optimizer_use_condition_selectivity;
eval EXPLAIN EXTENDED $query;
+#select * from information_schema.optimizer_trace;
+
eval $query;
let $query=
@@ -1425,7 +1432,7 @@ drop table t1,t2;
--echo # BUG#787299: Valgrind complains on a join query with two IN subqueries
--echo #
create table t1 (a int);
-insert into t1 values (1), (2), (3);
+insert into t1 values (1), (2), (3),(1000),(2000);
create table t2 as select * from t1;
select * from t1 A, t1 B
where A.a = B.a and A.a in (select a from t2 C) and B.a in (select a from t2 D);
@@ -1739,7 +1746,7 @@ DROP TABLE t1,t2,t3;
--echo #
--echo # BUG#803457: Wrong result with semijoin + view + outer join in maria-5.3-subqueries-mwl90
---echo # (Original testcase)
+--echo # (Original, slightly modified testcase)
--echo #
CREATE TABLE t1 (f1 int, f2 int );
@@ -1753,15 +1760,13 @@ INSERT INTO t3 VALUES (2,0),(4,0),(0,NULL),(4,0),(8,0);
CREATE TABLE t4 ( f2 int, KEY (f2) );
INSERT INTO t4 VALUES (0),(NULL);
-
-CREATE VIEW v4 AS SELECT DISTINCT f2 FROM t4 ;
+INSERT INTO t4 VALUES (0),(NULL),(-1),(-2),(-3);
--echo # The following must not have outer joins:
explain extended
-SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4);
-SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4);
+SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4 where f2 = 0 or f2 IS NULL);
+SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4 where f2 = 0 or f2 IS NULL);
-drop view v4;
drop table t1, t2, t3, t4;
--echo #
@@ -2249,6 +2254,7 @@ INSERT INTO t1 VALUES
CREATE TABLE t2 ( a INT, b INT, KEY(a)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (3,20),(2,21),(3,22);
+--sorted_result
SELECT *
FROM t1 AS alias1, t1 AS alias2
WHERE ( alias1.c, alias2.c )
@@ -2292,16 +2298,17 @@ INSERT INTO t1 VALUES
CREATE TABLE t2 ( c INT, d INT, KEY(c) );
INSERT INTO t2 VALUES
- (1,2),(2,1),(3,3),(4,2),(5,5),(6,3),(7,1);
+ (1,2),(2,1),(3,3),(4,2),(5,5),(6,3),(7,1),(11,11);
analyze table t1,t2;
explain
SELECT a, b, d FROM t1, t2
WHERE ( b, d ) IN
- ( SELECT b, d FROM t1, t2 WHERE b = c );
+ ( SELECT b, d FROM t1 as t3, t2 as t4 WHERE b = c );
+--sorted_result
SELECT a, b, d FROM t1, t2
WHERE ( b, d ) IN
- ( SELECT b, d FROM t1, t2 WHERE b = c );
+ ( SELECT b, d FROM t1 as t3, t2 as t4 WHERE b = c );
DROP TABLE t1, t2;
@@ -2449,6 +2456,7 @@ EXPLAIN
SELECT * FROM t1 AS t1_1, t1 AS t1_2
WHERE (t1_1.a, t1_2.a) IN ( SELECT a, b FROM v1 );
+--sorted_result
SELECT * FROM t1 AS t1_1, t1 AS t1_2
WHERE (t1_1.a, t1_2.a) IN ( SELECT a, b FROM v1 );
diff --git a/mysql-test/main/subselect_sj2.result b/mysql-test/main/subselect_sj2.result
index 2ddc7a5a..1ee106aa 100644
--- a/mysql-test/main/subselect_sj2.result
+++ b/mysql-test/main/subselect_sj2.result
@@ -25,11 +25,7 @@ key(b)
);
insert into t2 select a, a/2 from t0;
insert into t2 select a+10, a+10/2 from t0;
-select * from t1;
-a b
-1 1
-1 1
-2 2
+insert into t1 values (1030,30),(1031,31),(1032,32),(1033,33);
select * from t2;
a b
0 0
@@ -56,7 +52,7 @@ explain select * from t2 where b in (select a from t1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL b NULL NULL NULL 20
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3
+2 MATERIALIZED t1 ALL NULL NULL NULL NULL 7
select * from t2 where b in (select a from t1);
a b
1 1
@@ -84,7 +80,7 @@ explain select * from t3 where b in (select a from t1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL b NULL NULL NULL 20
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3
+2 MATERIALIZED t1 ALL NULL NULL NULL NULL 7
select * from t3 where b in (select a from t1);
a b pk1 pk2 pk3
1 1 1 1 1
@@ -106,11 +102,14 @@ primary key(pk1, pk2)
insert into t3 select
A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a
from t0 A, t0 B where B.a <5;
+analyze table t3 persistent for all;
+Table Op Msg_type Msg_text
+test.t3 analyze status Engine-independent statistics collected
+test.t3 analyze status OK
explain select * from t3 where b in (select a from t0);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t3 ALL b NULL NULL NULL #
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func #
-2 MATERIALIZED t0 ALL NULL NULL NULL NULL #
+1 PRIMARY t0 ALL NULL NULL NULL NULL # Using where; Start temporary
+1 PRIMARY t3 ref b b 5 test.t0.a # End temporary
select * from t3 where b in (select A.a+B.a from t0 A, t0 B where B.a<5);
a b pk1 pk2
0 0 0 0
@@ -131,20 +130,17 @@ set join_buffer_size= @save_join_buffer_size;
set max_heap_table_size= @save_max_heap_table_size;
explain select * from t1 where a in (select b from t2);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 3
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 index b b 5 NULL 20 Using index
-select * from t1;
-a b
-1 1
-1 1
-2 2
+1 PRIMARY t1 ALL NULL NULL NULL NULL 7 Using where
+1 PRIMARY t2 ref b b 5 test.t1.a 1 Using index; FirstMatch(t1)
select * from t1 where a in (select b from t2);
a b
1 1
1 1
2 2
drop table t1, t2, t3;
+#
+# Test join buffering
+#
set @save_join_buffer_size = @@join_buffer_size;
set join_buffer_size= 8192;
create table t1 (a int, filler1 binary(200), filler2 binary(200));
@@ -156,7 +152,7 @@ insert into t1 values (2, 'duplicate ok', 'duplicate ok');
insert into t1 values (18, 'duplicate ok', 'duplicate ok');
insert into t2 values (3, 'duplicate ok', 'duplicate ok');
insert into t2 values (19, 'duplicate ok', 'duplicate ok');
-explain select
+explain select
a, mid(filler1, 1,10), length(filler1)=length(filler2) as Z
from t1 ot where a in (select a from t2 it);
id select_type table type possible_keys key key_len ref rows Extra
@@ -344,9 +340,9 @@ t2.Code IN (SELECT Country FROM t3
WHERE Language='English' AND Percentage > 10 AND
t2.Population > 100000);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 range Population,Country Population 4 NULL 1 Using index condition; Rowid-ordered scan; Start temporary
-1 PRIMARY t2 eq_ref PRIMARY,Population PRIMARY 3 test.t1.Country 1 Using where; End temporary
-1 PRIMARY t3 eq_ref PRIMARY,Percentage PRIMARY 33 test.t1.Country,const 1 Using index condition; Using where
+1 PRIMARY t3 ALL PRIMARY,Percentage NULL NULL NULL 22 Using where
+1 PRIMARY t1 ref Population,Country Country 3 test.t3.Country 0 Using where; LooseScan
+1 PRIMARY t2 eq_ref PRIMARY,Population PRIMARY 3 test.t3.Country 1 Using where
set optimizer_switch=@bug35674_save_optimizer_switch;
DROP TABLE t1,t2,t3;
CREATE TABLE t1 (
@@ -628,7 +624,7 @@ select * from t1 left join t2 on (t2.a= t1.a and t2.a in (select pk from t3));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3
1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where
-2 MATERIALIZED t3 index PRIMARY PRIMARY 4 NULL 10 Using index
+2 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY PRIMARY 4 func 1 Using index
drop table t0, t1, t2, t3;
create table t1 (a int);
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
@@ -740,9 +736,8 @@ alter table t3 add primary key(id), add key(a);
The following must use loose index scan over t3, key a:
explain select count(a) from t2 where a in ( SELECT a FROM t3);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 index a a 5 NULL 1000 Using index
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t3 index a a 5 NULL 30000 Using index
+1 PRIMARY t2 index a a 5 NULL 1000 Using where; Using index
+1 PRIMARY t3 ref a a 5 test.t2.a 30 Using index; FirstMatch(t2)
select count(a) from t2 where a in ( SELECT a FROM t3);
count(a)
1000
@@ -770,8 +765,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where
1 PRIMARY t2 ALL NULL NULL NULL NULL 1
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 FirstMatch(t2)
-1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 Using where
-3 MATERIALIZED t2 ALL NULL NULL NULL NULL 1
+1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where; FirstMatch(t3)
select 1 from t2 where
c2 in (select 1 from t3, t2) and
c1 in (select convert(c6,char(1)) from t2);
@@ -839,9 +833,9 @@ explain
SELECT * FROM t3
WHERE f12 IN (SELECT alias2.f12 FROM t1 AS alias1, t2 AS alias2, t1 WHERE alias1.f13 = 24);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY alias1 const PRIMARY PRIMARY 4 const # Using index
+1 PRIMARY alias1 const PRIMARY PRIMARY 4 const #
1 PRIMARY alias2 index f12 f12 7 NULL # Using index; LooseScan
-1 PRIMARY t1 index NULL PRIMARY 4 NULL # Using index; FirstMatch(alias2)
+1 PRIMARY t1 ALL NULL NULL NULL NULL # FirstMatch(alias2)
1 PRIMARY t3 ALL NULL NULL NULL NULL # Using where; Using join buffer (flat, BNL join)
SELECT * FROM t3
WHERE f12 IN (SELECT alias2.f12 FROM t1 AS alias1, t2 AS alias2, t1 WHERE alias1.f13 = 24);
@@ -911,9 +905,9 @@ SELECT * FROM t3 LEFT JOIN (v1,t2) ON t3.a = t2.a
WHERE t3.b IN (SELECT b FROM t4);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 1
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where
1 PRIMARY <derived3> ALL NULL NULL NULL NULL 2
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
2 MATERIALIZED t4 ALL NULL NULL NULL NULL 2
3 DERIVED t1 ALL NULL NULL NULL NULL 1
SELECT * FROM t3 LEFT JOIN (v1,t2) ON t3.a = t2.a
@@ -950,35 +944,47 @@ INSERT INTO t1 VALUES
(11,'z',8),(12,'c',7),(13,'a',6),(14,'q',5),(15,'y',4),
(16,'n',3),(17,'r',2),(18,'v',1),(19,'p',0);
CREATE TABLE t2 (
-pk INT, d VARCHAR(1), e INT,
+pk INT, d VARCHAR(1), e INT, f int,
PRIMARY KEY(pk), KEY(d,e)
) ENGINE=InnoDB;
-INSERT INTO t2 VALUES
+INSERT INTO t2 (pk,d,e) VALUES
(1,'x',1),(2,'d',2),(3,'r',3),(4,'f',4),(5,'y',5),
(6,'u',6),(7,'m',7),(8,'k',8),(9,'o',9),(10,'w',1),
(11,'m',2),(12,'q',3),(13,'m',4),(14,'d',5),
(15,'g',6),(16,'x',7),(17,'f',8);
+update t2 set f=pk/2;
analyze table t1,t2;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status OK
+# Original query, changed because of new optimizations
explain
SELECT * FROM t1 WHERE b IN (
SELECT d FROM t2, t1
WHERE a = d AND ( pk < 2 OR d = 'z' )
);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2
+1 PRIMARY t2 index PRIMARY,d d 9 NULL 17 Using where; Using index; LooseScan
+1 PRIMARY t1 ref a a 5 test.t2.d 1 Using where; Using index; FirstMatch(t2)
1 PRIMARY t1 ref b b 4 test.t2.d 1
-2 MATERIALIZED t2 index_merge PRIMARY,d d,PRIMARY 4,4 NULL 2 Using sort_union(d,PRIMARY); Using where
-2 MATERIALIZED t1 ref a a 5 test.t2.d 1 Using where; Using index
Warnings:
Note 1105 Cannot use key `d` part[0] for lookup: `test`.`t2`.`d` of type `varchar` = "`t1`.`a`" of type `int`
+explain
SELECT * FROM t1 WHERE b IN (
SELECT d FROM t2, t1
-WHERE a = d AND ( pk < 2 OR d = 'z' )
+WHERE a = d AND ( pk < 2 OR d = 'z' ) and f > 0
+);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t2 index_merge PRIMARY,d d,PRIMARY 4,4 NULL 2 Using sort_union(d,PRIMARY); Using where; Start temporary
+1 PRIMARY t1 ref a a 5 test.t2.d 1 Using where; Using index
+1 PRIMARY t1 ref b b 4 test.t2.d 1 End temporary
+Warnings:
+Note 1105 Cannot use key `d` part[0] for lookup: `test`.`t2`.`d` of type `varchar` = "`t1`.`a`" of type `int`
+SELECT * FROM t1 WHERE b IN (
+SELECT d FROM t2, t1
+WHERE a = d AND ( pk < 2 OR d = 'z' ) and f > 0
);
a b c
Warnings:
@@ -1226,10 +1232,10 @@ t1_pk1 t1_pk2 t3_i t3_c
explain
SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' );
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ref PRIMARY PRIMARY 5 const 1 Using where; Using index
-1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Start temporary
-1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-1 PRIMARY t4 index NULL PRIMARY 59 NULL 2 Using where; Using index; End temporary
+1 PRIMARY t1 ref PRIMARY PRIMARY 5 const 1 Using where
+1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where
+1 PRIMARY t4 ALL NULL NULL NULL NULL 2 Using where; FirstMatch(t3)
DROP TABLE t1,t2,t3,t4;
#
# MDEV-6263: Wrong result when using IN subquery with order by
@@ -1347,9 +1353,9 @@ WHERE
T3_0_.t3idref= 1
);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY T3_0_ ref PRIMARY,FK_T3_T2Id PRIMARY 8 const 3 Using index; Start temporary
+1 PRIMARY T3_0_ ref PRIMARY,FK_T3_T2Id PRIMARY 8 const 3 Start temporary
1 PRIMARY T2_1_ eq_ref PRIMARY,FK_T2_T1Id PRIMARY 8 test.T3_0_.t2idref 1
-1 PRIMARY T1_1_ eq_ref PRIMARY PRIMARY 8 test.T2_1_.t1idref 1 Using index
+1 PRIMARY T1_1_ eq_ref PRIMARY PRIMARY 8 test.T2_1_.t1idref 1
1 PRIMARY T2_0_ ref FK_T2_T1Id FK_T2_T1Id 8 test.T2_1_.t1idref 1 Using index; End temporary
drop table t3,t2,t1;
set optimizer_search_depth=@tmp7474;
diff --git a/mysql-test/main/subselect_sj2.test b/mysql-test/main/subselect_sj2.test
index 5b9ec409..67c70d44 100644
--- a/mysql-test/main/subselect_sj2.test
+++ b/mysql-test/main/subselect_sj2.test
@@ -2,13 +2,15 @@
# DuplicateElimination strategy test
#
+--source include/have_innodb.inc
+--source include/have_sequence.inc
+
set @innodb_stats_persistent_save= @@innodb_stats_persistent;
set @innodb_stats_persistent_sample_pages_save=
@@innodb_stats_persistent_sample_pages;
set global innodb_stats_persistent= 1;
set global innodb_stats_persistent_sample_pages=100;
---source include/have_innodb.inc
set @subselect_sj2_tmp= @@optimizer_switch;
set optimizer_switch='semijoin=on,firstmatch=on,loosescan=on';
@@ -48,7 +50,7 @@ create table t2 (
insert into t2 select a, a/2 from t0;
insert into t2 select a+10, a+10/2 from t0;
-select * from t1;
+insert into t1 values (1030,30),(1031,31),(1032,32),(1033,33);
select * from t2;
explain select * from t2 where b in (select a from t1);
select * from t2 where b in (select a from t1);
@@ -87,6 +89,7 @@ insert into t3 select
A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a
from t0 A, t0 B where B.a <5;
+analyze table t3 persistent for all;
--replace_column 9 #
explain select * from t3 where b in (select a from t0);
select * from t3 where b in (select A.a+B.a from t0 A, t0 B where B.a<5);
@@ -96,15 +99,15 @@ set max_heap_table_size= @save_max_heap_table_size;
# O2I join orders, with shortcutting:
explain select * from t1 where a in (select b from t2);
-select * from t1;
select * from t1 where a in (select b from t2);
drop table t1, t2, t3;
# (no need for anything in range/index_merge/DS-MRR)
-#
-# Test join buffering
-#
+--echo #
+--echo # Test join buffering
+--echo #
+
set @save_join_buffer_size = @@join_buffer_size;
set join_buffer_size= 8192;
@@ -121,7 +124,7 @@ insert into t1 values (18, 'duplicate ok', 'duplicate ok');
insert into t2 values (3, 'duplicate ok', 'duplicate ok');
insert into t2 values (19, 'duplicate ok', 'duplicate ok');
-explain select
+explain select
a, mid(filler1, 1,10), length(filler1)=length(filler2) as Z
from t1 ot where a in (select a from t2 it);
select
@@ -255,6 +258,7 @@ INSERT INTO t3 VALUES
# Disable materialization to avoid races between query plans
set @bug35674_save_optimizer_switch=@@optimizer_switch;
set optimizer_switch='materialization=off';
+
EXPLAIN
SELECT Name FROM t2
WHERE t2.Code IN (SELECT Country FROM t1 WHERE Population > 5000000)
@@ -1121,26 +1125,35 @@ INSERT INTO t1 VALUES
(16,'n',3),(17,'r',2),(18,'v',1),(19,'p',0);
CREATE TABLE t2 (
- pk INT, d VARCHAR(1), e INT,
+ pk INT, d VARCHAR(1), e INT, f int,
PRIMARY KEY(pk), KEY(d,e)
) ENGINE=InnoDB;
-INSERT INTO t2 VALUES
+INSERT INTO t2 (pk,d,e) VALUES
(1,'x',1),(2,'d',2),(3,'r',3),(4,'f',4),(5,'y',5),
(6,'u',6),(7,'m',7),(8,'k',8),(9,'o',9),(10,'w',1),
(11,'m',2),(12,'q',3),(13,'m',4),(14,'d',5),
(15,'g',6),(16,'x',7),(17,'f',8);
+update t2 set f=pk/2;
analyze table t1,t2;
+--echo # Original query, changed because of new optimizations
explain
SELECT * FROM t1 WHERE b IN (
SELECT d FROM t2, t1
WHERE a = d AND ( pk < 2 OR d = 'z' )
);
+
+explain
SELECT * FROM t1 WHERE b IN (
SELECT d FROM t2, t1
- WHERE a = d AND ( pk < 2 OR d = 'z' )
+ WHERE a = d AND ( pk < 2 OR d = 'z' ) and f > 0
+);
+
+SELECT * FROM t1 WHERE b IN (
+ SELECT d FROM t2, t1
+ WHERE a = d AND ( pk < 2 OR d = 'z' ) and f > 0
);
DROP TABLE t1, t2;
@@ -1235,6 +1248,7 @@ INSERT INTO t2 VALUES
analyze table t1 persistent for all;
analyze table t2 persistent for all;
--replace_column 9 #
+
EXPLAIN
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
WHERE alias3.d IN (
@@ -1311,8 +1325,6 @@ SELECT * FROM t1 WHERE 9 IN ( SELECT b FROM t2 WHERE 1 IN ( SELECT MIN(c) FROM t
DROP TABLE t1,t2,t3;
---source include/have_innodb.inc
-
--disable_warnings
DROP TABLE IF EXISTS t1,t2,t3,t4;
--enable_warnings
diff --git a/mysql-test/main/subselect_sj2_jcl6.result b/mysql-test/main/subselect_sj2_jcl6.result
index 4c087a14..34cfe2d1 100644
--- a/mysql-test/main/subselect_sj2_jcl6.result
+++ b/mysql-test/main/subselect_sj2_jcl6.result
@@ -36,11 +36,7 @@ key(b)
);
insert into t2 select a, a/2 from t0;
insert into t2 select a+10, a+10/2 from t0;
-select * from t1;
-a b
-1 1
-1 1
-2 2
+insert into t1 values (1030,30),(1031,31),(1032,32),(1033,33);
select * from t2;
a b
0 0
@@ -65,9 +61,8 @@ a b
19 14
explain select * from t2 where b in (select a from t1);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 ALL b NULL NULL NULL 20
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3
+1 PRIMARY t2 ALL b NULL NULL NULL 20 Using where
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 test.t2.b 7 Using where; FirstMatch(t2); Using join buffer (flat, BNLH join)
select * from t2 where b in (select a from t1);
a b
1 1
@@ -93,9 +88,8 @@ test.t3 analyze status Engine-independent statistics collected
test.t3 analyze status OK
explain select * from t3 where b in (select a from t1);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t3 ALL b NULL NULL NULL 20
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3
+1 PRIMARY t3 ALL b NULL NULL NULL 20 Using where
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 test.t3.b 7 Using where; FirstMatch(t3); Using join buffer (flat, BNLH join)
select * from t3 where b in (select a from t1);
a b pk1 pk2 pk3
1 1 1 1 1
@@ -117,11 +111,14 @@ primary key(pk1, pk2)
insert into t3 select
A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a
from t0 A, t0 B where B.a <5;
+analyze table t3 persistent for all;
+Table Op Msg_type Msg_text
+test.t3 analyze status Engine-independent statistics collected
+test.t3 analyze status OK
explain select * from t3 where b in (select a from t0);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t3 ALL b NULL NULL NULL #
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func #
-2 MATERIALIZED t0 ALL NULL NULL NULL NULL #
+1 PRIMARY t0 ALL NULL NULL NULL NULL # Using where; Start temporary
+1 PRIMARY t3 ref b b 5 test.t0.a # End temporary; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
select * from t3 where b in (select A.a+B.a from t0 A, t0 B where B.a<5);
a b pk1 pk2
0 0 0 0
@@ -142,20 +139,17 @@ set join_buffer_size= @save_join_buffer_size;
set max_heap_table_size= @save_max_heap_table_size;
explain select * from t1 where a in (select b from t2);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 3
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 index b b 5 NULL 20 Using index
-select * from t1;
-a b
-1 1
-1 1
-2 2
+1 PRIMARY t1 ALL NULL NULL NULL NULL 7 Using where
+1 PRIMARY t2 ref b b 5 test.t1.a 1 Using index; FirstMatch(t1)
select * from t1 where a in (select b from t2);
a b
1 1
1 1
2 2
drop table t1, t2, t3;
+#
+# Test join buffering
+#
set @save_join_buffer_size = @@join_buffer_size;
set join_buffer_size= 8192;
create table t1 (a int, filler1 binary(200), filler2 binary(200));
@@ -167,13 +161,12 @@ insert into t1 values (2, 'duplicate ok', 'duplicate ok');
insert into t1 values (18, 'duplicate ok', 'duplicate ok');
insert into t2 values (3, 'duplicate ok', 'duplicate ok');
insert into t2 values (19, 'duplicate ok', 'duplicate ok');
-explain select
+explain select
a, mid(filler1, 1,10), length(filler1)=length(filler2) as Z
from t1 ot where a in (select a from t2 it);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY ot ALL NULL NULL NULL NULL 32
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED it ALL NULL NULL NULL NULL 22
+1 PRIMARY ot ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY it hash_ALL NULL #hash#$hj 5 test.ot.a 22 Using where; FirstMatch(ot); Using join buffer (flat, BNLH join)
select
a, mid(filler1, 1,10), length(filler1)=length(filler2) as Z
from t1 ot where a in (select a from t2 it);
@@ -197,16 +190,15 @@ a mid(filler1, 1,10) Z
16 filler1234 1
17 filler1234 1
18 filler1234 1
-19 filler1234 1
2 duplicate 1
18 duplicate 1
+19 filler1234 1
explain select
a, mid(filler1, 1,10), length(filler1)=length(filler2)
from t2 ot where a in (select a from t1 it);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY ot ALL NULL NULL NULL NULL 22
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED it ALL NULL NULL NULL NULL 32
+1 PRIMARY ot ALL NULL NULL NULL NULL 22 Using where
+1 PRIMARY it hash_ALL NULL #hash#$hj 5 test.ot.a 32 Using where; FirstMatch(ot); Using join buffer (flat, BNLH join)
select
a, mid(filler1, 1,10), length(filler1)=length(filler2)
from t2 ot where a in (select a from t1 it);
@@ -230,8 +222,8 @@ a mid(filler1, 1,10) length(filler1)=length(filler2)
16 filler1234 1
17 filler1234 1
18 filler1234 1
-19 filler1234 1
3 duplicate 1
+19 filler1234 1
19 duplicate 1
insert into t1 select a+20, 'filler123456', 'filler123456' from t0;
insert into t1 select a+20, 'filler123456', 'filler123456' from t0;
@@ -272,9 +264,8 @@ explain select
a, mid(filler1, 1,10), length(filler1)=length(filler2)
from t2 ot where a in (select a from t1 it);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY ot ALL NULL NULL NULL NULL 22
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED it ALL NULL NULL NULL NULL 52
+1 PRIMARY ot ALL NULL NULL NULL NULL 22 Using where
+1 PRIMARY it hash_ALL NULL #hash#$hj 5 test.ot.a 52 Using where; FirstMatch(ot); Using join buffer (flat, BNLH join)
select
a, mid(filler1, 1,10), length(filler1)=length(filler2)
from t2 ot where a in (select a from t1 it);
@@ -298,8 +289,8 @@ a mid(filler1, 1,10) length(filler1)=length(filler2)
16 filler1234 1
17 filler1234 1
18 filler1234 1
-19 filler1234 1
3 duplicate 1
+19 filler1234 1
19 duplicate 1
drop table t1, t2;
create table t1 (a int, b int, key(a));
@@ -355,9 +346,9 @@ t2.Code IN (SELECT Country FROM t3
WHERE Language='English' AND Percentage > 10 AND
t2.Population > 100000);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 range Population,Country Population 4 NULL 1 Using index condition; Rowid-ordered scan; Start temporary
-1 PRIMARY t2 eq_ref PRIMARY,Population PRIMARY 3 test.t1.Country 1 Using where; End temporary; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
-1 PRIMARY t3 eq_ref PRIMARY,Percentage PRIMARY 33 test.t1.Country,const 1 Using index condition; Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
+1 PRIMARY t2 ALL PRIMARY,Population NULL NULL NULL 16 Using where
+1 PRIMARY t1 range Population,Country Population 4 NULL 1 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t2); Using join buffer (flat, BNL join)
+1 PRIMARY t3 eq_ref PRIMARY,Percentage PRIMARY 33 test.t2.Code,const 1 Using index condition; Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan
set optimizer_switch=@bug35674_save_optimizer_switch;
DROP TABLE t1,t2,t3;
CREATE TABLE t1 (
@@ -641,7 +632,7 @@ select * from t1 left join t2 on (t2.a= t1.a and t2.a in (select pk from t3));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3
1 PRIMARY t2 hash_ALL NULL #hash#$hj 5 test.t1.a 3 Using where; Using join buffer (flat, BNLH join)
-2 MATERIALIZED t3 index PRIMARY PRIMARY 4 NULL 10 Using index
+2 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY PRIMARY 4 func 1 Using index
drop table t0, t1, t2, t3;
create table t1 (a int);
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
@@ -753,9 +744,8 @@ alter table t3 add primary key(id), add key(a);
The following must use loose index scan over t3, key a:
explain select count(a) from t2 where a in ( SELECT a FROM t3);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 index a a 5 NULL 1000 Using index
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t3 index a a 5 NULL 30000 Using index
+1 PRIMARY t2 index a a 5 NULL 1000 Using where; Using index
+1 PRIMARY t3 ref a a 5 test.t2.a 30 Using index; FirstMatch(t2)
select count(a) from t2 where a in ( SELECT a FROM t3);
count(a)
1000
@@ -783,8 +773,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where
1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using join buffer (flat, BNL join)
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 FirstMatch(t2); Using join buffer (incremental, BNL join)
-1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 Using where
-3 MATERIALIZED t2 ALL NULL NULL NULL NULL 1
+1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where; FirstMatch(t3); Using join buffer (incremental, BNL join)
select 1 from t2 where
c2 in (select 1 from t3, t2) and
c1 in (select convert(c6,char(1)) from t2);
@@ -852,9 +841,9 @@ explain
SELECT * FROM t3
WHERE f12 IN (SELECT alias2.f12 FROM t1 AS alias1, t2 AS alias2, t1 WHERE alias1.f13 = 24);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY alias1 const PRIMARY PRIMARY 4 const # Using index
+1 PRIMARY alias1 const PRIMARY PRIMARY 4 const #
1 PRIMARY alias2 index f12 f12 7 NULL # Using index; LooseScan
-1 PRIMARY t1 index NULL PRIMARY 4 NULL # Using index; FirstMatch(alias2)
+1 PRIMARY t1 ALL NULL NULL NULL NULL # FirstMatch(alias2)
1 PRIMARY t3 ALL NULL NULL NULL NULL # Using where; Using join buffer (flat, BNL join)
SELECT * FROM t3
WHERE f12 IN (SELECT alias2.f12 FROM t1 AS alias1, t2 AS alias2, t1 WHERE alias1.f13 = 24);
@@ -923,11 +912,10 @@ EXPLAIN
SELECT * FROM t3 LEFT JOIN (v1,t2) ON t3.a = t2.a
WHERE t3.b IN (SELECT b FROM t4);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t3 ALL NULL NULL NULL NULL 1
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+1 PRIMARY t3 ALL NULL NULL NULL NULL 1 Using where
1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t3.a 1 Using where; Using join buffer (flat, BNLH join)
1 PRIMARY <derived3> ALL NULL NULL NULL NULL 2 Using join buffer (incremental, BNL join)
-2 MATERIALIZED t4 ALL NULL NULL NULL NULL 2
+1 PRIMARY t4 hash_ALL NULL #hash#$hj 4 test.t3.b 2 Using where; Start temporary; End temporary; Using join buffer (incremental, BNLH join)
3 DERIVED t1 ALL NULL NULL NULL NULL 1
SELECT * FROM t3 LEFT JOIN (v1,t2) ON t3.a = t2.a
WHERE t3.b IN (SELECT b FROM t4);
@@ -963,35 +951,47 @@ INSERT INTO t1 VALUES
(11,'z',8),(12,'c',7),(13,'a',6),(14,'q',5),(15,'y',4),
(16,'n',3),(17,'r',2),(18,'v',1),(19,'p',0);
CREATE TABLE t2 (
-pk INT, d VARCHAR(1), e INT,
+pk INT, d VARCHAR(1), e INT, f int,
PRIMARY KEY(pk), KEY(d,e)
) ENGINE=InnoDB;
-INSERT INTO t2 VALUES
+INSERT INTO t2 (pk,d,e) VALUES
(1,'x',1),(2,'d',2),(3,'r',3),(4,'f',4),(5,'y',5),
(6,'u',6),(7,'m',7),(8,'k',8),(9,'o',9),(10,'w',1),
(11,'m',2),(12,'q',3),(13,'m',4),(14,'d',5),
(15,'g',6),(16,'x',7),(17,'f',8);
+update t2 set f=pk/2;
analyze table t1,t2;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status OK
+# Original query, changed because of new optimizations
explain
SELECT * FROM t1 WHERE b IN (
SELECT d FROM t2, t1
WHERE a = d AND ( pk < 2 OR d = 'z' )
);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2
+1 PRIMARY t2 index PRIMARY,d d 9 NULL 17 Using where; Using index; LooseScan
+1 PRIMARY t1 ref a a 5 test.t2.d 1 Using where; Using index; FirstMatch(t2)
1 PRIMARY t1 ref b b 4 test.t2.d 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
-2 MATERIALIZED t2 index_merge PRIMARY,d d,PRIMARY 4,4 NULL 2 Using sort_union(d,PRIMARY); Using where
-2 MATERIALIZED t1 ref a a 5 test.t2.d 1 Using where; Using index
Warnings:
Note 1105 Cannot use key `d` part[0] for lookup: `test`.`t2`.`d` of type `varchar` = "`t1`.`a`" of type `int`
+explain
SELECT * FROM t1 WHERE b IN (
SELECT d FROM t2, t1
-WHERE a = d AND ( pk < 2 OR d = 'z' )
+WHERE a = d AND ( pk < 2 OR d = 'z' ) and f > 0
+);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t2 index_merge PRIMARY,d d,PRIMARY 4,4 NULL 2 Using sort_union(d,PRIMARY); Using where; Start temporary
+1 PRIMARY t1 ref a a 5 test.t2.d 1 Using where; Using index
+1 PRIMARY t1 ref b b 4 test.t2.d 1 End temporary; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+Warnings:
+Note 1105 Cannot use key `d` part[0] for lookup: `test`.`t2`.`d` of type `varchar` = "`t1`.`a`" of type `int`
+SELECT * FROM t1 WHERE b IN (
+SELECT d FROM t2, t1
+WHERE a = d AND ( pk < 2 OR d = 'z' ) and f > 0
);
a b c
Warnings:
@@ -1154,10 +1154,10 @@ WHERE alias5.b = alias4.b
AND ( alias5.b >= alias3.b OR alias5.c != alias3.c )
);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL # Using where
-1 PRIMARY alias4 ref PRIMARY,c c 4 test.alias3.d # Using index
-1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b # Using where; FirstMatch(alias3)
-1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
+1 PRIMARY alias4 index PRIMARY,c c 4 NULL # Using where; Using index; Start temporary
+1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b # Using join buffer (flat, BKA join); Key-ordered scan
+1 PRIMARY alias3 hash_ALL PRIMARY #hash#$hj 4 test.alias4.c # Using where; End temporary; Using join buffer (incremental, BNLH join)
+1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (incremental, BNL join)
1 PRIMARY alias2 ALL NULL NULL NULL NULL # Using join buffer (incremental, BNL join)
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
WHERE alias3.d IN (
@@ -1175,10 +1175,10 @@ WHERE alias5.b = alias4.b
AND ( alias5.b >= alias3.b OR alias3.c != alias5.c )
);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY alias3 ALL PRIMARY NULL NULL NULL # Using where
-1 PRIMARY alias4 ref PRIMARY,c c 4 test.alias3.d # Using index
-1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b # Using where; FirstMatch(alias3)
-1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
+1 PRIMARY alias4 index PRIMARY,c c 4 NULL # Using where; Using index; Start temporary
+1 PRIMARY alias5 eq_ref PRIMARY PRIMARY 4 test.alias4.b # Using join buffer (flat, BKA join); Key-ordered scan
+1 PRIMARY alias3 hash_ALL PRIMARY #hash#$hj 4 test.alias4.c # Using where; End temporary; Using join buffer (incremental, BNLH join)
+1 PRIMARY alias1 ALL NULL NULL NULL NULL # Using join buffer (incremental, BNL join)
1 PRIMARY alias2 ALL NULL NULL NULL NULL # Using join buffer (incremental, BNL join)
SELECT COUNT(*) FROM t1 AS alias1, t1 AS alias2, t2 AS alias3
WHERE alias3.d IN (
@@ -1239,10 +1239,10 @@ t1_pk1 t1_pk2 t3_i t3_c
explain
SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' );
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ref PRIMARY PRIMARY 5 const 1 Using where; Using index
-1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Start temporary; Using join buffer (flat, BNL join)
-1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (incremental, BNL join)
-1 PRIMARY t4 hash_index NULL #hash#$hj:PRIMARY 54:59 test.t3.t3_c 2 Using where; Using index; End temporary; Using join buffer (incremental, BNLH join)
+1 PRIMARY t1 ref PRIMARY PRIMARY 5 const 1 Using where
+1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
+1 PRIMARY t4 ALL NULL NULL NULL NULL 2 Using where; FirstMatch(t3); Using join buffer (incremental, BNL join)
DROP TABLE t1,t2,t3,t4;
#
# MDEV-6263: Wrong result when using IN subquery with order by
@@ -1360,9 +1360,9 @@ WHERE
T3_0_.t3idref= 1
);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY T3_0_ ref PRIMARY,FK_T3_T2Id PRIMARY 8 const 3 Using index; Start temporary
+1 PRIMARY T3_0_ ref PRIMARY,FK_T3_T2Id PRIMARY 8 const 3 Start temporary
1 PRIMARY T2_1_ eq_ref PRIMARY,FK_T2_T1Id PRIMARY 8 test.T3_0_.t2idref 1 Using join buffer (flat, BKA join); Key-ordered scan
-1 PRIMARY T1_1_ eq_ref PRIMARY PRIMARY 8 test.T2_1_.t1idref 1 Using index
+1 PRIMARY T1_1_ eq_ref PRIMARY PRIMARY 8 test.T2_1_.t1idref 1 Using join buffer (incremental, BKA join); Key-ordered scan
1 PRIMARY T2_0_ ref FK_T2_T1Id FK_T2_T1Id 8 test.T2_1_.t1idref 1 Using index; End temporary
drop table t3,t2,t1;
set optimizer_search_depth=@tmp7474;
@@ -1441,10 +1441,9 @@ SELECT t3.* FROM t1 JOIN t3 ON t3.b = t1.b
WHERE c IN (SELECT t4.b FROM t4 JOIN t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 1 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using join buffer (flat, BNL join)
+1 PRIMARY t4 ALL NULL NULL NULL NULL 2 Using where; FirstMatch(t3); Using join buffer (incremental, BNL join)
1 PRIMARY t1 ref b b 4 test.t3.b 1 Using index
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 1
-2 MATERIALIZED t4 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join)
SELECT t3.* FROM t1 JOIN t3 ON t3.b = t1.b
WHERE c IN (SELECT t4.b FROM t4 JOIN t2);
b c
@@ -1462,18 +1461,19 @@ INSERT INTO t2 VALUES (8);
CREATE TABLE t3 (pk int PRIMARY KEY, a int);
INSERT INTO t3 VALUES (1, 6), (2, 8);
CREATE TABLE t4 (b int) ENGINE=InnoDB;
-INSERT INTO t4 VALUES (2);
+INSERT INTO t4 VALUES (2),(88),(99);
+insert into t2 select seq from seq_100_to_200;
set @tmp_optimizer_switch=@@optimizer_switch;
SET optimizer_switch = 'semijoin_with_cache=on';
SET join_cache_level = 2;
EXPLAIN
SELECT * FROM t1, t2 WHERE b IN (SELECT a FROM t3, t4 WHERE b = pk);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 ALL NULL NULL NULL NULL 1
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join)
-2 MATERIALIZED t4 ALL NULL NULL NULL NULL 1 Using where
-2 MATERIALIZED t3 eq_ref PRIMARY PRIMARY 4 test.t4.b 1
+1 PRIMARY t1 ALL NULL NULL NULL NULL #
+1 PRIMARY t2 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join)
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func #
+2 MATERIALIZED t4 ALL NULL NULL NULL NULL # Using where
+2 MATERIALIZED t3 eq_ref PRIMARY PRIMARY 4 test.t4.b #
SELECT * FROM t1, t2 WHERE b IN (SELECT a FROM t3, t4 WHERE b = pk);
pk a b
1 6 8
@@ -1494,9 +1494,8 @@ SET join_cache_level = 3;
EXPLAIN
SELECT * FROM t1 WHERE b IN (SELECT a FROM t2 GROUP BY a);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 1
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 1
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1 Using where
+1 PRIMARY t2 hash_ALL NULL #hash#$hj 4 test.t1.b 1 Using where; FirstMatch(t1); Using join buffer (flat, BNLH join)
SELECT * FROM t1 WHERE b IN (SELECT a FROM t2 GROUP BY a);
a b
v v
diff --git a/mysql-test/main/subselect_sj2_jcl6.test b/mysql-test/main/subselect_sj2_jcl6.test
index a0c8a6c0..1001a213 100644
--- a/mysql-test/main/subselect_sj2_jcl6.test
+++ b/mysql-test/main/subselect_sj2_jcl6.test
@@ -66,13 +66,16 @@ INSERT INTO t2 VALUES (8);
CREATE TABLE t3 (pk int PRIMARY KEY, a int);
INSERT INTO t3 VALUES (1, 6), (2, 8);
CREATE TABLE t4 (b int) ENGINE=InnoDB;
-INSERT INTO t4 VALUES (2);
+INSERT INTO t4 VALUES (2),(88),(99);
+
+insert into t2 select seq from seq_100_to_200;
set @tmp_optimizer_switch=@@optimizer_switch;
SET optimizer_switch = 'semijoin_with_cache=on';
SET join_cache_level = 2;
+--replace_column 9 #
EXPLAIN
SELECT * FROM t1, t2 WHERE b IN (SELECT a FROM t3, t4 WHERE b = pk);
SELECT * FROM t1, t2 WHERE b IN (SELECT a FROM t3, t4 WHERE b = pk);
diff --git a/mysql-test/main/subselect_sj2_mat.result b/mysql-test/main/subselect_sj2_mat.result
index df67a0be..d022820e 100644
--- a/mysql-test/main/subselect_sj2_mat.result
+++ b/mysql-test/main/subselect_sj2_mat.result
@@ -27,11 +27,7 @@ key(b)
);
insert into t2 select a, a/2 from t0;
insert into t2 select a+10, a+10/2 from t0;
-select * from t1;
-a b
-1 1
-1 1
-2 2
+insert into t1 values (1030,30),(1031,31),(1032,32),(1033,33);
select * from t2;
a b
0 0
@@ -58,7 +54,7 @@ explain select * from t2 where b in (select a from t1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL b NULL NULL NULL 20
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3
+2 MATERIALIZED t1 ALL NULL NULL NULL NULL 7
select * from t2 where b in (select a from t1);
a b
1 1
@@ -86,7 +82,7 @@ explain select * from t3 where b in (select a from t1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL b NULL NULL NULL 20
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3
+2 MATERIALIZED t1 ALL NULL NULL NULL NULL 7
select * from t3 where b in (select a from t1);
a b pk1 pk2 pk3
1 1 1 1 1
@@ -108,11 +104,14 @@ primary key(pk1, pk2)
insert into t3 select
A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a
from t0 A, t0 B where B.a <5;
+analyze table t3 persistent for all;
+Table Op Msg_type Msg_text
+test.t3 analyze status Engine-independent statistics collected
+test.t3 analyze status OK
explain select * from t3 where b in (select a from t0);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t3 ALL b NULL NULL NULL #
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func #
-2 MATERIALIZED t0 ALL NULL NULL NULL NULL #
+1 PRIMARY t0 ALL NULL NULL NULL NULL # Using where; Start temporary
+1 PRIMARY t3 ref b b 5 test.t0.a # End temporary
select * from t3 where b in (select A.a+B.a from t0 A, t0 B where B.a<5);
a b pk1 pk2
0 0 0 0
@@ -133,20 +132,17 @@ set join_buffer_size= @save_join_buffer_size;
set max_heap_table_size= @save_max_heap_table_size;
explain select * from t1 where a in (select b from t2);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 3
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 index b b 5 NULL 20 Using index
-select * from t1;
-a b
-1 1
-1 1
-2 2
+1 PRIMARY t1 ALL NULL NULL NULL NULL 7 Using where
+1 PRIMARY t2 ref b b 5 test.t1.a 1 Using index; FirstMatch(t1)
select * from t1 where a in (select b from t2);
a b
1 1
1 1
2 2
drop table t1, t2, t3;
+#
+# Test join buffering
+#
set @save_join_buffer_size = @@join_buffer_size;
set join_buffer_size= 8192;
create table t1 (a int, filler1 binary(200), filler2 binary(200));
@@ -158,7 +154,7 @@ insert into t1 values (2, 'duplicate ok', 'duplicate ok');
insert into t1 values (18, 'duplicate ok', 'duplicate ok');
insert into t2 values (3, 'duplicate ok', 'duplicate ok');
insert into t2 values (19, 'duplicate ok', 'duplicate ok');
-explain select
+explain select
a, mid(filler1, 1,10), length(filler1)=length(filler2) as Z
from t1 ot where a in (select a from t2 it);
id select_type table type possible_keys key key_len ref rows Extra
@@ -346,9 +342,9 @@ t2.Code IN (SELECT Country FROM t3
WHERE Language='English' AND Percentage > 10 AND
t2.Population > 100000);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 range Population,Country Population 4 NULL 1 Using index condition; Rowid-ordered scan; Start temporary
-1 PRIMARY t2 eq_ref PRIMARY,Population PRIMARY 3 test.t1.Country 1 Using where; End temporary
-1 PRIMARY t3 eq_ref PRIMARY,Percentage PRIMARY 33 test.t1.Country,const 1 Using index condition; Using where
+1 PRIMARY t3 ALL PRIMARY,Percentage NULL NULL NULL 22 Using where
+1 PRIMARY t1 ref Population,Country Country 3 test.t3.Country 0 Using where; LooseScan
+1 PRIMARY t2 eq_ref PRIMARY,Population PRIMARY 3 test.t3.Country 1 Using where
set optimizer_switch=@bug35674_save_optimizer_switch;
DROP TABLE t1,t2,t3;
CREATE TABLE t1 (
@@ -630,7 +626,7 @@ select * from t1 left join t2 on (t2.a= t1.a and t2.a in (select pk from t3));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3
1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where
-2 MATERIALIZED t3 index PRIMARY PRIMARY 4 NULL 10 Using index
+2 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY PRIMARY 4 func 1 Using index
drop table t0, t1, t2, t3;
create table t1 (a int);
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
@@ -742,9 +738,8 @@ alter table t3 add primary key(id), add key(a);
The following must use loose index scan over t3, key a:
explain select count(a) from t2 where a in ( SELECT a FROM t3);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 index a a 5 NULL 1000 Using index
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t3 index a a 5 NULL 30000 Using index
+1 PRIMARY t2 index a a 5 NULL 1000 Using where; Using index
+1 PRIMARY t3 ref a a 5 test.t2.a 30 Using index; FirstMatch(t2)
select count(a) from t2 where a in ( SELECT a FROM t3);
count(a)
1000
@@ -772,8 +767,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where
1 PRIMARY t2 ALL NULL NULL NULL NULL 1
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 FirstMatch(t2)
-1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 Using where
-3 MATERIALIZED t2 ALL NULL NULL NULL NULL 1
+1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where; FirstMatch(t3)
select 1 from t2 where
c2 in (select 1 from t3, t2) and
c1 in (select convert(c6,char(1)) from t2);
@@ -841,9 +835,9 @@ explain
SELECT * FROM t3
WHERE f12 IN (SELECT alias2.f12 FROM t1 AS alias1, t2 AS alias2, t1 WHERE alias1.f13 = 24);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY alias1 const PRIMARY PRIMARY 4 const # Using index
+1 PRIMARY alias1 const PRIMARY PRIMARY 4 const #
1 PRIMARY alias2 index f12 f12 7 NULL # Using index; LooseScan
-1 PRIMARY t1 index NULL PRIMARY 4 NULL # Using index; FirstMatch(alias2)
+1 PRIMARY t1 ALL NULL NULL NULL NULL # FirstMatch(alias2)
1 PRIMARY t3 ALL NULL NULL NULL NULL # Using where; Using join buffer (flat, BNL join)
SELECT * FROM t3
WHERE f12 IN (SELECT alias2.f12 FROM t1 AS alias1, t2 AS alias2, t1 WHERE alias1.f13 = 24);
@@ -913,9 +907,9 @@ SELECT * FROM t3 LEFT JOIN (v1,t2) ON t3.a = t2.a
WHERE t3.b IN (SELECT b FROM t4);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 1
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where
1 PRIMARY <derived3> ALL NULL NULL NULL NULL 2
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
2 MATERIALIZED t4 ALL NULL NULL NULL NULL 2
3 DERIVED t1 ALL NULL NULL NULL NULL 1
SELECT * FROM t3 LEFT JOIN (v1,t2) ON t3.a = t2.a
@@ -952,35 +946,47 @@ INSERT INTO t1 VALUES
(11,'z',8),(12,'c',7),(13,'a',6),(14,'q',5),(15,'y',4),
(16,'n',3),(17,'r',2),(18,'v',1),(19,'p',0);
CREATE TABLE t2 (
-pk INT, d VARCHAR(1), e INT,
+pk INT, d VARCHAR(1), e INT, f int,
PRIMARY KEY(pk), KEY(d,e)
) ENGINE=InnoDB;
-INSERT INTO t2 VALUES
+INSERT INTO t2 (pk,d,e) VALUES
(1,'x',1),(2,'d',2),(3,'r',3),(4,'f',4),(5,'y',5),
(6,'u',6),(7,'m',7),(8,'k',8),(9,'o',9),(10,'w',1),
(11,'m',2),(12,'q',3),(13,'m',4),(14,'d',5),
(15,'g',6),(16,'x',7),(17,'f',8);
+update t2 set f=pk/2;
analyze table t1,t2;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status OK
+# Original query, changed because of new optimizations
explain
SELECT * FROM t1 WHERE b IN (
SELECT d FROM t2, t1
WHERE a = d AND ( pk < 2 OR d = 'z' )
);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2
+1 PRIMARY t2 index PRIMARY,d d 9 NULL 17 Using where; Using index; LooseScan
+1 PRIMARY t1 ref a a 5 test.t2.d 1 Using where; Using index; FirstMatch(t2)
1 PRIMARY t1 ref b b 4 test.t2.d 1
-2 MATERIALIZED t2 index_merge PRIMARY,d d,PRIMARY 4,4 NULL 2 Using sort_union(d,PRIMARY); Using where
-2 MATERIALIZED t1 ref a a 5 test.t2.d 1 Using where; Using index
Warnings:
Note 1105 Cannot use key `d` part[0] for lookup: `test`.`t2`.`d` of type `varchar` = "`t1`.`a`" of type `int`
+explain
SELECT * FROM t1 WHERE b IN (
SELECT d FROM t2, t1
-WHERE a = d AND ( pk < 2 OR d = 'z' )
+WHERE a = d AND ( pk < 2 OR d = 'z' ) and f > 0
+);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t2 index_merge PRIMARY,d d,PRIMARY 4,4 NULL 2 Using sort_union(d,PRIMARY); Using where; Start temporary
+1 PRIMARY t1 ref a a 5 test.t2.d 1 Using where; Using index
+1 PRIMARY t1 ref b b 4 test.t2.d 1 End temporary
+Warnings:
+Note 1105 Cannot use key `d` part[0] for lookup: `test`.`t2`.`d` of type `varchar` = "`t1`.`a`" of type `int`
+SELECT * FROM t1 WHERE b IN (
+SELECT d FROM t2, t1
+WHERE a = d AND ( pk < 2 OR d = 'z' ) and f > 0
);
a b c
Warnings:
@@ -1228,10 +1234,10 @@ t1_pk1 t1_pk2 t3_i t3_c
explain
SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' );
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ref PRIMARY PRIMARY 5 const 1 Using where; Using index
-1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Start temporary
-1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-1 PRIMARY t4 index NULL PRIMARY 59 NULL 2 Using where; Using index; End temporary
+1 PRIMARY t1 ref PRIMARY PRIMARY 5 const 1 Using where
+1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where
+1 PRIMARY t4 ALL NULL NULL NULL NULL 2 Using where; FirstMatch(t3)
DROP TABLE t1,t2,t3,t4;
#
# MDEV-6263: Wrong result when using IN subquery with order by
@@ -1349,9 +1355,9 @@ WHERE
T3_0_.t3idref= 1
);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY T3_0_ ref PRIMARY,FK_T3_T2Id PRIMARY 8 const 3 Using index; Start temporary
+1 PRIMARY T3_0_ ref PRIMARY,FK_T3_T2Id PRIMARY 8 const 3 Start temporary
1 PRIMARY T2_1_ eq_ref PRIMARY,FK_T2_T1Id PRIMARY 8 test.T3_0_.t2idref 1
-1 PRIMARY T1_1_ eq_ref PRIMARY PRIMARY 8 test.T2_1_.t1idref 1 Using index
+1 PRIMARY T1_1_ eq_ref PRIMARY PRIMARY 8 test.T2_1_.t1idref 1
1 PRIMARY T2_0_ ref FK_T2_T1Id FK_T2_T1Id 8 test.T2_1_.t1idref 1 Using index; End temporary
drop table t3,t2,t1;
set optimizer_search_depth=@tmp7474;
@@ -1513,8 +1519,7 @@ t3.sack_id = 33479 AND t3.kit_id = 6;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ref PRIMARY PRIMARY 5 const,const 5 Using index
1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.cat_id 1 Using index
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t4 index cat_id cat_id 4 NULL 19 Using index
+1 PRIMARY t4 ref cat_id cat_id 4 test.t3.cat_id 1 Using index; FirstMatch(t1)
SELECT count(*) FROM t1, t3
WHERE t1.cat_id = t3.cat_id AND
t3.cat_id IN (SELECT cat_id FROM t4) AND
@@ -1529,8 +1534,7 @@ t3.sack_id = 33479 AND t3.kit_id = 6;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ref PRIMARY PRIMARY 5 const,const 5 Using index
1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.cat_id 1 Using index
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 Using where
-2 MATERIALIZED t2 index cat_id cat_id 4 NULL 19 Using index
+1 PRIMARY t2 ref cat_id cat_id 4 test.t3.cat_id 2 Using where; Using index; FirstMatch(t1)
SELECT count(*) FROM t1, t3
WHERE t1.cat_id = t3.cat_id AND
t3.cat_id IN (SELECT cat_id FROM t2) AND
@@ -1559,7 +1563,7 @@ WHERE ( b1, b1 ) IN ( SELECT a4, b4 FROM t3, t4);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t4 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary
1 PRIMARY t1 ref idx idx 2 test.t4.a4 1 100.00 Using index
-1 PRIMARY t3 ALL NULL NULL NULL NULL 2 100.00 End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t3 ALL NULL NULL NULL NULL 2 16.67 End temporary; Using join buffer (flat, BNL join)
1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b2` AS `b2` from `test`.`t1` semi join (`test`.`t3` join `test`.`t4`) left join `test`.`t2` on(`test`.`t2`.`a2` = `test`.`t4`.`a4`) where `test`.`t4`.`b4` = `test`.`t4`.`a4` and `test`.`t1`.`b1` = `test`.`t4`.`a4`
@@ -1577,7 +1581,7 @@ WHERE ( b1, b1 ) IN ( SELECT a4, b4 FROM t3, t4);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t4 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary
1 PRIMARY t1 ref idx idx 2 test.t4.a4 1 100.00 Using index
-1 PRIMARY t3 ALL NULL NULL NULL NULL 2 100.00 End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t3 ALL NULL NULL NULL NULL 2 16.67 End temporary; Using join buffer (flat, BNL join)
1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b2` AS `b2` from `test`.`t1` semi join (`test`.`t3` join `test`.`t4`) left join `test`.`t2` on(`test`.`t2`.`a2` = `test`.`t4`.`a4`) where `test`.`t4`.`b4` = `test`.`t4`.`a4` and `test`.`t1`.`b1` = `test`.`t4`.`a4`
@@ -1612,7 +1616,7 @@ WHERE c1 IN ( SELECT c4 FROM t3,t4 WHERE c3 = c4);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary; Using join buffer (flat, BNL join)
-1 PRIMARY t3 ALL NULL NULL NULL NULL 10 100.00 Using where; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t3 ALL NULL NULL NULL NULL 10 5.00 Using where; End temporary; Using join buffer (flat, BNL join)
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`c1` AS `c1`,`test`.`t2`.`c2` AS `c2` from `test`.`t1` semi join (`test`.`t3` join `test`.`t4`) left join `test`.`t2` on(`test`.`t2`.`c2` = `test`.`t1`.`c1` or `test`.`t1`.`c1` > 'z') where `test`.`t4`.`c4` = `test`.`t1`.`c1` and `test`.`t3`.`c3` = `test`.`t1`.`c1`
@@ -1661,7 +1665,7 @@ SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 = i2 OR 1=2);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 Using where
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00
-2 DEPENDENT SUBQUERY t3 hash_ALL NULL #hash#$hj 5 func 3 100.00 Using where; Using join buffer (flat, BNLH join)
+2 DEPENDENT SUBQUERY t3 hash_ALL NULL #hash#$hj 5 func 3 10.00 Using where; Using join buffer (flat, BNLH join)
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`i1` AS `i1` from `test`.`t1` where <expr_cache><`test`.`t1`.`i1`>(<in_optimizer>(`test`.`t1`.`i1`,<exists>(/* select#2 */ select `test`.`t3`.`i3` from `test`.`t2` join `test`.`t3` where `test`.`t3`.`i3` = `test`.`t2`.`i2` and <cache>(`test`.`t1`.`i1`) = `test`.`t3`.`i3`)))
SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 = i2 OR 1=2);
@@ -1671,12 +1675,11 @@ set optimizer_switch='materialization=on,semijoin=on';
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 = i2 OR 1=2);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00 Using where
-2 MATERIALIZED t3 hash_ALL NULL #hash#$hj 5 test.t2.i2 3 100.00 Using where; Using join buffer (flat, BNLH join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary
+1 PRIMARY t3 hash_ALL NULL #hash#$hj 5 test.t2.i2 3 10.00 Using where; Using join buffer (flat, BNLH join)
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 test.t2.i2 5 10.00 Using where; End temporary; Using join buffer (flat, BNLH join)
Warnings:
-Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where `test`.`t3`.`i3` = `test`.`t2`.`i2`
+Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where `test`.`t3`.`i3` = `test`.`t2`.`i2` and `test`.`t1`.`i1` = `test`.`t2`.`i2`
SELECT * FROM t1 WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 = i2 OR 1=2);
i1
7
@@ -1684,12 +1687,11 @@ EXPLAIN EXTENDED
SELECT * FROM t1
WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 > 0 AND i3 = i2 OR 1=2);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00 Using where
-2 MATERIALIZED t3 hash_ALL NULL #hash#$hj 5 test.t2.i2 3 100.00 Using where; Using join buffer (flat, BNLH join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary
+1 PRIMARY t3 hash_ALL NULL #hash#$hj 5 test.t2.i2 3 10.00 Using where; Using join buffer (flat, BNLH join)
+1 PRIMARY t1 hash_ALL NULL #hash#$hj 5 test.t2.i2 5 10.00 Using where; End temporary; Using join buffer (flat, BNLH join)
Warnings:
-Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where `test`.`t3`.`i3` = `test`.`t2`.`i2` and `test`.`t3`.`i3` > 0
+Note 1003 select `test`.`t1`.`i1` AS `i1` from `test`.`t1` semi join (`test`.`t2` join `test`.`t3`) where `test`.`t3`.`i3` = `test`.`t2`.`i2` and `test`.`t1`.`i1` = `test`.`t2`.`i2` and `test`.`t3`.`i3` > 0
SELECT * FROM t1
WHERE i1 IN (SELECT i3 FROM t2, t3 WHERE i3 > 0 AND i3 = i2 OR 1=2);
i1
@@ -1716,11 +1718,10 @@ i
explain extended
select * from t1 where (rand() < 0) and i in (select i from t2);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 10 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
+1 PRIMARY t2 ALL NULL NULL NULL NULL 10 10.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
Warnings:
-Note 1003 select `test`.`t1`.`i` AS `i` from `test`.`t1` semi join (`test`.`t2`) where rand() < 0
+Note 1003 select `test`.`t1`.`i` AS `i` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`i` = `test`.`t1`.`i` and rand() < 0
drop table t1,t2;
set optimizer_switch=@save_optimizer_switch;
#
@@ -1729,7 +1730,13 @@ set optimizer_switch=@save_optimizer_switch;
CREATE TABLE t1 (f1 varchar(8), KEY(f1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('qux'),('foo');
CREATE TABLE t2 (f2 varchar(8)) ENGINE=InnoDB;
-INSERT INTO t2 VALUES ('bar'),('foo'),('qux');
+INSERT INTO t2 VALUES ('bar'),('foo'),('qux'),('qq1'),('qq2');
+analyze table t1,t2 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+test.t2 analyze status Engine-independent statistics collected
+test.t2 analyze status OK
SELECT f1 FROM t1
WHERE f1 IN ( SELECT f2 FROM t2 WHERE f2 > 'bar' )
HAVING f1 != 'foo'
@@ -1741,9 +1748,8 @@ WHERE f1 IN ( SELECT f2 FROM t2 WHERE f2 > 'bar' )
HAVING f1 != 'foo'
ORDER BY f1;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 range f1 f1 11 NULL 2 Using where; Using index
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 11 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
+1 PRIMARY t1 range f1 f1 11 NULL 2 Using where; Using index; Using temporary; Using filesort
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
DROP TABLE t1,t2;
#
# MDEV-16225: wrong resultset from query with semijoin=on
@@ -1781,7 +1787,7 @@ OR
(t.id IN (0,4,12,13,1,10,3,11))
);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t index PRIMARY PRIMARY 4 NULL 114 Using where; Using index
+1 PRIMARY t ALL PRIMARY NULL NULL NULL 114 Using where
2 MATERIALIZED A ALL PRIMARY NULL NULL NULL 114
2 MATERIALIZED <subquery3> eq_ref distinct_key distinct_key 67 func 1
3 MATERIALIZED B range PRIMARY PRIMARY 4 NULL 8 Using where
@@ -1840,16 +1846,15 @@ explain
SELECT t2.id FROM t2,t1
WHERE t2.id IN (SELECT t3.ref_id FROM t3,t1 where t3.id = t1.id) and t2.id = t1.id;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 30 Using index
-1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.id 1 Using index
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 Using where
-2 MATERIALIZED t3 ALL NULL NULL NULL NULL 14
-2 MATERIALIZED t1 eq_ref PRIMARY PRIMARY 4 test.t3.id 1 Using index
+1 PRIMARY t3 ALL NULL NULL NULL NULL 14 Using where; Start temporary
+1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t3.ref_id 1 Using where; Using index
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.id 1 Using index; End temporary
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.ref_id 1 Using where; Using index
SELECT t2.id FROM t2,t1
WHERE t2.id IN (SELECT t3.ref_id FROM t3,t1 where t3.id = t1.id) and t2.id = t1.id;
id
-10
11
+10
set optimizer_switch='materialization=off';
SELECT t2.id FROM t2,t1
WHERE t2.id IN (SELECT t3.ref_id FROM t3,t1 where t3.id = t1.id) and t2.id = t1.id;
@@ -1946,16 +1951,15 @@ AND t3.id_product IN (SELECT id_product FROM t2 t2_3 WHERE t2_3.id_t2 = 18 OR t2
AND t3.id_product IN (SELECT id_product FROM t2 t2_4 WHERE t2_4.id_t2 = 34 OR t2_4.id_t2 = 23)
AND t3.id_product IN (SELECT id_product FROM t2 t2_5 WHERE t2_5.id_t2 = 29 OR t2_5.id_t2 = 28 OR t2_5.id_t2 = 26);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t3 index PRIMARY PRIMARY 4 NULL 18 Using index
-1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 Using where
-1 PRIMARY t5 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t2_2 ref id_t2,id_product id_t2 5 const 12 Using where; Start temporary
+1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t2_2.id_product 1 Using where; Using index; End temporary
1 PRIMARY t4 eq_ref PRIMARY PRIMARY 8 test.t3.id_product,const 1 Using where; Using index
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 Using where
1 PRIMARY <subquery4> eq_ref distinct_key distinct_key 4 func 1 Using where
1 PRIMARY <subquery5> eq_ref distinct_key distinct_key 4 func 1 Using where
-1 PRIMARY t1 index NULL PRIMARY 8 NULL 73 Using where; Using index; Using join buffer (flat, BNL join)
1 PRIMARY <subquery6> eq_ref distinct_key distinct_key 4 func 1 Using where
-3 MATERIALIZED t2_2 ref id_t2,id_product id_t2 5 const 12
+1 PRIMARY t5 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t1 index NULL PRIMARY 8 NULL 73 Using where; Using index; Using join buffer (flat, BNL join)
2 MATERIALIZED t2_1 ALL id_t2,id_product NULL NULL NULL 223 Using where
4 MATERIALIZED t2_3 range id_t2,id_product id_t2 5 NULL 33 Using index condition; Using where
5 MATERIALIZED t2_4 range id_t2,id_product id_t2 5 NULL 18 Using index condition; Using where
diff --git a/mysql-test/main/subselect_sj2_mat.test b/mysql-test/main/subselect_sj2_mat.test
index 4b768652..e38418f4 100644
--- a/mysql-test/main/subselect_sj2_mat.test
+++ b/mysql-test/main/subselect_sj2_mat.test
@@ -300,7 +300,8 @@ set optimizer_switch=@save_optimizer_switch;
CREATE TABLE t1 (f1 varchar(8), KEY(f1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('qux'),('foo');
CREATE TABLE t2 (f2 varchar(8)) ENGINE=InnoDB;
-INSERT INTO t2 VALUES ('bar'),('foo'),('qux');
+INSERT INTO t2 VALUES ('bar'),('foo'),('qux'),('qq1'),('qq2');
+analyze table t1,t2 persistent for all;
let $q=
SELECT f1 FROM t1
diff --git a/mysql-test/main/subselect_sj_jcl6.result b/mysql-test/main/subselect_sj_jcl6.result
index 6efa3fc1..6e397ddd 100644
--- a/mysql-test/main/subselect_sj_jcl6.result
+++ b/mysql-test/main/subselect_sj_jcl6.result
@@ -87,24 +87,24 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t10` join `test`.`t12` join `test`.`t1` where `test`.`t12`.`pk` = `test`.`t10`.`a` and `test`.`t10`.`pk` = `test`.`t1`.`a`
subqueries within outer joins go into ON expr.
-explAin extended
+explain extended
select * from t1 left join (t2 A, t2 B) on ( A.A= t1.A And B.A in (select pk from t10));
-id select_type tABle type possiBle_keys key key_len ref rows filtered ExtrA
+id select_type table type possible_keys key key_len ref rows filtered ExtrA
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00
1 PRIMARY A ALL NULL NULL NULL NULL 3 100.00 Using where; Using join Buffer (flAt, BNL join)
1 PRIMARY B ALL NULL NULL NULL NULL 3 100.00 Using where; Using join Buffer (incrementAl, BNL join)
-2 MATERIALIZED t10 index PRIMARY PRIMARY 4 NULL 10 100.00 Using index
+2 DEPENDENT SUBQUERY t10 unique_suBquery PRIMARY PRIMARY 4 func 1 100.00 Using index
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`A`.`A` AS `A`,`test`.`A`.`B` AS `B`,`test`.`B`.`A` AS `A`,`test`.`B`.`B` AS `B` from `test`.`t1` left join (`test`.`t2` `A` join `test`.`t2` `B`) on(`test`.`A`.`A` = `test`.`t1`.`A` And <in_optimizer>(`test`.`B`.`A`,`test`.`B`.`A` in ( <mAteriAlize> (/* select#2 */ select `test`.`t10`.`pk` from `test`.`t10` ), <primAry_index_lookup>(`test`.`B`.`A` in <temporAry tABle> on distinct_key where `test`.`B`.`A` = `<suBquery2>`.`pk`)))) where 1
+Note 1003 /* select#1 */ select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`A`.`A` AS `A`,`test`.`A`.`B` AS `B`,`test`.`B`.`A` AS `A`,`test`.`B`.`B` AS `B` from `test`.`t1` left join (`test`.`t2` `A` join `test`.`t2` `B`) on(`test`.`A`.`A` = `test`.`t1`.`A` And <in_optimizer>(`test`.`B`.`A`,<exists>(<primAry_index_lookup>(<cAche>(`test`.`B`.`A`) in t10 on PRIMARY)))) where 1
t2 should be wrapped into OJ-nest, so we have "t1 LJ (t2 J t10)"
-explAin extended
+explain extended
select * from t1 left join t2 on (t2.A= t1.A And t2.A in (select pk from t10));
-id select_type tABle type possiBle_keys key key_len ref rows filtered ExtrA
+id select_type table type possible_keys key key_len ref rows filtered ExtrA
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00
1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join Buffer (flAt, BNL join)
-2 MATERIALIZED t10 index PRIMARY PRIMARY 4 NULL 10 100.00 Using index
+2 DEPENDENT SUBQUERY t10 unique_suBquery PRIMARY PRIMARY 4 func 1 100.00 Using index
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`t2`.`A` AS `A`,`test`.`t2`.`B` AS `B` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`A` = `test`.`t1`.`A` And <in_optimizer>(`test`.`t1`.`A`,`test`.`t1`.`A` in ( <mAteriAlize> (/* select#2 */ select `test`.`t10`.`pk` from `test`.`t10` ), <primAry_index_lookup>(`test`.`t1`.`A` in <temporAry tABle> on distinct_key where `test`.`t1`.`A` = `<suBquery2>`.`pk`)))) where 1
+Note 1003 /* select#1 */ select `test`.`t1`.`A` AS `A`,`test`.`t1`.`B` AS `B`,`test`.`t2`.`A` AS `A`,`test`.`t2`.`B` AS `B` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`A` = `test`.`t1`.`A` And <in_optimizer>(`test`.`t1`.`A`,<exists>(<primAry_index_lookup>(<cAche>(`test`.`t2`.`A`) in t10 on PRIMARY)))) where 1
set @save_join_buffer_size=@@join_buffer_size;
set join_buffer_size=8*1024;
we shouldn't flatten if we're going to get a join of > MAX_TABLES.
@@ -171,26 +171,26 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY s47 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
1 PRIMARY s48 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
1 PRIMARY s49 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
-2 DEPENDENT SUBQUERY m00 ALL NULL NULL NULL NULL 3 Using where
-2 DEPENDENT SUBQUERY m01 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY m02 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
-2 DEPENDENT SUBQUERY m03 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
-2 DEPENDENT SUBQUERY m04 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
-2 DEPENDENT SUBQUERY m05 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
-2 DEPENDENT SUBQUERY m06 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
-2 DEPENDENT SUBQUERY m07 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
-2 DEPENDENT SUBQUERY m08 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
-2 DEPENDENT SUBQUERY m09 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
-2 DEPENDENT SUBQUERY m10 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
-2 DEPENDENT SUBQUERY m11 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
-2 DEPENDENT SUBQUERY m12 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
-2 DEPENDENT SUBQUERY m13 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
-2 DEPENDENT SUBQUERY m14 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
-2 DEPENDENT SUBQUERY m15 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
-2 DEPENDENT SUBQUERY m16 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
-2 DEPENDENT SUBQUERY m17 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
-2 DEPENDENT SUBQUERY m18 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
-2 DEPENDENT SUBQUERY m19 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
+2 MATERIALIZED m00 ALL NULL NULL NULL NULL 3
+2 MATERIALIZED m01 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join)
+2 MATERIALIZED m02 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
+2 MATERIALIZED m03 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
+2 MATERIALIZED m04 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
+2 MATERIALIZED m05 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
+2 MATERIALIZED m06 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
+2 MATERIALIZED m07 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
+2 MATERIALIZED m08 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
+2 MATERIALIZED m09 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
+2 MATERIALIZED m10 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
+2 MATERIALIZED m11 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
+2 MATERIALIZED m12 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
+2 MATERIALIZED m13 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
+2 MATERIALIZED m14 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
+2 MATERIALIZED m15 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
+2 MATERIALIZED m16 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
+2 MATERIALIZED m17 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
+2 MATERIALIZED m18 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
+2 MATERIALIZED m19 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
select * from
t1 left join t2 on (t2.a= t1.a and t2.a in (select pk from t10))
where t1.a < 5;
@@ -355,8 +355,8 @@ WHERE PNUM IN
(SELECT PNUM FROM PROJ));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY STAFF ALL NULL NULL NULL NULL 5
-1 PRIMARY PROJ ALL NULL NULL NULL NULL 6 Using join buffer (flat, BNL join)
-1 PRIMARY WORKS ALL NULL NULL NULL NULL 12 Using where; FirstMatch(STAFF); Using join buffer (incremental, BNL join)
+1 PRIMARY PROJ ALL NULL NULL NULL NULL 6 Start temporary; Using join buffer (flat, BNL join)
+1 PRIMARY WORKS ALL NULL NULL NULL NULL 12 Using where; End temporary; Using join buffer (incremental, BNL join)
SELECT EMPNUM, EMPNAME
FROM STAFF
WHERE EMPNUM IN
@@ -513,7 +513,7 @@ EXPLAIN EXTENDED SELECT vkey FROM t0 WHERE pk IN
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t0 ALL PRIMARY NULL NULL NULL 5 100.00
1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t0.pk 1 100.00 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
-1 PRIMARY t2 ref vkey vkey 4 test.t1.vnokey 2 100.00 Using index; FirstMatch(t1)
+1 PRIMARY t2 ref vkey vkey 4 test.t1.vnokey 1 100.00 Using index; FirstMatch(t1)
Warnings:
Note 1003 select `test`.`t0`.`vkey` AS `vkey` from `test`.`t0` `t1` semi join (`test`.`t0` `t2`) join `test`.`t0` where `test`.`t1`.`pk` = `test`.`t0`.`pk` and `test`.`t2`.`vkey` = `test`.`t1`.`vnokey`
SELECT vkey FROM t0 WHERE pk IN
@@ -775,7 +775,7 @@ select a from t1
where a in (select c from t2 where d >= some(select e from t3 where b=e));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 7 100.00
-1 PRIMARY t2 ALL NULL NULL NULL NULL 6 100.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 6 16.67 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 4 100.00 Using where
Warnings:
Note 1276 Field or reference 'test.t1.b' of SELECT #3 was resolved in SELECT #1
@@ -813,20 +813,20 @@ PRIMARY KEY (pk)
INSERT INTO t1 VALUES (1,'o','ffff','ffff','ffoo','ffff','ffff','ffff','ffff','ffff','ffff',GeomFromText('POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))')), (2,'f','ffff','ffff','ffff', 'ffff','ffff','ffff','ffff','ffff','ffff',GeomFromText('POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))'));
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES (1,'i','iiii','iiii','iiii','iiii','ffff','ffff','ffff','ffff','ffff',GeomFromText('POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))')), (2,'f','ffff','ffff','ffff','ffff','ffff','ffff','ffff','ffff','ffff',GeomFromText('POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))'));
+insert into t2 (pk) values (-1),(0);
EXPLAIN EXTENDED SELECT pk FROM t1 WHERE (a, b) IN (SELECT a, b FROM t2 WHERE pk > 0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 11 func,func 1 100.00
-2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan
+1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 50.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join)
Warnings:
-Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`pk` > 0
+Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`pk` > 0
SELECT pk FROM t1 WHERE (a, b) IN (SELECT a, b FROM t2 WHERE pk > 0);
pk
2
EXPLAIN EXTENDED SELECT pk FROM t1 WHERE (b, c) IN (SELECT b, c FROM t2 WHERE pk > 0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join)
+1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 50.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`c` = `test`.`t1`.`c` and `test`.`t2`.`pk` > 0
SELECT pk FROM t1 WHERE (b, c) IN (SELECT b, c FROM t2 WHERE pk > 0);
@@ -836,7 +836,7 @@ pk
EXPLAIN EXTENDED SELECT pk FROM t1 WHERE (b, d) IN (SELECT b, d FROM t2 WHERE pk > 0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join)
+1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 50.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`d` = `test`.`t1`.`d` and `test`.`t2`.`pk` > 0
SELECT pk FROM t1 WHERE (b, d) IN (SELECT b, d FROM t2 WHERE pk > 0);
@@ -845,7 +845,7 @@ pk
EXPLAIN EXTENDED SELECT pk FROM t1 WHERE (b, e) IN (SELECT b, e FROM t2 WHERE pk > 0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join)
+1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 50.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`e` = `test`.`t1`.`e` and `test`.`t2`.`pk` > 0
SELECT pk FROM t1 WHERE (b, e) IN (SELECT b, e FROM t2 WHERE pk > 0);
@@ -855,7 +855,7 @@ pk
EXPLAIN EXTENDED SELECT pk FROM t1 WHERE (b, f) IN (SELECT b, f FROM t2 WHERE pk > 0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join)
+1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 50.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`f` = `test`.`t1`.`f` and `test`.`t2`.`pk` > 0
SELECT pk FROM t1 WHERE (b, f) IN (SELECT b, f FROM t2 WHERE pk > 0);
@@ -865,7 +865,7 @@ pk
EXPLAIN EXTENDED SELECT pk FROM t1 WHERE (b, g) IN (SELECT b, g FROM t2 WHERE pk > 0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join)
+1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 50.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`g` = `test`.`t1`.`g` and `test`.`t2`.`pk` > 0
SELECT pk FROM t1 WHERE (b, g) IN (SELECT b, g FROM t2 WHERE pk > 0);
@@ -875,7 +875,7 @@ pk
EXPLAIN EXTENDED SELECT pk FROM t1 WHERE (b, h) IN (SELECT b, h FROM t2 WHERE pk > 0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join)
+1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 50.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`h` = `test`.`t1`.`h` and `test`.`t2`.`pk` > 0
SELECT pk FROM t1 WHERE (b, h) IN (SELECT b, h FROM t2 WHERE pk > 0);
@@ -885,7 +885,7 @@ pk
EXPLAIN EXTENDED SELECT pk FROM t1 WHERE (b, i) IN (SELECT b, i FROM t2 WHERE pk > 0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join)
+1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 50.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`i` = `test`.`t1`.`i` and `test`.`t2`.`pk` > 0
SELECT pk FROM t1 WHERE (b, i) IN (SELECT b, i FROM t2 WHERE pk > 0);
@@ -895,7 +895,7 @@ pk
EXPLAIN EXTENDED SELECT pk FROM t1 WHERE (b, j) IN (SELECT b, j FROM t2 WHERE pk > 0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join)
+1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 50.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`j` = `test`.`t1`.`j` and `test`.`t2`.`pk` > 0
SELECT pk FROM t1 WHERE (b, j) IN (SELECT b, j FROM t2 WHERE pk > 0);
@@ -905,7 +905,7 @@ pk
EXPLAIN EXTENDED SELECT pk FROM t1 WHERE (b, k) IN (SELECT b, k FROM t2 WHERE pk > 0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 100.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join)
+1 PRIMARY t2 range PRIMARY PRIMARY 4 NULL 2 50.00 Using index condition; Using where; Rowid-ordered scan; FirstMatch(t1); Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`b` and `test`.`t2`.`k` = `test`.`t1`.`k` and `test`.`t2`.`pk` > 0
SELECT pk FROM t1 WHERE (b, k) IN (SELECT b, k FROM t2 WHERE pk > 0);
@@ -985,10 +985,9 @@ FROM t1
WHERE `varchar_nokey` < 'n' XOR `pk` ) ;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 18 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1 100.00
-2 MATERIALIZED t1 ALL varchar_key NULL NULL NULL 15 100.00 Using where
+1 PRIMARY t1 ALL varchar_key NULL NULL NULL 15 6.67 Using where; FirstMatch(t2); Using join buffer (flat, BNL join)
Warnings:
-Note 1003 select `test`.`t2`.`varchar_nokey` AS `varchar_nokey` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`varchar_nokey` = `test`.`t1`.`varchar_key` and (`test`.`t1`.`varchar_key` < 'n' xor `test`.`t1`.`pk`)
+Note 1003 select `test`.`t2`.`varchar_nokey` AS `varchar_nokey` from `test`.`t2` semi join (`test`.`t1`) where `test`.`t1`.`varchar_key` = `test`.`t2`.`varchar_nokey` and `test`.`t1`.`varchar_nokey` = `test`.`t2`.`varchar_nokey` and (`test`.`t2`.`varchar_nokey` < 'n' xor `test`.`t1`.`pk`)
SELECT varchar_nokey
FROM t2
WHERE ( `varchar_nokey` , `varchar_nokey` ) IN (
@@ -1067,10 +1066,8 @@ AND t1.val IN (SELECT t3.val FROM t3
WHERE t3.val LIKE 'a%' OR t3.val LIKE 'e%');
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 5
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 13 func 1
-1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 13 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 6 Using where
-3 MATERIALIZED t3 ALL NULL NULL NULL NULL 5 Using where
+1 PRIMARY t2 ALL NULL NULL NULL NULL 6 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+1 PRIMARY t3 ALL NULL NULL NULL NULL 5 Using where; FirstMatch(t2); Using join buffer (incremental, BNL join)
SELECT *
FROM t1
WHERE t1.val IN (SELECT t2.val FROM t2
@@ -1260,8 +1257,8 @@ INSERT INTO t2 VALUES (1, 0), (1, 1), (2, 0), (2, 1);
EXPLAIN
SELECT * FROM t1 WHERE (i) IN (SELECT i FROM t2 where j > 0);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 index k k 10 NULL 4 Using where; Using index; Start temporary
-1 PRIMARY t1 ALL NULL NULL NULL NULL 5 Using where; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t1 ALL NULL NULL NULL NULL 5 Using where
+1 PRIMARY t2 ref k k 5 test.t1.i 1 Using where; Using index; Start temporary; End temporary
SELECT * FROM t1 WHERE (i) IN (SELECT i FROM t2 where j > 0);
i
1
@@ -1637,7 +1634,7 @@ drop table t1,t2;
# BUG#787299: Valgrind complains on a join query with two IN subqueries
#
create table t1 (a int);
-insert into t1 values (1), (2), (3);
+insert into t1 values (1), (2), (3),(1000),(2000);
create table t2 as select * from t1;
select * from t1 A, t1 B
where A.a = B.a and A.a in (select a from t2 C) and B.a in (select a from t2 D);
@@ -1645,16 +1642,16 @@ a a
1 1
2 2
3 3
+1000 1000
+2000 2000
explain
select * from t1 A, t1 B
where A.a = B.a and A.a in (select a from t2 C) and B.a in (select a from t2 D);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY A ALL NULL NULL NULL NULL 3
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-1 PRIMARY B ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
-1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED C ALL NULL NULL NULL NULL 3
-3 MATERIALIZED D ALL NULL NULL NULL NULL 3
+1 PRIMARY A ALL NULL NULL NULL NULL 5
+1 PRIMARY C ALL NULL NULL NULL NULL 5 Using where; FirstMatch(A); Using join buffer (flat, BNL join)
+1 PRIMARY B ALL NULL NULL NULL NULL 5 Using where; Using join buffer (incremental, BNL join)
+1 PRIMARY D ALL NULL NULL NULL NULL 5 Using where; FirstMatch(B); Using join buffer (incremental, BNL join)
drop table t1, t2;
#
# BUG#784441: Abort on semijoin with a view as the inner table
@@ -1991,7 +1988,7 @@ f1 f3 f4 f2 f4
DROP TABLE t1,t2,t3;
#
# BUG#803457: Wrong result with semijoin + view + outer join in maria-5.3-subqueries-mwl90
-# (Original testcase)
+# (Original, slightly modified testcase)
#
CREATE TABLE t1 (f1 int, f2 int );
INSERT INTO t1 VALUES (2,0),(4,0),(0,NULL);
@@ -2001,24 +1998,22 @@ CREATE TABLE t3 ( f1 int, f3 int );
INSERT INTO t3 VALUES (2,0),(4,0),(0,NULL),(4,0),(8,0);
CREATE TABLE t4 ( f2 int, KEY (f2) );
INSERT INTO t4 VALUES (0),(NULL);
-CREATE VIEW v4 AS SELECT DISTINCT f2 FROM t4 ;
+INSERT INTO t4 VALUES (0),(NULL),(-1),(-2),(-3);
# The following must not have outer joins:
explain extended
-SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4);
+SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4 where f2 = 0 or f2 IS NULL);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+1 PRIMARY t4 ref_or_null f2 f2 5 const 4 25.00 Using where; Using index; FirstMatch(t2)
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (incremental, BNL join)
-2 MATERIALIZED t4 index f2 f2 5 NULL 2 100.00 Using index
Warnings:
-Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2`,`test`.`t2`.`f3` AS `f3`,`test`.`t3`.`f3` AS `f3` from `test`.`t1` semi join (`test`.`t4`) join `test`.`t2` join `test`.`t3` where `test`.`t3`.`f1` = `test`.`t1`.`f1` and `test`.`t1`.`f2` = `test`.`t2`.`f2`
-SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4);
+Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2`,`test`.`t2`.`f3` AS `f3`,`test`.`t3`.`f3` AS `f3` from `test`.`t1` semi join (`test`.`t4`) join `test`.`t2` join `test`.`t3` where `test`.`t4`.`f2` = `test`.`t2`.`f3` and `test`.`t3`.`f1` = `test`.`t1`.`f1` and `test`.`t1`.`f2` = `test`.`t2`.`f2` and (`test`.`t2`.`f3` = 0 or `test`.`t2`.`f3` is null)
+SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4 where f2 = 0 or f2 IS NULL);
f1 f2 f3 f3
2 0 0 0
4 0 0 0
4 0 0 0
-drop view v4;
drop table t1, t2, t3, t4;
#
# BUG#803303: Wrong result with semijoin=on, outer join in maria-5.3-subqueries-mwl90
@@ -2164,9 +2159,9 @@ INSERT INTO t3 VALUES (6,5),(6,2),(8,0),(9,1),(6,5);
explain
SELECT * FROM t1, t2 WHERE (t2.a , t1.b) IN (SELECT a, b FROM t3);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2
-1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 2 Using index; Using join buffer (flat, BNL join)
-1 PRIMARY t3 ALL b NULL NULL NULL 5 Using where; Start temporary; End temporary; Using join buffer (incremental, BNL join)
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
+1 PRIMARY t3 ref b b 5 test.t1.b 1 Using where; Start temporary; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 Using index; End temporary
SELECT * FROM t1, t2 WHERE (t2.a , t1.b) IN (SELECT a, b FROM t3);
b a
5 6
@@ -2189,10 +2184,10 @@ INSERT INTO t5 VALUES (7,0),(9,0);
explain
SELECT * FROM t3 WHERE t3.a IN (SELECT t5.a FROM t2, t4, t5 WHERE t2.c = t5.a AND t2.b = t5.b);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t5 index a a 10 NULL 2 Using where; Using index; LooseScan
-1 PRIMARY t2 ref b b 5 test.t5.b 2 Using where
-1 PRIMARY t4 ALL NULL NULL NULL NULL 3 FirstMatch(t5)
-1 PRIMARY t3 ALL NULL NULL NULL NULL 15 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t5 index a a 10 NULL 2 Using where; Using index; Start temporary
+1 PRIMARY t2 ref b b 5 test.t5.b 1 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 PRIMARY t4 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join)
+1 PRIMARY t3 ALL NULL NULL NULL NULL 15 Using where; End temporary; Using join buffer (incremental, BNL join)
SELECT * FROM t3 WHERE t3.a IN (SELECT t5.a FROM t2, t4, t5 WHERE t2.c = t5.a AND t2.b = t5.b);
a
0
@@ -2271,10 +2266,10 @@ alias1.c IN (SELECT SQ3_alias1.b
FROM t2 AS SQ3_alias1 STRAIGHT_JOIN t2 AS SQ3_alias2)
LIMIT 100;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <derived2> ALL NULL NULL NULL NULL 20
-1 PRIMARY alias2 ALL NULL NULL NULL NULL 20 Using join buffer (flat, BNL join)
-1 PRIMARY t2 ALL NULL NULL NULL NULL 20 Using join buffer (incremental, BNL join)
-1 PRIMARY SQ3_alias1 ALL NULL NULL NULL NULL 20 Using where; Start temporary; Using join buffer (incremental, BNL join)
+1 PRIMARY alias2 ALL NULL NULL NULL NULL 20
+1 PRIMARY t2 ALL NULL NULL NULL NULL 20 Using join buffer (flat, BNL join)
+1 PRIMARY SQ3_alias1 ALL NULL NULL NULL NULL 20 Start temporary; Using join buffer (incremental, BNL join)
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 20 Using where; Using join buffer (incremental, BNL join)
1 PRIMARY SQ3_alias2 index NULL PRIMARY 4 NULL 20 Using index; End temporary; Using join buffer (incremental, BNL join)
2 DERIVED t2 ALL NULL NULL NULL NULL 20
create table t3 as
@@ -2447,9 +2442,9 @@ SET SESSION optimizer_switch='loosescan=off';
EXPLAIN
SELECT * FROM t1 WHERE a IN (SELECT t2.a FROM t2,t3 WHERE t2.b = t3.b);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 index idx idx 9 NULL 2 Using where; Using index; Start temporary
-1 PRIMARY t3 ref idx idx 4 test.t2.b 1 Using index
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4
+1 PRIMARY t2 range idx idx 4 NULL 2 Using where; Using index
+1 PRIMARY t3 ref idx idx 4 test.t2.b 1 Using index; FirstMatch(t1)
SELECT * FROM t1 WHERE a IN (SELECT t2.a FROM t2,t3 WHERE t2.b = t3.b);
a
5
@@ -2457,9 +2452,9 @@ SET SESSION optimizer_switch='loosescan=on';
EXPLAIN
SELECT * FROM t1 WHERE a IN (SELECT t2.a FROM t2,t3 WHERE t2.b = t3.b);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 index idx idx 9 NULL 2 Using where; Using index; Start temporary
-1 PRIMARY t3 ref idx idx 4 test.t2.b 1 Using index
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4
+1 PRIMARY t2 range idx idx 4 NULL 2 Using where; Using index
+1 PRIMARY t3 ref idx idx 4 test.t2.b 1 Using index; FirstMatch(t1)
SELECT * FROM t1 WHERE a IN (SELECT t2.a FROM t2,t3 WHERE t2.b = t3.b);
a
5
@@ -2510,10 +2505,9 @@ SELECT * FROM t1, t2
WHERE t1.a = t2.a AND t2.a IN (SELECT b FROM t3 STRAIGHT_JOIN t4);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 system NULL NULL NULL NULL 1
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 1
1 PRIMARY t1 ref a a 5 const 1 Using index
1 PRIMARY t2 ref a a 5 func 1 Using index
-2 MATERIALIZED t4 ALL NULL NULL NULL NULL 0
+1 PRIMARY t4 ALL NULL NULL NULL NULL 0 FirstMatch(t2); Using join buffer (flat, BNL join)
SELECT * FROM t1, t2
WHERE t1.a = t2.a AND t2.a IN (SELECT b FROM t3 STRAIGHT_JOIN t4);
a a
@@ -2573,7 +2567,7 @@ INSERT INTO t1 VALUES
(6,3),(7,1),(8,4),(9,3),(10,2);
CREATE TABLE t2 ( c INT, d INT, KEY(c) );
INSERT INTO t2 VALUES
-(1,2),(2,1),(3,3),(4,2),(5,5),(6,3),(7,1);
+(1,2),(2,1),(3,3),(4,2),(5,5),(6,3),(7,1),(11,11);
analyze table t1,t2;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
@@ -2583,18 +2577,20 @@ test.t2 analyze status OK
explain
SELECT a, b, d FROM t1, t2
WHERE ( b, d ) IN
-( SELECT b, d FROM t1, t2 WHERE b = c );
+( SELECT b, d FROM t1 as t3, t2 as t4 WHERE b = c );
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t2 ALL NULL NULL NULL NULL 7
-1 PRIMARY t1 index b b 5 NULL 10 Using where; Using index; LooseScan
-1 PRIMARY t2 ref c c 5 test.t1.b 1 Using where; FirstMatch(t1)
-1 PRIMARY t1 ref b b 5 test.t1.b 2 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 PRIMARY t3 index b b 5 NULL 10 Using where; Using index; Start temporary
+1 PRIMARY t4 ref c c 5 test.t3.b 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 PRIMARY t1 ALL b NULL NULL NULL 10 Using where; Using join buffer (incremental, BNL join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 8 Using where; End temporary; Using join buffer (incremental, BNL join)
SELECT a, b, d FROM t1, t2
WHERE ( b, d ) IN
-( SELECT b, d FROM t1, t2 WHERE b = c );
+( SELECT b, d FROM t1 as t3, t2 as t4 WHERE b = c );
a b d
1 2 1
1 2 1
+10 2 1
+10 2 1
2 1 2
2 1 2
3 3 3
@@ -2610,8 +2606,6 @@ a b d
8 4 2
9 3 3
9 3 3
-10 2 1
-10 2 1
DROP TABLE t1, t2;
# Another testcase for the above that still uses LooseScan:
create table t0(a int primary key);
@@ -2780,21 +2774,21 @@ WHERE (t1_1.a, t1_2.a) IN ( SELECT a, b FROM v1 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1_1 ALL NULL NULL NULL NULL 11 Using where
1 PRIMARY t1_2 ALL NULL NULL NULL NULL 11
-1 PRIMARY <derived3> ref key0 key0 5 test.t1_1.a 2 Using where; FirstMatch(t1_2)
+1 PRIMARY <derived3> ref key0 key0 5 test.t1_1.a 1 Using where; FirstMatch(t1_2)
3 DERIVED t1 ALL NULL NULL NULL NULL 11
SELECT * FROM t1 AS t1_1, t1 AS t1_2
WHERE (t1_1.a, t1_2.a) IN ( SELECT a, b FROM v1 );
a b a b
-3 1 9 1
-5 8 4 0
-3 9 9 1
2 4 4 0
2 4 6 8
2 6 4 0
2 6 6 8
+3 1 9 1
+3 9 9 1
5 4 4 0
-7 7 7 7
5 4 4 0
+5 8 4 0
+7 7 7 7
DROP VIEW v1;
DROP TABLE t1;
set @@join_cache_level= @tmp_jcl_978479;
@@ -2938,9 +2932,9 @@ alias2.col_int_key = alias1.col_int_key
WHERE alias1.pk = 58 OR alias1.col_varchar_key = 'o'
);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY alias1 index_merge PRIMARY,col_int_key,col_varchar_key PRIMARY,col_varchar_key 4,4 NULL 2 Using sort_union(PRIMARY,col_varchar_key); Using where; Start temporary
-1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-1 PRIMARY alias2 ALL col_int_key NULL NULL NULL 12 Range checked for each record (index map: 0x2); End temporary
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2
+1 PRIMARY alias1 index_merge PRIMARY,col_int_key,col_varchar_key PRIMARY,col_varchar_key 4,4 NULL 2 Using sort_union(PRIMARY,col_varchar_key); Using where
+1 PRIMARY alias2 ALL col_int_key NULL NULL NULL 12 Range checked for each record (index map: 0x2); FirstMatch(t2)
SELECT *
FROM t2
WHERE (field1) IN (SELECT alias1.col_varchar_nokey AS field1
@@ -3048,7 +3042,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 system NULL NULL NULL NULL 1 100.00 Using temporary; Using filesort
1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 5 100.00 Start temporary
1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t1.pk 1 100.00 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
-1 PRIMARY t3 ALL NULL NULL NULL NULL 2 100.00 Using where; End temporary; Using join buffer (incremental, BNL join)
+1 PRIMARY t3 ALL NULL NULL NULL NULL 2 10.00 Using where; End temporary; Using join buffer (incremental, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`c1` AS `c1`,'x' AS `c2` from `test`.`t1` semi join (`test`.`t1` left join `test`.`t3` on(`test`.`t1`.`c1` = `test`.`t3`.`c3`)) where `test`.`t1`.`pk` = `test`.`t1`.`pk` order by 'x',`test`.`t1`.`c1`
DROP TABLE t1,t2,t3;
@@ -3300,8 +3294,7 @@ explain extended
SELECT Id FROM t1 WHERE Id in (SELECT t1_Id FROM t2 WHERE t2.col1 IS NULL);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED t2 ref col1 col1 5 const 2 100.00 Using index condition; Using where
+1 PRIMARY t2 ref col1 col1 5 const 2 50.00 Using index condition; Using where; FirstMatch(t1)
Warnings:
Note 1003 select 1 AS `Id` from (`test`.`t2`) where `test`.`t2`.`t1_Id` = 1 and `test`.`t2`.`col1` is null
DROP TABLE t1, t2;
@@ -3416,13 +3409,13 @@ WHERE t2.a IN (SELECT b FROM t3 WHERE t3.d <= t1.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY t2 ALL PRIMARY NULL NULL NULL 4 Using join buffer (flat, BNL join)
-1 PRIMARY t3 ALL d NULL NULL NULL 5 Range checked for each record (index map: 0x2); FirstMatch(t2)
+1 PRIMARY t3 hash_ALL d #hash#$hj 5 test.t2.a 5 Using where; FirstMatch(t2); Using join buffer (flat, BNLH join)
SELECT * FROM t1, t2
WHERE t2.a IN (SELECT b FROM t3 WHERE t3.d <= t1.a);
a a b
+w 5 19:11:10
w 2 18:56:33
q 2 18:56:33
-w 5 19:11:10
SET SESSION optimizer_switch='mrr=on';
SET SESSION join_cache_level=6;
EXPLAIN
@@ -3431,13 +3424,13 @@ WHERE t2.a IN (SELECT b FROM t3 WHERE t3.d <= t1.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
1 PRIMARY t2 ALL PRIMARY NULL NULL NULL 4 Using join buffer (flat, BNL join)
-1 PRIMARY t3 ALL d NULL NULL NULL 5 Range checked for each record (index map: 0x2); FirstMatch(t2)
+1 PRIMARY t3 hash_ALL d #hash#$hj 5 test.t2.a 5 Using where; FirstMatch(t2); Using join buffer (incremental, BNLH join)
SELECT * FROM t1, t2
WHERE t2.a IN (SELECT b FROM t3 WHERE t3.d <= t1.a);
a a b
+w 5 19:11:10
w 2 18:56:33
q 2 18:56:33
-w 5 19:11:10
set optimizer_switch=@save_optimizer_switch;
set join_cache_level=default;
DROP TABLE t1,t2,t3;
@@ -3482,20 +3475,21 @@ INSERT INTO t2 VALUES ('v'), ('v'), ('s'), ('j');
CREATE TABLE t3 (c varchar(1), d varchar(1), INDEX idx_c(c) );
INSERT INTO t3 VALUES ('v','v'), ('v','v'), ('s','s'), ('j','j');
INSERT INTO t3 VALUES ('m','m'), ('d','d'), ('k','k'), ('m','m');
+insert into t1 select 'z','z' from seq_1_to_20;
set @tmp_otimizer_switch= @@optimizer_switch;
set @tmp_join_cache_level=@@join_cache_level;
set optimizer_switch = 'materialization=on,semijoin=on,join_cache_hashed=on';
set join_cache_level=0;
EXPLAIN
SELECT * FROM t1 LEFT JOIN t2 ON (c = b)
-WHERE (a, b) IN (SELECT a, b FROM t1 t);
+WHERE (a, b) IN (SELECT a, b FROM t1 t) having t1.a !='z';
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL idx_a NULL NULL NULL 3
+1 PRIMARY t1 ALL idx_a NULL NULL NULL 23
+1 PRIMARY t2 ref idx_c idx_c 4 test.t1.b 1 Using where; Using index
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1
-1 PRIMARY t2 ref idx_c idx_c 4 test.t1.b 2 Using where; Using index
-2 MATERIALIZED t ALL idx_a NULL NULL NULL 3
+2 MATERIALIZED t ALL idx_a NULL NULL NULL 23
SELECT * FROM t1 LEFT JOIN t2 ON (c = b)
-WHERE (a, b) IN (SELECT a, b FROM t1 t);
+WHERE (a, b) IN (SELECT a, b FROM t1 t) having t1.a !='z';
a b c
v v v
v v v
@@ -3503,14 +3497,14 @@ w w NULL
t t NULL
EXPLAIN
SELECT * FROM t1 LEFT JOIN t3 ON (c = b)
-WHERE (a, b) IN (SELECT a, b FROM t1 t);
+WHERE (a, b) IN (SELECT a, b FROM t1 t) having t1.a !='z';
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL idx_a NULL NULL NULL 3
+1 PRIMARY t1 ALL idx_a NULL NULL NULL 23
+1 PRIMARY t3 ref idx_c idx_c 4 test.t1.b 1 Using where
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1
-1 PRIMARY t3 ref idx_c idx_c 4 test.t1.b 2 Using where
-2 MATERIALIZED t ALL idx_a NULL NULL NULL 3
+2 MATERIALIZED t ALL idx_a NULL NULL NULL 23
SELECT * FROM t1 LEFT JOIN t3 ON (c = b)
-WHERE (a, b) IN (SELECT a, b FROM t1 t);
+WHERE (a, b) IN (SELECT a, b FROM t1 t) having t1.a !='z';
a b c d
v v v v
v v v v
@@ -3519,14 +3513,14 @@ t t NULL NULL
set join_cache_level=6;
EXPLAIN
SELECT * FROM t1 LEFT JOIN t2 ON (c = b)
-WHERE (a, b) IN (SELECT a, b FROM t1 t);
+WHERE (a, b) IN (SELECT a, b FROM t1 t) having t1.a !='z';
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL idx_a NULL NULL NULL 3
+1 PRIMARY t1 ALL idx_a NULL NULL NULL 23
+1 PRIMARY t2 ref idx_c idx_c 4 test.t1.b 1 Using where; Using index
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1
-1 PRIMARY t2 ref idx_c idx_c 4 test.t1.b 2 Using where; Using index
-2 MATERIALIZED t ALL idx_a NULL NULL NULL 3
+2 MATERIALIZED t ALL idx_a NULL NULL NULL 23
SELECT * FROM t1 LEFT JOIN t2 ON (c = b)
-WHERE (a, b) IN (SELECT a, b FROM t1 t);
+WHERE (a, b) IN (SELECT a, b FROM t1 t) having t1.a !='z';
a b c
v v v
v v v
@@ -3534,14 +3528,14 @@ w w NULL
t t NULL
EXPLAIN
SELECT * FROM t1 LEFT JOIN t3 ON (c = b)
-WHERE (a, b) IN (SELECT a, b FROM t1 t);
+WHERE (a, b) IN (SELECT a, b FROM t1 t) having t1.a !='z';
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL idx_a NULL NULL NULL 3
+1 PRIMARY t1 ALL idx_a NULL NULL NULL 23
+1 PRIMARY t3 ref idx_c idx_c 4 test.t1.b 1 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1
-1 PRIMARY t3 ref idx_c idx_c 4 test.t1.b 2 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
-2 MATERIALIZED t ALL idx_a NULL NULL NULL 3
+2 MATERIALIZED t ALL idx_a NULL NULL NULL 23
SELECT * FROM t1 LEFT JOIN t3 ON (c = b)
-WHERE (a, b) IN (SELECT a, b FROM t1 t);
+WHERE (a, b) IN (SELECT a, b FROM t1 t) having t1.a !='z';
a b c d
v v v v
v v v v
@@ -3568,9 +3562,8 @@ SELECT a FROM t1 t WHERE a IN (SELECT b FROM t1, t2 WHERE b = a)
GROUP BY a HAVING a != 'z';
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t range idx_a idx_a 4 NULL 3 Using where; Using index
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 Using where
-2 MATERIALIZED t1 ref idx_a idx_a 4 test.t2.b 2 Using index
+1 PRIMARY t1 ref idx_a idx_a 4 test.t.a 1 Using index
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; FirstMatch(t)
SELECT a FROM t1 t WHERE a IN (SELECT b FROM t1, t2 WHERE b = a)
GROUP BY a HAVING a != 'z';
a
@@ -3582,9 +3575,8 @@ SELECT a FROM t1 t WHERE a IN (SELECT b FROM t1, t2 WHERE b = a)
GROUP BY a HAVING a != 'z';
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t range idx_a idx_a 4 NULL 3 Using where; Using index
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 Using where
-2 MATERIALIZED t1 ref idx_a idx_a 4 test.t2.b 2 Using index
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
+1 PRIMARY t1 ref idx_a idx_a 4 test.t.a 1 Using index; FirstMatch(t)
SELECT a FROM t1 t WHERE a IN (SELECT b FROM t1, t2 WHERE b = a)
GROUP BY a HAVING a != 'z';
a
diff --git a/mysql-test/main/subselect_sj_jcl6.test b/mysql-test/main/subselect_sj_jcl6.test
index f4f605c0..e39a6887 100644
--- a/mysql-test/main/subselect_sj_jcl6.test
+++ b/mysql-test/main/subselect_sj_jcl6.test
@@ -3,6 +3,7 @@
#
--source include/no_valgrind_without_big.inc
--source include/default_optimizer_switch.inc
+--source include/have_sequence.inc
set @save_optimizer_switch_jcl6=@@optimizer_switch;
set @@optimizer_switch='optimize_join_buffer_size=on';
@@ -132,6 +133,8 @@ CREATE TABLE t3 (c varchar(1), d varchar(1), INDEX idx_c(c) );
INSERT INTO t3 VALUES ('v','v'), ('v','v'), ('s','s'), ('j','j');
INSERT INTO t3 VALUES ('m','m'), ('d','d'), ('k','k'), ('m','m');
+insert into t1 select 'z','z' from seq_1_to_20;
+
set @tmp_otimizer_switch= @@optimizer_switch;
set @tmp_join_cache_level=@@join_cache_level;
set optimizer_switch = 'materialization=on,semijoin=on,join_cache_hashed=on';
@@ -140,29 +143,29 @@ set join_cache_level=0;
EXPLAIN
SELECT * FROM t1 LEFT JOIN t2 ON (c = b)
- WHERE (a, b) IN (SELECT a, b FROM t1 t);
+ WHERE (a, b) IN (SELECT a, b FROM t1 t) having t1.a !='z';
SELECT * FROM t1 LEFT JOIN t2 ON (c = b)
- WHERE (a, b) IN (SELECT a, b FROM t1 t);
+ WHERE (a, b) IN (SELECT a, b FROM t1 t) having t1.a !='z';
EXPLAIN
SELECT * FROM t1 LEFT JOIN t3 ON (c = b)
- WHERE (a, b) IN (SELECT a, b FROM t1 t);
+ WHERE (a, b) IN (SELECT a, b FROM t1 t) having t1.a !='z';
SELECT * FROM t1 LEFT JOIN t3 ON (c = b)
- WHERE (a, b) IN (SELECT a, b FROM t1 t);
+ WHERE (a, b) IN (SELECT a, b FROM t1 t) having t1.a !='z';
set join_cache_level=6;
EXPLAIN
SELECT * FROM t1 LEFT JOIN t2 ON (c = b)
- WHERE (a, b) IN (SELECT a, b FROM t1 t);
+ WHERE (a, b) IN (SELECT a, b FROM t1 t) having t1.a !='z';
SELECT * FROM t1 LEFT JOIN t2 ON (c = b)
- WHERE (a, b) IN (SELECT a, b FROM t1 t);
+ WHERE (a, b) IN (SELECT a, b FROM t1 t) having t1.a !='z';
EXPLAIN
SELECT * FROM t1 LEFT JOIN t3 ON (c = b)
- WHERE (a, b) IN (SELECT a, b FROM t1 t);
+ WHERE (a, b) IN (SELECT a, b FROM t1 t) having t1.a !='z';
SELECT * FROM t1 LEFT JOIN t3 ON (c = b)
- WHERE (a, b) IN (SELECT a, b FROM t1 t);
+ WHERE (a, b) IN (SELECT a, b FROM t1 t) having t1.a !='z';
set optimizer_switch=@tmp_optimizer_switch;
set join_cache_level=@tmp_join_cache_level;
diff --git a/mysql-test/main/subselect_sj_mat.result b/mysql-test/main/subselect_sj_mat.result
index ed6a2a9e..e8d42228 100644
--- a/mysql-test/main/subselect_sj_mat.result
+++ b/mysql-test/main/subselect_sj_mat.result
@@ -107,11 +107,10 @@ a1 a2
explain extended
select * from t1i where a1 in (select b1 from t2i where b1 > '0');
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1i range _it1_idx _it1_idx # NULL 3 100.00 Using where;
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key # func 1 100.00
-2 MATERIALIZED t2i range it2i1,it2i3 it2i1 # NULL 5 100.00 Using where;
+1 PRIMARY t2i index it2i1,it2i3 it2i1 # NULL 5 50.00 Using where; Using index; LooseScan
+1 PRIMARY t1i ref _it1_idx _it1_idx # _ref_ 1 20.00
Warnings:
-Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) where `test`.`t2i`.`b1` > '0'
+Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) where `test`.`t1i`.`a1` = `test`.`t2i`.`b1` and `test`.`t2i`.`b1` > '0'
select * from t1i where a1 in (select b1 from t2i where b1 > '0');
a1 a2
1 - 01 2 - 01
@@ -119,11 +118,11 @@ a1 a2
explain extended
select * from t1i where a1 in (select max(b1) from t2i where b1 > '0' group by b1);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1i index it1i1,it1i3 # 18 # 3 100.00 #
-1 PRIMARY <subquery2> eq_ref distinct_key # 8 # 1 100.00 #
+1 PRIMARY <subquery2> ALL distinct_key # NULL # 5 100.00 #
+1 PRIMARY t1i ref it1i1,it1i3 # 9 # 1 100.00 #
2 MATERIALIZED t2i range it2i1,it2i3 # 9 # 5 100.00 #
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from <materialize> (/* select#2 */ select max(`test`.`t2i`.`b1`) from `test`.`t2i` where `test`.`t2i`.`b1` > '0' group by `test`.`t2i`.`b1`) join `test`.`t1i` where `<subquery2>`.`max(b1)` = `test`.`t1i`.`a1`
+Note 1003 /* select#1 */ select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from <materialize> (/* select#2 */ select max(`test`.`t2i`.`b1`) from `test`.`t2i` where `test`.`t2i`.`b1` > '0' group by `test`.`t2i`.`b1`) join `test`.`t1i` where `test`.`t1i`.`a1` = `<subquery2>`.`max(b1)`
select * from t1i where a1 in (select max(b1) from t2i where b1 > '0' group by b1);
a1 a2
1 - 01 2 - 01
@@ -131,11 +130,10 @@ a1 a2
explain extended
select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0');
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1i range _it1_idx _it1_idx # NULL 3 100.00 Using where;
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key # func,func 1 100.00
-2 MATERIALIZED t2i range it2i1,it2i2,it2i3 it2i3 # NULL 5 100.00 Using where;
+1 PRIMARY t2i index it2i1,it2i2,it2i3 it2i3 # NULL 5 50.00 Using where; Using index; LooseScan
+1 PRIMARY t1i ref _it1_idx _it1_idx # _ref_ 1 20.00
Warnings:
-Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) where `test`.`t2i`.`b1` > '0'
+Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) where `test`.`t1i`.`a1` = `test`.`t2i`.`b1` and `test`.`t1i`.`a2` = `test`.`t2i`.`b2` and `test`.`t2i`.`b1` > '0'
select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0');
a1 a2
1 - 01 2 - 01
@@ -143,11 +141,11 @@ a1 a2
explain extended
select * from t1i where (a1, a2) in (select b1, max(b2) from t2i where b1 > '0' group by b1);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1i index it1i1,it1i2,it1i3 # # # 3 100.00 #
-1 PRIMARY <subquery2> eq_ref distinct_key # # # 1 100.00 #
+1 PRIMARY <subquery2> ALL distinct_key # # # 5 100.00 #
+1 PRIMARY t1i ref it1i1,it1i2,it1i3 # # # 1 100.00 #
2 MATERIALIZED t2i range it2i1,it2i3 # # # 5 100.00 #
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from <materialize> (/* select#2 */ select `test`.`t2i`.`b1`,max(`test`.`t2i`.`b2`) from `test`.`t2i` where `test`.`t2i`.`b1` > '0' group by `test`.`t2i`.`b1`) join `test`.`t1i` where `<subquery2>`.`b1` = `test`.`t1i`.`a1` and `<subquery2>`.`max(b2)` = `test`.`t1i`.`a2`
+Note 1003 /* select#1 */ select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from <materialize> (/* select#2 */ select `test`.`t2i`.`b1`,max(`test`.`t2i`.`b2`) from `test`.`t2i` where `test`.`t2i`.`b1` > '0' group by `test`.`t2i`.`b1`) join `test`.`t1i` where `test`.`t1i`.`a1` = `<subquery2>`.`b1` and `test`.`t1i`.`a2` = `<subquery2>`.`max(b2)`
select * from t1i where (a1, a2) in (select b1, max(b2) from t2i where b1 > '0' group by b1);
a1 a2
1 - 01 2 - 01
@@ -155,11 +153,11 @@ a1 a2
explain extended
select * from t1i where (a1, a2) in (select b1, min(b2) from t2i where b1 > '0' group by b1);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1i index it1i1,it1i2,it1i3 # # # 3 100.00 #
-1 PRIMARY <subquery2> eq_ref distinct_key # # # 1 100.00 #
+1 PRIMARY <subquery2> ALL distinct_key # # # 5 100.00 #
+1 PRIMARY t1i ref it1i1,it1i2,it1i3 # # # 1 100.00 #
2 MATERIALIZED t2i range it2i1,it2i3 # # # 5 100.00 #
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from <materialize> (/* select#2 */ select `test`.`t2i`.`b1`,min(`test`.`t2i`.`b2`) from `test`.`t2i` where `test`.`t2i`.`b1` > '0' group by `test`.`t2i`.`b1`) join `test`.`t1i` where `<subquery2>`.`b1` = `test`.`t1i`.`a1` and `<subquery2>`.`min(b2)` = `test`.`t1i`.`a2`
+Note 1003 /* select#1 */ select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from <materialize> (/* select#2 */ select `test`.`t2i`.`b1`,min(`test`.`t2i`.`b2`) from `test`.`t2i` where `test`.`t2i`.`b1` > '0' group by `test`.`t2i`.`b1`) join `test`.`t1i` where `test`.`t1i`.`a1` = `<subquery2>`.`b1` and `test`.`t1i`.`a2` = `<subquery2>`.`min(b2)`
select * from t1i where (a1, a2) in (select b1, min(b2) from t2i where b1 > '0' group by b1);
a1 a2
1 - 01 2 - 01
@@ -279,7 +277,7 @@ explain extended
select * from t1i where (a1, a2) in (select b1, b2 from t2i order by b1, b2);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2i index it2i1,it2i2,it2i3 it2i3 18 NULL 5 50.00 Using where; Using index; LooseScan
-1 PRIMARY t1i ref it1i1,it1i2,it1i3 it1i3 18 test.t2i.b1,test.t2i.b2 1 100.00 Using index
+1 PRIMARY t1i ref it1i1,it1i2,it1i3 it1i3 18 test.t2i.b1,test.t2i.b2 1 20.00 Using index
Warnings:
Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) where `test`.`t1i`.`a1` = `test`.`t2i`.`b1` and `test`.`t1i`.`a2` = `test`.`t2i`.`b2`
select * from t1i where (a1, a2) in (select b1, b2 from t2i order by b1, b2);
@@ -331,14 +329,12 @@ where (a1, a2) in (select b1, b2 from t2 where b1 > '0') and
(a1, a2) in (select c1, c2 from t3
where (c1, c2) in (select b1, b2 from t2i where b2 > '0'));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 16 func,func 1 100.00
-1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 16 func,func 1 100.00
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where
-3 MATERIALIZED t3 ALL NULL NULL NULL NULL 4 100.00 Using where
-3 MATERIALIZED t2i ref it2i1,it2i2,it2i3 it2i3 18 test.t3.c1,test.t3.c2 1 100.00 Using index
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 PRIMARY t2i ref it2i1,it2i2,it2i3 it2i3 18 test.t1.a1,test.t1.a2 1 100.00 Using index; Start temporary
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 20.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t3 ALL NULL NULL NULL NULL 4 15.00 Using where; End temporary; Using join buffer (flat, BNL join)
Warnings:
-Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3`) where `test`.`t2i`.`b1` = `test`.`t3`.`c1` and `test`.`t2i`.`b2` = `test`.`t3`.`c2` and `test`.`t2`.`b1` > '0' and `test`.`t3`.`c2` > '0'
+Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3`) where `test`.`t2i`.`b1` = `test`.`t1`.`a1` and `test`.`t2`.`b1` = `test`.`t1`.`a1` and `test`.`t3`.`c1` = `test`.`t1`.`a1` and `test`.`t2i`.`b2` = `test`.`t1`.`a2` and `test`.`t2`.`b2` = `test`.`t1`.`a2` and `test`.`t3`.`c2` = `test`.`t1`.`a2` and `test`.`t1`.`a1` > '0' and `test`.`t1`.`a2` > '0'
select * from t1
where (a1, a2) in (select b1, b2 from t2 where b1 > '0') and
(a1, a2) in (select c1, c2 from t3
@@ -352,14 +348,12 @@ where (a1, a2) in (select b1, b2 from t2i where b1 > '0') and
(a1, a2) in (select c1, c2 from t3i
where (c1, c2) in (select b1, b2 from t2i where b2 > '0'));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1i range it1i1,it1i2,it1i3 # # # 3 100.00 #
-1 PRIMARY <subquery2> eq_ref distinct_key # # # 1 100.00 #
-1 PRIMARY <subquery3> eq_ref distinct_key # # # 1 100.00 #
-2 MATERIALIZED t2i range it2i1,it2i2,it2i3 # # # 5 100.00 #
-3 MATERIALIZED t3i range it3i1,it3i2,it3i3 # # # 4 100.00 #
-3 MATERIALIZED t2i ref it2i1,it2i2,it2i3 # # # 1 100.00 #
+1 PRIMARY t2i index it2i1,it2i2,it2i3 # # # 5 50.00 #
+1 PRIMARY t1i ref it1i1,it1i2,it1i3 # # # 1 20.00 #
+1 PRIMARY t3i ref it3i1,it3i2,it3i3 # # # 1 100.00 #
+1 PRIMARY t2i ref it2i1,it2i2,it2i3 # # # 1 60.00 #
Warnings:
-Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) semi join (`test`.`t2i` join `test`.`t3i`) where `test`.`t2i`.`b1` = `test`.`t3i`.`c1` and `test`.`t2i`.`b2` = `test`.`t3i`.`c2` and `test`.`t2i`.`b1` > '0' and `test`.`t3i`.`c2` > '0'
+Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) semi join (`test`.`t2i` join `test`.`t3i`) where `test`.`t1i`.`a1` = `test`.`t2i`.`b1` and `test`.`t3i`.`c1` = `test`.`t2i`.`b1` and `test`.`t2i`.`b1` = `test`.`t2i`.`b1` and `test`.`t1i`.`a2` = `test`.`t2i`.`b2` and `test`.`t3i`.`c2` = `test`.`t2i`.`b2` and `test`.`t2i`.`b2` = `test`.`t2i`.`b2` and `test`.`t2i`.`b1` > '0' and `test`.`t2i`.`b2` > '0'
select * from t1i
where (a1, a2) in (select b1, b2 from t2i where b1 > '0') and
(a1, a2) in (select c1, c2 from t3i
@@ -375,16 +369,14 @@ b2 in (select c2 from t3 where c2 LIKE '%03')) and
(a1, a2) in (select c1, c2 from t3
where (c1, c2) in (select b1, b2 from t2i where b2 > '0'));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 16 func,func 1 100.00
-1 PRIMARY <subquery5> eq_ref distinct_key distinct_key 16 func,func 1 100.00
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where
-5 MATERIALIZED t3 ALL NULL NULL NULL NULL 4 100.00 Using where
-5 MATERIALIZED t2i ref it2i1,it2i2,it2i3 it2i3 18 test.t3.c1,test.t3.c2 1 100.00 Using index
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+1 PRIMARY t2i ref it2i1,it2i2,it2i3 it2i3 18 test.t1.a1,test.t1.a2 1 100.00 Using index; Start temporary
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 20.00 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t3 ALL NULL NULL NULL NULL 4 15.00 Using where; End temporary; Using join buffer (flat, BNL join)
4 MATERIALIZED t3 ALL NULL NULL NULL NULL 4 100.00 Using where
3 MATERIALIZED t3 ALL NULL NULL NULL NULL 4 100.00 Using where
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3`) where `test`.`t2i`.`b1` = `test`.`t3`.`c1` and `test`.`t2i`.`b2` = `test`.`t3`.`c2` and (<expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (/* select#3 */ select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%02' ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where `test`.`t2`.`b2` = `<subquery3>`.`c2`)))) or <expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (/* select#4 */ select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%03' ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where `test`.`t2`.`b2` = `<subquery4>`.`c2`))))) and `test`.`t3`.`c2` > '0'
+Note 1003 /* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3`) where `test`.`t2i`.`b1` = `test`.`t1`.`a1` and `test`.`t2`.`b1` = `test`.`t1`.`a1` and `test`.`t3`.`c1` = `test`.`t1`.`a1` and `test`.`t2i`.`b2` = `test`.`t1`.`a2` and `test`.`t2`.`b2` = `test`.`t1`.`a2` and `test`.`t3`.`c2` = `test`.`t1`.`a2` and (<expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (/* select#3 */ select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%02' ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where `test`.`t2`.`b2` = `<subquery3>`.`c2`)))) or <expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (/* select#4 */ select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%03' ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where `test`.`t2`.`b2` = `<subquery4>`.`c2`))))) and `test`.`t1`.`a2` > '0'
select * from t1
where (a1, a2) in (select b1, b2 from t2
where b2 in (select c2 from t3 where c2 LIKE '%02') or
@@ -402,7 +394,7 @@ b2 in (select c2 from t3 t3b where c2 LIKE '%03')) and
where (c1, c2) in (select b1, b2 from t2i where b2 > '0'));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00
-1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 20.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
1 PRIMARY <subquery5> eq_ref distinct_key distinct_key 16 func,func 1 100.00
5 MATERIALIZED t3c ALL NULL NULL NULL NULL 4 100.00 Using where
5 MATERIALIZED t2i ref it2i1,it2i2,it2i3 it2i3 18 test.t3c.c1,test.t3c.c2 1 100.00 Using index
@@ -435,22 +427,18 @@ where (a1, a2) in (select b1, b2 from t2i where b1 > '0') and
where (c1, c2) in (select b1, b2 from t2i where b2 > '0')));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL # # # 3 100.00 #
-1 PRIMARY <subquery2> eq_ref distinct_key # # # 1 100.00 #
-1 PRIMARY <subquery5> eq_ref distinct_key # # # 1 100.00 #
-2 MATERIALIZED t2 ALL NULL # # # 5 100.00 #
-5 MATERIALIZED t3 ALL NULL # # # 4 100.00 #
-5 MATERIALIZED t2i ref it2i1,it2i2,it2i3 # # # 1 100.00 #
+1 PRIMARY t2i ref it2i1,it2i2,it2i3 # # # 1 100.00 #
+1 PRIMARY t2 ALL NULL # # # 5 20.00 #
+1 PRIMARY t3 ALL NULL # # # 4 15.00 #
4 MATERIALIZED t3 ALL NULL # # # 4 100.00 #
3 MATERIALIZED t3 ALL NULL # # # 4 100.00 #
-7 UNION t1i range it1i1,it1i2,it1i3 # # # 3 100.00 #
-7 UNION <subquery8> eq_ref distinct_key # # # 1 100.00 #
-7 UNION <subquery9> eq_ref distinct_key # # # 1 100.00 #
-8 MATERIALIZED t2i range it2i1,it2i2,it2i3 # # # 5 100.00 #
-9 MATERIALIZED t3i range it3i1,it3i2,it3i3 # # # 4 100.00 #
-9 MATERIALIZED t2i ref it2i1,it2i2,it2i3 # # # 1 100.00 #
+7 UNION t2i index it2i1,it2i2,it2i3 # # # 5 50.00 #
+7 UNION t1i ref it1i1,it1i2,it1i3 # # # 1 20.00 #
+7 UNION t3i ref it3i1,it3i2,it3i3 # # # 1 100.00 #
+7 UNION t2i ref it2i1,it2i2,it2i3 # # # 1 60.00 #
NULL UNION RESULT <union1,7> ALL NULL # # # NULL NULL #
Warnings:
-Note 1003 (/* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3`) where `test`.`t2i`.`b1` = `test`.`t3`.`c1` and `test`.`t2i`.`b2` = `test`.`t3`.`c2` and (<expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (/* select#3 */ select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%02' ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where `test`.`t2`.`b2` = `<subquery3>`.`c2`)))) or <expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (/* select#4 */ select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%03' ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where `test`.`t2`.`b2` = `<subquery4>`.`c2`))))) and `test`.`t3`.`c2` > '0') union (/* select#7 */ select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) semi join (`test`.`t2i` join `test`.`t3i`) where `test`.`t2i`.`b1` = `test`.`t3i`.`c1` and `test`.`t2i`.`b2` = `test`.`t3i`.`c2` and `test`.`t2i`.`b1` > '0' and `test`.`t3i`.`c2` > '0')
+Note 1003 (/* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3`) where `test`.`t2i`.`b1` = `test`.`t1`.`a1` and `test`.`t2`.`b1` = `test`.`t1`.`a1` and `test`.`t3`.`c1` = `test`.`t1`.`a1` and `test`.`t2i`.`b2` = `test`.`t1`.`a2` and `test`.`t2`.`b2` = `test`.`t1`.`a2` and `test`.`t3`.`c2` = `test`.`t1`.`a2` and (<expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (/* select#3 */ select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%02' ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where `test`.`t2`.`b2` = `<subquery3>`.`c2`)))) or <expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (/* select#4 */ select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%03' ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where `test`.`t2`.`b2` = `<subquery4>`.`c2`))))) and `test`.`t1`.`a2` > '0') union (/* select#7 */ select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) semi join (`test`.`t2i` join `test`.`t3i`) where `test`.`t1i`.`a1` = `test`.`t2i`.`b1` and `test`.`t3i`.`c1` = `test`.`t2i`.`b1` and `test`.`t2i`.`b1` = `test`.`t2i`.`b1` and `test`.`t1i`.`a2` = `test`.`t2i`.`b2` and `test`.`t3i`.`c2` = `test`.`t2i`.`b2` and `test`.`t2i`.`b2` = `test`.`t2i`.`b2` and `test`.`t2i`.`b1` > '0' and `test`.`t2i`.`b2` > '0')
(select * from t1
where (a1, a2) in (select b1, b2 from t2
where b2 in (select c2 from t3 where c2 LIKE '%02') or
@@ -542,9 +530,9 @@ b2 in (select c2 from t3 t3b where c2 LIKE '%03')) and
where (c1, c2) in (select b1, b2 from t2i where b2 > '0' or b2 = a2));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 20.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
1 PRIMARY t2i ref it2i1,it2i2,it2i3 it2i3 18 test.t1.a1,test.t1.a2 1 100.00 Using index; Start temporary
-1 PRIMARY t3c ALL NULL NULL NULL NULL 4 100.00 Using where; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t3c ALL NULL NULL NULL NULL 4 15.00 Using where; End temporary; Using join buffer (flat, BNL join)
4 MATERIALIZED t3b ALL NULL NULL NULL NULL 4 100.00 Using where
3 DEPENDENT SUBQUERY t3a ALL NULL NULL NULL NULL 4 100.00 Using where
Warnings:
@@ -658,7 +646,7 @@ from t1_16
where a1 in (select b1 from t2_16 where b1 > '0');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1_16 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 PRIMARY t2_16 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t2_16 ALL NULL NULL NULL NULL 3 33.33 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` semi join (`test`.`t2_16`) where `test`.`t2_16`.`b1` = `test`.`t1_16`.`a1` and `test`.`t1_16`.`a1` > '0'
select left(a1,7), left(a2,7)
@@ -672,7 +660,7 @@ from t1_16
where (a1,a2) in (select b1, b2 from t2_16 where b1 > '0');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1_16 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 PRIMARY t2_16 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t2_16 ALL NULL NULL NULL NULL 3 33.33 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select left(`test`.`t1_16`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_16`.`a2`,7) AS `left(a2,7)` from `test`.`t1_16` semi join (`test`.`t2_16`) where `test`.`t2_16`.`b1` = `test`.`t1_16`.`a1` and `test`.`t2_16`.`b2` = `test`.`t1_16`.`a2` and `test`.`t1_16`.`a1` > '0'
select left(a1,7), left(a2,7)
@@ -739,7 +727,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1_16 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; Using join buffer (flat, BNL join)
1 PRIMARY t2_16 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
1 PRIMARY t3 ALL NULL NULL NULL NULL 4 100.00 Using where; Using join buffer (flat, BNL join)
-1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 0.56 Using where; End temporary; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t3` join `test`.`t2_16` join `test`.`t2` join `test`.`t1_16`) where `test`.`t2`.`b1` = `test`.`t3`.`c1` and `test`.`t2_16`.`b1` = `test`.`t1_16`.`a1` and `test`.`t2_16`.`b2` = `test`.`t1_16`.`a2` and `test`.`t2`.`b2` = substr(`test`.`t1_16`.`a2`,1,6) and `test`.`t3`.`c2` > '0' and concat(`test`.`t1`.`a1`,'x') = left(`test`.`t1_16`.`a1`,8)
drop table t1_16, t2_16, t3_16;
@@ -773,7 +761,7 @@ from t1_512
where a1 in (select b1 from t2_512 where b1 > '0');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1_512 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 PRIMARY t2_512 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t2_512 ALL NULL NULL NULL NULL 3 33.33 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` semi join (`test`.`t2_512`) where `test`.`t2_512`.`b1` = `test`.`t1_512`.`a1` and `test`.`t1_512`.`a1` > '0'
select left(a1,7), left(a2,7)
@@ -787,7 +775,7 @@ from t1_512
where (a1,a2) in (select b1, b2 from t2_512 where b1 > '0');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1_512 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 PRIMARY t2_512 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t2_512 ALL NULL NULL NULL NULL 3 33.33 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select left(`test`.`t1_512`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_512`.`a2`,7) AS `left(a2,7)` from `test`.`t1_512` semi join (`test`.`t2_512`) where `test`.`t2_512`.`b1` = `test`.`t1_512`.`a1` and `test`.`t2_512`.`b2` = `test`.`t1_512`.`a2` and `test`.`t1_512`.`a1` > '0'
select left(a1,7), left(a2,7)
@@ -877,7 +865,7 @@ from t1_1024
where a1 in (select b1 from t2_1024 where b1 > '0');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1_1024 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 PRIMARY t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t2_1024 ALL NULL NULL NULL NULL 3 33.33 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` semi join (`test`.`t2_1024`) where `test`.`t2_1024`.`b1` = `test`.`t1_1024`.`a1` and `test`.`t1_1024`.`a1` > '0'
select left(a1,7), left(a2,7)
@@ -891,7 +879,7 @@ from t1_1024
where (a1,a2) in (select b1, b2 from t2_1024 where b1 > '0');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1_1024 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 PRIMARY t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t2_1024 ALL NULL NULL NULL NULL 3 33.33 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` semi join (`test`.`t2_1024`) where `test`.`t2_1024`.`b1` = `test`.`t1_1024`.`a1` and `test`.`t2_1024`.`b2` = `test`.`t1_1024`.`a2` and `test`.`t1_1024`.`a1` > '0'
select left(a1,7), left(a2,7)
@@ -905,7 +893,7 @@ from t1_1024
where a1 in (select substring(b1,1,1024) from t2_1024 where b1 > '0');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1_1024 ALL NULL NULL NULL NULL 3 100.00
-1 PRIMARY t2_1024 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t2_1024 ALL NULL NULL NULL NULL 3 33.33 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select left(`test`.`t1_1024`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1024`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1024` semi join (`test`.`t2_1024`) where `test`.`t2_1024`.`b1` > '0' and `test`.`t1_1024`.`a1` = substr(`test`.`t2_1024`.`b1`,1,1024)
select left(a1,7), left(a2,7)
@@ -980,7 +968,7 @@ from t1_1025
where a1 in (select b1 from t2_1025 where b1 > '0');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1_1025 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 PRIMARY t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t2_1025 ALL NULL NULL NULL NULL 3 33.33 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` semi join (`test`.`t2_1025`) where `test`.`t2_1025`.`b1` = `test`.`t1_1025`.`a1` and `test`.`t1_1025`.`a1` > '0'
select left(a1,7), left(a2,7)
@@ -994,7 +982,7 @@ from t1_1025
where (a1,a2) in (select b1, b2 from t2_1025 where b1 > '0');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1_1025 ALL NULL NULL NULL NULL 3 100.00 Using where
-1 PRIMARY t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t2_1025 ALL NULL NULL NULL NULL 3 33.33 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` semi join (`test`.`t2_1025`) where `test`.`t2_1025`.`b1` = `test`.`t1_1025`.`a1` and `test`.`t2_1025`.`b2` = `test`.`t1_1025`.`a2` and `test`.`t1_1025`.`a1` > '0'
select left(a1,7), left(a2,7)
@@ -1008,7 +996,7 @@ from t1_1025
where a1 in (select substring(b1,1,1025) from t2_1025 where b1 > '0');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1_1025 ALL NULL NULL NULL NULL 3 100.00
-1 PRIMARY t2_1025 ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t2_1025 ALL NULL NULL NULL NULL 3 33.33 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select left(`test`.`t1_1025`.`a1`,7) AS `left(a1,7)`,left(`test`.`t1_1025`.`a2`,7) AS `left(a2,7)` from `test`.`t1_1025` semi join (`test`.`t2_1025`) where `test`.`t2_1025`.`b1` > '0' and `test`.`t1_1025`.`a1` = substr(`test`.`t2_1025`.`b1`,1,1025)
select left(a1,7), left(a2,7)
@@ -1090,7 +1078,7 @@ from t1bb
where (a1, a2) in (select b1, b2 from t2bb);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1bb ALL NULL NULL NULL NULL 3 100.00
-1 PRIMARY t2bb ALL NULL NULL NULL NULL 3 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
+1 PRIMARY t2bb ALL NULL NULL NULL NULL 3 33.33 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select conv(`test`.`t1bb`.`a1`,10,2) AS `bin(a1)`,`test`.`t1bb`.`a2` AS `a2` from `test`.`t1bb` semi join (`test`.`t2bb`) where `test`.`t2bb`.`b1` = `test`.`t1bb`.`a1` and `test`.`t2bb`.`b2` = `test`.`t1bb`.`a2`
select bin(a1), a2
@@ -1152,11 +1140,10 @@ create index it1a on t1(a);
explain extended
select a from t1 where a in (select c from t2 where d >= 20);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 index it1a it1a 4 NULL 7 100.00 Using index
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 6 100.00 Using where
+1 PRIMARY t2 ALL NULL NULL NULL NULL 6 100.00 Using where; Start temporary
+1 PRIMARY t1 ref it1a it1a 4 test.t2.c 1 16.67 Using index; End temporary
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`d` >= 20
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t1`.`a` = `test`.`t2`.`c` and `test`.`t2`.`d` >= 20
select a from t1 where a in (select c from t2 where d >= 20);
a
2
@@ -1167,11 +1154,10 @@ insert into t2 values (1,10);
explain extended
select a from t1 where a in (select c from t2 where d >= 20);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 index it1a it1a 4 NULL 7 100.00 Using index
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 7 100.00 Using where
+1 PRIMARY t2 ALL NULL NULL NULL NULL 7 100.00 Using where; Start temporary
+1 PRIMARY t1 ref it1a it1a 4 test.t2.c 1 14.29 Using index; End temporary
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`d` >= 20
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t1`.`a` = `test`.`t2`.`c` and `test`.`t2`.`d` >= 20
select a from t1 where a in (select c from t2 where d >= 20);
a
2
@@ -1181,7 +1167,7 @@ a
explain extended
select a from t1 group by a having a in (select c from t2 where d >= 20);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 range NULL it1a 4 NULL 8 100.00 Using index for group-by
+1 PRIMARY t1 range NULL it1a 4 NULL 7 100.00 Using index for group-by
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 7 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` group by `test`.`t1`.`a` having <expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,`test`.`t1`.`a` in ( <materialize> (/* select#2 */ select `test`.`t2`.`c` from `test`.`t2` where `test`.`t2`.`d` >= 20 ), <primary_index_lookup>(`test`.`t1`.`a` in <temporary table> on distinct_key where `test`.`t1`.`a` = `<subquery2>`.`c`))))
@@ -1193,7 +1179,7 @@ create index iab on t1(a, b);
explain extended
select a from t1 group by a having a in (select c from t2 where d >= 20);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 range NULL it1a 4 NULL 8 100.00 Using index for group-by
+1 PRIMARY t1 range NULL it1a 4 NULL 7 100.00 Using index for group-by
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 7 100.00 Using where
Warnings:
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` group by `test`.`t1`.`a` having <expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,`test`.`t1`.`a` in ( <materialize> (/* select#2 */ select `test`.`t2`.`c` from `test`.`t2` where `test`.`t2`.`d` >= 20 ), <primary_index_lookup>(`test`.`t1`.`a` in <temporary table> on distinct_key where `test`.`t1`.`a` = `<subquery2>`.`c`))))
@@ -1205,7 +1191,7 @@ explain extended
select a from t1 group by a
having a in (select c from t2 where d >= some(select e from t3 where max(b)=e));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 range NULL iab 4 NULL 8 100.00 Using index for group-by
+1 PRIMARY t1 range NULL iab 4 NULL 7 100.00 Using index for group-by
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 7 100.00 Using where
3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 4 100.00 Using where
Warnings:
@@ -1222,7 +1208,7 @@ select a from t1
where a in (select c from t2 where d >= some(select e from t3 where b=e));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 7 100.00 Start temporary
-1 PRIMARY t1 ref it1a,iab iab 4 test.t2.c 1 100.00 Using where; Using index; End temporary
+1 PRIMARY t1 ref it1a,iab iab 4 test.t2.c 1 9.41 Using where; Using index; End temporary
3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 4 100.00 Using where
Warnings:
Note 1276 Field or reference 'test.t1.b' of SELECT #3 was resolved in SELECT #1
@@ -1549,13 +1535,15 @@ SET @@optimizer_switch='semijoin=on,materialization=on';
EXPLAIN SELECT COUNT(*) FROM t1 WHERE (f1,f2) IN (SELECT f1,f2 FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 7 func,func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2
+1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
SELECT COUNT(*) FROM t1 WHERE (f1,f2) IN (SELECT f1,f2 FROM t2);
COUNT(*)
2
set @@optimizer_switch= @local_optimizer_switch;
DROP TABLE t1, t2;
+#
+# BUG#46548 IN-subqueries return 0 rows with materialization=on
+#
CREATE TABLE t1 (
pk int,
a varchar(1),
@@ -1565,16 +1553,19 @@ d varchar(4),
PRIMARY KEY (pk)
);
INSERT INTO t1 VALUES (1,'o','ffff','ffff','ffoo'),(2,'f','ffff','ffff','ffff');
+insert into t1 select seq,'x','xxxx','xxxx','xxxx' from seq_10_to_40;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES (1,'i','iiii','iiii','iiii'),(2,'f','ffff','ffff','ffff');
+insert into t2 select -seq,'a','aaaa','aaaa','aaaa' from seq_1_to_20;
+insert into t2 select seq,'b','bbbb','bbbb','bbbb' from seq_100_to_200;
set @local_optimizer_switch=@@optimizer_switch;
set @@optimizer_switch=@optimizer_switch_local_default;
SET @@optimizer_switch='semijoin=on,materialization=on';
EXPLAIN SELECT pk FROM t1 WHERE (a) IN (SELECT a FROM t2 WHERE pk > 0);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 2
+1 PRIMARY t1 ALL NULL NULL NULL NULL 33
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 2 Using index condition; Using where; Rowid-ordered scan
+2 MATERIALIZED t2 ALL PRIMARY NULL NULL NULL 123 Using where
SELECT pk FROM t1 WHERE (a) IN (SELECT a FROM t2 WHERE pk > 0);
pk
2
@@ -1893,7 +1884,7 @@ SELECT * FROM t1
WHERE a IN ( SELECT MIN(a) FROM t1 );
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 system a NULL NULL NULL 1 100.00
-1 PRIMARY <subquery2> system NULL NULL NULL NULL 1 100.00
+1 PRIMARY <subquery2> system NULL NULL NULL NULL 0 0.00
2 MATERIALIZED NULL NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
Warnings:
Note 1003 /* select#1 */ select 8 AS `a` from dual where 1
@@ -1935,12 +1926,13 @@ DROP TABLE t1,t2;
#
create table t1 (a int, b int);
insert into t1 values (7,5), (3,3), (5,4), (9,3);
+insert into t1 select seq,seq from seq_100_to_200;
create table t2 (a int, b int, index i_a(a));
insert into t2 values
(4,2), (7,9), (7,4), (3,1), (5,3), (3,1), (9,4), (8,1);
explain select * from t1 where t1.a in (select a from t2 where t2.a=7 or t2.b<=1);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4
+1 PRIMARY t1 ALL NULL NULL NULL NULL 105
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
2 MATERIALIZED t2 ALL i_a NULL NULL NULL 8 Using where
select * from t1 where t1.a in (select a from t2 where t2.a=7 or t2.b<=1);
@@ -2031,10 +2023,9 @@ WHERE (a, c) IN (SELECT s1.b, s1.c FROM t2 AS s1, t2 AS s2
WHERE s2.d = s1.e AND s1.e = (SELECT MAX(e) FROM t2));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
-1 PRIMARY t2 index c c 5 NULL 8 Using index
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1
-2 MATERIALIZED s2 ref d d 4 const 2 Using where; Using index
-2 MATERIALIZED s1 ALL c NULL NULL NULL 8 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY t2 index c c 5 NULL 8 Using where; Using index
+1 PRIMARY s1 ref c c 5 test.t2.c 1 Using where
+1 PRIMARY s2 ref d d 4 const 2 Using where; Using index; FirstMatch(t2)
3 SUBQUERY t2 ALL NULL NULL NULL NULL 8
SELECT a, c FROM t1, t2
WHERE (a, c) IN (SELECT s1.b, s1.c FROM t2 AS s1, t2 AS s2
@@ -2051,10 +2042,9 @@ WHERE (a, c) IN (SELECT s1.b, s1.c FROM t2 AS s1, t2 AS s2
WHERE s2.d = s1.e AND s1.e = (SELECT MAX(e) FROM t2));
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
-1 PRIMARY t2 index c c 5 NULL 8 Using index
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1
-2 MATERIALIZED s2 ref d d 4 const 2 Using where; Using index
-2 MATERIALIZED s1 hash_ALL c #hash#$hj 5 const 8 Using where; Using join buffer (flat, BNLH join)
+1 PRIMARY t2 index c c 5 NULL 8 Using where; Using index
+1 PRIMARY s1 hash_ALL c #hash#c 5 test.t2.c 8 Using where; Using join buffer (flat, BNLH join)
+1 PRIMARY s2 hash_range d #hash#d:d 4:4 const 2 Using where; Using index; FirstMatch(t2); Using join buffer (incremental, BNLH join)
3 SUBQUERY t2 ALL NULL NULL NULL NULL 8
SELECT a, c FROM t1, t2
WHERE (a, c) IN (SELECT s1.b, s1.c FROM t2 AS s1, t2 AS s2
@@ -2236,9 +2226,8 @@ mysqltest1
EXPLAIN EXTENDED
SELECT db FROM t1 WHERE db IN (SELECT SCHEMA_NAME FROM information_schema.schemata) ORDER BY db DESC;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2 100.00 Using temporary; Using filesort
-1 PRIMARY t1 eq_ref db db 764 information_schema.schemata.SCHEMA_NAME 1 100.00 Using where; Using index
-2 MATERIALIZED schemata ALL NULL NULL NULL NULL NULL NULL
+1 PRIMARY t1 index db db 764 NULL 4 100.00 Using index; Using temporary; Using filesort
+1 PRIMARY schemata ALL NULL NULL NULL NULL NULL NULL Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`db` AS `db` from `test`.`t1` semi join (`information_schema`.`schemata`) where `test`.`t1`.`db` = `information_schema`.`schemata`.`SCHEMA_NAME` order by `test`.`t1`.`db` desc
drop table t1;
@@ -2270,8 +2259,10 @@ drop table t1;
CREATE TABLE t1 (
pk INT, f1 INT NOT NULL, f2 VARCHAR(3), f3 INT NULL, PRIMARY KEY(pk)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,1,'foo',8), (2,5,'bar',7);
+create table t2 like t1;
+insert into t2 select * from t1;
SELECT sq1.f2 FROM t1 AS sq1
-WHERE EXISTS ( SELECT * FROM t1 AS sq2
+WHERE EXISTS ( SELECT * FROM t2 AS sq2
WHERE sq1.`pk` IN ( SELECT f1 FROM t1 ) AND sq2.f1 = sq1.f1 );
f2
foo
@@ -2283,18 +2274,17 @@ WHERE EXISTS ( SELECT * FROM t1 AS sq2
WHERE sq1.`pk` IN ( SELECT f1 FROM t1 ) AND sq2.f1 = sq1.f1 );
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY sq1 ALL NULL NULL NULL NULL 2 Using where
-2 DEPENDENT SUBQUERY <subquery3> eq_ref distinct_key distinct_key 4 func 1
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where; FirstMatch
2 DEPENDENT SUBQUERY sq2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-3 MATERIALIZED t1 ALL NULL NULL NULL NULL 2
# this checks the result set above
set optimizer_switch= 'materialization=off,semijoin=off';
SELECT sq1.f2 FROM t1 AS sq1
-WHERE EXISTS ( SELECT * FROM t1 AS sq2
+WHERE EXISTS ( SELECT * FROM t2 AS sq2
WHERE sq1.`pk` IN ( SELECT f1 FROM t1 ) AND sq2.f1 = sq1.f1 );
f2
foo
set optimizer_switch= @local_optimizer_switch;
-DROP TABLE t1;
+DROP TABLE t1,t2;
#
# MDEV-12145: IN subquery used in WHERE of EXISTS subquery
#
@@ -2317,10 +2307,9 @@ WHERE EXISTS ( SELECT * FROM t2, t3
WHERE i3 = i2 AND f1 IN ( SELECT f3 FROM t3 ) );
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
-2 DEPENDENT SUBQUERY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 8 12.50 Using where; FirstMatch
2 DEPENDENT SUBQUERY t2 range i2 i2 5 NULL 3 100.00 Using where; Using index; Using join buffer (flat, BNL join)
-2 DEPENDENT SUBQUERY t3 ref i3 i3 5 test.t2.i2 2 100.00 Using index
-3 MATERIALIZED t3 ALL NULL NULL NULL NULL 8 100.00
+2 DEPENDENT SUBQUERY t3 ref i3 i3 5 test.t2.i2 1 100.00 Using index
Warnings:
Note 1276 Field or reference 'test.t1.f1' of SELECT #2 was resolved in SELECT #1
Note 1003 /* select#1 */ select `test`.`t1`.`f1` AS `f1` from `test`.`t1` where <expr_cache><`test`.`t1`.`f1`>(exists(/* select#2 */ select 1 from `test`.`t2` semi join (`test`.`t3`) join `test`.`t3` where `test`.`t3`.`i3` = `test`.`t2`.`i2` and `test`.`t1`.`f1` = `test`.`t3`.`f3` limit 1))
@@ -2356,9 +2345,8 @@ SELECT pk, f1, ( SELECT COUNT(*) FROM t2
WHERE t1.pk IN ( SELECT f2 FROM t2 ) ) AS sq FROM t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00
-2 DEPENDENT SUBQUERY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 20.00 Using where; FirstMatch
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (flat, BNL join)
-3 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00
Warnings:
Note 1276 Field or reference 'test.t1.pk' of SELECT #2 was resolved in SELECT #1
Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`f1` AS `f1`,<expr_cache><`test`.`t1`.`pk`>((/* select#2 */ select count(0) from `test`.`t2` semi join (`test`.`t2`) where `test`.`t1`.`pk` = `test`.`t2`.`f2`)) AS `sq` from `test`.`t1`
@@ -2441,11 +2429,10 @@ WHERE t2.ugroup = t3_i.sys_id AND
t3_i.type LIKE '59e22fb137032000158bbfc8bcbe5d52' AND
t2.user = '86826bf03710200044e0bfc8bcbe5d79');
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2
-1 PRIMARY t1 ref idx1,idx2 idx1 35 test.t2.ugroup 2 Using where
+1 PRIMARY t2 ref idx3,idx4 idx4 35 const 2 Using index condition; Using where; Start temporary
+1 PRIMARY t3_i eq_ref PRIMARY PRIMARY 32 test.t2.ugroup 1 Using index condition; Using where
+1 PRIMARY t1 ref idx1,idx2 idx1 35 test.t3_i.sys_id 2 Using index condition; Using where; End temporary
1 PRIMARY t3 eq_ref PRIMARY PRIMARY 32 test.t1.assignment_group 1 Using where; Using index
-2 MATERIALIZED t2 ref idx3,idx4 idx4 35 const 2 Using index condition; Using where
-2 MATERIALIZED t3_i eq_ref PRIMARY PRIMARY 32 test.t2.ugroup 1 Using index condition; Using where
set statement optimizer_prune_level=1 for explain SELECT t1.assignment_group
FROM t1, t3
WHERE t1.assignment_group = t3.sys_id AND
@@ -2456,11 +2443,10 @@ WHERE t2.ugroup = t3_i.sys_id AND
t3_i.type LIKE '59e22fb137032000158bbfc8bcbe5d52' AND
t2.user = '86826bf03710200044e0bfc8bcbe5d79');
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <subquery3> ALL distinct_key NULL NULL NULL 2
-1 PRIMARY t1 ref idx1,idx2 idx1 35 test.t2.ugroup 2 Using where
+1 PRIMARY t2 ref idx3,idx4 idx4 35 const 2 Using index condition; Using where; Start temporary
+1 PRIMARY t3_i eq_ref PRIMARY PRIMARY 32 test.t2.ugroup 1 Using index condition; Using where
+1 PRIMARY t1 ref idx1,idx2 idx1 35 test.t3_i.sys_id 2 Using index condition; Using where; End temporary
1 PRIMARY t3 eq_ref PRIMARY PRIMARY 32 test.t1.assignment_group 1 Using where; Using index
-3 MATERIALIZED t2 ref idx3,idx4 idx4 35 const 2 Using index condition; Using where
-3 MATERIALIZED t3_i eq_ref PRIMARY PRIMARY 32 test.t2.ugroup 1 Using index condition; Using where
SELECT t1.assignment_group
FROM t1, t3
WHERE t1.assignment_group = t3.sys_id AND
@@ -2492,8 +2478,7 @@ explain
SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 9
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
+1 PRIMARY t2 hash_ALL NULL #hash#$hj 8 test.t1.id,test.t1.id 3 Using where; FirstMatch(t1); Using join buffer (flat, BNLH join)
SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2);
1
1
@@ -2505,8 +2490,7 @@ explain
SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index id id 4 NULL 9 Using index
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
+1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2);
1
1
@@ -2555,20 +2539,17 @@ drop procedure prepare_data;
set @@optimizer_switch= @local_optimizer_switch;
drop table t1,t2,t3;
CREATE TABLE t1 ( id int NOT NULL, key(id));
-INSERT INTO t1 VALUES (11),(12),(13),(14),(15),(16),(17),(18),(19);
+INSERT INTO t1 select seq from seq_11_to_39;
CREATE TABLE t2 (i1 int NOT NULL, i2 int NOT NULL);
-INSERT INTO t2 VALUES (11,11),(12,12),(13,13);
+INSERT INTO t2 select seq,seq+1 from seq_11_to_50;
CREATE VIEW v1 AS SELECT t2.i1 FROM t2 where t2.i1 = t2.i2;
explain SELECT 1 FROM t1 where t1.id IN (SELECT v1.i1 from v1);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 index id id 4 NULL 9 Using index
+1 PRIMARY t1 index id id 4 NULL 29 Using index
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL 40 Using where
SELECT 1 FROM t1 where t1.id IN (SELECT v1.i1 from v1);
1
-1
-1
-1
drop table t1,t2;
drop view v1;
#
diff --git a/mysql-test/main/subselect_sj_mat.test b/mysql-test/main/subselect_sj_mat.test
index 0222743d..e411c29d 100644
--- a/mysql-test/main/subselect_sj_mat.test
+++ b/mysql-test/main/subselect_sj_mat.test
@@ -4,6 +4,7 @@
#
--source include/default_optimizer_switch.inc
+--source include/have_sequence.inc
set optimizer_switch=ifnull(@subselect_mat_test_optimizer_switch_value, 'semijoin=on,firstmatch=on,loosescan=on,semijoin_with_cache=on');
set optimizer_switch='mrr=on,mrr_sort_keys=on,index_condition_pushdown=on';
@@ -1174,9 +1175,9 @@ set @@optimizer_switch= @local_optimizer_switch;
DROP TABLE t1, t2;
-#
-# BUG#46548 IN-subqueries return 0 rows with materialization=on
-#
+--echo #
+--echo # BUG#46548 IN-subqueries return 0 rows with materialization=on
+--echo #
CREATE TABLE t1 (
pk int,
a varchar(1),
@@ -1186,9 +1187,12 @@ CREATE TABLE t1 (
PRIMARY KEY (pk)
);
INSERT INTO t1 VALUES (1,'o','ffff','ffff','ffoo'),(2,'f','ffff','ffff','ffff');
+insert into t1 select seq,'x','xxxx','xxxx','xxxx' from seq_10_to_40;
CREATE TABLE t2 LIKE t1;
INSERT INTO t2 VALUES (1,'i','iiii','iiii','iiii'),(2,'f','ffff','ffff','ffff');
+insert into t2 select -seq,'a','aaaa','aaaa','aaaa' from seq_1_to_20;
+insert into t2 select seq,'b','bbbb','bbbb','bbbb' from seq_100_to_200;
set @local_optimizer_switch=@@optimizer_switch;
set @@optimizer_switch=@optimizer_switch_local_default;
@@ -1553,6 +1557,7 @@ DROP TABLE t1,t2;
--echo #
create table t1 (a int, b int);
insert into t1 values (7,5), (3,3), (5,4), (9,3);
+insert into t1 select seq,seq from seq_100_to_200;
create table t2 (a int, b int, index i_a(a));
@@ -1883,9 +1888,11 @@ drop table t1;
CREATE TABLE t1 (
pk INT, f1 INT NOT NULL, f2 VARCHAR(3), f3 INT NULL, PRIMARY KEY(pk)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,1,'foo',8), (2,5,'bar',7);
+create table t2 like t1;
+insert into t2 select * from t1;
SELECT sq1.f2 FROM t1 AS sq1
- WHERE EXISTS ( SELECT * FROM t1 AS sq2
+ WHERE EXISTS ( SELECT * FROM t2 AS sq2
WHERE sq1.`pk` IN ( SELECT f1 FROM t1 ) AND sq2.f1 = sq1.f1 );
set @local_optimizer_switch= @@optimizer_switch;
@@ -1899,12 +1906,12 @@ SELECT sq1.f2 FROM t1 AS sq1
--echo # this checks the result set above
set optimizer_switch= 'materialization=off,semijoin=off';
SELECT sq1.f2 FROM t1 AS sq1
- WHERE EXISTS ( SELECT * FROM t1 AS sq2
+ WHERE EXISTS ( SELECT * FROM t2 AS sq2
WHERE sq1.`pk` IN ( SELECT f1 FROM t1 ) AND sq2.f1 = sq1.f1 );
set optimizer_switch= @local_optimizer_switch;
-DROP TABLE t1;
+DROP TABLE t1,t2;
--echo #
--echo # MDEV-12145: IN subquery used in WHERE of EXISTS subquery
@@ -2248,9 +2255,9 @@ set @@optimizer_switch= @local_optimizer_switch;
drop table t1,t2,t3;
CREATE TABLE t1 ( id int NOT NULL, key(id));
-INSERT INTO t1 VALUES (11),(12),(13),(14),(15),(16),(17),(18),(19);
+INSERT INTO t1 select seq from seq_11_to_39;
CREATE TABLE t2 (i1 int NOT NULL, i2 int NOT NULL);
-INSERT INTO t2 VALUES (11,11),(12,12),(13,13);
+INSERT INTO t2 select seq,seq+1 from seq_11_to_50;
CREATE VIEW v1 AS SELECT t2.i1 FROM t2 where t2.i1 = t2.i2;
explain SELECT 1 FROM t1 where t1.id IN (SELECT v1.i1 from v1);
SELECT 1 FROM t1 where t1.id IN (SELECT v1.i1 from v1);
diff --git a/mysql-test/main/subselect_sj_nonmerged.result b/mysql-test/main/subselect_sj_nonmerged.result
index a3e6c493..2413ce3a 100644
--- a/mysql-test/main/subselect_sj_nonmerged.result
+++ b/mysql-test/main/subselect_sj_nonmerged.result
@@ -47,8 +47,8 @@ id select_type table type possible_keys key key_len ref rows Extra
# Compare to this which really will have 50 record combinations:
explain select * from t3 where a in (select max(t2.a) from t1, t2 group by t2.b, t1.b);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t3 index PRIMARY PRIMARY 8 NULL 100 Using index
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 test.t3.a 1 Using where
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 50
+1 PRIMARY t3 eq_ref PRIMARY PRIMARY 8 <subquery2>.max(t2.a) 1 Using where; Using index
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using temporary
2 MATERIALIZED t1 ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join)
SET @save_optimizer_switch=@@optimizer_switch;
@@ -57,8 +57,8 @@ SET optimizer_switch='outer_join_with_cache=off';
explain select * from t3
where a in (select max(t2.a) from t1 left join t2 on t1.a=t2.a group by t2.b, t1.b);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t3 index PRIMARY PRIMARY 8 NULL 100 Using index
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 test.t3.a 1 Using where
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 50
+1 PRIMARY t3 eq_ref PRIMARY PRIMARY 8 <subquery2>.max(t2.a) 1 Using where; Using index
2 MATERIALIZED t1 ALL NULL NULL NULL NULL 10 Using temporary
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using where
SET optimizer_switch=@save_optimizer_switch;
diff --git a/mysql-test/main/system_mysql_db.result b/mysql-test/main/system_mysql_db.result
index bd63549a..fb54069b 100644
--- a/mysql-test/main/system_mysql_db.result
+++ b/mysql-test/main/system_mysql_db.result
@@ -57,6 +57,7 @@ db CREATE TABLE `db` (
`Event_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
`Trigger_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
`Delete_history_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `Show_create_routine_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
PRIMARY KEY (`Host`,`Db`,`User`),
KEY `User` (`User`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges'
@@ -115,7 +116,7 @@ procs_priv CREATE TABLE `procs_priv` (
`Routine_name` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
`Routine_type` enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') NOT NULL,
`Grantor` varchar(384) NOT NULL DEFAULT '',
- `Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
+ `Proc_priv` set('Execute','Alter Routine','Grant','Show Create Routine') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
`Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`),
KEY `Grantor` (`Grantor`)
diff --git a/mysql-test/main/system_mysql_db_error_log.result b/mysql-test/main/system_mysql_db_error_log.result
index 5af3eda0..e92c2e74 100644
--- a/mysql-test/main/system_mysql_db_error_log.result
+++ b/mysql-test/main/system_mysql_db_error_log.result
@@ -15,7 +15,7 @@ SET @all_known_privileges_current=(SELECT CAST(json_value(Priv, '$.access') AS U
DROP USER user1@localhost;
SELECT HEX(@all_known_privileges_current);
HEX(@all_known_privileges_current)
-7FFFFFFFFF
+FFFFFFFFFF
CREATE USER bad_access1@localhost;
UPDATE
mysql.global_priv
@@ -110,7 +110,7 @@ host='localhost' and user='good_version_id_100500';
FLUSH PRIVILEGES;
SHOW GRANTS FOR good_version_id_100500@localhost;
Grants for good_version_id_100500@localhost
-GRANT SUPER, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, BINLOG ADMIN, BINLOG REPLAY ON *.* TO `good_version_id_100500`@`localhost`
+GRANT SUPER, BINLOG MONITOR, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `good_version_id_100500`@`localhost`
DROP USER good_version_id_100500@localhost;
FOUND 1 /Warning.*'user' entry 'bad_access1@localhost' has a wrong 'access' value.*version_id=/ in system_mysql_db_error_log.err
FOUND 1 /Warning.*'user' entry 'bad_version_id_1000000@localhost' has a wrong 'version_id' value 1000000/ in system_mysql_db_error_log.err
diff --git a/mysql-test/main/system_mysql_db_fix40123.result b/mysql-test/main/system_mysql_db_fix40123.result
index d580edbc..9688038c 100644
--- a/mysql-test/main/system_mysql_db_fix40123.result
+++ b/mysql-test/main/system_mysql_db_fix40123.result
@@ -95,6 +95,7 @@ db CREATE TABLE `db` (
`Event_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
`Trigger_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
`Delete_history_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `Show_create_routine_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
PRIMARY KEY (`Host`,`Db`,`User`),
KEY `User` (`User`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges'
@@ -153,7 +154,7 @@ procs_priv CREATE TABLE `procs_priv` (
`Routine_name` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
`Routine_type` enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') NOT NULL,
`Grantor` varchar(384) NOT NULL DEFAULT '',
- `Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
+ `Proc_priv` set('Execute','Alter Routine','Grant','Show Create Routine') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
`Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`),
KEY `Grantor` (`Grantor`)
diff --git a/mysql-test/main/system_mysql_db_fix50030.result b/mysql-test/main/system_mysql_db_fix50030.result
index 10607be8..ea2ea1c1 100644
--- a/mysql-test/main/system_mysql_db_fix50030.result
+++ b/mysql-test/main/system_mysql_db_fix50030.result
@@ -99,6 +99,7 @@ db CREATE TABLE `db` (
`Event_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
`Trigger_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
`Delete_history_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `Show_create_routine_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
PRIMARY KEY (`Host`,`Db`,`User`),
KEY `User` (`User`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges'
@@ -157,7 +158,7 @@ procs_priv CREATE TABLE `procs_priv` (
`Routine_name` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
`Routine_type` enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') NOT NULL,
`Grantor` varchar(384) NOT NULL DEFAULT '',
- `Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
+ `Proc_priv` set('Execute','Alter Routine','Grant','Show Create Routine') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
`Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`),
KEY `Grantor` (`Grantor`)
diff --git a/mysql-test/main/system_mysql_db_fix50117.result b/mysql-test/main/system_mysql_db_fix50117.result
index 391c4e5b..7c85ca98 100644
--- a/mysql-test/main/system_mysql_db_fix50117.result
+++ b/mysql-test/main/system_mysql_db_fix50117.result
@@ -79,6 +79,7 @@ db CREATE TABLE `db` (
`Event_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
`Trigger_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
`Delete_history_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `Show_create_routine_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
PRIMARY KEY (`Host`,`Db`,`User`),
KEY `User` (`User`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges'
@@ -137,7 +138,7 @@ procs_priv CREATE TABLE `procs_priv` (
`Routine_name` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
`Routine_type` enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') NOT NULL,
`Grantor` varchar(384) NOT NULL DEFAULT '',
- `Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
+ `Proc_priv` set('Execute','Alter Routine','Grant','Show Create Routine') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
`Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`),
KEY `Grantor` (`Grantor`)
diff --git a/mysql-test/main/system_mysql_db_fix50568.result b/mysql-test/main/system_mysql_db_fix50568.result
index 8f3a1ff1..2dad3c47 100644
--- a/mysql-test/main/system_mysql_db_fix50568.result
+++ b/mysql-test/main/system_mysql_db_fix50568.result
@@ -100,6 +100,7 @@ db CREATE TABLE `db` (
`Event_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
`Trigger_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
`Delete_history_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
+ `Show_create_routine_priv` enum('N','Y') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT 'N',
PRIMARY KEY (`Host`,`Db`,`User`),
KEY `User` (`User`)
) ENGINE=Aria DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin PAGE_CHECKSUM=1 TRANSACTIONAL=1 COMMENT='Database privileges'
@@ -158,7 +159,7 @@ procs_priv CREATE TABLE `procs_priv` (
`Routine_name` char(64) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
`Routine_type` enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') NOT NULL,
`Grantor` varchar(384) NOT NULL DEFAULT '',
- `Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
+ `Proc_priv` set('Execute','Alter Routine','Grant','Show Create Routine') CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL DEFAULT '',
`Timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`),
KEY `Grantor` (`Grantor`)
diff --git a/mysql-test/main/table_elim.result b/mysql-test/main/table_elim.result
index 70a949fe..34c27814 100644
--- a/mysql-test/main/table_elim.result
+++ b/mysql-test/main/table_elim.result
@@ -571,9 +571,9 @@ JOIN t5 ON t4.f3 ON t3.f1 = t5.f5 ON t2.f4 = t3.f4
WHERE t3.f2 ;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where
-1 SIMPLE t5 ref f5 f5 5 test.t3.f1 2 Using where; Using index
+1 SIMPLE t5 ref f5 f5 5 test.t3.f1 1 Using where; Using index
1 SIMPLE t4 ALL NULL NULL NULL NULL 3 Using where
-1 SIMPLE t2 ALL f4 NULL NULL NULL 11 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 ref f4 f4 1003 test.t3.f4 1 Using where
# ^^ The above must not produce a QEP of t3,t5,t2,t4
# as that violates the "no interleaving of outer join nests" rule.
DROP TABLE t1,t2,t3,t4,t5;
@@ -745,13 +745,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"const_condition": "1",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -777,13 +780,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"const_condition": "1",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -796,12 +802,15 @@ EXPLAIN
"key_length": "8",
"used_key_parts": ["b"],
"ref": ["test.t1.a"],
+ "loops": 10,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "trigcond(t1.a = v2b.b and trigcond(t1.a is not null))",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"const_condition": "1",
"filesort": {
"sort_key": "t11.a",
@@ -811,7 +820,9 @@ EXPLAIN
"table": {
"table_name": "t11",
"access_type": "ALL",
+ "loops": 1,
"rows": 1000,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -839,13 +850,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"const_condition": "1",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -865,13 +879,16 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"const_condition": "1",
"nested_loop": [
{
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -884,12 +901,15 @@ EXPLAIN
"key_length": "5",
"used_key_parts": ["b"],
"ref": ["test.t1.a"],
+ "loops": 10,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "trigcond(trigcond(t1.a is not null))",
"materialized": {
"query_block": {
"select_id": 2,
+ "cost": "COST_REPLACED",
"const_condition": "1",
"filesort": {
"sort_key": "t11.a",
@@ -899,7 +919,9 @@ EXPLAIN
"table": {
"table_name": "t11",
"access_type": "ALL",
+ "loops": 1,
"rows": 1000,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -912,7 +934,9 @@ EXPLAIN
"key_length": "4",
"used_key_parts": ["pk"],
"ref": ["test.t11.b"],
+ "loops": 1000,
"rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"attached_condition": "trigcond(trigcond(t11.b is not null))"
}
@@ -954,7 +978,7 @@ group by yyy;
explain select t1.* from t1 left join v2e on v2e.yyy=t1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 10
-1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 2 Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 1 Using where
2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
create table t2 (a int, b int, c int);
insert into t2 select A.seq, B.seq, 123 from seq_1_to_3 A, seq_1_to_3 B;
@@ -964,14 +988,14 @@ explain select t1.* from t1 left join
(select a, count(*) as cnt from t2 group by a, b) D on D.a=t1.a;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 10
-1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 2 Using where
+1 PRIMARY <derived2> ref key0 key0 5 test.t1.a 1 Using where
2 DERIVED t2 ALL NULL NULL NULL NULL 9 Using temporary; Using filesort
# Still no elimination 'cause field D.b is just an alias for t2.a
explain select t1.* from t1 left join
(select a, a as b, count(*) as cnt from t2 group by a, b) D on D.a=t1.a and D.b=t1.b;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 10
-1 PRIMARY <derived2> ref key0 key0 10 test.t1.a,test.t1.b 2 Using where
+1 PRIMARY <derived2> ref key0 key0 10 test.t1.a,test.t1.b 1 Using where
2 DERIVED t2 ALL NULL NULL NULL NULL 9 Using temporary; Using filesort
Warnings:
Warning 1052 Column 'b' in group statement is ambiguous
diff --git a/mysql-test/main/table_elim.test b/mysql-test/main/table_elim.test
index d6bf925c..26c56630 100644
--- a/mysql-test/main/table_elim.test
+++ b/mysql-test/main/table_elim.test
@@ -680,6 +680,7 @@ group by t11.a;
explain select t1.* from t1 left join v2b on v2b.a=t1.a;
--echo # Check format JSON as well
+--source include/explain-no-costs.inc
explain format=JSON select t1.* from t1 left join v2b on t1.a=v2b.a;
--echo # Elimination of a whole subquery
@@ -692,6 +693,7 @@ explain select t1.* from t1 left join
explain select t1.* from t1 left join v2b on t1.a=v2b.b;
--echo # Check format JSON as well
+--source include/explain-no-costs.inc
explain format=JSON select t1.* from t1 left join v2b on t1.a=v2b.b;
create view v2c as
@@ -703,12 +705,14 @@ group by t11.a;
explain select t1.* from t1 left join v2c on v2c.a=t1.a;
--echo # Check format JSON as well
+--source include/explain-no-costs.inc
explain format=JSON select t1.* from t1 left join v2c on v2c.a=t1.a;
--echo # In this case v2c cannot be eliminated (since v2c.b is not unique)!
explain select t1.* from t1 left join v2c on t1.a=v2c.b;
--echo # Check format JSON as well
+--source include/explain-no-costs.inc
explain format=JSON select t1.* from t1 left join v2c on t1.a=v2c.b;
--echo # Create a view with multiple fields in the GROUP BY clause:
diff --git a/mysql-test/main/table_value_constr.result b/mysql-test/main/table_value_constr.result
index 46bea606..857808f6 100644
--- a/mysql-test/main/table_value_constr.result
+++ b/mysql-test/main/table_value_constr.result
@@ -567,12 +567,12 @@ where t1.a=t2.a and st<3
select * from t2;
a b st
1 1 1
-1 2 2
1 1 2
-1 2 3
-1 2 3
1 1 3
1 1 3
+1 2 2
+1 2 3
+1 2 3
# recursive CTE that uses VALUES structure(s) : computation of factorial (first 10 elements)
with recursive fact(n,f) as
(
@@ -743,21 +743,19 @@ a b
explain extended select * from t1
where a in (values (1));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
-1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00
-3 MATERIALIZED <derived2> ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+1 PRIMARY <derived2> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1)) `tvc_0`) where 1
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1)) `tvc_0` join `test`.`t1` where `tvc_0`.`1` = `test`.`t1`.`a`
explain extended select * from t1
where a in (select * from (values (1)) as tvc_0);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1)) `tvc_0`) where 1
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1)) `tvc_0` join `test`.`t1` where `tvc_0`.`1` = `test`.`t1`.`a`
# IN-subquery with VALUES structure(s) : UNION with VALUES on the first place
select * from t1
where a in (values (1) union select 2);
@@ -776,7 +774,7 @@ explain extended select * from t1
where a in (values (1) union select 2);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
-4 DEPENDENT SUBQUERY <derived2> ref key0 key0 4 func 2 100.00
+4 DEPENDENT SUBQUERY <derived2> eq_ref distinct_key distinct_key 4 func 1 100.00
2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union4,3> ALL NULL NULL NULL NULL NULL NULL
@@ -787,7 +785,7 @@ where a in (select * from (values (1)) as tvc_0 union
select 2);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
-2 DEPENDENT SUBQUERY <derived3> ref key0 key0 4 func 2 100.00
+2 DEPENDENT SUBQUERY <derived3> eq_ref distinct_key distinct_key 4 func 1 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
4 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,4> ALL NULL NULL NULL NULL NULL NULL
@@ -812,7 +810,7 @@ where a in (select 2 union values (1));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
-4 DEPENDENT UNION <derived3> ref key0 key0 4 func 2 100.00
+4 DEPENDENT UNION <derived3> eq_ref distinct_key distinct_key 4 func 1 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,4> ALL NULL NULL NULL NULL NULL NULL
Warnings:
@@ -823,7 +821,7 @@ select * from (values (1)) tvc_0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
-3 DEPENDENT UNION <derived4> ref key0 key0 4 func 2 100.00
+3 DEPENDENT UNION <derived4> ref key0 key0 4 func 1 100.00
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
@@ -848,7 +846,7 @@ explain extended select * from t1
where a in (values (1) union all select b from t1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
-4 DEPENDENT SUBQUERY <derived2> ref key0 key0 4 func 2 100.00
+4 DEPENDENT SUBQUERY <derived2> eq_ref distinct_key distinct_key 4 func 1 100.00
2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
3 DEPENDENT UNION t1 ALL NULL NULL NULL NULL 6 100.00 Using where
Warnings:
@@ -858,7 +856,7 @@ where a in (select * from (values (1)) as tvc_0 union all
select b from t1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
-2 DEPENDENT SUBQUERY <derived3> ref key0 key0 4 func 2 100.00
+2 DEPENDENT SUBQUERY <derived3> eq_ref distinct_key distinct_key 4 func 1 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
4 DEPENDENT UNION t1 ALL NULL NULL NULL NULL 6 100.00 Using where
Warnings:
@@ -880,18 +878,18 @@ explain extended select * from t1
where a not in (values (1),(2));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
-3 MATERIALIZED <derived2> ALL NULL NULL NULL NULL 2 100.00
+3 DEPENDENT SUBQUERY <derived2> unique_subquery distinct_key distinct_key 4 func 1 100.00 Using where; Full scan on NULL key
2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where !<expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,`test`.`t1`.`a` in ( <materialize> (/* select#3 */ select `tvc_0`.`1` from (values (1),(2)) `tvc_0` ), <primary_index_lookup>(`test`.`t1`.`a` in <temporary table> on distinct_key where `test`.`t1`.`a` = `<subquery3>`.`1`))))
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where !<expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,<exists>(<primary_index_lookup>(<cache>(`test`.`t1`.`a`) in <temporary table> on distinct_key where trigcond(<cache>(`test`.`t1`.`a`) = `tvc_0`.`1`)))))
explain extended select * from t1
where a not in (select * from (values (1),(2)) as tvc_0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
-2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
+2 DEPENDENT SUBQUERY <derived3> unique_subquery distinct_key distinct_key 4 func 1 100.00 Using where; Full scan on NULL key
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where !<expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,`test`.`t1`.`a` in ( <materialize> (/* select#2 */ select `tvc_0`.`1` from (values (1),(2)) `tvc_0` ), <primary_index_lookup>(`test`.`t1`.`a` in <temporary table> on distinct_key where `test`.`t1`.`a` = `<subquery2>`.`1`))))
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where !<expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,<exists>(<primary_index_lookup>(<cache>(`test`.`t1`.`a`) in <temporary table> on distinct_key where trigcond(<cache>(`test`.`t1`.`a`) = `tvc_0`.`1`)))))
# NOT IN subquery with VALUES structure(s) : UNION with VALUES on the first place
select * from t1
where a not in (values (1) union select 2);
@@ -978,21 +976,19 @@ a b
explain extended select * from t1
where a = any (values (1),(2));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
-1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00
-3 MATERIALIZED <derived2> ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+1 PRIMARY <derived2> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1),(2)) `tvc_0`) where 1
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1),(2)) `tvc_0` join `test`.`t1` where `tvc_0`.`1` = `test`.`t1`.`a`
explain extended select * from t1
where a = any (select * from (values (1),(2)) as tvc_0);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1),(2)) `tvc_0`) where 1
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from (values (1),(2)) `tvc_0` join `test`.`t1` where `tvc_0`.`1` = `test`.`t1`.`a`
# ANY-subquery with VALUES structure(s) : UNION with VALUES on the first place
select * from t1
where a = any (values (1) union select 2);
@@ -1011,7 +1007,7 @@ explain extended select * from t1
where a = any (values (1) union select 2);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
-4 DEPENDENT SUBQUERY <derived2> ref key0 key0 4 func 2 100.00
+4 DEPENDENT SUBQUERY <derived2> eq_ref distinct_key distinct_key 4 func 1 100.00
2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union4,3> ALL NULL NULL NULL NULL NULL NULL
@@ -1022,7 +1018,7 @@ where a = any (select * from (values (1)) as tvc_0 union
select 2);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
-2 DEPENDENT SUBQUERY <derived3> ref key0 key0 4 func 2 100.00
+2 DEPENDENT SUBQUERY <derived3> eq_ref distinct_key distinct_key 4 func 1 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
4 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,4> ALL NULL NULL NULL NULL NULL NULL
@@ -1047,7 +1043,7 @@ where a = any (select 2 union values (1));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
-4 DEPENDENT UNION <derived3> ref key0 key0 4 func 2 100.00
+4 DEPENDENT UNION <derived3> eq_ref distinct_key distinct_key 4 func 1 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,4> ALL NULL NULL NULL NULL NULL NULL
Warnings:
@@ -1058,7 +1054,7 @@ select * from (values (1)) as tvc_0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
-3 DEPENDENT UNION <derived4> ref key0 key0 4 func 2 100.00
+3 DEPENDENT UNION <derived4> ref key0 key0 4 func 1 100.00
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
@@ -1140,7 +1136,7 @@ where a = any (select 1 union values (1));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
-4 DEPENDENT UNION <derived3> ref key0 key0 4 func 2 100.00
+4 DEPENDENT UNION <derived3> eq_ref distinct_key distinct_key 4 func 1 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,4> ALL NULL NULL NULL NULL NULL NULL
Warnings:
@@ -1151,7 +1147,7 @@ select * from (values (1)) as tvc_0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
-3 DEPENDENT UNION <derived4> ref key0 key0 4 func 2 100.00
+3 DEPENDENT UNION <derived4> ref key0 key0 4 func 1 100.00
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
@@ -2688,9 +2684,9 @@ a
explain extended select a from t1 where a in (values (7) union values (8));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
-4 DEPENDENT SUBQUERY <derived2> ref key0 key0 4 func 2 100.00
+4 DEPENDENT SUBQUERY <derived2> eq_ref distinct_key distinct_key 4 func 1 100.00
2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
-5 DEPENDENT UNION <derived3> ref key0 key0 4 func 2 100.00
+5 DEPENDENT UNION <derived3> eq_ref distinct_key distinct_key 4 func 1 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union4,5> ALL NULL NULL NULL NULL NULL NULL
Warnings:
@@ -2841,7 +2837,7 @@ id select_type table type possible_keys key key_len ref rows Extra
6 SUBQUERY <derived2> ALL NULL NULL NULL NULL 2
2 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
3 SUBQUERY t3 ALL NULL NULL NULL NULL 11 Using where
-3 SUBQUERY <derived5> ref key0 key0 8 test.t3.a 2 Using where; FirstMatch(t3)
+3 SUBQUERY <derived5> ref key0 key0 8 test.t3.a 1 Using where; FirstMatch(t3)
5 DERIVED t3 ALL NULL NULL NULL NULL 11 Using temporary; Using filesort
prepare stmt from "select
(values ((select * from t3 where a in (select * from v1))))";
@@ -2866,7 +2862,7 @@ id select_type table type possible_keys key key_len ref rows Extra
6 SUBQUERY <derived2> ALL NULL NULL NULL NULL 2
2 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
3 SUBQUERY t3 ALL NULL NULL NULL NULL 11 Using where
-3 SUBQUERY <derived5> ref key0 key0 8 test.t3.a 2 Using where; FirstMatch(t3)
+3 SUBQUERY <derived5> ref key0 key0 8 test.t3.a 1 Using where; FirstMatch(t3)
5 DERIVED t3 ALL NULL NULL NULL NULL 11 Using temporary; Using filesort
prepare stmt from "select
(values ((select * from t3
@@ -2951,6 +2947,8 @@ values ((values (4)), (select 5)), ((select 2), (values (8)));
values ((values (1) union values (1)));
(values (1) union values (1))
1
+values ((values (1) union all values (1)));
+ERROR 21000: Subquery returns more than 1 row
values ((values (1) union values (1) union values (1)));
(values (1) union values (1) union values (1))
1
diff --git a/mysql-test/main/table_value_constr.test b/mysql-test/main/table_value_constr.test
index 6fee71a5..29347a16 100644
--- a/mysql-test/main/table_value_constr.test
+++ b/mysql-test/main/table_value_constr.test
@@ -422,6 +422,7 @@ select * from t2;
--echo # recursive CTE that uses VALUES structure(s) : that uses UNION ALL
+--sorted_result
with recursive t2(a,b,st) as
(
values(1,1,1)
@@ -832,6 +833,7 @@ deallocate prepare stmt1;
explain
values (1,2);
+--source include/explain-no-costs.inc
explain format=json
values (1,2);
@@ -852,16 +854,19 @@ values (5,6)
union
values (1,2),(3,4);
+--source include/explain-no-costs.inc
explain format=json
select 1,2
union
values (1,2),(3,4);
+--source include/explain-no-costs.inc
explain format=json
values (1,2),(3,4)
union
select 1,2;
+--source include/explain-no-costs.inc
explain format=json
values (5,6)
union
@@ -874,6 +879,7 @@ values (3,4)
union
values (1,2);
+--source include/explain-no-costs.inc
explain format=json
select 1,2
union
@@ -898,16 +904,19 @@ values (1,2)
union all
values (1,2),(3,4);
+--source include/explain-no-costs.inc
explain format=json
values (1,2),(3,4)
union all
select 1,2;
+--source include/explain-no-costs.inc
explain format=json
select 1,2
union
values (1,2),(3,4);
+--source include/explain-no-costs.inc
explain format=json
values (1,2)
union all
@@ -920,6 +929,7 @@ values (3,4)
union all
values (1,2);
+--source include/explain-no-costs.inc
explain format=json
select 1,2
union all
@@ -1574,6 +1584,9 @@ values ((values (4)), (select 5)), ((select 2), (values (8)));
values ((values (1) union values (1)));
+--error ER_SUBQUERY_NO_1_ROW
+values ((values (1) union all values (1)));
+
values ((values (1) union values (1) union values (1)));
values ((values ((values (4)))));
diff --git a/mysql-test/main/temp_table.result b/mysql-test/main/temp_table.result
index 61b78f96..9724c2c0 100644
--- a/mysql-test/main/temp_table.result
+++ b/mysql-test/main/temp_table.result
@@ -329,6 +329,7 @@ i
1
SHOW TABLES;
Tables_in_temp_db
+temp_t1
DROP TABLE temp_t1;
#
# Create and drop a temporary table.
@@ -611,6 +612,9 @@ test.t1 optimize status Table is already up to date
test.t2 optimize status Table is already up to date
SHOW TABLES;
Tables_in_test
+t2
+t1
+tmp
# in 11.2 and above here should be listed above used temporary tables
DROP TEMPORARY TABLE t1, t2;
#
diff --git a/mysql-test/main/timezone.result b/mysql-test/main/timezone.result
index 2ba1e3fb..2a099e90 100644
--- a/mysql-test/main/timezone.result
+++ b/mysql-test/main/timezone.result
@@ -75,3 +75,14 @@ alter table mysql.time_zone_transition_type add primary key (time_zone_id,transi
#
# End of 10.8 tests
#
+#
+# MDEV-31684 Add timezone information to DATE_FORMAT
+#
+# using system time
+SET @@time_zone= default;
+SELECT DATE_FORMAT('2009-11-01 22:23:00', '%z %Z') AS current_timezone;
+current_timezone
++0100 MET
+SELECT DATE_FORMAT('2008-06-04 02:23:00', '%z %Z') AS current_timezone;
+current_timezone
++0200 MEST
diff --git a/mysql-test/main/timezone.test b/mysql-test/main/timezone.test
index 89c3ab5c..50e062b4 100644
--- a/mysql-test/main/timezone.test
+++ b/mysql-test/main/timezone.test
@@ -74,3 +74,12 @@ alter table mysql.time_zone_transition_type add primary key (time_zone_id,transi
--echo #
--echo # End of 10.8 tests
--echo #
+
+--echo #
+--echo # MDEV-31684 Add timezone information to DATE_FORMAT
+--echo #
+
+--echo # using system time
+SET @@time_zone= default;
+SELECT DATE_FORMAT('2009-11-01 22:23:00', '%z %Z') AS current_timezone;
+SELECT DATE_FORMAT('2008-06-04 02:23:00', '%z %Z') AS current_timezone;
diff --git a/mysql-test/main/timezone2.result b/mysql-test/main/timezone2.result
index 31b17fbc..382ed447 100644
--- a/mysql-test/main/timezone2.result
+++ b/mysql-test/main/timezone2.result
@@ -373,6 +373,8 @@ DROP TABLE t1, t2, t3;
# (an addition for the test for MDEV-4653)
SET timestamp=unix_timestamp('2001-02-03 10:20:30');
SET old_mode=ZERO_DATE_TIME_CAST;
+Warnings:
+Warning 1287 'ZERO_DATE_TIME_CAST' is deprecated and will be removed in a future release
SELECT CONVERT_TZ(TIME('00:00:00'),'+00:00','+7:5');
CONVERT_TZ(TIME('00:00:00'),'+00:00','+7:5')
NULL
@@ -676,3 +678,188 @@ SELECT a, UNIX_TIMESTAMP(a) FROM t1 WHERE a >= ALL (SELECT * FROM t1);
a UNIX_TIMESTAMP(a)
2010-10-31 02:25:25 1288481125
DROP TABLE t1;
+#
+# MDEV-32148 Inefficient WHERE timestamp_column=datetime_expr
+#
+#
+# Testing a DST change (fall back)
+#
+SET time_zone='Europe/Moscow';
+SET @first_second_after_dst_fall_back=1288479600;
+CREATE TABLE t1 (a TIMESTAMP NULL);
+INSERT INTO t1 VALUES ('2001-01-01 10:20:30'),('2001-01-01 10:20:31');
+#
+# Optimized (more than 24 hours before the DST fall back)
+#
+SET timestamp=@first_second_after_dst_fall_back-24*3600-1;
+SELECT UNIX_TIMESTAMP(), NOW();
+UNIX_TIMESTAMP() NOW()
+1288393199 2010-10-30 02:59:59
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2010-10-30 02:59:59'
+#
+# Not optimized (24 hours before the DST fall back)
+#
+SET timestamp=@first_second_after_dst_fall_back-24*3600;
+SELECT UNIX_TIMESTAMP(), NOW();
+UNIX_TIMESTAMP() NOW()
+1288393200 2010-10-30 03:00:00
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = <cache>(current_timestamp())
+#
+# Not optimized (less than 24 hours after the DST fall back)
+#
+SET timestamp=@first_second_after_dst_fall_back+24*3600-1;
+SELECT UNIX_TIMESTAMP(), NOW();
+UNIX_TIMESTAMP() NOW()
+1288565999 2010-11-01 01:59:59
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = <cache>(current_timestamp())
+#
+# Optimized (24 hours after the DST fall back)
+#
+SET timestamp=@first_second_after_dst_fall_back+24*3600;
+SELECT UNIX_TIMESTAMP(), NOW();
+UNIX_TIMESTAMP() NOW()
+1288566000 2010-11-01 02:00:00
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2010-11-01 02:00:00'
+DROP TABLE t1;
+SET time_zone=DEFAULT;
+#
+# Testing a DST change (spring forward)
+#
+SET time_zone='Europe/Moscow';
+SET @first_second_after_dst_spring_forward=1301180400;
+CREATE TABLE t1 (a TIMESTAMP NULL);
+INSERT INTO t1 VALUES ('2001-01-01 10:20:30'),('2001-01-01 10:20:31');
+#
+# Optimized (more than 24 hours before the DST sprint forward)
+#
+SET timestamp=@first_second_after_dst_spring_forward-24*3600-1;
+SELECT UNIX_TIMESTAMP(), NOW();
+UNIX_TIMESTAMP() NOW()
+1301093999 2011-03-26 01:59:59
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2011-03-26 01:59:59'
+#
+# Not optimized (24 hours before the DST sprint forward)
+#
+SET timestamp=@first_second_after_dst_spring_forward-24*3600;
+SELECT UNIX_TIMESTAMP(), NOW();
+UNIX_TIMESTAMP() NOW()
+1301094000 2011-03-26 02:00:00
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = <cache>(current_timestamp())
+#
+# Not optimized (less than 24 hours after the DST sprint forward)
+#
+SET timestamp=@first_second_after_dst_spring_forward+24*3600-1;
+SELECT UNIX_TIMESTAMP(), NOW();
+UNIX_TIMESTAMP() NOW()
+1301266799 2011-03-28 02:59:59
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = <cache>(current_timestamp())
+#
+# Optimized (24 hours after the DST sprint forward)
+#
+SET timestamp=@first_second_after_dst_spring_forward+24*3600;
+SELECT UNIX_TIMESTAMP(), NOW();
+UNIX_TIMESTAMP() NOW()
+1301266800 2011-03-28 03:00:00
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2011-03-28 03:00:00'
+DROP TABLE t1;
+#
+# Testing a leap second
+#
+SET time_zone='leap/Europe/Moscow';
+SET @leap_second=362793609;
+/*The 60th leap second*/
+CREATE TABLE t1 (a TIMESTAMP);
+SET timestamp=@leap_second-1;
+INSERT INTO t1 VALUES (NOW());
+SET timestamp=@leap_second;
+INSERT INTO t1 VALUES (NOW());
+SET timestamp=@leap_second+1;
+INSERT INTO t1 VALUES (NOW());
+SELECT UNIX_TIMESTAMP(a), a FROM t1 ORDER BY UNIX_TIMESTAMP(a);
+UNIX_TIMESTAMP(a) a
+362793608 1981-07-01 03:59:59
+362793609 1981-07-01 03:59:59
+362793610 1981-07-01 04:00:00
+INSERT INTO t1 VALUES ('2001-01-01 10:20:30');
+#
+# Optimized (more than 24 hours before the leap second)
+#
+SET timestamp=@leap_second-24*3600-1;
+SELECT UNIX_TIMESTAMP(), NOW();
+UNIX_TIMESTAMP() NOW()
+362707208 1981-06-30 03:59:59
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'1981-06-30 03:59:59'
+#
+# Not optimized (24 hours before the leap second)
+#
+SET timestamp=@leap_second-24*3600;
+SELECT UNIX_TIMESTAMP(), NOW();
+UNIX_TIMESTAMP() NOW()
+362707209 1981-06-30 04:00:00
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = <cache>(current_timestamp())
+#
+# Not optimized (less than 24 hours after the leap second)
+#
+SET timestamp=@leap_second+24*3600-1;
+SELECT UNIX_TIMESTAMP(), NOW();
+UNIX_TIMESTAMP() NOW()
+362880008 1981-07-02 03:59:58
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = <cache>(current_timestamp())
+#
+# Not optimized (24 hours after the leap second)
+#
+SET timestamp=@leap_second+24*3600;
+SELECT UNIX_TIMESTAMP(), NOW();
+UNIX_TIMESTAMP() NOW()
+362880009 1981-07-02 03:59:59
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'1981-07-02 03:59:59'
+DROP TABLE t1;
+SET time_zone=DEFAULT;
diff --git a/mysql-test/main/timezone2.test b/mysql-test/main/timezone2.test
index b5045203..09be7408 100644
--- a/mysql-test/main/timezone2.test
+++ b/mysql-test/main/timezone2.test
@@ -630,3 +630,155 @@ SELECT a, UNIX_TIMESTAMP(a) FROM t1 ORDER BY a;
SELECT a, UNIX_TIMESTAMP(a) FROM t1 WHERE a <= ALL (SELECT * FROM t1);
SELECT a, UNIX_TIMESTAMP(a) FROM t1 WHERE a >= ALL (SELECT * FROM t1);
DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-32148 Inefficient WHERE timestamp_column=datetime_expr
+--echo #
+
+--echo #
+--echo # Testing a DST change (fall back)
+--echo #
+
+SET time_zone='Europe/Moscow';
+# '2010-10-31 02:59:59' (1288479599)
+# '2010-10-31 02:00:00' (1288479600)
+SET @first_second_after_dst_fall_back=1288479600;
+
+CREATE TABLE t1 (a TIMESTAMP NULL);
+INSERT INTO t1 VALUES ('2001-01-01 10:20:30'),('2001-01-01 10:20:31');
+
+--echo #
+--echo # Optimized (more than 24 hours before the DST fall back)
+--echo #
+
+SET timestamp=@first_second_after_dst_fall_back-24*3600-1;
+SELECT UNIX_TIMESTAMP(), NOW();
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+
+--echo #
+--echo # Not optimized (24 hours before the DST fall back)
+--echo #
+
+SET timestamp=@first_second_after_dst_fall_back-24*3600;
+SELECT UNIX_TIMESTAMP(), NOW();
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+
+--echo #
+--echo # Not optimized (less than 24 hours after the DST fall back)
+--echo #
+
+SET timestamp=@first_second_after_dst_fall_back+24*3600-1;
+SELECT UNIX_TIMESTAMP(), NOW();
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+
+--echo #
+--echo # Optimized (24 hours after the DST fall back)
+--echo #
+
+SET timestamp=@first_second_after_dst_fall_back+24*3600;
+SELECT UNIX_TIMESTAMP(), NOW();
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+
+DROP TABLE t1;
+SET time_zone=DEFAULT;
+
+
+--echo #
+--echo # Testing a DST change (spring forward)
+--echo #
+
+SET time_zone='Europe/Moscow';
+# '2011-03-27 01:59:59' (1301180399)
+# '2011-03-27 03:00:00' (1301180400)
+SET @first_second_after_dst_spring_forward=1301180400;
+
+CREATE TABLE t1 (a TIMESTAMP NULL);
+INSERT INTO t1 VALUES ('2001-01-01 10:20:30'),('2001-01-01 10:20:31');
+
+--echo #
+--echo # Optimized (more than 24 hours before the DST sprint forward)
+--echo #
+
+SET timestamp=@first_second_after_dst_spring_forward-24*3600-1;
+SELECT UNIX_TIMESTAMP(), NOW();
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+
+--echo #
+--echo # Not optimized (24 hours before the DST sprint forward)
+--echo #
+
+SET timestamp=@first_second_after_dst_spring_forward-24*3600;
+SELECT UNIX_TIMESTAMP(), NOW();
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+
+--echo #
+--echo # Not optimized (less than 24 hours after the DST sprint forward)
+--echo #
+
+SET timestamp=@first_second_after_dst_spring_forward+24*3600-1;
+SELECT UNIX_TIMESTAMP(), NOW();
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+
+--echo #
+--echo # Optimized (24 hours after the DST sprint forward)
+--echo #
+
+SET timestamp=@first_second_after_dst_spring_forward+24*3600;
+SELECT UNIX_TIMESTAMP(), NOW();
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+
+DROP TABLE t1;
+
+--echo #
+--echo # Testing a leap second
+--echo #
+
+SET time_zone='leap/Europe/Moscow';
+SET @leap_second=362793609; /*The 60th leap second*/
+
+CREATE TABLE t1 (a TIMESTAMP);
+SET timestamp=@leap_second-1;
+INSERT INTO t1 VALUES (NOW());
+SET timestamp=@leap_second;
+INSERT INTO t1 VALUES (NOW());
+SET timestamp=@leap_second+1;
+INSERT INTO t1 VALUES (NOW());
+SELECT UNIX_TIMESTAMP(a), a FROM t1 ORDER BY UNIX_TIMESTAMP(a);
+INSERT INTO t1 VALUES ('2001-01-01 10:20:30');
+
+--echo #
+--echo # Optimized (more than 24 hours before the leap second)
+--echo #
+
+SET timestamp=@leap_second-24*3600-1;
+SELECT UNIX_TIMESTAMP(), NOW();
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+
+--echo #
+--echo # Not optimized (24 hours before the leap second)
+--echo #
+
+SET timestamp=@leap_second-24*3600;
+SELECT UNIX_TIMESTAMP(), NOW();
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+
+--echo #
+--echo # Not optimized (less than 24 hours after the leap second)
+--echo #
+
+SET timestamp=@leap_second+24*3600-1;
+SELECT UNIX_TIMESTAMP(), NOW();
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+
+--echo #
+--echo # Not optimized (24 hours after the leap second)
+--echo #
+
+SET timestamp=@leap_second+24*3600;
+SELECT UNIX_TIMESTAMP(), NOW();
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=now();
+
+DROP TABLE t1;
+
+SET time_zone=DEFAULT;
diff --git a/mysql-test/main/tls_version.result b/mysql-test/main/tls_version.result
index 3d956598..9561c5f5 100644
--- a/mysql-test/main/tls_version.result
+++ b/mysql-test/main/tls_version.result
@@ -1,15 +1,25 @@
+#default is highest available version: TLSv1.2
Variable_name Value
Ssl_version TLSv1.2
+# TLSv1.2
Variable_name Value
Ssl_version TLSv1.2
+# TLSv1.1
Variable_name Value
Ssl_version TLSv1.1
+# if a gap is between TLS versions, lowest version number should be used (TLS1.1)
Variable_name Value
Ssl_version TLSv1.1
+# TLSv1.3 is not enabled, so TLSv1.2 should be used
Variable_name Value
Ssl_version TLSv1.2
+# Highest TLS version number should be used (TLSv1.2)
Variable_name Value
Ssl_version TLSv1.2
+# TLS v1.0 is no longer supported, an attempt to set it is ignored
+Variable_name Value
+Ssl_version TLSv1.2
+# finally list available protocols
@@tls_version
TLSv1.1,TLSv1.2
call mtr.add_suppression("TLSv1.0 and TLSv1.1 are insecure");
diff --git a/mysql-test/main/tls_version.test b/mysql-test/main/tls_version.test
index 50448f89..d973f151 100644
--- a/mysql-test/main/tls_version.test
+++ b/mysql-test/main/tls_version.test
@@ -2,24 +2,21 @@
# with support for SSL.
-- source include/have_ssl_communication.inc
-#default is highest available version: TLSv1.2
+--echo #default is highest available version: TLSv1.2
--exec $MYSQL --host=localhost --ssl -e "show status like 'ssl_version';"
-# TLSv1.2
+--echo # TLSv1.2
--exec $MYSQL --host=localhost --ssl --tls_version=TLSv1.2 -e "show status like 'ssl_version';"
-# TLSv1.1
+--echo # TLSv1.1
--exec $MYSQL --host=localhost --ssl --tls_version=TLSv1.1 -e "show status like 'ssl_version';"
-# if a gap is between TLS versions, lowest version number should be used (TLS1.1)
+--echo # if a gap is between TLS versions, lowest version number should be used (TLS1.1)
--exec $MYSQL --host=localhost --ssl --tls_version=TLSv1.1,TLSv1.3 -e "show status like 'ssl_version';"
-# TLSv1.3 is not enabled, so TLSv1.2 should be used
+--echo # TLSv1.3 is not enabled, so TLSv1.2 should be used
--exec $MYSQL --host=localhost --ssl --tls_version=TLSv1.2,TLSv1.3 -e "show status like 'ssl_version';"
-# Highest TLS version number should be used (TLSv1.2)
+--echo # Highest TLS version number should be used (TLSv1.2)
--exec $MYSQL --host=localhost --ssl --tls_version=TLSv1.1,TLSv1.2 -e "show status like 'ssl_version';"
-# Errors:
-# TLS v1.0 is disabled on server, so we should get an error
---replace_regex /2026 SSL connection error.*/2026 SSL connection error: xxxx/
---error 1
+--echo # TLS v1.0 is no longer supported, an attempt to set it is ignored
--exec $MYSQL --host=localhost --ssl --tls_version=TLSv1.0 -e "show status like 'ssl_version';"
-# finally list available protocols
+--echo # finally list available protocols
--exec $MYSQL --host=localhost --ssl -e "select @@tls_version;"
call mtr.add_suppression("TLSv1.0 and TLSv1.1 are insecure");
diff --git a/mysql-test/main/tls_version1.opt b/mysql-test/main/tls_version1.opt
deleted file mode 100644
index 91715074..00000000
--- a/mysql-test/main/tls_version1.opt
+++ /dev/null
@@ -1 +0,0 @@
---tls_version=TLSv1.0
diff --git a/mysql-test/main/tls_version1.result b/mysql-test/main/tls_version1.result
deleted file mode 100644
index caabed83..00000000
--- a/mysql-test/main/tls_version1.result
+++ /dev/null
@@ -1,8 +0,0 @@
-Variable_name Value
-Ssl_version TLSv1
-Variable_name Value
-Ssl_version TLSv1
-@@tls_version
-TLSv1.0
-call mtr.add_suppression("TLSv1.0 and TLSv1.1 are insecure");
-FOUND 1 /TLSv1.0 and TLSv1.1 are insecure/ in mysqld.1.err
diff --git a/mysql-test/main/tls_version1.test b/mysql-test/main/tls_version1.test
deleted file mode 100644
index 788284c3..00000000
--- a/mysql-test/main/tls_version1.test
+++ /dev/null
@@ -1,17 +0,0 @@
-# Tests for SSL connections, only run if mysqld is compiled
-# with support for SSL.
-
--- source include/have_ssl_communication.inc
---exec $MYSQL --host=localhost --ssl -e "show status like 'ssl_version';"
---error 1
---exec $MYSQL --host=localhost --ssl --tls_version=TLSv1.2 -e "show status like 'ssl_version';"
---error 1
---exec $MYSQL --host=localhost --ssl --tls_version=TLSv1.1 -e "show status like 'ssl_version';"
---exec $MYSQL --host=localhost --ssl --tls_version=TLSv1.0 -e "show status like 'ssl_version';"
---exec $MYSQL --host=localhost --ssl -e "select @@tls_version;"
-
-call mtr.add_suppression("TLSv1.0 and TLSv1.1 are insecure");
---let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err
---let SEARCH_PATTERN= TLSv1.0 and TLSv1.1 are insecure
---source include/search_pattern_in_file.inc
-
diff --git a/mysql-test/main/tmp_table_count-7586.result b/mysql-test/main/tmp_table_count-7586.result
index 637e7385..ebb23331 100644
--- a/mysql-test/main/tmp_table_count-7586.result
+++ b/mysql-test/main/tmp_table_count-7586.result
@@ -52,6 +52,7 @@ Created_tmp_disk_tables 0
Created_tmp_files 0
Created_tmp_tables 2
drop table t3;
+set @@optimizer_switch="firstmatch=off";
EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT * FROM t2 GROUP BY a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
@@ -69,6 +70,7 @@ Variable_name Value
Created_tmp_disk_tables 0
Created_tmp_files 0
Created_tmp_tables 1
+set @@optimizer_switch=default;
drop table t1,t2,t3;
truncate table performance_schema.events_statements_history_long;
flush status;
diff --git a/mysql-test/main/tmp_table_count-7586.test b/mysql-test/main/tmp_table_count-7586.test
index 0629e27f..8fe9e3d2 100644
--- a/mysql-test/main/tmp_table_count-7586.test
+++ b/mysql-test/main/tmp_table_count-7586.test
@@ -47,6 +47,7 @@ select sum(created_tmp_tables) from performance_schema.events_statements_history
show status like '%Created_tmp%';
drop table t3;
+set @@optimizer_switch="firstmatch=off";
EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT * FROM t2 GROUP BY a);
truncate table performance_schema.events_statements_history_long;
flush status;
@@ -54,6 +55,7 @@ CREATE TABLE t3 SELECT * FROM t1 WHERE a IN (SELECT * FROM t2 GROUP BY a);
--echo # Performance schema should be the same as "Created_tmp_tables" variable below
select sum(created_tmp_tables) from performance_schema.events_statements_history_long;
show status like '%Created_tmp%';
+set @@optimizer_switch=default;
drop table t1,t2,t3;
diff --git a/mysql-test/main/trans_read_only.result b/mysql-test/main/trans_read_only.result
index 5e86b099..acced0a0 100644
--- a/mysql-test/main/trans_read_only.result
+++ b/mysql-test/main/trans_read_only.result
@@ -4,22 +4,22 @@
#
# Test9: The --transaction-read-only startup option.
# Check that the option was set by the .opt file.
-SELECT @@tx_read_only;
-@@tx_read_only
+SELECT @@transaction_read_only;
+@@transaction_read_only
1
# Also for new connections.
connect con1, localhost, root;
-SELECT @@tx_read_only;
-@@tx_read_only
+SELECT @@transaction_read_only;
+@@transaction_read_only
1
SET SESSION TRANSACTION READ WRITE;
-SELECT @@tx_read_only;
-@@tx_read_only
+SELECT @@transaction_read_only;
+@@transaction_read_only
0
disconnect con1;
connection default;
-SELECT @@tx_read_only;
-@@tx_read_only
+SELECT @@transaction_read_only;
+@@transaction_read_only
1
#
# Test 10: SET TRANSACTION / START TRANSACTION + implicit commit.
diff --git a/mysql-test/main/trans_read_only.test b/mysql-test/main/trans_read_only.test
index 38b2a833..d8c2f20b 100644
--- a/mysql-test/main/trans_read_only.test
+++ b/mysql-test/main/trans_read_only.test
@@ -8,18 +8,18 @@
--echo # Test9: The --transaction-read-only startup option.
--echo # Check that the option was set by the .opt file.
-SELECT @@tx_read_only;
+SELECT @@transaction_read_only;
--echo # Also for new connections.
connect (con1, localhost, root);
-SELECT @@tx_read_only;
+SELECT @@transaction_read_only;
SET SESSION TRANSACTION READ WRITE;
-SELECT @@tx_read_only;
+SELECT @@transaction_read_only;
disconnect con1;
--source include/wait_until_disconnected.inc
connection default;
-SELECT @@tx_read_only;
+SELECT @@transaction_read_only;
--echo #
diff --git a/mysql-test/main/trigger.result b/mysql-test/main/trigger.result
index c824af66..dd6fa215 100644
--- a/mysql-test/main/trigger.result
+++ b/mysql-test/main/trigger.result
@@ -730,8 +730,6 @@ select user() into user;
set NEW.username = user;
select count(*) from ((select 1) union (select 2)) as d1 into i;
end|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
update t1 set data = 1;
connection addconroot1;
update t1 set data = 2;
@@ -2080,8 +2078,6 @@ FOR EACH ROW BEGIN
SELECT 1 FROM t1 c WHERE
(@bug51650 IS NULL OR @bug51650 != c.b) AND c.b = NEW.a LIMIT 1 INTO @foo;
END//
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
SET @bug51650 = 1;
INSERT IGNORE INTO t2 VALUES();
INSERT IGNORE INTO t1 SET b = '777';
diff --git a/mysql-test/main/trigger_notembedded.result b/mysql-test/main/trigger_notembedded.result
index 41547ac1..b6d87843 100644
--- a/mysql-test/main/trigger_notembedded.result
+++ b/mysql-test/main/trigger_notembedded.result
@@ -112,7 +112,7 @@ CREATE DEFINER='mysqltest_inv'@'localhost'
TRIGGER trg1 BEFORE INSERT ON t1
FOR EACH ROW
SET @new_sum = 0;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, SET USER privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the SET USER privilege(s) for this operation
connection default;
use mysqltest_db1;
GRANT SET USER ON *.* TO mysqltest_dfn@localhost;
diff --git a/mysql-test/main/type_blob.result b/mysql-test/main/type_blob.result
index b9d1f2ca..bc25af5a 100644
--- a/mysql-test/main/type_blob.result
+++ b/mysql-test/main/type_blob.result
@@ -690,18 +690,18 @@ id txt
2 Chevy
select * from t1 where txt > 'Chevy';
id txt
+7 Ford
4 Honda
-5 Subaru
6 Honda
-7 Ford
+5 Subaru
select * from t1 where txt >= 'Chevy';
id txt
1 Chevy
2 Chevy
+7 Ford
4 Honda
-5 Subaru
6 Honda
-7 Ford
+5 Subaru
alter table t1 modify column txt blob;
explain select * from t1 where txt='Chevy' or txt is NULL;
id select_type table type possible_keys key key_len ref rows Extra
@@ -901,7 +901,7 @@ CREATE TABLE b15776 (a char(4294967296));
ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT instead
CREATE TABLE b15776 (a year(?));
Warnings:
-Note 1287 'YEAR(?)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(?)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
INSERT INTO b15776 VALUES (42);
SELECT * FROM b15776;
a
@@ -909,7 +909,7 @@ a
DROP TABLE b15776;
CREATE TABLE b15776 (a year(4294967296));
Warnings:
-Note 1287 'YEAR(4294967295)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(4294967295)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
SHOW CREATE TABLE b15776;
Table Create Table
b15776 CREATE TABLE `b15776` (
@@ -918,7 +918,7 @@ b15776 CREATE TABLE `b15776` (
DROP TABLE b15776;
CREATE TABLE b15776 (a year(0));
Warnings:
-Note 1287 'YEAR(0)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(0)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
DROP TABLE b15776;
CREATE TABLE b15776 (a year(-2));
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-2))' at line 1
@@ -938,7 +938,7 @@ CREATE TABLE b15776 (a char(9999999999999999999999999999999999999999999999999999
ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT instead
CREATE TABLE b15776 (a year(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
Warnings:
-Note 1287 'YEAR(4294967295)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(4294967295)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
SHOW CREATE TABLE b15776;
Table Create Table
b15776 CREATE TABLE `b15776` (
diff --git a/mysql-test/main/type_datetime.result b/mysql-test/main/type_datetime.result
index bd937416..282ff60f 100644
--- a/mysql-test/main/type_datetime.result
+++ b/mysql-test/main/type_datetime.result
@@ -545,7 +545,7 @@ select * from t1
where id in (select id from t1 as x1 where (t1.cur_date is null));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
-1 PRIMARY x1 ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary; End temporary
+1 PRIMARY x1 ALL NULL NULL NULL NULL 2 50.00 Using where; FirstMatch(t1)
Warnings:
Note 1276 Field or reference 'test.t1.cur_date' of SELECT #2 was resolved in SELECT #1
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`cur_date` AS `cur_date` from `test`.`t1` semi join (`test`.`t1` `x1`) where `test`.`x1`.`id` = `test`.`t1`.`id` and `test`.`t1`.`cur_date` = 0
@@ -557,7 +557,7 @@ select * from t2
where id in (select id from t2 as x1 where (t2.cur_date is null));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
-1 PRIMARY x1 ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary; End temporary
+1 PRIMARY x1 ALL NULL NULL NULL NULL 2 50.00 Using where; FirstMatch(t2)
Warnings:
Note 1276 Field or reference 'test.t2.cur_date' of SELECT #2 was resolved in SELECT #1
Note 1003 select `test`.`t2`.`id` AS `id`,`test`.`t2`.`cur_date` AS `cur_date` from `test`.`t2` semi join (`test`.`t2` `x1`) where `test`.`x1`.`id` = `test`.`t2`.`id` and `test`.`t2`.`cur_date` = 0
@@ -936,6 +936,8 @@ SELECT STR_TO_DATE('0000-00-00 00:00:00.000001','%Y-%m-%d %H:%i:%s.%f');
STR_TO_DATE('0000-00-00 00:00:00.000001','%Y-%m-%d %H:%i:%s.%f')
0000-00-00 00:00:00.000001
SET old_mode=zero_date_time_cast;
+Warnings:
+Warning 1287 'ZERO_DATE_TIME_CAST' is deprecated and will be removed in a future release
SELECT CAST(TIME'10:20:30' AS DATETIME);
CAST(TIME'10:20:30' AS DATETIME)
0000-00-00 10:20:30
diff --git a/mysql-test/main/type_enum.result b/mysql-test/main/type_enum.result
index b3ef6b5b..df9c07c6 100644
--- a/mysql-test/main/type_enum.result
+++ b/mysql-test/main/type_enum.result
@@ -1905,7 +1905,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index PRIMARY PRIMARY 1 NULL 2 Using where; Using index
Warnings:
Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of type `enum` = "`t1`.`c1`" of type `date`
-Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of type `enum` = "'2001-01-01'" of type `date`
SELECT t1.* FROM t1 LEFT JOIN t2 USING (c1);
c1
2001-01-01
@@ -1917,7 +1916,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index PRIMARY PRIMARY 1 NULL 2 Using where; Using index
Warnings:
Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of type `enum` = "`t1`.`c1`" of type `date`
-Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of type `enum` = "'2001-01-01'" of type `date`
DROP TABLE t1, t2;
#
# MDEV-6978 Bad results with join comparing case insensitive VARCHAR/ENUM/SET expression to a _bin ENUM column
@@ -1950,7 +1948,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index PRIMARY PRIMARY 1 NULL 2 Using where; Using index
Warnings:
Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of collation `latin1_bin` = "`t1`.`c1` collate latin1_swedish_ci" of collation `latin1_swedish_ci`
-Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of collation `latin1_bin` = "<cache>('a' collate latin1_swedish_ci)" of collation `latin1_swedish_ci`
DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (c1 SET('a') CHARACTER SET latin1 PRIMARY KEY);
INSERT INTO t1 VALUES ('a');
@@ -1980,7 +1977,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index PRIMARY PRIMARY 1 NULL 2 Using where; Using index
Warnings:
Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of collation `latin1_bin` = "`t1`.`c1` collate latin1_swedish_ci" of collation `latin1_swedish_ci`
-Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of collation `latin1_bin` = "<cache>('a' collate latin1_swedish_ci)" of collation `latin1_swedish_ci`
DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (c1 VARCHAR(10) CHARACTER SET latin1 PRIMARY KEY);
INSERT INTO t1 VALUES ('a');
@@ -2010,7 +2006,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index PRIMARY PRIMARY 1 NULL 2 Using where; Using index
Warnings:
Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of collation `latin1_bin` = "`t1`.`c1` collate latin1_swedish_ci" of collation `latin1_swedish_ci`
-Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of collation `latin1_bin` = "<cache>('a' collate latin1_swedish_ci)" of collation `latin1_swedish_ci`
DROP TABLE IF EXISTS t1,t2;
#
# MDEV-6991 GROUP_MIN_MAX optimization is erroneously applied in some cases
@@ -2594,7 +2589,7 @@ t2 CREATE TABLE `t2` (
DROP TABLE t2;
SELECT c_int FROM t1 UNION SELECT c_enum FROM t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def c_int c_int 253 11 0 Y 0 0 8
+def c_int c_int 253 11 0 Y 16384 0 8
c_int
SELECT COALESCE(c_int, c_enum) FROM t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
diff --git a/mysql-test/main/type_float.result b/mysql-test/main/type_float.result
index 2df714af..877cdec8 100644
--- a/mysql-test/main/type_float.result
+++ b/mysql-test/main/type_float.result
@@ -540,7 +540,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index PRIMARY PRIMARY 8 NULL 2 Using where; Using index
Warnings:
Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`a` of type `double` = "`t1`.`a`" of type `datetime`
-Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`a` of type `double` = "'1999-01-01 00:00:00'" of type `datetime`
DROP TABLE t1,t2;
#
# MDEV-6971 Bad results with joins comparing TIME and DOUBLE/DECIMAL columns
@@ -573,7 +572,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index PRIMARY PRIMARY 8 NULL 2 Using where; Using index
Warnings:
Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`a` of type `double` = "`t1`.`a`" of type `time`
-Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`a` of type `double` = "'10:20:30.000000'" of type `time`
DROP TABLE t1,t2;
#
# End of 10.0 tests
diff --git a/mysql-test/main/type_newdecimal.result b/mysql-test/main/type_newdecimal.result
index 08161ccc..f63aafef 100644
--- a/mysql-test/main/type_newdecimal.result
+++ b/mysql-test/main/type_newdecimal.result
@@ -2136,7 +2136,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index PRIMARY PRIMARY 14 NULL 2 Using where; Using index
Warnings:
Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`a` of type `decimal` = "`t1`.`a`" of type `datetime`
-Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`a` of type `decimal` = "'1999-01-01 00:00:00'" of type `datetime`
DROP TABLE t1,t2;
#
# MDEV-6971 Bad results with joins comparing TIME and DOUBLE/DECIMAL columns
@@ -2169,7 +2168,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index PRIMARY PRIMARY 14 NULL 2 Using where; Using index
Warnings:
Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`a` of type `decimal` = "`t1`.`a`" of type `time`
-Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`a` of type `decimal` = "'10:20:30.000000'" of type `time`
DROP TABLE t1,t2;
#
# End of 10.0 tests
diff --git a/mysql-test/main/type_ranges.result b/mysql-test/main/type_ranges.result
index efd83423..c6ce8bd4 100644
--- a/mysql-test/main/type_ranges.result
+++ b/mysql-test/main/type_ranges.result
@@ -175,12 +175,12 @@ PRIMARY KEY (auto)
);
INSERT IGNORE INTO t2 (string,mediumblob_col,new_field) SELECT string,mediumblob_col,new_field from t1 where auto > 10;
Warnings:
+Warning 1265 Data truncated for column 'new_field' at row 1
Warning 1265 Data truncated for column 'new_field' at row 2
Warning 1265 Data truncated for column 'new_field' at row 3
Warning 1265 Data truncated for column 'new_field' at row 4
Warning 1265 Data truncated for column 'new_field' at row 5
Warning 1265 Data truncated for column 'new_field' at row 6
-Warning 1265 Data truncated for column 'new_field' at row 7
select * from t2;
auto string mediumblob_col new_field
1 2 2 ne
diff --git a/mysql-test/main/type_set.result b/mysql-test/main/type_set.result
index c439cbaf..e727c2cb 100644
--- a/mysql-test/main/type_set.result
+++ b/mysql-test/main/type_set.result
@@ -135,7 +135,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index PRIMARY PRIMARY 1 NULL 2 Using where; Using index
Warnings:
Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of type `set` = "`t1`.`c1`" of type `date`
-Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of type `set` = "'2001-01-01'" of type `date`
SELECT t1.* FROM t1 LEFT JOIN t2 ON t1.c1=t2.c1;
c1
2001-01-01
@@ -147,7 +146,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index PRIMARY PRIMARY 1 NULL 2 Using where; Using index
Warnings:
Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of type `set` = "`t1`.`c1`" of type `date`
-Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of type `set` = "'2001-01-01'" of type `date`
DROP TABLE t1, t2;
#
# MDEV-6978 Bad results with join comparing case insensitive VARCHAR/ENUM/SET expression to a _bin ENUM column
@@ -180,7 +178,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index PRIMARY PRIMARY 1 NULL 2 Using where; Using index
Warnings:
Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of collation `latin1_bin` = "`t1`.`c1` collate latin1_swedish_ci" of collation `latin1_swedish_ci`
-Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of collation `latin1_bin` = "<cache>('a' collate latin1_swedish_ci)" of collation `latin1_swedish_ci`
DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (c1 SET('a') CHARACTER SET latin1 PRIMARY KEY);
INSERT INTO t1 VALUES ('a');
@@ -210,7 +207,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index PRIMARY PRIMARY 1 NULL 2 Using where; Using index
Warnings:
Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of collation `latin1_bin` = "`t1`.`c1` collate latin1_swedish_ci" of collation `latin1_swedish_ci`
-Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of collation `latin1_bin` = "<cache>('a' collate latin1_swedish_ci)" of collation `latin1_swedish_ci`
DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (c1 VARCHAR(10) CHARACTER SET latin1 PRIMARY KEY);
INSERT INTO t1 VALUES ('a');
@@ -240,7 +236,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index PRIMARY PRIMARY 1 NULL 2 Using where; Using index
Warnings:
Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of collation `latin1_bin` = "`t1`.`c1` collate latin1_swedish_ci" of collation `latin1_swedish_ci`
-Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of collation `latin1_bin` = "<cache>('a' collate latin1_swedish_ci)" of collation `latin1_swedish_ci`
DROP TABLE IF EXISTS t1,t2;
#
# MDEV-6993 Bad results with join comparing DECIMAL and ENUM/SET columns
@@ -684,7 +679,7 @@ t2 CREATE TABLE `t2` (
DROP TABLE t2;
SELECT c_int FROM t1 UNION SELECT c_set FROM t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def c_int c_int 253 33 0 Y 0 0 33
+def c_int c_int 253 33 0 Y 16384 0 33
c_int
SELECT COALESCE(c_int, c_set) FROM t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
diff --git a/mysql-test/main/type_time.result b/mysql-test/main/type_time.result
index 532672a0..97f45e61 100644
--- a/mysql-test/main/type_time.result
+++ b/mysql-test/main/type_time.result
@@ -788,6 +788,8 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` =
DROP TABLE t1;
SET timestamp=DEFAULT;
SET @@old_mode=zero_date_time_cast;
+Warnings:
+Warning 1287 'ZERO_DATE_TIME_CAST' is deprecated and will be removed in a future release
# TIMESTAMP literal, old mode
CREATE TABLE t1 (a TIME);
INSERT INTO t1 VALUES ('0000-00-00 10:20:30'),('0000-00-00 10:20:31');
@@ -1231,6 +1233,8 @@ DROP TABLE t1;
#
SET @save_old_mode=@@old_mode;
SET @@old_mode=zero_date_time_cast;
+Warnings:
+Warning 1287 'ZERO_DATE_TIME_CAST' is deprecated and will be removed in a future release
CREATE TABLE t1 (a TIME);
INSERT INTO t1 VALUES ('0000-00-00 10:20:30'),('0000-00-00 10:20:31');
INSERT INTO t1 VALUES ('0000-00-01 10:20:30'),('0000-00-01 10:20:31');
diff --git a/mysql-test/main/type_time_6065.result b/mysql-test/main/type_time_6065.result
index 56de9687..e0014ea7 100644
--- a/mysql-test/main/type_time_6065.result
+++ b/mysql-test/main/type_time_6065.result
@@ -220,7 +220,7 @@ t1 force INDEX (col_time_key)
WHERE col_time_key = col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where
-1 SIMPLE t1 ref col_time_key col_time_key 4 test.t2.col_datetime_key 2 100.00 Using where; Using index
+1 SIMPLE t1 ref col_time_key col_time_key 4 test.t2.col_datetime_key 1 100.00 Using where; Using index
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -241,7 +241,7 @@ t1 force INDEX (col_time_key)
WHERE col_datetime_key = col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using where
-1 SIMPLE t1 ref col_time_key col_time_key 4 test.t2.col_datetime_key 2 100.00 Using where; Using index
+1 SIMPLE t1 ref col_time_key col_time_key 4 test.t2.col_datetime_key 1 100.00 Using where; Using index
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -304,7 +304,7 @@ t1 force INDEX (col_time_key)
WHERE col_time_key = col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using where; Using index
-1 SIMPLE t1 ref col_time_key col_time_key 4 test.t2.col_datetime_key 2 100.00 Using where; Using index
+1 SIMPLE t1 ref col_time_key col_time_key 4 test.t2.col_datetime_key 1 100.00 Using where; Using index
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` = `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -325,7 +325,7 @@ t1 force INDEX (col_time_key)
WHERE col_datetime_key = col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using where; Using index
-1 SIMPLE t1 ref col_time_key col_time_key 4 test.t2.col_datetime_key 2 100.00 Using where; Using index
+1 SIMPLE t1 ref col_time_key col_time_key 4 test.t2.col_datetime_key 1 100.00 Using where; Using index
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` = `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -408,7 +408,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_time_key >= col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00
-1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` >= `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -439,7 +439,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_datetime_key >= col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00
-1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` >= `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -532,7 +532,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_time_key >= col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index
-1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` >= `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -563,7 +563,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_datetime_key >= col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index
-1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` >= `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -656,7 +656,7 @@ t1 force INDEX (col_time_key)
WHERE col_time_key >= col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00
-1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` >= `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -687,7 +687,7 @@ t1 force INDEX (col_time_key)
WHERE col_datetime_key >= col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00
-1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` >= `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -780,7 +780,7 @@ t1 force INDEX (col_time_key)
WHERE col_time_key >= col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
-1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` >= `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -811,7 +811,7 @@ t1 force INDEX (col_time_key)
WHERE col_datetime_key >= col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
-1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` >= `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -894,7 +894,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_time_key > col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00
-1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` > `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -920,7 +920,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_datetime_key > col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00
-1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` > `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -998,7 +998,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_time_key > col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index
-1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` > `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -1024,7 +1024,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_datetime_key > col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index
-1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` > `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -1102,7 +1102,7 @@ t1 force INDEX (col_time_key)
WHERE col_time_key > col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00
-1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` > `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -1128,7 +1128,7 @@ t1 force INDEX (col_time_key)
WHERE col_datetime_key > col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00
-1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` > `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -1206,7 +1206,7 @@ t1 force INDEX (col_time_key)
WHERE col_time_key > col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
-1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` > `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -1232,7 +1232,7 @@ t1 force INDEX (col_time_key)
WHERE col_datetime_key > col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
-1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` > `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -1320,7 +1320,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_time_key <= col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00
-1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` <= `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -1351,7 +1351,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_datetime_key <= col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00
-1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` <= `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -1444,7 +1444,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_time_key <= col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index
-1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` <= `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -1475,7 +1475,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_datetime_key <= col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index
-1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` <= `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -1568,7 +1568,7 @@ t1 force INDEX (col_time_key)
WHERE col_time_key <= col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00
-1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` <= `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -1599,7 +1599,7 @@ t1 force INDEX (col_time_key)
WHERE col_datetime_key <= col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00
-1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` <= `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -1692,7 +1692,7 @@ t1 force INDEX (col_time_key)
WHERE col_time_key <= col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
-1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` <= `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -1723,7 +1723,7 @@ t1 force INDEX (col_time_key)
WHERE col_datetime_key <= col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
-1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` <= `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -1806,7 +1806,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_time_key < col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00
-1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` < `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -1832,7 +1832,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_datetime_key < col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00
-1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` IGNORE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` < `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -1910,7 +1910,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_time_key < col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index
-1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t1`.`col_time_key` < `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -1936,7 +1936,7 @@ t2 force INDEX (col_datetime_key)
WHERE col_datetime_key < col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Using index
-1 SIMPLE t2 ALL col_datetime_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t1`.`col_time_key` AS `col_time_key`,`test`.`t2`.`col_datetime_key` AS `col_datetime_key` from `test`.`t1` FORCE INDEX (`col_time_key`) straight_join `test`.`t2` FORCE INDEX (`col_datetime_key`) where `test`.`t2`.`col_datetime_key` < `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -2014,7 +2014,7 @@ t1 force INDEX (col_time_key)
WHERE col_time_key < col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00
-1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` < `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -2040,7 +2040,7 @@ t1 force INDEX (col_time_key)
WHERE col_datetime_key < col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00
-1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` IGNORE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` < `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -2118,7 +2118,7 @@ t1 force INDEX (col_time_key)
WHERE col_time_key < col_datetime_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
-1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t1`.`col_time_key` < `test`.`t2`.`col_datetime_key`
SELECT * FROM
@@ -2144,7 +2144,7 @@ t1 force INDEX (col_time_key)
WHERE col_datetime_key < col_time_key;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 index col_datetime_key col_datetime_key 6 NULL 5 100.00 Using index
-1 SIMPLE t1 ALL col_time_key NULL NULL NULL 5 100.00 Range checked for each record (index map: 0x1)
+1 SIMPLE t1 index col_time_key col_time_key 4 NULL 5 100.00 Range checked for each record (index map: 0x1); Using index
Warnings:
Note 1003 select `test`.`t2`.`col_datetime_key` AS `col_datetime_key`,`test`.`t1`.`col_time_key` AS `col_time_key` from `test`.`t2` FORCE INDEX (`col_datetime_key`) straight_join `test`.`t1` FORCE INDEX (`col_time_key`) where `test`.`t2`.`col_datetime_key` < `test`.`t1`.`col_time_key`
SELECT * FROM
@@ -2267,9 +2267,8 @@ outr.col_varchar_key IS NULL
);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY outr system col_datetime_key NULL NULL NULL 1 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
+1 PRIMARY innr ref col_int_key col_int_key 4 const 2 50.00 Using where; FirstMatch(outr)
1 PRIMARY outr2 index col_time_key col_time_key 4 NULL 20 100.00 Using where; Using index; Using join buffer (flat, BNL join)
-2 MATERIALIZED innr ref col_int_key col_int_key 4 const 2 100.00 Using where
Warnings:
Note 1003 select 1 AS `col_int_nokey` from `test`.`t3` `outr2` semi join (`test`.`t1` `innr`) where `test`.`innr`.`col_int_key` = 1 and `test`.`innr`.`pk` >= `test`.`innr`.`col_int_nokey` and `test`.`outr2`.`col_time_key` > '2001-11-04 19:07:55'
SELECT outr.col_int_nokey
diff --git a/mysql-test/main/type_timestamp.result b/mysql-test/main/type_timestamp.result
index 5ac7cd64..a378ab80 100644
--- a/mysql-test/main/type_timestamp.result
+++ b/mysql-test/main/type_timestamp.result
@@ -872,13 +872,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=' 2001-01-01 00:00:00';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00'
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 00:00:00'
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=19+RAND() AND a=' 2001-01-01 00:00:00';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00' and <cache>(octet_length(TIMESTAMP'2001-01-01 00:00:00')) = 19 + rand()
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 00:00:00' and <cache>(octet_length(TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 00:00:00')) = 19 + rand()
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=' garbage ';
id select_type table type possible_keys key key_len ref rows filtered Extra
@@ -905,13 +905,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000'
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 00:00:00.000000'
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=30+RAND() AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000' and <cache>(octet_length(TIMESTAMP'2001-01-01 00:00:00')) = 30 + rand()
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 00:00:00.000000' and <cache>(octet_length(TIMESTAMP'2001-01-01 00:00:00')) = 30 + rand()
DROP TABLE t1;
CREATE TABLE t1 (a TIMESTAMP(6));;
INSERT INTO t1 VALUES ('2001-01-01 00:00:00.000000'),('2001-01-01 00:00:01.000000');
@@ -930,13 +930,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=26 AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000'
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 00:00:00.000000'
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIMESTAMP'2001-01-01 00:00:00.000000';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00.000000' and <cache>(octet_length(TIMESTAMP'2001-01-01 00:00:00.000000')) = 40 + rand()
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 00:00:00.000000' and <cache>(octet_length(TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 00:00:00.000000')) = 40 + rand()
DROP TABLE t1;
SET timestamp=UNIX_TIMESTAMP('2001-01-01 10:20:30');
CREATE TABLE t1 (a TIMESTAMP);;
@@ -956,13 +956,13 @@ SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIME'00:00:00';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00'
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 00:00:00'
EXPLAIN EXTENDED
SELECT * FROM t1 WHERE LENGTH(a)=40+RAND() AND a=TIME'00:00:00';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-01 00:00:00' and <cache>(octet_length(TIMESTAMP'2001-01-01 00:00:00')) = 40 + rand()
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 00:00:00' and <cache>(octet_length(TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 00:00:00')) = 40 + rand()
DROP TABLE t1;
#
# End of 10.1 tests
@@ -1347,9 +1347,545 @@ SET time_zone=DEFAULT;
# End of 10.4 tests
#
#
+# Start of 10.6 tests
+#
+#
+# MDEV-32148 Inefficient WHERE timestamp_column=datetime_expr
+#
+SET time_zone='+00:00';
+CREATE TABLE t1 (a TIMESTAMP);
+INSERT INTO t1 VALUES ('0000-00-00 00:00:00');
+INSERT INTO t1 VALUES ('2001-01-01 10:20:30'), ('2001-01-01 10:20:31');
+#
+# Comparison predicates: Bad TIMESTAMP values preserve DATETIME comparison
+#
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'1001-01-01 10:20:30';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'1001-01-01 10:20:30'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-00 00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2001-01-00 00:00:00'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'2040-01-01 10:20:30';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2040-01-01 10:20:30'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='1001-01-01 10:20:30';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'1001-01-01 10:20:30'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-00 00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Warning 1292 Incorrect datetime value: '2001-01-00 00:00:00'
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = '2001-01-00 00:00:00'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2040-01-01 10:20:30';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2040-01-01 10:20:30'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10010101102030;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 10010101102030
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=20010100000000;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 20010100000000
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=20400101102030;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 20400101102030
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10010101102030e0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 10010101102030e0
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=20010100000000e0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 20010100000000e0
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=20400101102030e0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 20400101102030e0
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10010101102030.0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 10010101102030.0
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=20010100000000.0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 20010100000000.0
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=20400101102030.0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 20400101102030.0
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=DATE_ADD('2020-01-01 10:20:30', INTERVAL 30 YEAR);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2050-01-01 10:20:30'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE COALESCE(NULL, a)=DATE_ADD('2020-01-01 10:20:30', INTERVAL 30 YEAR);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(NULL,`test`.`t1`.`a`) = <cache>('2020-01-01 10:20:30' + interval 30 year)
+#
+# Comparison predicates: Good TIMESTAMP values switch to TIMESTAMP comparison
+#
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-00 00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'0000-00-00 00:00:00'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-01 10:20:30';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='0000-00-00 00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'0000-00-00 00:00:00'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01 10:20:30';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'0000-00-00 00:00:00'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=20010101102030;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=0e0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'0000-00-00 00:00:00.000000'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=20010101102030e0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30.000000'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=0.0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'0000-00-00 00:00:00.0'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=20010101102030.0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30.0'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=DATE_ADD('2001-01-01 10:20:00', INTERVAL 30 SECOND);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE COALESCE(NULL, a)=DATE_ADD('2001-01-01 10:20:00', INTERVAL 30 SECOND);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where coalesce(NULL,`test`.`t1`.`a`) = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30'
+#
+# Corner cases: DATETIME values before the supported optimization range
+# FROM_UNIXTIME(0)..FROM_UNIXTIME(24*3600-1)
+#
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'1970-01-01 00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'1970-01-01 00:00:00'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'1970-01-01 23:59:59';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'1970-01-01 23:59:59'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'1970-01-01 23:59:59.999999';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'1970-01-01 23:59:59.999999'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'1970-01-01 23:59:59.9999999';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1292 Truncated incorrect DATETIME value: '1970-01-01 23:59:59.9999999'
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'1970-01-01 23:59:59.999999'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=FROM_UNIXTIME(24*3600-1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = <cache>(from_unixtime(24 * 3600 - 1))
+#
+# Corner cases: DATETIME values inside the supported optimization range:
+# FROM_UNIXTIME(24*3600) .. FROM_UNIXTIME(0x7FFFFFFF-24*3600)
+#
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=FROM_UNIXTIME(24*3600);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'1970-01-02 00:00:00'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'1970-01-02 00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'1970-01-02 00:00:00'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'2038-01-18 03:14:07';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2038-01-18 03:14:07'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=FROM_UNIXTIME(0x7FFFFFFF-24*3600);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2038-01-18 03:14:07'
+#
+# Corner cases: DATETIME values after the supported optimization range
+# FROM_UNIXTIME(0x7FFFFFFF-24*3600+1) .. FROM_UNIXTIME(0x7FFFFFFF)
+#
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=FROM_UNIXTIME(0x7FFFFFFF-24*3600+1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = <cache>(from_unixtime(0x7fffffff - 24 * 3600 + 1))
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'2038-01-18 03:14:08';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2038-01-18 03:14:08'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'2038-01-19 03:14:07';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2038-01-19 03:14:07'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=FROM_UNIXTIME(0x7FFFFFFF);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = <cache>(from_unixtime(0x7fffffff))
+#
+# Corner cases: rounding
+#
+SET sql_mode=TIME_ROUND_FRACTIONAL;
+#
+# Not optimized (before the supported range)
+#
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'1970-01-01 23:59:59.999999';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'1970-01-01 23:59:59.999999'
+#
+# Optimized
+#
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'1970-01-01 23:59:59.9999999';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1292 Truncated incorrect DATETIME value: '1970-01-01 23:59:59.9999999'
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'1970-01-02 00:00:00.000000'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'2038-01-18 03:14:07.999999';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2038-01-18 03:14:07.999999'
+#
+# Not optimized (after the supported range)
+#
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'2038-01-18 03:14:07.9999999';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1292 Truncated incorrect DATETIME value: '2038-01-18 03:14:07.9999999'
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP'2038-01-18 03:14:08.000000'
+SET sql_mode=DEFAULT;
+#
+# NULLIF: Bad TIMESTAMP values preserve DATETIME comparison
+#
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,TIMESTAMP'1001-01-01 10:20:30');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,TIMESTAMP'1001-01-01 10:20:30')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,TIMESTAMP'2001-01-00 00:00:00');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,TIMESTAMP'2001-01-00 00:00:00')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,TIMESTAMP'2040-01-01 10:20:30');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,TIMESTAMP'2040-01-01 10:20:30')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,'1001-01-01 10:20:30');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,'1001-01-01 10:20:30')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,'2001-01-00 00:00:00');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,'2001-01-00 00:00:00')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,'2040-01-01 10:20:30');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,'2040-01-01 10:20:30')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,10010101102030);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,10010101102030)
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,20010100000000);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,20010100000000)
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,20400101102030);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,20400101102030)
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,10010101102030e0);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,10010101102030e0)
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,20010100000000e0);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,20010100000000e0)
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,20400101102030e0);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,20400101102030e0)
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,10010101102030.0);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,10010101102030.0)
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,20010100000000.0);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,20010100000000.0)
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,20400101102030.0);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,20400101102030.0)
+#
+# NULLIF: Good TIMESTAMP values switch to TIMESTAMP comparison
+#
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,TIMESTAMP'0000-00-00 00:00:00');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,TIMESTAMP/*WITH LOCAL TIME ZONE*/'0000-00-00 00:00:00')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,TIMESTAMP'2001-01-01 10:20:30');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,'0000-00-00 00:00:00');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,TIMESTAMP/*WITH LOCAL TIME ZONE*/'0000-00-00 00:00:00')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,'2001-01-01 10:20:30');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,0);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,TIMESTAMP/*WITH LOCAL TIME ZONE*/'0000-00-00 00:00:00')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,20010101102030);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,0e0);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,TIMESTAMP/*WITH LOCAL TIME ZONE*/'0000-00-00 00:00:00.000000')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,20010101102030e0);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30.000000')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,0.0);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,TIMESTAMP/*WITH LOCAL TIME ZONE*/'0000-00-00 00:00:00.0')
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,20010101102030.0);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where nullif(`test`.`t1`.`a`,TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30.0')
+#
+# Subqueries with bad TIMESTAMP values
+# It's not clear from the output if the comparison is done as DATETIME or TIMESTAMP
+#
+CREATE TABLE t2 (a DATETIME);
+INSERT INTO t2 VALUES ('1001-01-01 10:20:30');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=(SELECT MAX(a) FROM t2);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+2 SUBQUERY t2 system NULL NULL NULL NULL 1 100.00
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = (/* select#2 */ select max('1001-01-01 10:20:30') from dual)
+DROP TABLE t2;
+CREATE TABLE t2 (a DATETIME);
+INSERT INTO t2 VALUES ('2001-00-00 00:00:00');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=(SELECT MAX(a) FROM t2);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+2 SUBQUERY t2 system NULL NULL NULL NULL 1 100.00
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = (/* select#2 */ select max('2001-00-00 00:00:00') from dual)
+DROP TABLE t2;
+CREATE TABLE t2 (a DATETIME);
+INSERT INTO t2 VALUES ('2040-01-01 10:20:30');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=(SELECT MAX(a) FROM t2);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+2 SUBQUERY t2 system NULL NULL NULL NULL 1 100.00
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = (/* select#2 */ select max('2040-01-01 10:20:30') from dual)
+DROP TABLE t2;
+#
+# Subqueries with good TIMESTAMP values
+# It's not clear from the output if the comparison is done as DATETIME or TIMESTAMP
+#
+CREATE TABLE t2 (a DATETIME);
+INSERT INTO t2 VALUES ('0000-00-00 00:00:00');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=(SELECT MAX(a) FROM t2);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+2 SUBQUERY t2 system NULL NULL NULL NULL 1 100.00
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = (/* select#2 */ select max('0000-00-00 00:00:00') from dual)
+DROP TABLE t2;
+CREATE TABLE t2 (a DATETIME);
+INSERT INTO t2 VALUES ('2001-01-01 10:20:30');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=(SELECT MAX(a) FROM t2);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+2 SUBQUERY t2 system NULL NULL NULL NULL 1 100.00
+Warnings:
+Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = (/* select#2 */ select max('2001-01-01 10:20:30') from dual)
+DROP TABLE t2;
+#
+# Trivial equality elimination
+# Covers Type_handler_timestamp_common::Item_const_eq()
+#
+EXPLAIN EXTENDED SELECT * FROM t1
+WHERE IF(a='2001-01-01 00:00:00',1,0)=IF(a='2001-01-01 00:00:00',1,0);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where if(`test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 00:00:00',1,0) = if(`test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 00:00:00',1,0)
+EXECUTE IMMEDIATE 'EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a<=>?)=(a<=>?)'
+ USING '2001-01-01 00:00:00', '2001-01-01 00:00:00';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 1
+#
+# Equal field propagation: Good TIMESTAMP values switch to TIMESTAMP comparison
+#
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIMESTAMP'2001-01-01 10:20:30';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=19 AND a='2001-01-01 10:20:30';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=20010101102030;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=20010101102030e0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30.000000'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=20010101102030.0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30.0'
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=19+RAND() AND a=TIMESTAMP'2001-01-01 10:20:30';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30' and <cache>(octet_length(TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30')) = 19 + rand()
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=19+RAND() AND a='2001-01-01 10:20:30';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30' and <cache>(octet_length(TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30')) = 19 + rand()
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=19+RAND() AND a=20010101102030;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30' and <cache>(octet_length(TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30')) = 19 + rand()
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=19+RAND() AND a=20010101102030e0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30.000000' and <cache>(octet_length(TIMESTAMP'2001-01-01 10:20:30')) = 19 + rand()
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=19+RAND() AND a=20010101102030.0;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = TIMESTAMP/*WITH LOCAL TIME ZONE*/'2001-01-01 10:20:30.0' and <cache>(octet_length(TIMESTAMP'2001-01-01 10:20:30')) = 19 + rand()
+DROP TABLE t1;
+SET time_zone=DEFAULT;
+#
+# End of 10.6 tests
+#
+#
# MDEV-29225 make explicit_defaults_for_timestamps SESSION variable
#
set explicit_defaults_for_timestamp=OFF;
+Warnings:
+Warning 1287 'explicit_defaults_for_timestamp=0' is deprecated and will be removed in a future release
create table t1 (f1 timestamp, f2 timestamp);
show create table t1;
Table Create Table
@@ -1606,3 +2142,198 @@ DROP TABLE t2;
DROP TABLE t1;
SET note_verbosity=DEFAULT;
# End of 10.6 tests
+#
+# Start of 11.3 tests
+#
+#
+# MDEV-33299 Assertion `(tm->tv_usec % (int) log_10_int[6 - dec]) == 0' failed in void my_timestamp_to_binary(const timeval*, uchar*, uint)
+#
+CREATE TABLE t1(a TIMESTAMP,KEY(a));
+SELECT * FROM t1 WHERE DATE(a) <= '2024-01-23' ;
+a
+SELECT * FROM t1 WHERE YEAR(a) <= 2024;
+a
+DROP TABLE t1;
+CREATE TABLE t1(a TIMESTAMP,KEY(a));
+INSERT INTO t1 VALUES ('2023-12-31 23:59:59');
+INSERT INTO t1 VALUES ('2024-01-22 10:20:30');
+INSERT INTO t1 VALUES ('2024-01-23 10:20:30');
+INSERT INTO t1 VALUES ('2024-01-23 23:59:59');
+INSERT INTO t1 VALUES ('2024-01-24 00:00:00');
+INSERT INTO t1 VALUES ('2024-12-31 23:59:59');
+INSERT INTO t1 VALUES ('2025-01-01 00:00:00');
+SELECT * FROM t1 WHERE DATE(a) <= '2024-01-23';
+a
+2023-12-31 23:59:59
+2024-01-22 10:20:30
+2024-01-23 10:20:30
+2024-01-23 23:59:59
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE DATE(a) <= '2024-01-23';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 range a a 5 NULL 4 100.00 Using where; Using index
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'2024-01-23 23:59:59'
+SELECT * FROM t1 WHERE YEAR(a) <= 2024;
+a
+2023-12-31 23:59:59
+2024-01-22 10:20:30
+2024-01-23 10:20:30
+2024-01-23 23:59:59
+2024-01-24 00:00:00
+2024-12-31 23:59:59
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE YEAR(a) <= 2024;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 range a a 5 NULL 6 100.00 Using where; Using index
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'2024-12-31 23:59:59'
+SELECT * FROM t1 WHERE DATE(a) >= '2024-01-24';
+a
+2024-01-24 00:00:00
+2024-12-31 23:59:59
+2025-01-01 00:00:00
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE DATE(a) >= '2024-01-24';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 range a a 5 NULL 3 100.00 Using where; Using index
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` >= TIMESTAMP/*WITH LOCAL TIME ZONE*/'2024-01-24 00:00:00'
+SELECT * FROM t1 WHERE YEAR(a) >= 2024;
+a
+2024-01-22 10:20:30
+2024-01-23 10:20:30
+2024-01-23 23:59:59
+2024-01-24 00:00:00
+2024-12-31 23:59:59
+2025-01-01 00:00:00
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE YEAR(a) >= 2024;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 range a a 5 NULL 6 100.00 Using where; Using index
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` >= TIMESTAMP/*WITH LOCAL TIME ZONE*/'2024-01-01 00:00:00'
+DROP TABLE t1;
+CREATE TABLE t1(a TIMESTAMP(3),KEY(a));
+INSERT INTO t1 VALUES ('2023-12-31 23:59:59.999');
+INSERT INTO t1 VALUES ('2024-01-22 10:20:30.001');
+INSERT INTO t1 VALUES ('2024-01-23 10:20:30.002');
+INSERT INTO t1 VALUES ('2024-01-23 23:59:59.999');
+INSERT INTO t1 VALUES ('2024-01-24 00:00:00.000');
+INSERT INTO t1 VALUES ('2024-12-31 23:59:59.999');
+INSERT INTO t1 VALUES ('2025-01-01 00:00:00.000');
+SELECT * FROM t1 WHERE DATE(a) <= '2024-01-23';
+a
+2023-12-31 23:59:59.999
+2024-01-22 10:20:30.001
+2024-01-23 10:20:30.002
+2024-01-23 23:59:59.999
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE DATE(a) <= '2024-01-23';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 range a a 7 NULL 4 100.00 Using where; Using index
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'2024-01-23 23:59:59.999'
+SELECT * FROM t1 WHERE YEAR(a) <= 2024;
+a
+2023-12-31 23:59:59.999
+2024-01-22 10:20:30.001
+2024-01-23 10:20:30.002
+2024-01-23 23:59:59.999
+2024-01-24 00:00:00.000
+2024-12-31 23:59:59.999
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE YEAR(a) <= 2024;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 range a a 7 NULL 6 100.00 Using where; Using index
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'2024-12-31 23:59:59.999'
+SELECT * FROM t1 WHERE DATE(a) >= '2024-01-24';
+a
+2024-01-24 00:00:00.000
+2024-12-31 23:59:59.999
+2025-01-01 00:00:00.000
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE DATE(a) >= '2024-01-24';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 range a a 7 NULL 3 100.00 Using where; Using index
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` >= TIMESTAMP/*WITH LOCAL TIME ZONE*/'2024-01-24 00:00:00.000'
+SELECT * FROM t1 WHERE YEAR(a) >= 2024;
+a
+2024-01-22 10:20:30.001
+2024-01-23 10:20:30.002
+2024-01-23 23:59:59.999
+2024-01-24 00:00:00.000
+2024-12-31 23:59:59.999
+2025-01-01 00:00:00.000
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE YEAR(a) >= 2024;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 range a a 7 NULL 6 100.00 Using where; Using index
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` >= TIMESTAMP/*WITH LOCAL TIME ZONE*/'2024-01-01 00:00:00.000'
+DROP TABLE t1;
+CREATE TABLE t1(a TIMESTAMP(6),KEY(a));
+INSERT INTO t1 VALUES ('2023-12-31 23:59:59.999999');
+INSERT INTO t1 VALUES ('2024-01-22 10:20:30.000001');
+INSERT INTO t1 VALUES ('2024-01-23 10:20:30.000002');
+INSERT INTO t1 VALUES ('2024-01-23 23:59:59.999999');
+INSERT INTO t1 VALUES ('2024-01-24 00:00:00.000000');
+INSERT INTO t1 VALUES ('2024-12-31 23:59:59.999999');
+INSERT INTO t1 VALUES ('2025-01-01 00:00:00.000000');
+SELECT * FROM t1 WHERE DATE(a) <= '2024-01-23';
+a
+2023-12-31 23:59:59.999999
+2024-01-22 10:20:30.000001
+2024-01-23 10:20:30.000002
+2024-01-23 23:59:59.999999
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE DATE(a) <= '2024-01-23';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 range a a 8 NULL 4 100.00 Using where; Using index
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'2024-01-23 23:59:59.999999'
+SELECT * FROM t1 WHERE YEAR(a) <= 2024;
+a
+2023-12-31 23:59:59.999999
+2024-01-22 10:20:30.000001
+2024-01-23 10:20:30.000002
+2024-01-23 23:59:59.999999
+2024-01-24 00:00:00.000000
+2024-12-31 23:59:59.999999
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE YEAR(a) <= 2024;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 range a a 8 NULL 6 100.00 Using where; Using index
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'2024-12-31 23:59:59.999999'
+SELECT * FROM t1 WHERE DATE(a) >= '2024-01-24';
+a
+2024-01-24 00:00:00.000000
+2024-12-31 23:59:59.999999
+2025-01-01 00:00:00.000000
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE DATE(a) >= '2024-01-24';
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 range a a 8 NULL 3 100.00 Using where; Using index
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` >= TIMESTAMP/*WITH LOCAL TIME ZONE*/'2024-01-24 00:00:00.000000'
+SELECT * FROM t1 WHERE YEAR(a) >= 2024;
+a
+2024-01-22 10:20:30.000001
+2024-01-23 10:20:30.000002
+2024-01-23 23:59:59.999999
+2024-01-24 00:00:00.000000
+2024-12-31 23:59:59.999999
+2025-01-01 00:00:00.000000
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE YEAR(a) >= 2024;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 range a a 8 NULL 6 100.00 Using where; Using index
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` >= TIMESTAMP/*WITH LOCAL TIME ZONE*/'2024-01-01 00:00:00.000000'
+DROP TABLE t1;
+#
+# MDEV-34085 Server crash ASAN used-after-poison upon 2nd execution of PS with erroneous timestamp conversion
+#
+CREATE TABLE t1 (a int, b timestamp);
+INSERT INTO t1 VALUES (1,'2000-01-01'),(2,'2001-12-31');
+PREPARE stmt FROM 'UPDATE t1 SET a = 0 WHERE 1 IN (SELECT b FROM t1)';
+EXECUTE stmt;
+ERROR 22007: Truncated incorrect datetime value: '1'
+EXECUTE stmt;
+ERROR 22007: Truncated incorrect datetime value: '1'
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
+#
+# End of 11.3 tests
+#
diff --git a/mysql-test/main/type_timestamp.test b/mysql-test/main/type_timestamp.test
index b8568291..56f02c75 100644
--- a/mysql-test/main/type_timestamp.test
+++ b/mysql-test/main/type_timestamp.test
@@ -908,6 +908,246 @@ SET time_zone=DEFAULT;
--echo #
--echo #
+--echo # Start of 10.6 tests
+--echo #
+
+--echo #
+--echo # MDEV-32148 Inefficient WHERE timestamp_column=datetime_expr
+--echo #
+
+SET time_zone='+00:00';
+CREATE TABLE t1 (a TIMESTAMP);
+INSERT INTO t1 VALUES ('0000-00-00 00:00:00');
+INSERT INTO t1 VALUES ('2001-01-01 10:20:30'), ('2001-01-01 10:20:31');
+
+--echo #
+--echo # Comparison predicates: Bad TIMESTAMP values preserve DATETIME comparison
+--echo #
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'1001-01-01 10:20:30';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-00 00:00:00';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'2040-01-01 10:20:30';
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='1001-01-01 10:20:30';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-00 00:00:00';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2040-01-01 10:20:30';
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10010101102030;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=20010100000000;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=20400101102030;
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10010101102030e0;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=20010100000000e0;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=20400101102030e0;
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10010101102030.0;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=20010100000000.0;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=20400101102030.0;
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=DATE_ADD('2020-01-01 10:20:30', INTERVAL 30 YEAR);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE COALESCE(NULL, a)=DATE_ADD('2020-01-01 10:20:30', INTERVAL 30 YEAR);
+
+--echo #
+--echo # Comparison predicates: Good TIMESTAMP values switch to TIMESTAMP comparison
+--echo #
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'0000-00-00 00:00:00';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'2001-01-01 10:20:30';
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='0000-00-00 00:00:00';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01 10:20:30';
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=0;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=20010101102030;
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=0e0;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=20010101102030e0;
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=0.0;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=20010101102030.0;
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=DATE_ADD('2001-01-01 10:20:00', INTERVAL 30 SECOND);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE COALESCE(NULL, a)=DATE_ADD('2001-01-01 10:20:00', INTERVAL 30 SECOND);
+
+--echo #
+--echo # Corner cases: DATETIME values before the supported optimization range
+--echo # FROM_UNIXTIME(0)..FROM_UNIXTIME(24*3600-1)
+--echo #
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'1970-01-01 00:00:00';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'1970-01-01 23:59:59';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'1970-01-01 23:59:59.999999';
+
+# Truncation of the 7th flactional digit produces a NOTE only without --ps
+--disable_ps_protocol
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'1970-01-01 23:59:59.9999999';
+--enable_ps_protocol
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=FROM_UNIXTIME(24*3600-1);
+
+--echo #
+--echo # Corner cases: DATETIME values inside the supported optimization range:
+--echo # FROM_UNIXTIME(24*3600) .. FROM_UNIXTIME(0x7FFFFFFF-24*3600)
+--echo #
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=FROM_UNIXTIME(24*3600);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'1970-01-02 00:00:00';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'2038-01-18 03:14:07';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=FROM_UNIXTIME(0x7FFFFFFF-24*3600);
+
+--echo #
+--echo # Corner cases: DATETIME values after the supported optimization range
+--echo # FROM_UNIXTIME(0x7FFFFFFF-24*3600+1) .. FROM_UNIXTIME(0x7FFFFFFF)
+--echo #
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=FROM_UNIXTIME(0x7FFFFFFF-24*3600+1);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'2038-01-18 03:14:08';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'2038-01-19 03:14:07';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=FROM_UNIXTIME(0x7FFFFFFF);
+
+--echo #
+--echo # Corner cases: rounding
+--echo #
+
+SET sql_mode=TIME_ROUND_FRACTIONAL;
+
+--echo #
+--echo # Not optimized (before the supported range)
+--echo #
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'1970-01-01 23:59:59.999999';
+
+--echo #
+--echo # Optimized
+--echo #
+--disable_ps_protocol
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'1970-01-01 23:59:59.9999999';
+--enable_ps_protocol
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'2038-01-18 03:14:07.999999';
+
+--echo #
+--echo # Not optimized (after the supported range)
+--echo #
+--disable_ps_protocol
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=TIMESTAMP'2038-01-18 03:14:07.9999999';
+--enable_ps_protocol
+
+SET sql_mode=DEFAULT;
+
+--echo #
+--echo # NULLIF: Bad TIMESTAMP values preserve DATETIME comparison
+--echo #
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,TIMESTAMP'1001-01-01 10:20:30');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,TIMESTAMP'2001-01-00 00:00:00');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,TIMESTAMP'2040-01-01 10:20:30');
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,'1001-01-01 10:20:30');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,'2001-01-00 00:00:00');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,'2040-01-01 10:20:30');
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,10010101102030);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,20010100000000);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,20400101102030);
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,10010101102030e0);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,20010100000000e0);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,20400101102030e0);
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,10010101102030.0);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,20010100000000.0);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,20400101102030.0);
+
+--echo #
+--echo # NULLIF: Good TIMESTAMP values switch to TIMESTAMP comparison
+--echo #
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,TIMESTAMP'0000-00-00 00:00:00');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,TIMESTAMP'2001-01-01 10:20:30');
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,'0000-00-00 00:00:00');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,'2001-01-01 10:20:30');
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,0);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,20010101102030);
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,0e0);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,20010101102030e0);
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,0.0);
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE NULLIF(a,20010101102030.0);
+
+
+--echo #
+--echo # Subqueries with bad TIMESTAMP values
+--echo # It's not clear from the output if the comparison is done as DATETIME or TIMESTAMP
+--echo #
+
+CREATE TABLE t2 (a DATETIME);
+INSERT INTO t2 VALUES ('1001-01-01 10:20:30');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=(SELECT MAX(a) FROM t2);
+DROP TABLE t2;
+
+CREATE TABLE t2 (a DATETIME);
+INSERT INTO t2 VALUES ('2001-00-00 00:00:00');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=(SELECT MAX(a) FROM t2);
+DROP TABLE t2;
+
+CREATE TABLE t2 (a DATETIME);
+INSERT INTO t2 VALUES ('2040-01-01 10:20:30');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=(SELECT MAX(a) FROM t2);
+DROP TABLE t2;
+
+--echo #
+--echo # Subqueries with good TIMESTAMP values
+--echo # It's not clear from the output if the comparison is done as DATETIME or TIMESTAMP
+--echo #
+
+CREATE TABLE t2 (a DATETIME);
+INSERT INTO t2 VALUES ('0000-00-00 00:00:00');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=(SELECT MAX(a) FROM t2);
+DROP TABLE t2;
+
+CREATE TABLE t2 (a DATETIME);
+INSERT INTO t2 VALUES ('2001-01-01 10:20:30');
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=(SELECT MAX(a) FROM t2);
+DROP TABLE t2;
+
+--echo #
+--echo # Trivial equality elimination
+--echo # Covers Type_handler_timestamp_common::Item_const_eq()
+--echo #
+
+EXPLAIN EXTENDED SELECT * FROM t1
+WHERE IF(a='2001-01-01 00:00:00',1,0)=IF(a='2001-01-01 00:00:00',1,0);
+
+EXECUTE IMMEDIATE 'EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a<=>?)=(a<=>?)'
+ USING '2001-01-01 00:00:00', '2001-01-01 00:00:00';
+
+
+--echo #
+--echo # Equal field propagation: Good TIMESTAMP values switch to TIMESTAMP comparison
+--echo #
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=TIMESTAMP'2001-01-01 10:20:30';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=19 AND a='2001-01-01 10:20:30';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=20010101102030;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=20010101102030e0;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=19 AND a=20010101102030.0;
+
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=19+RAND() AND a=TIMESTAMP'2001-01-01 10:20:30';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=19+RAND() AND a='2001-01-01 10:20:30';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=19+RAND() AND a=20010101102030;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=19+RAND() AND a=20010101102030e0;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE LENGTH(a)=19+RAND() AND a=20010101102030.0;
+
+DROP TABLE t1;
+
+SET time_zone=DEFAULT;
+
+--echo #
+--echo # End of 10.6 tests
+--echo #
+
+--echo #
--echo # MDEV-29225 make explicit_defaults_for_timestamps SESSION variable
--echo #
@@ -1035,3 +1275,93 @@ DROP TABLE t1;
SET note_verbosity=DEFAULT;
--echo # End of 10.6 tests
+
+
+--echo #
+--echo # Start of 11.3 tests
+--echo #
+
+--echo #
+--echo # MDEV-33299 Assertion `(tm->tv_usec % (int) log_10_int[6 - dec]) == 0' failed in void my_timestamp_to_binary(const timeval*, uchar*, uint)
+--echo #
+
+CREATE TABLE t1(a TIMESTAMP,KEY(a));
+SELECT * FROM t1 WHERE DATE(a) <= '2024-01-23' ;
+SELECT * FROM t1 WHERE YEAR(a) <= 2024;
+DROP TABLE t1;
+
+CREATE TABLE t1(a TIMESTAMP,KEY(a));
+INSERT INTO t1 VALUES ('2023-12-31 23:59:59');
+INSERT INTO t1 VALUES ('2024-01-22 10:20:30');
+INSERT INTO t1 VALUES ('2024-01-23 10:20:30');
+INSERT INTO t1 VALUES ('2024-01-23 23:59:59');
+INSERT INTO t1 VALUES ('2024-01-24 00:00:00');
+INSERT INTO t1 VALUES ('2024-12-31 23:59:59');
+INSERT INTO t1 VALUES ('2025-01-01 00:00:00');
+SELECT * FROM t1 WHERE DATE(a) <= '2024-01-23';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE DATE(a) <= '2024-01-23';
+SELECT * FROM t1 WHERE YEAR(a) <= 2024;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE YEAR(a) <= 2024;
+SELECT * FROM t1 WHERE DATE(a) >= '2024-01-24';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE DATE(a) >= '2024-01-24';
+SELECT * FROM t1 WHERE YEAR(a) >= 2024;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE YEAR(a) >= 2024;
+DROP TABLE t1;
+
+
+CREATE TABLE t1(a TIMESTAMP(3),KEY(a));
+INSERT INTO t1 VALUES ('2023-12-31 23:59:59.999');
+INSERT INTO t1 VALUES ('2024-01-22 10:20:30.001');
+INSERT INTO t1 VALUES ('2024-01-23 10:20:30.002');
+INSERT INTO t1 VALUES ('2024-01-23 23:59:59.999');
+INSERT INTO t1 VALUES ('2024-01-24 00:00:00.000');
+INSERT INTO t1 VALUES ('2024-12-31 23:59:59.999');
+INSERT INTO t1 VALUES ('2025-01-01 00:00:00.000');
+SELECT * FROM t1 WHERE DATE(a) <= '2024-01-23';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE DATE(a) <= '2024-01-23';
+SELECT * FROM t1 WHERE YEAR(a) <= 2024;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE YEAR(a) <= 2024;
+SELECT * FROM t1 WHERE DATE(a) >= '2024-01-24';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE DATE(a) >= '2024-01-24';
+SELECT * FROM t1 WHERE YEAR(a) >= 2024;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE YEAR(a) >= 2024;
+DROP TABLE t1;
+
+
+CREATE TABLE t1(a TIMESTAMP(6),KEY(a));
+INSERT INTO t1 VALUES ('2023-12-31 23:59:59.999999');
+INSERT INTO t1 VALUES ('2024-01-22 10:20:30.000001');
+INSERT INTO t1 VALUES ('2024-01-23 10:20:30.000002');
+INSERT INTO t1 VALUES ('2024-01-23 23:59:59.999999');
+INSERT INTO t1 VALUES ('2024-01-24 00:00:00.000000');
+INSERT INTO t1 VALUES ('2024-12-31 23:59:59.999999');
+INSERT INTO t1 VALUES ('2025-01-01 00:00:00.000000');
+SELECT * FROM t1 WHERE DATE(a) <= '2024-01-23';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE DATE(a) <= '2024-01-23';
+SELECT * FROM t1 WHERE YEAR(a) <= 2024;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE YEAR(a) <= 2024;
+SELECT * FROM t1 WHERE DATE(a) >= '2024-01-24';
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE DATE(a) >= '2024-01-24';
+SELECT * FROM t1 WHERE YEAR(a) >= 2024;
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE YEAR(a) >= 2024;
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-34085 Server crash ASAN used-after-poison upon 2nd execution of PS with erroneous timestamp conversion
+--echo #
+
+CREATE TABLE t1 (a int, b timestamp);
+INSERT INTO t1 VALUES (1,'2000-01-01'),(2,'2001-12-31');
+PREPARE stmt FROM 'UPDATE t1 SET a = 0 WHERE 1 IN (SELECT b FROM t1)';
+--error ER_TRUNCATED_WRONG_VALUE
+EXECUTE stmt;
+--error ER_TRUNCATED_WRONG_VALUE
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
+
+
+--echo #
+--echo # End of 11.3 tests
+--echo #
diff --git a/mysql-test/main/type_uint.result b/mysql-test/main/type_uint.result
index c98a513a..b4118edc 100644
--- a/mysql-test/main/type_uint.result
+++ b/mysql-test/main/type_uint.result
@@ -68,7 +68,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index PRIMARY PRIMARY 4 NULL 2 Using where; Using index
Warnings:
Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`a` of type `int unsigned` = "`t1`.`a`" of type `date`
-Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`a` of type `int unsigned` = "'1999-01-01'" of type `date`
DROP TABLE t1,t2;
#
# End of 10.0 tests
diff --git a/mysql-test/main/type_varchar.result b/mysql-test/main/type_varchar.result
index c7bf59ba..a4b99ad9 100644
--- a/mysql-test/main/type_varchar.result
+++ b/mysql-test/main/type_varchar.result
@@ -614,7 +614,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index PRIMARY PRIMARY 22 NULL 2 Using where; Using index
Warnings:
Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of type `varchar` = "`t1`.`c1`" of type `date`
-Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of type `varchar` = "'2001-01-01'" of type `date`
SELECT t1.* FROM t1 LEFT JOIN t2 ON t1.c1=t2.c1;
c1
2001-01-01
@@ -626,7 +625,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 index PRIMARY PRIMARY 22 NULL 2 Using where; Using index
Warnings:
Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of type `varchar` = "`t1`.`c1`" of type `date`
-Note 1105 Cannot use key `PRIMARY` part[0] for lookup: `test`.`t2`.`c1` of type `varchar` = "'2001-01-01'" of type `date`
DROP TABLE IF EXISTS t1,t2;
#
# MDEV-6989 BINARY and COLLATE xxx_bin comparisions are not used for optimization in some cases
@@ -964,13 +962,13 @@ END FOR;
$$
EXPLAIN SELECT * FROM t1 WHERE i>30 ORDER BY i LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL i NULL NULL NULL 31 Using where; Using filesort
+1 SIMPLE t1 index i i 33 NULL 5 Using where
Warnings:
Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` > "30" of type `int`
Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` > "30" of type `int`
EXPLAIN SELECT * FROM t1 WHERE i>=30 ORDER BY i LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL i NULL NULL NULL 31 Using where; Using filesort
+1 SIMPLE t1 index i i 33 NULL 5 Using where
Warnings:
Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` >= "30" of type `int`
Note 1105 Cannot use key `i` part[0] for lookup: `test`.`t1`.`i` of type `char` >= "30" of type `int`
diff --git a/mysql-test/main/type_year.result b/mysql-test/main/type_year.result
index 78776fc7..ce602c14 100644
--- a/mysql-test/main/type_year.result
+++ b/mysql-test/main/type_year.result
@@ -1,6 +1,6 @@
create table t1 (y year,y2 year(2));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert into t1 values (0,0),(1999,1999),(2000,2000),(2001,2001),(70,70),(69,69);
select * from t1;
y y2
@@ -60,7 +60,7 @@ drop table t1;
#
CREATE TABLE t2(yy YEAR(2), c2 CHAR(4));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
CREATE TABLE t4(yyyy YEAR(4), c4 CHAR(4));
INSERT INTO t2 (c2) VALUES (NULL),(1970),(1999),(2000),(2001),(2069);
INSERT INTO t4 (c4) SELECT c2 FROM t2;
@@ -373,11 +373,11 @@ DROP TABLE t1;
#
CREATE TABLE t1 (c1 YEAR(2), c2 YEAR(4));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
ALTER TABLE t1 MODIFY COLUMN c2 YEAR(2);
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
DROP TABLE t1;
#
# End of 5.1 tests
@@ -385,7 +385,7 @@ DROP TABLE t1;
create function y2k() returns int deterministic return 2000;
create table t1 (a year(2), b int);
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
insert t1 values (0,2000);
select a from t1 where a=2000;
a
@@ -509,7 +509,7 @@ DROP TABLE t1;
#
create or replace table t1 (a YEAR(0));
Warnings:
-Note 1287 'YEAR(0)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(0)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -517,7 +517,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
create or replace table t1 (a YEAR(1));
Warnings:
-Note 1287 'YEAR(1)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(1)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -525,7 +525,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
create or replace table t1 (a YEAR(2));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -533,7 +533,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
create or replace table t1 (a YEAR(3));
Warnings:
-Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -547,7 +547,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
create or replace table t1 (a YEAR(5));
Warnings:
-Note 1287 'YEAR(5)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(5)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -555,7 +555,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
create or replace table t1 (a YEAR(100));
Warnings:
-Note 1287 'YEAR(100)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(100)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -588,7 +588,7 @@ Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` =
DROP TABLE t1;
CREATE TABLE t1 (a YEAR(2));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
INSERT INTO t1 VALUES (93),(94);
SELECT * FROM t1;
a
@@ -620,7 +620,7 @@ MIN(a) MAX(a)
DROP TABLE t1;
CREATE OR REPLACE TABLE t1 (a YEAR(2));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
INSERT INTO t1 VALUES (1970),(1978),(2000),(2069);
SELECT a, CAST(a AS DATE), CAST(COALESCE(a) AS DATE) FROM t1;
a CAST(a AS DATE) CAST(COALESCE(a) AS DATE)
@@ -652,10 +652,10 @@ DROP TABLE t1;
#
CREATE TABLE t1 (a YEAR(2));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
CREATE TABLE t2 AS SELECT a, ROUND(a), TRUNCATE(a,0), FLOOR(a), CEILING(a) FROM t1;
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
DESC t2;
Field Type Null Key Default Extra
a year(2) YES NULL
diff --git a/mysql-test/main/union.result b/mysql-test/main/union.result
index aab13d19..797abaf9 100644
--- a/mysql-test/main/union.result
+++ b/mysql-test/main/union.result
@@ -1541,8 +1541,6 @@ NULL
(select 2) union (select 1 into @var);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'into @var)' at line 1
(select 1) union (select 1) into @var;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
(select 2) union (select 1) into @var;
ERROR 42000: Result consisted of more than one row
CREATE TABLE t1 (a int);
@@ -1675,14 +1673,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
SELECT a FROM t1 UNION SELECT a INTO OUTFILE 'union.out.file6' FROM t1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'FROM t1' at line 1
SELECT a FROM t1 UNION SELECT a FROM t1 INTO @v ;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
SELECT a FROM t1 UNION SELECT a FROM t1 INTO OUTFILE 'union.out.file5';
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
SELECT a FROM t1 UNION SELECT a FROM t1 INTO OUTFILE 'union.out.file6';
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
SELECT a INTO @v FROM t1 UNION SELECT a FROM t1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNION SELECT a FROM t1' at line 1
SELECT a INTO OUTFILE 'union.out.file7' FROM t1 UNION SELECT a FROM t1;
@@ -2783,3 +2775,70 @@ drop table t1;
#
# End of 10.3 tests
#
+
+# check union all & union disctinct
+
+select 1 as res union select 2 union select 1 union select 2;
+res
+1
+2
+select 1 as res union distinct select 2 union distinct select 1 union distinct select 2;
+res
+1
+2
+select 1 as res union all select 2 union all select 1 union all select 2;
+res
+1
+2
+1
+2
+select truncate(seq/2,0)+1 as res from seq_1_to_6 union select 2;
+res
+1
+2
+3
+4
+select truncate(seq/2,0)+1 as res from seq_1_to_6 union distinct select 2;
+res
+1
+2
+3
+4
+select truncate(seq/2,0)+1 as res from seq_1_to_6 union all select 2;
+res
+1
+2
+2
+3
+3
+4
+2
+select 1 as res union all select 2 union distinct select 1 union all select 2;
+res
+1
+2
+2
+select 1 as res union select 2 union all select 1 union distinct select 3;
+res
+1
+2
+3
+select 1 as res union select 2 union all select 1 union distinct select 3 union all select 2;
+res
+1
+2
+3
+2
+select 1 as res union select 2 union all select 1 union distinct select 3 union all select 2 union distinct select 5;
+res
+1
+2
+3
+5
+select truncate(seq/2,0)+1 as res from seq_1_to_6 union all select 2 union all select 1 union distinct select 3 union all select 2;
+res
+1
+2
+3
+4
+2
diff --git a/mysql-test/main/union.test b/mysql-test/main/union.test
index 994f187b..f43b1b58 100644
--- a/mysql-test/main/union.test
+++ b/mysql-test/main/union.test
@@ -1,6 +1,8 @@
#
# Test of unions
#
+--source include/have_sequence.inc
+
CREATE TABLE t1 (a int not null, b char (10) not null);
insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
@@ -2028,3 +2030,21 @@ drop table t1;
--echo #
--echo # End of 10.3 tests
--echo #
+
+--echo
+--echo # check union all & union disctinct
+--echo
+
+select 1 as res union select 2 union select 1 union select 2;
+select 1 as res union distinct select 2 union distinct select 1 union distinct select 2;
+select 1 as res union all select 2 union all select 1 union all select 2;
+
+select truncate(seq/2,0)+1 as res from seq_1_to_6 union select 2;
+select truncate(seq/2,0)+1 as res from seq_1_to_6 union distinct select 2;
+select truncate(seq/2,0)+1 as res from seq_1_to_6 union all select 2;
+
+select 1 as res union all select 2 union distinct select 1 union all select 2;
+select 1 as res union select 2 union all select 1 union distinct select 3;
+select 1 as res union select 2 union all select 1 union distinct select 3 union all select 2;
+select 1 as res union select 2 union all select 1 union distinct select 3 union all select 2 union distinct select 5;
+select truncate(seq/2,0)+1 as res from seq_1_to_6 union all select 2 union all select 1 union distinct select 3 union all select 2;
diff --git a/mysql-test/main/unsafe_binlog_innodb.result b/mysql-test/main/unsafe_binlog_innodb.result
index ced29926..19956cfc 100644
--- a/mysql-test/main/unsafe_binlog_innodb.result
+++ b/mysql-test/main/unsafe_binlog_innodb.result
@@ -1,6 +1,6 @@
SET @save_timeout = @@GLOBAL.innodb_lock_wait_timeout;
SET GLOBAL innodb_lock_wait_timeout = 1;
-SET @save_isolation = @@GLOBAL.tx_isolation;
+SET @save_isolation = @@GLOBAL.transaction_isolation;
SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
create table t1 (id int not null, f_id int not null, f int not null,
@@ -192,4 +192,4 @@ disconnect i;
disconnect j;
drop table t1, t2, t3, t5, t6, t8, t9;
SET GLOBAL innodb_lock_wait_timeout = @save_timeout;
-SET GLOBAL tx_isolation = @save_isolation;
+SET GLOBAL transaction_isolation = @save_isolation;
diff --git a/mysql-test/main/unsafe_binlog_innodb.test b/mysql-test/main/unsafe_binlog_innodb.test
index abd2c58d..0f57c60c 100644
--- a/mysql-test/main/unsafe_binlog_innodb.test
+++ b/mysql-test/main/unsafe_binlog_innodb.test
@@ -15,10 +15,10 @@ let $engine_type= InnoDB;
SET @save_timeout = @@GLOBAL.innodb_lock_wait_timeout;
SET GLOBAL innodb_lock_wait_timeout = 1;
-SET @save_isolation = @@GLOBAL.tx_isolation;
+SET @save_isolation = @@GLOBAL.transaction_isolation;
SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
--source include/unsafe_binlog.inc
SET GLOBAL innodb_lock_wait_timeout = @save_timeout;
-SET GLOBAL tx_isolation = @save_isolation;
+SET GLOBAL transaction_isolation = @save_isolation;
diff --git a/mysql-test/main/update.result b/mysql-test/main/update.result
index b9b80fb4..8dda69e4 100644
--- a/mysql-test/main/update.result
+++ b/mysql-test/main/update.result
@@ -399,7 +399,7 @@ update t1 set `*f2`=1;
drop table t1;
create table t1(f1 int);
update t1 set f2=1 order by f2;
-ERROR 42S22: Unknown column 'f2' in 'order clause'
+ERROR 42S22: Unknown column 'f2' in 'field list'
drop table t1;
CREATE TABLE t1 (
request_id int unsigned NOT NULL auto_increment,
@@ -763,3 +763,41 @@ ccc yyy
u xxb
drop table t1;
# End of MariaDB 10.4 tests
+#
+# MDEV-29189: Second execution of SF using UPDATE?DELETE
+# after reported error by the first execution
+#
+CREATE TABLE t1 (c int);
+CREATE FUNCTION f1() RETURNS int
+BEGIN
+UPDATE t1 SET c=c+1;
+RETURN 1;
+END;//
+CREATE FUNCTION f2() RETURNS int
+BEGIN
+DELETE FROM t1 WHERE c < 7;
+RETURN 1;
+END;//
+INSERT INTO t1 VALUES (3), (7), (1);
+SELECT * FROM t1 WHERE f1() = 1;
+ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger
+SELECT f1();
+f1()
+1
+SELECT * FROM t1;
+c
+4
+8
+2
+SELECT * FROM t1 WHERE f2() = 1;
+ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger
+SELECT f2();
+f2()
+1
+SELECT * FROM t1;
+c
+8
+DROP FUNCTION f1;
+DROP FUNCTION f2;
+DROP TABLE t1;
+# End of MariaDB 10.10 tests
diff --git a/mysql-test/main/update.test b/mysql-test/main/update.test
index 0dbc3c33..f24bf9b1 100644
--- a/mysql-test/main/update.test
+++ b/mysql-test/main/update.test
@@ -703,3 +703,43 @@ select * from t1;
drop table t1;
--echo # End of MariaDB 10.4 tests
+
+--echo #
+--echo # MDEV-29189: Second execution of SF using UPDATE?DELETE
+--echo # after reported error by the first execution
+--echo #
+--disable_ps2_protocol # because SELECT with side effects
+
+CREATE TABLE t1 (c int);
+
+DELIMITER //;
+CREATE FUNCTION f1() RETURNS int
+BEGIN
+ UPDATE t1 SET c=c+1;
+ RETURN 1;
+END;//
+CREATE FUNCTION f2() RETURNS int
+BEGIN
+ DELETE FROM t1 WHERE c < 7;
+ RETURN 1;
+END;//
+DELIMITER ;//
+
+INSERT INTO t1 VALUES (3), (7), (1);
+
+--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
+SELECT * FROM t1 WHERE f1() = 1;
+SELECT f1();
+SELECT * FROM t1;
+
+--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
+SELECT * FROM t1 WHERE f2() = 1;
+SELECT f2();
+SELECT * FROM t1;
+
+DROP FUNCTION f1;
+DROP FUNCTION f2;
+DROP TABLE t1;
+--enable_ps2_protocol
+
+--echo # End of MariaDB 10.10 tests
diff --git a/mysql-test/main/update_innodb.result b/mysql-test/main/update_innodb.result
index beab5483..fbcbf78d 100644
--- a/mysql-test/main/update_innodb.result
+++ b/mysql-test/main/update_innodb.result
@@ -143,3 +143,111 @@ connection default;
disconnect con2;
drop table t1,t2;
# End of 10.4 tests
+#
+# MDEV-33533: multi-delete using rowid filter
+#
+set @save_default_storage_engine=@@default_storage_engine;
+set default_storage_engine=InnoDB;
+CREATE DATABASE dbt3_s001;
+use dbt3_s001;
+create index i_n_name on nation(n_name);
+analyze table
+nation, lineitem, customer, orders, part, supplier, partsupp, region
+persistent for all;
+Table Op Msg_type Msg_text
+dbt3_s001.nation analyze status Engine-independent statistics collected
+dbt3_s001.nation analyze status OK
+dbt3_s001.lineitem analyze status Engine-independent statistics collected
+dbt3_s001.lineitem analyze status OK
+dbt3_s001.customer analyze status Engine-independent statistics collected
+dbt3_s001.customer analyze status OK
+dbt3_s001.orders analyze status Engine-independent statistics collected
+dbt3_s001.orders analyze status OK
+dbt3_s001.part analyze status Engine-independent statistics collected
+dbt3_s001.part analyze status OK
+dbt3_s001.supplier analyze status Engine-independent statistics collected
+dbt3_s001.supplier analyze status OK
+dbt3_s001.partsupp analyze status Engine-independent statistics collected
+dbt3_s001.partsupp analyze status OK
+dbt3_s001.region analyze status Engine-independent statistics collected
+dbt3_s001.region analyze status OK
+explain
+update orders, customer, nation set orders.o_comment = "+++" where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey = c_custkey and c_nationkey = n_nationkey and n_name='PERU';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using where; Using index
+1 SIMPLE customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6 Using index
+1 SIMPLE orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (8%) Using where; Using rowid filter
+explain format=json
+update orders, customer, nation set orders.o_comment = "+++" where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey = c_custkey and c_nationkey = n_nationkey and n_name='PERU';
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": "COST_REPLACED",
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "nation",
+ "access_type": "ref",
+ "possible_keys": ["PRIMARY", "i_n_name"],
+ "key": "i_n_name",
+ "key_length": "26",
+ "used_key_parts": ["n_name"],
+ "ref": ["const"],
+ "loops": 1,
+ "rows": 1,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "attached_condition": "nation.n_name = 'PERU'",
+ "using_index": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "customer",
+ "access_type": "ref",
+ "possible_keys": ["PRIMARY", "i_c_nationkey"],
+ "key": "i_c_nationkey",
+ "key_length": "5",
+ "used_key_parts": ["c_nationkey"],
+ "ref": ["dbt3_s001.nation.n_nationkey"],
+ "loops": 1,
+ "rows": 6,
+ "cost": "COST_REPLACED",
+ "filtered": 100,
+ "using_index": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "ref",
+ "possible_keys": ["i_o_orderdate", "i_o_custkey"],
+ "key": "i_o_custkey",
+ "key_length": "5",
+ "used_key_parts": ["o_custkey"],
+ "ref": ["dbt3_s001.customer.c_custkey"],
+ "rowid_filter": {
+ "range": {
+ "key": "i_o_orderdate",
+ "used_key_parts": ["o_orderDATE"]
+ },
+ "rows": 119,
+ "selectivity_pct": 7.933333333
+ },
+ "loops": 6,
+ "rows": 15,
+ "cost": "COST_REPLACED",
+ "filtered": 7.933333397,
+ "attached_condition": "orders.o_orderDATE between '1992-01-01' and '1992-06-30'"
+ }
+ }
+ ]
+ }
+}
+update orders, customer, nation set orders.o_comment = "+++" where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey = c_custkey and c_nationkey = n_nationkey and n_name='PERU';
+DROP DATABASE dbt3_s001;
+set default_storage_engine=@save_default_storage_engine;
diff --git a/mysql-test/main/update_innodb.test b/mysql-test/main/update_innodb.test
index c213ba8b..ad728fb8 100644
--- a/mysql-test/main/update_innodb.test
+++ b/mysql-test/main/update_innodb.test
@@ -162,3 +162,50 @@ drop table t1,t2;
--enable_view_protocol
--echo # End of 10.4 tests
+
+--echo #
+--echo # MDEV-33533: multi-delete using rowid filter
+--echo #
+
+set @save_default_storage_engine=@@default_storage_engine;
+set default_storage_engine=InnoDB;
+
+CREATE DATABASE dbt3_s001;
+
+use dbt3_s001;
+
+--disable_query_log
+--disable_result_log
+--disable_warnings
+--source include/dbt3_s001.inc
+--enable_warnings
+--enable_result_log
+--enable_query_log
+
+create index i_n_name on nation(n_name);
+analyze table
+ nation, lineitem, customer, orders, part, supplier, partsupp, region
+persistent for all;
+
+let $c1=
+ o_orderDATE between '1992-01-01' and '1992-06-30' and
+ o_custkey = c_custkey and
+ c_nationkey = n_nationkey and
+ n_name='PERU';
+
+
+explain
+update orders, customer, nation set orders.o_comment = "+++" where o_orderDATE between '1992-01-01' and '1992-06-30' and
+ o_custkey = c_custkey and c_nationkey = n_nationkey and n_name='PERU';
+--source include/explain-no-costs.inc
+explain format=json
+update orders, customer, nation set orders.o_comment = "+++" where o_orderDATE between '1992-01-01' and '1992-06-30' and
+ o_custkey = c_custkey and c_nationkey = n_nationkey and n_name='PERU';
+
+update orders, customer, nation set orders.o_comment = "+++" where o_orderDATE between '1992-01-01' and '1992-06-30' and
+ o_custkey = c_custkey and c_nationkey = n_nationkey and n_name='PERU';
+
+DROP DATABASE dbt3_s001;
+
+set default_storage_engine=@save_default_storage_engine;
+
diff --git a/mysql-test/main/update_single_to_multi.result b/mysql-test/main/update_single_to_multi.result
new file mode 100644
index 00000000..67923783
--- /dev/null
+++ b/mysql-test/main/update_single_to_multi.result
@@ -0,0 +1,3860 @@
+DROP DATABASE IF EXISTS dbt3_s001;
+CREATE DATABASE dbt3_s001;
+use dbt3_s001;
+create index i_n_name on nation(n_name);
+analyze table
+nation, lineitem, customer, orders, part, supplier, partsupp, region
+persistent for all;
+Table Op Msg_type Msg_text
+dbt3_s001.nation analyze status Engine-independent statistics collected
+dbt3_s001.nation analyze status OK
+dbt3_s001.lineitem analyze status Engine-independent statistics collected
+dbt3_s001.lineitem analyze status OK
+dbt3_s001.customer analyze status Engine-independent statistics collected
+dbt3_s001.customer analyze status OK
+dbt3_s001.orders analyze status Engine-independent statistics collected
+dbt3_s001.orders analyze status OK
+dbt3_s001.part analyze status Engine-independent statistics collected
+dbt3_s001.part analyze status OK
+dbt3_s001.supplier analyze status Engine-independent statistics collected
+dbt3_s001.supplier analyze status OK
+dbt3_s001.partsupp analyze status Engine-independent statistics collected
+dbt3_s001.partsupp analyze status OK
+dbt3_s001.region analyze status Engine-independent statistics collected
+dbt3_s001.region analyze status OK
+# Pullout
+# =======
+explain
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6
+1 PRIMARY orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (7%) Using where; Using rowid filter
+explain format=json
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.052271677,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "nation",
+ "access_type": "ref",
+ "possible_keys": ["PRIMARY", "i_n_name"],
+ "key": "i_n_name",
+ "key_length": "26",
+ "used_key_parts": ["n_name"],
+ "ref": ["const"],
+ "loops": 1,
+ "rows": 1,
+ "cost": 0.002024411,
+ "filtered": 100,
+ "index_condition": "nation.n_name = 'PERU'"
+ }
+ },
+ {
+ "table": {
+ "table_name": "customer",
+ "access_type": "ref",
+ "possible_keys": ["PRIMARY", "i_c_nationkey"],
+ "key": "i_c_nationkey",
+ "key_length": "5",
+ "used_key_parts": ["c_nationkey"],
+ "ref": ["dbt3_s001.nation.n_nationkey"],
+ "loops": 1,
+ "rows": 6,
+ "cost": 0.008193756,
+ "filtered": 100
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "ref",
+ "possible_keys": ["i_o_orderdate", "i_o_custkey"],
+ "key": "i_o_custkey",
+ "key_length": "5",
+ "used_key_parts": ["o_custkey"],
+ "ref": ["dbt3_s001.customer.c_custkey"],
+ "rowid_filter": {
+ "range": {
+ "key": "i_o_orderdate",
+ "used_key_parts": ["o_orderDATE"]
+ },
+ "rows": 108,
+ "selectivity_pct": 7.2
+ },
+ "loops": 6,
+ "rows": 15,
+ "cost": 0.04205351,
+ "filtered": 7.199999809,
+ "attached_condition": "orders.o_orderDATE between '1992-01-01' and '1992-06-30'"
+ }
+ }
+ ]
+ }
+}
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+644 201268.06
+2880 145761.99
+3142 16030.15
+5382 138423.03
+5095 184583.99
+737 12984.85
+1729 12137.76
+5121 150334.57
+explain
+update orders set o_totalprice = o_totalprice-50 where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6
+1 PRIMARY orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (7%) Using where; Using rowid filter
+explain format=json
+update orders set o_totalprice = o_totalprice-50 where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.052271677,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "nation",
+ "access_type": "ref",
+ "possible_keys": ["PRIMARY", "i_n_name"],
+ "key": "i_n_name",
+ "key_length": "26",
+ "used_key_parts": ["n_name"],
+ "ref": ["const"],
+ "loops": 1,
+ "rows": 1,
+ "cost": 0.002024411,
+ "filtered": 100,
+ "index_condition": "nation.n_name = 'PERU'"
+ }
+ },
+ {
+ "table": {
+ "table_name": "customer",
+ "access_type": "ref",
+ "possible_keys": ["PRIMARY", "i_c_nationkey"],
+ "key": "i_c_nationkey",
+ "key_length": "5",
+ "used_key_parts": ["c_nationkey"],
+ "ref": ["dbt3_s001.nation.n_nationkey"],
+ "loops": 1,
+ "rows": 6,
+ "cost": 0.008193756,
+ "filtered": 100
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "ref",
+ "possible_keys": ["i_o_orderdate", "i_o_custkey"],
+ "key": "i_o_custkey",
+ "key_length": "5",
+ "used_key_parts": ["o_custkey"],
+ "ref": ["dbt3_s001.customer.c_custkey"],
+ "rowid_filter": {
+ "range": {
+ "key": "i_o_orderdate",
+ "used_key_parts": ["o_orderDATE"]
+ },
+ "rows": 108,
+ "selectivity_pct": 7.2
+ },
+ "loops": 6,
+ "rows": 15,
+ "cost": 0.04205351,
+ "filtered": 7.199999809,
+ "attached_condition": "orders.o_orderDATE between '1992-01-01' and '1992-06-30'"
+ }
+ }
+ ]
+ }
+}
+update orders set o_totalprice = o_totalprice-50 where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+644 201218.06
+2880 145711.99
+3142 15980.15
+5382 138373.03
+5095 184533.99
+737 12934.85
+1729 12087.76
+5121 150284.57
+update orders set o_totalprice= o_totalprice+50 where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+644 201268.06
+2880 145761.99
+3142 16030.15
+5382 138423.03
+5095 184583.99
+737 12984.85
+1729 12137.76
+5121 150334.57
+explain
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where (ps_partkey, ps_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 910 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1
+1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where (ps_partkey, ps_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 910 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+ps_partkey ps_suppkey ps_supplycost
+1 8 357.84
+3 8 645.4
+4 1 444.37
+5 8 50.52
+6 1 642.13
+7 8 763.98
+8 1 957.34
+explain
+update partsupp set ps_supplycost = ps_supplycost+2 where (ps_partkey, ps_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 910 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1
+1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 Using where
+1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1
+update partsupp set ps_supplycost = ps_supplycost+2 where (ps_partkey, ps_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 910 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where (ps_partkey, ps_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 910 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+ps_partkey ps_suppkey ps_supplycost
+1 8 359.84
+3 8 647.4
+4 1 446.37
+5 8 52.52
+6 1 644.13
+7 8 765.98
+8 1 959.34
+update partsupp set ps_supplycost = ps_supplycost-2 where (ps_partkey, ps_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 910 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where (ps_partkey, ps_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 910 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+ps_partkey ps_suppkey ps_supplycost
+1 8 357.84
+3 8 645.4
+4 1 444.37
+5 8 50.52
+6 1 642.13
+7 8 763.98
+8 1 957.34
+explain
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where ps_partkey in (select p_partkey from part
+where p_retailprice between 901 and 910) and
+ps_suppkey in (select s_suppkey from supplier
+where s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1
+1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 Using where; Using join buffer (flat, BNL join)
+1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where ps_partkey in (select p_partkey from part
+where p_retailprice between 901 and 910) and
+ps_suppkey in (select s_suppkey from supplier
+where s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+ps_partkey ps_suppkey ps_supplycost
+1 8 357.84
+3 8 645.4
+4 1 444.37
+5 8 50.52
+6 1 642.13
+7 8 763.98
+8 1 957.34
+explain
+update partsupp set ps_supplycost = ps_supplycost+10 where ps_partkey in (select p_partkey from part
+where p_retailprice between 901 and 910) and
+ps_suppkey in (select s_suppkey from supplier
+where s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1
+1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 Using where
+1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1
+update partsupp set ps_supplycost = ps_supplycost+10 where ps_partkey in (select p_partkey from part
+where p_retailprice between 901 and 910) and
+ps_suppkey in (select s_suppkey from supplier
+where s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where ps_partkey in (select p_partkey from part
+where p_retailprice between 901 and 910) and
+ps_suppkey in (select s_suppkey from supplier
+where s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+ps_partkey ps_suppkey ps_supplycost
+1 8 367.84
+3 8 655.4
+4 1 454.37
+5 8 60.52
+6 1 652.13
+7 8 773.98
+8 1 967.34
+update partsupp set ps_supplycost = ps_supplycost-10 where ps_partkey in (select p_partkey from part
+where p_retailprice between 901 and 910) and
+ps_suppkey in (select s_suppkey from supplier
+where s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where ps_partkey in (select p_partkey from part
+where p_retailprice between 901 and 910) and
+ps_suppkey in (select s_suppkey from supplier
+where s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+ps_partkey ps_suppkey ps_supplycost
+1 8 357.84
+3 8 645.4
+4 1 444.37
+5 8 50.52
+6 1 642.13
+7 8 763.98
+8 1 957.34
+explain
+select l_orderkey, l_linenumber, l_tax from lineitem where l_orderkey in (select o_orderkey from orders
+where o_custkey in
+(select c_custkey from customer
+where c_nationkey in
+(select n_nationkey from nation
+where n_name='PERU'))
+and
+o_orderDATE between '1992-06-30' and '1992-12-31')
+and
+(l_partkey, l_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 1000 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1
+1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6
+1 PRIMARY orders ref|filter PRIMARY,i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (7%) Using where; Using rowid filter
+1 PRIMARY lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where
+1 PRIMARY part eq_ref PRIMARY PRIMARY 4 dbt3_s001.lineitem.l_partkey 1 Using where
+select l_orderkey, l_linenumber, l_tax from lineitem where l_orderkey in (select o_orderkey from orders
+where o_custkey in
+(select c_custkey from customer
+where c_nationkey in
+(select n_nationkey from nation
+where n_name='PERU'))
+and
+o_orderDATE between '1992-06-30' and '1992-12-31')
+and
+(l_partkey, l_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 1000 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+l_orderkey l_linenumber l_tax
+4996 1 0.01
+933 1 0.04
+2500 2 0.02
+2500 4 0.02
+explain
+update lineitem set l_tax = (l_tax*100+1)/100 where l_orderkey in (select o_orderkey from orders
+where o_custkey in
+(select c_custkey from customer
+where c_nationkey in
+(select n_nationkey from nation
+where n_name='PERU'))
+and
+o_orderDATE between '1992-06-30' and '1992-12-31')
+and
+(l_partkey, l_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 1000 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1
+1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6
+1 PRIMARY orders ref|filter PRIMARY,i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (7%) Using where; Using rowid filter
+1 PRIMARY lineitem ref PRIMARY,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where
+1 PRIMARY part eq_ref PRIMARY PRIMARY 4 dbt3_s001.lineitem.l_partkey 1 Using where
+update lineitem set l_tax = (l_tax*100+1)/100 where l_orderkey in (select o_orderkey from orders
+where o_custkey in
+(select c_custkey from customer
+where c_nationkey in
+(select n_nationkey from nation
+where n_name='PERU'))
+and
+o_orderDATE between '1992-06-30' and '1992-12-31')
+and
+(l_partkey, l_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 1000 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+select l_orderkey, l_linenumber, l_tax from lineitem where l_orderkey in (select o_orderkey from orders
+where o_custkey in
+(select c_custkey from customer
+where c_nationkey in
+(select n_nationkey from nation
+where n_name='PERU'))
+and
+o_orderDATE between '1992-06-30' and '1992-12-31')
+and
+(l_partkey, l_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 1000 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+l_orderkey l_linenumber l_tax
+4996 1 0.02
+933 1 0.05
+2500 2 0.03
+2500 4 0.03
+update lineitem set l_tax = (l_tax*100-1)/100 where l_orderkey in (select o_orderkey from orders
+where o_custkey in
+(select c_custkey from customer
+where c_nationkey in
+(select n_nationkey from nation
+where n_name='PERU'))
+and
+o_orderDATE between '1992-06-30' and '1992-12-31')
+and
+(l_partkey, l_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 1000 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+select l_orderkey, l_linenumber, l_tax from lineitem where l_orderkey in (select o_orderkey from orders
+where o_custkey in
+(select c_custkey from customer
+where c_nationkey in
+(select n_nationkey from nation
+where n_name='PERU'))
+and
+o_orderDATE between '1992-06-30' and '1992-12-31')
+and
+(l_partkey, l_suppkey) in
+(select p_partkey, s_suppkey from part, supplier
+where p_retailprice between 901 and 1000 and
+s_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+l_orderkey l_linenumber l_tax
+4996 1 0.01
+933 1 0.04
+2500 2 0.02
+2500 4 0.02
+# FirstMatch
+# ==========
+set optimizer_switch='materialization=off';
+explain
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ALL PRIMARY,i_n_regionkey NULL NULL NULL 25 Using where
+1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6
+1 PRIMARY orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (9%) Using where; FirstMatch(customer); Using rowid filter
+explain format=json
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.40015207,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "nation",
+ "access_type": "ALL",
+ "possible_keys": ["PRIMARY", "i_n_regionkey"],
+ "loops": 1,
+ "rows": 25,
+ "cost": 0.013945725,
+ "filtered": 40,
+ "attached_condition": "nation.n_regionkey in (1,2)"
+ }
+ },
+ {
+ "table": {
+ "table_name": "customer",
+ "access_type": "ref",
+ "possible_keys": ["PRIMARY", "i_c_nationkey"],
+ "key": "i_c_nationkey",
+ "key_length": "5",
+ "used_key_parts": ["c_nationkey"],
+ "ref": ["dbt3_s001.nation.n_nationkey"],
+ "loops": 10,
+ "rows": 6,
+ "cost": 0.08009436,
+ "filtered": 100
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "ref",
+ "possible_keys": ["i_o_orderdate", "i_o_custkey"],
+ "key": "i_o_custkey",
+ "key_length": "5",
+ "used_key_parts": ["o_custkey"],
+ "ref": ["dbt3_s001.customer.c_custkey"],
+ "rowid_filter": {
+ "range": {
+ "key": "i_o_orderdate",
+ "used_key_parts": ["o_orderDATE"]
+ },
+ "rows": 140,
+ "selectivity_pct": 9.333333333
+ },
+ "loops": 60,
+ "rows": 15,
+ "cost": 0.306111985,
+ "filtered": 6.666666508,
+ "attached_condition": "orders.o_orderDATE between '1992-10-09' and '1993-06-08'",
+ "first_match": "customer"
+ }
+ }
+ ]
+ }
+}
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+Customer#000000059 3458.6
+Customer#000000106 3288.42
+Customer#000000017 6.34
+Customer#000000047 274.58
+Customer#000000092 1182.91
+Customer#000000101 7470.96
+Customer#000000022 591.98
+Customer#000000040 1335.3
+Customer#000000064 -646.64
+Customer#000000122 7865.46
+Customer#000000028 1007.18
+Customer#000000037 -917.75
+Customer#000000091 4643.14
+Customer#000000115 7508.92
+Customer#000000067 8166.59
+Customer#000000094 5500.11
+Customer#000000103 2757.45
+Customer#000000130 5073.58
+Customer#000000139 7897.78
+Customer#000000142 2209.81
+Customer#000000025 7133.7
+Customer#000000008 6819.74
+Customer#000000061 1536.24
+Customer#000000077 1738.87
+Customer#000000097 2164.48
+Customer#000000121 6428.32
+Customer#000000133 2314.67
+Customer#000000007 9561.95
+Customer#000000019 8914.71
+Customer#000000082 9468.34
+Customer#000000124 1842.49
+Customer#000000127 9280.71
+explain
+update customer set c_acctbal = c_acctbal+10 where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ALL PRIMARY,i_n_regionkey NULL NULL NULL 25 Using where
+1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6
+1 PRIMARY orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (9%) Using where; FirstMatch(customer); Using rowid filter
+explain format=json
+update customer set c_acctbal = c_acctbal+10 where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.40015207,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "nation",
+ "access_type": "ALL",
+ "possible_keys": ["PRIMARY", "i_n_regionkey"],
+ "loops": 1,
+ "rows": 25,
+ "cost": 0.013945725,
+ "filtered": 40,
+ "attached_condition": "nation.n_regionkey in (1,2)"
+ }
+ },
+ {
+ "table": {
+ "table_name": "customer",
+ "access_type": "ref",
+ "possible_keys": ["PRIMARY", "i_c_nationkey"],
+ "key": "i_c_nationkey",
+ "key_length": "5",
+ "used_key_parts": ["c_nationkey"],
+ "ref": ["dbt3_s001.nation.n_nationkey"],
+ "loops": 10,
+ "rows": 6,
+ "cost": 0.08009436,
+ "filtered": 100
+ }
+ },
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "ref",
+ "possible_keys": ["i_o_orderdate", "i_o_custkey"],
+ "key": "i_o_custkey",
+ "key_length": "5",
+ "used_key_parts": ["o_custkey"],
+ "ref": ["dbt3_s001.customer.c_custkey"],
+ "rowid_filter": {
+ "range": {
+ "key": "i_o_orderdate",
+ "used_key_parts": ["o_orderDATE"]
+ },
+ "rows": 140,
+ "selectivity_pct": 9.333333333
+ },
+ "loops": 60,
+ "rows": 15,
+ "cost": 0.306111985,
+ "filtered": 6.666666508,
+ "attached_condition": "orders.o_orderDATE between '1992-10-09' and '1993-06-08'",
+ "first_match": "customer"
+ }
+ }
+ ]
+ }
+}
+update customer set c_acctbal = c_acctbal+10 where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+Customer#000000059 3468.6
+Customer#000000106 3298.42
+Customer#000000017 16.34
+Customer#000000047 284.58
+Customer#000000092 1192.91
+Customer#000000101 7480.96
+Customer#000000022 601.98
+Customer#000000040 1345.3
+Customer#000000064 -636.64
+Customer#000000122 7875.46
+Customer#000000028 1017.18
+Customer#000000037 -907.75
+Customer#000000091 4653.14
+Customer#000000115 7518.92
+Customer#000000067 8176.59
+Customer#000000094 5510.11
+Customer#000000103 2767.45
+Customer#000000130 5083.58
+Customer#000000139 7907.78
+Customer#000000142 2219.81
+Customer#000000025 7143.7
+Customer#000000008 6829.74
+Customer#000000061 1546.24
+Customer#000000077 1748.87
+Customer#000000097 2174.48
+Customer#000000121 6438.32
+Customer#000000133 2324.67
+Customer#000000007 9571.95
+Customer#000000019 8924.71
+Customer#000000082 9478.34
+Customer#000000124 1852.49
+Customer#000000127 9290.71
+update customer set c_acctbal = c_acctbal-10 where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+Customer#000000059 3458.6
+Customer#000000106 3288.42
+Customer#000000017 6.34
+Customer#000000047 274.58
+Customer#000000092 1182.91
+Customer#000000101 7470.96
+Customer#000000022 591.98
+Customer#000000040 1335.3
+Customer#000000064 -646.64
+Customer#000000122 7865.46
+Customer#000000028 1007.18
+Customer#000000037 -917.75
+Customer#000000091 4643.14
+Customer#000000115 7508.92
+Customer#000000067 8166.59
+Customer#000000094 5500.11
+Customer#000000103 2757.45
+Customer#000000130 5073.58
+Customer#000000139 7897.78
+Customer#000000142 2209.81
+Customer#000000025 7133.7
+Customer#000000008 6819.74
+Customer#000000061 1536.24
+Customer#000000077 1738.87
+Customer#000000097 2164.48
+Customer#000000121 6428.32
+Customer#000000133 2314.67
+Customer#000000007 9561.95
+Customer#000000019 8914.71
+Customer#000000082 9468.34
+Customer#000000124 1842.49
+Customer#000000127 9280.71
+set optimizer_switch='materialization=default';
+explain
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation where n_name='PERU')
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1993-01-08");
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6
+1 PRIMARY orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (14%) Using where; FirstMatch(customer); Using rowid filter
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation where n_name='PERU')
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1993-01-08");
+c_name c_acctbal
+Customer#000000008 6819.74
+Customer#000000035 1228.24
+Customer#000000061 1536.24
+Customer#000000097 2164.48
+Customer#000000121 6428.32
+Customer#000000133 2314.67
+explain
+update customer set c_acctbal = c_acctbal+20 where c_nationkey in (select n_nationkey from nation where n_name='PERU')
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1993-01-08");
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation ref PRIMARY,i_n_name i_n_name 26 const 1 Using index condition
+1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6
+1 PRIMARY orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (14%) Using where; FirstMatch(customer); Using rowid filter
+update customer set c_acctbal = c_acctbal+20 where c_nationkey in (select n_nationkey from nation where n_name='PERU')
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1993-01-08");
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation where n_name='PERU')
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1993-01-08");
+c_name c_acctbal
+Customer#000000008 6839.74
+Customer#000000035 1248.24
+Customer#000000061 1556.24
+Customer#000000097 2184.48
+Customer#000000121 6448.32
+Customer#000000133 2334.67
+update customer set c_acctbal = c_acctbal-20 where c_nationkey in (select n_nationkey from nation where n_name='PERU')
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1993-01-08");
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation where n_name='PERU')
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1993-01-08");
+c_name c_acctbal
+Customer#000000008 6819.74
+Customer#000000035 1228.24
+Customer#000000061 1536.24
+Customer#000000097 2164.48
+Customer#000000121 6428.32
+Customer#000000133 2314.67
+# Materialization
+# ===============
+set optimizer_switch='firstmatch=off';
+explain
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation where
+n_name in ('JAPAN', 'INDONESIA', 'PERU', 'ARGENTINA'))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1995-01-08");
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation range PRIMARY,i_n_name i_n_name 26 NULL 4 Using index condition
+1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6
+1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1
+3 MATERIALIZED orders ALL i_o_orderdate,i_o_custkey NULL NULL NULL 1500 Using where
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation where
+n_name in ('JAPAN', 'INDONESIA', 'PERU', 'ARGENTINA'))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1995-01-08");
+c_name c_acctbal
+Customer#000000014 5266.3
+Customer#000000059 3458.6
+Customer#000000106 3288.42
+Customer#000000067 8166.59
+Customer#000000094 5500.11
+Customer#000000103 2757.45
+Customer#000000130 5073.58
+Customer#000000139 7897.78
+Customer#000000142 2209.81
+Customer#000000025 7133.7
+Customer#000000038 6345.11
+Customer#000000098 -551.37
+Customer#000000113 2912
+Customer#000000008 6819.74
+Customer#000000035 1228.24
+Customer#000000061 1536.24
+Customer#000000077 1738.87
+Customer#000000097 2164.48
+Customer#000000121 6428.32
+Customer#000000133 2314.67
+explain
+update customer set c_acctbal = c_acctbal+20 where c_nationkey in (select n_nationkey from nation where
+n_name in ('JAPAN', 'INDONESIA', 'PERU', 'ARGENTINA'))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1995-01-08");
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY nation range PRIMARY,i_n_name i_n_name 26 NULL 4 Using index condition
+1 PRIMARY customer ref PRIMARY,i_c_nationkey i_c_nationkey 5 dbt3_s001.nation.n_nationkey 6
+1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1
+3 MATERIALIZED orders ALL i_o_orderdate,i_o_custkey NULL NULL NULL 1500 Using where
+update customer set c_acctbal = c_acctbal+20 where c_nationkey in (select n_nationkey from nation where
+n_name in ('JAPAN', 'INDONESIA', 'PERU', 'ARGENTINA'))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1995-01-08");
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation where
+n_name in ('JAPAN', 'INDONESIA', 'PERU', 'ARGENTINA'))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1995-01-08");
+c_name c_acctbal
+Customer#000000014 5286.3
+Customer#000000059 3478.6
+Customer#000000106 3308.42
+Customer#000000067 8186.59
+Customer#000000094 5520.11
+Customer#000000103 2777.45
+Customer#000000130 5093.58
+Customer#000000139 7917.78
+Customer#000000142 2229.81
+Customer#000000025 7153.7
+Customer#000000038 6365.11
+Customer#000000098 -531.37
+Customer#000000113 2932
+Customer#000000008 6839.74
+Customer#000000035 1248.24
+Customer#000000061 1556.24
+Customer#000000077 1758.87
+Customer#000000097 2184.48
+Customer#000000121 6448.32
+Customer#000000133 2334.67
+update customer set c_acctbal = c_acctbal-20 where c_nationkey in (select n_nationkey from nation where
+n_name in ('JAPAN', 'INDONESIA', 'PERU', 'ARGENTINA'))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1995-01-08");
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation where
+n_name in ('JAPAN', 'INDONESIA', 'PERU', 'ARGENTINA'))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between "1992-01-09" and "1995-01-08");
+c_name c_acctbal
+Customer#000000014 5266.3
+Customer#000000059 3458.6
+Customer#000000106 3288.42
+Customer#000000067 8166.59
+Customer#000000094 5500.11
+Customer#000000103 2757.45
+Customer#000000130 5073.58
+Customer#000000139 7897.78
+Customer#000000142 2209.81
+Customer#000000025 7133.7
+Customer#000000038 6345.11
+Customer#000000098 -551.37
+Customer#000000113 2912
+Customer#000000008 6819.74
+Customer#000000035 1228.24
+Customer#000000061 1536.24
+Customer#000000077 1738.87
+Customer#000000097 2164.48
+Customer#000000121 6428.32
+Customer#000000133 2314.67
+set optimizer_switch='firstmatch=default';
+explain
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY customer ALL PRIMARY NULL NULL NULL 150
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED orders ALL i_o_orderdate,i_o_custkey NULL NULL NULL 1500 Using where
+explain format=json
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.382051418,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "customer",
+ "access_type": "ALL",
+ "possible_keys": ["PRIMARY"],
+ "loops": 1,
+ "rows": 150,
+ "cost": 0.03493875,
+ "filtered": 100
+ }
+ },
+ {
+ "table": {
+ "table_name": "<subquery2>",
+ "access_type": "eq_ref",
+ "possible_keys": ["distinct_key"],
+ "key": "distinct_key",
+ "key_length": "4",
+ "used_key_parts": ["o_custkey"],
+ "ref": ["func"],
+ "rows": 1,
+ "filtered": 100,
+ "materialized": {
+ "unique": 1,
+ "query_block": {
+ "select_id": 2,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "ALL",
+ "possible_keys": ["i_o_orderdate", "i_o_custkey"],
+ "loops": 1,
+ "rows": 1500,
+ "cost": 0.2532975,
+ "filtered": 16.13333321,
+ "attached_condition": "orders.o_orderDATE between '1992-01-09' and '1993-03-08'"
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ ]
+ }
+}
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+Customer#000000001 711.56
+Customer#000000002 121.65
+Customer#000000005 794.47
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000010 2753.54
+Customer#000000011 -272.6
+Customer#000000013 3857.34
+Customer#000000014 5266.3
+Customer#000000016 4681.03
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000023 3332.02
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000029 7618.27
+Customer#000000031 5236.89
+Customer#000000032 3471.53
+Customer#000000034 8589.7
+Customer#000000035 1228.24
+Customer#000000037 -917.75
+Customer#000000038 6345.11
+Customer#000000040 1335.3
+Customer#000000041 270.95
+Customer#000000043 9904.28
+Customer#000000044 7315.94
+Customer#000000046 5744.59
+Customer#000000047 274.58
+Customer#000000049 4573.94
+Customer#000000052 5630.28
+Customer#000000053 4113.64
+Customer#000000055 4572.11
+Customer#000000056 6530.86
+Customer#000000058 6478.46
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000062 595.61
+Customer#000000064 -646.64
+Customer#000000065 8795.16
+Customer#000000067 8166.59
+Customer#000000070 4867.52
+Customer#000000071 -611.19
+Customer#000000073 4288.5
+Customer#000000074 2764.43
+Customer#000000076 5745.33
+Customer#000000079 5121.28
+Customer#000000080 7383.53
+Customer#000000082 9468.34
+Customer#000000083 6463.51
+Customer#000000085 3386.64
+Customer#000000086 3306.32
+Customer#000000088 8031.44
+Customer#000000089 1530.76
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000095 5327.38
+Customer#000000097 2164.48
+Customer#000000098 -551.37
+Customer#000000100 9889.89
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000104 -588.38
+Customer#000000106 3288.42
+Customer#000000107 2514.15
+Customer#000000109 -716.1
+Customer#000000110 7462.99
+Customer#000000112 2953.35
+Customer#000000115 7508.92
+Customer#000000116 8403.99
+Customer#000000118 3582.37
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000127 9280.71
+Customer#000000128 -986.96
+Customer#000000130 5073.58
+Customer#000000131 8595.53
+Customer#000000133 2314.67
+Customer#000000134 4608.9
+Customer#000000136 -842.39
+Customer#000000137 7838.3
+Customer#000000139 7897.78
+Customer#000000140 9963.15
+Customer#000000142 2209.81
+Customer#000000143 2186.5
+Customer#000000145 9748.93
+Customer#000000148 2135.6
+Customer#000000149 8959.65
+explain
+update customer set c_acctbal = c_acctbal+5 where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY customer ALL PRIMARY NULL NULL NULL 150
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED orders ALL i_o_orderdate,i_o_custkey NULL NULL NULL 1500 Using where
+explain format=json
+update customer set c_acctbal = c_acctbal+5 where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.382051418,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "customer",
+ "access_type": "ALL",
+ "possible_keys": ["PRIMARY"],
+ "loops": 1,
+ "rows": 150,
+ "cost": 0.03493875,
+ "filtered": 100
+ }
+ },
+ {
+ "table": {
+ "table_name": "<subquery2>",
+ "access_type": "eq_ref",
+ "possible_keys": ["distinct_key"],
+ "key": "distinct_key",
+ "key_length": "4",
+ "used_key_parts": ["o_custkey"],
+ "ref": ["func"],
+ "rows": 1,
+ "filtered": 100,
+ "materialized": {
+ "unique": 1,
+ "query_block": {
+ "select_id": 2,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "ALL",
+ "possible_keys": ["i_o_orderdate", "i_o_custkey"],
+ "loops": 1,
+ "rows": 1500,
+ "cost": 0.2532975,
+ "filtered": 16.13333321,
+ "attached_condition": "orders.o_orderDATE between '1992-01-09' and '1993-03-08'"
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ ]
+ }
+}
+update customer set c_acctbal = c_acctbal+5 where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+Customer#000000001 716.56
+Customer#000000002 126.65
+Customer#000000005 799.47
+Customer#000000007 9566.95
+Customer#000000008 6824.74
+Customer#000000010 2758.54
+Customer#000000011 -267.6
+Customer#000000013 3862.34
+Customer#000000014 5271.3
+Customer#000000016 4686.03
+Customer#000000017 11.34
+Customer#000000019 8919.71
+Customer#000000022 596.98
+Customer#000000023 3337.02
+Customer#000000025 7138.7
+Customer#000000028 1012.18
+Customer#000000029 7623.27
+Customer#000000031 5241.89
+Customer#000000032 3476.53
+Customer#000000034 8594.7
+Customer#000000035 1233.24
+Customer#000000037 -912.75
+Customer#000000038 6350.11
+Customer#000000040 1340.3
+Customer#000000041 275.95
+Customer#000000043 9909.28
+Customer#000000044 7320.94
+Customer#000000046 5749.59
+Customer#000000047 279.58
+Customer#000000049 4578.94
+Customer#000000052 5635.28
+Customer#000000053 4118.64
+Customer#000000055 4577.11
+Customer#000000056 6535.86
+Customer#000000058 6483.46
+Customer#000000059 3463.6
+Customer#000000061 1541.24
+Customer#000000062 600.61
+Customer#000000064 -641.64
+Customer#000000065 8800.16
+Customer#000000067 8171.59
+Customer#000000070 4872.52
+Customer#000000071 -606.19
+Customer#000000073 4293.5
+Customer#000000074 2769.43
+Customer#000000076 5750.33
+Customer#000000079 5126.28
+Customer#000000080 7388.53
+Customer#000000082 9473.34
+Customer#000000083 6468.51
+Customer#000000085 3391.64
+Customer#000000086 3311.32
+Customer#000000088 8036.44
+Customer#000000089 1535.76
+Customer#000000091 4648.14
+Customer#000000092 1187.91
+Customer#000000094 5505.11
+Customer#000000095 5332.38
+Customer#000000097 2169.48
+Customer#000000098 -546.37
+Customer#000000100 9894.89
+Customer#000000101 7475.96
+Customer#000000103 2762.45
+Customer#000000104 -583.38
+Customer#000000106 3293.42
+Customer#000000107 2519.15
+Customer#000000109 -711.1
+Customer#000000110 7467.99
+Customer#000000112 2958.35
+Customer#000000115 7513.92
+Customer#000000116 8408.99
+Customer#000000118 3587.37
+Customer#000000121 6433.32
+Customer#000000122 7870.46
+Customer#000000127 9285.71
+Customer#000000128 -981.96
+Customer#000000130 5078.58
+Customer#000000131 8600.53
+Customer#000000133 2319.67
+Customer#000000134 4613.9
+Customer#000000136 -837.39
+Customer#000000137 7843.3
+Customer#000000139 7902.78
+Customer#000000140 9968.15
+Customer#000000142 2214.81
+Customer#000000143 2191.5
+Customer#000000145 9753.93
+Customer#000000148 2140.6
+Customer#000000149 8964.65
+update customer set c_acctbal = c_acctbal-5 where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+Customer#000000001 711.56
+Customer#000000002 121.65
+Customer#000000005 794.47
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000010 2753.54
+Customer#000000011 -272.6
+Customer#000000013 3857.34
+Customer#000000014 5266.3
+Customer#000000016 4681.03
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000023 3332.02
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000029 7618.27
+Customer#000000031 5236.89
+Customer#000000032 3471.53
+Customer#000000034 8589.7
+Customer#000000035 1228.24
+Customer#000000037 -917.75
+Customer#000000038 6345.11
+Customer#000000040 1335.3
+Customer#000000041 270.95
+Customer#000000043 9904.28
+Customer#000000044 7315.94
+Customer#000000046 5744.59
+Customer#000000047 274.58
+Customer#000000049 4573.94
+Customer#000000052 5630.28
+Customer#000000053 4113.64
+Customer#000000055 4572.11
+Customer#000000056 6530.86
+Customer#000000058 6478.46
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000062 595.61
+Customer#000000064 -646.64
+Customer#000000065 8795.16
+Customer#000000067 8166.59
+Customer#000000070 4867.52
+Customer#000000071 -611.19
+Customer#000000073 4288.5
+Customer#000000074 2764.43
+Customer#000000076 5745.33
+Customer#000000079 5121.28
+Customer#000000080 7383.53
+Customer#000000082 9468.34
+Customer#000000083 6463.51
+Customer#000000085 3386.64
+Customer#000000086 3306.32
+Customer#000000088 8031.44
+Customer#000000089 1530.76
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000095 5327.38
+Customer#000000097 2164.48
+Customer#000000098 -551.37
+Customer#000000100 9889.89
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000104 -588.38
+Customer#000000106 3288.42
+Customer#000000107 2514.15
+Customer#000000109 -716.1
+Customer#000000110 7462.99
+Customer#000000112 2953.35
+Customer#000000115 7508.92
+Customer#000000116 8403.99
+Customer#000000118 3582.37
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000127 9280.71
+Customer#000000128 -986.96
+Customer#000000130 5073.58
+Customer#000000131 8595.53
+Customer#000000133 2314.67
+Customer#000000134 4608.9
+Customer#000000136 -842.39
+Customer#000000137 7838.3
+Customer#000000139 7897.78
+Customer#000000140 9963.15
+Customer#000000142 2209.81
+Customer#000000143 2186.5
+Customer#000000145 9748.93
+Customer#000000148 2135.6
+Customer#000000149 8959.65
+explain
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-06-09' and '1993-01-08');
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY customer ALL PRIMARY NULL NULL NULL 150
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED orders range i_o_orderdate,i_o_custkey i_o_orderdate 4 NULL 114 Using index condition; Using where
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-06-09' and '1993-01-08');
+c_name c_acctbal
+Customer#000000001 711.56
+Customer#000000002 121.65
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000010 2753.54
+Customer#000000011 -272.6
+Customer#000000016 4681.03
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000023 3332.02
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000029 7618.27
+Customer#000000031 5236.89
+Customer#000000034 8589.7
+Customer#000000037 -917.75
+Customer#000000040 1335.3
+Customer#000000043 9904.28
+Customer#000000044 7315.94
+Customer#000000046 5744.59
+Customer#000000047 274.58
+Customer#000000049 4573.94
+Customer#000000053 4113.64
+Customer#000000055 4572.11
+Customer#000000061 1536.24
+Customer#000000064 -646.64
+Customer#000000067 8166.59
+Customer#000000070 4867.52
+Customer#000000071 -611.19
+Customer#000000073 4288.5
+Customer#000000074 2764.43
+Customer#000000076 5745.33
+Customer#000000079 5121.28
+Customer#000000080 7383.53
+Customer#000000082 9468.34
+Customer#000000083 6463.51
+Customer#000000085 3386.64
+Customer#000000086 3306.32
+Customer#000000088 8031.44
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000095 5327.38
+Customer#000000097 2164.48
+Customer#000000100 9889.89
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000104 -588.38
+Customer#000000106 3288.42
+Customer#000000109 -716.1
+Customer#000000110 7462.99
+Customer#000000112 2953.35
+Customer#000000118 3582.37
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000127 9280.71
+Customer#000000130 5073.58
+Customer#000000131 8595.53
+Customer#000000133 2314.67
+Customer#000000134 4608.9
+Customer#000000136 -842.39
+Customer#000000137 7838.3
+Customer#000000139 7897.78
+Customer#000000142 2209.81
+Customer#000000143 2186.5
+Customer#000000148 2135.6
+Customer#000000149 8959.65
+explain
+update customer set c_acctbal = c_acctbal+1 where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-06-09' and '1993-01-08');
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY customer ALL PRIMARY NULL NULL NULL 150
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED orders range i_o_orderdate,i_o_custkey i_o_orderdate 4 NULL 114 Using index condition; Using where
+update customer set c_acctbal = c_acctbal+1 where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-06-09' and '1993-01-08');
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-06-09' and '1993-01-08');
+c_name c_acctbal
+Customer#000000001 712.56
+Customer#000000002 122.65
+Customer#000000007 9562.95
+Customer#000000008 6820.74
+Customer#000000010 2754.54
+Customer#000000011 -271.6
+Customer#000000016 4682.03
+Customer#000000017 7.34
+Customer#000000019 8915.71
+Customer#000000022 592.98
+Customer#000000023 3333.02
+Customer#000000025 7134.7
+Customer#000000028 1008.18
+Customer#000000029 7619.27
+Customer#000000031 5237.89
+Customer#000000034 8590.7
+Customer#000000037 -916.75
+Customer#000000040 1336.3
+Customer#000000043 9905.28
+Customer#000000044 7316.94
+Customer#000000046 5745.59
+Customer#000000047 275.58
+Customer#000000049 4574.94
+Customer#000000053 4114.64
+Customer#000000055 4573.11
+Customer#000000061 1537.24
+Customer#000000064 -645.64
+Customer#000000067 8167.59
+Customer#000000070 4868.52
+Customer#000000071 -610.19
+Customer#000000073 4289.5
+Customer#000000074 2765.43
+Customer#000000076 5746.33
+Customer#000000079 5122.28
+Customer#000000080 7384.53
+Customer#000000082 9469.34
+Customer#000000083 6464.51
+Customer#000000085 3387.64
+Customer#000000086 3307.32
+Customer#000000088 8032.44
+Customer#000000091 4644.14
+Customer#000000092 1183.91
+Customer#000000095 5328.38
+Customer#000000097 2165.48
+Customer#000000100 9890.89
+Customer#000000101 7471.96
+Customer#000000103 2758.45
+Customer#000000104 -587.38
+Customer#000000106 3289.42
+Customer#000000109 -715.1
+Customer#000000110 7463.99
+Customer#000000112 2954.35
+Customer#000000118 3583.37
+Customer#000000121 6429.32
+Customer#000000122 7866.46
+Customer#000000127 9281.71
+Customer#000000130 5074.58
+Customer#000000131 8596.53
+Customer#000000133 2315.67
+Customer#000000134 4609.9
+Customer#000000136 -841.39
+Customer#000000137 7839.3
+Customer#000000139 7898.78
+Customer#000000142 2210.81
+Customer#000000143 2187.5
+Customer#000000148 2136.6
+Customer#000000149 8960.65
+update customer set c_acctbal = c_acctbal-1 where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-06-09' and '1993-01-08');
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-06-09' and '1993-01-08');
+c_name c_acctbal
+Customer#000000001 711.56
+Customer#000000002 121.65
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000010 2753.54
+Customer#000000011 -272.6
+Customer#000000016 4681.03
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000023 3332.02
+Customer#000000025 7133.7
+Customer#000000028 1007.18
+Customer#000000029 7618.27
+Customer#000000031 5236.89
+Customer#000000034 8589.7
+Customer#000000037 -917.75
+Customer#000000040 1335.3
+Customer#000000043 9904.28
+Customer#000000044 7315.94
+Customer#000000046 5744.59
+Customer#000000047 274.58
+Customer#000000049 4573.94
+Customer#000000053 4113.64
+Customer#000000055 4572.11
+Customer#000000061 1536.24
+Customer#000000064 -646.64
+Customer#000000067 8166.59
+Customer#000000070 4867.52
+Customer#000000071 -611.19
+Customer#000000073 4288.5
+Customer#000000074 2764.43
+Customer#000000076 5745.33
+Customer#000000079 5121.28
+Customer#000000080 7383.53
+Customer#000000082 9468.34
+Customer#000000083 6463.51
+Customer#000000085 3386.64
+Customer#000000086 3306.32
+Customer#000000088 8031.44
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000095 5327.38
+Customer#000000097 2164.48
+Customer#000000100 9889.89
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000104 -588.38
+Customer#000000106 3288.42
+Customer#000000109 -716.1
+Customer#000000110 7462.99
+Customer#000000112 2953.35
+Customer#000000118 3582.37
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000127 9280.71
+Customer#000000130 5073.58
+Customer#000000131 8595.53
+Customer#000000133 2314.67
+Customer#000000134 4608.9
+Customer#000000136 -842.39
+Customer#000000137 7838.3
+Customer#000000139 7897.78
+Customer#000000142 2209.81
+Customer#000000143 2186.5
+Customer#000000148 2135.6
+Customer#000000149 8959.65
+# Materialization SJM
+# ===================
+explain
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 28
+1 PRIMARY customer eq_ref PRIMARY PRIMARY 4 <subquery2>.o_custkey 1
+2 MATERIALIZED orders range i_o_orderdate i_o_orderdate 4 NULL 28 Using index condition; Using temporary
+explain format=json
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.085533248,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "<subquery2>",
+ "access_type": "ALL",
+ "possible_keys": ["distinct_key"],
+ "loops": 1,
+ "rows": 28,
+ "cost": 0.03691572,
+ "filtered": 100,
+ "materialized": {
+ "unique": 1,
+ "query_block": {
+ "select_id": 2,
+ "cost": 0.053826401,
+ "having_condition": "count(orders.o_custkey) > 1",
+ "temporary_table": {
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "range",
+ "possible_keys": ["i_o_orderdate"],
+ "key": "i_o_orderdate",
+ "key_length": "4",
+ "used_key_parts": ["o_orderDATE"],
+ "loops": 1,
+ "rows": 28,
+ "cost": 0.035889016,
+ "filtered": 100,
+ "index_condition": "orders.o_orderDATE between '1992-01-09' and '1992-03-08'"
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ {
+ "table": {
+ "table_name": "customer",
+ "access_type": "eq_ref",
+ "possible_keys": ["PRIMARY"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["c_custkey"],
+ "ref": ["<subquery2>.o_custkey"],
+ "loops": 28,
+ "rows": 1,
+ "cost": 0.048617528,
+ "filtered": 100
+ }
+ }
+ ]
+ }
+}
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+Customer#000000013 3857.34
+Customer#000000032 3471.53
+Customer#000000037 -917.75
+Customer#000000118 3582.37
+Customer#000000056 6530.86
+explain
+update customer set c_acctbal = c_acctbal-5 where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 28
+1 PRIMARY customer eq_ref PRIMARY PRIMARY 4 <subquery2>.o_custkey 1
+2 MATERIALIZED orders range i_o_orderdate i_o_orderdate 4 NULL 28 Using index condition; Using temporary
+explain format=json
+update customer set c_acctbal = c_acctbal-5 where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.085533248,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "<subquery2>",
+ "access_type": "ALL",
+ "possible_keys": ["distinct_key"],
+ "loops": 1,
+ "rows": 28,
+ "cost": 0.03691572,
+ "filtered": 100,
+ "materialized": {
+ "unique": 1,
+ "query_block": {
+ "select_id": 2,
+ "cost": 0.053826401,
+ "having_condition": "count(orders.o_custkey) > 1",
+ "temporary_table": {
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "orders",
+ "access_type": "range",
+ "possible_keys": ["i_o_orderdate"],
+ "key": "i_o_orderdate",
+ "key_length": "4",
+ "used_key_parts": ["o_orderDATE"],
+ "loops": 1,
+ "rows": 28,
+ "cost": 0.035889016,
+ "filtered": 100,
+ "index_condition": "orders.o_orderDATE between '1992-01-09' and '1992-03-08'"
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
+ {
+ "table": {
+ "table_name": "customer",
+ "access_type": "eq_ref",
+ "possible_keys": ["PRIMARY"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["c_custkey"],
+ "ref": ["<subquery2>.o_custkey"],
+ "loops": 28,
+ "rows": 1,
+ "cost": 0.048617528,
+ "filtered": 100
+ }
+ }
+ ]
+ }
+}
+update customer set c_acctbal = c_acctbal-5 where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+Customer#000000013 3852.34
+Customer#000000032 3466.53
+Customer#000000037 -922.75
+Customer#000000118 3577.37
+Customer#000000056 6525.86
+update customer set c_acctbal = c_acctbal+5 where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+Customer#000000013 3857.34
+Customer#000000032 3471.53
+Customer#000000037 -917.75
+Customer#000000118 3582.37
+Customer#000000056 6530.86
+explain
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08'
+ group by o_custkey having count(o_custkey) > 5);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY customer ALL PRIMARY NULL NULL NULL 150
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 dbt3_s001.customer.c_custkey 1
+2 MATERIALIZED orders ALL i_o_orderdate NULL NULL NULL 1500 Using where; Using temporary
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08'
+ group by o_custkey having count(o_custkey) > 5);
+c_name c_acctbal
+Customer#000000007 9561.95
+Customer#000000016 4681.03
+Customer#000000037 -917.75
+Customer#000000046 5744.59
+Customer#000000091 4643.14
+Customer#000000103 2757.45
+Customer#000000118 3582.37
+Customer#000000133 2314.67
+Customer#000000134 4608.9
+explain
+update customer set c_acctbal = c_acctbal-1 where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08'
+ group by o_custkey having count(o_custkey) > 5);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY customer ALL PRIMARY NULL NULL NULL 150
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 dbt3_s001.customer.c_custkey 1
+2 MATERIALIZED orders ALL i_o_orderdate NULL NULL NULL 1500 Using where; Using temporary
+update customer set c_acctbal = c_acctbal-1 where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08'
+ group by o_custkey having count(o_custkey) > 5);
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08'
+ group by o_custkey having count(o_custkey) > 5);
+c_name c_acctbal
+Customer#000000007 9560.95
+Customer#000000016 4680.03
+Customer#000000037 -918.75
+Customer#000000046 5743.59
+Customer#000000091 4642.14
+Customer#000000103 2756.45
+Customer#000000118 3581.37
+Customer#000000133 2313.67
+Customer#000000134 4607.9
+update customer set c_acctbal = c_acctbal+1 where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08'
+ group by o_custkey having count(o_custkey) > 5);
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08'
+ group by o_custkey having count(o_custkey) > 5);
+c_name c_acctbal
+Customer#000000007 9561.95
+Customer#000000016 4681.03
+Customer#000000037 -917.75
+Customer#000000046 5744.59
+Customer#000000091 4643.14
+Customer#000000103 2757.45
+Customer#000000118 3582.37
+Customer#000000133 2314.67
+Customer#000000134 4608.9
+# Pullout PS
+# ==========
+prepare stmt from "
+update orders set o_totalprice = o_totalprice+? where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+";
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+644 201268.06
+2880 145761.99
+3142 16030.15
+5382 138423.03
+5095 184583.99
+737 12984.85
+1729 12137.76
+5121 150334.57
+set @a1=-20;
+execute stmt using @a1;
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+644 201248.06
+2880 145741.99
+3142 16010.15
+5382 138403.03
+5095 184563.99
+737 12964.85
+1729 12117.76
+5121 150314.57
+set @a2=-10;
+execute stmt using @a2;
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+644 201238.06
+2880 145731.99
+3142 16000.15
+5382 138393.03
+5095 184553.99
+737 12954.85
+1729 12107.76
+5121 150304.57
+execute stmt using -(@a1+@a2);
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+644 201268.06
+2880 145761.99
+3142 16030.15
+5382 138423.03
+5095 184583.99
+737 12984.85
+1729 12137.76
+5121 150334.57
+deallocate prepare stmt;
+# FirstMatch PS
+# =============
+set optimizer_switch='materialization=off';
+prepare stmt from "
+update customer set c_acctbal = c_acctbal+? where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+";
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+Customer#000000059 3458.6
+Customer#000000106 3288.42
+Customer#000000017 6.34
+Customer#000000047 274.58
+Customer#000000092 1182.91
+Customer#000000101 7470.96
+Customer#000000022 591.98
+Customer#000000040 1335.3
+Customer#000000064 -646.64
+Customer#000000122 7865.46
+Customer#000000028 1007.18
+Customer#000000037 -917.75
+Customer#000000091 4643.14
+Customer#000000115 7508.92
+Customer#000000067 8166.59
+Customer#000000094 5500.11
+Customer#000000103 2757.45
+Customer#000000130 5073.58
+Customer#000000139 7897.78
+Customer#000000142 2209.81
+Customer#000000025 7133.7
+Customer#000000008 6819.74
+Customer#000000061 1536.24
+Customer#000000077 1738.87
+Customer#000000097 2164.48
+Customer#000000121 6428.32
+Customer#000000133 2314.67
+Customer#000000007 9561.95
+Customer#000000019 8914.71
+Customer#000000082 9468.34
+Customer#000000124 1842.49
+Customer#000000127 9280.71
+set @a1=15;
+execute stmt using @a1;
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+Customer#000000059 3473.6
+Customer#000000106 3303.42
+Customer#000000017 21.34
+Customer#000000047 289.58
+Customer#000000092 1197.91
+Customer#000000101 7485.96
+Customer#000000022 606.98
+Customer#000000040 1350.3
+Customer#000000064 -631.64
+Customer#000000122 7880.46
+Customer#000000028 1022.18
+Customer#000000037 -902.75
+Customer#000000091 4658.14
+Customer#000000115 7523.92
+Customer#000000067 8181.59
+Customer#000000094 5515.11
+Customer#000000103 2772.45
+Customer#000000130 5088.58
+Customer#000000139 7912.78
+Customer#000000142 2224.81
+Customer#000000025 7148.7
+Customer#000000008 6834.74
+Customer#000000061 1551.24
+Customer#000000077 1753.87
+Customer#000000097 2179.48
+Customer#000000121 6443.32
+Customer#000000133 2329.67
+Customer#000000007 9576.95
+Customer#000000019 8929.71
+Customer#000000082 9483.34
+Customer#000000124 1857.49
+Customer#000000127 9295.71
+set @a2=5;
+execute stmt using @a2;
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+Customer#000000059 3478.6
+Customer#000000106 3308.42
+Customer#000000017 26.34
+Customer#000000047 294.58
+Customer#000000092 1202.91
+Customer#000000101 7490.96
+Customer#000000022 611.98
+Customer#000000040 1355.3
+Customer#000000064 -626.64
+Customer#000000122 7885.46
+Customer#000000028 1027.1799999999998
+Customer#000000037 -897.75
+Customer#000000091 4663.14
+Customer#000000115 7528.92
+Customer#000000067 8186.59
+Customer#000000094 5520.11
+Customer#000000103 2777.45
+Customer#000000130 5093.58
+Customer#000000139 7917.78
+Customer#000000142 2229.81
+Customer#000000025 7153.7
+Customer#000000008 6839.74
+Customer#000000061 1556.24
+Customer#000000077 1758.87
+Customer#000000097 2184.48
+Customer#000000121 6448.32
+Customer#000000133 2334.67
+Customer#000000007 9581.95
+Customer#000000019 8934.71
+Customer#000000082 9488.34
+Customer#000000124 1862.49
+Customer#000000127 9300.71
+execute stmt using -(@a1+@a2);
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+Customer#000000059 3458.6
+Customer#000000106 3288.42
+Customer#000000017 6.34
+Customer#000000047 274.58
+Customer#000000092 1182.91
+Customer#000000101 7470.96
+Customer#000000022 591.98
+Customer#000000040 1335.3
+Customer#000000064 -646.64
+Customer#000000122 7865.46
+Customer#000000028 1007.1799999999998
+Customer#000000037 -917.75
+Customer#000000091 4643.14
+Customer#000000115 7508.92
+Customer#000000067 8166.59
+Customer#000000094 5500.11
+Customer#000000103 2757.45
+Customer#000000130 5073.58
+Customer#000000139 7897.78
+Customer#000000142 2209.81
+Customer#000000025 7133.7
+Customer#000000008 6819.74
+Customer#000000061 1536.24
+Customer#000000077 1738.87
+Customer#000000097 2164.48
+Customer#000000121 6428.32
+Customer#000000133 2314.67
+Customer#000000007 9561.95
+Customer#000000019 8914.71
+Customer#000000082 9468.34
+Customer#000000124 1842.49
+Customer#000000127 9280.71
+deallocate prepare stmt;
+set optimizer_switch='materialization=default';
+# Materialization PS
+# ==================
+prepare stmt from "
+update customer set c_acctbal = c_acctbal+? where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+";
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+Customer#000000001 711.56
+Customer#000000002 121.65
+Customer#000000005 794.47
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000010 2753.54
+Customer#000000011 -272.6
+Customer#000000013 3857.34
+Customer#000000014 5266.3
+Customer#000000016 4681.03
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000023 3332.02
+Customer#000000025 7133.7
+Customer#000000028 1007.1799999999998
+Customer#000000029 7618.27
+Customer#000000031 5236.89
+Customer#000000032 3471.53
+Customer#000000034 8589.7
+Customer#000000035 1228.24
+Customer#000000037 -917.75
+Customer#000000038 6345.11
+Customer#000000040 1335.3
+Customer#000000041 270.95
+Customer#000000043 9904.28
+Customer#000000044 7315.94
+Customer#000000046 5744.59
+Customer#000000047 274.58
+Customer#000000049 4573.94
+Customer#000000052 5630.28
+Customer#000000053 4113.64
+Customer#000000055 4572.11
+Customer#000000056 6530.86
+Customer#000000058 6478.46
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000062 595.61
+Customer#000000064 -646.64
+Customer#000000065 8795.16
+Customer#000000067 8166.59
+Customer#000000070 4867.52
+Customer#000000071 -611.19
+Customer#000000073 4288.5
+Customer#000000074 2764.43
+Customer#000000076 5745.33
+Customer#000000079 5121.28
+Customer#000000080 7383.53
+Customer#000000082 9468.34
+Customer#000000083 6463.51
+Customer#000000085 3386.64
+Customer#000000086 3306.32
+Customer#000000088 8031.44
+Customer#000000089 1530.76
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000095 5327.38
+Customer#000000097 2164.48
+Customer#000000098 -551.37
+Customer#000000100 9889.89
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000104 -588.38
+Customer#000000106 3288.42
+Customer#000000107 2514.15
+Customer#000000109 -716.1
+Customer#000000110 7462.99
+Customer#000000112 2953.35
+Customer#000000115 7508.92
+Customer#000000116 8403.99
+Customer#000000118 3582.37
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000127 9280.71
+Customer#000000128 -986.96
+Customer#000000130 5073.58
+Customer#000000131 8595.53
+Customer#000000133 2314.67
+Customer#000000134 4608.9
+Customer#000000136 -842.39
+Customer#000000137 7838.3
+Customer#000000139 7897.78
+Customer#000000140 9963.15
+Customer#000000142 2209.81
+Customer#000000143 2186.5
+Customer#000000145 9748.93
+Customer#000000148 2135.6
+Customer#000000149 8959.65
+set @a1=7;
+execute stmt using @a1;
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+Customer#000000001 718.56
+Customer#000000002 128.65
+Customer#000000005 801.47
+Customer#000000007 9568.95
+Customer#000000008 6826.74
+Customer#000000010 2760.54
+Customer#000000011 -265.6
+Customer#000000013 3864.34
+Customer#000000014 5273.3
+Customer#000000016 4688.03
+Customer#000000017 13.34
+Customer#000000019 8921.71
+Customer#000000022 598.98
+Customer#000000023 3339.02
+Customer#000000025 7140.7
+Customer#000000028 1014.1799999999998
+Customer#000000029 7625.27
+Customer#000000031 5243.89
+Customer#000000032 3478.53
+Customer#000000034 8596.7
+Customer#000000035 1235.24
+Customer#000000037 -910.75
+Customer#000000038 6352.11
+Customer#000000040 1342.3
+Customer#000000041 277.95
+Customer#000000043 9911.28
+Customer#000000044 7322.94
+Customer#000000046 5751.59
+Customer#000000047 281.58
+Customer#000000049 4580.94
+Customer#000000052 5637.28
+Customer#000000053 4120.64
+Customer#000000055 4579.11
+Customer#000000056 6537.86
+Customer#000000058 6485.46
+Customer#000000059 3465.6
+Customer#000000061 1543.24
+Customer#000000062 602.61
+Customer#000000064 -639.64
+Customer#000000065 8802.16
+Customer#000000067 8173.59
+Customer#000000070 4874.52
+Customer#000000071 -604.19
+Customer#000000073 4295.5
+Customer#000000074 2771.43
+Customer#000000076 5752.33
+Customer#000000079 5128.28
+Customer#000000080 7390.53
+Customer#000000082 9475.34
+Customer#000000083 6470.51
+Customer#000000085 3393.64
+Customer#000000086 3313.32
+Customer#000000088 8038.44
+Customer#000000089 1537.76
+Customer#000000091 4650.14
+Customer#000000092 1189.91
+Customer#000000094 5507.11
+Customer#000000095 5334.38
+Customer#000000097 2171.48
+Customer#000000098 -544.37
+Customer#000000100 9896.89
+Customer#000000101 7477.96
+Customer#000000103 2764.45
+Customer#000000104 -581.38
+Customer#000000106 3295.42
+Customer#000000107 2521.15
+Customer#000000109 -709.1
+Customer#000000110 7469.99
+Customer#000000112 2960.35
+Customer#000000115 7515.92
+Customer#000000116 8410.99
+Customer#000000118 3589.37
+Customer#000000121 6435.32
+Customer#000000122 7872.46
+Customer#000000127 9287.71
+Customer#000000128 -979.96
+Customer#000000130 5080.58
+Customer#000000131 8602.53
+Customer#000000133 2321.67
+Customer#000000134 4615.9
+Customer#000000136 -835.39
+Customer#000000137 7845.3
+Customer#000000139 7904.78
+Customer#000000140 9970.15
+Customer#000000142 2216.81
+Customer#000000143 2193.5
+Customer#000000145 9755.93
+Customer#000000148 2142.6
+Customer#000000149 8966.65
+set @a2=3;
+execute stmt using @a2;
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+Customer#000000001 721.56
+Customer#000000002 131.65
+Customer#000000005 804.47
+Customer#000000007 9571.95
+Customer#000000008 6829.74
+Customer#000000010 2763.54
+Customer#000000011 -262.6
+Customer#000000013 3867.34
+Customer#000000014 5276.3
+Customer#000000016 4691.03
+Customer#000000017 16.34
+Customer#000000019 8924.71
+Customer#000000022 601.98
+Customer#000000023 3342.02
+Customer#000000025 7143.7
+Customer#000000028 1017.1799999999998
+Customer#000000029 7628.27
+Customer#000000031 5246.89
+Customer#000000032 3481.53
+Customer#000000034 8599.7
+Customer#000000035 1238.24
+Customer#000000037 -907.75
+Customer#000000038 6355.11
+Customer#000000040 1345.3
+Customer#000000041 280.95
+Customer#000000043 9914.28
+Customer#000000044 7325.94
+Customer#000000046 5754.59
+Customer#000000047 284.58
+Customer#000000049 4583.94
+Customer#000000052 5640.28
+Customer#000000053 4123.64
+Customer#000000055 4582.11
+Customer#000000056 6540.86
+Customer#000000058 6488.46
+Customer#000000059 3468.6
+Customer#000000061 1546.24
+Customer#000000062 605.61
+Customer#000000064 -636.64
+Customer#000000065 8805.16
+Customer#000000067 8176.59
+Customer#000000070 4877.52
+Customer#000000071 -601.19
+Customer#000000073 4298.5
+Customer#000000074 2774.43
+Customer#000000076 5755.33
+Customer#000000079 5131.28
+Customer#000000080 7393.53
+Customer#000000082 9478.34
+Customer#000000083 6473.51
+Customer#000000085 3396.64
+Customer#000000086 3316.32
+Customer#000000088 8041.44
+Customer#000000089 1540.76
+Customer#000000091 4653.14
+Customer#000000092 1192.91
+Customer#000000094 5510.11
+Customer#000000095 5337.38
+Customer#000000097 2174.48
+Customer#000000098 -541.37
+Customer#000000100 9899.89
+Customer#000000101 7480.96
+Customer#000000103 2767.45
+Customer#000000104 -578.38
+Customer#000000106 3298.42
+Customer#000000107 2524.15
+Customer#000000109 -706.1
+Customer#000000110 7472.99
+Customer#000000112 2963.35
+Customer#000000115 7518.92
+Customer#000000116 8413.99
+Customer#000000118 3592.37
+Customer#000000121 6438.32
+Customer#000000122 7875.46
+Customer#000000127 9290.71
+Customer#000000128 -976.96
+Customer#000000130 5083.58
+Customer#000000131 8605.53
+Customer#000000133 2324.67
+Customer#000000134 4618.9
+Customer#000000136 -832.39
+Customer#000000137 7848.3
+Customer#000000139 7907.78
+Customer#000000140 9973.15
+Customer#000000142 2219.81
+Customer#000000143 2196.5
+Customer#000000145 9758.93
+Customer#000000148 2145.6
+Customer#000000149 8969.65
+execute stmt using -(@a1+@a2);
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+Customer#000000001 711.56
+Customer#000000002 121.65
+Customer#000000005 794.47
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000010 2753.54
+Customer#000000011 -272.6
+Customer#000000013 3857.34
+Customer#000000014 5266.3
+Customer#000000016 4681.03
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000023 3332.02
+Customer#000000025 7133.7
+Customer#000000028 1007.1799999999998
+Customer#000000029 7618.27
+Customer#000000031 5236.89
+Customer#000000032 3471.53
+Customer#000000034 8589.7
+Customer#000000035 1228.24
+Customer#000000037 -917.75
+Customer#000000038 6345.11
+Customer#000000040 1335.3
+Customer#000000041 270.95
+Customer#000000043 9904.28
+Customer#000000044 7315.94
+Customer#000000046 5744.59
+Customer#000000047 274.58
+Customer#000000049 4573.94
+Customer#000000052 5630.28
+Customer#000000053 4113.64
+Customer#000000055 4572.11
+Customer#000000056 6530.86
+Customer#000000058 6478.46
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000062 595.61
+Customer#000000064 -646.64
+Customer#000000065 8795.16
+Customer#000000067 8166.59
+Customer#000000070 4867.52
+Customer#000000071 -611.19
+Customer#000000073 4288.5
+Customer#000000074 2764.43
+Customer#000000076 5745.33
+Customer#000000079 5121.28
+Customer#000000080 7383.53
+Customer#000000082 9468.34
+Customer#000000083 6463.51
+Customer#000000085 3386.64
+Customer#000000086 3306.32
+Customer#000000088 8031.44
+Customer#000000089 1530.76
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000095 5327.38
+Customer#000000097 2164.48
+Customer#000000098 -551.37
+Customer#000000100 9889.89
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000104 -588.38
+Customer#000000106 3288.42
+Customer#000000107 2514.15
+Customer#000000109 -716.1
+Customer#000000110 7462.99
+Customer#000000112 2953.35
+Customer#000000115 7508.92
+Customer#000000116 8403.99
+Customer#000000118 3582.37
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000127 9280.71
+Customer#000000128 -986.96
+Customer#000000130 5073.58
+Customer#000000131 8595.53
+Customer#000000133 2314.67
+Customer#000000134 4608.9
+Customer#000000136 -842.39
+Customer#000000137 7838.3
+Customer#000000139 7897.78
+Customer#000000140 9963.15
+Customer#000000142 2209.81
+Customer#000000143 2186.5
+Customer#000000145 9748.93
+Customer#000000148 2135.6
+Customer#000000149 8959.65
+deallocate prepare stmt;
+# Materialization SJM PS
+# ======================
+prepare stmt from "
+update customer set c_acctbal = c_acctbal+? where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+";
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+Customer#000000013 3857.34
+Customer#000000032 3471.53
+Customer#000000037 -917.75
+Customer#000000118 3582.37
+Customer#000000056 6530.86
+set @a1=-2;
+execute stmt using @a1;
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+Customer#000000013 3855.34
+Customer#000000032 3469.53
+Customer#000000037 -919.75
+Customer#000000118 3580.37
+Customer#000000056 6528.86
+set @a2=-1;
+execute stmt using @a2;
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+Customer#000000013 3854.34
+Customer#000000032 3468.53
+Customer#000000037 -920.75
+Customer#000000118 3579.37
+Customer#000000056 6527.86
+execute stmt using -(@a1+@a2);
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+Customer#000000013 3857.34
+Customer#000000032 3471.53
+Customer#000000037 -917.75
+Customer#000000118 3582.37
+Customer#000000056 6530.86
+deallocate prepare stmt;
+# Pullout SP
+# ==========
+create procedure p(d int)
+update orders set o_totalprice = o_totalprice+d where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+644 201268.06
+2880 145761.99
+3142 16030.15
+5382 138423.03
+5095 184583.99
+737 12984.85
+1729 12137.76
+5121 150334.57
+call p(-10);
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+644 201258.06
+2880 145751.99
+3142 16020.15
+5382 138413.03
+5095 184573.99
+737 12974.85
+1729 12127.76
+5121 150324.57
+call p(-20);
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+644 201238.06
+2880 145731.99
+3142 16000.15
+5382 138393.03
+5095 184553.99
+737 12954.85
+1729 12107.76
+5121 150304.57
+call p(10+20);
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (select n_nationkey from nation
+where n_name='PERU'));
+o_orderkey o_totalprice
+644 201268.06
+2880 145761.99
+3142 16030.15
+5382 138423.03
+5095 184583.99
+737 12984.85
+1729 12137.76
+5121 150334.57
+drop procedure p;
+# FirstMatch SP
+# =============
+set optimizer_switch='materialization=off';
+create procedure p(d int)
+update customer set c_acctbal = c_acctbal+d where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+Customer#000000059 3458.6
+Customer#000000106 3288.42
+Customer#000000017 6.34
+Customer#000000047 274.58
+Customer#000000092 1182.91
+Customer#000000101 7470.96
+Customer#000000022 591.98
+Customer#000000040 1335.3
+Customer#000000064 -646.64
+Customer#000000122 7865.46
+Customer#000000028 1007.1799999999998
+Customer#000000037 -917.75
+Customer#000000091 4643.14
+Customer#000000115 7508.92
+Customer#000000067 8166.59
+Customer#000000094 5500.11
+Customer#000000103 2757.45
+Customer#000000130 5073.58
+Customer#000000139 7897.78
+Customer#000000142 2209.81
+Customer#000000025 7133.7
+Customer#000000008 6819.74
+Customer#000000061 1536.24
+Customer#000000077 1738.87
+Customer#000000097 2164.48
+Customer#000000121 6428.32
+Customer#000000133 2314.67
+Customer#000000007 9561.95
+Customer#000000019 8914.71
+Customer#000000082 9468.34
+Customer#000000124 1842.49
+Customer#000000127 9280.71
+call p(5);
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+Customer#000000059 3463.6
+Customer#000000106 3293.42
+Customer#000000017 11.34
+Customer#000000047 279.58
+Customer#000000092 1187.91
+Customer#000000101 7475.96
+Customer#000000022 596.98
+Customer#000000040 1340.3
+Customer#000000064 -641.64
+Customer#000000122 7870.46
+Customer#000000028 1012.1799999999998
+Customer#000000037 -912.75
+Customer#000000091 4648.14
+Customer#000000115 7513.92
+Customer#000000067 8171.59
+Customer#000000094 5505.11
+Customer#000000103 2762.45
+Customer#000000130 5078.58
+Customer#000000139 7902.78
+Customer#000000142 2214.81
+Customer#000000025 7138.7
+Customer#000000008 6824.74
+Customer#000000061 1541.24
+Customer#000000077 1743.87
+Customer#000000097 2169.48
+Customer#000000121 6433.32
+Customer#000000133 2319.67
+Customer#000000007 9566.95
+Customer#000000019 8919.71
+Customer#000000082 9473.34
+Customer#000000124 1847.49
+Customer#000000127 9285.71
+call p(15);
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+Customer#000000059 3478.6
+Customer#000000106 3308.42
+Customer#000000017 26.34
+Customer#000000047 294.58
+Customer#000000092 1202.91
+Customer#000000101 7490.96
+Customer#000000022 611.98
+Customer#000000040 1355.3
+Customer#000000064 -626.64
+Customer#000000122 7885.46
+Customer#000000028 1027.1799999999998
+Customer#000000037 -897.75
+Customer#000000091 4663.14
+Customer#000000115 7528.92
+Customer#000000067 8186.59
+Customer#000000094 5520.11
+Customer#000000103 2777.45
+Customer#000000130 5093.58
+Customer#000000139 7917.78
+Customer#000000142 2229.81
+Customer#000000025 7153.7
+Customer#000000008 6839.74
+Customer#000000061 1556.24
+Customer#000000077 1758.87
+Customer#000000097 2184.48
+Customer#000000121 6448.32
+Customer#000000133 2334.67
+Customer#000000007 9581.95
+Customer#000000019 8934.71
+Customer#000000082 9488.34
+Customer#000000124 1862.49
+Customer#000000127 9300.71
+call p(-(5+15));
+select c_name, c_acctbal from customer where c_nationkey in (select n_nationkey from nation
+where n_regionkey in (1,2))
+and
+c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-10-09' and '1993-06-08');
+c_name c_acctbal
+Customer#000000059 3458.6
+Customer#000000106 3288.42
+Customer#000000017 6.34
+Customer#000000047 274.58
+Customer#000000092 1182.91
+Customer#000000101 7470.96
+Customer#000000022 591.98
+Customer#000000040 1335.3
+Customer#000000064 -646.64
+Customer#000000122 7865.46
+Customer#000000028 1007.1799999999998
+Customer#000000037 -917.75
+Customer#000000091 4643.14
+Customer#000000115 7508.92
+Customer#000000067 8166.59
+Customer#000000094 5500.11
+Customer#000000103 2757.45
+Customer#000000130 5073.58
+Customer#000000139 7897.78
+Customer#000000142 2209.81
+Customer#000000025 7133.7
+Customer#000000008 6819.74
+Customer#000000061 1536.24
+Customer#000000077 1738.87
+Customer#000000097 2164.48
+Customer#000000121 6428.32
+Customer#000000133 2314.67
+Customer#000000007 9561.95
+Customer#000000019 8914.71
+Customer#000000082 9468.34
+Customer#000000124 1842.49
+Customer#000000127 9280.71
+drop procedure p;
+set optimizer_switch='materialization=default';
+# Materialization SP
+# ==================
+create procedure p(d int)
+update customer set c_acctbal = c_acctbal+d where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+Customer#000000001 711.56
+Customer#000000002 121.65
+Customer#000000005 794.47
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000010 2753.54
+Customer#000000011 -272.6
+Customer#000000013 3857.34
+Customer#000000014 5266.3
+Customer#000000016 4681.03
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000023 3332.02
+Customer#000000025 7133.7
+Customer#000000028 1007.1799999999998
+Customer#000000029 7618.27
+Customer#000000031 5236.89
+Customer#000000032 3471.53
+Customer#000000034 8589.7
+Customer#000000035 1228.24
+Customer#000000037 -917.75
+Customer#000000038 6345.11
+Customer#000000040 1335.3
+Customer#000000041 270.95
+Customer#000000043 9904.28
+Customer#000000044 7315.94
+Customer#000000046 5744.59
+Customer#000000047 274.58
+Customer#000000049 4573.94
+Customer#000000052 5630.28
+Customer#000000053 4113.64
+Customer#000000055 4572.11
+Customer#000000056 6530.86
+Customer#000000058 6478.46
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000062 595.61
+Customer#000000064 -646.64
+Customer#000000065 8795.16
+Customer#000000067 8166.59
+Customer#000000070 4867.52
+Customer#000000071 -611.19
+Customer#000000073 4288.5
+Customer#000000074 2764.43
+Customer#000000076 5745.33
+Customer#000000079 5121.28
+Customer#000000080 7383.53
+Customer#000000082 9468.34
+Customer#000000083 6463.51
+Customer#000000085 3386.64
+Customer#000000086 3306.32
+Customer#000000088 8031.44
+Customer#000000089 1530.76
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000095 5327.38
+Customer#000000097 2164.48
+Customer#000000098 -551.37
+Customer#000000100 9889.89
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000104 -588.38
+Customer#000000106 3288.42
+Customer#000000107 2514.15
+Customer#000000109 -716.1
+Customer#000000110 7462.99
+Customer#000000112 2953.35
+Customer#000000115 7508.92
+Customer#000000116 8403.99
+Customer#000000118 3582.37
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000127 9280.71
+Customer#000000128 -986.96
+Customer#000000130 5073.58
+Customer#000000131 8595.53
+Customer#000000133 2314.67
+Customer#000000134 4608.9
+Customer#000000136 -842.39
+Customer#000000137 7838.3
+Customer#000000139 7897.78
+Customer#000000140 9963.15
+Customer#000000142 2209.81
+Customer#000000143 2186.5
+Customer#000000145 9748.93
+Customer#000000148 2135.6
+Customer#000000149 8959.65
+call p(3);
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+Customer#000000001 714.56
+Customer#000000002 124.65
+Customer#000000005 797.47
+Customer#000000007 9564.95
+Customer#000000008 6822.74
+Customer#000000010 2756.54
+Customer#000000011 -269.6
+Customer#000000013 3860.34
+Customer#000000014 5269.3
+Customer#000000016 4684.03
+Customer#000000017 9.34
+Customer#000000019 8917.71
+Customer#000000022 594.98
+Customer#000000023 3335.02
+Customer#000000025 7136.7
+Customer#000000028 1010.1799999999998
+Customer#000000029 7621.27
+Customer#000000031 5239.89
+Customer#000000032 3474.53
+Customer#000000034 8592.7
+Customer#000000035 1231.24
+Customer#000000037 -914.75
+Customer#000000038 6348.11
+Customer#000000040 1338.3
+Customer#000000041 273.95
+Customer#000000043 9907.28
+Customer#000000044 7318.94
+Customer#000000046 5747.59
+Customer#000000047 277.58
+Customer#000000049 4576.94
+Customer#000000052 5633.28
+Customer#000000053 4116.64
+Customer#000000055 4575.11
+Customer#000000056 6533.86
+Customer#000000058 6481.46
+Customer#000000059 3461.6
+Customer#000000061 1539.24
+Customer#000000062 598.61
+Customer#000000064 -643.64
+Customer#000000065 8798.16
+Customer#000000067 8169.59
+Customer#000000070 4870.52
+Customer#000000071 -608.19
+Customer#000000073 4291.5
+Customer#000000074 2767.43
+Customer#000000076 5748.33
+Customer#000000079 5124.28
+Customer#000000080 7386.53
+Customer#000000082 9471.34
+Customer#000000083 6466.51
+Customer#000000085 3389.64
+Customer#000000086 3309.32
+Customer#000000088 8034.44
+Customer#000000089 1533.76
+Customer#000000091 4646.14
+Customer#000000092 1185.91
+Customer#000000094 5503.11
+Customer#000000095 5330.38
+Customer#000000097 2167.48
+Customer#000000098 -548.37
+Customer#000000100 9892.89
+Customer#000000101 7473.96
+Customer#000000103 2760.45
+Customer#000000104 -585.38
+Customer#000000106 3291.42
+Customer#000000107 2517.15
+Customer#000000109 -713.1
+Customer#000000110 7465.99
+Customer#000000112 2956.35
+Customer#000000115 7511.92
+Customer#000000116 8406.99
+Customer#000000118 3585.37
+Customer#000000121 6431.32
+Customer#000000122 7868.46
+Customer#000000127 9283.71
+Customer#000000128 -983.96
+Customer#000000130 5076.58
+Customer#000000131 8598.53
+Customer#000000133 2317.67
+Customer#000000134 4611.9
+Customer#000000136 -839.39
+Customer#000000137 7841.3
+Customer#000000139 7900.78
+Customer#000000140 9966.15
+Customer#000000142 2212.81
+Customer#000000143 2189.5
+Customer#000000145 9751.93
+Customer#000000148 2138.6
+Customer#000000149 8962.65
+call p(7);
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+Customer#000000001 721.56
+Customer#000000002 131.65
+Customer#000000005 804.47
+Customer#000000007 9571.95
+Customer#000000008 6829.74
+Customer#000000010 2763.54
+Customer#000000011 -262.6
+Customer#000000013 3867.34
+Customer#000000014 5276.3
+Customer#000000016 4691.03
+Customer#000000017 16.34
+Customer#000000019 8924.71
+Customer#000000022 601.98
+Customer#000000023 3342.02
+Customer#000000025 7143.7
+Customer#000000028 1017.1799999999998
+Customer#000000029 7628.27
+Customer#000000031 5246.89
+Customer#000000032 3481.53
+Customer#000000034 8599.7
+Customer#000000035 1238.24
+Customer#000000037 -907.75
+Customer#000000038 6355.11
+Customer#000000040 1345.3
+Customer#000000041 280.95
+Customer#000000043 9914.28
+Customer#000000044 7325.94
+Customer#000000046 5754.59
+Customer#000000047 284.58
+Customer#000000049 4583.94
+Customer#000000052 5640.28
+Customer#000000053 4123.64
+Customer#000000055 4582.11
+Customer#000000056 6540.86
+Customer#000000058 6488.46
+Customer#000000059 3468.6
+Customer#000000061 1546.24
+Customer#000000062 605.61
+Customer#000000064 -636.64
+Customer#000000065 8805.16
+Customer#000000067 8176.59
+Customer#000000070 4877.52
+Customer#000000071 -601.19
+Customer#000000073 4298.5
+Customer#000000074 2774.43
+Customer#000000076 5755.33
+Customer#000000079 5131.28
+Customer#000000080 7393.53
+Customer#000000082 9478.34
+Customer#000000083 6473.51
+Customer#000000085 3396.64
+Customer#000000086 3316.32
+Customer#000000088 8041.44
+Customer#000000089 1540.76
+Customer#000000091 4653.14
+Customer#000000092 1192.91
+Customer#000000094 5510.11
+Customer#000000095 5337.38
+Customer#000000097 2174.48
+Customer#000000098 -541.37
+Customer#000000100 9899.89
+Customer#000000101 7480.96
+Customer#000000103 2767.45
+Customer#000000104 -578.38
+Customer#000000106 3298.42
+Customer#000000107 2524.15
+Customer#000000109 -706.1
+Customer#000000110 7472.99
+Customer#000000112 2963.35
+Customer#000000115 7518.92
+Customer#000000116 8413.99
+Customer#000000118 3592.37
+Customer#000000121 6438.32
+Customer#000000122 7875.46
+Customer#000000127 9290.71
+Customer#000000128 -976.96
+Customer#000000130 5083.58
+Customer#000000131 8605.53
+Customer#000000133 2324.67
+Customer#000000134 4618.9
+Customer#000000136 -832.39
+Customer#000000137 7848.3
+Customer#000000139 7907.78
+Customer#000000140 9973.15
+Customer#000000142 2219.81
+Customer#000000143 2196.5
+Customer#000000145 9758.93
+Customer#000000148 2145.6
+Customer#000000149 8969.65
+call p(-(3+7));
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1993-03-08');
+c_name c_acctbal
+Customer#000000001 711.56
+Customer#000000002 121.65
+Customer#000000005 794.47
+Customer#000000007 9561.95
+Customer#000000008 6819.74
+Customer#000000010 2753.54
+Customer#000000011 -272.6
+Customer#000000013 3857.34
+Customer#000000014 5266.3
+Customer#000000016 4681.03
+Customer#000000017 6.34
+Customer#000000019 8914.71
+Customer#000000022 591.98
+Customer#000000023 3332.02
+Customer#000000025 7133.7
+Customer#000000028 1007.1799999999998
+Customer#000000029 7618.27
+Customer#000000031 5236.89
+Customer#000000032 3471.53
+Customer#000000034 8589.7
+Customer#000000035 1228.24
+Customer#000000037 -917.75
+Customer#000000038 6345.11
+Customer#000000040 1335.3
+Customer#000000041 270.95
+Customer#000000043 9904.28
+Customer#000000044 7315.94
+Customer#000000046 5744.59
+Customer#000000047 274.58
+Customer#000000049 4573.94
+Customer#000000052 5630.28
+Customer#000000053 4113.64
+Customer#000000055 4572.11
+Customer#000000056 6530.86
+Customer#000000058 6478.46
+Customer#000000059 3458.6
+Customer#000000061 1536.24
+Customer#000000062 595.61
+Customer#000000064 -646.64
+Customer#000000065 8795.16
+Customer#000000067 8166.59
+Customer#000000070 4867.52
+Customer#000000071 -611.19
+Customer#000000073 4288.5
+Customer#000000074 2764.43
+Customer#000000076 5745.33
+Customer#000000079 5121.28
+Customer#000000080 7383.53
+Customer#000000082 9468.34
+Customer#000000083 6463.51
+Customer#000000085 3386.64
+Customer#000000086 3306.32
+Customer#000000088 8031.44
+Customer#000000089 1530.76
+Customer#000000091 4643.14
+Customer#000000092 1182.91
+Customer#000000094 5500.11
+Customer#000000095 5327.38
+Customer#000000097 2164.48
+Customer#000000098 -551.37
+Customer#000000100 9889.89
+Customer#000000101 7470.96
+Customer#000000103 2757.45
+Customer#000000104 -588.38
+Customer#000000106 3288.42
+Customer#000000107 2514.15
+Customer#000000109 -716.1
+Customer#000000110 7462.99
+Customer#000000112 2953.35
+Customer#000000115 7508.92
+Customer#000000116 8403.99
+Customer#000000118 3582.37
+Customer#000000121 6428.32
+Customer#000000122 7865.46
+Customer#000000127 9280.71
+Customer#000000128 -986.96
+Customer#000000130 5073.58
+Customer#000000131 8595.53
+Customer#000000133 2314.67
+Customer#000000134 4608.9
+Customer#000000136 -842.39
+Customer#000000137 7838.3
+Customer#000000139 7897.78
+Customer#000000140 9963.15
+Customer#000000142 2209.81
+Customer#000000143 2186.5
+Customer#000000145 9748.93
+Customer#000000148 2135.6
+Customer#000000149 8959.65
+drop procedure p;
+# Materialization SJM SP
+# ======================
+create procedure p(d int)
+update customer set c_acctbal = c_acctbal+d where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+Customer#000000013 3857.34
+Customer#000000032 3471.53
+Customer#000000037 -917.75
+Customer#000000118 3582.37
+Customer#000000056 6530.86
+call p(-1);
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+Customer#000000013 3856.34
+Customer#000000032 3470.53
+Customer#000000037 -918.75
+Customer#000000118 3581.37
+Customer#000000056 6529.86
+call p(-2);
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+Customer#000000013 3854.34
+Customer#000000032 3468.53
+Customer#000000037 -920.75
+Customer#000000118 3579.37
+Customer#000000056 6527.86
+call p(1+2);
+select c_name, c_acctbal from customer where c_custkey in (select o_custkey from orders
+where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+c_name c_acctbal
+Customer#000000013 3857.34
+Customer#000000032 3471.53
+Customer#000000037 -917.75
+Customer#000000118 3582.37
+Customer#000000056 6530.86
+drop procedure p;
+# Checking limitations
+# ====================
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (1,2));
+o_orderkey o_totalprice
+1221 117397.16
+324 26868.85
+1856 189361.42
+1344 43809.37
+1925 146382.71
+3139 40975.96
+4903 34363.63
+5607 24660.06
+# Should not use semi-join conversion because has ORDER BY ... LIMIT
+explain
+update orders set o_totalprice = o_totalprice-50 where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (1,2))
+order by o_totalprice limit 500;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY orders range i_o_orderdate i_o_orderdate 4 NULL 108 Using where; Using filesort
+2 DEPENDENT SUBQUERY customer unique_subquery PRIMARY,i_c_nationkey PRIMARY 4 func 1 Using where
+update orders set o_totalprice = o_totalprice-50 where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (1,2))
+order by o_totalprice limit 500;
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (1,2));
+o_orderkey o_totalprice
+1221 117347.16
+324 26818.85
+1856 189311.42
+1344 43759.37
+1925 146332.71
+3139 40925.96
+4903 34313.63
+5607 24610.06
+update orders set o_totalprice = o_totalprice+50 where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (1,2))
+order by o_totalprice limit 500;
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (1,2));
+o_orderkey o_totalprice
+1221 117397.16
+324 26868.85
+1856 189361.42
+1344 43809.37
+1925 146382.71
+3139 40975.96
+4903 34363.63
+5607 24660.06
+# Should use semi-join converion
+explain
+update orders set o_totalprice = o_totalprice-50 where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (1,2));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY customer range PRIMARY,i_c_nationkey i_c_nationkey 5 NULL 15 Using index condition
+1 PRIMARY orders ref|filter i_o_orderdate,i_o_custkey i_o_custkey|i_o_orderdate 5|4 dbt3_s001.customer.c_custkey 15 (7%) Using where; Using rowid filter
+update orders set o_totalprice = o_totalprice-50 where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (1,2));
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (1,2));
+o_orderkey o_totalprice
+1221 117347.16
+324 26818.85
+1856 189311.42
+1344 43759.37
+1925 146332.71
+3139 40925.96
+4903 34313.63
+5607 24610.06
+update orders set o_totalprice = o_totalprice+50 where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (1,2));
+select o_orderkey, o_totalprice from orders where o_orderDATE between '1992-01-01' and '1992-06-30' and
+o_custkey in (select c_custkey from customer
+where c_nationkey in (1,2));
+o_orderkey o_totalprice
+1221 117397.16
+324 26868.85
+1856 189361.42
+1344 43809.37
+1925 146382.71
+3139 40975.96
+4903 34363.63
+5607 24660.06
+CREATE TABLE partsupp_small (
+ps_partkey int(11) NOT NULL DEFAULT '0',
+ps_suppkey int(11) NOT NULL DEFAULT '0',
+ps_availqty int(11) DEFAULT NULL,
+ps_supplycost double DEFAULT NULL,
+ps_comment varchar(199) DEFAULT NULL,
+PRIMARY KEY (ps_partkey,ps_suppkey),
+KEY i_ps_partkey (ps_partkey),
+KEY i_ps_suppkey (ps_suppkey)
+);
+create index i_ps_sup_part on partsupp_small(ps_suppkey, ps_partkey);
+insert into partsupp_small select * from partsupp where ps_partkey <50;
+analyze table partsupp_small persistent for all;
+Table Op Msg_type Msg_text
+dbt3_s001.partsupp_small analyze status Engine-independent statistics collected
+dbt3_s001.partsupp_small analyze status OK
+# LooseScan
+# =========
+explain
+select count(*) from lineitem where l_suppkey in
+(select ps_suppkey from partsupp_small
+where ps_partkey in (1,2,3));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY partsupp_small index PRIMARY,i_ps_partkey,i_ps_suppkey,i_ps_sup_part i_ps_sup_part 8 NULL 176 Using where; Using index; LooseScan
+1 PRIMARY lineitem ref i_l_suppkey i_l_suppkey 5 dbt3_s001.partsupp_small.ps_suppkey 600 Using index
+explain format=json
+select count(*) from lineitem where l_suppkey in
+(select ps_suppkey from partsupp_small
+where ps_partkey in (1,2,3));
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 0.776623555,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "partsupp_small",
+ "access_type": "index",
+ "possible_keys": [
+ "PRIMARY",
+ "i_ps_partkey",
+ "i_ps_suppkey",
+ "i_ps_sup_part"
+ ],
+ "key": "i_ps_sup_part",
+ "key_length": "8",
+ "used_key_parts": ["ps_suppkey", "ps_partkey"],
+ "loops": 1,
+ "rows": 176,
+ "cost": 0.019403477,
+ "filtered": 5.113636494,
+ "attached_condition": "partsupp_small.ps_partkey in (1,2,3)",
+ "using_index": true,
+ "loose_scan": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": ["i_l_suppkey"],
+ "key": "i_l_suppkey",
+ "key_length": "5",
+ "used_key_parts": ["l_suppkey"],
+ "ref": ["dbt3_s001.partsupp_small.ps_suppkey"],
+ "loops": 9,
+ "rows": 600,
+ "cost": 0.757220078,
+ "filtered": 11.11111069,
+ "using_index": true
+ }
+ }
+ ]
+ }
+}
+select count(*) from lineitem where l_suppkey in
+(select ps_suppkey from partsupp_small
+where ps_partkey in (1,2,3));
+count(*)
+5373
+select 5373 as count, 136458704.22 as old_sum;
+count old_sum
+5373 136458704.22
+explain
+update lineitem set l_extendedprice=l_extendedprice+10 where l_suppkey in
+(select ps_suppkey from partsupp_small
+where ps_partkey in (1,2,3));
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY lineitem ALL i_l_suppkey NULL NULL NULL 6005
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED partsupp_small range PRIMARY,i_ps_partkey,i_ps_suppkey,i_ps_sup_part PRIMARY 4 NULL 9 Using where; Using index
+explain format=json
+update lineitem set l_extendedprice=l_extendedprice+10 where l_suppkey in
+(select ps_suppkey from partsupp_small
+where ps_partkey in (1,2,3));
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 2.191459679,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ALL",
+ "possible_keys": ["i_l_suppkey"],
+ "loops": 1,
+ "rows": 6005,
+ "cost": 0.988432825,
+ "filtered": 100
+ }
+ },
+ {
+ "table": {
+ "table_name": "<subquery2>",
+ "access_type": "eq_ref",
+ "possible_keys": ["distinct_key"],
+ "key": "distinct_key",
+ "key_length": "4",
+ "used_key_parts": ["ps_suppkey"],
+ "ref": ["func"],
+ "rows": 1,
+ "filtered": 100,
+ "materialized": {
+ "unique": 1,
+ "query_block": {
+ "select_id": 2,
+ "nested_loop": [
+ {
+ "table": {
+ "table_name": "partsupp_small",
+ "access_type": "range",
+ "possible_keys": [
+ "PRIMARY",
+ "i_ps_partkey",
+ "i_ps_suppkey",
+ "i_ps_sup_part"
+ ],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["ps_partkey"],
+ "loops": 1,
+ "rows": 9,
+ "cost": 0.003756598,
+ "filtered": 100,
+ "attached_condition": "partsupp_small.ps_partkey in (1,2,3)",
+ "using_index": true
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ ]
+ }
+}
+update lineitem set l_extendedprice=l_extendedprice+10 where l_suppkey in
+(select ps_suppkey from partsupp_small
+where ps_partkey in (1,2,3));
+select ROUND(sum(l_extendedprice),2), 5373 as count,
+(136458704.22+10*5373) as 'old_sum+10*count'
+ from lineitem where l_suppkey in
+(select ps_suppkey from partsupp_small
+where ps_partkey in (1,2,3));
+ROUND(sum(l_extendedprice),2) count old_sum+10*count
+136512434.22 5373 136512434.22
+update lineitem set l_extendedprice=l_extendedprice-10 where l_suppkey in
+(select ps_suppkey from partsupp_small
+where ps_partkey in (1,2,3));
+select ROUND(sum(l_extendedprice),2), 5373 as count,
+136458704.22 as old_sum from lineitem where l_suppkey in
+(select ps_suppkey from partsupp_small
+where ps_partkey in (1,2,3));
+ROUND(sum(l_extendedprice),2) count old_sum
+136458704.22 5373 136458704.22
+# LooseScan PS
+# ============
+prepare stmt from "
+update lineitem set l_extendedprice=l_extendedprice+? where l_suppkey in
+(select ps_suppkey from partsupp_small
+where ps_partkey in (1,2,3));
+";
+select 5373 as count, 136458704.22 as old_sum;
+count old_sum
+5373 136458704.22
+set @a1=20;
+execute stmt using @a1;
+select ROUND(sum(l_extendedprice),2), 5373 as count,
+(136458704.22+20*5373) as 'old_sum+20*count'
+ from lineitem where l_suppkey in
+(select ps_suppkey from partsupp_small
+where ps_partkey in (1,2,3));
+ROUND(sum(l_extendedprice),2) count old_sum+20*count
+136566164.22 5373 136566164.22
+set @a2=10;
+execute stmt using @a2;
+select ROUND(sum(l_extendedprice),2), 5373 as count,
+(136458704.22+30*5373) as 'old_sum+30*count'
+ from lineitem where l_suppkey in
+(select ps_suppkey from partsupp_small
+where ps_partkey in (1,2,3));
+ROUND(sum(l_extendedprice),2) count old_sum+30*count
+136619894.22 5373 136619894.22
+execute stmt using -(@a1+@a2);
+select ROUND(sum(l_extendedprice),2), 5373 as count,
+136458704.22 as old_sum from lineitem where l_suppkey in
+(select ps_suppkey from partsupp_small
+where ps_partkey in (1,2,3));
+ROUND(sum(l_extendedprice),2) count old_sum
+136458704.22 5373 136458704.22
+deallocate prepare stmt;
+# LooseScan SP
+# ============
+create procedure p(d int)
+update lineitem set l_extendedprice=l_extendedprice+d where l_suppkey in
+(select ps_suppkey from partsupp_small
+where ps_partkey in (1,2,3));
+select 5373 as count, 136458704.22 as old_sum;
+count old_sum
+5373 136458704.22
+call p(10);
+select ROUND(sum(l_extendedprice),2), 5373 as count,
+(136458704.22+10*5373) as 'old_sum+10*count'
+ from lineitem where l_suppkey in
+(select ps_suppkey from partsupp_small
+where ps_partkey in (1,2,3));
+ROUND(sum(l_extendedprice),2) count old_sum+10*count
+136512434.22 5373 136512434.22
+call p(20);
+select ROUND(sum(l_extendedprice),2), 5373 as count,
+(136458704.22+30*5373) as 'old_sum+30*count'
+ from lineitem where l_suppkey in
+(select ps_suppkey from partsupp_small
+where ps_partkey in (1,2,3));
+ROUND(sum(l_extendedprice),2) count old_sum+30*count
+136619894.22 5373 136619894.22
+call p(-(10+20));
+select ROUND(sum(l_extendedprice),2), 5373 as count,
+136458704.22 as old_sum from lineitem where l_suppkey in
+(select ps_suppkey from partsupp_small
+where ps_partkey in (1,2,3));
+ROUND(sum(l_extendedprice),2) count old_sum
+136458704.22 5373 136458704.22
+drop procedure p;
+# DuplicateWeedout
+# ================
+set @tmp_optimizer_switch= @@optimizer_switch;
+set optimizer_switch='materialization=off';
+analyze table lineitem;
+Table Op Msg_type Msg_text
+dbt3_s001.lineitem analyze status Engine-independent statistics collected
+dbt3_s001.lineitem analyze status OK
+analyze table orders;
+Table Op Msg_type Msg_text
+dbt3_s001.orders analyze status Engine-independent statistics collected
+dbt3_s001.orders analyze status OK
+explain
+select count(*) from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY supplier range PRIMARY PRIMARY 4 NULL 1 Using where; Using index; Start temporary
+1 PRIMARY partsupp_small ref PRIMARY,i_ps_partkey,i_ps_suppkey,i_ps_sup_part i_ps_sup_part 4 dbt3_s001.supplier.s_suppkey 17 Using where; Using index
+1 PRIMARY lineitem ref i_l_suppkey_partkey,i_l_partkey i_l_suppkey_partkey 5 dbt3_s001.partsupp_small.ps_partkey 30 Using index
+1 PRIMARY lineitem ref i_l_suppkey_partkey,i_l_partkey i_l_partkey 5 dbt3_s001.partsupp_small.ps_partkey 30 Using index; End temporary
+explain format=json
+select count(*) from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 4.129940741,
+ "nested_loop": [
+ {
+ "duplicates_removal": [
+ {
+ "table": {
+ "table_name": "supplier",
+ "access_type": "range",
+ "possible_keys": ["PRIMARY"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["s_suppkey"],
+ "loops": 1,
+ "rows": 1,
+ "cost": 0.001478954,
+ "filtered": 100,
+ "attached_condition": "supplier.s_suppkey < 2",
+ "using_index": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "partsupp_small",
+ "access_type": "ref",
+ "possible_keys": [
+ "PRIMARY",
+ "i_ps_partkey",
+ "i_ps_suppkey",
+ "i_ps_sup_part"
+ ],
+ "key": "i_ps_sup_part",
+ "key_length": "4",
+ "used_key_parts": ["ps_suppkey"],
+ "ref": ["dbt3_s001.supplier.s_suppkey"],
+ "loops": 1,
+ "rows": 17,
+ "cost": 0.003160332,
+ "filtered": 79.54545593,
+ "attached_condition": "partsupp_small.ps_partkey is not null",
+ "using_index": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": ["i_l_suppkey_partkey", "i_l_partkey"],
+ "key": "i_l_suppkey_partkey",
+ "key_length": "5",
+ "used_key_parts": ["l_partkey"],
+ "ref": ["dbt3_s001.partsupp_small.ps_partkey"],
+ "loops": 14,
+ "rows": 30,
+ "cost": 0.069152188,
+ "filtered": 100,
+ "using_index": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": ["i_l_suppkey_partkey", "i_l_partkey"],
+ "key": "i_l_partkey",
+ "key_length": "5",
+ "used_key_parts": ["l_partkey"],
+ "ref": ["dbt3_s001.partsupp_small.ps_partkey"],
+ "loops": 420.35,
+ "rows": 30,
+ "cost": 1.994712365,
+ "filtered": 0.237896994,
+ "using_index": true
+ }
+ }
+ ]
+ }
+ ]
+ }
+}
+select count(*) from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+count(*)
+471
+select 471 as count, 10751458.66 as old_sum;
+count old_sum
+471 10751458.66
+explain
+update lineitem set l_extendedprice=l_extendedprice+10 where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY supplier range PRIMARY PRIMARY 4 NULL 1 Using where; Using index; Start temporary
+1 PRIMARY partsupp_small ref PRIMARY,i_ps_partkey,i_ps_suppkey,i_ps_sup_part i_ps_sup_part 4 dbt3_s001.supplier.s_suppkey 17 Using where; Using index
+1 PRIMARY lineitem ref i_l_suppkey_partkey,i_l_partkey i_l_suppkey_partkey 5 dbt3_s001.partsupp_small.ps_partkey 30
+1 PRIMARY lineitem ref i_l_suppkey_partkey,i_l_partkey i_l_partkey 5 dbt3_s001.partsupp_small.ps_partkey 30 Using index; End temporary
+explain format=json
+update lineitem set l_extendedprice=l_extendedprice+10 where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "cost": 4.590092321,
+ "nested_loop": [
+ {
+ "duplicates_removal": [
+ {
+ "table": {
+ "table_name": "supplier",
+ "access_type": "range",
+ "possible_keys": ["PRIMARY"],
+ "key": "PRIMARY",
+ "key_length": "4",
+ "used_key_parts": ["s_suppkey"],
+ "loops": 1,
+ "rows": 1,
+ "cost": 0.001478954,
+ "filtered": 100,
+ "attached_condition": "supplier.s_suppkey < 2",
+ "using_index": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "partsupp_small",
+ "access_type": "ref",
+ "possible_keys": [
+ "PRIMARY",
+ "i_ps_partkey",
+ "i_ps_suppkey",
+ "i_ps_sup_part"
+ ],
+ "key": "i_ps_sup_part",
+ "key_length": "4",
+ "used_key_parts": ["ps_suppkey"],
+ "ref": ["dbt3_s001.supplier.s_suppkey"],
+ "loops": 1,
+ "rows": 17,
+ "cost": 0.003160332,
+ "filtered": 79.54545593,
+ "attached_condition": "partsupp_small.ps_partkey is not null",
+ "using_index": true
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": ["i_l_suppkey_partkey", "i_l_partkey"],
+ "key": "i_l_suppkey_partkey",
+ "key_length": "5",
+ "used_key_parts": ["l_partkey"],
+ "ref": ["dbt3_s001.partsupp_small.ps_partkey"],
+ "loops": 14,
+ "rows": 30,
+ "cost": 0.529303768,
+ "filtered": 100
+ }
+ },
+ {
+ "table": {
+ "table_name": "lineitem",
+ "access_type": "ref",
+ "possible_keys": ["i_l_suppkey_partkey", "i_l_partkey"],
+ "key": "i_l_partkey",
+ "key_length": "5",
+ "used_key_parts": ["l_partkey"],
+ "ref": ["dbt3_s001.partsupp_small.ps_partkey"],
+ "loops": 420.35,
+ "rows": 30,
+ "cost": 1.994712365,
+ "filtered": 0.237896994,
+ "using_index": true
+ }
+ }
+ ]
+ }
+ ]
+ }
+}
+update lineitem set l_extendedprice=l_extendedprice+10 where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+select ROUND(sum(l_extendedprice),2), 471 as count,
+(10751458.66+10*471) as 'old_sum+10*count'
+ from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+ROUND(sum(l_extendedprice),2) count old_sum+10*count
+10756168.66 471 10756168.66
+update lineitem set l_extendedprice=l_extendedprice-10 where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+select ROUND(sum(l_extendedprice),2), 471 as count,
+10751458.66 as old_sum from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+ROUND(sum(l_extendedprice),2) count old_sum
+10751458.66 471 10751458.66
+# DuplicateWeedout PS
+# ===================
+prepare stmt from "
+update lineitem set l_extendedprice=l_extendedprice+? where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+";
+select 471 as count, 10751458.66 as old_sum;
+count old_sum
+471 10751458.66
+set @a1=20;
+execute stmt using @a1;
+select ROUND(sum(l_extendedprice),2), 471 as count,
+(10751458.66+20*471) as 'old_sum+20*count'
+ from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+ROUND(sum(l_extendedprice),2) count old_sum+20*count
+10760878.66 471 10760878.66
+set @a2=10;
+execute stmt using @a2;
+select ROUND(sum(l_extendedprice),2), 471 as count,
+(10751458.66+30*471) as 'old_sum+30*count'
+ from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+ROUND(sum(l_extendedprice),2) count old_sum+30*count
+10765588.66 471 10765588.66
+execute stmt using -(@a1+@a2);
+select ROUND(sum(l_extendedprice),2), 471 as count,
+10751458.66 as old_sum from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+ROUND(sum(l_extendedprice),2) count old_sum
+10751458.66 471 10751458.66
+deallocate prepare stmt;
+# DuplicateWeedout SP
+# ===================
+create procedure p(d int)
+update lineitem set l_extendedprice=l_extendedprice+d where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+select 471 as count, 10751458.66 as old_sum;
+count old_sum
+471 10751458.66
+call p(10);
+select ROUND(sum(l_extendedprice),2), 471 as count,
+(10751458.66+10*471) as 'old_sum+10*count'
+ from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+ROUND(sum(l_extendedprice),2) count old_sum+10*count
+10756168.66 471 10756168.66
+call p(20);
+select ROUND(sum(l_extendedprice),2), 471 as count,
+(10751458.66+30*471) as 'old_sum+30*count'
+ from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+ROUND(sum(l_extendedprice),2) count old_sum+30*count
+10765588.66 471 10765588.66
+call p(-(10+20));
+select ROUND(sum(l_extendedprice),2), 471 as count,
+10751458.66 as old_sum from lineitem where l_partkey in (
+select ps_partkey
+from partsupp_small join lineitem on ps_partkey=l_partkey
+where ps_suppkey in (
+select s_suppkey from supplier where s_suppkey < 2
+)
+);
+ROUND(sum(l_extendedprice),2) count old_sum
+10751458.66 471 10751458.66
+drop procedure p;
+set @@optimizer_switch=@tmp_optimizer_switch;
+drop table partsupp_small;
+DROP DATABASE dbt3_s001;
diff --git a/mysql-test/main/update_single_to_multi.test b/mysql-test/main/update_single_to_multi.test
new file mode 100644
index 00000000..7364806e
--- /dev/null
+++ b/mysql-test/main/update_single_to_multi.test
@@ -0,0 +1,832 @@
+--disable_warnings
+DROP DATABASE IF EXISTS dbt3_s001;
+--enable_warnings
+
+CREATE DATABASE dbt3_s001;
+
+use dbt3_s001;
+
+--disable_query_log
+--disable_result_log
+--disable_warnings
+--source include/dbt3_s001.inc
+--enable_warnings
+--enable_result_log
+--enable_query_log
+
+create index i_n_name on nation(n_name);
+analyze table
+ nation, lineitem, customer, orders, part, supplier, partsupp, region
+persistent for all;
+
+--echo # Pullout
+--echo # =======
+
+let $c1=
+ o_orderDATE between '1992-01-01' and '1992-06-30' and
+ o_custkey in (select c_custkey from customer
+ where c_nationkey in (select n_nationkey from nation
+ where n_name='PERU'));
+
+eval
+explain
+select o_orderkey, o_totalprice from orders where $c1;
+eval
+explain format=json
+select o_orderkey, o_totalprice from orders where $c1;
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+
+eval
+explain
+update orders set o_totalprice = o_totalprice-50 where $c1;
+eval
+explain format=json
+update orders set o_totalprice = o_totalprice-50 where $c1;
+eval
+update orders set o_totalprice = o_totalprice-50 where $c1;
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+
+eval
+update orders set o_totalprice= o_totalprice+50 where $c1;
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+
+
+let $c2=
+ (ps_partkey, ps_suppkey) in
+ (select p_partkey, s_suppkey from part, supplier
+ where p_retailprice between 901 and 910 and
+ s_nationkey in (select n_nationkey from nation
+ where n_name='PERU'));
+
+eval
+explain
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where $c2;
+eval
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where $c2;
+
+eval
+explain
+update partsupp set ps_supplycost = ps_supplycost+2 where $c2;
+eval
+update partsupp set ps_supplycost = ps_supplycost+2 where $c2;
+eval
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where $c2;
+
+eval
+update partsupp set ps_supplycost = ps_supplycost-2 where $c2;
+eval
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where $c2;
+
+
+let $c3=
+ ps_partkey in (select p_partkey from part
+ where p_retailprice between 901 and 910) and
+ ps_suppkey in (select s_suppkey from supplier
+ where s_nationkey in (select n_nationkey from nation
+ where n_name='PERU'));
+eval
+explain
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where $c3;
+eval
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where $c3;
+
+eval
+explain
+update partsupp set ps_supplycost = ps_supplycost+10 where $c3;
+eval
+update partsupp set ps_supplycost = ps_supplycost+10 where $c3;
+eval
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where $c3;
+
+eval
+update partsupp set ps_supplycost = ps_supplycost-10 where $c3;
+eval
+select ps_partkey, ps_suppkey, ps_supplycost from partsupp where $c3;
+
+
+let $c4=
+ l_orderkey in (select o_orderkey from orders
+ where o_custkey in
+ (select c_custkey from customer
+ where c_nationkey in
+ (select n_nationkey from nation
+ where n_name='PERU'))
+ and
+ o_orderDATE between '1992-06-30' and '1992-12-31')
+ and
+ (l_partkey, l_suppkey) in
+ (select p_partkey, s_suppkey from part, supplier
+ where p_retailprice between 901 and 1000 and
+ s_nationkey in (select n_nationkey from nation
+ where n_name='PERU'));
+
+eval
+explain
+select l_orderkey, l_linenumber, l_tax from lineitem where $c4;
+eval
+select l_orderkey, l_linenumber, l_tax from lineitem where $c4;
+
+eval
+explain
+update lineitem set l_tax = (l_tax*100+1)/100 where $c4;
+eval
+update lineitem set l_tax = (l_tax*100+1)/100 where $c4;
+eval
+select l_orderkey, l_linenumber, l_tax from lineitem where $c4;
+
+eval
+update lineitem set l_tax = (l_tax*100-1)/100 where $c4;
+eval
+select l_orderkey, l_linenumber, l_tax from lineitem where $c4;
+
+
+--echo # FirstMatch
+--echo # ==========
+
+set optimizer_switch='materialization=off';
+
+let $c5=
+ c_nationkey in (select n_nationkey from nation
+ where n_regionkey in (1,2))
+ and
+ c_custkey in (select o_custkey from orders
+ where o_orderDATE between '1992-10-09' and '1993-06-08');
+
+eval
+explain
+select c_name, c_acctbal from customer where $c5;
+eval
+explain format=json
+select c_name, c_acctbal from customer where $c5;
+eval
+select c_name, c_acctbal from customer where $c5;
+
+eval
+explain
+update customer set c_acctbal = c_acctbal+10 where $c5;
+eval
+explain format=json
+update customer set c_acctbal = c_acctbal+10 where $c5;
+eval
+update customer set c_acctbal = c_acctbal+10 where $c5;
+eval
+select c_name, c_acctbal from customer where $c5;
+
+eval
+update customer set c_acctbal = c_acctbal-10 where $c5;
+eval
+select c_name, c_acctbal from customer where $c5;
+
+set optimizer_switch='materialization=default';
+
+let $c6=
+ c_nationkey in (select n_nationkey from nation where n_name='PERU')
+ and
+ c_custkey in (select o_custkey from orders
+ where o_orderDATE between "1992-01-09" and "1993-01-08");
+
+eval
+explain
+select c_name, c_acctbal from customer where $c6;
+eval
+select c_name, c_acctbal from customer where $c6;
+
+eval
+explain
+update customer set c_acctbal = c_acctbal+20 where $c6;
+eval
+update customer set c_acctbal = c_acctbal+20 where $c6;
+eval
+select c_name, c_acctbal from customer where $c6;
+
+eval
+update customer set c_acctbal = c_acctbal-20 where $c6;
+eval
+select c_name, c_acctbal from customer where $c6;
+
+--echo # Materialization
+--echo # ===============
+
+set optimizer_switch='firstmatch=off';
+
+let $c7=
+ c_nationkey in (select n_nationkey from nation where
+ n_name in ('JAPAN', 'INDONESIA', 'PERU', 'ARGENTINA'))
+ and
+ c_custkey in (select o_custkey from orders
+ where o_orderDATE between "1992-01-09" and "1995-01-08");
+
+eval
+explain
+select c_name, c_acctbal from customer where $c7;
+eval
+select c_name, c_acctbal from customer where $c7;
+
+eval
+explain
+update customer set c_acctbal = c_acctbal+20 where $c7;
+eval
+update customer set c_acctbal = c_acctbal+20 where $c7;
+eval
+select c_name, c_acctbal from customer where $c7;
+
+eval
+update customer set c_acctbal = c_acctbal-20 where $c7;
+eval
+select c_name, c_acctbal from customer where $c7;
+
+set optimizer_switch='firstmatch=default';
+
+let $c8=
+ c_custkey in (select o_custkey from orders
+ where o_orderDATE between '1992-01-09' and '1993-03-08');
+
+eval
+explain
+select c_name, c_acctbal from customer where $c8;
+eval
+explain format=json
+select c_name, c_acctbal from customer where $c8;
+eval
+select c_name, c_acctbal from customer where $c8;
+
+eval
+explain
+update customer set c_acctbal = c_acctbal+5 where $c8;
+eval
+explain format=json
+update customer set c_acctbal = c_acctbal+5 where $c8;
+eval
+update customer set c_acctbal = c_acctbal+5 where $c8;
+eval
+select c_name, c_acctbal from customer where $c8;
+
+eval
+update customer set c_acctbal = c_acctbal-5 where $c8;
+eval
+select c_name, c_acctbal from customer where $c8;
+
+
+let $c9=
+ c_custkey in (select o_custkey from orders
+ where o_orderDATE between '1992-06-09' and '1993-01-08');
+
+eval
+explain
+select c_name, c_acctbal from customer where $c9;
+eval
+select c_name, c_acctbal from customer where $c9;
+
+eval
+explain
+update customer set c_acctbal = c_acctbal+1 where $c9;
+eval
+update customer set c_acctbal = c_acctbal+1 where $c9;
+eval
+select c_name, c_acctbal from customer where $c9;
+
+eval
+update customer set c_acctbal = c_acctbal-1 where $c9;
+eval
+select c_name, c_acctbal from customer where $c9;
+
+
+
+--echo # Materialization SJM
+--echo # ===================
+
+let $c10=
+ c_custkey in (select o_custkey from orders
+ where o_orderDATE between '1992-01-09' and '1992-03-08'
+ group by o_custkey having count(o_custkey) > 1);
+
+eval
+explain
+select c_name, c_acctbal from customer where $c10;
+eval
+explain format=json
+select c_name, c_acctbal from customer where $c10;
+eval
+select c_name, c_acctbal from customer where $c10;
+
+eval
+explain
+update customer set c_acctbal = c_acctbal-5 where $c10;
+eval
+explain format=json
+update customer set c_acctbal = c_acctbal-5 where $c10;
+eval
+update customer set c_acctbal = c_acctbal-5 where $c10;
+eval
+select c_name, c_acctbal from customer where $c10;
+
+eval
+update customer set c_acctbal = c_acctbal+5 where $c10;
+eval
+select c_name, c_acctbal from customer where $c10;
+
+
+let $c11=
+ c_custkey in (select o_custkey from orders
+ where o_orderDATE between '1992-01-09' and '1993-03-08'
+ group by o_custkey having count(o_custkey) > 5);
+
+eval
+explain
+select c_name, c_acctbal from customer where $c11;
+eval
+select c_name, c_acctbal from customer where $c11;
+
+eval
+explain
+update customer set c_acctbal = c_acctbal-1 where $c11;
+eval
+update customer set c_acctbal = c_acctbal-1 where $c11;
+eval
+select c_name, c_acctbal from customer where $c11;
+
+eval
+update customer set c_acctbal = c_acctbal+1 where $c11;
+eval
+select c_name, c_acctbal from customer where $c11;
+
+
+--echo # Pullout PS
+--echo # ==========
+
+eval
+prepare stmt from "
+update orders set o_totalprice = o_totalprice+? where $c1;
+";
+
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+set @a1=-20;
+execute stmt using @a1;
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+set @a2=-10;
+execute stmt using @a2;
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+execute stmt using -(@a1+@a2);
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+
+deallocate prepare stmt;
+
+
+--echo # FirstMatch PS
+--echo # =============
+
+set optimizer_switch='materialization=off';
+
+eval
+prepare stmt from "
+update customer set c_acctbal = c_acctbal+? where $c5;
+";
+
+eval
+select c_name, c_acctbal from customer where $c5;
+set @a1=15;
+execute stmt using @a1;
+eval
+select c_name, c_acctbal from customer where $c5;
+set @a2=5;
+execute stmt using @a2;
+eval
+select c_name, c_acctbal from customer where $c5;
+execute stmt using -(@a1+@a2);
+eval
+select c_name, c_acctbal from customer where $c5;
+
+deallocate prepare stmt;
+
+set optimizer_switch='materialization=default';
+
+--echo # Materialization PS
+--echo # ==================
+
+eval
+prepare stmt from "
+update customer set c_acctbal = c_acctbal+? where $c8;
+";
+
+eval
+select c_name, c_acctbal from customer where $c8;
+set @a1=7;
+execute stmt using @a1;
+eval
+select c_name, c_acctbal from customer where $c8;
+set @a2=3;
+execute stmt using @a2;
+eval
+select c_name, c_acctbal from customer where $c8;
+execute stmt using -(@a1+@a2);
+eval
+select c_name, c_acctbal from customer where $c8;
+
+deallocate prepare stmt;
+
+
+--echo # Materialization SJM PS
+--echo # ======================
+
+eval
+prepare stmt from "
+update customer set c_acctbal = c_acctbal+? where $c10;
+";
+
+eval
+select c_name, c_acctbal from customer where $c10;
+set @a1=-2;
+execute stmt using @a1;
+eval
+select c_name, c_acctbal from customer where $c10;
+set @a2=-1;
+execute stmt using @a2;
+eval
+select c_name, c_acctbal from customer where $c10;
+execute stmt using -(@a1+@a2);
+eval
+select c_name, c_acctbal from customer where $c10;
+
+deallocate prepare stmt;
+
+
+--echo # Pullout SP
+--echo # ==========
+
+eval
+create procedure p(d int)
+update orders set o_totalprice = o_totalprice+d where $c1;
+
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+call p(-10);
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+call p(-20);
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+call p(10+20);
+eval
+select o_orderkey, o_totalprice from orders where $c1;
+
+drop procedure p;
+
+
+--echo # FirstMatch SP
+--echo # =============
+
+set optimizer_switch='materialization=off';
+
+eval
+create procedure p(d int)
+update customer set c_acctbal = c_acctbal+d where $c5;
+
+eval
+select c_name, c_acctbal from customer where $c5;
+call p(5);
+eval
+select c_name, c_acctbal from customer where $c5;
+call p(15);
+eval
+select c_name, c_acctbal from customer where $c5;
+call p(-(5+15));
+eval
+select c_name, c_acctbal from customer where $c5;
+
+drop procedure p;
+
+set optimizer_switch='materialization=default';
+
+
+--echo # Materialization SP
+--echo # ==================
+
+eval
+create procedure p(d int)
+update customer set c_acctbal = c_acctbal+d where $c8;
+
+eval
+select c_name, c_acctbal from customer where $c8;
+call p(3);
+eval
+select c_name, c_acctbal from customer where $c8;
+call p(7);
+eval
+select c_name, c_acctbal from customer where $c8;
+call p(-(3+7));
+eval
+select c_name, c_acctbal from customer where $c8;
+
+drop procedure p;
+
+
+--echo # Materialization SJM SP
+--echo # ======================
+
+eval
+create procedure p(d int)
+update customer set c_acctbal = c_acctbal+d where $c10;
+
+eval
+select c_name, c_acctbal from customer where $c10;
+call p(-1);
+eval
+select c_name, c_acctbal from customer where $c10;
+call p(-2);
+eval
+select c_name, c_acctbal from customer where $c10;
+call p(1+2);
+eval
+select c_name, c_acctbal from customer where $c10;
+
+drop procedure p;
+
+--echo # Checking limitations
+--echo # ====================
+
+let $c11=
+ o_orderDATE between '1992-01-01' and '1992-06-30' and
+ o_custkey in (select c_custkey from customer
+ where c_nationkey in (1,2));
+
+eval
+select o_orderkey, o_totalprice from orders where $c11;
+--echo # Should not use semi-join conversion because has ORDER BY ... LIMIT
+eval
+explain
+update orders set o_totalprice = o_totalprice-50 where $c11
+order by o_totalprice limit 500;
+eval
+update orders set o_totalprice = o_totalprice-50 where $c11
+order by o_totalprice limit 500;
+eval
+select o_orderkey, o_totalprice from orders where $c11;
+eval
+update orders set o_totalprice = o_totalprice+50 where $c11
+order by o_totalprice limit 500;
+eval
+select o_orderkey, o_totalprice from orders where $c11;
+
+--echo # Should use semi-join converion
+eval
+explain
+update orders set o_totalprice = o_totalprice-50 where $c11;
+eval
+update orders set o_totalprice = o_totalprice-50 where $c11;
+eval
+select o_orderkey, o_totalprice from orders where $c11;
+eval
+update orders set o_totalprice = o_totalprice+50 where $c11;
+eval
+select o_orderkey, o_totalprice from orders where $c11;
+
+CREATE TABLE partsupp_small (
+ ps_partkey int(11) NOT NULL DEFAULT '0',
+ ps_suppkey int(11) NOT NULL DEFAULT '0',
+ ps_availqty int(11) DEFAULT NULL,
+ ps_supplycost double DEFAULT NULL,
+ ps_comment varchar(199) DEFAULT NULL,
+ PRIMARY KEY (ps_partkey,ps_suppkey),
+ KEY i_ps_partkey (ps_partkey),
+ KEY i_ps_suppkey (ps_suppkey)
+);
+
+create index i_ps_sup_part on partsupp_small(ps_suppkey, ps_partkey);
+insert into partsupp_small select * from partsupp where ps_partkey <50;
+analyze table partsupp_small persistent for all;
+
+--echo # LooseScan
+--echo # =========
+
+let $c12 = l_suppkey in
+ (select ps_suppkey from partsupp_small
+ where ps_partkey in (1,2,3));
+
+eval
+explain
+select count(*) from lineitem where $c12;
+eval
+explain format=json
+select count(*) from lineitem where $c12;
+eval
+select count(*) from lineitem where $c12;
+let $l_count =
+ query_get_value('select count(*) as a from lineitem where $c12;', a, 1);
+let $l_old_sum =
+ query_get_value('select ROUND(sum(l_extendedprice),2) as a
+ from lineitem where $c12;', a, 1
+ );
+eval select $l_count as count, $l_old_sum as old_sum;
+
+eval
+explain
+update lineitem set l_extendedprice=l_extendedprice+10 where $c12;
+eval
+explain format=json
+update lineitem set l_extendedprice=l_extendedprice+10 where $c12;
+eval
+update lineitem set l_extendedprice=l_extendedprice+10 where $c12;
+eval
+select ROUND(sum(l_extendedprice),2), $l_count as count,
+ ($l_old_sum+10*$l_count) as 'old_sum+10*count'
+ from lineitem where $c12;
+
+eval
+update lineitem set l_extendedprice=l_extendedprice-10 where $c12;
+eval
+select ROUND(sum(l_extendedprice),2), $l_count as count,
+ $l_old_sum as old_sum from lineitem where $c12;
+
+
+--echo # LooseScan PS
+--echo # ============
+
+eval
+prepare stmt from "
+update lineitem set l_extendedprice=l_extendedprice+? where $c12;
+";
+
+let $l_count = query_get_value('select count(*) as a
+ from lineitem where $c12;', a, 1 );
+let $l_old_sum = query_get_value('select ROUND(sum(l_extendedprice),2) as a
+ from lineitem where $c12;', a, 1 );
+eval select $l_count as count, $l_old_sum as old_sum;
+eval
+set @a1=20;
+execute stmt using @a1;
+eval
+select ROUND(sum(l_extendedprice),2), $l_count as count,
+ ($l_old_sum+20*$l_count) as 'old_sum+20*count'
+ from lineitem where $c12;
+set @a2=10;
+execute stmt using @a2;
+eval
+select ROUND(sum(l_extendedprice),2), $l_count as count,
+ ($l_old_sum+30*$l_count) as 'old_sum+30*count'
+ from lineitem where $c12;
+execute stmt using -(@a1+@a2);
+eval
+select ROUND(sum(l_extendedprice),2), $l_count as count,
+ $l_old_sum as old_sum from lineitem where $c12;
+
+deallocate prepare stmt;
+
+--echo # LooseScan SP
+--echo # ============
+
+eval
+create procedure p(d int)
+update lineitem set l_extendedprice=l_extendedprice+d where $c12;
+
+let $l_count = query_get_value('select count(*) as a
+ from lineitem where $c12;', a, 1 );
+let $l_old_sum = query_get_value('select ROUND(sum(l_extendedprice),2) as a
+ from lineitem where $c12;', a, 1 );
+eval select $l_count as count, $l_old_sum as old_sum;
+eval
+call p(10);
+eval
+select ROUND(sum(l_extendedprice),2), $l_count as count,
+ ($l_old_sum+10*$l_count) as 'old_sum+10*count'
+ from lineitem where $c12;
+call p(20);
+eval
+select ROUND(sum(l_extendedprice),2), $l_count as count,
+ ($l_old_sum+30*$l_count) as 'old_sum+30*count'
+ from lineitem where $c12;
+call p(-(10+20));
+eval
+select ROUND(sum(l_extendedprice),2), $l_count as count,
+ $l_old_sum as old_sum from lineitem where $c12;
+
+drop procedure p;
+
+--echo # DuplicateWeedout
+--echo # ================
+
+set @tmp_optimizer_switch= @@optimizer_switch;
+set optimizer_switch='materialization=off';
+
+analyze table lineitem;
+analyze table orders;
+
+let $c13 = l_partkey in (
+ select ps_partkey
+ from partsupp_small join lineitem on ps_partkey=l_partkey
+ where ps_suppkey in (
+ select s_suppkey from supplier where s_suppkey < 2
+ )
+);
+
+eval
+explain
+select count(*) from lineitem where $c13;
+eval
+explain format=json
+select count(*) from lineitem where $c13;
+eval
+select count(*) from lineitem where $c13;
+
+let $l_count = query_get_value('select count(*) as a
+ from lineitem where $c13;', a, 1 );
+let $l_old_sum = query_get_value('select ROUND(sum(l_extendedprice),2) as a
+ from lineitem where $c13;', a, 1 );
+eval select $l_count as count, $l_old_sum as old_sum;
+
+eval
+explain
+update lineitem set l_extendedprice=l_extendedprice+10 where $c13;
+eval
+explain format=json
+update lineitem set l_extendedprice=l_extendedprice+10 where $c13;
+eval
+update lineitem set l_extendedprice=l_extendedprice+10 where $c13;
+eval
+select ROUND(sum(l_extendedprice),2), $l_count as count,
+ ($l_old_sum+10*$l_count) as 'old_sum+10*count'
+ from lineitem where $c13;
+
+eval
+update lineitem set l_extendedprice=l_extendedprice-10 where $c13;
+eval
+select ROUND(sum(l_extendedprice),2), $l_count as count,
+ $l_old_sum as old_sum from lineitem where $c13;
+
+
+--echo # DuplicateWeedout PS
+--echo # ===================
+
+eval
+prepare stmt from "
+update lineitem set l_extendedprice=l_extendedprice+? where $c13;
+";
+
+let $l_count =
+ query_get_value('select count(*) as a
+ from lineitem where $c13;', a, 1 );
+let $l_old_sum =
+ query_get_value('select ROUND(sum(l_extendedprice),2) as a
+ from lineitem where $c13;', a, 1);
+eval select $l_count as count, $l_old_sum as old_sum;
+eval
+set @a1=20;
+execute stmt using @a1;
+eval
+select ROUND(sum(l_extendedprice),2), $l_count as count,
+ ($l_old_sum+20*$l_count) as 'old_sum+20*count'
+ from lineitem where $c13;
+set @a2=10;
+execute stmt using @a2;
+eval
+select ROUND(sum(l_extendedprice),2), $l_count as count,
+ ($l_old_sum+30*$l_count) as 'old_sum+30*count'
+ from lineitem where $c13;
+execute stmt using -(@a1+@a2);
+eval
+select ROUND(sum(l_extendedprice),2), $l_count as count,
+ $l_old_sum as old_sum from lineitem where $c13;
+
+deallocate prepare stmt;
+
+--echo # DuplicateWeedout SP
+--echo # ===================
+
+eval
+create procedure p(d int)
+update lineitem set l_extendedprice=l_extendedprice+d where $c13;
+
+let $l_count = query_get_value('select count(*) as a
+ from lineitem where $c13;', a, 1 );
+let $l_old_sum = query_get_value('select ROUND(sum(l_extendedprice),2) as a
+ from lineitem where $c13;', a, 1 );
+eval select $l_count as count, $l_old_sum as old_sum;
+eval
+call p(10);
+
+eval
+select ROUND(sum(l_extendedprice),2), $l_count as count,
+ ($l_old_sum+10*$l_count) as 'old_sum+10*count'
+ from lineitem where $c13;
+call p(20);
+eval
+select ROUND(sum(l_extendedprice),2), $l_count as count,
+ ($l_old_sum+30*$l_count) as 'old_sum+30*count'
+ from lineitem where $c13;
+call p(-(10+20));
+eval
+select ROUND(sum(l_extendedprice),2), $l_count as count,
+ $l_old_sum as old_sum from lineitem where $c13;
+
+drop procedure p;
+set @@optimizer_switch=@tmp_optimizer_switch;
+
+drop table partsupp_small;
+
+DROP DATABASE dbt3_s001;
diff --git a/mysql-test/main/update_use_source.result b/mysql-test/main/update_use_source.result
index 5a9e0a77..d7567752 100644
--- a/mysql-test/main/update_use_source.result
+++ b/mysql-test/main/update_use_source.result
@@ -1,4 +1,16 @@
-create table t1 (old_c1 integer, old_c2 integer,c1 integer, c2 integer, c3 integer) engine=InnoDB STATS_PERSISTENT=0;
+set @save_default_engine=@@default_storage_engine;
+#######################################
+# #
+# Engine InnoDB #
+# #
+#######################################
+set global innodb_stats_persistent=1;
+set default_storage_engine=InnoDB;
+create table t1 (old_c1 integer,
+old_c2 integer,
+c1 integer,
+c2 integer,
+c3 integer);
create view v1 as select * from t1 where c2=2;
create trigger trg_t1 before update on t1 for each row
begin
@@ -6,37 +18,39 @@ set new.old_c1=old.c1;
set new.old_c2=old.c2;
end;
/
-insert into t1(c1,c2,c3) values (1,1,1);
-insert into t1(c1,c2,c3) values (1,2,2);
-insert into t1(c1,c2,c3) values (1,3,3);
-insert into t1(c1,c2,c3) values (2,1,4);
-insert into t1(c1,c2,c3) values (2,2,5);
-insert into t1(c1,c2,c3) values (2,3,6);
-insert into t1(c1,c2,c3) values (2,4,7);
-insert into t1(c1,c2,c3) values (2,5,8);
-commit;
-select * from t1;
-old_c1 old_c2 c1 c2 c3
-NULL NULL 1 1 1
-NULL NULL 1 2 2
-NULL NULL 1 3 3
-NULL NULL 2 1 4
-NULL NULL 2 2 5
-NULL NULL 2 3 6
-NULL NULL 2 4 7
-NULL NULL 2 5 8
-Test without any index
-#
-# Update a with value from subquery on the same table, no search clause. ALL access
-#
-start transaction;
-update t1
-set c1=(select a.c3
-from t1 a
-where a.c3 = t1.c3);
-affected rows: 8
-info: Rows matched: 8 Changed: 8 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ;
+insert into t1(c1,c2,c3)
+values (1,1,1), (1,2,2), (1,3,3),
+(2,1,4), (2,2,5), (2,3,6),
+(2,4,7), (2,5,8);
+insert into t1 select NULL, NULL, c1+10,c2,c3+10 from t1;
+insert into t1 select NULL, NULL, c1+20,c2+1,c3+20 from t1;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1;
+#######################################
+# Test without any index #
+#######################################
+#
+# Update with value from subquery on the same table
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
1->1 1
1->2 2 *
@@ -46,20 +60,56 @@ concat(old_c1,'->',c1) c3 Changed
2->6 6 *
2->7 7 *
2->8 8 *
-rollback;
+11->11 11
+11->12 12 *
+11->13 13 *
+12->14 14 *
+12->15 15 *
+12->16 16 *
+12->17 17 *
+12->18 18 *
+21->21 21
+21->22 22 *
+21->23 23 *
+22->24 24 *
+22->25 25 *
+22->26 26 *
+22->27 27 *
+22->28 28 *
+31->31 31
+31->32 32 *
+31->33 33 *
+32->34 34 *
+32->35 35 *
+32->36 36 *
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update with search clause on the same table
+# Update with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
#
-start transaction;
-update t1
-set c1=10
-where c1 <2
-and exists (select 'X'
- from t1 a
-where a.c1 = t1.c1);
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
affected rows: 3
info: Rows matched: 3 Changed: 3 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ;
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
1->10 1 *
1->10 2 *
@@ -69,20 +119,55 @@ NULL 5
NULL 6
NULL 7
NULL 8
-rollback;
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update via RANGE or INDEX access if an index or a primary key exists
+# Update with EXISTS subquery over the updated table
+# in WHERE + non-sargable condition
#
-explain update t1 set c1=0 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 > 3;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 8 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED a ALL NULL NULL NULL NULL 8
-start transaction;
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
-affected rows: 4
-info: Rows matched: 4 Changed: 4 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
NULL 2
@@ -92,13 +177,57 @@ NULL 5
2->12 6 *
2->12 7 *
2->12 8 *
-rollback;
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
#
# Update with order by
#
-start transaction;
-update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3 order by c2;
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
NULL 2
@@ -108,18 +237,54 @@ NULL 5
2->12 6 *
2->12 7 *
2->12 8 *
-rollback;
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
#
-Update using a view in subquery
+# Update with a reference to view in subquery
+# in settable value
#
-start transaction;
-update t1
-set c1=c1 +(select max(a.c2)
-from v1 a
-where a.c1 = t1.c1) ;
-affected rows: 8
-info: Rows matched: 8 Changed: 8 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
1->3 1 *
1->3 2 *
@@ -129,19 +294,53 @@ concat(old_c1,'->',c1) c3 Changed
2->4 6 *
2->4 7 *
2->4 8 *
-rollback;
+11->13 11 *
+11->13 12 *
+11->13 13 *
+12->14 14 *
+12->14 15 *
+12->14 16 *
+12->14 17 *
+12->14 18 *
+21->23 21 *
+21->23 22 *
+21->23 23 *
+22->24 24 *
+22->24 25 *
+22->24 26 *
+22->24 27 *
+22->24 28 *
+31->33 31 *
+31->33 32 *
+31->33 33 *
+32->34 34 *
+32->34 35 *
+32->34 36 *
+32->34 37 *
+32->34 38 *
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update throw a view
+# Update view
#
-start transaction;
-update v1
-set c1=c1 + (select max(a.c2)
-from t1 a
-where a.c1 = v1.c1) +10
-where c3 > 3;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using where
+explain update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+affected rows: 7
+info: Rows matched: 7 Changed: 7 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
NULL 2
@@ -151,20 +350,55 @@ NULL 4
NULL 6
NULL 7
NULL 8
-rollback;
+NULL 11
+11->24 12 *
+NULL 13
+NULL 14
+12->27 15 *
+NULL 16
+NULL 17
+NULL 18
+21->35 21 *
+NULL 22
+NULL 23
+22->38 24 *
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+31->45 31 *
+NULL 32
+NULL 33
+32->48 34 *
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update through a view and using the view in subquery
+# Update view with reference to the same view in subquery
#
-start transaction;
-update v1
-set c1=c1 + 1
-where c1 <2
-and exists (select 'X'
- from v1 a
-where a.c1 = v1.c1);
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
affected rows: 1
info: Rows matched: 1 Changed: 1 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
1->2 2 *
@@ -174,22 +408,57 @@ NULL 5
NULL 6
NULL 7
NULL 8
-rollback;
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update through a view and using the view in subquery
+# Update view with EXISTS and reference to the same view in subquery
#
-start transaction;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1 where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update v1
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
update v1
-set c1=(select max(a.c1)+10
-from v1 a
-where a.c1 = v1.c1)
-where c1 <10
-and exists (select 'X'
- from v1 a
-where a.c2 = v1.c2);
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
affected rows: 2
info: Rows matched: 2 Changed: 2 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
1->11 2 *
@@ -199,41 +468,107 @@ NULL 4
NULL 6
NULL 7
NULL 8
-rollback;
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update of the index or primary key (c3)
+# Update with IN predicand over the updated table in WHERE
#
-start transaction;
-explain update t1 set c3=c3+10 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 8
-1 PRIMARY a ALL NULL NULL NULL NULL 8 Using where; FirstMatch(t1)
-update t1 set c3=c3+10 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
-affected rows: 8
-info: Rows matched: 8 Changed: 8 Warnings: 0
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
select c3 from t1;
c3
-11
-12
-13
-14
-15
-16
-17
-18
-rollback;
-#
-# update with a limit
-#
-start transaction;
+111
+112
+113
+114
+115
+116
+117
+118
+121
+122
+123
+124
+125
+126
+127
+128
+131
+132
+133
+134
+135
+136
+137
+138
+141
+142
+143
+144
+145
+146
+147
+148
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a limit
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
update t1
-set c1=(select a.c3
-from t1 a
-where a.c3 = t1.c3)
-limit 2;
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
affected rows: 2
info: Rows matched: 2 Changed: 2 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ;
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
1->1 1
1->2 2 *
@@ -243,19 +578,55 @@ NULL 5
NULL 6
NULL 7
NULL 8
-rollback;
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
#
-# update with a limit and an order by
+# Update with a limit and an order by
#
-start transaction;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using filesort
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using filesort
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
update t1
-set c1=(select a.c3
-from t1 a
-where a.c3 = t1.c3)
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
order by c3 desc limit 2;
affected rows: 2
info: Rows matched: 2 Changed: 2 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ;
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
NULL 2
@@ -263,22 +634,61 @@ NULL 3
NULL 4
NULL 5
NULL 6
-2->7 7 *
-2->8 8 *
-rollback;
-Test with an index on updated columns
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#######################################
+# Test with an index #
+#######################################
create index t1_c2 on t1 (c2,c1);
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
#
-# Update a with value from subquery on the same table, no search clause. ALL access
+# Update with value from subquery on the same table
#
-start transaction;
-update t1
-set c1=(select a.c3
-from t1 a
-where a.c3 = t1.c3);
-affected rows: 8
-info: Rows matched: 8 Changed: 8 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
1->1 1
1->2 2 *
@@ -288,20 +698,56 @@ concat(old_c1,'->',c1) c3 Changed
2->6 6 *
2->7 7 *
2->8 8 *
-rollback;
+11->11 11
+11->12 12 *
+11->13 13 *
+12->14 14 *
+12->15 15 *
+12->16 16 *
+12->17 17 *
+12->18 18 *
+21->21 21
+21->22 22 *
+21->23 23 *
+22->24 24 *
+22->25 25 *
+22->26 26 *
+22->27 27 *
+22->28 28 *
+31->31 31
+31->32 32 *
+31->33 33 *
+32->34 34 *
+32->35 35 *
+32->36 36 *
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update with search clause on the same table
+# Update with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
#
-start transaction;
-update t1
-set c1=10
-where c1 <2
-and exists (select 'X'
- from t1 a
-where a.c1 = t1.c1);
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a index NULL t1_c2 10 NULL 32 Using where; Using index; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a index NULL t1_c2 10 NULL 32 Using where; Using index; FirstMatch(t1)
+update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
affected rows: 3
info: Rows matched: 3 Changed: 3 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ;
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
1->10 1 *
1->10 2 *
@@ -311,20 +757,53 @@ NULL 5
NULL 6
NULL 7
NULL 8
-rollback;
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update via RANGE or INDEX access if an index or a primary key exists
+# Update with EXISTS subquery over the updated table
+# in WHERE + non-sargable condition
#
-explain update t1 set c1=0 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 > 3;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 range t1_c2 t1_c2 5 NULL 2 Using where
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED a range t1_c2 t1_c2 5 NULL 2 Using where; Using index
-start transaction;
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1)
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1)
update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
-affected rows: 4
-info: Rows matched: 4 Changed: 4 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
NULL 2
@@ -334,13 +813,55 @@ NULL 5
2->12 6 *
2->12 7 *
2->12 8 *
-rollback;
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
#
# Update with order by
#
-start transaction;
-update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3 order by c2;
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1)
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1)
+update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
NULL 2
@@ -350,18 +871,54 @@ NULL 5
2->12 6 *
2->12 7 *
2->12 8 *
-rollback;
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
#
-Update using a view in subquery
+# Update with a reference to view in subquery
+# in settable value
#
-start transaction;
-update t1
-set c1=c1 +(select max(a.c2)
-from v1 a
-where a.c1 = t1.c1) ;
-affected rows: 8
-info: Rows matched: 8 Changed: 8 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 Using index
+update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
1->3 1 *
1->3 2 *
@@ -371,19 +928,53 @@ concat(old_c1,'->',c1) c3 Changed
2->4 6 *
2->4 7 *
2->4 8 *
-rollback;
+11->13 11 *
+11->13 12 *
+11->13 13 *
+12->14 14 *
+12->14 15 *
+12->14 16 *
+12->14 17 *
+12->14 18 *
+21->23 21 *
+21->23 22 *
+21->23 23 *
+22->24 24 *
+22->24 25 *
+22->24 26 *
+22->24 27 *
+22->24 28 *
+31->33 31 *
+31->33 32 *
+31->33 33 *
+32->34 34 *
+32->34 35 *
+32->34 36 *
+32->34 37 *
+32->34 38 *
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update throw a view
+# Update view
#
-start transaction;
-update v1
-set c1=c1 + (select max(a.c2)
-from t1 a
-where a.c1 = v1.c1) +10
-where c3 > 3;
-affected rows: 1
-info: Rows matched: 1 Changed: 1 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref t1_c2 t1_c2 5 const 8
+explain update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ref t1_c2 t1_c2 5 const 8 Using where
+2 DEPENDENT SUBQUERY a index NULL t1_c2 10 NULL 32 Using where; Using index
+update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+affected rows: 7
+info: Rows matched: 7 Changed: 7 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
NULL 2
@@ -393,20 +984,55 @@ NULL 4
NULL 6
NULL 7
NULL 8
-rollback;
+NULL 11
+11->24 12 *
+NULL 13
+NULL 14
+12->27 15 *
+NULL 16
+NULL 17
+NULL 18
+21->35 21 *
+NULL 22
+NULL 23
+22->38 24 *
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+31->45 31 *
+NULL 32
+NULL 33
+32->48 34 *
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update through a view and using the view in subquery
+# Update view with reference to the same view in subquery
#
-start transaction;
-update v1
-set c1=c1 + 1
-where c1 <2
-and exists (select 'X'
- from v1 a
-where a.c1 = v1.c1);
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 range t1_c2 t1_c2 10 NULL 1 Using index condition
+1 PRIMARY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 Using index; FirstMatch(t1)
+explain update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 range t1_c2 t1_c2 10 NULL 1 Using index condition; Using where
+2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,func 1 Using where; Using index
+update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
affected rows: 1
info: Rows matched: 1 Changed: 1 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
1->2 2 *
@@ -416,22 +1042,57 @@ NULL 5
NULL 6
NULL 7
NULL 8
-rollback;
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update through a view and using the view in subquery
+# Update view with EXISTS and reference to the same view in subquery
#
-start transaction;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1 where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 range t1_c2 t1_c2 10 NULL 2 Using index condition
+1 PRIMARY t1 ref t1_c2 t1_c2 5 const 8 Using index; FirstMatch(t1)
+explain update v1
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 range t1_c2 t1_c2 10 NULL 2 Using index condition
+3 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 5 const 8 Using where; Using index
+2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 Using index
update v1
-set c1=(select max(a.c1)+10
-from v1 a
-where a.c1 = v1.c1)
-where c1 <10
-and exists (select 'X'
- from v1 a
-where a.c2 = v1.c2);
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
affected rows: 2
info: Rows matched: 2 Changed: 2 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
1->11 2 *
@@ -441,41 +1102,107 @@ NULL 4
NULL 6
NULL 7
NULL 8
-rollback;
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update of the index or primary key (c3)
+# Update with IN predicand over the updated table in WHERE
#
-start transaction;
-explain update t1 set c3=c3+10 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 8 Using where
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
1 PRIMARY a ref t1_c2 t1_c2 10 test.t1.c2,test.t1.c1 1 Using index; FirstMatch(t1)
-update t1 set c3=c3+10 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
-affected rows: 8
-info: Rows matched: 8 Changed: 8 Warnings: 0
+explain update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a ref t1_c2 t1_c2 10 test.t1.c2,test.t1.c1 1 Using index; FirstMatch(t1)
+update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
select c3 from t1;
c3
-11
-12
-13
-14
-15
-16
-17
-18
-rollback;
-#
-# update with a limit
-#
-start transaction;
+111
+112
+113
+114
+115
+116
+117
+118
+121
+122
+123
+124
+125
+126
+127
+128
+131
+132
+133
+134
+135
+136
+137
+138
+141
+142
+143
+144
+145
+146
+147
+148
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a limit
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
update t1
-set c1=(select a.c3
-from t1 a
-where a.c3 = t1.c3)
-limit 2;
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
affected rows: 2
info: Rows matched: 2 Changed: 2 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ;
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
1->1 1
1->2 2 *
@@ -485,19 +1212,55 @@ NULL 5
NULL 6
NULL 7
NULL 8
-rollback;
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
#
-# update with a limit and an order by
+# Update with a limit and an order by
#
-start transaction;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using filesort
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using filesort
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
update t1
-set c1=(select a.c3
-from t1 a
-where a.c3 = t1.c3)
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
order by c3 desc limit 2;
affected rows: 2
info: Rows matched: 2 Changed: 2 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ;
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
NULL 2
@@ -505,22 +1268,1336 @@ NULL 3
NULL 4
NULL 5
NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#######################################
+# Test with a primary key #
+#######################################
+drop index t1_c2 on t1;
+alter table t1 add primary key (c3);
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+#
+# Update with value from subquery on the same table
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1
+update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->1 1
+1->2 2 *
+1->3 3 *
+2->4 4 *
+2->5 5 *
+2->6 6 *
2->7 7 *
2->8 8 *
-rollback;
-Test with an index on updated columns
-create index t1_c3 on t1 (c3);
+11->11 11
+11->12 12 *
+11->13 13 *
+12->14 14 *
+12->15 15 *
+12->16 16 *
+12->17 17 *
+12->18 18 *
+21->21 21
+21->22 22 *
+21->23 23 *
+22->24 24 *
+22->25 25 *
+22->26 26 *
+22->27 27 *
+22->28 28 *
+31->31 31
+31->32 32 *
+31->33 33 *
+32->34 34 *
+32->35 35 *
+32->36 36 *
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+affected rows: 3
+info: Rows matched: 3 Changed: 3 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->10 1 *
+1->10 2 *
+1->10 3 *
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with EXISTS subquery over the updated table
+# in WHERE + non-sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+1->11 3 *
+NULL 4
+NULL 5
+2->12 6 *
+2->12 7 *
+2->12 8 *
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+1->11 3 *
+NULL 4
+NULL 5
+2->12 6 *
+2->12 7 *
+2->12 8 *
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a reference to view in subquery
+# in settable value
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->3 1 *
+1->3 2 *
+1->3 3 *
+2->4 4 *
+2->4 5 *
+2->4 6 *
+2->4 7 *
+2->4 8 *
+11->13 11 *
+11->13 12 *
+11->13 13 *
+12->14 14 *
+12->14 15 *
+12->14 16 *
+12->14 17 *
+12->14 18 *
+21->23 21 *
+21->23 22 *
+21->23 23 *
+22->24 24 *
+22->24 25 *
+22->24 26 *
+22->24 27 *
+22->24 28 *
+31->33 31 *
+31->33 32 *
+31->33 33 *
+32->34 34 *
+32->34 35 *
+32->34 36 *
+32->34 37 *
+32->34 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using where
+explain update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 range PRIMARY PRIMARY 4 NULL 29 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+affected rows: 7
+info: Rows matched: 7 Changed: 7 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+NULL 3
+NULL 4
+2->17 5 *
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+11->24 12 *
+NULL 13
+NULL 14
+12->27 15 *
+NULL 16
+NULL 17
+NULL 18
+21->35 21 *
+NULL 22
+NULL 23
+22->38 24 *
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+31->45 31 *
+NULL 32
+NULL 33
+32->48 34 *
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view with reference to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+affected rows: 1
+info: Rows matched: 1 Changed: 1 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+1->2 2 *
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view with EXISTS and reference to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1 where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update v1
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+update v1
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+1->11 2 *
+NULL 3
+NULL 4
+2->12 5 *
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with IN predicand over the updated table in WHERE
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select c3 from t1;
+c3
+111
+112
+113
+114
+115
+116
+117
+118
+121
+122
+123
+124
+125
+126
+127
+128
+131
+132
+133
+134
+135
+136
+137
+138
+141
+142
+143
+144
+145
+146
+147
+148
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a limit
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1
+update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->1 1
+1->2 2 *
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update a with value from subquery on the same table, no search clause. ALL access
+# Update with a limit and an order by
#
-start transaction;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 2
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 index NULL PRIMARY 4 NULL 2 Using buffer
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1
update t1
-set c1=(select a.c3
-from t1 a
-where a.c3 = t1.c3);
-affected rows: 8
-info: Rows matched: 8 Changed: 8 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ;
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 2;
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+# Update with error "Subquery returns more than 1 row"
+update t1 set c2=(select c2 from t1);
+ERROR 21000: Subquery returns more than 1 row
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+# Update with error "Subquery returns more than 1 row"
+# and order by
+update t1 set c2=(select c2 from t1) order by c3;
+ERROR 21000: Subquery returns more than 1 row
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+# Duplicate value on update a primary key
+update t1 set c3=0
+where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+# Duplicate value on update a primary key with ignore
+update ignore t1 set c3=0
+where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 0
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+# Duplicate value on update a primary key and limit
+update t1 set c3=0
+where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 limit 2;
+ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+# Duplicate value on update a primary key with ignore
+# and limit
+update ignore t1 set c3=0
+where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 limit 2;
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 0
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+# Update no rows found
+update t1 set c1=10
+where c1 <2 and exists (select 'X' from t1 a where a.c1 = t1.c1 + 10);
+affected rows: 3
+info: Rows matched: 3 Changed: 3 Warnings: 0
+select c1,c2,c3 from t1;
+c1 c2 c3
+10 1 1
+10 2 2
+10 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+# Update no rows changed
+drop trigger trg_t1;
+update t1 set c1=c1
+where c1 <2 and exists (select 'X' from t1 a where a.c1 = t1.c1);
+affected rows: 0
+info: Rows matched: 3 Changed: 0 Warnings: 0
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Check call of after trigger
+#
+create or replace trigger trg_t2 after update on t1 for each row
+begin
+declare msg varchar(100);
+if (new.c3 = 5) then
+set msg=concat('in after update trigger on ',new.c3);
+SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = msg;
+end if;
+end;
+/
+update t1 set c1=2
+where c3 in (select distinct a.c3 from t1 a where a.c1=t1.c1);
+ERROR 45000: in after update trigger on 5
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Check update with order by and after trigger
+#
+update t1 set c1=2
+where c3 in (select distinct a.c3 from t1 a where a.c1=t1.c1)
+order by t1.c2, t1.c1;
+ERROR 45000: in after update trigger on 5
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+drop view v1;
+#
+# Check update on view with check option
+#
+create view v1 as select * from t1 where c2=2 with check option;
+update v1 set c2=3 where c1=1;
+ERROR 44000: CHECK OPTION failed `test`.`v1`
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+update v1 set c2=(select max(c3) from v1) where c1=1;
+ERROR 44000: CHECK OPTION failed `test`.`v1`
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+update v1 set c2=(select min(va.c3) from v1 va), c1=0 where c1=1;
+select c1,c2,c3 from t1;
+c1 c2 c3
+0 2 2
+1 1 1
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+drop table tmp;
+drop view v1;
+drop table t1;
+#
+# Test on dynamic columns (blob)
+#
+create table assets (
+item_name varchar(32) primary key, -- A common attribute for all items
+dynamic_cols blob -- Dynamic columns will be stored here
+);
+INSERT INTO assets VALUES ('MariaDB T-shirt',
+COLUMN_CREATE('color', 'blue', 'size', 'XL'));
+INSERT INTO assets VALUES ('Thinkpad Laptop',
+COLUMN_CREATE('color', 'black', 'price', 500));
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+FROM assets;
+item_name color
+MariaDB T-shirt blue
+Thinkpad Laptop black
+UPDATE assets
+SET dynamic_cols=COLUMN_ADD(dynamic_cols, 'warranty', '3 years')
+WHERE item_name='Thinkpad Laptop';
+SELECT item_name,
+COLUMN_GET(dynamic_cols, 'warranty' as char) AS color
+FROM assets;
+item_name color
+MariaDB T-shirt NULL
+Thinkpad Laptop 3 years
+UPDATE assets
+SET dynamic_cols=COLUMN_ADD(dynamic_cols, 'warranty', '4 years')
+WHERE item_name in
+(select b.item_name from assets b
+where COLUMN_GET(b.dynamic_cols, 'color' as char) ='black');
+SELECT item_name,
+COLUMN_GET(dynamic_cols, 'warranty' as char) AS color
+FROM assets;
+item_name color
+MariaDB T-shirt NULL
+Thinkpad Laptop 4 years
+UPDATE assets SET dynamic_cols=COLUMN_ADD(dynamic_cols, 'warranty',
+(select COLUMN_GET(b.dynamic_cols, 'color' as char)
+from assets b
+where assets.item_name = item_name));
+SELECT item_name,
+COLUMN_GET(dynamic_cols, 'warranty' as char) AS color
+FROM assets;
+item_name color
+MariaDB T-shirt blue
+Thinkpad Laptop black
+drop table assets;
+#
+# Test on fulltext columns
+#
+CREATE TABLE ft2(copy TEXT,FULLTEXT(copy));
+INSERT INTO ft2(copy) VALUES
+('MySQL vs MariaDB database'),
+('Oracle vs MariaDB database'),
+('PostgreSQL vs MariaDB database'),
+('MariaDB overview'),
+('Foreign keys'),
+('Primary keys'),
+('Indexes'),
+('Transactions'),
+('Triggers');
+SELECT * FROM ft2 WHERE MATCH(copy) AGAINST('database');
+copy
+MySQL vs MariaDB database
+Oracle vs MariaDB database
+PostgreSQL vs MariaDB database
+update ft2 set copy = (select max(concat('mykeyword ',substr(b.copy,1,5)))
+from ft2 b WHERE MATCH(b.copy) AGAINST('database'))
+where MATCH(copy) AGAINST('keys');
+SELECT * FROM ft2 WHERE MATCH(copy) AGAINST('mykeyword');
+copy
+mykeyword Postg
+mykeyword Postg
+drop table ft2;
+#######################################
+# #
+# Engine Aria #
+# #
+#######################################
+set default_storage_engine=Aria;
+create table t1 (old_c1 integer,
+old_c2 integer,
+c1 integer,
+c2 integer,
+c3 integer);
+create view v1 as select * from t1 where c2=2;
+create trigger trg_t1 before update on t1 for each row
+begin
+set new.old_c1=old.c1;
+set new.old_c2=old.c2;
+end;
+/
+insert into t1(c1,c2,c3)
+values (1,1,1), (1,2,2), (1,3,3),
+(2,1,4), (2,2,5), (2,3,6),
+(2,4,7), (2,5,8);
+insert into t1 select NULL, NULL, c1+10,c2,c3+10 from t1;
+insert into t1 select NULL, NULL, c1+20,c2+1,c3+20 from t1;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1;
+#######################################
+# Test without any index #
+#######################################
+#
+# Update with value from subquery on the same table
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
1->1 1
1->2 2 *
@@ -530,20 +2607,56 @@ concat(old_c1,'->',c1) c3 Changed
2->6 6 *
2->7 7 *
2->8 8 *
-rollback;
+11->11 11
+11->12 12 *
+11->13 13 *
+12->14 14 *
+12->15 15 *
+12->16 16 *
+12->17 17 *
+12->18 18 *
+21->21 21
+21->22 22 *
+21->23 23 *
+22->24 24 *
+22->25 25 *
+22->26 26 *
+22->27 27 *
+22->28 28 *
+31->31 31
+31->32 32 *
+31->33 33 *
+32->34 34 *
+32->35 35 *
+32->36 36 *
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update with search clause on the same table
+# Update with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
#
-start transaction;
-update t1
-set c1=10
-where c1 <2
-and exists (select 'X'
- from t1 a
-where a.c1 = t1.c1);
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
affected rows: 3
info: Rows matched: 3 Changed: 3 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ;
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
1->10 1 *
1->10 2 *
@@ -553,20 +2666,55 @@ NULL 5
NULL 6
NULL 7
NULL 8
-rollback;
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update via RANGE or INDEX access if an index or a primary key exists
+# Update with EXISTS subquery over the updated table
+# in WHERE + non-sargable condition
#
-explain update t1 set c1=0 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 > 3;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 range t1_c2 t1_c2 5 NULL 2 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED a range t1_c2 t1_c2 5 NULL 2 Using where; Using index
-start transaction;
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
-affected rows: 4
-info: Rows matched: 4 Changed: 4 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
NULL 2
@@ -576,13 +2724,57 @@ NULL 5
2->12 6 *
2->12 7 *
2->12 8 *
-rollback;
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
#
# Update with order by
#
-start transaction;
-update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3 order by c2;
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
NULL 2
@@ -592,18 +2784,54 @@ NULL 5
2->12 6 *
2->12 7 *
2->12 8 *
-rollback;
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
#
-Update using a view in subquery
+# Update with a reference to view in subquery
+# in settable value
#
-start transaction;
-update t1
-set c1=c1 +(select max(a.c2)
-from v1 a
-where a.c1 = t1.c1) ;
-affected rows: 8
-info: Rows matched: 8 Changed: 8 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
1->3 1 *
1->3 2 *
@@ -613,19 +2841,687 @@ concat(old_c1,'->',c1) c3 Changed
2->4 6 *
2->4 7 *
2->4 8 *
-rollback;
+11->13 11 *
+11->13 12 *
+11->13 13 *
+12->14 14 *
+12->14 15 *
+12->14 16 *
+12->14 17 *
+12->14 18 *
+21->23 21 *
+21->23 22 *
+21->23 23 *
+22->24 24 *
+22->24 25 *
+22->24 26 *
+22->24 27 *
+22->24 28 *
+31->33 31 *
+31->33 32 *
+31->33 33 *
+32->34 34 *
+32->34 35 *
+32->34 36 *
+32->34 37 *
+32->34 38 *
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update throw a view
+# Update view
#
-start transaction;
-update v1
-set c1=c1 + (select max(a.c2)
-from t1 a
-where a.c1 = v1.c1) +10
-where c3 > 3;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using where
+explain update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+affected rows: 7
+info: Rows matched: 7 Changed: 7 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+NULL 3
+NULL 4
+2->17 5 *
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+11->24 12 *
+NULL 13
+NULL 14
+12->27 15 *
+NULL 16
+NULL 17
+NULL 18
+21->35 21 *
+NULL 22
+NULL 23
+22->38 24 *
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+31->45 31 *
+NULL 32
+NULL 33
+32->48 34 *
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view with reference to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
affected rows: 1
info: Rows matched: 1 Changed: 1 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+1->2 2 *
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view with EXISTS and reference to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1 where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update v1
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+update v1
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+1->11 2 *
+NULL 3
+NULL 4
+2->12 5 *
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with IN predicand over the updated table in WHERE
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select c3 from t1;
+c3
+111
+112
+113
+114
+115
+116
+117
+118
+121
+122
+123
+124
+125
+126
+127
+128
+131
+132
+133
+134
+135
+136
+137
+138
+141
+142
+143
+144
+145
+146
+147
+148
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a limit
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->1 1
+1->2 2 *
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a limit and an order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using filesort
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using filesort
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 2;
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#######################################
+# Test with an index #
+#######################################
+create index t1_c2 on t1 (c2,c1);
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+#
+# Update with value from subquery on the same table
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->1 1
+1->2 2 *
+1->3 3 *
+2->4 4 *
+2->5 5 *
+2->6 6 *
+2->7 7 *
+2->8 8 *
+11->11 11
+11->12 12 *
+11->13 13 *
+12->14 14 *
+12->15 15 *
+12->16 16 *
+12->17 17 *
+12->18 18 *
+21->21 21
+21->22 22 *
+21->23 23 *
+22->24 24 *
+22->25 25 *
+22->26 26 *
+22->27 27 *
+22->28 28 *
+31->31 31
+31->32 32 *
+31->33 33 *
+32->34 34 *
+32->35 35 *
+32->36 36 *
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a index NULL t1_c2 10 NULL 32 Using where; Using index; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a index NULL t1_c2 10 NULL 32 Using where; Using index; FirstMatch(t1)
+update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+affected rows: 3
+info: Rows matched: 3 Changed: 3 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->10 1 *
+1->10 2 *
+1->10 3 *
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with EXISTS subquery over the updated table
+# in WHERE + non-sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 range t1_c2 t1_c2 5 NULL 21 Using index condition
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1)
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 range t1_c2 t1_c2 5 NULL 21 Using index condition
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1)
+update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+1->11 3 *
+NULL 4
+NULL 5
+2->12 6 *
+2->12 7 *
+2->12 8 *
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 range t1_c2 t1_c2 5 NULL 21 Using index condition
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1)
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 range t1_c2 t1_c2 5 NULL 21 Using index condition
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1)
+update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+1->11 3 *
+NULL 4
+NULL 5
+2->12 6 *
+2->12 7 *
+2->12 8 *
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a reference to view in subquery
+# in settable value
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 Using index
+update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->3 1 *
+1->3 2 *
+1->3 3 *
+2->4 4 *
+2->4 5 *
+2->4 6 *
+2->4 7 *
+2->4 8 *
+11->13 11 *
+11->13 12 *
+11->13 13 *
+12->14 14 *
+12->14 15 *
+12->14 16 *
+12->14 17 *
+12->14 18 *
+21->23 21 *
+21->23 22 *
+21->23 23 *
+22->24 24 *
+22->24 25 *
+22->24 26 *
+22->24 27 *
+22->24 28 *
+31->33 31 *
+31->33 32 *
+31->33 33 *
+32->34 34 *
+32->34 35 *
+32->34 36 *
+32->34 37 *
+32->34 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref t1_c2 t1_c2 5 const 8
+explain update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ref t1_c2 t1_c2 5 const 8 Using where
+2 DEPENDENT SUBQUERY a index NULL t1_c2 10 NULL 32 Using where; Using index
+update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+affected rows: 7
+info: Rows matched: 7 Changed: 7 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
NULL 2
@@ -635,20 +3531,55 @@ NULL 4
NULL 6
NULL 7
NULL 8
-rollback;
+NULL 11
+11->24 12 *
+NULL 13
+NULL 14
+12->27 15 *
+NULL 16
+NULL 17
+NULL 18
+21->35 21 *
+NULL 22
+NULL 23
+22->38 24 *
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+31->45 31 *
+NULL 32
+NULL 33
+32->48 34 *
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update through a view and using the view in subquery
+# Update view with reference to the same view in subquery
#
-start transaction;
-update v1
-set c1=c1 + 1
-where c1 <2
-and exists (select 'X'
- from v1 a
-where a.c1 = v1.c1);
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 range t1_c2 t1_c2 10 NULL 1 Using index condition
+1 PRIMARY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 Using index; FirstMatch(t1)
+explain update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 range t1_c2 t1_c2 10 NULL 1 Using index condition; Using where
+2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,func 1 Using where; Using index
+update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
affected rows: 1
info: Rows matched: 1 Changed: 1 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
1->2 2 *
@@ -658,22 +3589,57 @@ NULL 5
NULL 6
NULL 7
NULL 8
-rollback;
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update through a view and using the view in subquery
+# Update view with EXISTS and reference to the same view in subquery
#
-start transaction;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1 where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 range t1_c2 t1_c2 10 NULL 2 Using index condition
+1 PRIMARY t1 ref t1_c2 t1_c2 5 const 8 Using index; FirstMatch(t1)
+explain update v1
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 range t1_c2 t1_c2 10 NULL 2 Using index condition
+3 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 5 const 8 Using where; Using index
+2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 Using index
update v1
-set c1=(select max(a.c1)+10
-from v1 a
-where a.c1 = v1.c1)
-where c1 <10
-and exists (select 'X'
- from v1 a
-where a.c2 = v1.c2);
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
affected rows: 2
info: Rows matched: 2 Changed: 2 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
1->11 2 *
@@ -683,41 +3649,107 @@ NULL 4
NULL 6
NULL 7
NULL 8
-rollback;
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update of the index or primary key (c3)
+# Update with IN predicand over the updated table in WHERE
#
-start transaction;
-explain update t1 set c3=c3+10 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 8 Using where
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
1 PRIMARY a ref t1_c2 t1_c2 10 test.t1.c2,test.t1.c1 1 Using index; FirstMatch(t1)
-update t1 set c3=c3+10 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
-affected rows: 8
-info: Rows matched: 8 Changed: 8 Warnings: 0
+explain update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a ref t1_c2 t1_c2 10 test.t1.c2,test.t1.c1 1 Using index; FirstMatch(t1)
+update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
select c3 from t1;
c3
-11
-12
-13
-14
-15
-16
-17
-18
-rollback;
-#
-# update with a limit
-#
-start transaction;
+111
+112
+113
+114
+115
+116
+117
+118
+121
+122
+123
+124
+125
+126
+127
+128
+131
+132
+133
+134
+135
+136
+137
+138
+141
+142
+143
+144
+145
+146
+147
+148
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a limit
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
update t1
-set c1=(select a.c3
-from t1 a
-where a.c3 = t1.c3)
-limit 2;
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
affected rows: 2
info: Rows matched: 2 Changed: 2 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ;
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
1->1 1
1->2 2 *
@@ -727,19 +3759,55 @@ NULL 5
NULL 6
NULL 7
NULL 8
-rollback;
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
#
-# update with a limit and an order by
+# Update with a limit and an order by
#
-start transaction;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using filesort
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using filesort
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
update t1
-set c1=(select a.c3
-from t1 a
-where a.c3 = t1.c3)
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
order by c3 desc limit 2;
affected rows: 2
info: Rows matched: 2 Changed: 2 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ;
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
NULL 2
@@ -747,23 +3815,1336 @@ NULL 3
NULL 4
NULL 5
NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#######################################
+# Test with a primary key #
+#######################################
+drop index t1_c2 on t1;
+alter table t1 add primary key (c3);
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+#
+# Update with value from subquery on the same table
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1 Using index
+update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->1 1
+1->2 2 *
+1->3 3 *
+2->4 4 *
+2->5 5 *
+2->6 6 *
2->7 7 *
2->8 8 *
-rollback;
-Test with a primary key on updated columns
-drop index t1_c3 on t1;
-alter table t1 add primary key (c3);
+11->11 11
+11->12 12 *
+11->13 13 *
+12->14 14 *
+12->15 15 *
+12->16 16 *
+12->17 17 *
+12->18 18 *
+21->21 21
+21->22 22 *
+21->23 23 *
+22->24 24 *
+22->25 25 *
+22->26 26 *
+22->27 27 *
+22->28 28 *
+31->31 31
+31->32 32 *
+31->33 33 *
+32->34 34 *
+32->35 35 *
+32->36 36 *
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+affected rows: 3
+info: Rows matched: 3 Changed: 3 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->10 1 *
+1->10 2 *
+1->10 3 *
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with EXISTS subquery over the updated table
+# in WHERE + non-sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+1->11 3 *
+NULL 4
+NULL 5
+2->12 6 *
+2->12 7 *
+2->12 8 *
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+1->11 3 *
+NULL 4
+NULL 5
+2->12 6 *
+2->12 7 *
+2->12 8 *
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a reference to view in subquery
+# in settable value
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->3 1 *
+1->3 2 *
+1->3 3 *
+2->4 4 *
+2->4 5 *
+2->4 6 *
+2->4 7 *
+2->4 8 *
+11->13 11 *
+11->13 12 *
+11->13 13 *
+12->14 14 *
+12->14 15 *
+12->14 16 *
+12->14 17 *
+12->14 18 *
+21->23 21 *
+21->23 22 *
+21->23 23 *
+22->24 24 *
+22->24 25 *
+22->24 26 *
+22->24 27 *
+22->24 28 *
+31->33 31 *
+31->33 32 *
+31->33 33 *
+32->34 34 *
+32->34 35 *
+32->34 36 *
+32->34 37 *
+32->34 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using where
+explain update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 range PRIMARY PRIMARY 4 NULL 30 Using index condition; Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+affected rows: 7
+info: Rows matched: 7 Changed: 7 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+NULL 3
+NULL 4
+2->17 5 *
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+11->24 12 *
+NULL 13
+NULL 14
+12->27 15 *
+NULL 16
+NULL 17
+NULL 18
+21->35 21 *
+NULL 22
+NULL 23
+22->38 24 *
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+31->45 31 *
+NULL 32
+NULL 33
+32->48 34 *
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view with reference to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+affected rows: 1
+info: Rows matched: 1 Changed: 1 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+1->2 2 *
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view with EXISTS and reference to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1 where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update v1
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+update v1
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+1->11 2 *
+NULL 3
+NULL 4
+2->12 5 *
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update a with value from subquery on the same table, no search clause. ALL access
+# Update with IN predicand over the updated table in WHERE
#
-start transaction;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select c3 from t1;
+c3
+111
+112
+113
+114
+115
+116
+117
+118
+121
+122
+123
+124
+125
+126
+127
+128
+131
+132
+133
+134
+135
+136
+137
+138
+141
+142
+143
+144
+145
+146
+147
+148
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a limit
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1 Using index
update t1
-set c1=(select a.c3
-from t1 a
-where a.c3 = t1.c3);
-affected rows: 8
-info: Rows matched: 8 Changed: 8 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ;
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->1 1
+1->2 2 *
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a limit and an order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 2
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 index NULL PRIMARY 4 NULL 2 Using buffer
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1 Using index
+update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 2;
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+# Update with error "Subquery returns more than 1 row"
+update t1 set c2=(select c2 from t1);
+ERROR 21000: Subquery returns more than 1 row
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+# Update with error "Subquery returns more than 1 row"
+# and order by
+update t1 set c2=(select c2 from t1) order by c3;
+ERROR 21000: Subquery returns more than 1 row
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+# Duplicate value on update a primary key
+update t1 set c3=0
+where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 0
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+# Duplicate value on update a primary key with ignore
+update ignore t1 set c3=0
+where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 0
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+# Duplicate value on update a primary key and limit
+update t1 set c3=0
+where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 limit 2;
+ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 0
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+# Duplicate value on update a primary key with ignore
+# and limit
+update ignore t1 set c3=0
+where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 limit 2;
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 0
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+# Update no rows found
+update t1 set c1=10
+where c1 <2 and exists (select 'X' from t1 a where a.c1 = t1.c1 + 10);
+affected rows: 3
+info: Rows matched: 3 Changed: 3 Warnings: 0
+select c1,c2,c3 from t1;
+c1 c2 c3
+10 1 1
+10 2 2
+10 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+# Update no rows changed
+drop trigger trg_t1;
+update t1 set c1=c1
+where c1 <2 and exists (select 'X' from t1 a where a.c1 = t1.c1);
+affected rows: 0
+info: Rows matched: 3 Changed: 0 Warnings: 0
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Check call of after trigger
+#
+create or replace trigger trg_t2 after update on t1 for each row
+begin
+declare msg varchar(100);
+if (new.c3 = 5) then
+set msg=concat('in after update trigger on ',new.c3);
+SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = msg;
+end if;
+end;
+/
+update t1 set c1=2
+where c3 in (select distinct a.c3 from t1 a where a.c1=t1.c1);
+ERROR 45000: in after update trigger on 5
+select c1,c2,c3 from t1;
+c1 c2 c3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 1
+2 1 4
+2 2 2
+2 2 5
+2 3 3
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Check update with order by and after trigger
+#
+update t1 set c1=2
+where c3 in (select distinct a.c3 from t1 a where a.c1=t1.c1)
+order by t1.c2, t1.c1;
+ERROR 45000: in after update trigger on 5
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 3 3
+11 2 12
+11 3 13
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 1
+2 1 11
+2 1 14
+2 1 4
+2 2 2
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+drop view v1;
+#
+# Check update on view with check option
+#
+create view v1 as select * from t1 where c2=2 with check option;
+update v1 set c2=3 where c1=1;
+ERROR 44000: CHECK OPTION failed `test`.`v1`
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+update v1 set c2=(select max(c3) from v1) where c1=1;
+ERROR 44000: CHECK OPTION failed `test`.`v1`
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+update v1 set c2=(select min(va.c3) from v1 va), c1=0 where c1=1;
+select c1,c2,c3 from t1;
+c1 c2 c3
+0 2 2
+1 1 1
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+drop table tmp;
+drop view v1;
+drop table t1;
+#
+# Test on dynamic columns (blob)
+#
+create table assets (
+item_name varchar(32) primary key, -- A common attribute for all items
+dynamic_cols blob -- Dynamic columns will be stored here
+);
+INSERT INTO assets VALUES ('MariaDB T-shirt',
+COLUMN_CREATE('color', 'blue', 'size', 'XL'));
+INSERT INTO assets VALUES ('Thinkpad Laptop',
+COLUMN_CREATE('color', 'black', 'price', 500));
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+FROM assets;
+item_name color
+MariaDB T-shirt blue
+Thinkpad Laptop black
+UPDATE assets
+SET dynamic_cols=COLUMN_ADD(dynamic_cols, 'warranty', '3 years')
+WHERE item_name='Thinkpad Laptop';
+SELECT item_name,
+COLUMN_GET(dynamic_cols, 'warranty' as char) AS color
+FROM assets;
+item_name color
+MariaDB T-shirt NULL
+Thinkpad Laptop 3 years
+UPDATE assets
+SET dynamic_cols=COLUMN_ADD(dynamic_cols, 'warranty', '4 years')
+WHERE item_name in
+(select b.item_name from assets b
+where COLUMN_GET(b.dynamic_cols, 'color' as char) ='black');
+SELECT item_name,
+COLUMN_GET(dynamic_cols, 'warranty' as char) AS color
+FROM assets;
+item_name color
+MariaDB T-shirt NULL
+Thinkpad Laptop 4 years
+UPDATE assets SET dynamic_cols=COLUMN_ADD(dynamic_cols, 'warranty',
+(select COLUMN_GET(b.dynamic_cols, 'color' as char)
+from assets b
+where assets.item_name = item_name));
+SELECT item_name,
+COLUMN_GET(dynamic_cols, 'warranty' as char) AS color
+FROM assets;
+item_name color
+MariaDB T-shirt blue
+Thinkpad Laptop black
+drop table assets;
+#
+# Test on fulltext columns
+#
+CREATE TABLE ft2(copy TEXT,FULLTEXT(copy));
+INSERT INTO ft2(copy) VALUES
+('MySQL vs MariaDB database'),
+('Oracle vs MariaDB database'),
+('PostgreSQL vs MariaDB database'),
+('MariaDB overview'),
+('Foreign keys'),
+('Primary keys'),
+('Indexes'),
+('Transactions'),
+('Triggers');
+SELECT * FROM ft2 WHERE MATCH(copy) AGAINST('database');
+copy
+MySQL vs MariaDB database
+Oracle vs MariaDB database
+PostgreSQL vs MariaDB database
+update ft2 set copy = (select max(concat('mykeyword ',substr(b.copy,1,5)))
+from ft2 b WHERE MATCH(b.copy) AGAINST('database'))
+where MATCH(copy) AGAINST('keys');
+SELECT * FROM ft2 WHERE MATCH(copy) AGAINST('mykeyword');
+copy
+mykeyword Postg
+mykeyword Postg
+drop table ft2;
+#######################################
+# #
+# Engine MyISAM #
+# #
+#######################################
+set default_storage_engine=MyISAM;
+create table t1 (old_c1 integer,
+old_c2 integer,
+c1 integer,
+c2 integer,
+c3 integer);
+create view v1 as select * from t1 where c2=2;
+create trigger trg_t1 before update on t1 for each row
+begin
+set new.old_c1=old.c1;
+set new.old_c2=old.c2;
+end;
+/
+insert into t1(c1,c2,c3)
+values (1,1,1), (1,2,2), (1,3,3),
+(2,1,4), (2,2,5), (2,3,6),
+(2,4,7), (2,5,8);
+insert into t1 select NULL, NULL, c1+10,c2,c3+10 from t1;
+insert into t1 select NULL, NULL, c1+20,c2+1,c3+20 from t1;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+create table tmp as select * from t1;
+#######################################
+# Test without any index #
+#######################################
+#
+# Update with value from subquery on the same table
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
1->1 1
1->2 2 *
@@ -773,20 +5154,56 @@ concat(old_c1,'->',c1) c3 Changed
2->6 6 *
2->7 7 *
2->8 8 *
-rollback;
+11->11 11
+11->12 12 *
+11->13 13 *
+12->14 14 *
+12->15 15 *
+12->16 16 *
+12->17 17 *
+12->18 18 *
+21->21 21
+21->22 22 *
+21->23 23 *
+22->24 24 *
+22->25 25 *
+22->26 26 *
+22->27 27 *
+22->28 28 *
+31->31 31
+31->32 32 *
+31->33 33 *
+32->34 34 *
+32->35 35 *
+32->36 36 *
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update with search clause on the same table
+# Update with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
#
-start transaction;
-update t1
-set c1=10
-where c1 <2
-and exists (select 'X'
- from t1 a
-where a.c1 = t1.c1);
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
affected rows: 3
info: Rows matched: 3 Changed: 3 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ;
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
1->10 1 *
1->10 2 *
@@ -796,20 +5213,55 @@ NULL 5
NULL 6
NULL 7
NULL 8
-rollback;
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update via RANGE or INDEX access if an index or a primary key exists
+# Update with EXISTS subquery over the updated table
+# in WHERE + non-sargable condition
#
-explain update t1 set c1=0 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 > 3;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 range t1_c2 t1_c2 5 NULL 2 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED a range t1_c2 t1_c2 5 NULL 2 Using where; Using index
-start transaction;
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
-affected rows: 4
-info: Rows matched: 4 Changed: 4 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
NULL 2
@@ -819,13 +5271,57 @@ NULL 5
2->12 6 *
2->12 7 *
2->12 8 *
-rollback;
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
#
# Update with order by
#
-start transaction;
-update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3 order by c2;
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
NULL 2
@@ -835,18 +5331,54 @@ NULL 5
2->12 6 *
2->12 7 *
2->12 8 *
-rollback;
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
#
-Update using a view in subquery
+# Update with a reference to view in subquery
+# in settable value
#
-start transaction;
-update t1
-set c1=c1 +(select max(a.c2)
-from v1 a
-where a.c1 = t1.c1) ;
-affected rows: 8
-info: Rows matched: 8 Changed: 8 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
1->3 1 *
1->3 2 *
@@ -856,19 +5388,687 @@ concat(old_c1,'->',c1) c3 Changed
2->4 6 *
2->4 7 *
2->4 8 *
-rollback;
+11->13 11 *
+11->13 12 *
+11->13 13 *
+12->14 14 *
+12->14 15 *
+12->14 16 *
+12->14 17 *
+12->14 18 *
+21->23 21 *
+21->23 22 *
+21->23 23 *
+22->24 24 *
+22->24 25 *
+22->24 26 *
+22->24 27 *
+22->24 28 *
+31->33 31 *
+31->33 32 *
+31->33 33 *
+32->34 34 *
+32->34 35 *
+32->34 36 *
+32->34 37 *
+32->34 38 *
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update throw a view
+# Update view
#
-start transaction;
-update v1
-set c1=c1 + (select max(a.c2)
-from t1 a
-where a.c1 = v1.c1) +10
-where c3 > 3;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using where
+explain update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+affected rows: 7
+info: Rows matched: 7 Changed: 7 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+NULL 3
+NULL 4
+2->17 5 *
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+11->24 12 *
+NULL 13
+NULL 14
+12->27 15 *
+NULL 16
+NULL 17
+NULL 18
+21->35 21 *
+NULL 22
+NULL 23
+22->38 24 *
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+31->45 31 *
+NULL 32
+NULL 33
+32->48 34 *
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view with reference to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
affected rows: 1
info: Rows matched: 1 Changed: 1 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+1->2 2 *
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view with EXISTS and reference to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1 where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update v1
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+update v1
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+1->11 2 *
+NULL 3
+NULL 4
+2->12 5 *
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with IN predicand over the updated table in WHERE
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select c3 from t1;
+c3
+111
+112
+113
+114
+115
+116
+117
+118
+121
+122
+123
+124
+125
+126
+127
+128
+131
+132
+133
+134
+135
+136
+137
+138
+141
+142
+143
+144
+145
+146
+147
+148
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a limit
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->1 1
+1->2 2 *
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a limit and an order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using filesort
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using filesort
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 2;
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#######################################
+# Test with an index #
+#######################################
+create index t1_c2 on t1 (c2,c1);
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+#
+# Update with value from subquery on the same table
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->1 1
+1->2 2 *
+1->3 3 *
+2->4 4 *
+2->5 5 *
+2->6 6 *
+2->7 7 *
+2->8 8 *
+11->11 11
+11->12 12 *
+11->13 13 *
+12->14 14 *
+12->15 15 *
+12->16 16 *
+12->17 17 *
+12->18 18 *
+21->21 21
+21->22 22 *
+21->23 23 *
+22->24 24 *
+22->25 25 *
+22->26 26 *
+22->27 27 *
+22->28 28 *
+31->31 31
+31->32 32 *
+31->33 33 *
+32->34 34 *
+32->35 35 *
+32->36 36 *
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a index NULL t1_c2 10 NULL 32 Using where; Using index; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a index NULL t1_c2 10 NULL 32 Using where; Using index; FirstMatch(t1)
+update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+affected rows: 3
+info: Rows matched: 3 Changed: 3 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->10 1 *
+1->10 2 *
+1->10 3 *
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with EXISTS subquery over the updated table
+# in WHERE + non-sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1)
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1)
+update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+1->11 3 *
+NULL 4
+NULL 5
+2->12 6 *
+2->12 7 *
+2->12 8 *
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1)
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY a ref t1_c2 t1_c2 5 test.t1.c2 5 Using index; FirstMatch(t1)
+update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+1->11 3 *
+NULL 4
+NULL 5
+2->12 6 *
+2->12 7 *
+2->12 8 *
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a reference to view in subquery
+# in settable value
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 Using index
+update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->3 1 *
+1->3 2 *
+1->3 3 *
+2->4 4 *
+2->4 5 *
+2->4 6 *
+2->4 7 *
+2->4 8 *
+11->13 11 *
+11->13 12 *
+11->13 13 *
+12->14 14 *
+12->14 15 *
+12->14 16 *
+12->14 17 *
+12->14 18 *
+21->23 21 *
+21->23 22 *
+21->23 23 *
+22->24 24 *
+22->24 25 *
+22->24 26 *
+22->24 27 *
+22->24 28 *
+31->33 31 *
+31->33 32 *
+31->33 33 *
+32->34 34 *
+32->34 35 *
+32->34 36 *
+32->34 37 *
+32->34 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ref t1_c2 t1_c2 5 const 8
+explain update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ref t1_c2 t1_c2 5 const 8 Using where
+2 DEPENDENT SUBQUERY a index NULL t1_c2 10 NULL 32 Using where; Using index
+update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+affected rows: 7
+info: Rows matched: 7 Changed: 7 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
NULL 2
@@ -878,20 +6078,55 @@ NULL 4
NULL 6
NULL 7
NULL 8
-rollback;
+NULL 11
+11->24 12 *
+NULL 13
+NULL 14
+12->27 15 *
+NULL 16
+NULL 17
+NULL 18
+21->35 21 *
+NULL 22
+NULL 23
+22->38 24 *
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+31->45 31 *
+NULL 32
+NULL 33
+32->48 34 *
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update through a view and using the view in subquery
+# Update view with reference to the same view in subquery
#
-start transaction;
-update v1
-set c1=c1 + 1
-where c1 <2
-and exists (select 'X'
- from v1 a
-where a.c1 = v1.c1);
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 range t1_c2 t1_c2 10 NULL 1 Using index condition
+1 PRIMARY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 Using index; FirstMatch(t1)
+explain update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 range t1_c2 t1_c2 10 NULL 1 Using index condition; Using where
+2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,func 1 Using where; Using index
+update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
affected rows: 1
info: Rows matched: 1 Changed: 1 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
1->2 2 *
@@ -901,22 +6136,57 @@ NULL 5
NULL 6
NULL 7
NULL 8
-rollback;
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update through a view and using the view in subquery
+# Update view with EXISTS and reference to the same view in subquery
#
-start transaction;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1 where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 range t1_c2 t1_c2 10 NULL 2 Using index condition
+1 PRIMARY t1 ref t1_c2 t1_c2 5 const 8 Using index; FirstMatch(t1)
+explain update v1
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 range t1_c2 t1_c2 10 NULL 2 Using index condition
+3 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 5 const 8 Using where; Using index
+2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 1 Using index
update v1
-set c1=(select max(a.c1)+10
-from v1 a
-where a.c1 = v1.c1)
-where c1 <10
-and exists (select 'X'
- from v1 a
-where a.c2 = v1.c2);
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
affected rows: 2
info: Rows matched: 2 Changed: 2 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
1->11 2 *
@@ -926,41 +6196,107 @@ NULL 4
NULL 6
NULL 7
NULL 8
-rollback;
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
#
-# Update of the index or primary key (c3)
+# Update with IN predicand over the updated table in WHERE
#
-start transaction;
-explain update t1 set c3=c3+10 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a ref t1_c2 t1_c2 10 test.t1.c2,test.t1.c1 1 Using index; FirstMatch(t1)
+explain update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 8 Using where
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
1 PRIMARY a ref t1_c2 t1_c2 10 test.t1.c2,test.t1.c1 1 Using index; FirstMatch(t1)
-update t1 set c3=c3+10 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
-affected rows: 8
-info: Rows matched: 8 Changed: 8 Warnings: 0
+update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
select c3 from t1;
c3
-11
-14
-12
-15
-13
-16
-17
-18
-rollback;
-#
-# update with a limit
-#
-start transaction;
+111
+112
+113
+114
+115
+116
+117
+118
+121
+122
+123
+124
+125
+126
+127
+128
+131
+132
+133
+134
+135
+136
+137
+138
+141
+142
+143
+144
+145
+146
+147
+148
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a limit
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
update t1
-set c1=(select a.c3
-from t1 a
-where a.c3 = t1.c3)
-limit 2;
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
affected rows: 2
info: Rows matched: 2 Changed: 2 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ;
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
1->1 1
1->2 2 *
@@ -970,19 +6306,55 @@ NULL 5
NULL 6
NULL 7
NULL 8
-rollback;
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
#
-# update with a limit and an order by
+# Update with a limit and an order by
#
-start transaction;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using filesort
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using filesort
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
update t1
-set c1=(select a.c3
-from t1 a
-where a.c3 = t1.c3)
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
order by c3 desc limit 2;
affected rows: 2
info: Rows matched: 2 Changed: 2 Warnings: 0
-select concat(old_c1,'->',c1),c3, case when c1 != old_c1 then '*' else ' ' end "Changed" from t1 ;
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
concat(old_c1,'->',c1) c3 Changed
NULL 1
NULL 2
@@ -990,58 +6362,996 @@ NULL 3
NULL 4
NULL 5
NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#######################################
+# Test with a primary key #
+#######################################
+drop index t1_c2 on t1;
+alter table t1 add primary key (c3);
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+#
+# Update with value from subquery on the same table
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status Table is already up to date
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1 Using index
+update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->1 1
+1->2 2 *
+1->3 3 *
+2->4 4 *
+2->5 5 *
+2->6 6 *
2->7 7 *
2->8 8 *
-rollback;
+11->11 11
+11->12 12 *
+11->13 13 *
+12->14 14 *
+12->15 15 *
+12->16 16 *
+12->17 17 *
+12->18 18 *
+21->21 21
+21->22 22 *
+21->23 23 *
+22->24 24 *
+22->25 25 *
+22->26 26 *
+22->27 27 *
+22->28 28 *
+31->31 31
+31->32 32 *
+31->33 33 *
+32->34 34 *
+32->35 35 *
+32->36 36 *
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+affected rows: 3
+info: Rows matched: 3 Changed: 3 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->10 1 *
+1->10 2 *
+1->10 3 *
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with EXISTS subquery over the updated table
+# in WHERE + non-sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+1->11 3 *
+NULL 4
+NULL 5
+2->12 6 *
+2->12 7 *
+2->12 8 *
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+1->11 3 *
+NULL 4
+NULL 5
+2->12 6 *
+2->12 7 *
+2->12 8 *
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a reference to view in subquery
+# in settable value
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->3 1 *
+1->3 2 *
+1->3 3 *
+2->4 4 *
+2->4 5 *
+2->4 6 *
+2->4 7 *
+2->4 8 *
+11->13 11 *
+11->13 12 *
+11->13 13 *
+12->14 14 *
+12->14 15 *
+12->14 16 *
+12->14 17 *
+12->14 18 *
+21->23 21 *
+21->23 22 *
+21->23 23 *
+22->24 24 *
+22->24 25 *
+22->24 26 *
+22->24 27 *
+22->24 28 *
+31->33 31 *
+31->33 32 *
+31->33 33 *
+32->34 34 *
+32->34 35 *
+32->34 36 *
+32->34 37 *
+32->34 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using where
+explain update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+affected rows: 7
+info: Rows matched: 7 Changed: 7 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+NULL 3
+NULL 4
+2->17 5 *
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+11->24 12 *
+NULL 13
+NULL 14
+12->27 15 *
+NULL 16
+NULL 17
+NULL 18
+21->35 21 *
+NULL 22
+NULL 23
+22->38 24 *
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+31->45 31 *
+NULL 32
+NULL 33
+32->48 34 *
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view with reference to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+affected rows: 1
+info: Rows matched: 1 Changed: 1 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+1->2 2 *
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view with EXISTS and reference to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from v1 where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update v1
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+update v1
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+1->11 2 *
+NULL 3
+NULL 4
+2->12 5 *
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with IN predicand over the updated table in WHERE
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select c3 from t1;
+c3
+111
+112
+113
+114
+115
+116
+117
+118
+121
+122
+123
+124
+125
+126
+127
+128
+131
+132
+133
+134
+135
+136
+137
+138
+141
+142
+143
+144
+145
+146
+147
+148
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a limit
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1 Using index
+update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->1 1
+1->2 2 *
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a limit and an order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+explain select * from t1 order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 2
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 index NULL PRIMARY 4 NULL 2 Using buffer
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1 Using index
+update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 2;
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
# Update with error "Subquery returns more than 1 row"
update t1 set c2=(select c2 from t1);
ERROR 21000: Subquery returns more than 1 row
-# Update with error "Subquery returns more than 1 row" and order by
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+# Update with error "Subquery returns more than 1 row"
+# and order by
update t1 set c2=(select c2 from t1) order by c3;
ERROR 21000: Subquery returns more than 1 row
-Duplicate value on update a primary key
-start transaction;
-update t1 set c3=0 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+# Duplicate value on update a primary key
+update t1 set c3=0
+where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
-rollback;
-Duplicate value on update a primary key with ignore
-start transaction;
-update ignore t1 set c3=0 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
-affected rows: 4
-info: Rows matched: 4 Changed: 4 Warnings: 0
-rollback;
-Duplicate value on update a primary key and limit
-start transaction;
-update t1 set c3=0 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3 limit 2;
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 0
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+# Duplicate value on update a primary key with ignore
+update ignore t1 set c3=0
+where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 0
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+# Duplicate value on update a primary key and limit
+update t1 set c3=0
+where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 limit 2;
ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
-rollback;
-Duplicate value on update a primary key with ignore and limit
-start transaction;
-update ignore t1 set c3=0 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3 limit 2;
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 0
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+# Duplicate value on update a primary key with ignore
+# and limit
+update ignore t1 set c3=0
+where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 limit 2;
affected rows: 2
info: Rows matched: 2 Changed: 2 Warnings: 0
-rollback;
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 0
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
# Update no rows found
-update t1
-set c1=10
-where c1 <2
-and exists (select 'X'
- from t1 a
-where a.c1 = t1.c1 + 10);
-affected rows: 0
-info: Rows matched: 0 Changed: 0 Warnings: 0
+update t1 set c1=10
+where c1 <2 and exists (select 'X' from t1 a where a.c1 = t1.c1 + 10);
+affected rows: 3
+info: Rows matched: 3 Changed: 3 Warnings: 0
+select c1,c2,c3 from t1;
+c1 c2 c3
+10 1 1
+10 2 2
+10 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
# Update no rows changed
drop trigger trg_t1;
-start transaction;
-update t1
-set c1=c1
-where c1 <2
-and exists (select 'X'
- from t1 a
-where a.c1 = t1.c1);
+update t1 set c1=c1
+where c1 <2 and exists (select 'X' from t1 a where a.c1 = t1.c1);
affected rows: 0
info: Rows matched: 3 Changed: 0 Warnings: 0
-rollback;
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
#
# Check call of after trigger
#
@@ -1054,61 +7364,208 @@ SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = msg;
end if;
end;
/
-update t1 set c1=2 where c3 in (select distinct a.c3 from t1 a where a.c1=t1.c1);
+update t1 set c1=2
+where c3 in (select distinct a.c3 from t1 a where a.c1=t1.c1);
ERROR 45000: in after update trigger on 5
+select c1,c2,c3 from t1;
+c1 c2 c3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 1
+2 1 4
+2 2 2
+2 2 5
+2 3 3
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
#
# Check update with order by and after trigger
#
-update t1 set c1=2 where c3 in (select distinct a.c3 from t1 a where a.c1=t1.c1) order by t1.c2;
+update t1 set c1=2
+where c3 in (select distinct a.c3 from t1 a where a.c1=t1.c1)
+order by t1.c2, t1.c1;
ERROR 45000: in after update trigger on 5
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 3 3
+11 2 12
+11 3 13
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 1
+2 1 11
+2 1 14
+2 1 4
+2 2 2
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
drop view v1;
#
# Check update on view with check option
#
create view v1 as select * from t1 where c2=2 with check option;
-start transaction;
update v1 set c2=3 where c1=1;
ERROR 44000: CHECK OPTION failed `test`.`v1`
-rollback;
-start transaction;
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
update v1 set c2=(select max(c3) from v1) where c1=1;
ERROR 44000: CHECK OPTION failed `test`.`v1`
-rollback;
-start transaction;
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
update v1 set c2=(select min(va.c3) from v1 va), c1=0 where c1=1;
-rollback;
-drop view v1;
-drop table t1;
-#
-# Test with a temporary table
-#
-create temporary table t1 (c1 integer, c2 integer, c3 integer) engine=InnoDb;
-insert into t1(c1,c2,c3) values (1,1,1);
-insert into t1(c1,c2,c3) values (1,2,2);
-insert into t1(c1,c2,c3) values (1,3,3);
-insert into t1(c1,c2,c3) values (2,1,4);
-insert into t1(c1,c2,c3) values (2,2,5);
-insert into t1(c1,c2,c3) values (2,3,6);
-insert into t1(c1,c2,c3) values (2,4,7);
-insert into t1(c1,c2,c3) values (2,5,8);
-start transaction;
-update t1
-set c1=(select a.c2
-from t1 a
-where a.c3 = t1.c3) limit 3;
-affected rows: 2
-info: Rows matched: 3 Changed: 2 Warnings: 0
-select * from t1 ;
+select c1,c2,c3 from t1;
c1 c2 c3
+0 2 2
1 1 1
-2 2 2
-3 3 3
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
2 1 4
2 2 5
2 3 6
2 4 7
2 5 8
-rollback;
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+drop table tmp;
+drop view v1;
drop table t1;
#
# Test on dynamic columns (blob)
@@ -1117,37 +7574,50 @@ create table assets (
item_name varchar(32) primary key, -- A common attribute for all items
dynamic_cols blob -- Dynamic columns will be stored here
);
-INSERT INTO assets VALUES ('MariaDB T-shirt', COLUMN_CREATE('color', 'blue', 'size', 'XL'));
-INSERT INTO assets VALUES ('Thinkpad Laptop', COLUMN_CREATE('color', 'black', 'price', 500));
-SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color FROM assets;
+INSERT INTO assets VALUES ('MariaDB T-shirt',
+COLUMN_CREATE('color', 'blue', 'size', 'XL'));
+INSERT INTO assets VALUES ('Thinkpad Laptop',
+COLUMN_CREATE('color', 'black', 'price', 500));
+SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color
+FROM assets;
item_name color
MariaDB T-shirt blue
Thinkpad Laptop black
-UPDATE assets SET dynamic_cols=COLUMN_ADD(dynamic_cols, 'warranty', '3 years') WHERE item_name='Thinkpad Laptop';
-SELECT item_name, COLUMN_GET(dynamic_cols, 'warranty' as char) AS color FROM assets;
+UPDATE assets
+SET dynamic_cols=COLUMN_ADD(dynamic_cols, 'warranty', '3 years')
+WHERE item_name='Thinkpad Laptop';
+SELECT item_name,
+COLUMN_GET(dynamic_cols, 'warranty' as char) AS color
+FROM assets;
item_name color
MariaDB T-shirt NULL
Thinkpad Laptop 3 years
-UPDATE assets SET dynamic_cols=COLUMN_ADD(dynamic_cols, 'warranty', '4 years')
-WHERE item_name in (select b.item_name
-from assets b
+UPDATE assets
+SET dynamic_cols=COLUMN_ADD(dynamic_cols, 'warranty', '4 years')
+WHERE item_name in
+(select b.item_name from assets b
where COLUMN_GET(b.dynamic_cols, 'color' as char) ='black');
-SELECT item_name, COLUMN_GET(dynamic_cols, 'warranty' as char) AS color FROM assets;
+SELECT item_name,
+COLUMN_GET(dynamic_cols, 'warranty' as char) AS color
+FROM assets;
item_name color
MariaDB T-shirt NULL
Thinkpad Laptop 4 years
-UPDATE assets SET dynamic_cols=COLUMN_ADD(dynamic_cols, 'warranty', (select COLUMN_GET(b.dynamic_cols, 'color' as char)
+UPDATE assets SET dynamic_cols=COLUMN_ADD(dynamic_cols, 'warranty',
+(select COLUMN_GET(b.dynamic_cols, 'color' as char)
from assets b
where assets.item_name = item_name));
-SELECT item_name, COLUMN_GET(dynamic_cols, 'warranty' as char) AS color FROM assets;
+SELECT item_name,
+COLUMN_GET(dynamic_cols, 'warranty' as char) AS color
+FROM assets;
item_name color
MariaDB T-shirt blue
Thinkpad Laptop black
-drop table assets ;
+drop table assets;
#
# Test on fulltext columns
#
-CREATE TABLE ft2(copy TEXT,FULLTEXT(copy)) ENGINE=MyISAM;
+CREATE TABLE ft2(copy TEXT,FULLTEXT(copy));
INSERT INTO ft2(copy) VALUES
('MySQL vs MariaDB database'),
('Oracle vs MariaDB database'),
@@ -1163,17 +7633,2488 @@ copy
MySQL vs MariaDB database
Oracle vs MariaDB database
PostgreSQL vs MariaDB database
-update ft2 set copy = (select max(concat('mykeyword ',substr(b.copy,1,5))) from ft2 b WHERE MATCH(b.copy) AGAINST('database'))
+update ft2 set copy = (select max(concat('mykeyword ',substr(b.copy,1,5)))
+from ft2 b WHERE MATCH(b.copy) AGAINST('database'))
where MATCH(copy) AGAINST('keys');
SELECT * FROM ft2 WHERE MATCH(copy) AGAINST('mykeyword');
copy
mykeyword Postg
mykeyword Postg
drop table ft2;
+#######################################
+# #
+# Engine MEMORY #
+# #
+#######################################
+set default_storage_engine=MEMORY;
+create table t1 (old_c1 integer,
+old_c2 integer,
+c1 integer,
+c2 integer,
+c3 integer);
+create view v1 as select * from t1 where c2=2;
+create trigger trg_t1 before update on t1 for each row
+begin
+set new.old_c1=old.c1;
+set new.old_c2=old.c2;
+end;
+/
+insert into t1(c1,c2,c3)
+values (1,1,1), (1,2,2), (1,3,3),
+(2,1,4), (2,2,5), (2,3,6),
+(2,4,7), (2,5,8);
+insert into t1 select NULL, NULL, c1+10,c2,c3+10 from t1;
+insert into t1 select NULL, NULL, c1+20,c2+1,c3+20 from t1;
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+create table tmp as select * from t1;
+#######################################
+# Test without any index #
+#######################################
+#
+# Update with value from subquery on the same table
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->1 1
+1->2 2 *
+1->3 3 *
+2->4 4 *
+2->5 5 *
+2->6 6 *
+2->7 7 *
+2->8 8 *
+11->11 11
+11->12 12 *
+11->13 13 *
+12->14 14 *
+12->15 15 *
+12->16 16 *
+12->17 17 *
+12->18 18 *
+21->21 21
+21->22 22 *
+21->23 23 *
+22->24 24 *
+22->25 25 *
+22->26 26 *
+22->27 27 *
+22->28 28 *
+31->31 31
+31->32 32 *
+31->33 33 *
+32->34 34 *
+32->35 35 *
+32->36 36 *
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+explain select * from t1 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+affected rows: 3
+info: Rows matched: 3 Changed: 3 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->10 1 *
+1->10 2 *
+1->10 3 *
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with EXISTS subquery over the updated table
+# in WHERE + non-sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+1->11 3 *
+NULL 4
+NULL 5
+2->12 6 *
+2->12 7 *
+2->12 8 *
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+1->11 3 *
+NULL 4
+NULL 5
+2->12 6 *
+2->12 7 *
+2->12 8 *
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a reference to view in subquery
+# in settable value
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->3 1 *
+1->3 2 *
+1->3 3 *
+2->4 4 *
+2->4 5 *
+2->4 6 *
+2->4 7 *
+2->4 8 *
+11->13 11 *
+11->13 12 *
+11->13 13 *
+12->14 14 *
+12->14 15 *
+12->14 16 *
+12->14 17 *
+12->14 18 *
+21->23 21 *
+21->23 22 *
+21->23 23 *
+22->24 24 *
+22->24 25 *
+22->24 26 *
+22->24 27 *
+22->24 28 *
+31->33 31 *
+31->33 32 *
+31->33 33 *
+32->34 34 *
+32->34 35 *
+32->34 36 *
+32->34 37 *
+32->34 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+explain select * from v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using where
+explain update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+affected rows: 7
+info: Rows matched: 7 Changed: 7 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+NULL 3
+NULL 4
+2->17 5 *
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+11->24 12 *
+NULL 13
+NULL 14
+12->27 15 *
+NULL 16
+NULL 17
+NULL 18
+21->35 21 *
+NULL 22
+NULL 23
+22->38 24 *
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+31->45 31 *
+NULL 32
+NULL 33
+32->48 34 *
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view with reference to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+explain select * from v1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+affected rows: 1
+info: Rows matched: 1 Changed: 1 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+1->2 2 *
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view with EXISTS and reference to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+explain select * from v1 where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update v1
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+update v1
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+1->11 2 *
+NULL 3
+NULL 4
+2->12 5 *
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with IN predicand over the updated table in WHERE
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+explain select * from t1 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select c3 from t1;
+c3
+111
+112
+113
+114
+115
+116
+117
+118
+121
+122
+123
+124
+125
+126
+127
+128
+131
+132
+133
+134
+135
+136
+137
+138
+141
+142
+143
+144
+145
+146
+147
+148
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a limit
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+explain select * from t1 limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->1 1
+1->2 2 *
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a limit and an order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+explain select * from t1 order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using filesort
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using filesort
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 2;
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#######################################
+# Test with an index #
+#######################################
+create index t1_c2 on t1 (c2,c1);
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Operation failed
+#
+# Update with value from subquery on the same table
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Operation failed
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->1 1
+1->2 2 *
+1->3 3 *
+2->4 4 *
+2->5 5 *
+2->6 6 *
+2->7 7 *
+2->8 8 *
+11->11 11
+11->12 12 *
+11->13 13 *
+12->14 14 *
+12->15 15 *
+12->16 16 *
+12->17 17 *
+12->18 18 *
+21->21 21
+21->22 22 *
+21->23 23 *
+22->24 24 *
+22->25 25 *
+22->26 26 *
+22->27 27 *
+22->28 28 *
+31->31 31
+31->32 32 *
+31->33 33 *
+32->34 34 *
+32->35 35 *
+32->36 36 *
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Operation failed
+explain select * from t1 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+affected rows: 3
+info: Rows matched: 3 Changed: 3 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->10 1 *
+1->10 2 *
+1->10 3 *
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with EXISTS subquery over the updated table
+# in WHERE + non-sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Operation failed
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL t1_c2 NULL NULL NULL 32
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL t1_c2 NULL NULL NULL 32
+update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+1->11 3 *
+NULL 4
+NULL 5
+2->12 6 *
+2->12 7 *
+2->12 8 *
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Operation failed
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL t1_c2 NULL NULL NULL 32
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL t1_c2 NULL NULL NULL 32
+update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+1->11 3 *
+NULL 4
+NULL 5
+2->12 6 *
+2->12 7 *
+2->12 8 *
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a reference to view in subquery
+# in settable value
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Operation failed
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 2
+update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->3 1 *
+1->3 2 *
+1->3 3 *
+2->4 4 *
+2->4 5 *
+2->4 6 *
+2->4 7 *
+2->4 8 *
+11->13 11 *
+11->13 12 *
+11->13 13 *
+12->14 14 *
+12->14 15 *
+12->14 16 *
+12->14 17 *
+12->14 18 *
+21->23 21 *
+21->23 22 *
+21->23 23 *
+22->24 24 *
+22->24 25 *
+22->24 26 *
+22->24 27 *
+22->24 28 *
+31->33 31 *
+31->33 32 *
+31->33 33 *
+32->34 34 *
+32->34 35 *
+32->34 36 *
+32->34 37 *
+32->34 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Operation failed
+explain select * from v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL t1_c2 NULL NULL NULL 32 Using where
+explain update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+affected rows: 7
+info: Rows matched: 7 Changed: 7 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+NULL 3
+NULL 4
+2->17 5 *
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+11->24 12 *
+NULL 13
+NULL 14
+12->27 15 *
+NULL 16
+NULL 17
+NULL 18
+21->35 21 *
+NULL 22
+NULL 23
+22->38 24 *
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+31->45 31 *
+NULL 32
+NULL 33
+32->48 34 *
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view with reference to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Operation failed
+explain select * from v1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 2 FirstMatch(t1)
+explain update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,func 2 Using where
+update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+affected rows: 1
+info: Rows matched: 1 Changed: 1 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+1->2 2 *
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view with EXISTS and reference to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Operation failed
+explain select * from v1 where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update v1
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+3 DEPENDENT SUBQUERY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ref t1_c2 t1_c2 10 const,test.t1.c1 2
+update v1
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+1->11 2 *
+NULL 3
+NULL 4
+2->12 5 *
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with IN predicand over the updated table in WHERE
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Operation failed
+explain select * from t1 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a ref t1_c2 t1_c2 10 test.t1.c2,test.t1.c1 2 FirstMatch(t1)
+explain update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL t1_c2 NULL NULL NULL 32 Using where
+1 PRIMARY a ref t1_c2 t1_c2 10 test.t1.c2,test.t1.c1 2 FirstMatch(t1)
+update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select c3 from t1;
+c3
+111
+112
+113
+114
+115
+116
+117
+118
+121
+122
+123
+124
+125
+126
+127
+128
+131
+132
+133
+134
+135
+136
+137
+138
+141
+142
+143
+144
+145
+146
+147
+148
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a limit
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Operation failed
+explain select * from t1 limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->1 1
+1->2 2 *
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a limit and an order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Operation failed
+explain select * from t1 order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using filesort
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using filesort
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 2;
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#######################################
+# Test with a primary key #
+#######################################
+drop index t1_c2 on t1;
+alter table t1 add primary key (c3);
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+#
+# Update with value from subquery on the same table
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1
+update t1 set c1=(select a.c3 from t1 a where a.c3 = t1.c3);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->1 1
+1->2 2 *
+1->3 3 *
+2->4 4 *
+2->5 5 *
+2->6 6 *
+2->7 7 *
+2->8 8 *
+11->11 11
+11->12 12 *
+11->13 13 *
+12->14 14 *
+12->15 15 *
+12->16 16 *
+12->17 17 *
+12->18 18 *
+21->21 21
+21->22 22 *
+21->23 23 *
+22->24 24 *
+22->25 25 *
+22->26 26 *
+22->27 27 *
+22->28 28 *
+31->31 31
+31->32 32 *
+31->33 33 *
+32->34 34 *
+32->35 35 *
+32->36 36 *
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with EXISTS subquery over the updated table
+# in WHERE + possibly sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+explain select * from t1 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+update t1 set c1=10 where c1 <2
+and exists (select 'X' from t1 a where a.c1 = t1.c1);
+affected rows: 3
+info: Rows matched: 3 Changed: 3 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->10 1 *
+1->10 2 *
+1->10 3 *
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with EXISTS subquery over the updated table
+# in WHERE + non-sargable condition
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+1->11 3 *
+NULL 4
+NULL 5
+2->12 6 *
+2->12 7 *
+2->12 8 *
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+explain select * from t1 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; Using filesort
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
+2 MATERIALIZED a ALL NULL NULL NULL NULL 32
+update t1 set c1=c1+10 where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 order by c2;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+1->11 3 *
+NULL 4
+NULL 5
+2->12 6 *
+2->12 7 *
+2->12 8 *
+NULL 11
+NULL 12
+11->21 13 *
+NULL 14
+NULL 15
+12->22 16 *
+12->22 17 *
+12->22 18 *
+NULL 21
+21->31 22 *
+21->31 23 *
+NULL 24
+22->32 25 *
+22->32 26 *
+22->32 27 *
+22->32 28 *
+NULL 31
+31->41 32 *
+31->41 33 *
+NULL 34
+32->42 35 *
+32->42 36 *
+32->42 37 *
+32->42 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a reference to view in subquery
+# in settable value
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+explain select * from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+update t1 set c1=c1 +(select max(a.c2) from v1 a
+where a.c1 = t1.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->3 1 *
+1->3 2 *
+1->3 3 *
+2->4 4 *
+2->4 5 *
+2->4 6 *
+2->4 7 *
+2->4 8 *
+11->13 11 *
+11->13 12 *
+11->13 13 *
+12->14 14 *
+12->14 15 *
+12->14 16 *
+12->14 17 *
+12->14 18 *
+21->23 21 *
+21->23 22 *
+21->23 23 *
+22->24 24 *
+22->24 25 *
+22->24 26 *
+22->24 27 *
+22->24 28 *
+31->33 31 *
+31->33 32 *
+31->33 33 *
+32->34 34 *
+32->34 35 *
+32->34 36 *
+32->34 37 *
+32->34 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+explain select * from v1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using where
+explain update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY a ALL NULL NULL NULL NULL 32 Using where
+update v1 set c1=c1 + (select max(a.c2) from t1 a
+where a.c1 = v1.c1) +10 where c3 > 3;
+affected rows: 7
+info: Rows matched: 7 Changed: 7 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+NULL 3
+NULL 4
+2->17 5 *
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+11->24 12 *
+NULL 13
+NULL 14
+12->27 15 *
+NULL 16
+NULL 17
+NULL 18
+21->35 21 *
+NULL 22
+NULL 23
+22->38 24 *
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+31->45 31 *
+NULL 32
+NULL 33
+32->48 34 *
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view with reference to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+explain select * from v1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+update v1 set c1=c1 + 1 where c1 <2
+and exists (select 'X' from v1 a where a.c1 = v1.c1);
+affected rows: 1
+info: Rows matched: 1 Changed: 1 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+1->2 2 *
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update view with EXISTS and reference to the same view in subquery
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+explain select * from v1 where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update v1
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using where
+3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 32 Using where
+update v1
+set c1=(select max(a.c1)+10 from v1 a where a.c1 = v1.c1)
+where c1 <10 and exists (select 'X' from v1 a where a.c2 = v1.c2);
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+1->11 2 *
+NULL 3
+NULL 4
+2->12 5 *
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with IN predicand over the updated table in WHERE
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+explain select * from t1 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
+explain update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+1 PRIMARY a ALL NULL NULL NULL NULL 32 Using where; FirstMatch(t1)
+update t1 set c3=c3+110 where c2 in (select distinct a.c2 from t1 a where t1.c1=a.c1);
+affected rows: 32
+info: Rows matched: 32 Changed: 32 Warnings: 0
+select c3 from t1;
+c3
+111
+112
+113
+114
+115
+116
+117
+118
+121
+122
+123
+124
+125
+126
+127
+128
+131
+132
+133
+134
+135
+136
+137
+138
+141
+142
+143
+144
+145
+146
+147
+148
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a limit
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+explain select * from t1 limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1
+update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3) limit 2;
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+1->1 1
+1->2 2 *
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+NULL 37
+NULL 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Update with a limit and an order by
+#
+analyze table t1 persistent for all;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+explain select * from t1 order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 32 Using filesort
+explain update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 32 Using filesort
+2 DEPENDENT SUBQUERY a eq_ref PRIMARY PRIMARY 4 test.t1.c3 1
+update t1
+set c1=(select a.c3 from t1 a where a.c3 = t1.c3)
+order by c3 desc limit 2;
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select concat(old_c1,'->',c1),c3,
+case when c1 != old_c1 then '*' else ' ' end "Changed" from t1;
+concat(old_c1,'->',c1) c3 Changed
+NULL 1
+NULL 2
+NULL 3
+NULL 4
+NULL 5
+NULL 6
+NULL 7
+NULL 8
+NULL 11
+NULL 12
+NULL 13
+NULL 14
+NULL 15
+NULL 16
+NULL 17
+NULL 18
+NULL 21
+NULL 22
+NULL 23
+NULL 24
+NULL 25
+NULL 26
+NULL 27
+NULL 28
+NULL 31
+NULL 32
+NULL 33
+NULL 34
+NULL 35
+NULL 36
+32->37 37 *
+32->38 38 *
+truncate table t1;
+insert into t1 select * from tmp;
+# Update with error "Subquery returns more than 1 row"
+update t1 set c2=(select c2 from t1);
+ERROR 21000: Subquery returns more than 1 row
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+# Update with error "Subquery returns more than 1 row"
+# and order by
+update t1 set c2=(select c2 from t1) order by c3;
+ERROR 21000: Subquery returns more than 1 row
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+# Duplicate value on update a primary key
+update t1 set c3=0
+where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 0
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+# Duplicate value on update a primary key with ignore
+update ignore t1 set c3=0
+where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
+affected rows: 20
+info: Rows matched: 20 Changed: 20 Warnings: 0
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 0
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+# Duplicate value on update a primary key and limit
+update t1 set c3=0
+where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 limit 2;
+ERROR 23000: Duplicate entry '0' for key 'PRIMARY'
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 0
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+# Duplicate value on update a primary key with ignore
+# and limit
+update ignore t1 set c3=0
+where exists (select 'X' from t1 a where a.c2 = t1.c2)
+and c2 >= 3 limit 2;
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 0
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 0
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+# Update no rows found
+update t1 set c1=10
+where c1 <2 and exists (select 'X' from t1 a where a.c1 = t1.c1 + 10);
+affected rows: 3
+info: Rows matched: 3 Changed: 3 Warnings: 0
+select c1,c2,c3 from t1;
+c1 c2 c3
+10 1 1
+10 2 2
+10 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+# Update no rows changed
+drop trigger trg_t1;
+update t1 set c1=c1
+where c1 <2 and exists (select 'X' from t1 a where a.c1 = t1.c1);
+affected rows: 0
+info: Rows matched: 3 Changed: 0 Warnings: 0
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Check call of after trigger
+#
+create or replace trigger trg_t2 after update on t1 for each row
+begin
+declare msg varchar(100);
+if (new.c3 = 5) then
+set msg=concat('in after update trigger on ',new.c3);
+SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = msg;
+end if;
+end;
+/
+update t1 set c1=2
+where c3 in (select distinct a.c3 from t1 a where a.c1=t1.c1);
+ERROR 45000: in after update trigger on 5
+select c1,c2,c3 from t1;
+c1 c2 c3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 1
+2 1 4
+2 2 2
+2 2 5
+2 3 3
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+#
+# Check update with order by and after trigger
+#
+update t1 set c1=2
+where c3 in (select distinct a.c3 from t1 a where a.c1=t1.c1)
+order by t1.c2, t1.c1;
+ERROR 45000: in after update trigger on 5
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 3 3
+11 2 12
+11 3 13
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 1
+2 1 11
+2 1 14
+2 1 4
+2 2 2
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+drop view v1;
+#
+# Check update on view with check option
+#
+create view v1 as select * from t1 where c2=2 with check option;
+update v1 set c2=3 where c1=1;
+ERROR 44000: CHECK OPTION failed `test`.`v1`
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+update v1 set c2=(select max(c3) from v1) where c1=1;
+ERROR 44000: CHECK OPTION failed `test`.`v1`
+select c1,c2,c3 from t1;
+c1 c2 c3
+1 1 1
+1 2 2
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+update v1 set c2=(select min(va.c3) from v1 va), c1=0 where c1=1;
+select c1,c2,c3 from t1;
+c1 c2 c3
+0 2 2
+1 1 1
+1 3 3
+11 1 11
+11 2 12
+11 3 13
+12 1 14
+12 2 15
+12 3 16
+12 4 17
+12 5 18
+2 1 4
+2 2 5
+2 3 6
+2 4 7
+2 5 8
+21 2 21
+21 3 22
+21 4 23
+22 2 24
+22 3 25
+22 4 26
+22 5 27
+22 6 28
+31 2 31
+31 3 32
+31 4 33
+32 2 34
+32 3 35
+32 4 36
+32 5 37
+32 6 38
+truncate table t1;
+insert into t1 select * from tmp;
+drop table tmp;
+drop view v1;
+drop table t1;
+set @@default_storage_engine=@save_default_engine;
#
# Test with MyISAM
#
-create table t1 (old_c1 integer, old_c2 integer,c1 integer, c2 integer, c3 integer) engine=MyISAM;
+create table t1 (old_c1 integer,
+old_c2 integer,
+c1 integer,
+c2 integer,
+c3 integer) engine=MyISAM;
insert t1 (c1,c2,c3) select 0,seq,seq%10 from seq_1_to_500;
insert t1 (c1,c2,c3) select 1,seq,seq%10 from seq_1_to_400;
insert t1 (c1,c2,c3) select 2,seq,seq%10 from seq_1_to_300;
@@ -1193,13 +10134,14 @@ count(*)
140
drop table t1;
#
-# Test error on multi_update conversion on view with order by or limit
+# Test error on multi_update conversion on view
+# with order by or limit
#
create table t1 (c1 integer) engine=InnoDb;
create table t2 (c1 integer) engine=InnoDb;
-create view v1 as select t1.c1 as "t1c1" ,t2.c1 as "t2c1" from t1,t2 where t1.c1=t2.c1;
+create view v1 as select t1.c1 as "t1c1" ,t2.c1 as "t2c1"
+ from t1,t2 where t1.c1=t2.c1;
update v1 set t1c1=2 order by 1;
-ERROR 42S22: Unknown column '1' in 'order clause'
update v1 set t1c1=2 limit 1;
drop table t1;
drop table t2;
diff --git a/mysql-test/main/update_use_source.test b/mysql-test/main/update_use_source.test
index 1b765138..ec27fa4d 100644
--- a/mysql-test/main/update_use_source.test
+++ b/mysql-test/main/update_use_source.test
@@ -2,221 +2,55 @@
--source include/have_innodb.inc
--source include/no_valgrind_without_big.inc
-create table t1 (old_c1 integer, old_c2 integer,c1 integer, c2 integer, c3 integer) engine=InnoDB STATS_PERSISTENT=0;
-create view v1 as select * from t1 where c2=2;
-delimiter /;
-create trigger trg_t1 before update on t1 for each row
-begin
- set new.old_c1=old.c1;
- set new.old_c2=old.c2;
-end;
-/
-delimiter ;/
-
-insert into t1(c1,c2,c3) values (1,1,1);
-insert into t1(c1,c2,c3) values (1,2,2);
-insert into t1(c1,c2,c3) values (1,3,3);
-insert into t1(c1,c2,c3) values (2,1,4);
-insert into t1(c1,c2,c3) values (2,2,5);
-insert into t1(c1,c2,c3) values (2,3,6);
-insert into t1(c1,c2,c3) values (2,4,7);
-insert into t1(c1,c2,c3) values (2,5,8);
-
-commit;
-select * from t1;
-
---echo Test without any index
+set @save_default_engine=@@default_storage_engine;
+
+--echo #######################################
+--echo # #
+--echo # Engine InnoDB #
+--echo # #
+--echo #######################################
+set global innodb_stats_persistent=1;
+set default_storage_engine=InnoDB;
--source include/update_use_source.inc
-
---echo Test with an index on updated columns
-create index t1_c2 on t1 (c2,c1);
+--source include/update_use_source_ext.inc
+
+--echo #######################################
+--echo # #
+--echo # Engine Aria #
+--echo # #
+--echo #######################################
+set default_storage_engine=Aria;
--source include/update_use_source.inc
-
---echo Test with an index on updated columns
-create index t1_c3 on t1 (c3);
+--source include/update_use_source_ext.inc
+
+--echo #######################################
+--echo # #
+--echo # Engine MyISAM #
+--echo # #
+--echo #######################################
+set default_storage_engine=MyISAM;
--source include/update_use_source.inc
-
---echo Test with a primary key on updated columns
-drop index t1_c3 on t1;
-alter table t1 add primary key (c3);
+--source include/update_use_source_ext.inc
+
+--echo #######################################
+--echo # #
+--echo # Engine MEMORY #
+--echo # #
+--echo #######################################
+set default_storage_engine=MEMORY;
--source include/update_use_source.inc
---echo # Update with error "Subquery returns more than 1 row"
---error ER_SUBQUERY_NO_1_ROW
-update t1 set c2=(select c2 from t1);
-
---echo # Update with error "Subquery returns more than 1 row" and order by
---error ER_SUBQUERY_NO_1_ROW
-update t1 set c2=(select c2 from t1) order by c3;
-
--- echo Duplicate value on update a primary key
-start transaction;
---error ER_DUP_ENTRY
-update t1 set c3=0 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
-rollback;
-
--- echo Duplicate value on update a primary key with ignore
-start transaction;
---enable_info ONCE
-update ignore t1 set c3=0 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3;
-rollback;
-
--- echo Duplicate value on update a primary key and limit
-start transaction;
---error ER_DUP_ENTRY
-update t1 set c3=0 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3 limit 2;
-rollback;
-
--- echo Duplicate value on update a primary key with ignore and limit
-start transaction;
---enable_info ONCE
-update ignore t1 set c3=0 where exists (select 'X' from t1 a where a.c2 = t1.c2) and c2 >= 3 limit 2;
-rollback;
-
---echo # Update no rows found
---enable_info ONCE
-update t1
- set c1=10
- where c1 <2
- and exists (select 'X'
- from t1 a
- where a.c1 = t1.c1 + 10);
-
---echo # Update no rows changed
-drop trigger trg_t1;
-start transaction;
---enable_info ONCE
-update t1
- set c1=c1
- where c1 <2
- and exists (select 'X'
- from t1 a
- where a.c1 = t1.c1);
-rollback;
-
---echo #
---echo # Check call of after trigger
---echo #
-
-delimiter /;
-create or replace trigger trg_t2 after update on t1 for each row
-begin
- declare msg varchar(100);
- if (new.c3 = 5) then
- set msg=concat('in after update trigger on ',new.c3);
- SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = msg;
- end if;
-end;
-/
-delimiter ;/
---error 1644
-update t1 set c1=2 where c3 in (select distinct a.c3 from t1 a where a.c1=t1.c1);
-
---echo #
---echo # Check update with order by and after trigger
---echo #
-
---error 1644
-update t1 set c1=2 where c3 in (select distinct a.c3 from t1 a where a.c1=t1.c1) order by t1.c2;
-
-drop view v1;
---echo #
---echo # Check update on view with check option
---echo #
-
-create view v1 as select * from t1 where c2=2 with check option;
-
-start transaction;
--- error 1369
-update v1 set c2=3 where c1=1;
-rollback;
-
-start transaction;
--- error 1369
-update v1 set c2=(select max(c3) from v1) where c1=1;
-rollback;
-
-start transaction;
-update v1 set c2=(select min(va.c3) from v1 va), c1=0 where c1=1;
-rollback;
-
-drop view v1;
-drop table t1;
-
---echo #
---echo # Test with a temporary table
---echo #
-
-create temporary table t1 (c1 integer, c2 integer, c3 integer) engine=InnoDb;
-insert into t1(c1,c2,c3) values (1,1,1);
-insert into t1(c1,c2,c3) values (1,2,2);
-insert into t1(c1,c2,c3) values (1,3,3);
-insert into t1(c1,c2,c3) values (2,1,4);
-insert into t1(c1,c2,c3) values (2,2,5);
-insert into t1(c1,c2,c3) values (2,3,6);
-insert into t1(c1,c2,c3) values (2,4,7);
-insert into t1(c1,c2,c3) values (2,5,8);
-
-start transaction;
---enable_info ONCE
-update t1
- set c1=(select a.c2
- from t1 a
- where a.c3 = t1.c3) limit 3;
-select * from t1 ;
-rollback;
-drop table t1;
-
---echo #
---echo # Test on dynamic columns (blob)
---echo #
-
-create table assets (
- item_name varchar(32) primary key, -- A common attribute for all items
- dynamic_cols blob -- Dynamic columns will be stored here
-);
-INSERT INTO assets VALUES ('MariaDB T-shirt', COLUMN_CREATE('color', 'blue', 'size', 'XL'));
-INSERT INTO assets VALUES ('Thinkpad Laptop', COLUMN_CREATE('color', 'black', 'price', 500));
-SELECT item_name, COLUMN_GET(dynamic_cols, 'color' as char) AS color FROM assets;
-UPDATE assets SET dynamic_cols=COLUMN_ADD(dynamic_cols, 'warranty', '3 years') WHERE item_name='Thinkpad Laptop';
-SELECT item_name, COLUMN_GET(dynamic_cols, 'warranty' as char) AS color FROM assets;
-UPDATE assets SET dynamic_cols=COLUMN_ADD(dynamic_cols, 'warranty', '4 years')
- WHERE item_name in (select b.item_name
- from assets b
- where COLUMN_GET(b.dynamic_cols, 'color' as char) ='black');
-SELECT item_name, COLUMN_GET(dynamic_cols, 'warranty' as char) AS color FROM assets;
-
-UPDATE assets SET dynamic_cols=COLUMN_ADD(dynamic_cols, 'warranty', (select COLUMN_GET(b.dynamic_cols, 'color' as char)
- from assets b
- where assets.item_name = item_name));
-SELECT item_name, COLUMN_GET(dynamic_cols, 'warranty' as char) AS color FROM assets;
-drop table assets ;
-
---echo #
---echo # Test on fulltext columns
---echo #
-CREATE TABLE ft2(copy TEXT,FULLTEXT(copy)) ENGINE=MyISAM;
-INSERT INTO ft2(copy) VALUES
- ('MySQL vs MariaDB database'),
- ('Oracle vs MariaDB database'),
- ('PostgreSQL vs MariaDB database'),
- ('MariaDB overview'),
- ('Foreign keys'),
- ('Primary keys'),
- ('Indexes'),
- ('Transactions'),
- ('Triggers');
-SELECT * FROM ft2 WHERE MATCH(copy) AGAINST('database');
-update ft2 set copy = (select max(concat('mykeyword ',substr(b.copy,1,5))) from ft2 b WHERE MATCH(b.copy) AGAINST('database'))
- where MATCH(copy) AGAINST('keys');
-SELECT * FROM ft2 WHERE MATCH(copy) AGAINST('mykeyword');
-drop table ft2;
+set @@default_storage_engine=@save_default_engine;
--echo #
--echo # Test with MyISAM
--echo #
-create table t1 (old_c1 integer, old_c2 integer,c1 integer, c2 integer, c3 integer) engine=MyISAM;
+create table t1 (old_c1 integer,
+ old_c2 integer,
+ c1 integer,
+ c2 integer,
+ c3 integer) engine=MyISAM;
insert t1 (c1,c2,c3) select 0,seq,seq%10 from seq_1_to_500;
insert t1 (c1,c2,c3) select 1,seq,seq%10 from seq_1_to_400;
insert t1 (c1,c2,c3) select 2,seq,seq%10 from seq_1_to_300;
@@ -232,13 +66,15 @@ drop table t1;
--echo #
---echo # Test error on multi_update conversion on view with order by or limit
+--echo # Test error on multi_update conversion on view
+--echo # with order by or limit
--echo #
create table t1 (c1 integer) engine=InnoDb;
create table t2 (c1 integer) engine=InnoDb;
-create view v1 as select t1.c1 as "t1c1" ,t2.c1 as "t2c1" from t1,t2 where t1.c1=t2.c1;
---error ER_BAD_FIELD_ERROR
+create view v1 as select t1.c1 as "t1c1" ,t2.c1 as "t2c1"
+ from t1,t2 where t1.c1=t2.c1;
+# 'order by 1' should be considered as in 'select * from v1 order 1'
update v1 set t1c1=2 order by 1;
update v1 set t1c1=2 limit 1;
drop table t1;
diff --git a/mysql-test/main/upgrade_MDEV-19650.result b/mysql-test/main/upgrade_MDEV-19650.result
index 81673dc8..7d36ab9c 100644
--- a/mysql-test/main/upgrade_MDEV-19650.result
+++ b/mysql-test/main/upgrade_MDEV-19650.result
@@ -160,6 +160,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
diff --git a/mysql-test/main/upgrade_MDEV-19650.test b/mysql-test/main/upgrade_MDEV-19650.test
index a2f9fee7..d4bd64ce 100644
--- a/mysql-test/main/upgrade_MDEV-19650.test
+++ b/mysql-test/main/upgrade_MDEV-19650.test
@@ -101,8 +101,8 @@ let $MYSQLD_DATADIR= `select @@datadir`;
--echo # Run mysql_upgrade
--exec $MYSQL_UPGRADE 2>&1
---file_exists $MYSQLD_DATADIR/mysql_upgrade_info
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--file_exists $MYSQLD_DATADIR/mariadb_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
--echo # check new definitions mysql_upgrade
diff --git a/mysql-test/main/upgrade_MDEV-23102-1.result b/mysql-test/main/upgrade_MDEV-23102-1.result
index a092cf10..64ba8fb4 100644
--- a/mysql-test/main/upgrade_MDEV-23102-1.result
+++ b/mysql-test/main/upgrade_MDEV-23102-1.result
@@ -178,6 +178,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
@@ -380,6 +381,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
diff --git a/mysql-test/main/upgrade_MDEV-23102-1.test b/mysql-test/main/upgrade_MDEV-23102-1.test
index 172e0d59..b70230eb 100644
--- a/mysql-test/main/upgrade_MDEV-23102-1.test
+++ b/mysql-test/main/upgrade_MDEV-23102-1.test
@@ -115,8 +115,8 @@ let $MYSQLD_DATADIR= `select @@datadir`;
--echo # Run mysql_upgrade
--exec $MYSQL_UPGRADE 2>&1
---file_exists $MYSQLD_DATADIR/mysql_upgrade_info
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--file_exists $MYSQLD_DATADIR/mariadb_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
--echo # check new definitions mysql_upgrade
@@ -138,8 +138,8 @@ DROP VIEW mysql.user;
DROP PROCEDURE AddGeometryColumn;
DROP PROCEDURE DropGeometryColumn;
--exec $MYSQL_UPGRADE 2>&1
---file_exists $MYSQLD_DATADIR/mysql_upgrade_info
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--file_exists $MYSQLD_DATADIR/mariadb_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
delete from global_priv;
delete from tables_priv;
diff --git a/mysql-test/main/upgrade_MDEV-23102-2.result b/mysql-test/main/upgrade_MDEV-23102-2.result
index f84a109e..44268908 100644
--- a/mysql-test/main/upgrade_MDEV-23102-2.result
+++ b/mysql-test/main/upgrade_MDEV-23102-2.result
@@ -162,6 +162,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
@@ -356,6 +357,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
diff --git a/mysql-test/main/upgrade_MDEV-23102-2.test b/mysql-test/main/upgrade_MDEV-23102-2.test
index f2d7ac57..d55ebe03 100644
--- a/mysql-test/main/upgrade_MDEV-23102-2.test
+++ b/mysql-test/main/upgrade_MDEV-23102-2.test
@@ -96,8 +96,8 @@ let $MYSQLD_DATADIR= `select @@datadir`;
--echo # Run mysql_upgrade
--exec $MYSQL_UPGRADE 2>&1
---file_exists $MYSQLD_DATADIR/mysql_upgrade_info
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--file_exists $MYSQLD_DATADIR/mariadb_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
--echo # check new definitions mysql_upgrade
@@ -116,8 +116,8 @@ select count(*) from global_priv where user='mariadb.sys' and host='localhost';
DROP USER 'superuser'@'localhost';
DROP VIEW mysql.user;
--exec $MYSQL_UPGRADE 2>&1
---file_exists $MYSQLD_DATADIR/mysql_upgrade_info
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--file_exists $MYSQLD_DATADIR/mariadb_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
delete from global_priv;
delete from tables_priv;
diff --git a/mysql-test/main/upgrade_geometrycolumn_procedure_definer.result b/mysql-test/main/upgrade_geometrycolumn_procedure_definer.result
index 9d2f445d..67d269c2 100644
--- a/mysql-test/main/upgrade_geometrycolumn_procedure_definer.result
+++ b/mysql-test/main/upgrade_geometrycolumn_procedure_definer.result
@@ -108,6 +108,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
diff --git a/mysql-test/main/upgrade_geometrycolumn_procedure_definer.test b/mysql-test/main/upgrade_geometrycolumn_procedure_definer.test
index 5111fcdf..7ef8b4c0 100644
--- a/mysql-test/main/upgrade_geometrycolumn_procedure_definer.test
+++ b/mysql-test/main/upgrade_geometrycolumn_procedure_definer.test
@@ -43,8 +43,8 @@ let $MYSQLD_DATADIR= `select @@datadir`;
--echo # Run mysql_upgrade
--echo #
--exec $MYSQL_UPGRADE 2>&1
---file_exists $MYSQLD_DATADIR/mysql_upgrade_info
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--file_exists $MYSQLD_DATADIR/mariadb_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
--echo #
--echo # check new definers of Add/DropGeometryColumn
diff --git a/mysql-test/main/upgrade_mdev_24363.result b/mysql-test/main/upgrade_mdev_24363.result
index 184c948f..1991f336 100644
--- a/mysql-test/main/upgrade_mdev_24363.result
+++ b/mysql-test/main/upgrade_mdev_24363.result
@@ -122,6 +122,7 @@ sys.memory_by_user_by_current_bytes OK
sys.memory_global_by_current_bytes OK
sys.memory_global_total OK
sys.metrics OK
+sys.privileges_by_table_by_level OK
sys.processlist OK
sys.ps_check_lost_instrumentation OK
sys.schema_auto_increment_columns OK
diff --git a/mysql-test/main/upgrade_mdev_24363.test b/mysql-test/main/upgrade_mdev_24363.test
index c188d4c7..d08ffa3b 100644
--- a/mysql-test/main/upgrade_mdev_24363.test
+++ b/mysql-test/main/upgrade_mdev_24363.test
@@ -55,8 +55,8 @@ drop user gigi@localhost;
--echo # Run mysql_upgrade
--exec $MYSQL_UPGRADE 2>&1
let $MYSQLD_DATADIR= `select @@datadir`;
---file_exists $MYSQLD_DATADIR/mysql_upgrade_info
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--file_exists $MYSQLD_DATADIR/mariadb_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
create user gigi@localhost;
show create user gigi@localhost;
diff --git a/mysql-test/main/userstat.result b/mysql-test/main/userstat.result
index 5315317e..eec7910a 100644
--- a/mysql-test/main/userstat.result
+++ b/mysql-test/main/userstat.result
@@ -1,6 +1,4 @@
select variable_value from information_schema.global_status where variable_name="handler_read_key" into @global_read_key;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
show columns from information_schema.client_statistics;
Field Type Null Key Default Extra
CLIENT varchar(64) NO NULL
diff --git a/mysql-test/main/variables-notembedded-master.opt b/mysql-test/main/variables-notembedded-master.opt
deleted file mode 100644
index 8a173a04..00000000
--- a/mysql-test/main/variables-notembedded-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-slave-skip-errors=3,100,137,0,643,1752
diff --git a/mysql-test/main/variables-notembedded.opt b/mysql-test/main/variables-notembedded.opt
new file mode 100644
index 00000000..c648e504
--- /dev/null
+++ b/mysql-test/main/variables-notembedded.opt
@@ -0,0 +1,2 @@
+--loose-slave-skip-errors=3,100,137,0,643,1752
+--old-mode=no_dup_key_warnings_with_ignore,compat_5_1_checksum
diff --git a/mysql-test/main/variables-notembedded.result b/mysql-test/main/variables-notembedded.result
index 70a068cd..05c87314 100644
--- a/mysql-test/main/variables-notembedded.result
+++ b/mysql-test/main/variables-notembedded.result
@@ -174,4 +174,20 @@ LENGTH(a)
SET GLOBAL max_allowed_packet=@save_max_allowed_packet;
SET GLOBAL net_buffer_length=@save_net_buffer_length;
DROP TABLE t1;
-End of 5.1 tests
+#
+# End of 5.1 tests
+#
+#
+# MDEV-31811 deprecate old_mode values
+#
+select @@old_mode;
+@@old_mode
+NO_DUP_KEY_WARNINGS_WITH_IGNORE,COMPAT_5_1_CHECKSUM
+set old_mode='zero_date_time_cast,no_progress_info';
+Warnings:
+Warning 1287 'NO_PROGRESS_INFO' is deprecated and will be removed in a future release
+Warning 1287 'ZERO_DATE_TIME_CAST' is deprecated and will be removed in a future release
+FOUND 2 /old-mode='[0-9A-Z_]+' is deprecated and will be removed in a future release/ in mysqld.1.err
+#
+# End of 11.3 tests
+#
diff --git a/mysql-test/main/variables-notembedded.test b/mysql-test/main/variables-notembedded.test
index 7a1489cf..6c08f535 100644
--- a/mysql-test/main/variables-notembedded.test
+++ b/mysql-test/main/variables-notembedded.test
@@ -182,4 +182,19 @@ SET GLOBAL max_allowed_packet=@save_max_allowed_packet;
SET GLOBAL net_buffer_length=@save_net_buffer_length;
DROP TABLE t1;
---echo End of 5.1 tests
+--echo #
+--echo # End of 5.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-31811 deprecate old_mode values
+--echo #
+select @@old_mode;
+set old_mode='zero_date_time_cast,no_progress_info';
+let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err;
+let SEARCH_PATTERN=old-mode='[0-9A-Z_]+' is deprecated and will be removed in a future release;
+source include/search_pattern_in_file.inc;
+
+--echo #
+--echo # End of 11.3 tests
+--echo #
diff --git a/mysql-test/main/variables.result b/mysql-test/main/variables.result
index 9b54a24b..2230e5a3 100644
--- a/mysql-test/main/variables.result
+++ b/mysql-test/main/variables.result
@@ -548,7 +548,7 @@ set default_storage_engine=myisam;
set global thread_cache_size=100;
set timestamp=1, timestamp=default;
set tmp_table_size=1024;
-set tx_isolation="READ-COMMITTED";
+set transaction_isolation="READ-COMMITTED";
set wait_timeout=100;
set log_warnings=1;
set global log_warnings=1;
@@ -777,16 +777,16 @@ select @@lc_time_names;
@@lc_time_names
en_US
LC_TIME_NAMES: testing locale with the last ID:
-set lc_time_names=111;
+set lc_time_names=112;
select @@lc_time_names;
@@lc_time_names
-ka_GE
+sw_KE
LC_TIME_NAMES: testing a number beyond the valid ID range:
-set lc_time_names=112;
-ERROR HY000: Unknown locale: '112'
+set lc_time_names=113;
+ERROR HY000: Unknown locale: '113'
select @@lc_time_names;
@@lc_time_names
-ka_GE
+sw_KE
LC_TIME_NAMES: testing that 0 is en_US:
set lc_time_names=0;
select @@lc_time_names;
@@ -892,6 +892,8 @@ VARIABLE_NAME VARIABLE_VALUE
SQL_BIG_SELECTS ON
set @@sql_big_selects = @old_sql_big_selects;
set @@sql_notes = 0, @@sql_warnings = 0;
+Warnings:
+Warning 1287 '@@sql_notes' is deprecated and will be removed in a future release. Please use '@@note_verbosity' instead
show variables like 'sql_notes';
Variable_name Value
sql_notes OFF
@@ -905,6 +907,8 @@ select * from information_schema.session_variables where variable_name like 'sql
VARIABLE_NAME VARIABLE_VALUE
SQL_WARNINGS OFF
set @@sql_notes = 1, @@sql_warnings = 1;
+Warnings:
+Warning 1287 '@@sql_notes' is deprecated and will be removed in a future release. Please use '@@note_verbosity' instead
show variables like 'sql_notes';
Variable_name Value
sql_notes ON
@@ -1561,6 +1565,8 @@ End of 5.1 tests
SET @sql_notes_saved = @@sql_notes;
SET @@sql_notes = ON;
+Warnings:
+Warning 1287 '@@sql_notes' is deprecated and will be removed in a future release. Please use '@@note_verbosity' instead
SELECT @@sql_notes;
@@sql_notes
1
@@ -1572,11 +1578,15 @@ SELECT @@sql_notes;
1
SET @@sql_notes = OFF;
+Warnings:
+Warning 1287 '@@sql_notes' is deprecated and will be removed in a future release. Please use '@@note_verbosity' instead
SELECT @@sql_notes;
@@sql_notes
0
SET @@sql_notes = @sql_notes_saved;
+Warnings:
+Warning 1287 '@@sql_notes' is deprecated and will be removed in a future release. Please use '@@note_verbosity' instead
# Checking delay_key_write...
SET @delay_key_write_saved = @@delay_key_write;
diff --git a/mysql-test/main/variables.test b/mysql-test/main/variables.test
index f589d139..227f7704 100644
--- a/mysql-test/main/variables.test
+++ b/mysql-test/main/variables.test
@@ -338,7 +338,7 @@ set default_storage_engine=myisam;
set global thread_cache_size=100;
set timestamp=1, timestamp=default;
set tmp_table_size=1024;
-set tx_isolation="READ-COMMITTED";
+set transaction_isolation="READ-COMMITTED";
set wait_timeout=100;
set log_warnings=1;
set global log_warnings=1;
@@ -542,11 +542,11 @@ set lc_time_names=-1;
select @@lc_time_names;
# note same boundary condition tests in sys_vars.lc_time_names_basic
--echo LC_TIME_NAMES: testing locale with the last ID:
-set lc_time_names=111;
+set lc_time_names=112;
select @@lc_time_names;
--echo LC_TIME_NAMES: testing a number beyond the valid ID range:
--error ER_UNKNOWN_LOCALE
-set lc_time_names=112;
+set lc_time_names=113;
select @@lc_time_names;
--echo LC_TIME_NAMES: testing that 0 is en_US:
set lc_time_names=0;
diff --git a/mysql-test/main/view.result b/mysql-test/main/view.result
index 9cab1b5f..04049fbe 100644
--- a/mysql-test/main/view.result
+++ b/mysql-test/main/view.result
@@ -1228,10 +1228,17 @@ drop table t1;
create table t1 (s1 int);
create view v1 as select * from t1 where s1 < 5 with check option;
insert ignore into v1 values (6);
-ERROR 44000: CHECK OPTION failed `test`.`v1`
+Warnings:
+Warning 1369 CHECK OPTION failed `test`.`v1`
+SHOW WARNINGS;
+Level Code Message
+Warning 1369 CHECK OPTION failed `test`.`v1`
insert ignore into v1 values (6),(3);
Warnings:
Warning 1369 CHECK OPTION failed `test`.`v1`
+SHOW WARNINGS;
+Level Code Message
+Warning 1369 CHECK OPTION failed `test`.`v1`
select * from t1;
s1
3
@@ -2445,8 +2452,6 @@ SELECT Meaning FROM v1 INTO retn;
RETURN retn;
END
//
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CREATE VIEW v2 AS SELECT f1();
select * from v2;
f1()
@@ -2618,8 +2623,6 @@ declare mx int;
select max(a) from t1 into mx;
return mx;
end//
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create view v1 as select f1() as a;
create view v2 as select * from v1;
drop table t1;
@@ -3162,14 +3165,10 @@ DROP VIEW v1;
DROP TABLE t1;
DROP VIEW IF EXISTS v1;
SELECT * FROM (SELECT 1) AS t into @w;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CREATE VIEW v1 AS SELECT * FROM (SELECT 1) AS t into @w;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'into @w' at line 1
# Previously the following would fail.
SELECT * FROM (SELECT 1) AS t into @w;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
drop view if exists view_24532_a;
drop view if exists view_24532_b;
drop table if exists table_24532;
@@ -3966,8 +3965,6 @@ BEGIN
SELECT a FROM v2 INTO @a;
RETURN @a;
END//
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
# Trigger pre-locking when opening v2.
CREATE VIEW v1 AS SELECT f1() FROM t1;
SHOW CREATE VIEW v1;
@@ -4213,10 +4210,10 @@ INSERT INTO t2 VALUES
EXPLAIN EXTENDED
SELECT t1.a,t2.c FROM t1,t2 WHERE t2.pk = t1.a AND t2.pk > 8;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 16 100.00 Using where
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00
+1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 12 75.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 16 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`pk` = `test`.`t1`.`a` and `test`.`t1`.`a` > 8
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`pk` and `test`.`t2`.`pk` > 8
FLUSH STATUS;
SELECT t1.a,t2.c FROM t1,t2 WHERE t2.pk = t1.a AND t2.pk > 8;
a c
@@ -4225,22 +4222,34 @@ a c
SHOW STATUS LIKE 'Handler_read_%';
Variable_name Value
Handler_read_first 0
-Handler_read_key 1
+Handler_read_key 0
Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_retry 0
Handler_read_rnd 0
Handler_read_rnd_deleted 0
-Handler_read_rnd_next 17
+Handler_read_rnd_next 30
+analyze table t1,t2;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze status OK
+test.t2 analyze status Engine-independent statistics collected
+test.t2 analyze status OK
+explain extended SELECT t1.a,t2.c FROM t1,t2 WHERE t2.pk = t1.a AND t2.pk > 8;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 16 12.50 Using where
+1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`pk` = `test`.`t1`.`a` and `test`.`t1`.`a` > 8
CREATE VIEW v AS SELECT * FROM t2;
EXPLAIN EXTENDED
SELECT t1.a,v.c FROM t1,v WHERE v.pk = t1.a AND v.pk > 8;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 16 100.00 Using where
-1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00
+1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 12 75.00 Using where
+1 SIMPLE t1 ALL NULL NULL NULL NULL 16 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`pk` = `test`.`t1`.`a` and `test`.`t1`.`a` > 8
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`pk` and `test`.`t2`.`pk` > 8
FLUSH STATUS;
SELECT t1.a,v.c FROM t1,v WHERE v.pk = t1.a AND v.pk > 8;
a c
@@ -4249,14 +4258,20 @@ a c
SHOW STATUS LIKE 'Handler_read_%';
Variable_name Value
Handler_read_first 0
-Handler_read_key 1
+Handler_read_key 0
Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_retry 0
Handler_read_rnd 0
Handler_read_rnd_deleted 0
-Handler_read_rnd_next 17
+Handler_read_rnd_next 30
+set statement optimizer_where_cost=100 FOR explain extended SELECT t1.a,v.c FROM t1,v WHERE v.pk = t1.a AND v.pk > 8;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 16 100.00 Using where
+1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`c` AS `c` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`pk` = `test`.`t1`.`a` and `test`.`t1`.`a` > 8
DROP VIEW v;
DROP TABLE t1, t2;
#
@@ -5485,8 +5500,8 @@ from t1 left join v1 on v1.c=t1.b
where t1.a < 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range a a 5 NULL 3 100.00 Using index condition
-1 SIMPLE t2 ref c c 5 test.t1.b 2 100.00 Using where
-1 SIMPLE t3 ref f,e e 5 test.t2.d 2 100.00 Using where
+1 SIMPLE t2 ref c c 5 test.t1.b 1 100.00 Using where
+1 SIMPLE t3 ref f,e e 5 test.t2.d 1 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`e` AS `e`,`test`.`t3`.`f` AS `f` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`c` = `test`.`t1`.`b` and `test`.`t3`.`e` = `test`.`t2`.`d` and `test`.`t3`.`f` is not null and `test`.`t1`.`b` is not null and `test`.`t2`.`d` is not null) where `test`.`t1`.`a` < 5
explain extended
@@ -5496,8 +5511,8 @@ on t2.c=t1.b and t3.f is not null
where t1.a < 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range a a 5 NULL 3 100.00 Using index condition
-1 SIMPLE t2 ref c c 5 test.t1.b 2 100.00 Using where
-1 SIMPLE t3 ref f,e e 5 test.t2.d 2 100.00 Using where
+1 SIMPLE t2 ref c c 5 test.t1.b 1 100.00 Using where
+1 SIMPLE t3 ref f,e e 5 test.t2.d 1 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`e` AS `e`,`test`.`t3`.`f` AS `f` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`c` = `test`.`t1`.`b` and `test`.`t3`.`e` = `test`.`t2`.`d` and `test`.`t3`.`f` is not null and `test`.`t1`.`b` is not null and `test`.`t2`.`d` is not null) where `test`.`t1`.`a` < 5
explain extended
@@ -5507,7 +5522,7 @@ where t1.a < 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range a a 5 NULL 3 100.00 Using index condition
1 SIMPLE t3 eq_ref f,e f 4 test.t1.a 1 100.00 Using where
-1 SIMPLE t2 ref c c 5 test.t1.b 2 100.00 Using where
+1 SIMPLE t2 ref c c 5 test.t1.b 1 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`e` AS `e`,`test`.`t3`.`f` AS `f` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`c` = `test`.`t1`.`b` and `test`.`t3`.`f` = `test`.`t1`.`a` and `test`.`t2`.`d` = `test`.`t3`.`e` and `test`.`t1`.`a` is not null and `test`.`t1`.`a` is not null and `test`.`t1`.`b` is not null) where `test`.`t1`.`a` < 5
explain extended
@@ -5518,7 +5533,7 @@ where t1.a < 5;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 range a a 5 NULL 3 100.00 Using index condition
1 SIMPLE t3 eq_ref f,e f 4 test.t1.a 1 100.00 Using where
-1 SIMPLE t2 ref c c 5 test.t1.b 2 100.00 Using where
+1 SIMPLE t2 ref c c 5 test.t1.b 1 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d`,`test`.`t3`.`e` AS `e`,`test`.`t3`.`f` AS `f` from `test`.`t1` left join (`test`.`t2` join `test`.`t3`) on(`test`.`t2`.`c` = `test`.`t1`.`b` and `test`.`t3`.`f` = `test`.`t1`.`a` and `test`.`t2`.`d` = `test`.`t3`.`e` and `test`.`t1`.`a` is not null and `test`.`t1`.`a` is not null and `test`.`t1`.`b` is not null) where `test`.`t1`.`a` < 5
drop view v1;
diff --git a/mysql-test/main/view.test b/mysql-test/main/view.test
index 4c2d71d4..ddcaa296 100644
--- a/mysql-test/main/view.test
+++ b/mysql-test/main/view.test
@@ -1094,10 +1094,11 @@ insert into t1 values (1);
update v2 set s1 = 1;
select * from v2;
select * from t2;
-# scheck how VIEWs with subqueries work with prepared statements
+# check how VIEWs with subqueries work with prepared statements
prepare stmt1 from "select * from v2;";
execute stmt1;
insert into t1 values (0);
+--sorted_result
execute stmt1;
deallocate prepare stmt1;
drop view v2;
@@ -1126,15 +1127,16 @@ drop view v2, v1;
drop table t1;
#
-# inserting single value with check option failed always get error
+# inserting single value with check option warns like 2 values
#
create table t1 (s1 int);
create view v1 as select * from t1 where s1 < 5 with check option;
#single value
--- error ER_VIEW_CHECK_FAILED
insert ignore into v1 values (6);
+SHOW WARNINGS;
#several values
insert ignore into v1 values (6),(3);
+SHOW WARNINGS;
select * from t1;
drop view v1;
drop table t1;
@@ -1881,7 +1883,9 @@ CREATE VIEW v1 AS SELECT id, f FROM t1 WHERE id <= 2;
INSERT INTO t1 VALUES (2, 'foo2');
INSERT INTO t1 VALUES (1, 'foo1');
+--sorted_result
SELECT * FROM v1;
+--sorted_result
SELECT * FROM v1;
DROP VIEW v1;
@@ -4166,12 +4170,18 @@ FLUSH STATUS;
SELECT t1.a,t2.c FROM t1,t2 WHERE t2.pk = t1.a AND t2.pk > 8;
SHOW STATUS LIKE 'Handler_read_%';
+analyze table t1,t2;
+explain extended SELECT t1.a,t2.c FROM t1,t2 WHERE t2.pk = t1.a AND t2.pk > 8;
+
CREATE VIEW v AS SELECT * FROM t2;
EXPLAIN EXTENDED
SELECT t1.a,v.c FROM t1,v WHERE v.pk = t1.a AND v.pk > 8;
FLUSH STATUS;
SELECT t1.a,v.c FROM t1,v WHERE v.pk = t1.a AND v.pk > 8;
SHOW STATUS LIKE 'Handler_read_%';
+
+set statement optimizer_where_cost=100 FOR explain extended SELECT t1.a,v.c FROM t1,v WHERE v.pk = t1.a AND v.pk > 8;
+
DROP VIEW v;
DROP TABLE t1, t2;
diff --git a/mysql-test/main/view_grant.result b/mysql-test/main/view_grant.result
index 3754a55e..cfb8f7df 100644
--- a/mysql-test/main/view_grant.result
+++ b/mysql-test/main/view_grant.result
@@ -22,7 +22,7 @@ grant create view,select on test.* to mysqltest_1@localhost;
connect user1,localhost,mysqltest_1,,test;
connection user1;
create definer=root@localhost view v1 as select * from mysqltest.t1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, SET USER privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the SET USER privilege(s) for this operation
create view v1 as select * from mysqltest.t1;
alter view v1 as select * from mysqltest.t1;
ERROR 42000: DROP command denied to user 'mysqltest_1'@'localhost' for table `test`.`v1`
@@ -415,8 +415,6 @@ create table t2 (s1 int);
drop function if exists f2;
create function f2 () returns int begin declare v int; select s1 from t2
into v; return v; end//
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create algorithm=TEMPTABLE view v1 as select f2() from t1;
create algorithm=MERGE view v2 as select f2() from t1;
create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select f2() from t1;
@@ -459,8 +457,6 @@ create table t2 (s1 int);
drop function if exists f2;
create function f2 () returns int begin declare v int; select s1 from t2
into v; return v; end//
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create user mysqltest_1@localhost;
grant select on t1 to mysqltest_1@localhost;
grant execute on function f2 to mysqltest_1@localhost;
@@ -680,6 +676,7 @@ ERROR 42000: UPDATE command denied to user 'readonly'@'localhost' for table `mys
UPDATE mysqltest1.v_ts SET x= 200;
ERROR 42000: UPDATE command denied to user 'readonly'@'localhost' for table `mysqltest1`.`v_ts`
UPDATE mysqltest1.v_tu SET x= 200 WHERE x = 100;
+ERROR 42000: SELECT command denied to user 'readonly'@'localhost' for column 'x' in table 'v_tu'
UPDATE mysqltest1.v_tus SET x= 200 WHERE x = 100;
UPDATE mysqltest1.v_tu SET x= 200;
DELETE FROM mysqltest1.v_ts WHERE x= 200;
@@ -931,7 +928,7 @@ ERROR 42000: CREATE VIEW command denied to user 'u26813'@'localhost' for table `
ALTER VIEW v2 AS SELECT f2 FROM t1;
ERROR 42000: DROP command denied to user 'u26813'@'localhost' for table `db26813`.`v2`
ALTER VIEW v3 AS SELECT f2 FROM t1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, SET USER privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the SET USER privilege(s) for this operation
connection root;
SHOW CREATE VIEW v3;
View Create View character_set_client collation_connection
@@ -959,9 +956,9 @@ GRANT SELECT, DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_2@loc
GRANT SELECT ON mysqltest_29908.t1 TO u29908_2@localhost;
connect u2,localhost,u29908_2,,mysqltest_29908;
ALTER VIEW v1 AS SELECT f2 FROM t1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, SET USER privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the SET USER privilege(s) for this operation
ALTER VIEW v2 AS SELECT f2 FROM t1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, SET USER privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the SET USER privilege(s) for this operation
SHOW CREATE VIEW v2;
View Create View character_set_client collation_connection
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`u29908_1`@`localhost` SQL SECURITY INVOKER VIEW `v2` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
diff --git a/mysql-test/main/view_grant.test b/mysql-test/main/view_grant.test
index 9094c616..a7990b44 100644
--- a/mysql-test/main/view_grant.test
+++ b/mysql-test/main/view_grant.test
@@ -809,6 +809,7 @@ INSERT INTO mysqltest1.v_ti VALUES (100);
UPDATE mysqltest1.v_ts SET x= 200 WHERE x = 100;
--error ER_TABLEACCESS_DENIED_ERROR
UPDATE mysqltest1.v_ts SET x= 200;
+--error ER_COLUMNACCESS_DENIED_ERROR
UPDATE mysqltest1.v_tu SET x= 200 WHERE x = 100;
UPDATE mysqltest1.v_tus SET x= 200 WHERE x = 100;
UPDATE mysqltest1.v_tu SET x= 200;
diff --git a/mysql-test/main/win.result b/mysql-test/main/win.result
index 1c3be0bd..93652834 100644
--- a/mysql-test/main/win.result
+++ b/mysql-test/main/win.result
@@ -1402,6 +1402,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -1416,7 +1417,9 @@ EXPLAIN
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1437,6 +1440,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"window_functions_computation": {
@@ -1453,7 +1457,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1474,6 +1480,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -1488,7 +1495,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1511,6 +1520,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "MX in (3,5,7)",
"filesort": {
"sort_key": "t1.b",
@@ -1528,7 +1538,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1665,6 +1677,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -1679,7 +1692,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1697,6 +1712,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -1711,7 +1727,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1729,6 +1747,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -1743,7 +1762,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1761,6 +1782,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -1775,7 +1797,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1821,6 +1845,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "row_number() over ( order by t1.s1,t1.s2) desc",
"window_functions_computation": {
@@ -1837,7 +1862,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 6,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1981,6 +2008,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"duplicate_removal": {
"window_functions_computation": {
"sorts": [
@@ -1996,7 +2024,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -2161,6 +2191,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -2175,7 +2206,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 11,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -2228,6 +2261,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -2242,7 +2276,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 6,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -3827,6 +3863,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"window_functions_computation": {
@@ -3849,9 +3886,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
diff --git a/mysql-test/main/win.test b/mysql-test/main/win.test
index 2eed8783..51c91eb6 100644
--- a/mysql-test/main/win.test
+++ b/mysql-test/main/win.test
@@ -927,11 +927,13 @@ drop table t0,t1;
create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+--source include/explain-no-costs.inc
explain format=json select rank() over (order by a) from t0;
create table t1 (a int, b int, c int);
insert into t1 select a,a,a from t0;
+--source include/explain-no-costs.inc
explain format=json
select
a,
@@ -939,6 +941,7 @@ select
from t1
group by a;
+--source include/explain-no-costs.inc
explain format=json
select
a,
@@ -952,6 +955,7 @@ order by null;
--echo #
select b,max(a) as MX, rank() over (order by b) from t1 group by b having MX in (3,5,7);
+--source include/explain-no-costs.inc
explain format=json
select b,max(a) as MX, rank() over (order by b) from t1 group by b having MX in (3,5,7);
@@ -1041,24 +1045,28 @@ from t1;
show status like '%sort%';
# Check using EXPLAIN FORMAT=JSON
+--source include/explain-no-costs.inc
explain format=json
select
rank() over (partition by c order by a),
rank() over (partition by c order by a)
from t1;
+--source include/explain-no-costs.inc
explain format=json
select
rank() over (order by a),
row_number() over (order by a)
from t1;
+--source include/explain-no-costs.inc
explain format=json
select
rank() over (partition by c order by a),
count(*) over (partition by c)
from t1;
+--source include/explain-no-costs.inc
explain format=json
select
count(*) over (partition by c),
@@ -1091,6 +1099,7 @@ insert into t1 values (null,'a');
insert into t1 values (2,'b');
insert into t1 values (-1,'');
+--source include/explain-no-costs.inc
explain format=json
select *, row_number() over (order by s1, s2) as X from t1 order by X desc;
select *, row_number() over (order by s1, s2) as X from t1 order by X desc;
@@ -1179,6 +1188,7 @@ insert into t1 values
select rank() over (partition by part_id order by a) from t1;
select distinct rank() over (partition by part_id order by a) from t1;
+--source include/explain-no-costs.inc
explain format=json
select distinct rank() over (partition by part_id order by a) from t1;
@@ -1303,6 +1313,7 @@ select pk, a, d,
sum(d) over (order by a
ROWS BETWEEN 1 preceding and 2 following) as sum_2
from t1;
+--source include/explain-no-costs.inc
explain format=json
select pk, a, d,
sum(d) over (partition by a order by pk
@@ -1338,6 +1349,7 @@ insert into t1 values
(10, 5, 1000),
(10, 1, 100);
+--source include/explain-no-costs.inc
explain format=json
select
a,b,c,
diff --git a/mysql-test/main/win_empty_over.result b/mysql-test/main/win_empty_over.result
index 4fa53bb4..2f75f80c 100644
--- a/mysql-test/main/win_empty_over.result
+++ b/mysql-test/main/win_empty_over.result
@@ -36,6 +36,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -53,7 +54,9 @@ EXPLAIN
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["pk"],
+ "loops": 1,
"rows": 11,
+ "cost": "COST_REPLACED",
"filtered": 100,
"using_index": true
}
@@ -68,6 +71,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -85,7 +89,9 @@ EXPLAIN
"key": "PRIMARY",
"key_length": "4",
"used_key_parts": ["pk"],
+ "loops": 1,
"rows": 11,
+ "cost": "COST_REPLACED",
"filtered": 100,
"using_index": true
}
diff --git a/mysql-test/main/win_empty_over.test b/mysql-test/main/win_empty_over.test
index 91344d76..dff15a41 100644
--- a/mysql-test/main/win_empty_over.test
+++ b/mysql-test/main/win_empty_over.test
@@ -21,7 +21,9 @@ insert into t1 values
(11, 2, 10, NULL, 0.9, NULL);
select pk, row_number() over () from t1;
+--source include/explain-no-costs.inc
explain FORMAT=JSON select pk, row_number() over () from t1;
+--source include/explain-no-costs.inc
explain FORMAT=JSON select row_number() over (), pk from t1;
select row_number() over () from (select 4) as t;
diff --git a/mysql-test/main/xtradb_mrr.result b/mysql-test/main/xtradb_mrr.result
index b4c91d9a..7d84f605 100644
--- a/mysql-test/main/xtradb_mrr.result
+++ b/mysql-test/main/xtradb_mrr.result
@@ -431,6 +431,12 @@ INSERT INTO `t1` VALUES (97,7,0,'z','z');
INSERT INTO `t1` VALUES (98,1,1,'j','j');
INSERT INTO `t1` VALUES (99,7,8,'c','c');
INSERT INTO `t1` VALUES (100,2,5,'f','f');
+EXPLAIN SELECT table1 .`col_varchar_key`
+FROM t1 table1 STRAIGHT_JOIN ( t1 table3 JOIN t1 table4 ON table4 .`pk` = table3 .`col_int_nokey` ) ON table4 .`col_varchar_nokey` ;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE table1 index NULL col_varchar_key 9 NULL # Using index
+1 SIMPLE table3 ALL NULL NULL NULL NULL # Using where; Using join buffer (flat, BNL join)
+1 SIMPLE table4 eq_ref PRIMARY PRIMARY 4 test.table3.col_int_nokey # Using where
SELECT table1 .`col_varchar_key`
FROM t1 table1 STRAIGHT_JOIN ( t1 table3 JOIN t1 table4 ON table4 .`pk` = table3 .`col_int_nokey` ) ON table4 .`col_varchar_nokey` ;
col_varchar_key
diff --git a/mysql-test/main/xtradb_mrr.test b/mysql-test/main/xtradb_mrr.test
index 9de9b192..f5cecc54 100644
--- a/mysql-test/main/xtradb_mrr.test
+++ b/mysql-test/main/xtradb_mrr.test
@@ -151,6 +151,9 @@ INSERT INTO `t1` VALUES (97,7,0,'z','z');
INSERT INTO `t1` VALUES (98,1,1,'j','j');
INSERT INTO `t1` VALUES (99,7,8,'c','c');
INSERT INTO `t1` VALUES (100,2,5,'f','f');
+--replace_column 9 #
+EXPLAIN SELECT table1 .`col_varchar_key`
+FROM t1 table1 STRAIGHT_JOIN ( t1 table3 JOIN t1 table4 ON table4 .`pk` = table3 .`col_int_nokey` ) ON table4 .`col_varchar_nokey` ;
SELECT table1 .`col_varchar_key`
FROM t1 table1 STRAIGHT_JOIN ( t1 table3 JOIN t1 table4 ON table4 .`pk` = table3 .`col_int_nokey` ) ON table4 .`col_varchar_nokey` ;
DROP TABLE t1;
diff --git a/mysql-test/mariadb-test-run.pl b/mysql-test/mariadb-test-run.pl
index 8bd45e5b..e2d3fa64 100755
--- a/mysql-test/mariadb-test-run.pl
+++ b/mysql-test/mariadb-test-run.pl
@@ -186,6 +186,7 @@ my @DEFAULT_SUITES= qw(
compat/mssql-
compat/maxdb-
encryption-
+ events-
federated-
funcs_1-
funcs_2-
@@ -200,6 +201,7 @@ my @DEFAULT_SUITES= qw(
json-
maria-
mariabackup-
+ merge-
multi_source-
optimizer_unfixed_bugs-
parts-
@@ -1323,14 +1325,14 @@ sub command_line_setup {
# In the RPM case, binaries and libraries are installed in the
# default system locations, instead of having our own private base
- # directory. And we install "/usr/share/mysql-test". Moving up one
- # more directory relative to "mysql-test" gives us a usable base
+ # directory. And we install "/usr/share/mariadb-test". Moving up one
+ # more directory relative to "mariadb-test" gives us a usable base
# directory for RPM installs.
if ( ! $source_dist and ! -d "$basedir/bin" )
{
$basedir= dirname($basedir);
}
- # For .deb, it's like RPM, but installed in /usr/share/mysql/mysql-test.
+ # For .deb, it's like RPM, but installed in /usr/share/mariadb/mariadb-test.
# So move up one more directory level yet.
if ( ! $source_dist and ! -d "$basedir/bin" )
{
@@ -1930,14 +1932,15 @@ sub executable_setup () {
$exe_mysql_plugin= mtr_exe_exists("$path_client_bindir/mariadb-plugin");
$exe_mariadb_conv= mtr_exe_exists("$path_client_bindir/mariadb-conv");
- $exe_mysql_embedded= mtr_exe_maybe_exists("$bindir/libmysqld/examples/mysql_embedded");
+ $exe_mysql_embedded= mtr_exe_maybe_exists("$bindir/libmysqld/examples/mariadb-embedded",
+ "$bindir/libmysqld/examples/mysql_embedded");
# Look for mysqltest executable
if ( $opt_embedded_server )
{
$exe_mysqltest=
- mtr_exe_exists("$bindir/libmysqld/examples$multiconfig/mysqltest_embedded",
- "$path_client_bindir/mysqltest_embedded");
+ mtr_exe_exists("$bindir/libmysqld/examples$multiconfig/mariadb-test-embedded",
+ "$path_client_bindir/mariadb-test-embedded");
}
else
{
@@ -1965,7 +1968,7 @@ sub client_debug_arg($$) {
if ( $opt_debug ) {
mtr_add_arg($args,
- "--loose-debug=d,info,warning,warnings:t:A,%s/log/%s.trace",
+ "--loose-debug-dbug=d,info,warning,warnings:t:A,%s/log/%s.trace",
$path_vardir_trace, $client_name)
}
}
@@ -2040,11 +2043,15 @@ sub mysql_client_test_arguments(){
# mysql_client_test executable may _not_ exist
if ( $opt_embedded_server ) {
$exe= mtr_exe_maybe_exists(
+ "$bindir/libmysqld/examples$multiconfig/mariadb-client-test-embedded",
+ "$bindir/bin/mariadb-client-test-embedded",
"$bindir/libmysqld/examples$multiconfig/mysql_client_test_embedded",
- "$bindir/bin/mysql_client_test_embedded");
+ "$bindir/bin/mysql_client_test_embedded");
} else {
- $exe= mtr_exe_maybe_exists("$bindir/tests$multiconfig/mysql_client_test",
- "$bindir/bin/mysql_client_test");
+ $exe= mtr_exe_maybe_exists("$bindir/tests$multiconfig/mariadb-client-test",
+ "$bindir/bin/mariadb-client-test",
+ "$bindir/tests$multiconfig/mysql_client_test",
+ "$bindir/bin/mysql_client_test");
}
my $args;
@@ -2249,10 +2256,10 @@ sub environment_setup {
# mysql_fix_privilege_tables.sql
# ----------------------------------------------------
my $file_mysql_fix_privilege_tables=
- mtr_file_exists("$bindir/scripts/mysql_fix_privilege_tables.sql",
- "$bindir/share/mysql_fix_privilege_tables.sql",
- "$bindir/share/mariadb/mysql_fix_privilege_tables.sql",
- "$bindir/share/mysql/mysql_fix_privilege_tables.sql");
+ mtr_file_exists("$bindir/scripts/mariadb_fix_privilege_tables.sql",
+ "$bindir/share/mariadb_fix_privilege_tables.sql",
+ "$bindir/share/mariadb/mariadb_fix_privilege_tables.sql",
+ "$bindir/share/mysql/mariadb_fix_privilege_tables.sql");
$ENV{'MYSQL_FIX_PRIVILEGE_TABLES'}= $file_mysql_fix_privilege_tables;
# ----------------------------------------------------
@@ -2327,6 +2334,8 @@ sub environment_setup {
# mariabackup
# ----------------------------------------------------
my $exe_mariabackup= mtr_exe_maybe_exists(
+ "$bindir/extra/mariabackup$multiconfig/mariadb-backup",
+ "$path_client_bindir/mariadb-backup",
"$bindir/extra/mariabackup$multiconfig/mariabackup",
"$path_client_bindir/mariabackup");
@@ -2783,6 +2792,7 @@ sub mysql_server_start($) {
# Copy datadir from installed system db
my $path= ($opt_parallel == 1) ? "$opt_vardir" : "$opt_vardir/..";
my $install_db= "$path/install.db";
+ mtr_verbose("copying $install_db to $datadir");
copytree($install_db, $datadir) if -d $install_db;
mtr_error("Failed to copy system db to '$datadir'") unless -d $datadir;
}
@@ -3100,6 +3110,7 @@ sub mysql_install_db {
# starting from 10.0 bootstrap scripts require InnoDB
mtr_add_arg($args, "--loose-innodb");
mtr_add_arg($args, "--loose-innodb-log-file-size=10M");
+ mtr_add_arg($args, "--loose-innodb-fast-shutdown=0");
mtr_add_arg($args, "--disable-sync-frm");
mtr_add_arg($args, "--tmpdir=%s", "$opt_vardir/tmp/");
mtr_add_arg($args, "--core-file");
@@ -3161,7 +3172,7 @@ sub mysql_install_db {
my $path_sql= my_find_file($install_basedir,
["mysql", "sql/share", "share/mariadb",
"share/mysql", "share", "scripts"],
- "mysql_system_tables.sql",
+ "mariadb_system_tables.sql",
NOT_REQUIRED);
if (-f $path_sql )
@@ -3172,7 +3183,7 @@ sub mysql_install_db {
# Add the offical mysql system tables
# for a production system
- mtr_appendfile_to_file("$sql_dir/mysql_system_tables.sql",
+ mtr_appendfile_to_file("$sql_dir/mariadb_system_tables.sql",
$bootstrap_sql_file);
my $gis_sp_path = $source_dist ? "$bindir/scripts" : $sql_dir;
@@ -3181,18 +3192,18 @@ sub mysql_install_db {
# Add the performance tables
# for a production system
- mtr_appendfile_to_file("$sql_dir/mysql_performance_tables.sql",
+ mtr_appendfile_to_file("$sql_dir/mariadb_performance_tables.sql",
$bootstrap_sql_file);
# Add the mysql system tables initial data
# for a production system
- mtr_appendfile_to_file("$sql_dir/mysql_system_tables_data.sql",
+ mtr_appendfile_to_file("$sql_dir/mariadb_system_tables_data.sql",
$bootstrap_sql_file);
# Add test data for timezone - this is just a subset, on a real
# system these tables will be populated either by mysql_tzinfo_to_sql
# or by downloading the timezone table package from our website
- mtr_appendfile_to_file("$sql_dir/mysql_test_data_timezone.sql",
+ mtr_appendfile_to_file("$sql_dir/mariadb_test_data_timezone.sql",
$bootstrap_sql_file);
# Fill help tables, just an empty file when running from bk repo
@@ -3202,7 +3213,7 @@ sub mysql_install_db {
$bootstrap_sql_file);
# Append sys schema
- mtr_appendfile_to_file("$gis_sp_path/mysql_sys_schema.sql",
+ mtr_appendfile_to_file("$gis_sp_path/mariadb_sys_schema.sql",
$bootstrap_sql_file);
mtr_tofile($bootstrap_sql_file, "CREATE DATABASE IF NOT EXISTS test CHARACTER SET latin1 COLLATE latin1_swedish_ci;\n");
@@ -5025,6 +5036,7 @@ sub mysqld_stop {
mtr_add_arg($args, "--host=%s", $mysqld->value('#host'));
mtr_add_arg($args, "--connect_timeout=20");
mtr_add_arg($args, "--protocol=tcp");
+ mtr_add_arg($args, "--disable-ssl-verify-server-cert");
mtr_add_arg($args, "shutdown");
@@ -6040,7 +6052,7 @@ Misc options
phases of test execution.
stress=ARGS Run stress test, providing options to
mysql-stress-test.pl. Options are separated by comma.
- xml-report=<file> Output jUnit xml file of the results.
+ xml-report=<file> Output xml file of the results.
tail-lines=N Number of lines of the result to include in a failure
report.
diff --git a/mysql-test/std_data/bug47142_master-bin.000001 b/mysql-test/std_data/bug47142_master-bin.000001
deleted file mode 100644
index d1a089a7..00000000
--- a/mysql-test/std_data/bug47142_master-bin.000001
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/master-bin.000001 b/mysql-test/std_data/master-bin.000001
deleted file mode 100644
index 2ec2397a..00000000
--- a/mysql-test/std_data/master-bin.000001
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/trunc_binlog.000001 b/mysql-test/std_data/trunc_binlog.000001
deleted file mode 100644
index 3da2490e..00000000
--- a/mysql-test/std_data/trunc_binlog.000001
+++ /dev/null
Binary files differ
diff --git a/mysql-test/std_data/wsrep_notify_ssl.sh b/mysql-test/std_data/wsrep_notify_ssl.sh
index 12dc939e..d259ec4b 100755
--- a/mysql-test/std_data/wsrep_notify_ssl.sh
+++ b/mysql-test/std_data/wsrep_notify_ssl.sh
@@ -186,6 +186,8 @@ then
"$ssl_verify_server_cert" = "on" ]
then
SSL_PARAM="$SSL_PARAM --ssl-verify-server-cert"
+ else
+ SSL_PARAM="$SSL_PARAM --disable-ssl-verify-server-cert"
fi
fi
fi
diff --git a/mysql-test/suite.pm b/mysql-test/suite.pm
index c9eea9b6..3e5e024a 100644
--- a/mysql-test/suite.pm
+++ b/mysql-test/suite.pm
@@ -73,12 +73,7 @@ sub skip_combinations {
$skip{'main/openssl_6975.test'} = 'no or wrong openssl version'
unless $openssl_ver ge "1.0.1d" and $openssl_ver lt "1.1.1";
-
- $skip{'main/ssl_7937.combinations'} = [ 'x509v3' ]
- unless $ssl_lib =~ /WolfSSL/ or $openssl_ver ge "1.0.2";
-
- $skip{'main/ssl_verify_ip.test'} = 'x509v3 support required'
- unless $openssl_ver ge "1.0.2";
+ $skip{'main/func_kdf.combinations'} = [ $ssl_lib =~ /OpenSSL 1\.0\./ ? 'new' : 'old' ];
sub utf8_command_line_ok() {
if (IS_WINDOWS) {
diff --git a/mysql-test/suite/archive/archive.result b/mysql-test/suite/archive/archive.result
index 022b400f..0a6ec04f 100644
--- a/mysql-test/suite/archive/archive.result
+++ b/mysql-test/suite/archive/archive.result
@@ -12488,6 +12488,10 @@ SELECT b FROM t5 WHERE a =3;
b
in order to form a more pefect union
foo this is mine to think about
+explain
+SELECT b FROM t5 WHERE a IN (32, 23, 5);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t5 ALL a NULL NULL NULL 11 Using where
SELECT b FROM t5 WHERE a IN (32, 23, 5);
b
foo grok
diff --git a/mysql-test/suite/archive/archive.test b/mysql-test/suite/archive/archive.test
index 1367a30c..2319154c 100644
--- a/mysql-test/suite/archive/archive.test
+++ b/mysql-test/suite/archive/archive.test
@@ -1445,8 +1445,9 @@ INSERT INTO t5 VALUES (NULL, "promote the general welfare");
SELECT * FROM t5;
SELECT b FROM t5;
SELECT b FROM t5 WHERE a =3;
+explain
+SELECT b FROM t5 WHERE a IN (32, 23, 5);
SELECT b FROM t5 WHERE a IN (32, 23, 5);
-
#More blob tests
diff --git a/mysql-test/suite/atomic/alter_partition.test b/mysql-test/suite/atomic/alter_partition.test
index 23b996cf..ff4635d3 100644
--- a/mysql-test/suite/atomic/alter_partition.test
+++ b/mysql-test/suite/atomic/alter_partition.test
@@ -1,7 +1,7 @@
--source include/have_partition.inc
--source include/have_debug.inc
--source include/have_sequence.inc
---source include/binlog_combinations.inc
+--source include/binlog_format_combinations.inc
--source include/have_binlog_format_row_or_statement.inc
--source include/not_valgrind.inc
diff --git a/mysql-test/suite/binlog/include/binlog_expire_warnings.inc b/mysql-test/suite/binlog/include/binlog_expire_warnings.inc
index 3f879bff..04a00f11 100644
--- a/mysql-test/suite/binlog/include/binlog_expire_warnings.inc
+++ b/mysql-test/suite/binlog/include/binlog_expire_warnings.inc
@@ -87,7 +87,7 @@ if ($expect_binlog_off_days_and_seconds_warning) {
}
--let $assert_file = $ofile
---let $assert_select = You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
+--let $assert_select = You need to use --log-bin to make --expire-logs-days, --binlog-expire-logs-seconds or --max-binlog-total-size work.
--let $assert_only_after = Shutdown complete
--source include/assert_grep.inc
diff --git a/mysql-test/suite/binlog/include/binlog_incident-master.opt b/mysql-test/suite/binlog/include/binlog_incident-master.opt
index 57ce0081..4e746bf1 100644
--- a/mysql-test/suite/binlog/include/binlog_incident-master.opt
+++ b/mysql-test/suite/binlog/include/binlog_incident-master.opt
@@ -1 +1 @@
---loose-debug=+d,incident_database_resync_on_replace \ No newline at end of file
+--loose-debug-dbug=+d,incident_database_resync_on_replace
diff --git a/mysql-test/suite/binlog/include/binlog_ioerr.inc b/mysql-test/suite/binlog/include/binlog_ioerr.inc
index da6fb5ac..b710eccc 100644
--- a/mysql-test/suite/binlog/include/binlog_ioerr.inc
+++ b/mysql-test/suite/binlog/include/binlog_ioerr.inc
@@ -17,11 +17,14 @@ CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
INSERT INTO t1 VALUES(0);
SET @saved_dbug = @@SESSION.debug_dbug;
SET SESSION debug_dbug='+d,fail_binlog_write_1';
+# The error injection is in the "legacy" code path.
+SET GLOBAL binlog_legacy_event_pos= 1;
--error ER_ERROR_ON_WRITE
INSERT INTO t1 VALUES(1);
--error ER_ERROR_ON_WRITE
INSERT INTO t1 VALUES(2);
SET SESSION debug_dbug=@saved_dbug;
+SET GLOBAL binlog_legacy_event_pos= 0;
INSERT INTO t1 VALUES(3);
SELECT * FROM t1;
diff --git a/mysql-test/suite/binlog/include/row_img.test b/mysql-test/suite/binlog/include/row_img.test
new file mode 100644
index 00000000..42f3f273
--- /dev/null
+++ b/mysql-test/suite/binlog/include/row_img.test
@@ -0,0 +1,56 @@
+# Auxaliary script for test binlog_row_image
+#
+CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 varchar(100),
+ c3 INT DEFAULT 1000, c4 TEXT);
+CREATE TABLE t2 (c1 INT, c2 char(100), c3 INT DEFAULT 1000, c4 TEXT);
+
+FLUSH BINARY LOGS;
+--let $binlog= query_get_value(SHOW MASTER STATUS, File, 1)
+--let $datadir= `SELECT @@datadir`
+
+--let $img_mode= `SELECT @@binlog_row_image`
+--echo
+--echo #########################################################################
+--echo # binlog_row_image = $img_mode
+--echo #########################################################################
+--echo
+INSERT INTO t1 VALUES(1, "insert_to_t1", 1, repeat('a', 20)),
+ (2, "insert_to_t1", 2, repeat('a', 20)),
+ (3, "insert_to_t1", 3, repeat('a', 20));
+INSERT INTO t1(c1) VALUES(4);
+UPDATE t1 SET c2 = "only_c2_changed";
+UPDATE t1 SET c3 = 1, c4 = "c3_c4_changed";
+DELETE FROM t1 WHERE c1 = 1;
+
+--echo
+--echo # Verify that rows events are binlogged as expeced.
+--echo
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--replace_regex /^\# at .*// /.*SET (@@|TIMESTAMP).*// /.* end_log_pos .*// /xid=\d*/xid=<xid>/
+--exec $MYSQL_BINLOG --force-if-open --verbose --verbose --base64-output=DECODE-ROWS $datadir/$binlog
+
+FLUSH BINARY LOGS;
+--let $binlog= query_get_value(SHOW MASTER STATUS, File, 1)
+--let $datadir= `SELECT @@datadir`
+
+--echo
+--echo # t2 has no primary key.
+--echo # It will binlog full before and after image for all modes if the
+--echo # table has no primary key. FULL_NODUP follows the behavior.
+--echo
+INSERT INTO t2 VALUES(1, "insert_to_t2", 1, repeat('a', 20)),
+ (2, "insert_to_t2", 2, repeat('a', 20)),
+ (3, "insert_to_t2", 3, repeat('a', 20));
+INSERT INTO t2(c1) VALUES(4);
+UPDATE t2 SET c2 = "only_c2_changed";
+UPDATE t2 SET c3 = 1, c4 = "c3_c4_changed";
+DELETE FROM t2 WHERE c1 > 2;
+
+--echo
+--echo # Verify that rows events are binlogged as expeced.
+--echo
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--replace_regex /^\# at .*// /.*SET (@@|TIMESTAMP).*// /.* end_log_pos .*// /xid=\d*/xid=<xid>/
+--exec $MYSQL_BINLOG --force-if-open --verbose --verbose --base64-output=DECODE-ROWS $datadir/$binlog
+
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/binlog/my.cnf b/mysql-test/suite/binlog/my.cnf
new file mode 100644
index 00000000..a563433d
--- /dev/null
+++ b/mysql-test/suite/binlog/my.cnf
@@ -0,0 +1,4 @@
+!include include/default_my.cnf
+
+[mariadbd]
+slave_connections_needed_for_purge=0
diff --git a/mysql-test/suite/binlog/r/binlog_base64_flag.result b/mysql-test/suite/binlog/r/binlog_base64_flag.result
index c4c4fddb..4b75b712 100644
--- a/mysql-test/suite/binlog/r/binlog_base64_flag.result
+++ b/mysql-test/suite/binlog/r/binlog_base64_flag.result
@@ -1,7 +1,7 @@
call mtr.add_suppression("BINLOG_BASE64_EVENT: According to the master's version");
call mtr.add_suppression("BINLOG_BASE64_EVENT: Column 1 of table 'test.char128_utf8' cannot be converted");
-DROP TABLE IF EXISTS t1;
-==== Test BUG#32407 ====
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (1), (1);
select * from t1;
a
1
@@ -49,35 +49,6 @@ a
SELECT @binlog_fragment_0, @binlog_fragment_1 as 'NULL','NULL';
@binlog_fragment_0 NULL NULL
NULL NULL NULL
-==== Test --base64-output=never on a binlog with row events ====
-/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
-/*!40019 SET @@session.max_delayed_threads=0*/;
-/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
-DELIMITER /*!*/;
-<#>
-ROLLBACK/*!*/;
-<#>
-use `test`/*!*/;
-SET TIMESTAMP=1196959712/*!*/;
-<#>SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.system_versioning_insert_history=0/*!*/;
-SET @@session.sql_mode=0/*!*/;
-SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
-/*!\C latin1 *//*!*/;
-SET @@session.character_set_client=latin1,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
-SET @@session.lc_time_names=0/*!*/;
-SET @@session.collation_database=DEFAULT/*!*/;
-create table t1 (a int) engine= myisam
-/*!*/;
-<#>
-<#>
-<#>
-<#>
-<#>
-DELIMITER ;
-# End of log file
-ROLLBACK /* added by mysqlbinlog */;
-/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
-/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
==== Test non-matching FD event and Row event ====
BINLOG '
4CdYRw8BAAAAYgAAAGYAAAAAAAQANS4xLjE1LW5kYi02LjEuMjQtZGVidWctbG9nAAAAAAAAAAAA
diff --git a/mysql-test/suite/binlog/r/binlog_grant.result b/mysql-test/suite/binlog/r/binlog_grant.result
index edf70561..76cc415d 100644
--- a/mysql-test/suite/binlog/r/binlog_grant.result
+++ b/mysql-test/suite/binlog/r/binlog_grant.result
@@ -16,7 +16,7 @@ set session sql_log_bin = 1;
connection plain;
[plain]
set session sql_log_bin = 1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
**** Variable BINLOG_FORMAT ****
connection root;
[root]
@@ -25,9 +25,9 @@ set session binlog_format = row;
connection plain;
[plain]
set global binlog_format = row;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
set session binlog_format = row;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
**** Clean up ****
disconnect plain;
disconnect root;
@@ -45,7 +45,10 @@ disconnect rpl;
connection default;
DROP USER 'mysqltest_1'@'localhost';
#
-# Start of 10.5 test
+# End of 10.4 tests
+#
+#
+# Start of 10.5 tests
#
#
# MDEV-21743 Split up SUPER privilege to smaller privileges
@@ -61,29 +64,29 @@ SHOW GRANTS FOR user1@localhost;
Grants for user1@localhost
GRANT USAGE ON *.* TO `user1`@`localhost`
DROP USER user1@localhost;
-# Test if SHOW BINARY LOGS and SHOW BINGLOG STATUS are not allowed without REPLICATION CLIENT or SUPER
+# Test if SHOW BINARY LOGS and SHOW BINGLOG STATUS are not allowed without REPLICATION CLIENT
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION CLIENT, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION CLIENT ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SHOW MASTER LOGS;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG MONITOR privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG MONITOR privilege(s) for this operation
SHOW BINARY LOGS;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG MONITOR privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG MONITOR privilege(s) for this operation
SHOW BINLOG STATUS;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG MONITOR privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG MONITOR privilege(s) for this operation
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test if PURGE BINARY LOGS is not allowed without BINLOG ADMIN or SUPER
+# Test if PURGE BINARY LOGS is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
PURGE BINARY LOGS BEFORE '2001-01-01 00:00:00';
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
disconnect user1;
connection default;
DROP USER user1@localhost;
@@ -96,15 +99,6 @@ PURGE BINARY LOGS BEFORE '2001-01-01 00:00:00';
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test if PURGE BINLOG is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,"*NO-ONE*";
-connection user1;
-PURGE BINARY LOGS BEFORE '2001-01-01 00:00:00';
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
# Test if SHOW BINLOG EVENTS is not allowed without BINLOG MONITOR
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
@@ -142,7 +136,7 @@ connect user1,localhost,user1,,;
RENAME TABLE t1 to t2;
connection default;
REVOKE BINLOG REPLAY ON *.* FROM user1@localhost;
-call mtr.add_suppression("Access denied; you need (at least one of) the SUPER, BINLOG REPLAY privilege(s) for this operation");
+call mtr.add_suppression("Access denied; you need (at least one of) the BINLOG REPLAY privilege(s) for this operation");
# Privilege errors are expected now:
connection user1;
connection default;
diff --git a/mysql-test/suite/binlog/r/binlog_gtid_index.result b/mysql-test/suite/binlog/r/binlog_gtid_index.result
new file mode 100644
index 00000000..e53e1aac
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_gtid_index.result
@@ -0,0 +1,135 @@
+SET GLOBAL binlog_gtid_index= 0;
+SET GLOBAL binlog_gtid_index= 1;
+SET @gtid1= @@gtid_binlog_pos;
+CREATE TABLE t1 (a INT PRIMARY KEY);
+SET @gtid2= @@gtid_binlog_pos;
+INSERT INTO t1 VALUES (1);
+SET @gtid3= @@gtid_binlog_pos;
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+SET @gtid4= @@gtid_binlog_pos;
+INSERT INTO t1 VALUES (5);
+SET @gtid5= @@gtid_binlog_pos;
+SET @gtid6= @@gtid_binlog_pos;
+INSERT INTO t1 VALUES (106);
+INSERT INTO t1 VALUES (107);
+Ok
+1
+Ok
+1
+Ok
+1
+Ok
+1
+Ok
+1
+Ok
+1
+FLUSH BINARY LOGS;
+Ok
+1
+Ok
+1
+Ok
+1
+Ok
+1
+Ok
+1
+Ok
+1
+*** Test that purge deletes the gtid index files. ***
+FLUSH BINARY LOGS;
+INSERT INTO t1 VALUES (200);
+FLUSH BINARY LOGS;
+INSERT INTO t1 VALUES (201);
+FLUSH BINARY LOGS;
+INSERT INTO t1 VALUES (202);
+PURGE BINARY LOGS TO 'FILE';
+*** Test missed index lookup due to missing or corrupt index file.
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+INSERT INTO t1 VALUES (301);
+INSERT INTO t1 VALUES (302);
+INSERT INTO t1 VALUES (303);
+SET @gtid_pos= @@GLOBAL.gtid_binlog_pos;
+INSERT INTO t1 VALUES (304);
+INSERT INTO t1 VALUES (305);
+FLUSH NO_WRITE_TO_BINLOG STATUS;
++++ Initial status:
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+Variable_name Value
+Binlog_gtid_index_hit 0
+Binlog_gtid_index_miss 0
++++ GTID Lookup in good index.
+Gtid_Lookup_Ok
+1
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+Variable_name Value
+Binlog_gtid_index_hit 1
+Binlog_gtid_index_miss 0
++++ GTID Lookup, index file is missing.
+Gtid_Lookup_Ok
+1
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+Variable_name Value
+Binlog_gtid_index_hit 1
+Binlog_gtid_index_miss 1
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+INSERT INTO t1 VALUES (306);
+SET @gtid_pos= @@GLOBAL.gtid_binlog_pos;
+INSERT INTO t1 VALUES (307);
+INSERT INTO t1 VALUES (308);
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
++++ GTID Lookup, first page of index is corrupt.
+Gtid_Lookup_Ok
+1
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+Variable_name Value
+Binlog_gtid_index_hit 1
+Binlog_gtid_index_miss 2
+SET @old_page_size= @@GLOBAL.binlog_gtid_index_page_size;
+SET @old_span_min= @@GLOBAL.binlog_gtid_index_span_min;
+SET GLOBAL binlog_gtid_index_page_size= 64;
+SET GLOBAL binlog_gtid_index_span_min= 1;
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+INSERT INTO t1 VALUES (310);
+INSERT INTO t1 VALUES (311);
+INSERT INTO t1 VALUES (312);
+SET @gtid_pos= @@GLOBAL.gtid_binlog_pos;
+INSERT INTO t1 VALUES (313);
+INSERT INTO t1 VALUES (314);
+INSERT INTO t1 VALUES (315);
+INSERT INTO t1 VALUES (316);
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+SET GLOBAL binlog_gtid_index_page_size= @old_page_size;
+SET GLOBAL binlog_gtid_index_span_min= @old_span_min;
++++ GTID Lookup, root page of index is corrupt.
+Gtid_Lookup_Ok
+1
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+Variable_name Value
+Binlog_gtid_index_hit 1
+Binlog_gtid_index_miss 3
+*** Test BINLOG_GTID_POS() with too-large offset.
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+INSERT INTO t1 VALUES (401);
+INSERT INTO t1 VALUES (402);
++++ Test the hot index.
+SELECT BINLOG_GTID_POS('FILE', 100000000);
+BINLOG_GTID_POS('FILE', 100000000)
+NULL
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+Variable_name Value
+Binlog_gtid_index_hit 2
+Binlog_gtid_index_miss 3
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
++++ Test the cold index.
+SELECT BINLOG_GTID_POS('FILE', 100000000);
+BINLOG_GTID_POS('FILE', 100000000)
+NULL
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+Variable_name Value
+Binlog_gtid_index_hit 3
+Binlog_gtid_index_miss 3
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/r/binlog_gtid_index_crash.result b/mysql-test/suite/binlog/r/binlog_gtid_index_crash.result
new file mode 100644
index 00000000..91e5a6c9
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_gtid_index_crash.result
@@ -0,0 +1,28 @@
+*** Test that binlog GTID index is recovered after a crash.
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+Ok
+1
+Ok
+1
+Ok
+1
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+Variable_name Value
+Binlog_gtid_index_hit 3
+Binlog_gtid_index_miss 0
+*** Crash the server, check that GTID index can be used after restart.
+SET debug_dbug="d,crash_shutdown";
+shutdown;
+ERROR HY000: Lost connection to server during query
+FLUSH NO_WRITE_TO_BINLOG STATUS;
+Ok
+1
+Ok
+1
+Ok
+1
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+Variable_name Value
+Binlog_gtid_index_hit 3
+Binlog_gtid_index_miss 0
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/r/binlog_ioerr.result b/mysql-test/suite/binlog/r/binlog_ioerr.result
index e4f00a01..aa4042d3 100644
--- a/mysql-test/suite/binlog/r/binlog_ioerr.result
+++ b/mysql-test/suite/binlog/r/binlog_ioerr.result
@@ -4,11 +4,13 @@ CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
INSERT INTO t1 VALUES(0);
SET @saved_dbug = @@SESSION.debug_dbug;
SET SESSION debug_dbug='+d,fail_binlog_write_1';
+SET GLOBAL binlog_legacy_event_pos= 1;
INSERT INTO t1 VALUES(1);
ERROR HY000: Error writing file 'master-bin' (errno: 28 "No space left on device")
INSERT INTO t1 VALUES(2);
ERROR HY000: Error writing file 'master-bin' (errno: 28 "No space left on device")
SET SESSION debug_dbug=@saved_dbug;
+SET GLOBAL binlog_legacy_event_pos= 0;
INSERT INTO t1 VALUES(3);
SELECT * FROM t1;
a
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_raw_flush.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_raw_flush.result
index d6977880..87152e82 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_raw_flush.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_raw_flush.result
@@ -1,4 +1,5 @@
RESET MASTER;
+RESET MASTER;
#
# MDEV-30698 Cover missing test cases for mariadb-binlog options
# --raw [and] --flashback
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
index b793887a..4ae2a7d4 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
@@ -1934,7 +1934,6 @@ START TRANSACTION
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
-SET @@session.time_zone='SYSTEM'/*!*/;
COMMIT
/*!*/;
# at #
@@ -2320,6 +2319,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c37 NATIONAL CHAR)
/*!*/;
# at #
@@ -2378,6 +2378,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c38 NATIONAL CHAR(0))
/*!*/;
# at #
@@ -2436,6 +2437,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c39 NATIONAL CHAR(1))
/*!*/;
# at #
@@ -2494,6 +2496,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c40 NATIONAL CHAR(255))
/*!*/;
# at #
@@ -2576,6 +2579,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c41 CHAR CHARACTER SET UCS2)
/*!*/;
# at #
@@ -2634,6 +2638,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c42 CHAR(0) CHARACTER SET UCS2)
/*!*/;
# at #
@@ -2692,6 +2697,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c43 CHAR(1) CHARACTER SET UCS2)
/*!*/;
# at #
@@ -2750,6 +2756,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c44 CHAR(255) CHARACTER SET UCS2)
/*!*/;
# at #
@@ -3064,6 +3071,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c49 NATIONAL VARCHAR(0))
/*!*/;
# at #
@@ -3122,6 +3130,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c50 NATIONAL VARCHAR(1))
/*!*/;
# at #
@@ -3180,6 +3189,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c51 NATIONAL VARCHAR(255))
/*!*/;
# at #
@@ -3262,6 +3272,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c52 NATIONAL VARCHAR(261))
/*!*/;
# at #
@@ -3344,6 +3355,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c53 VARCHAR(0) CHARACTER SET ucs2)
/*!*/;
# at #
@@ -3402,6 +3414,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c54 VARCHAR(1) CHARACTER SET ucs2)
/*!*/;
# at #
@@ -3460,6 +3473,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c55 VARCHAR(255) CHARACTER SET ucs2)
/*!*/;
# at #
@@ -3518,6 +3532,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c56 VARCHAR(261) CHARACTER SET ucs2)
/*!*/;
# at #
@@ -4656,6 +4671,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c67 TINYTEXT CHARACTER SET UCS2)
/*!*/;
# at #
@@ -4714,6 +4730,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c70 TEXT CHARACTER SET UCS2)
/*!*/;
# at #
@@ -4772,6 +4789,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c73 MEDIUMTEXT CHARACTER SET UCS2)
/*!*/;
# at #
@@ -4830,6 +4848,7 @@ DROP TABLE `t1` /* generated by server */
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t1 (c76 LONGTEXT CHARACTER SET UCS2)
/*!*/;
# at #
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
index 9e88917c..c0c6b7db 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
@@ -2275,6 +2275,7 @@ SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
SET @@session.character_set_client=utf8mb3,@@session.collation_connection=33,@@session.collation_server=X/*!*/;
+SET @@session.character_set_collations=''/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (
@@ -5367,6 +5368,7 @@ SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
SET @@session.character_set_client=utf8mb3,@@session.collation_connection=33,@@session.collation_server=X/*!*/;
+SET @@session.character_set_collations=''/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (
@@ -5767,6 +5769,7 @@ SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
SET @@session.character_set_client=utf8mb3,@@session.collation_connection=33,@@session.collation_server=X/*!*/;
+SET @@session.character_set_collations=''/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (
@@ -5781,6 +5784,7 @@ c_1_n INT -- row number
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t2 (
c_2_1 DATE,
c_2_2 VARCHAR(255),
@@ -5793,6 +5797,7 @@ c_2_n INT -- row number
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t3 (
c_3_1 DATE,
c_3_2 VARCHAR(255),
@@ -6405,6 +6410,7 @@ SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
SET @@session.character_set_client=utf8mb3,@@session.collation_connection=33,@@session.collation_server=X/*!*/;
+SET @@session.character_set_collations=''/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
index 916bed0c..9186d065 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
@@ -2273,6 +2273,7 @@ SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
SET @@session.character_set_client=utf8mb3,@@session.collation_connection=33,@@session.collation_server=X/*!*/;
+SET @@session.character_set_collations=''/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (
@@ -2550,7 +2551,6 @@ START TRANSACTION
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
-SET @@session.time_zone='SYSTEM'/*!*/;
COMMIT
/*!*/;
# at #
@@ -5388,6 +5388,7 @@ SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
SET @@session.character_set_client=utf8mb3,@@session.collation_connection=33,@@session.collation_server=X/*!*/;
+SET @@session.character_set_collations=''/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (
@@ -5794,6 +5795,7 @@ SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
SET @@session.character_set_client=utf8mb3,@@session.collation_connection=33,@@session.collation_server=X/*!*/;
+SET @@session.character_set_collations=''/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (
@@ -5808,6 +5810,7 @@ c_1_n INT -- row number
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t2 (
c_2_1 DATE,
c_2_2 VARCHAR(255),
@@ -5820,6 +5823,7 @@ c_2_n INT -- row number
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t3 (
c_3_1 DATE,
c_3_2 VARCHAR(255),
@@ -6442,6 +6446,7 @@ SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
SET @@session.character_set_client=utf8mb3,@@session.collation_connection=33,@@session.collation_server=X/*!*/;
+SET @@session.character_set_collations=''/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
index 5735b9b8..1a49ad29 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
@@ -151,6 +151,7 @@ SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=X,@@session.collation_connection=X,@@session.collation_server=X/*!*/;
+SET @@session.character_set_collations=''/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (
@@ -164,6 +165,7 @@ c2 VARCHAR(20)
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations=''/*!*/;
CREATE TABLE t2 (
c1 INT,
c2 VARCHAR(20)
diff --git a/mysql-test/suite/binlog/r/binlog_old_versions.result b/mysql-test/suite/binlog/r/binlog_old_versions.result
deleted file mode 100644
index 30b64535..00000000
--- a/mysql-test/suite/binlog/r/binlog_old_versions.result
+++ /dev/null
@@ -1,70 +0,0 @@
-==== Read binlog with v2 row events ====
-SELECT * FROM t1 ORDER BY a;
-a b
-0 last_insert_id
-1 one
-3 last stm in trx: next event should be xid
-4 four
-62046 random
-SELECT * FROM t2 ORDER BY a;
-a b
-3 first stm in trx
-SELECT COUNT(*) FROM t3;
-COUNT(*)
-17920
-DROP TABLE t1, t2, t3;
-==== Read modern binlog (version 5.1.23) ====
-SELECT * FROM t1 ORDER BY a;
-a b
-0 last_insert_id
-1 one
-3 last stm in trx: next event should be xid
-4 four
-674568 random
-SELECT * FROM t2 ORDER BY a;
-a b
-3 first stm in trx
-SELECT COUNT(*) FROM t3;
-COUNT(*)
-17920
-DROP TABLE t1, t2, t3;
-==== Read binlog from version 5.1.17 ====
-SELECT * FROM t1 ORDER BY a;
-a b
-0 last_insert_id
-1 one
-3 last stm in trx: next event should be xid
-4 four
-764247 random
-SELECT * FROM t2 ORDER BY a;
-a b
-3 first stm in trx
-SELECT COUNT(*) FROM t3;
-COUNT(*)
-17920
-DROP TABLE t1, t2, t3;
-==== Read binlog from version 4.1 ====
-SELECT * FROM t1 ORDER BY a;
-a b
-0 last_insert_id
-4 four
-190243 random
-SELECT COUNT(*) FROM t3;
-COUNT(*)
-17920
-DROP TABLE t1, t3;
-==== Read binlog from telco tree (mysql-5.1-telco-6.1) ====
-SELECT * FROM t1 ORDER BY a;
-a b
-0 last_insert_id
-1 one
-3 last stm in trx: next event should be xid
-4 four
-703356 random
-SELECT * FROM t2 ORDER BY a;
-a b
-3 first stm in trx
-SELECT COUNT(*) FROM t3;
-COUNT(*)
-17920
-DROP TABLE t1, t2, t3;
diff --git a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
index c02912b8..de8a9e89 100644
--- a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
+++ b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
@@ -97,6 +97,7 @@ SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
SET @@session.character_set_client=X,@@session.collation_connection=X,@@session.collation_server=X/*!*/;
+SET @@session.character_set_collations=''/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8)
diff --git a/mysql-test/suite/binlog/r/binlog_row_img.result b/mysql-test/suite/binlog/r/binlog_row_img.result
new file mode 100644
index 00000000..b4c4f26e
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_row_img.result
@@ -0,0 +1,1365 @@
+#
+# FULL_NODUP mode works as expected
+#
+SET binlog_row_image = "FULL_NODUP";
+CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 varchar(100),
+c3 INT DEFAULT 1000, c4 TEXT);
+CREATE TABLE t2 (c1 INT, c2 char(100), c3 INT DEFAULT 1000, c4 TEXT);
+FLUSH BINARY LOGS;
+
+#########################################################################
+# binlog_row_image = FULL_NODUP
+#########################################################################
+
+INSERT INTO t1 VALUES(1, "insert_to_t1", 1, repeat('a', 20)),
+(2, "insert_to_t1", 2, repeat('a', 20)),
+(3, "insert_to_t1", 3, repeat('a', 20));
+INSERT INTO t1(c1) VALUES(4);
+UPDATE t1 SET c2 = "only_c2_changed";
+UPDATE t1 SET c3 = 1, c4 = "c3_c4_changed";
+DELETE FROM t1 WHERE c1 = 1;
+
+# Verify that rows events are binlogged as expeced.
+
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# Warning: this binlog is either in use or was not closed properly.
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t1 VALUES(1, "insert_to_t1", 1, repeat('a', 20)),
+#Q> (2, "insert_to_t1", 2, repeat('a', 20)),
+#Q> (3, "insert_to_t1", 3, repeat('a', 20))
+### INSERT INTO `test`.`t1`
+### SET
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t1`
+### SET
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t1`
+### SET
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 3
+/*!\C latin1 *//*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t1(c1) VALUES(4)
+### INSERT INTO `test`.`t1`
+### SET
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2=NULL /* VARSTRING(100) meta=100 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t1 SET c2 = "only_c2_changed"
+### UPDATE `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2=NULL /* VARSTRING(100) meta=100 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t1 SET c3 = 1, c4 = "c3_c4_changed"
+### UPDATE `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> DELETE FROM t1 WHERE c1 = 1
+### DELETE FROM `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+FLUSH BINARY LOGS;
+
+# t2 has no primary key.
+# It will binlog full before and after image for all modes if the
+# table has no primary key. FULL_NODUP follows the behavior.
+
+INSERT INTO t2 VALUES(1, "insert_to_t2", 1, repeat('a', 20)),
+(2, "insert_to_t2", 2, repeat('a', 20)),
+(3, "insert_to_t2", 3, repeat('a', 20));
+INSERT INTO t2(c1) VALUES(4);
+UPDATE t2 SET c2 = "only_c2_changed";
+UPDATE t2 SET c3 = 1, c4 = "c3_c4_changed";
+DELETE FROM t2 WHERE c1 > 2;
+
+# Verify that rows events are binlogged as expeced.
+
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# Warning: this binlog is either in use or was not closed properly.
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t2 VALUES(1, "insert_to_t2", 1, repeat('a', 20)),
+#Q> (2, "insert_to_t2", 2, repeat('a', 20)),
+#Q> (3, "insert_to_t2", 3, repeat('a', 20))
+### INSERT INTO `test`.`t2`
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t2`
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t2`
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 3
+/*!\C latin1 *//*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t2(c1) VALUES(4)
+### INSERT INTO `test`.`t2`
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2=NULL /* STRING(100) meta=65124 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t2 SET c2 = "only_c2_changed"
+### UPDATE `test`.`t2`
+### WHERE
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2=NULL /* STRING(100) meta=65124 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t2 SET c3 = 1, c4 = "c3_c4_changed"
+### UPDATE `test`.`t2`
+### WHERE
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> DELETE FROM t2 WHERE c1 > 2
+### DELETE FROM `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### DELETE FROM `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 2
+COMMIT
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+DROP TABLE t1, t2;
+#
+# MINIMAL mode works as expected
+#
+SET binlog_row_image = "MINIMAL";
+CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 varchar(100),
+c3 INT DEFAULT 1000, c4 TEXT);
+CREATE TABLE t2 (c1 INT, c2 char(100), c3 INT DEFAULT 1000, c4 TEXT);
+FLUSH BINARY LOGS;
+
+#########################################################################
+# binlog_row_image = MINIMAL
+#########################################################################
+
+INSERT INTO t1 VALUES(1, "insert_to_t1", 1, repeat('a', 20)),
+(2, "insert_to_t1", 2, repeat('a', 20)),
+(3, "insert_to_t1", 3, repeat('a', 20));
+INSERT INTO t1(c1) VALUES(4);
+UPDATE t1 SET c2 = "only_c2_changed";
+UPDATE t1 SET c3 = 1, c4 = "c3_c4_changed";
+DELETE FROM t1 WHERE c1 = 1;
+
+# Verify that rows events are binlogged as expeced.
+
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# Warning: this binlog is either in use or was not closed properly.
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t1 VALUES(1, "insert_to_t1", 1, repeat('a', 20)),
+#Q> (2, "insert_to_t1", 2, repeat('a', 20)),
+#Q> (3, "insert_to_t1", 3, repeat('a', 20))
+### INSERT INTO `test`.`t1`
+### SET
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t1`
+### SET
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t1`
+### SET
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 3
+/*!\C latin1 *//*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t1(c1) VALUES(4)
+### INSERT INTO `test`.`t1`
+### SET
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t1 SET c2 = "only_c2_changed"
+### UPDATE `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### SET
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### SET
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### SET
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### SET
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t1 SET c3 = 1, c4 = "c3_c4_changed"
+### UPDATE `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### SET
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### SET
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### SET
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### SET
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> DELETE FROM t1 WHERE c1 = 1
+### DELETE FROM `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+FLUSH BINARY LOGS;
+
+# t2 has no primary key.
+# It will binlog full before and after image for all modes if the
+# table has no primary key. FULL_NODUP follows the behavior.
+
+INSERT INTO t2 VALUES(1, "insert_to_t2", 1, repeat('a', 20)),
+(2, "insert_to_t2", 2, repeat('a', 20)),
+(3, "insert_to_t2", 3, repeat('a', 20));
+INSERT INTO t2(c1) VALUES(4);
+UPDATE t2 SET c2 = "only_c2_changed";
+UPDATE t2 SET c3 = 1, c4 = "c3_c4_changed";
+DELETE FROM t2 WHERE c1 > 2;
+
+# Verify that rows events are binlogged as expeced.
+
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# Warning: this binlog is either in use or was not closed properly.
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t2 VALUES(1, "insert_to_t2", 1, repeat('a', 20)),
+#Q> (2, "insert_to_t2", 2, repeat('a', 20)),
+#Q> (3, "insert_to_t2", 3, repeat('a', 20))
+### INSERT INTO `test`.`t2`
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t2`
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t2`
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 3
+/*!\C latin1 *//*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t2(c1) VALUES(4)
+### INSERT INTO `test`.`t2`
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2=NULL /* STRING(100) meta=65124 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t2 SET c2 = "only_c2_changed"
+### UPDATE `test`.`t2`
+### WHERE
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2=NULL /* STRING(100) meta=65124 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t2 SET c3 = 1, c4 = "c3_c4_changed"
+### UPDATE `test`.`t2`
+### WHERE
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> DELETE FROM t2 WHERE c1 > 2
+### DELETE FROM `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### DELETE FROM `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 2
+COMMIT
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+DROP TABLE t1, t2;
+#
+# NOBLOB mode works as expected
+#
+SET binlog_row_image = "NOBLOB";
+CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 varchar(100),
+c3 INT DEFAULT 1000, c4 TEXT);
+CREATE TABLE t2 (c1 INT, c2 char(100), c3 INT DEFAULT 1000, c4 TEXT);
+FLUSH BINARY LOGS;
+
+#########################################################################
+# binlog_row_image = NOBLOB
+#########################################################################
+
+INSERT INTO t1 VALUES(1, "insert_to_t1", 1, repeat('a', 20)),
+(2, "insert_to_t1", 2, repeat('a', 20)),
+(3, "insert_to_t1", 3, repeat('a', 20));
+INSERT INTO t1(c1) VALUES(4);
+UPDATE t1 SET c2 = "only_c2_changed";
+UPDATE t1 SET c3 = 1, c4 = "c3_c4_changed";
+DELETE FROM t1 WHERE c1 = 1;
+
+# Verify that rows events are binlogged as expeced.
+
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# Warning: this binlog is either in use or was not closed properly.
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t1 VALUES(1, "insert_to_t1", 1, repeat('a', 20)),
+#Q> (2, "insert_to_t1", 2, repeat('a', 20)),
+#Q> (3, "insert_to_t1", 3, repeat('a', 20))
+### INSERT INTO `test`.`t1`
+### SET
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t1`
+### SET
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t1`
+### SET
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 3
+/*!\C latin1 *//*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t1(c1) VALUES(4)
+### INSERT INTO `test`.`t1`
+### SET
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2=NULL /* VARSTRING(100) meta=100 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t1 SET c2 = "only_c2_changed"
+### UPDATE `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2=NULL /* VARSTRING(100) meta=100 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### SET
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t1 SET c3 = 1, c4 = "c3_c4_changed"
+### UPDATE `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### SET
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> DELETE FROM t1 WHERE c1 = 1
+### DELETE FROM `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+FLUSH BINARY LOGS;
+
+# t2 has no primary key.
+# It will binlog full before and after image for all modes if the
+# table has no primary key. FULL_NODUP follows the behavior.
+
+INSERT INTO t2 VALUES(1, "insert_to_t2", 1, repeat('a', 20)),
+(2, "insert_to_t2", 2, repeat('a', 20)),
+(3, "insert_to_t2", 3, repeat('a', 20));
+INSERT INTO t2(c1) VALUES(4);
+UPDATE t2 SET c2 = "only_c2_changed";
+UPDATE t2 SET c3 = 1, c4 = "c3_c4_changed";
+DELETE FROM t2 WHERE c1 > 2;
+
+# Verify that rows events are binlogged as expeced.
+
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# Warning: this binlog is either in use or was not closed properly.
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t2 VALUES(1, "insert_to_t2", 1, repeat('a', 20)),
+#Q> (2, "insert_to_t2", 2, repeat('a', 20)),
+#Q> (3, "insert_to_t2", 3, repeat('a', 20))
+### INSERT INTO `test`.`t2`
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t2`
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t2`
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 3
+/*!\C latin1 *//*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t2(c1) VALUES(4)
+### INSERT INTO `test`.`t2`
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2=NULL /* STRING(100) meta=65124 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t2 SET c2 = "only_c2_changed"
+### UPDATE `test`.`t2`
+### WHERE
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2=NULL /* STRING(100) meta=65124 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t2 SET c3 = 1, c4 = "c3_c4_changed"
+### UPDATE `test`.`t2`
+### WHERE
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> DELETE FROM t2 WHERE c1 > 2
+### DELETE FROM `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### DELETE FROM `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 2
+COMMIT
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+DROP TABLE t1, t2;
+#
+# FULL mode works as expected
+#
+SET binlog_row_image = "FULL";
+CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 varchar(100),
+c3 INT DEFAULT 1000, c4 TEXT);
+CREATE TABLE t2 (c1 INT, c2 char(100), c3 INT DEFAULT 1000, c4 TEXT);
+FLUSH BINARY LOGS;
+
+#########################################################################
+# binlog_row_image = FULL
+#########################################################################
+
+INSERT INTO t1 VALUES(1, "insert_to_t1", 1, repeat('a', 20)),
+(2, "insert_to_t1", 2, repeat('a', 20)),
+(3, "insert_to_t1", 3, repeat('a', 20));
+INSERT INTO t1(c1) VALUES(4);
+UPDATE t1 SET c2 = "only_c2_changed";
+UPDATE t1 SET c3 = 1, c4 = "c3_c4_changed";
+DELETE FROM t1 WHERE c1 = 1;
+
+# Verify that rows events are binlogged as expeced.
+
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# Warning: this binlog is either in use or was not closed properly.
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t1 VALUES(1, "insert_to_t1", 1, repeat('a', 20)),
+#Q> (2, "insert_to_t1", 2, repeat('a', 20)),
+#Q> (3, "insert_to_t1", 3, repeat('a', 20))
+### INSERT INTO `test`.`t1`
+### SET
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t1`
+### SET
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t1`
+### SET
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 3
+/*!\C latin1 *//*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t1(c1) VALUES(4)
+### INSERT INTO `test`.`t1`
+### SET
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2=NULL /* VARSTRING(100) meta=100 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t1 SET c2 = "only_c2_changed"
+### UPDATE `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='insert_to_t1' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2=NULL /* VARSTRING(100) meta=100 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t1 SET c3 = 1, c4 = "c3_c4_changed"
+### UPDATE `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t1`
+### WHERE
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @1=4 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> DELETE FROM t1 WHERE c1 = 1
+### DELETE FROM `test`.`t1`
+### WHERE
+### @1=1 /* INT meta=0 nullable=0 is_null=0 */
+### @2='only_c2_changed' /* VARSTRING(100) meta=100 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+FLUSH BINARY LOGS;
+
+# t2 has no primary key.
+# It will binlog full before and after image for all modes if the
+# table has no primary key. FULL_NODUP follows the behavior.
+
+INSERT INTO t2 VALUES(1, "insert_to_t2", 1, repeat('a', 20)),
+(2, "insert_to_t2", 2, repeat('a', 20)),
+(3, "insert_to_t2", 3, repeat('a', 20));
+INSERT INTO t2(c1) VALUES(4);
+UPDATE t2 SET c2 = "only_c2_changed";
+UPDATE t2 SET c3 = 1, c4 = "c3_c4_changed";
+DELETE FROM t2 WHERE c1 > 2;
+
+# Verify that rows events are binlogged as expeced.
+
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+# Warning: this binlog is either in use or was not closed properly.
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t2 VALUES(1, "insert_to_t2", 1, repeat('a', 20)),
+#Q> (2, "insert_to_t2", 2, repeat('a', 20)),
+#Q> (3, "insert_to_t2", 3, repeat('a', 20))
+### INSERT INTO `test`.`t2`
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t2`
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### INSERT INTO `test`.`t2`
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 3
+/*!\C latin1 *//*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> INSERT INTO t2(c1) VALUES(4)
+### INSERT INTO `test`.`t2`
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2=NULL /* STRING(100) meta=65124 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+# Number of rows: 1
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t2 SET c2 = "only_c2_changed"
+### UPDATE `test`.`t2`
+### WHERE
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='insert_to_t2' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2=NULL /* STRING(100) meta=65124 nullable=1 is_null=1 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> UPDATE t2 SET c3 = 1, c4 = "c3_c4_changed"
+### UPDATE `test`.`t2`
+### WHERE
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=2 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=3 /* INT meta=0 nullable=1 is_null=0 */
+### @4='aaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### SET
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### UPDATE `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1000 /* INT meta=0 nullable=1 is_null=0 */
+### @4=NULL /* BLOB/TEXT meta=2 nullable=1 is_null=1 */
+### SET
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 4
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+#Q> DELETE FROM t2 WHERE c1 > 2
+### DELETE FROM `test`.`t2`
+### WHERE
+### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+### DELETE FROM `test`.`t2`
+### WHERE
+### @1=4 /* INT meta=0 nullable=1 is_null=0 */
+### @2='only_c2_changed' /* STRING(100) meta=65124 nullable=1 is_null=0 */
+### @3=1 /* INT meta=0 nullable=1 is_null=0 */
+### @4='c3_c4_changed' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 2
+COMMIT
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+DROP TABLE t1, t2;
+RESET MASTER;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
index f9dc5d64..380e6f86 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result
@@ -99,6 +99,7 @@ SET @@session.sql_mode=1411383296/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8mb3 *//*!*/;
SET @@session.character_set_client=X,@@session.collation_connection=X,@@session.collation_server=X/*!*/;
+SET @@session.character_set_collations=''/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8)
@@ -126,6 +127,7 @@ START TRANSACTION
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=XXX/*!*/;
+SET @@session.character_set_collations=''/*!*/;
INSERT INTO t1 VALUES ('ä(i2)')
/*!*/;
# at #
@@ -171,6 +173,7 @@ START TRANSACTION
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0 xid=<xid>
SET TIMESTAMP=XXX/*!*/;
+SET @@session.character_set_collations=''/*!*/;
INSERT INTO t1 VALUES ('ä(p2)')
/*!*/;
# at #
diff --git a/mysql-test/suite/binlog/r/binlog_stm_do_db.result b/mysql-test/suite/binlog/r/binlog_stm_do_db.result
index c39404ae..391158b1 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_do_db.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_do_db.result
@@ -1,6 +1,6 @@
RESET MASTER;
-SET @old_isolation_level= @@session.tx_isolation;
-SET @@session.tx_isolation= 'READ-COMMITTED';
+SET @old_isolation_level= @@session.transaction_isolation;
+SET @@session.transaction_isolation= 'READ-COMMITTED';
CREATE DATABASE b42829;
use b42829;
CREATE TABLE t1 (x int, y int) engine=InnoDB;
@@ -43,4 +43,4 @@ master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `b42829`; CREATE TABLE t2 (x int, y int) engine=InnoDB
DROP DATABASE b42829;
DROP DATABASE b42829_filtered;
-SET @@session.tx_isolation= @old_isolation_level;
+SET @@session.transaction_isolation= @old_isolation_level;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_mysqlbinlog_collate_implicit.result b/mysql-test/suite/binlog/r/binlog_stm_mysqlbinlog_collate_implicit.result
new file mode 100644
index 00000000..1b9afbe6
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_stm_mysqlbinlog_collate_implicit.result
@@ -0,0 +1,193 @@
+RESET MASTER;
+SET timestamp=1000000000;
+#
+# MDEV-30164 System variable for default collations
+#
+SET character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin';
+CREATE TABLE t1 (a VARCHAR(20));
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb4);
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin);
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb3);
+INSERT INTO t1 VALUES ('a00');
+INSERT INTO t1 VALUES (_utf8mb3'a01-utf8mb3');
+INSERT INTO t1 VALUES (_utf8mb4'a01-utf8mb4');
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (?)';
+EXECUTE stmt USING _utf8mb3'a02-utf8mb3';
+EXECUTE stmt USING _utf8mb4'a02-utf8mb4';
+EXECUTE stmt USING CONVERT('a03-utf8mb3' USING utf8mb3);
+EXECUTE stmt USING CONVERT('a03-utf8mb4' USING utf8mb4);
+EXECUTE stmt USING IF(0,CONVERT('a04-utf8mb3' USING utf8mb3),CONVERT('a03-utf8mb4' USING utf8mb4));
+EXECUTE stmt USING IF(1,CONVERT('a04-utf8mb3' USING utf8mb3),CONVERT('a03-utf8mb4' USING utf8mb4));
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
+PREPARE stmt FROM 'CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb4)';
+EXECUTE stmt;
+DROP TABLE t1;
+DEALLOCATE PREPARE stmt;
+PREPARE stmt FROM 'CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb3)';
+EXECUTE stmt;
+DROP TABLE t1;
+DEALLOCATE PREPARE stmt;
+EXECUTE IMMEDIATE 'CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb4)';
+DROP TABLE t1;
+EXECUTE IMMEDIATE 'CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb3)';
+DROP TABLE t1;
+FLUSH LOGS;
+
+--- ---- ---
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
+/*!40019 SET @@session.max_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
+ROLLBACK/*!*/;
+use `test`/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.pseudo_thread_id=999999999/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1, @@session.sql_if_exists=0, @@session.explicit_defaults_for_timestamp=1, @@session.system_versioning_insert_history=0/*!*/;
+SET @@session.sql_mode=#/*!*/;
+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=latin1,@@session.collation_connection=8,@@session.collation_server=#/*!*/;
+SET @@session.lc_time_names=0/*!*/;
+SET @@session.collation_database=DEFAULT/*!*/;
+CREATE TABLE t1 (a VARCHAR(20))
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+DROP TABLE `t1` /* generated by server */
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb4)
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+DROP TABLE `t1` /* generated by server */
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin)
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+DROP TABLE `t1` /* generated by server */
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb3)
+/*!*/;
+START TRANSACTION
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+INSERT INTO t1 VALUES ('a00')
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+INSERT INTO t1 VALUES (_utf8mb3'a01-utf8mb3')
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+INSERT INTO t1 VALUES (_utf8mb4'a01-utf8mb4')
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+INSERT INTO t1 VALUES ('a02-utf8mb3')
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+INSERT INTO t1 VALUES ('a02-utf8mb4')
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+INSERT INTO t1 VALUES ('a03-utf8mb3')
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+INSERT INTO t1 VALUES ('a03-utf8mb4')
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+INSERT INTO t1 VALUES ('a03-utf8mb4')
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+START TRANSACTION
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+INSERT INTO t1 VALUES ('a04-utf8mb3')
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+DROP TABLE `t1` /* generated by server */
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb4)
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+DROP TABLE `t1` /* generated by server */
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb3)
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+DROP TABLE `t1` /* generated by server */
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb4)
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+DROP TABLE `t1` /* generated by server */
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin'/*!*/;
+CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb3)
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+DROP TABLE `t1` /* generated by server */
+/*!*/;
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
diff --git a/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-test/suite/binlog/r/binlog_unsafe.result
index 0c0b0e77..67849fc7 100644
--- a/mysql-test/suite/binlog/r/binlog_unsafe.result
+++ b/mysql-test/suite/binlog/r/binlog_unsafe.result
@@ -2338,11 +2338,7 @@ Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. REPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave
UPDATE t1 SET a=1 LIMIT 1;
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted
DELETE FROM t1 LIMIT 1;
-Warnings:
-Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted
CREATE PROCEDURE p1()
BEGIN
INSERT INTO t1 SELECT * FROM t1 LIMIT 1;
diff --git a/mysql-test/suite/binlog/r/flashback.result b/mysql-test/suite/binlog/r/flashback.result
index ec767f62..6ae3e194 100644
--- a/mysql-test/suite/binlog/r/flashback.result
+++ b/mysql-test/suite/binlog/r/flashback.result
@@ -706,6 +706,60 @@ DROP TABLE t1;
# MDEV-30698 Cover missing test cases for mariadb-binlog options
# --raw [and] --flashback
#
+#
+# < CASE 8 >
+# Verify flashback works well for binlog_row_image full_nodup mode
+#
+CREATE TABLE t1 (
+c01 TINYINT PRIMARY KEY,
+c02 SMALLINT,
+c03 MEDIUMINT,
+c04 INT,
+c05 BIGINT,
+c06 CHAR(10),
+c07 VARCHAR(20),
+c08 TEXT,
+c09 ENUM('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight'),
+c10 SET('black', 'white', 'red', 'yellow'),
+c11 TIMESTAMP(3),
+c12 DATETIME(3)
+) ENGINE = InnoDB;
+INSERT INTO t1 VALUES (1, 1, 1, 1, 1, 'A', 'A', 'A', 'one', 'black',
+'2023-11-26 10:00:00.123', '2023-11-26 10:00:00');
+INSERT INTO t1 VALUES (2, 1, 1, 1, 1, 'A', 'A', 'A', 'one', 'black',
+'2023-11-26 10:00:00.123', '2023-11-26 10:00:00');
+INSERT INTO t1 VALUES (3, 1, NULL, 1, 1, 'A', 'A', 'A', 'one', 'black',
+'2023-11-26 10:00:00.123', NULL);
+INSERT INTO t1 VALUES (4, 1, NULL, 1, 1, 'A', 'A', 'A', 'one', 'black',
+'2023-11-26 10:00:00.123', NULL);
+FLUSH BINARY LOGS;
+# The update includes the cases that
+# Value -> Value
+# Value -> NULL
+# NULL -> value
+# and the changed null bits in both first and second null byte
+UPDATE t1 SET c02 = NULL, c03 = 2, c09 = 'two',
+c10 = NULL, c12 = '2023-11-26 11:00:00';
+FLUSH BINARY LOGS;
+#
+# Data before flashback
+#
+SELECT * FROM t1;
+c01 c02 c03 c04 c05 c06 c07 c08 c09 c10 c11 c12
+1 NULL 2 1 1 A A A two NULL 2023-11-26 10:00:00.123 2023-11-26 11:00:00.000
+2 NULL 2 1 1 A A A two NULL 2023-11-26 10:00:00.123 2023-11-26 11:00:00.000
+3 NULL 2 1 1 A A A two NULL 2023-11-26 10:00:00.123 2023-11-26 11:00:00.000
+4 NULL 2 1 1 A A A two NULL 2023-11-26 10:00:00.123 2023-11-26 11:00:00.000
+#
+# Data after flashback
+#
+SELECT * FROM t1;
+c01 c02 c03 c04 c05 c06 c07 c08 c09 c10 c11 c12
+1 1 1 1 1 A A A one black 2023-11-26 10:00:00.123 2023-11-26 10:00:00.000
+2 1 1 1 1 A A A one black 2023-11-26 10:00:00.123 2023-11-26 10:00:00.000
+3 1 NULL 1 1 A A A one black 2023-11-26 10:00:00.123 NULL
+4 1 NULL 1 1 A A A one black 2023-11-26 10:00:00.123 NULL
+DROP TABLE t1;
SET binlog_format=statement;
Warnings:
Warning 1105 MariaDB Galera and flashback do not support binlog format: STATEMENT
diff --git a/mysql-test/suite/binlog/r/max_binlog_total_size.result b/mysql-test/suite/binlog/r/max_binlog_total_size.result
new file mode 100644
index 00000000..93f83cf2
--- /dev/null
+++ b/mysql-test/suite/binlog/r/max_binlog_total_size.result
@@ -0,0 +1,123 @@
+select @@global.max_binlog_total_size;
+@@global.max_binlog_total_size
+1500
+select @@global.max_binlog_size;
+@@global.max_binlog_size
+4096
+#
+# MDEV-31404 Implement binlog_space_limit
+#
+FLUSH LOGS;
+FLUSH LOGS;
+FLUSH LOGS;
+show binary logs;
+Log_name File_size
+binary.000001 #
+binary.000002 #
+binary.000003 #
+binary.000004 #
+show status like "binlog_disk_use";
+Variable_name Value
+Binlog_disk_use 1552
+set @@global.slave_connections_needed_for_purge= 0;
+# binary.000001 should be deleted now
+show binary logs;
+Log_name File_size
+binary.000002 #
+binary.000003 #
+binary.000004 #
+show status like "binlog_disk_use";
+Variable_name Value
+Binlog_disk_use 1183
+CREATE TABLE `t1` (
+`v1` int(11) DEFAULT NULL,
+`v2` varchar(8000) DEFAULT NULL,
+KEY `v1` (`v1`)
+) engine=myisam;
+INSERT INTO t1 VALUES (0,repeat("a",3000));
+show status like "binlog_disk_use";
+Variable_name Value
+Binlog_disk_use 3863
+# First binary should be binary.000004
+show binary logs;
+Log_name File_size
+binary.000004 #
+INSERT INTO t1 VALUES (2,repeat("b",10));
+# First binary should be binary.000004
+show binary logs;
+Log_name File_size
+binary.000004 #
+binary.000005 #
+FLUSH LOGS;
+# First binary should be binary.000005
+show binary logs;
+Log_name File_size
+binary.000005 #
+binary.000006 #
+FLUSH LOGS;
+FLUSH LOGS;
+FLUSH LOGS;
+FLUSH LOGS;
+show binary logs;
+Log_name File_size
+binary.000008 #
+binary.000009 #
+binary.000010 #
+show status like "binlog_disk_use";
+Variable_name Value
+Binlog_disk_use 1225
+PURGE BINARY LOGS TO 'binary.000009';
+# First binary should be binary.000009
+show binary logs;
+Log_name File_size
+binary.000009 #
+binary.000010 #
+INSERT INTO t1 VALUES (3,repeat("c",4000));
+# First binary should be binary.000010
+show binary logs;
+Log_name File_size
+binary.000010 #
+binary.000011 #
+INSERT INTO t1 VALUES (4,repeat("d",3000));
+# First binary should be binary.000011
+show binary logs;
+Log_name File_size
+binary.000011 #
+RESET MASTER;
+show binary logs;
+Log_name File_size
+binary.000001 #
+show status like "binlog_disk_use";
+Variable_name Value
+Binlog_disk_use 325
+INSERT INTO t1 VALUES (5,"e");
+FLUSH LOGS;
+INSERT INTO t1 VALUES (6,repeat("f",3000));
+show binary logs;
+Log_name File_size
+binary.000002 #
+show status like "binlog_disk_use";
+Variable_name Value
+Binlog_disk_use 3647
+INSERT INTO t1 VALUES (7,repeat("g",3000));
+# binary.000001 should be deleted now
+show binary logs;
+Log_name File_size
+binary.000002 #
+binary.000003 #
+show status like "binlog_disk_use";
+Variable_name Value
+Binlog_disk_use 7338
+FLUSH LOGS;
+FLUSH LOGS;
+# binary.000002 should be deleted now
+show binary logs;
+Log_name File_size
+binary.000003 423
+binary.000004 423
+binary.000005 379
+show status like "binlog_disk_use";
+Variable_name Value
+Binlog_disk_use 1225
+DROP TABLE IF EXISTS t1;
+set @@global.slave_connections_needed_for_purge= default;
diff --git a/mysql-test/suite/binlog/std_data/binlog_old_version_4_1.000001 b/mysql-test/suite/binlog/std_data/binlog_old_version_4_1.000001
deleted file mode 100644
index 66db9668..00000000
--- a/mysql-test/suite/binlog/std_data/binlog_old_version_4_1.000001
+++ /dev/null
Binary files differ
diff --git a/mysql-test/suite/binlog/std_data/bug32407.001 b/mysql-test/suite/binlog/std_data/bug32407.001
deleted file mode 100644
index c7324370..00000000
--- a/mysql-test/suite/binlog/std_data/bug32407.001
+++ /dev/null
Binary files differ
diff --git a/mysql-test/suite/binlog/std_data/ver_5_1-telco.001 b/mysql-test/suite/binlog/std_data/ver_5_1-telco.001
deleted file mode 100644
index 76856cb0..00000000
--- a/mysql-test/suite/binlog/std_data/ver_5_1-telco.001
+++ /dev/null
Binary files differ
diff --git a/mysql-test/suite/binlog/std_data/ver_5_1_17.001 b/mysql-test/suite/binlog/std_data/ver_5_1_17.001
deleted file mode 100644
index 9b6e200e..00000000
--- a/mysql-test/suite/binlog/std_data/ver_5_1_17.001
+++ /dev/null
Binary files differ
diff --git a/mysql-test/suite/binlog/std_data/ver_5_1_23.001 b/mysql-test/suite/binlog/std_data/ver_5_1_23.001
deleted file mode 100644
index 0e9a9d14..00000000
--- a/mysql-test/suite/binlog/std_data/ver_5_1_23.001
+++ /dev/null
Binary files differ
diff --git a/mysql-test/suite/binlog/std_data/ver_trunk_row_v2.001 b/mysql-test/suite/binlog/std_data/ver_trunk_row_v2.001
deleted file mode 100644
index 28360bec..00000000
--- a/mysql-test/suite/binlog/std_data/ver_trunk_row_v2.001
+++ /dev/null
Binary files differ
diff --git a/mysql-test/suite/binlog/t/binlog_base64_flag.test b/mysql-test/suite/binlog/t/binlog_base64_flag.test
index 5311da54..6935f69b 100644
--- a/mysql-test/suite/binlog/t/binlog_base64_flag.test
+++ b/mysql-test/suite/binlog/t/binlog_base64_flag.test
@@ -2,9 +2,6 @@
# work as expected, and that BINLOG statements with row events fail if
# they are not preceded by BINLOG statements with Format description
# events.
-#
-# See also BUG#32407.
-
# BINLOG statement does not work in embedded mode.
source include/not_embedded.inc;
@@ -12,23 +9,10 @@ source include/not_embedded.inc;
call mtr.add_suppression("BINLOG_BASE64_EVENT: According to the master's version");
call mtr.add_suppression("BINLOG_BASE64_EVENT: Column 1 of table 'test.char128_utf8' cannot be converted");
-disable_warnings;
-DROP TABLE IF EXISTS t1;
-enable_warnings;
-# Test to show BUG#32407. This reads a binlog created with the
-# mysql-5.1-telco-6.1 tree, specifically at the tag
-# mysql-5.1.15-ndb-6.1.23, and applies it to the database. The test
-# should fail before BUG#32407 was fixed and succeed afterwards.
---echo ==== Test BUG#32407 ====
-
-# The binlog contains row events equivalent to:
-# CREATE TABLE t1 (a int) engine = myisam
-# INSERT INTO t1 VALUES (1), (1)
-exec $MYSQL_BINLOG suite/binlog/std_data/bug32407.001 | $MYSQL;
-# The above line should succeed and t1 should contain two ones
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (1), (1);
select * from t1;
-
# Test that a BINLOG statement encoding a row event fails unless a
# Format_description_event as been supplied with an earlier BINLOG
# statement.
@@ -92,14 +76,6 @@ select * from t1;
# show "one-shot" feature of binlog_fragment variables
SELECT @binlog_fragment_0, @binlog_fragment_1 as 'NULL','NULL';
-# New mysqlbinlog supports --base64-output=never
---echo ==== Test --base64-output=never on a binlog with row events ====
-
-# mysqlbinlog should fail
---replace_regex /#[0-9][0-9][0-9][0-9][0-9][0-9] \N*/<#>/ /SET \@\@session.pseudo_thread_id.*/<#>/
-exec $MYSQL_BINLOG --base64-output=never --print-row-count=0 --print-row-event-positions=0 suite/binlog/std_data/bug32407.001;
-
-
# Test that the following fails cleanly: "First, read a
# Format_description event which has N event types. Then, read an
# event of type M>N"
diff --git a/mysql-test/suite/binlog/t/binlog_expire_warnings.opt b/mysql-test/suite/binlog/t/binlog_expire_warnings.opt
new file mode 100644
index 00000000..c85ef7d3
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_expire_warnings.opt
@@ -0,0 +1 @@
+--log-warnings=4
diff --git a/mysql-test/suite/binlog/t/binlog_grant.test b/mysql-test/suite/binlog/t/binlog_grant.test
index d573281f..5ece793e 100644
--- a/mysql-test/suite/binlog/t/binlog_grant.test
+++ b/mysql-test/suite/binlog/t/binlog_grant.test
@@ -30,7 +30,6 @@ connection plain;
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
set session sql_log_bin = 1;
-
# Testing setting both session and global BINLOG_FORMAT variable both
# as root and as plain user.
@@ -56,7 +55,6 @@ connection default;
set global binlog_format = @saved_binlog_format;
drop user mysqltest_1@localhost;
-
# Testing if REPLICATION CLIENT privilege is enough to execute
# SHOW MASTER LOGS and SHOW BINARY.
CREATE USER 'mysqltest_1'@'localhost';
@@ -77,9 +75,12 @@ SHOW BINLOG STATUS;
connection default;
DROP USER 'mysqltest_1'@'localhost';
+--echo #
+--echo # End of 10.4 tests
+--echo #
--echo #
---echo # Start of 10.5 test
+--echo # Start of 10.5 tests
--echo #
--echo #
@@ -95,11 +96,10 @@ REVOKE REPLICATION CLIENT ON *.* FROM user1@localhost;
SHOW GRANTS FOR user1@localhost;
DROP USER user1@localhost;
-
---echo # Test if SHOW BINARY LOGS and SHOW BINGLOG STATUS are not allowed without REPLICATION CLIENT or SUPER
+--echo # Test if SHOW BINARY LOGS and SHOW BINGLOG STATUS are not allowed without REPLICATION CLIENT
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION CLIENT, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION CLIENT ON *.* FROM user1@localhost;
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -112,11 +112,10 @@ SHOW BINLOG STATUS;
--connection default
DROP USER user1@localhost;
-
---echo # Test if PURGE BINARY LOGS is not allowed without BINLOG ADMIN or SUPER
+--echo # Test if PURGE BINARY LOGS is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -125,7 +124,6 @@ PURGE BINARY LOGS BEFORE '2001-01-01 00:00:00';
--connection default
DROP USER user1@localhost;
-
--echo # Test if PURGE BINLOG is allowed with BINLOG ADMIN
CREATE USER user1@localhost;
GRANT BINLOG ADMIN ON *.* TO user1@localhost;
@@ -136,18 +134,6 @@ PURGE BINARY LOGS BEFORE '2001-01-01 00:00:00';
connection default;
DROP USER user1@localhost;
-
---echo # Test if PURGE BINLOG is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,"*NO-ONE*")
---connection user1
-PURGE BINARY LOGS BEFORE '2001-01-01 00:00:00';
---disconnect user1
-connection default;
-DROP USER user1@localhost;
-
-
--echo # Test if SHOW BINLOG EVENTS is not allowed without BINLOG MONITOR
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
@@ -160,7 +146,6 @@ SHOW BINLOG EVENTS;
--connection default
DROP USER user1@localhost;
-
--echo # Test if SHOW BINLOG EVENTS is allowed with BINLOG MONITOR
CREATE USER user1@localhost;
GRANT BINLOG MONITOR ON *.* TO user1@localhost;
@@ -196,7 +181,7 @@ RENAME TABLE t1 to t2;
--connection default
REVOKE BINLOG REPLAY ON *.* FROM user1@localhost;
-call mtr.add_suppression("Access denied; you need (at least one of) the SUPER, BINLOG REPLAY privilege(s) for this operation");
+call mtr.add_suppression("Access denied; you need (at least one of) the BINLOG REPLAY privilege(s) for this operation");
--echo # Privilege errors are expected now:
--connection user1
--error 1
diff --git a/mysql-test/suite/binlog/t/binlog_gtid_index.test b/mysql-test/suite/binlog/t/binlog_gtid_index.test
new file mode 100644
index 00000000..458b77ec
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_gtid_index.test
@@ -0,0 +1,229 @@
+--source include/have_binlog_format_mixed.inc
+
+SET GLOBAL binlog_gtid_index= 0;
+SET GLOBAL binlog_gtid_index= 1;
+
+--let $file= query_get_value(SHOW MASTER STATUS, File, 1)
+--let $pos1= query_get_value(SHOW MASTER STATUS, Position, 1)
+SET @gtid1= @@gtid_binlog_pos;
+CREATE TABLE t1 (a INT PRIMARY KEY);
+--let $pos2= query_get_value(SHOW MASTER STATUS, Position, 1)
+SET @gtid2= @@gtid_binlog_pos;
+INSERT INTO t1 VALUES (1);
+--let $pos3= query_get_value(SHOW MASTER STATUS, Position, 1)
+SET @gtid3= @@gtid_binlog_pos;
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+--let $pos4= query_get_value(SHOW MASTER STATUS, Position, 1)
+SET @gtid4= @@gtid_binlog_pos;
+INSERT INTO t1 VALUES (5);
+--let $pos5= query_get_value(SHOW MASTER STATUS, Position, 1)
+SET @gtid5= @@gtid_binlog_pos;
+
+--disable_query_log
+--let $i=0
+while ($i < 100) {
+ eval INSERT INTO t1 VALUES (6 + $i);
+ inc $i;
+}
+--enable_query_log
+--let $pos6= query_get_value(SHOW MASTER STATUS, Position, 1)
+SET @gtid6= @@gtid_binlog_pos;
+
+INSERT INTO t1 VALUES (106);
+INSERT INTO t1 VALUES (107);
+
+# Test first the hot and then the cold index.
+--let $i= 0
+while ($i < 2) {
+ --disable_query_log
+ eval SELECT BINLOG_GTID_POS('$file', $pos1) = @gtid1 AS Ok;
+ eval SELECT BINLOG_GTID_POS('$file', $pos2) = @gtid2 AS Ok;
+ eval SELECT BINLOG_GTID_POS('$file', $pos3) = @gtid3 AS Ok;
+ eval SELECT BINLOG_GTID_POS('$file', $pos4) = @gtid4 AS Ok;
+ eval SELECT BINLOG_GTID_POS('$file', $pos5) = @gtid5 AS Ok;
+ eval SELECT BINLOG_GTID_POS('$file', $pos6) = @gtid6 AS Ok;
+ --enable_query_log
+
+ inc $i;
+ if ($i == 1) {
+ FLUSH BINARY LOGS;
+ }
+}
+
+--echo *** Test that purge deletes the gtid index files. ***
+FLUSH BINARY LOGS;
+INSERT INTO t1 VALUES (200);
+--let $file2= query_get_value(SHOW MASTER STATUS, File, 1)
+FLUSH BINARY LOGS;
+INSERT INTO t1 VALUES (201);
+--let $file3= query_get_value(SHOW MASTER STATUS, File, 1)
+FLUSH BINARY LOGS;
+INSERT INTO t1 VALUES (202);
+--let $file4= query_get_value(SHOW MASTER STATUS, File, 1)
+
+--replace_result $file3 FILE
+eval PURGE BINARY LOGS TO '$file3';
+
+--let $MYSQLD_DATADIR= `select @@datadir`
+--error 1
+--file_exists $MYSQLD_DATADIR/$file.idx
+--error 1
+--file_exists $MYSQLD_DATADIR/$file2.idx
+--file_exists $MYSQLD_DATADIR/$file3.idx
+--file_exists $MYSQLD_DATADIR/$file4.idx
+
+--echo *** Test missed index lookup due to missing or corrupt index file.
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+--let $file= query_get_value(SHOW MASTER STATUS, File, 1)
+INSERT INTO t1 VALUES (301);
+INSERT INTO t1 VALUES (302);
+INSERT INTO t1 VALUES (303);
+--let $pos= query_get_value(SHOW MASTER STATUS, Position, 1)
+SET @gtid_pos= @@GLOBAL.gtid_binlog_pos;
+INSERT INTO t1 VALUES (304);
+INSERT INTO t1 VALUES (305);
+
+# BINLOG_GTID_POS() has a side effect: it increments binlog_gtid_index_hit
+--disable_ps2_protocol
+FLUSH NO_WRITE_TO_BINLOG STATUS;
+--echo +++ Initial status:
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+--echo +++ GTID Lookup in good index.
+--disable_query_log
+eval SELECT BINLOG_GTID_POS('$file', $pos) = @gtid_pos AS Gtid_Lookup_Ok;
+--enable_query_log
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+--remove_file $MYSQLD_DATADIR/$file.idx
+--echo +++ GTID Lookup, index file is missing.
+--disable_query_log
+eval SELECT BINLOG_GTID_POS('$file', $pos) = @gtid_pos AS Gtid_Lookup_Ok;
+--enable_query_log
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+--let $file= query_get_value(SHOW MASTER STATUS, File, 1)
+INSERT INTO t1 VALUES (306);
+--let $pos= query_get_value(SHOW MASTER STATUS, Position, 1)
+SET @gtid_pos= @@GLOBAL.gtid_binlog_pos;
+INSERT INTO t1 VALUES (307);
+INSERT INTO t1 VALUES (308);
+# Rotate again so we hit an on-disk index file, not the "hot" index.
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+
+# Corrupt the flag byte of the first page with an unused bit.
+--let FILE_TO_CORRUPT= $MYSQLD_DATADIR/$file.idx
+--perl
+use strict;
+use warnings;
+use Fcntl qw(:DEFAULT :seek);
+sysopen F, $ENV{FILE_TO_CORRUPT}, O_RDWR
+ or die "Cannot open file $ENV{FILE_TO_CORRUPT}: $!\n";
+# Corrupt the flag byte with an unused flag.
+sysseek(F, 16, SEEK_SET)
+ or die "Cannot seek file: $!\n";
+my $buf;
+sysread(F, $buf, 1)
+ or die "Cannot read file: $!\n";
+$buf= chr(ord($buf) | 0x80);
+sysseek(F, 16, SEEK_SET)
+ or die "Cannot seek file: $!\n";
+syswrite(F, $buf, 1) == 1
+ or die "Cannot write file: $!\n";
+close F;
+EOF
+
+--echo +++ GTID Lookup, first page of index is corrupt.
+--disable_query_log
+eval SELECT BINLOG_GTID_POS('$file', $pos) = @gtid_pos AS Gtid_Lookup_Ok;
+--enable_query_log
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+
+# Corrupt the last byte of the root page.
+# Set a small page-size so we test corruption in something not the header page.
+SET @old_page_size= @@GLOBAL.binlog_gtid_index_page_size;
+SET @old_span_min= @@GLOBAL.binlog_gtid_index_span_min;
+SET GLOBAL binlog_gtid_index_page_size= 64;
+SET GLOBAL binlog_gtid_index_span_min= 1;
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+--let $file= query_get_value(SHOW MASTER STATUS, File, 1)
+INSERT INTO t1 VALUES (310);
+INSERT INTO t1 VALUES (311);
+INSERT INTO t1 VALUES (312);
+--let $pos= query_get_value(SHOW MASTER STATUS, Position, 1)
+SET @gtid_pos= @@GLOBAL.gtid_binlog_pos;
+INSERT INTO t1 VALUES (313);
+INSERT INTO t1 VALUES (314);
+INSERT INTO t1 VALUES (315);
+INSERT INTO t1 VALUES (316);
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+SET GLOBAL binlog_gtid_index_page_size= @old_page_size;
+SET GLOBAL binlog_gtid_index_span_min= @old_span_min;
+
+--let FILE_TO_CORRUPT= $MYSQLD_DATADIR/$file.idx
+--perl
+use strict;
+use warnings;
+use Fcntl qw(:DEFAULT :seek);
+sysopen F, $ENV{FILE_TO_CORRUPT}, O_RDWR
+ or die "Cannot open file $ENV{FILE_TO_CORRUPT}: $!\n";
+# Tricky: The index is written asynchroneously, it may still be incomplete.
+# So wait for the file to be written completely with a root node at the end.
+my $count= 0;
+for (;;) {
+ my $end= sysseek(F, 0, SEEK_END);
+ if ($end > 0 && ($end % 64) == 0) {
+ # The index file is non-empty with a full page at the end, test if the
+ # root page has been fully written. This is seen as bit 2 (PAGE_FLAG_LAST)
+ # and bit 3 (PAGE_FLAG_ROOT) being set (0xc).
+ my $flag;
+ if (sysseek(F, -64, SEEK_CUR) &&
+ sysread(F, $flag, 1) &&
+ (ord($flag) & 0xc) == 0xc) {
+ last;
+ }
+ }
+ die "Timeout waiting for GTID index to be non-empty\n"
+ if ++$count >= 500;
+ # Simple way to do sub-second sleep.
+ select(undef, undef, undef, 0.050);
+}
+# Corrupt the flag byte with an unused flag.
+sysseek(F, -2, SEEK_END)
+ or die "Cannot seek file: $!\n";
+my $buf;
+sysread(F, $buf, 1)
+ or die "Cannot read file: $!\n";
+$buf= chr(ord($buf) ^ 0x4);
+sysseek(F, -2, SEEK_END)
+ or die "Cannot seek file: $!\n";
+syswrite(F, $buf, 1) == 1
+ or die "Cannot write file: $!\n";
+close F;
+EOF
+
+--echo +++ GTID Lookup, root page of index is corrupt.
+--disable_query_log
+eval SELECT BINLOG_GTID_POS('$file', $pos) = @gtid_pos AS Gtid_Lookup_Ok;
+--enable_query_log
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+
+--echo *** Test BINLOG_GTID_POS() with too-large offset.
+# New binlog to skip the now corrupted one.
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+--let $file= query_get_value(SHOW MASTER STATUS, File, 1)
+INSERT INTO t1 VALUES (401);
+INSERT INTO t1 VALUES (402);
+--echo +++ Test the hot index.
+--replace_result $file FILE
+eval SELECT BINLOG_GTID_POS('$file', 100000000);
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+--echo +++ Test the cold index.
+--replace_result $file FILE
+eval SELECT BINLOG_GTID_POS('$file', 100000000);
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+--enable_ps2_protocol
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/t/binlog_gtid_index_crash.opt b/mysql-test/suite/binlog/t/binlog_gtid_index_crash.opt
new file mode 100644
index 00000000..993e6613
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_gtid_index_crash.opt
@@ -0,0 +1 @@
+--binlog-gtid-index-page-size=128 --binlog-gtid-index-span-min=1
diff --git a/mysql-test/suite/binlog/t/binlog_gtid_index_crash.test b/mysql-test/suite/binlog/t/binlog_gtid_index_crash.test
new file mode 100644
index 00000000..965e08a4
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_gtid_index_crash.test
@@ -0,0 +1,66 @@
+--source include/have_innodb.inc
+# Don't test this under valgrind, memory leaks will occur
+--source include/not_valgrind.inc
+# Avoid CrashReporter popup on Mac
+--source include/not_crashrep.inc
+# Binary must be compiled with debug for crash to occur
+--source include/have_debug.inc
+--source include/have_binlog_format_row.inc
+
+# We have an .opt file that sets a small page size and disables sparseness,
+# so we get something non-trivial in the GTID index even with a small amount
+# of binlogged events.
+
+--echo *** Test that binlog GTID index is recovered after a crash.
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+
+--disable_query_log
+INSERT INTO t1 VALUES (0, 0);
+INSERT INTO t1 VALUES (1, 0);
+INSERT INTO t1 VALUES (2, 0);
+--let $i= 10
+while ($i < 20) {
+ eval INSERT INTO t1 VALUES ($i, 0);
+ inc $i;
+}
+--let $file= query_get_value(SHOW MASTER STATUS, File, 1)
+--let $pos1= query_get_value(SHOW MASTER STATUS, Position, 1)
+--let $gtid1= `SELECT @@gtid_binlog_pos`
+while ($i < 30) {
+ eval INSERT INTO t1 VALUES ($i, 0);
+ inc $i;
+}
+--let $pos2= query_get_value(SHOW MASTER STATUS, Position, 1)
+--let $gtid2= `SELECT @@gtid_binlog_pos`
+while ($i < 40) {
+ eval INSERT INTO t1 VALUES ($i, 0);
+ inc $i;
+}
+--let $pos3= query_get_value(SHOW MASTER STATUS, Position, 1)
+--let $gtid3= `SELECT @@gtid_binlog_pos`
+INSERT INTO t1 VALUES (50, 0);
+INSERT INTO t1 VALUES (51, 0);
+
+--disable_ps2_protocol
+FLUSH NO_WRITE_TO_BINLOG STATUS;
+eval SELECT BINLOG_GTID_POS('$file', $pos1) = "$gtid1" AS Ok;
+eval SELECT BINLOG_GTID_POS('$file', $pos2) = "$gtid2" AS Ok;
+eval SELECT BINLOG_GTID_POS('$file', $pos3) = "$gtid3" AS Ok;
+--enable_query_log
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+--enable_ps2_protocol
+
+--echo *** Crash the server, check that GTID index can be used after restart.
+--source include/crash_mysqld.inc
+
+--disable_ps2_protocol
+FLUSH NO_WRITE_TO_BINLOG STATUS;
+--disable_query_log
+eval SELECT BINLOG_GTID_POS('$file', $pos1) = "$gtid1" AS Ok;
+eval SELECT BINLOG_GTID_POS('$file', $pos2) = "$gtid2" AS Ok;
+eval SELECT BINLOG_GTID_POS('$file', $pos3) = "$gtid3" AS Ok;
+--enable_query_log
+SHOW STATUS LIKE 'binlog_gtid_index_%';
+--enable_ps2_protocol
+
+DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/t/binlog_killed.test b/mysql-test/suite/binlog/t/binlog_killed.test
index 7c3a262d..271da705 100644
--- a/mysql-test/suite/binlog/t/binlog_killed.test
+++ b/mysql-test/suite/binlog/t/binlog_killed.test
@@ -67,7 +67,7 @@ let $rows= `select count(*) from t2 /* must be 2 or 0 */`;
let $MYSQLD_DATADIR= `select @@datadir`;
--let $binlog_killed_pos=query_get_value(SHOW BINLOG EVENTS, Pos, 6)
---let $binlog_killed_end_log_pos=query_get_value(SHOW BINLOG EVENTS, End_log_pos, 6)
+--let $binlog_killed_end_log_pos=query_get_value(SHOW BINLOG EVENTS, Pos, 7)
--exec $MYSQL_BINLOG --force-if-open --start-position=$binlog_killed_pos --stop-position=$binlog_killed_end_log_pos $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--disable_result_log
diff --git a/mysql-test/suite/binlog/t/binlog_killed_simulate-master.opt b/mysql-test/suite/binlog/t/binlog_killed_simulate-master.opt
index 90c70ece..d6f14950 100644
--- a/mysql-test/suite/binlog/t/binlog_killed_simulate-master.opt
+++ b/mysql-test/suite/binlog/t/binlog_killed_simulate-master.opt
@@ -1 +1 @@
---loose-debug=d,simulate_kill_bug27571
+--loose-debug-dbug=d,simulate_kill_bug27571
diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_raw_flush.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_raw_flush.test
index 539a8fe5..e32d1e0e 100644
--- a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_raw_flush.test
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_raw_flush.test
@@ -23,6 +23,8 @@
# Test needs to reset the binlog as it is checking specific GTID.
RESET MASTER;
+RESET MASTER;
+
--echo #
--echo # MDEV-30698 Cover missing test cases for mariadb-binlog options
--echo # --raw [and] --flashback
diff --git a/mysql-test/suite/binlog/t/binlog_old_versions.test b/mysql-test/suite/binlog/t/binlog_old_versions.test
deleted file mode 100644
index 13010154..00000000
--- a/mysql-test/suite/binlog/t/binlog_old_versions.test
+++ /dev/null
@@ -1,153 +0,0 @@
-# Test that old binlog formats can be read.
-
-# Some previous versions of MySQL use their own binlog format,
-# especially in row-based replication. This test uses saved binlogs
-# from those old versions to test that we can replicate from old
-# versions to the present version.
-
-# Replicating from old versions to new versions is necessary in an
-# online upgrade scenario, where the .
-
-# The previous versions we currently test are:
-# - version 5.1.17 and earlier trees
-# - mysql-5.1-wl2325-xxx trees (AKA alcatel trees)
-# - mysql-5.1-telco-6.1 trees
-# For completeness, we also test mysql-5.1-new_rpl, which is supposed
-# to be the "correct" version.
-
-# All binlogs were generated with the same commands (listed at the end
-# of this test for reference). The binlogs contain the following
-# events: Table_map, Write_rows, Update_rows, Delete_rows Query, Xid,
-# User_var, Int_var, Rand, Begin_load, Append_file, Execute_load.
-
-# Related bugs: BUG#27779, BUG#31581, BUG#31582, BUG#31583, BUG#32407
-
-source include/not_embedded.inc;
-
---echo ==== Read binlog with v2 row events ====
-
-# Read binlog.
---exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/ver_trunk_row_v2.001 | $MYSQL --local-infile=1
-# Show result.
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY a;
-SELECT COUNT(*) FROM t3;
-# Reset.
-DROP TABLE t1, t2, t3;
-
-
---echo ==== Read modern binlog (version 5.1.23) ====
-
-# Read binlog.
---exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/ver_5_1_23.001 | $MYSQL --local-infile=1
-# Show result.
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY a;
-SELECT COUNT(*) FROM t3;
-# Reset.
-DROP TABLE t1, t2, t3;
-
-
---echo ==== Read binlog from version 5.1.17 ====
-
-# Read binlog.
---exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/ver_5_1_17.001 | $MYSQL --local-infile=1
-# Show result.
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY a;
-SELECT COUNT(*) FROM t3;
-# Reset.
-DROP TABLE t1, t2, t3;
-
-
---echo ==== Read binlog from version 4.1 ====
-
-# In this version, neither row-based binlogging nor Xid events
-# existed, so the binlog was generated without the "row-based tests"
-# part and the "get xid event" part, and it does not create table t2.
-
-# Read binlog.
---exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/binlog_old_version_4_1.000001 | $MYSQL --local-infile=1
-# Show result.
-SELECT * FROM t1 ORDER BY a;
-SELECT COUNT(*) FROM t3;
-# Reset.
-DROP TABLE t1, t3;
-
-
---echo ==== Read binlog from telco tree (mysql-5.1-telco-6.1) ====
-
-# Read binlog.
---exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ suite/binlog/std_data/ver_5_1-telco.001 | $MYSQL --local-infile=1
-# Show resulting tablea.
-SELECT * FROM t1 ORDER BY a;
-SELECT * FROM t2 ORDER BY a;
-SELECT COUNT(*) FROM t3;
-# Reset.
-DROP TABLE t1, t2, t3;
-
-
-#### The following commands were used to generate the binlogs ####
-#
-#source include/master-slave.inc;
-#
-## ==== initialize ====
-#USE test;
-#CREATE TABLE t1 (a int, b char(50)) ENGINE = MyISAM;
-#CREATE TABLE t2 (a int, b char(50)) ENGINE = InnoDB;
-#CREATE TABLE t3 (a char(20));
-#
-#
-## ==== row based tests ====
-#SET BINLOG_FORMAT='row';
-#
-## ---- get write, update, and delete rows events ----
-#INSERT INTO t1 VALUES (0, 'one'), (1, 'two');
-#UPDATE t1 SET a=a+1;
-#DELETE FROM t1 WHERE a=2;
-#
-#
-## ==== statement based tests ====
-#SET BINLOG_FORMAT = 'statement';
-#
-## ---- get xid events ----
-#BEGIN;
-#INSERT INTO t2 VALUES (3, 'first stm in trx');
-#INSERT INTO t1 VALUES (3, 'last stm in trx: next event should be xid');
-#COMMIT;
-#
-## ---- get user var events ----
-#SET @x = 4;
-#INSERT INTO t1 VALUES (@x, 'four');
-#
-## ---- get rand event ----
-#INSERT INTO t1 VALUES (RAND() * 1000000, 'random');
-#
-## ---- get intvar event ----
-#INSERT INTO t1 VALUES (LAST_INSERT_ID(), 'last_insert_id');
-#
-## ---- get begin, append and execute load events ----
-## double the file until we have more than 2^17 bytes, so that the
-## event has to be split and we can use Append_file_log_event.
-#
-#SET SQL_LOG_BIN=0;
-#CREATE TABLE temp (a char(20));
-#LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE temp;
-#INSERT INTO temp SELECT * FROM temp;
-#INSERT INTO temp SELECT * FROM temp;
-#INSERT INTO temp SELECT * FROM temp;
-#INSERT INTO temp SELECT * FROM temp;
-#INSERT INTO temp SELECT * FROM temp;
-#INSERT INTO temp SELECT * FROM temp;
-#INSERT INTO temp SELECT * FROM temp;
-#INSERT INTO temp SELECT * FROM temp;
-#SELECT a FROM temp INTO OUTFILE 'big_file.dat';
-#DROP TABLE temp;
-#SET SQL_LOG_BIN=1;
-#
-#LOAD DATA INFILE 'big_file.dat' INTO TABLE t3;
-#
-#SELECT * FROM t1 ORDER BY a;
-#SELECT * FROM t2 ORDER BY a;
-#SELECT COUNT(*) FROM t3;
-#--source include/rpl_end.inc
diff --git a/mysql-test/suite/binlog/t/binlog_row_img.test b/mysql-test/suite/binlog/t/binlog_row_img.test
new file mode 100644
index 00000000..a6624e7e
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_row_img.test
@@ -0,0 +1,35 @@
+################################################################################
+# Support binlog_row_image FULL_NODUP mode
+#
+# In FULL_NODUP:
+# - before image includes all columns.
+# - after image includes only changed columns.
+################################################################################
+
+--source include/have_binlog_format_row.inc
+--echo #
+--echo # FULL_NODUP mode works as expected
+--echo #
+SET binlog_row_image = "FULL_NODUP";
+--source suite/binlog/include/row_img.test
+
+--echo #
+--echo # MINIMAL mode works as expected
+--echo #
+SET binlog_row_image = "MINIMAL";
+--source suite/binlog/include/row_img.test
+
+--echo #
+--echo # NOBLOB mode works as expected
+--echo #
+SET binlog_row_image = "NOBLOB";
+--source suite/binlog/include/row_img.test
+
+--echo #
+--echo # FULL mode works as expected
+--echo #
+SET binlog_row_image = "FULL";
+--source suite/binlog/include/row_img.test
+
+RESET MASTER;
+
diff --git a/mysql-test/suite/binlog/t/binlog_stm_do_db.test b/mysql-test/suite/binlog/t/binlog_stm_do_db.test
index 3ed1734f..c83753eb 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_do_db.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_do_db.test
@@ -19,7 +19,7 @@
#
# The test is implemented as follows:
#
-# i) set tx_isolation to read-committed.
+# i) set transaction_isolation to read-committed.
#
# ii) create two databases (one filtered other not - using
# binlog-do-db)
@@ -38,8 +38,8 @@
-- source include/have_innodb.inc
-- source include/have_binlog_format_statement.inc
RESET MASTER; # clear up binlogs
-SET @old_isolation_level= @@session.tx_isolation;
-SET @@session.tx_isolation= 'READ-COMMITTED';
+SET @old_isolation_level= @@session.transaction_isolation;
+SET @@session.transaction_isolation= 'READ-COMMITTED';
-- let $engine= InnoDB
-- let $filtered= b42829_filtered
@@ -87,4 +87,4 @@ source include/show_binlog_events.inc;
-- eval DROP DATABASE $not_filtered
-- eval DROP DATABASE $filtered
-SET @@session.tx_isolation= @old_isolation_level;
+SET @@session.transaction_isolation= @old_isolation_level;
diff --git a/mysql-test/suite/binlog/t/binlog_stm_mysqlbinlog_collate_implicit.test b/mysql-test/suite/binlog/t/binlog_stm_mysqlbinlog_collate_implicit.test
new file mode 100644
index 00000000..77dad9de
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_stm_mysqlbinlog_collate_implicit.test
@@ -0,0 +1,77 @@
+-- source include/have_utf8.inc
+-- source include/have_utf8mb4.inc
+-- source include/have_ucs2.inc
+-- source include/have_binlog_format_statement.inc
+-- source include/have_log_bin.inc
+
+--disable_query_log
+CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+--enable_query_log
+
+RESET MASTER;
+SET timestamp=1000000000;
+
+--echo #
+--echo # MDEV-30164 System variable for default collations
+--echo #
+
+SET character_set_collations='utf8mb3=utf8mb3_bin,ucs2=ucs2_bin';
+
+CREATE TABLE t1 (a VARCHAR(20));
+DROP TABLE t1;
+
+CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb4);
+DROP TABLE t1;
+
+CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb3 COLLATE utf8mb3_bin);
+DROP TABLE t1;
+
+CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb3);
+
+INSERT INTO t1 VALUES ('a00');
+INSERT INTO t1 VALUES (_utf8mb3'a01-utf8mb3');
+INSERT INTO t1 VALUES (_utf8mb4'a01-utf8mb4');
+
+PREPARE stmt FROM 'INSERT INTO t1 VALUES (?)';
+EXECUTE stmt USING _utf8mb3'a02-utf8mb3';
+EXECUTE stmt USING _utf8mb4'a02-utf8mb4';
+
+EXECUTE stmt USING CONVERT('a03-utf8mb3' USING utf8mb3);
+EXECUTE stmt USING CONVERT('a03-utf8mb4' USING utf8mb4);
+
+EXECUTE stmt USING IF(0,CONVERT('a04-utf8mb3' USING utf8mb3),CONVERT('a03-utf8mb4' USING utf8mb4));
+EXECUTE stmt USING IF(1,CONVERT('a04-utf8mb3' USING utf8mb3),CONVERT('a03-utf8mb4' USING utf8mb4));
+
+DEALLOCATE PREPARE stmt;
+
+DROP TABLE t1;
+
+PREPARE stmt FROM 'CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb4)';
+EXECUTE stmt;
+DROP TABLE t1;
+DEALLOCATE PREPARE stmt;
+
+PREPARE stmt FROM 'CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb3)';
+EXECUTE stmt;
+DROP TABLE t1;
+DEALLOCATE PREPARE stmt;
+
+
+EXECUTE IMMEDIATE 'CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb4)';
+DROP TABLE t1;
+
+EXECUTE IMMEDIATE 'CREATE TABLE t1 (a VARCHAR(20) CHARACTER SET utf8mb3)';
+DROP TABLE t1;
+
+
+### Starting master-bin.000002
+FLUSH LOGS;
+
+--disable_query_log
+SELECT "--- ---- ---" as "";
+--enable_query_log
+
+let $MYSQLD_DATADIR= `select @@datadir`;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--replace_regex /SQL_LOAD_MB-[0-9a-f]+-[0-9a-f]+/SQL_LOAD_MB-#-#/ /@@session.sql_mode=\d+/@@session.sql_mode=#/ /collation_server=\d+/collation_server=#/
+--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000001
diff --git a/mysql-test/suite/binlog/t/binlog_table_map_optional_metadata.test b/mysql-test/suite/binlog/t/binlog_table_map_optional_metadata.test
index 4577c6c1..ea439730 100644
--- a/mysql-test/suite/binlog/t/binlog_table_map_optional_metadata.test
+++ b/mysql-test/suite/binlog/t/binlog_table_map_optional_metadata.test
@@ -275,7 +275,7 @@ INSERT INTO t1 VALUES(2, "b");
# The invalid metadata will case assertion failure on Write_rows_log_event
# So we need to stop mysqlbinlog before reading Write_rows_log_event.
---let $stop_position= query_get_value(SHOW BINLOG EVENTS FROM $start_pos LIMIT 3, End_log_pos, 3)
+--let $stop_position= query_get_value(SHOW BINLOG EVENTS FROM $start_pos LIMIT 4, Pos, 4)
--source include/print_optional_metadata.inc
--echo #
@@ -291,7 +291,7 @@ INSERT INTO t1(c_point) VALUES(ST_PointFromText('POINT(10 10)'));
# The invalid metadata will case assertion failure on Write_rows_log_event
# So we need to stop mysqlbinlog before reading Write_rows_log_event.
---let $stop_position= query_get_value(SHOW BINLOG EVENTS FROM $start_pos LIMIT 3, End_log_pos, 3)
+--let $stop_position= query_get_value(SHOW BINLOG EVENTS FROM $start_pos LIMIT 4, Pos, 4)
--source include/print_optional_metadata.inc
DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/t/binlog_truncate_multi_engine.test b/mysql-test/suite/binlog/t/binlog_truncate_multi_engine.test
index 12b0a743..61d097a8 100644
--- a/mysql-test/suite/binlog/t/binlog_truncate_multi_engine.test
+++ b/mysql-test/suite/binlog/t/binlog_truncate_multi_engine.test
@@ -12,6 +12,7 @@
--source include/have_debug.inc
--source include/have_debug_sync.inc
--source include/have_binlog_format_row.inc
+--source include/not_valgrind.inc
--let $old_max_binlog_size= `select @@global.max_binlog_size`
call mtr.add_suppression("Can.t init tc log");
diff --git a/mysql-test/suite/binlog/t/flashback.combinations b/mysql-test/suite/binlog/t/flashback.combinations
new file mode 100644
index 00000000..51716cbb
--- /dev/null
+++ b/mysql-test/suite/binlog/t/flashback.combinations
@@ -0,0 +1,4 @@
+[use_full_mode]
+binlog_row_image=FULL
+[use_full_nodup_mode]
+binlog_row_image=FULL_NODUP
diff --git a/mysql-test/suite/binlog/t/flashback.test b/mysql-test/suite/binlog/t/flashback.test
index 8daf3f43..fa20744b 100644
--- a/mysql-test/suite/binlog/t/flashback.test
+++ b/mysql-test/suite/binlog/t/flashback.test
@@ -372,6 +372,73 @@ DROP TABLE t1;
--error 1 # --raw mode and --flashback mode are not allowed
--exec $MYSQL_BINLOG -vv -B --raw --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000003> $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback_8.sql
+--echo #
+--echo # < CASE 8 >
+--echo # Verify flashback works well for binlog_row_image full_nodup mode
+--echo #
+CREATE TABLE t1 (
+ c01 TINYINT PRIMARY KEY,
+ c02 SMALLINT,
+ c03 MEDIUMINT,
+ c04 INT,
+ c05 BIGINT,
+ c06 CHAR(10),
+ c07 VARCHAR(20),
+ c08 TEXT,
+ c09 ENUM('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight'),
+ c10 SET('black', 'white', 'red', 'yellow'),
+ c11 TIMESTAMP(3),
+ c12 DATETIME(3)
+) ENGINE = InnoDB;
+
+INSERT INTO t1 VALUES (1, 1, 1, 1, 1, 'A', 'A', 'A', 'one', 'black',
+ '2023-11-26 10:00:00.123', '2023-11-26 10:00:00');
+INSERT INTO t1 VALUES (2, 1, 1, 1, 1, 'A', 'A', 'A', 'one', 'black',
+ '2023-11-26 10:00:00.123', '2023-11-26 10:00:00');
+INSERT INTO t1 VALUES (3, 1, NULL, 1, 1, 'A', 'A', 'A', 'one', 'black',
+ '2023-11-26 10:00:00.123', NULL);
+INSERT INTO t1 VALUES (4, 1, NULL, 1, 1, 'A', 'A', 'A', 'one', 'black',
+ '2023-11-26 10:00:00.123', NULL);
+
+--let $checksum_old= `CHECKSUM TABLE t1`
+
+FLUSH BINARY LOGS;
+--echo # The update includes the cases that
+--echo # Value -> Value
+--echo # Value -> NULL
+--echo # NULL -> value
+--echo # and the changed null bits in both first and second null byte
+
+UPDATE t1 SET c02 = NULL, c03 = 2, c09 = 'two',
+ c10 = NULL, c12 = '2023-11-26 11:00:00';
+--let $master_file= query_get_value("SHOW MASTER STATUS", File, 1)
+--let $MYSQLD_DATADIR= `select @@datadir`
+FLUSH BINARY LOGS;
+
+--echo #
+--echo # Data before flashback
+--echo #
+SELECT * FROM t1;
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--exec $MYSQL_BINLOG -B -vv $MYSQLD_DATADIR/$master_file > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback.sql
+--exec $MYSQL -e "SET binlog_format= ROW; source $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback.sql;"
+
+--echo #
+--echo # Data after flashback
+--echo #
+SELECT * FROM t1;
+
+# After flashback, t1's checksum should be same to original checksum
+--let $checksum_new = `CHECKSUM TABLE t1`
+if ($checksum_new != $checksum_old)
+{
+ --die "After flashback, t1's checksum is different from the original checksum"
+}
+
+DROP TABLE t1;
+--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_row_flashback.sql
+
## Clear
SET binlog_format=statement;
--error ER_FLASHBACK_NOT_SUPPORTED
diff --git a/mysql-test/suite/binlog/t/max_binlog_total_size-master.opt b/mysql-test/suite/binlog/t/max_binlog_total_size-master.opt
new file mode 100644
index 00000000..9ba64a44
--- /dev/null
+++ b/mysql-test/suite/binlog/t/max_binlog_total_size-master.opt
@@ -0,0 +1,5 @@
+--log-bin=binary
+--max-binlog-total-size=1500
+--max-binlog-size=4096
+--binlog-format=row
+--slave_connections_needed_for_purge=1
diff --git a/mysql-test/suite/binlog/t/max_binlog_total_size.test b/mysql-test/suite/binlog/t/max_binlog_total_size.test
new file mode 100644
index 00000000..19e6131b
--- /dev/null
+++ b/mysql-test/suite/binlog/t/max_binlog_total_size.test
@@ -0,0 +1,94 @@
+--source include/have_log_bin.inc
+select @@global.max_binlog_total_size;
+select @@global.max_binlog_size;
+
+# Note that this test is only using MyISAM tables.
+# The reason for this is that we do not want to have engine
+# checkpoints in the binary log as it would change the number of
+# bytes in the log, which could cause random rotations.
+
+--echo #
+--echo # MDEV-31404 Implement binlog_space_limit
+--echo #
+
+FLUSH LOGS;
+FLUSH LOGS;
+FLUSH LOGS;
+source include/show_binary_logs.inc;
+show status like "binlog_disk_use";
+set @@global.slave_connections_needed_for_purge= 0;
+--echo # binary.000001 should be deleted now
+source include/show_binary_logs.inc;
+show status like "binlog_disk_use";
+
+CREATE TABLE `t1` (
+ `v1` int(11) DEFAULT NULL,
+ `v2` varchar(8000) DEFAULT NULL,
+ KEY `v1` (`v1`)
+) engine=myisam;
+INSERT INTO t1 VALUES (0,repeat("a",3000));
+show status like "binlog_disk_use";
+--echo # First binary should be binary.000004
+source include/show_binary_logs.inc;
+
+INSERT INTO t1 VALUES (2,repeat("b",10));
+--echo # First binary should be binary.000004
+# The reson why we have logs 00004 and 00005 at this point is that we first
+# do a rotate and then try to purge. However as there are still existing
+# xid's pointing to the 00004, we cannot yet purge 000004.
+# After rotate a checkpoint record will be written to 00005 which
+# will release pointers to 00004. On next binary log write or flush
+# the purge will be retried and succeed.
+
+source include/show_binary_logs.inc;
+
+FLUSH LOGS;
+--echo # First binary should be binary.000005
+source include/show_binary_logs.inc;
+
+FLUSH LOGS;
+FLUSH LOGS;
+FLUSH LOGS;
+FLUSH LOGS;
+source include/show_binary_logs.inc;
+show status like "binlog_disk_use";
+
+PURGE BINARY LOGS TO 'binary.000009';
+--echo # First binary should be binary.000009
+source include/show_binary_logs.inc;
+
+INSERT INTO t1 VALUES (3,repeat("c",4000));
+--echo # First binary should be binary.000010
+source include/show_binary_logs.inc;
+
+INSERT INTO t1 VALUES (4,repeat("d",3000));
+--echo # First binary should be binary.000011
+source include/show_binary_logs.inc;
+
+RESET MASTER;
+source include/show_binary_logs.inc;
+show status like "binlog_disk_use";
+
+INSERT INTO t1 VALUES (5,"e");
+FLUSH LOGS;
+INSERT INTO t1 VALUES (6,repeat("f",3000));
+source include/show_binary_logs.inc;
+show status like "binlog_disk_use";
+
+INSERT INTO t1 VALUES (7,repeat("g",3000));
+--echo # binary.000001 should be deleted now
+source include/show_binary_logs.inc;
+show status like "binlog_disk_use";
+
+FLUSH LOGS;
+FLUSH LOGS;
+--echo # binary.000002 should be deleted now
+show binary logs;
+show status like "binlog_disk_use";
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+set @@global.slave_connections_needed_for_purge= default;
+# End of 11.4 tests
diff --git a/mysql-test/suite/binlog_encryption/binlog_index-master.opt b/mysql-test/suite/binlog_encryption/binlog_index-master.opt
new file mode 100644
index 00000000..f2673d08
--- /dev/null
+++ b/mysql-test/suite/binlog_encryption/binlog_index-master.opt
@@ -0,0 +1 @@
+--slave_connections_needed_for_purge=0
diff --git a/mysql-test/suite/binlog_encryption/binlog_ioerr.result b/mysql-test/suite/binlog_encryption/binlog_ioerr.result
index 2823b705..146bc50c 100644
--- a/mysql-test/suite/binlog_encryption/binlog_ioerr.result
+++ b/mysql-test/suite/binlog_encryption/binlog_ioerr.result
@@ -4,11 +4,13 @@ CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
INSERT INTO t1 VALUES(0);
SET @saved_dbug = @@SESSION.debug_dbug;
SET SESSION debug_dbug='+d,fail_binlog_write_1';
+SET GLOBAL binlog_legacy_event_pos= 1;
INSERT INTO t1 VALUES(1);
ERROR HY000: Error writing file 'master-bin' (errno: 28 "No space left on device")
INSERT INTO t1 VALUES(2);
ERROR HY000: Error writing file 'master-bin' (errno: 28 "No space left on device")
SET SESSION debug_dbug=@saved_dbug;
+SET GLOBAL binlog_legacy_event_pos= 0;
INSERT INTO t1 VALUES(3);
SELECT * FROM t1;
a
diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.result b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.result
index c6835ff9..d05e3abd 100644
--- a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.result
+++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.result
@@ -6,6 +6,7 @@ connection server_2;
include/stop_slave.inc
CHANGE MASTER TO MASTER_USE_GTID=SLAVE_POS;
call mtr.add_suppression(" Got fatal error 1236 from master when reading data from binary log: 'Could not set up decryption for binlog.'");
+call mtr.add_suppression(" Got fatal error 1236 from master when reading data from binary log: 'Could not decrypt binlog: encryption key error");
#####################################################
# Part 1: unencrypted master
#####################################################
@@ -58,10 +59,11 @@ INSERT INTO table3_no_encryption SELECT NULL,NOW(),b FROM table3_no_encryption;
connection server_2;
start slave;
include/wait_for_slave_io_error.inc [errno=1236]
-# Ensuring slave was unable to replicate any transactions..
+# Ensuring slave was unable to replicate any encrypted transactions..
# ..success
SHOW TABLES;
Tables_in_test
+table1_no_encryption
include/stop_slave_sql.inc
reset slave;
##########
@@ -80,5 +82,7 @@ COUNT(*)
4
DROP TABLE table1_no_encryption, table2_to_encrypt, table3_no_encryption;
connection server_2;
+RESET MASTER;
+SET GLOBAL gtid_slave_pos= '';
include/start_slave.inc
include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.test b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.test
index 9991fb9b..7f717190 100644
--- a/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.test
+++ b/mysql-test/suite/binlog_encryption/encrypted_master_switch_to_unencrypted_gtid.test
@@ -36,6 +36,7 @@
CHANGE MASTER TO MASTER_USE_GTID=SLAVE_POS;
--enable_connect_log
call mtr.add_suppression(" Got fatal error 1236 from master when reading data from binary log: 'Could not set up decryption for binlog.'");
+call mtr.add_suppression(" Got fatal error 1236 from master when reading data from binary log: 'Could not decrypt binlog: encryption key error");
--echo #####################################################
--echo # Part 1: unencrypted master
@@ -55,6 +56,7 @@ FLUSH BINARY LOGS;
SET binlog_format=ROW;
INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
INSERT INTO table1_no_encryption SELECT NULL,NOW(),b FROM table1_no_encryption;
+--let $last_unencrypted_gtid= `SELECT @@gtid_binlog_pos`
# Make sure that binary logs are not encrypted
@@ -120,11 +122,11 @@ start slave;
--let $slave_io_errno= 1236
--source include/wait_for_slave_io_error.inc
---echo # Ensuring slave was unable to replicate any transactions..
+--echo # Ensuring slave was unable to replicate any encrypted transactions..
--let $gsp= `SELECT @@global.gtid_slave_pos`
-if (`SELECT strcmp("$gsp","")`)
+if (`SELECT strcmp("$gsp","$last_unencrypted_gtid")`)
{
- die Slave without encryption configured should fail to read encrypted binlog;
+ die Slave without encryption configured should fail to read encrypted binlog (expected $last_unencrypted_gtid but got $gsp);
}
--echo # ..success
@@ -151,5 +153,7 @@ DROP TABLE table1_no_encryption, table2_to_encrypt, table3_no_encryption;
--connection server_2
--disable_connect_log
+RESET MASTER;
+SET GLOBAL gtid_slave_pos= '';
--source include/start_slave.inc
--source include/rpl_end.inc
diff --git a/mysql-test/suite/binlog_encryption/multisource.result b/mysql-test/suite/binlog_encryption/multisource.result
index 4b53b465..ca420f9a 100644
--- a/mysql-test/suite/binlog_encryption/multisource.result
+++ b/mysql-test/suite/binlog_encryption/multisource.result
@@ -6,7 +6,8 @@ ERROR HY000: Incorrect arguments to MASTER_HOST
change master 'master1' to
master_port=MYPORT_1,
master_host='127.0.0.1',
-master_user='root';
+master_user='root',
+master_ssl_verify_server_cert=0;
start slave 'master1';
set default_master_connection = 'master1';
include/wait_for_slave_to_start.inc
@@ -100,6 +101,7 @@ change master to
master_port=MYPORT_2,
master_host='127.0.0.1',
master_user='root',
+master_ssl_verify_server_cert=0,
master_use_gtid=no;
start slave;
include/wait_for_slave_to_start.inc
diff --git a/mysql-test/suite/binlog_encryption/my.cnf b/mysql-test/suite/binlog_encryption/my.cnf
index d787ebe1..f0fbca7b 100644
--- a/mysql-test/suite/binlog_encryption/my.cnf
+++ b/mysql-test/suite/binlog_encryption/my.cnf
@@ -1,5 +1,4 @@
-!include include/default_mysqld.cnf
-!include include/default_client.cnf
+!include include/default_my.cnf
[mysqld.1]
innodb
diff --git a/mysql-test/suite/binlog_encryption/rpl_skip_replication.result b/mysql-test/suite/binlog_encryption/rpl_skip_replication.result
index 96e0a303..c17ffbb5 100644
--- a/mysql-test/suite/binlog_encryption/rpl_skip_replication.result
+++ b/mysql-test/suite/binlog_encryption/rpl_skip_replication.result
@@ -12,7 +12,7 @@ SELECT,UPDATE ON *.* TO 'nonsuperuser'@'127.0.0.1';
connect nonpriv, 127.0.0.1, nonsuperuser,, test, $SLAVE_MYPORT,;
connection nonpriv;
SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
disconnect nonpriv;
connection slave;
DROP USER'nonsuperuser'@'127.0.0.1';
diff --git a/mysql-test/suite/binlog_encryption/rpl_ssl.result b/mysql-test/suite/binlog_encryption/rpl_ssl.result
index ce9e4d48..8c696f25 100644
--- a/mysql-test/suite/binlog_encryption/rpl_ssl.result
+++ b/mysql-test/suite/binlog_encryption/rpl_ssl.result
@@ -51,7 +51,7 @@ connection slave;
include/stop_slave.inc
CHANGE MASTER TO
master_user = 'root',
-master_ssl = 0,
+master_ssl = 1,
master_ssl_ca = '',
master_ssl_cert = '',
master_ssl_key = '';
diff --git a/mysql-test/suite/binlog_encryption/rpl_sync-master.opt b/mysql-test/suite/binlog_encryption/rpl_sync-master.opt
index 04b06bfa..96f0ce3f 100644
--- a/mysql-test/suite/binlog_encryption/rpl_sync-master.opt
+++ b/mysql-test/suite/binlog_encryption/rpl_sync-master.opt
@@ -1,2 +1 @@
--default-storage-engine=MyISAM
---loose-innodb-file-per-table=0
diff --git a/mysql-test/suite/binlog_encryption/rpl_sync-slave.opt b/mysql-test/suite/binlog_encryption/rpl_sync-slave.opt
index 79533053..d1a481cd 100644
--- a/mysql-test/suite/binlog_encryption/rpl_sync-slave.opt
+++ b/mysql-test/suite/binlog_encryption/rpl_sync-slave.opt
@@ -1,2 +1,2 @@
---sync-relay-log-info=1 --relay-log-recovery=1 --default-storage-engine=MyISAM --loose-innodb-file-per-table=0
+--sync-relay-log-info=1 --relay-log-recovery=1 --default-storage-engine=MyISAM
--skip-core-file --skip-slave-start
diff --git a/mysql-test/suite/compat/oracle/r/sp-inout.result b/mysql-test/suite/compat/oracle/r/sp-inout.result
index fa6f5076..bfaa7572 100644
--- a/mysql-test/suite/compat/oracle/r/sp-inout.result
+++ b/mysql-test/suite/compat/oracle/r/sp-inout.result
@@ -684,7 +684,7 @@ END;
END;
$$
set @a = 4;
-INSERT INTO Persons SELECT 4, 'DDD', PKG2.func(@a);
+INSERT INTO Persons SELECT 4, 'DDD', pkg2.func(@a);
SELECT * FROM Persons;
ID Name Age
1 AAA 10
@@ -726,8 +726,8 @@ ID Name Age
2 BBB 20
3 CCC 30
set @a = 0;
-INSERT INTO Persons SELECT 5, 'EEE', PKG2.func(@a);
-ERROR HY000: OUT or INOUT argument 1 for function PKG2.func is not allowed here
+INSERT INTO Persons SELECT 5, 'EEE', pkg2.func(@a);
+ERROR HY000: OUT or INOUT argument 1 for function pkg2.func is not allowed here
DROP TABLE Persons;
DROP PACKAGE pkg2;
#
@@ -764,7 +764,7 @@ ID Name Age
3 CCC 30
4 DDD 40
set @a = 4;
-DELETE FROM Persons WHERE ID = PKG2.func(@a);
+DELETE FROM Persons WHERE ID = pkg2.func(@a);
SELECT * FROM Persons;
ID Name Age
1 AAA 10
@@ -807,8 +807,8 @@ ID Name Age
3 CCC 30
4 DDD 40
set @a = 0;
-DELETE FROM Persons WHERE ID = PKG2.func(@a);
-ERROR HY000: OUT or INOUT argument 1 for function PKG2.func is not allowed here
+DELETE FROM Persons WHERE ID = pkg2.func(@a);
+ERROR HY000: OUT or INOUT argument 1 for function pkg2.func is not allowed here
DROP TABLE Persons;
DROP PACKAGE pkg2;
#
diff --git a/mysql-test/suite/compat/oracle/r/sp-package-innodb.result b/mysql-test/suite/compat/oracle/r/sp-package-innodb.result
index 0ac357df..50eb2dc6 100644
--- a/mysql-test/suite/compat/oracle/r/sp-package-innodb.result
+++ b/mysql-test/suite/compat/oracle/r/sp-package-innodb.result
@@ -23,8 +23,6 @@ a:=a+1;
INSERT INTO t1 VALUES (a,'pkg1 initialization');
END;
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL pkg1.p1;
SELECT * FROM t1 ORDER BY a;
a routine
diff --git a/mysql-test/suite/compat/oracle/r/sp-package-mysqldump.result b/mysql-test/suite/compat/oracle/r/sp-package-mysqldump.result
index 508aea0e..7b423e85 100644
--- a/mysql-test/suite/compat/oracle/r/sp-package-mysqldump.result
+++ b/mysql-test/suite/compat/oracle/r/sp-package-mysqldump.result
@@ -45,7 +45,7 @@ $$
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+/*M!100616 SET @OLD_NOTE_VERBOSITY=@@NOTE_VERBOSITY, NOTE_VERBOSITY=0 */;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ORACLE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER,SIMULTANEOUS_ASSIGNMENT' */ ;
/*!50003 DROP PROCEDURE IF EXISTS `p1` */;
@@ -137,7 +137,7 @@ DELIMITER ;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
+/*M!100616 SET NOTE_VERBOSITY=@OLD_NOTE_VERBOSITY */;
<?xml version="1.0"?>
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
diff --git a/mysql-test/suite/compat/oracle/r/sp-package.result b/mysql-test/suite/compat/oracle/r/sp-package.result
index ee17c048..2372cfea 100644
--- a/mysql-test/suite/compat/oracle/r/sp-package.result
+++ b/mysql-test/suite/compat/oracle/r/sp-package.result
@@ -444,7 +444,7 @@ CREATE PACKAGE BODY test2 AS
PROCEDURE p2 AS BEGIN NULL; END;
END;
$$
-ERROR HY000: Subroutine 'test.test2.p1' is declared in the package specification but is not defined in the package body
+ERROR HY000: PROCEDURE `test.test2.p1` is declared in the package specification but is not defined in the package body
DROP PACKAGE test2;
CREATE PACKAGE test2 AS
FUNCTION f1 RETURN INT;
@@ -454,7 +454,7 @@ CREATE PACKAGE BODY test2 AS
FUNCTION f2 RETURN INT AS BEGIN RETURN 10; END;
END;
$$
-ERROR HY000: Subroutine 'test.test2.f1' is declared in the package specification but is not defined in the package body
+ERROR HY000: FUNCTION `test.test2.f1` is declared in the package specification but is not defined in the package body
DROP PACKAGE test2;
CREATE PACKAGE test2 AS
PROCEDURE p1;
@@ -464,7 +464,7 @@ CREATE PACKAGE BODY test2 AS
FUNCTION p1 RETURN INT AS BEGIN RETURN 10; END;
END;
$$
-ERROR HY000: Subroutine 'test.test2.p1' is declared in the package specification but is not defined in the package body
+ERROR HY000: PROCEDURE `test.test2.p1` is declared in the package specification but is not defined in the package body
DROP PACKAGE test2;
CREATE PACKAGE test2 AS
PROCEDURE p1;
@@ -474,7 +474,7 @@ CREATE PACKAGE BODY test2 AS
PROCEDURE p1(a INT) AS BEGIN NULL; END; -- Notice different prototype
END;
$$
-ERROR HY000: Subroutine 'test.test2.p1' is declared in the package specification but is not defined in the package body
+ERROR HY000: PROCEDURE `test.test2.p1` is declared in the package specification but is not defined in the package body
DROP PACKAGE test2;
#
# Forward declarations in CREATE PACKAGE BODY with missing implementations
@@ -488,13 +488,13 @@ PROCEDURE p1 AS BEGIN NULL; END;
PROCEDURE p2;
END;
$$
-ERROR HY000: Subroutine 'test.test2.p2' has a forward declaration but is not defined
+ERROR HY000: PROCEDURE `test.test2.p2` has a forward declaration but is not defined
CREATE PACKAGE BODY test2 AS
FUNCTION f1 RETURN INT;
PROCEDURE p1 AS BEGIN NULL; END;
END;
$$
-ERROR HY000: Subroutine 'test.test2.f1' has a forward declaration but is not defined
+ERROR HY000: FUNCTION `test.test2.f1` has a forward declaration but is not defined
DROP PACKAGE test2;
#
# Creating a new package
@@ -2092,8 +2092,6 @@ $$
CALL p1.p1();
@a
11
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL p1.p1();
@a
12
@@ -2125,8 +2123,6 @@ BEGIN
SELECT MAX(a) FROM t1 INTO @a;
END;
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL p1.p1();
@a
11
@@ -2160,8 +2156,6 @@ BEGIN
SELECT 1 FROM t1 INTO @a;
END;
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL p1.p1();
ERROR 42S02: Table 'test.t1' doesn't exist
SELECT p1.f1();
@@ -2720,9 +2714,6 @@ SELECT * FROM t1 INTO b;
SELECT b.a, b.b;
END;
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL p1.p1;
b.a b.b
10 b
@@ -3157,7 +3148,24 @@ collation_connection latin1_swedish_ci
DROP VIEW v_test;
SET sql_mode=DEFAULT;
CREATE VIEW v_test AS SELECT 1 AS c1 FROM DUAL WHERE 1=test1.f_test();
-ERROR 42000: FUNCTION test1.f_test does not exist
+SELECT * FROM v_test;
+c1
+1
+SHOW CREATE VIEW v_test;
+View v_test
+Create View CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_test` AS select 1 AS `c1` from DUAL where 1 = `test`.`test1`.`f_test`()
+character_set_client latin1
+collation_connection latin1_swedish_ci
+SET sql_mode=ORACLE;
+SELECT * FROM v_test;
+c1
+1
+SHOW CREATE VIEW v_test;
+View v_test
+Create View CREATE VIEW "v_test" AS select 1 AS "c1" from DUAL where 1 = "test"."test1"."f_test"()
+character_set_client latin1
+collation_connection latin1_swedish_ci
+DROP VIEW v_test;
SET sql_mode=ORACLE;
CREATE VIEW v_test AS SELECT 1 AS c1 FROM DUAL WHERE 1=test.test1.f_test();
SELECT * FROM v_test;
diff --git a/mysql-test/suite/compat/oracle/r/sp-row.result b/mysql-test/suite/compat/oracle/r/sp-row.result
index 0b23f303..b3a0ae15 100644
--- a/mysql-test/suite/compat/oracle/r/sp-row.result
+++ b/mysql-test/suite/compat/oracle/r/sp-row.result
@@ -2835,8 +2835,6 @@ SELECT * FROM t1 INTO rec1;
SELECT rec1.a, rec1.b;
END;
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL p1();
ERROR 21000: The used SELECT statements have a different number of columns
DROP TABLE t1;
@@ -2851,8 +2849,6 @@ SELECT * FROM t1 INTO rec1, rec1;
SELECT rec1.a, rec1.b;
END;
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL p1();
ERROR 21000: Operand should contain 2 column(s)
DROP TABLE t1;
@@ -2867,8 +2863,6 @@ SELECT * FROM t1 INTO rec1;
SELECT rec1.a, rec1.b;
END;
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL p1();
rec1.a rec1.b
10 b10
@@ -2884,8 +2878,6 @@ SELECT 10,'a','b' FROM t1 INTO rec1;
SELECT rec1.a, rec1.b;
END;
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL p1();
ERROR 21000: The used SELECT statements have a different number of columns
DROP TABLE t1;
@@ -2900,8 +2892,6 @@ SELECT 10,'a' FROM t1 INTO rec1, rec1;
SELECT rec1.a, rec1.b;
END;
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL p1();
ERROR 21000: Operand should contain 2 column(s)
DROP TABLE t1;
@@ -2916,8 +2906,6 @@ SELECT * FROM t1 INTO rec1;
SELECT rec1.a, rec1.b;
END;
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL p1();
rec1.a rec1.b
10 b10
@@ -2934,8 +2922,6 @@ SELECT * FROM t1 INTO rec1;
SELECT rec1.a, rec1.b;
END;
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL p1();
ERROR 21000: The used SELECT statements have a different number of columns
DROP TABLE t1;
@@ -2951,8 +2937,6 @@ SELECT * FROM t1 INTO rec1, rec1;
SELECT rec1.a, rec1.b;
END;
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL p1();
ERROR 21000: Operand should contain 2 column(s)
DROP TABLE t1;
@@ -2968,8 +2952,6 @@ SELECT * FROM t1 INTO rec1;
SELECT rec1.a, rec1.b;
END;
$$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL p1();
rec1.a rec1.b
10 b10
diff --git a/mysql-test/suite/compat/oracle/r/table_value_constr.result b/mysql-test/suite/compat/oracle/r/table_value_constr.result
index af071433..65e31761 100644
--- a/mysql-test/suite/compat/oracle/r/table_value_constr.result
+++ b/mysql-test/suite/compat/oracle/r/table_value_constr.result
@@ -565,12 +565,12 @@ where t1.a=t2.a and st<3
select * from t2;
a b st
1 1 1
-1 2 2
1 1 2
-1 2 3
-1 2 3
1 1 3
1 1 3
+1 2 2
+1 2 3
+1 2 3
# recursive CTE that uses VALUES structure(s) : computation of factorial (first 10 elements)
with recursive fact(n,f) as
(
@@ -741,21 +741,19 @@ a b
explain extended select * from t1
where a in (values (1));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
-1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00
-3 MATERIALIZED <derived2> ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+1 PRIMARY <derived2> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" semi join ((values (1)) "tvc_0") where 1
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from (values (1)) "tvc_0" join "test"."t1" where "tvc_0"."1" = "test"."t1"."a"
explain extended select * from t1
where a in (select * from (values (1)) as tvc_0);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" semi join ((values (1)) "tvc_0") where 1
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from (values (1)) "tvc_0" join "test"."t1" where "tvc_0"."1" = "test"."t1"."a"
# IN-subquery with VALUES structure(s) : UNION with VALUES on the first place
select * from t1
where a in (values (1) union select 2);
@@ -774,7 +772,7 @@ explain extended select * from t1
where a in (values (1) union select 2);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
-4 DEPENDENT SUBQUERY <derived2> ref key0 key0 4 func 2 100.00
+4 DEPENDENT SUBQUERY <derived2> eq_ref distinct_key distinct_key 4 func 1 100.00
2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union4,3> ALL NULL NULL NULL NULL NULL NULL
@@ -785,7 +783,7 @@ where a in (select * from (values (1)) as tvc_0 union
select 2);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
-2 DEPENDENT SUBQUERY <derived3> ref key0 key0 4 func 2 100.00
+2 DEPENDENT SUBQUERY <derived3> eq_ref distinct_key distinct_key 4 func 1 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
4 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,4> ALL NULL NULL NULL NULL NULL NULL
@@ -810,7 +808,7 @@ where a in (select 2 union values (1));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
-4 DEPENDENT UNION <derived3> ref key0 key0 4 func 2 100.00
+4 DEPENDENT UNION <derived3> eq_ref distinct_key distinct_key 4 func 1 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,4> ALL NULL NULL NULL NULL NULL NULL
Warnings:
@@ -821,7 +819,7 @@ select * from (values (1)) tvc_0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
-3 DEPENDENT UNION <derived4> ref key0 key0 4 func 2 100.00
+3 DEPENDENT UNION <derived4> ref key0 key0 4 func 1 100.00
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
@@ -846,7 +844,7 @@ explain extended select * from t1
where a in (values (1) union all select b from t1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
-4 DEPENDENT SUBQUERY <derived2> ref key0 key0 4 func 2 100.00
+4 DEPENDENT SUBQUERY <derived2> eq_ref distinct_key distinct_key 4 func 1 100.00
2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
3 DEPENDENT UNION t1 ALL NULL NULL NULL NULL 6 100.00 Using where
Warnings:
@@ -856,7 +854,7 @@ where a in (select * from (values (1)) as tvc_0 union all
select b from t1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
-2 DEPENDENT SUBQUERY <derived3> ref key0 key0 4 func 2 100.00
+2 DEPENDENT SUBQUERY <derived3> eq_ref distinct_key distinct_key 4 func 1 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
4 DEPENDENT UNION t1 ALL NULL NULL NULL NULL 6 100.00 Using where
Warnings:
@@ -878,18 +876,18 @@ explain extended select * from t1
where a not in (values (1),(2));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
-3 MATERIALIZED <derived2> ALL NULL NULL NULL NULL 2 100.00
+3 DEPENDENT SUBQUERY <derived2> unique_subquery distinct_key distinct_key 4 func 1 100.00 Using where; Full scan on NULL key
2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where !<expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a","test"."t1"."a" in ( <materialize> (/* select#3 */ select "tvc_0"."1" from (values (1),(2)) "tvc_0" ), <primary_index_lookup>("test"."t1"."a" in <temporary table> on distinct_key where "test"."t1"."a" = "<subquery3>"."1"))))
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where !<expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a",<exists>(<primary_index_lookup>(<cache>("test"."t1"."a") in <temporary table> on distinct_key where trigcond(<cache>("test"."t1"."a") = "tvc_0"."1")))))
explain extended select * from t1
where a not in (select * from (values (1),(2)) as tvc_0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
-2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
+2 DEPENDENT SUBQUERY <derived3> unique_subquery distinct_key distinct_key 4 func 1 100.00 Using where; Full scan on NULL key
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where !<expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a","test"."t1"."a" in ( <materialize> (/* select#2 */ select "tvc_0"."1" from (values (1),(2)) "tvc_0" ), <primary_index_lookup>("test"."t1"."a" in <temporary table> on distinct_key where "test"."t1"."a" = "<subquery2>"."1"))))
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" where !<expr_cache><"test"."t1"."a">(<in_optimizer>("test"."t1"."a",<exists>(<primary_index_lookup>(<cache>("test"."t1"."a") in <temporary table> on distinct_key where trigcond(<cache>("test"."t1"."a") = "tvc_0"."1")))))
# NOT IN subquery with VALUES structure(s) : UNION with VALUES on the first place
select * from t1
where a not in (values (1) union select 2);
@@ -976,21 +974,19 @@ a b
explain extended select * from t1
where a = any (values (1),(2));
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
-1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00
-3 MATERIALIZED <derived2> ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+1 PRIMARY <derived2> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" semi join ((values (1),(2)) "tvc_0") where 1
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from (values (1),(2)) "tvc_0" join "test"."t1" where "tvc_0"."1" = "test"."t1"."a"
explain extended select * from t1
where a = any (select * from (values (1),(2)) as tvc_0);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00
-2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 2 100.00
+1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
+1 PRIMARY <derived3> eq_ref distinct_key distinct_key 4 test.t1.a 1 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from "test"."t1" semi join ((values (1),(2)) "tvc_0") where 1
+Note 1003 /* select#1 */ select "test"."t1"."a" AS "a","test"."t1"."b" AS "b" from (values (1),(2)) "tvc_0" join "test"."t1" where "tvc_0"."1" = "test"."t1"."a"
# ANY-subquery with VALUES structure(s) : UNION with VALUES on the first place
select * from t1
where a = any (values (1) union select 2);
@@ -1009,7 +1005,7 @@ explain extended select * from t1
where a = any (values (1) union select 2);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
-4 DEPENDENT SUBQUERY <derived2> ref key0 key0 4 func 2 100.00
+4 DEPENDENT SUBQUERY <derived2> eq_ref distinct_key distinct_key 4 func 1 100.00
2 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union4,3> ALL NULL NULL NULL NULL NULL NULL
@@ -1020,7 +1016,7 @@ where a = any (select * from (values (1)) as tvc_0 union
select 2);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
-2 DEPENDENT SUBQUERY <derived3> ref key0 key0 4 func 2 100.00
+2 DEPENDENT SUBQUERY <derived3> eq_ref distinct_key distinct_key 4 func 1 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
4 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,4> ALL NULL NULL NULL NULL NULL NULL
@@ -1045,7 +1041,7 @@ where a = any (select 2 union values (1));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
-4 DEPENDENT UNION <derived3> ref key0 key0 4 func 2 100.00
+4 DEPENDENT UNION <derived3> eq_ref distinct_key distinct_key 4 func 1 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,4> ALL NULL NULL NULL NULL NULL NULL
Warnings:
@@ -1056,7 +1052,7 @@ select * from (values (1)) as tvc_0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
-3 DEPENDENT UNION <derived4> ref key0 key0 4 func 2 100.00
+3 DEPENDENT UNION <derived4> ref key0 key0 4 func 1 100.00
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
@@ -1138,7 +1134,7 @@ where a = any (select 1 union values (1));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
-4 DEPENDENT UNION <derived3> ref key0 key0 4 func 2 100.00
+4 DEPENDENT UNION <derived3> eq_ref distinct_key distinct_key 4 func 1 100.00
3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,4> ALL NULL NULL NULL NULL NULL NULL
Warnings:
@@ -1149,7 +1145,7 @@ select * from (values (1)) as tvc_0);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL No tables used
-3 DEPENDENT UNION <derived4> ref key0 key0 4 func 2 100.00
+3 DEPENDENT UNION <derived4> ref key0 key0 4 func 1 100.00
4 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
diff --git a/mysql-test/suite/compat/oracle/r/update_innodb.result b/mysql-test/suite/compat/oracle/r/update_innodb.result
index 1dae643e..0c9922fe 100644
--- a/mysql-test/suite/compat/oracle/r/update_innodb.result
+++ b/mysql-test/suite/compat/oracle/r/update_innodb.result
@@ -6,8 +6,6 @@ CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY) engine=innodb;
INSERT INTO t1 VALUES (1);
START TRANSACTION;
SELECT a AS a_con1 FROM t1 INTO @a FOR UPDATE;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
connect con2,localhost,root,,;
SET sql_mode='ORACLE';
START TRANSACTION;
@@ -16,8 +14,6 @@ connection default;
UPDATE t1 SET a=a+100;
COMMIT;
connection con2;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
SELECT a AS con2 FROM t1;
con2
101
diff --git a/mysql-test/suite/compat/oracle/t/sp-inout.test b/mysql-test/suite/compat/oracle/t/sp-inout.test
index d605be64..e62a9436 100644
--- a/mysql-test/suite/compat/oracle/t/sp-inout.test
+++ b/mysql-test/suite/compat/oracle/t/sp-inout.test
@@ -730,7 +730,7 @@ $$
DELIMITER ;$$
set @a = 4;
-INSERT INTO Persons SELECT 4, 'DDD', PKG2.func(@a);
+INSERT INTO Persons SELECT 4, 'DDD', pkg2.func(@a);
SELECT * FROM Persons;
DROP TABLE Persons;
DROP PACKAGE pkg2;
@@ -770,7 +770,7 @@ DELIMITER ;$$
SELECT * FROM Persons;
set @a = 0;
--error ER_SF_OUT_INOUT_ARG_NOT_ALLOWED
-INSERT INTO Persons SELECT 5, 'EEE', PKG2.func(@a);
+INSERT INTO Persons SELECT 5, 'EEE', pkg2.func(@a);
DROP TABLE Persons;
DROP PACKAGE pkg2;
@@ -808,7 +808,7 @@ DELIMITER ;$$
SELECT * FROM Persons;
set @a = 4;
-DELETE FROM Persons WHERE ID = PKG2.func(@a);
+DELETE FROM Persons WHERE ID = pkg2.func(@a);
SELECT * FROM Persons;
DROP TABLE Persons;
DROP PACKAGE pkg2;
@@ -849,7 +849,7 @@ DELIMITER ;$$
SELECT * FROM Persons;
set @a = 0;
--error ER_SF_OUT_INOUT_ARG_NOT_ALLOWED
-DELETE FROM Persons WHERE ID = PKG2.func(@a);
+DELETE FROM Persons WHERE ID = pkg2.func(@a);
DROP TABLE Persons;
DROP PACKAGE pkg2;
diff --git a/mysql-test/suite/compat/oracle/t/sp-package.test b/mysql-test/suite/compat/oracle/t/sp-package.test
index b6310eed..aefede41 100644
--- a/mysql-test/suite/compat/oracle/t/sp-package.test
+++ b/mysql-test/suite/compat/oracle/t/sp-package.test
@@ -2854,13 +2854,18 @@ END test1;
$$
DELIMITER ;$$
-
+#
+# A VIEW created with sql_mode=ORACLE, calling a package routine
+#
SET sql_mode=ORACLE;
CREATE VIEW v_test AS SELECT 1 AS c1 FROM DUAL WHERE 1=test1.f_test();
SELECT * FROM v_test;
--vertical_results
SHOW CREATE VIEW v_test;
--horizontal_results
+#
+# It also works with sql_mode=DEFALT
+#
SET sql_mode=DEFAULT;
SELECT * FROM v_test;
--vertical_results
@@ -2868,10 +2873,24 @@ SHOW CREATE VIEW v_test;
--horizontal_results
DROP VIEW v_test;
-
+#
+# A VIEW created with sql_mode=DEFAULT, calling a package routine
+#
SET sql_mode=DEFAULT;
---error ER_SP_DOES_NOT_EXIST
CREATE VIEW v_test AS SELECT 1 AS c1 FROM DUAL WHERE 1=test1.f_test();
+SELECT * FROM v_test;
+--vertical_results
+SHOW CREATE VIEW v_test;
+#
+# It also works with sql_mode=ORACLE
+#
+--horizontal_results
+SET sql_mode=ORACLE;
+SELECT * FROM v_test;
+--vertical_results
+SHOW CREATE VIEW v_test;
+--horizontal_results
+DROP VIEW v_test;
SET sql_mode=ORACLE;
diff --git a/mysql-test/suite/compat/oracle/t/table_value_constr.test b/mysql-test/suite/compat/oracle/t/table_value_constr.test
index ca3c40bb..7c1463e2 100644
--- a/mysql-test/suite/compat/oracle/t/table_value_constr.test
+++ b/mysql-test/suite/compat/oracle/t/table_value_constr.test
@@ -424,6 +424,7 @@ select * from t2;
--echo # recursive CTE that uses VALUES structure(s) : that uses UNION ALL
+--sorted_result
with recursive t2(a,b,st) as
(
values(1,1,1)
diff --git a/mysql-test/suite/encryption/r/encrypt_and_grep.result b/mysql-test/suite/encryption/r/encrypt_and_grep.result
index 72d612ee..e52ec0e4 100644
--- a/mysql-test/suite/encryption/r/encrypt_and_grep.result
+++ b/mysql-test/suite/encryption/r/encrypt_and_grep.result
@@ -1,4 +1,3 @@
-SET GLOBAL innodb_file_per_table = ON;
create table t1 (a varchar(255)) engine=innodb encrypted=yes;
create table t2 (a varchar(255)) engine=innodb;
show warnings;
diff --git a/mysql-test/suite/encryption/r/innochecksum.result b/mysql-test/suite/encryption/r/innochecksum.result
index 7c68164e..dc0bf63a 100644
--- a/mysql-test/suite/encryption/r/innochecksum.result
+++ b/mysql-test/suite/encryption/r/innochecksum.result
@@ -1,4 +1,3 @@
-SET GLOBAL innodb_file_per_table = ON;
set global innodb_compression_algorithm = 1;
# Create and populate a tables
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change.result b/mysql-test/suite/encryption/r/innodb-bad-key-change.result
index e69d427e..d2ad5fb9 100644
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change.result
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change.result
@@ -6,10 +6,10 @@ call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page n
call mtr.add_suppression("failed to read \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t1.ibd looks corrupted; key_version=1");
call mtr.add_suppression("File '.*mysql-test.std_data.keysbad3\\.txt' not found");
+call mtr.add_suppression("File '.*mariadb-test.std_data.keysbad3\\.txt' not found");
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space=");
# Start server with keys2.txt
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
-SET GLOBAL innodb_file_per_table = ON;
CREATE TABLE t1 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=2;
INSERT INTO t1 VALUES ('foobar');
ALTER TABLE t1 ADD COLUMN c2 INT;
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change2.result b/mysql-test/suite/encryption/r/innodb-bad-key-change2.result
index c02c543a..129de6e9 100644
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change2.result
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change2.result
@@ -8,7 +8,6 @@ call mtr.add_suppression("InnoDB: Cannot delete tablespace .* because it is not
call mtr.add_suppression("InnoDB: ALTER TABLE `test`\\.`t1` DISCARD TABLESPACE failed to find tablespace");
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space=");
# restart: --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
-SET GLOBAL innodb_file_per_table = ON;
CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB
ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change4.result b/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
deleted file mode 100644
index 40b377e6..00000000
--- a/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
+++ /dev/null
@@ -1,26 +0,0 @@
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page)");
-call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t1\\.ibd' cannot be decrypted; key_version=1");
-call mtr.add_suppression("InnoDB: Recovery failed to read page");
-call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
-call mtr.add_suppression("Table .*t1.* is corrupted");
-call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space=");
-# restart: --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
-SET GLOBAL innodb_file_per_table = ON;
-CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB
-ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
-INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
-# restart: --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys3.txt
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize Error Table `test`.`t1` is corrupted. Please drop the table and recreate.
-test.t1 optimize error Corrupt
-SHOW WARNINGS;
-Level Code Message
-CHECK TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 check Error Table `test`.`t1` is corrupted. Please drop the table and recreate.
-test.t1 check error Corrupt
-SHOW WARNINGS;
-Level Code Message
-# restart: --plugin-load-add=file_key_management --file-key-management --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
-DROP TABLE t1;
diff --git a/mysql-test/suite/encryption/r/innodb-checksum-algorithm.result b/mysql-test/suite/encryption/r/innodb-checksum-algorithm.result
index 7b97eb6b..f88f18d0 100644
--- a/mysql-test/suite/encryption/r/innodb-checksum-algorithm.result
+++ b/mysql-test/suite/encryption/r/innodb-checksum-algorithm.result
@@ -1,8 +1,6 @@
-SET @saved_file_per_table = @@global.innodb_file_per_table;
SET @saved_encrypt_tables = @@global.innodb_encrypt_tables;
SET @saved_encryption_threads = @@global.innodb_encryption_threads;
SET @saved_encryption_key_id = @@global.innodb_default_encryption_key_id;
-SET GLOBAL innodb_file_per_table = ON;
SET GLOBAL innodb_encrypt_tables = ON;
SET GLOBAL innodb_encryption_threads = 4;
SET GLOBAL innodb_default_encryption_key_id=4;
@@ -92,7 +90,6 @@ test.t check status OK
test.tpe check status OK
test.tp check status OK
DROP TABLE tce, tc, te, t, tpe, tp;
-SET GLOBAL innodb_file_per_table = @saved_file_per_table;
SET GLOBAL innodb_encrypt_tables = @saved_encrypt_tables;
SET GLOBAL innodb_encryption_threads = @saved_encryption_threads;
SET GLOBAL innodb_default_encryption_key_id = @saved_encryption_key_id;
diff --git a/mysql-test/suite/encryption/r/innodb-compressed-blob.result b/mysql-test/suite/encryption/r/innodb-compressed-blob.result
index 6c645ecf..fd095f70 100644
--- a/mysql-test/suite/encryption/r/innodb-compressed-blob.result
+++ b/mysql-test/suite/encryption/r/innodb-compressed-blob.result
@@ -4,7 +4,6 @@ call mtr.add_suppression("InnoDB: Unable to decompress ..test.t[1-3]\\.ibd\\[pag
call mtr.add_suppression("Table `test`\\.`t[12]` is corrupted");
# Restart mysqld --file-key-management-filename=keys2.txt
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
-SET GLOBAL innodb_file_per_table = ON;
set GLOBAL innodb_default_encryption_key_id=4;
create table t1(a int not null primary key, b blob, index(b(10))) engine=innodb row_format=compressed;
create table t2(a int not null primary key, b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes;
diff --git a/mysql-test/suite/encryption/r/innodb-force-corrupt.result b/mysql-test/suite/encryption/r/innodb-force-corrupt.result
index 16cce1d2..40b85beb 100644
--- a/mysql-test/suite/encryption/r/innodb-force-corrupt.result
+++ b/mysql-test/suite/encryption/r/innodb-force-corrupt.result
@@ -2,7 +2,6 @@ call mtr.add_suppression("Table `test`\\.`t[13]` (has an unreadable root page|is
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=\\d+, page number=[36]\\] in file .*test.t[123]\\.ibd looks corrupted; key_version=");
call mtr.add_suppression("\\[ERROR\\] InnoDB: We detected index corruption in an InnoDB type table");
call mtr.add_suppression("\\[ERROR\\] (mysqld|mariadbd).*: Index for table 't2' is corrupt; try to repair it");
-SET GLOBAL innodb_file_per_table = ON;
set global innodb_compression_algorithm = 1;
# Create and populate tables to be corrupted
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT,c char(200)) ENGINE=InnoDB encrypted=yes;
diff --git a/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result b/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result
index 4e816bea..4eb203d2 100644
--- a/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result
+++ b/mysql-test/suite/encryption/r/innodb-key-rotation-disable.result
@@ -1,4 +1,3 @@
-SET GLOBAL innodb_file_per_table = ON;
set global innodb_compression_algorithm = 1;
create database enctests;
use enctests;
diff --git a/mysql-test/suite/encryption/r/innodb-redo-badkey.result b/mysql-test/suite/encryption/r/innodb-redo-badkey.result
index 34fd043a..6b8f6aa1 100644
--- a/mysql-test/suite/encryption/r/innodb-redo-badkey.result
+++ b/mysql-test/suite/encryption/r/innodb-redo-badkey.result
@@ -14,7 +14,6 @@ call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE faile
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space=");
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
# Wait max 10 min for key encryption threads to encrypt all spaces
-SET GLOBAL innodb_file_per_table = ON;
create table t1(a int not null primary key auto_increment, c char(250), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes encryption_key_id=4;
create table t2(a int not null primary key auto_increment, c char(250), b blob, index(b(10))) engine=innodb row_format=compressed;
create table t3(a int not null primary key auto_increment, c char(250), b blob, index(b(10))) engine=innodb encrypted=yes encryption_key_id=4;
diff --git a/mysql-test/suite/encryption/r/innodb-redo-nokeys.result b/mysql-test/suite/encryption/r/innodb-redo-nokeys.result
index 78c2a200..cd17bd50 100644
--- a/mysql-test/suite/encryption/r/innodb-redo-nokeys.result
+++ b/mysql-test/suite/encryption/r/innodb-redo-nokeys.result
@@ -13,7 +13,6 @@ call mtr.add_suppression("InnoDB: Log scan aborted at LSN");
call mtr.add_suppression("InnoDB: Set innodb_force_recovery=1 to ignore corruption");
call mtr.add_suppression("InnoDB: Encryption key is not found for");
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
-SET GLOBAL innodb_file_per_table = ON;
create table t1(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes encryption_key_id=20;
create table t2(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes;
create table t3(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb encrypted=yes encryption_key_id=20;
diff --git a/mysql-test/suite/encryption/r/innodb-remove-encryption.result b/mysql-test/suite/encryption/r/innodb-remove-encryption.result
index e241d213..22207f81 100644
--- a/mysql-test/suite/encryption/r/innodb-remove-encryption.result
+++ b/mysql-test/suite/encryption/r/innodb-remove-encryption.result
@@ -1,4 +1,6 @@
set global innodb_file_per_table=OFF;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
call mtr.add_suppression("(mysqld|mariadbd).*: file-key-management-filename is not set");
call mtr.add_suppression("Plugin 'file_key_management' init function returned error.");
call mtr.add_suppression("Plugin 'file_key_management' registration as a ENCRYPTION failed.");
diff --git a/mysql-test/suite/encryption/r/innodb-spatial-index.result b/mysql-test/suite/encryption/r/innodb-spatial-index.result
index 66c3edcd..6bd22d6c 100644
--- a/mysql-test/suite/encryption/r/innodb-spatial-index.result
+++ b/mysql-test/suite/encryption/r/innodb-spatial-index.result
@@ -38,6 +38,9 @@ INSERT INTO t2 values(1, 'secret', ST_GeomFromText('POINT(903994614 180726515)')
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION > 0;
NAME
innodb_system
+innodb_undo001
+innodb_undo002
+innodb_undo003
mysql/innodb_index_stats
mysql/innodb_table_stats
mysql/transaction_registry
diff --git a/mysql-test/suite/encryption/r/innodb_encrypt_freed.result b/mysql-test/suite/encryption/r/innodb_encrypt_freed.result
index cdcdd177..9d4d99a2 100644
--- a/mysql-test/suite/encryption/r/innodb_encrypt_freed.result
+++ b/mysql-test/suite/encryption/r/innodb_encrypt_freed.result
@@ -19,7 +19,7 @@ mysql/innodb_table_stats
mysql/transaction_registry
test/t1
CREATE TABLE t2 (f1 int not null)engine=innodb;
-# restart: --debug=d,ib_log_checkpoint_avoid
+# restart: --debug-dbug=d,ib_log_checkpoint_avoid
connect con1,localhost,root,,,;
begin;
insert into t2 values(1);
@@ -46,7 +46,7 @@ mysql/transaction_registry
test/t1
test/t2
disconnect con1;
-# restart: --debug=d,ib_log_checkpoint_avoid
+# restart: --debug-dbug=d,ib_log_checkpoint_avoid
drop table t1, t2;
CREATE TABLE t1(f1 BIGINT PRIMARY KEY, f2 int not null,
f3 int not null, index(f1), index idx_1(f2),
@@ -60,7 +60,7 @@ mysql/innodb_table_stats
mysql/transaction_registry
test/t1
CREATE TABLE t2 (f1 int not null)engine=innodb;
-# restart: --debug=d,ib_log_checkpoint_avoid
+# restart: --debug-dbug=d,ib_log_checkpoint_avoid
connect con1,localhost,root,,,;
begin;
insert into t2 values(1);
@@ -77,7 +77,7 @@ test/t1
test/t2
alter table t1 drop index idx_1;
disconnect con1;
-# restart: --debug=d,ib_log_checkpoint_avoid
+# restart: --debug-dbug=d,ib_log_checkpoint_avoid
connect con1,localhost,root,,,;
begin;
insert into t2 values(1);
diff --git a/mysql-test/suite/encryption/r/innodb_import.result b/mysql-test/suite/encryption/r/innodb_import.result
index 54b95ab2..b1895b65 100644
--- a/mysql-test/suite/encryption/r/innodb_import.result
+++ b/mysql-test/suite/encryption/r/innodb_import.result
@@ -20,3 +20,22 @@ SELECT * FROM t2;
f1 f2
1 InnoDB
DROP TABLE t1, t2;
+#
+# MDEV-26137 ALTER TABLE IMPORT enhancement
+#
+# with encryption and page_compressed
+CREATE TABLE t1 (a int, b varchar(50)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=6 PAGE_COMPRESSED=1;
+INSERT INTO t1 VALUES(42, "hello");
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+ALTER TABLE t2 IMPORT TABLESPACE;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(50) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `ENCRYPTED`=YES `ENCRYPTION_KEY_ID`=6 `PAGE_COMPRESSED`=1
+SELECT * FROM t2;
+a b
+42 hello
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result b/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result
index d6e32989..3a280827 100644
--- a/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result
+++ b/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result
@@ -41,7 +41,6 @@ NOT FOUND /mangled/ in t6.ibd
# t7 ... on expecting NOT FOUND
NOT FOUND /mysql/ in t7.ibd
# restart
-SET GLOBAL innodb_file_per_table = ON;
ALTER TABLE t1 ADD COLUMN b int default 2;
ALTER TABLE t2 ADD COLUMN b int default 2;
ALTER TABLE t7 ADD COLUMN b int default 2;
diff --git a/mysql-test/suite/encryption/r/tempfiles_encrypted.result b/mysql-test/suite/encryption/r/tempfiles_encrypted.result
index 6dedcd4b..3560672e 100644
--- a/mysql-test/suite/encryption/r/tempfiles_encrypted.result
+++ b/mysql-test/suite/encryption/r/tempfiles_encrypted.result
@@ -1408,6 +1408,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -1422,7 +1423,9 @@ EXPLAIN
"table": {
"table_name": "t0",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1443,6 +1446,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "t1.a",
"window_functions_computation": {
@@ -1459,7 +1463,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1480,6 +1486,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -1494,7 +1501,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1517,6 +1526,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"having_condition": "MX in (3,5,7)",
"filesort": {
"sort_key": "t1.b",
@@ -1534,7 +1544,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 10,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1671,6 +1683,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -1685,7 +1698,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1703,6 +1718,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -1717,7 +1733,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1735,6 +1753,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -1749,7 +1768,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1767,6 +1788,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -1781,7 +1803,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 3,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1827,6 +1851,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"filesort": {
"sort_key": "row_number() over ( order by t1.s1,t1.s2) desc",
"window_functions_computation": {
@@ -1843,7 +1868,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 6,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -1987,6 +2014,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"duplicate_removal": {
"window_functions_computation": {
"sorts": [
@@ -2002,7 +2030,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 9,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -2167,6 +2197,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -2181,7 +2212,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 11,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -2234,6 +2267,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"window_functions_computation": {
"sorts": [
{
@@ -2248,7 +2282,9 @@ EXPLAIN
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"rows": 6,
+ "cost": "COST_REPLACED",
"filtered": 100
}
}
@@ -3833,6 +3869,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"window_functions_computation": {
@@ -3855,9 +3892,11 @@ ANALYZE
"table": {
"table_name": "t1",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 3,
"r_rows": 3,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
diff --git a/mysql-test/suite/encryption/t/encrypt_and_grep.test b/mysql-test/suite/encryption/t/encrypt_and_grep.test
index 12593837..648ad807 100644
--- a/mysql-test/suite/encryption/t/encrypt_and_grep.test
+++ b/mysql-test/suite/encryption/t/encrypt_and_grep.test
@@ -12,8 +12,6 @@
--let t3_IBD = $MYSQLD_DATADIR/test/t3.ibd
--let SEARCH_RANGE = 10000000
-SET GLOBAL innodb_file_per_table = ON;
-
create table t1 (a varchar(255)) engine=innodb encrypted=yes;
create table t2 (a varchar(255)) engine=innodb;
show warnings;
diff --git a/mysql-test/suite/encryption/t/innochecksum.test b/mysql-test/suite/encryption/t/innochecksum.test
index 516bc073..358a6a0f 100644
--- a/mysql-test/suite/encryption/t/innochecksum.test
+++ b/mysql-test/suite/encryption/t/innochecksum.test
@@ -26,7 +26,6 @@ call mtr.add_suppression("InnoDB: Crash recovery is broken due to insufficient i
--enable_query_log
let $checksum_algorithm = `SELECT @@innodb_checksum_algorithm`;
-SET GLOBAL innodb_file_per_table = ON;
# zlib
set global innodb_compression_algorithm = 1;
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change.test b/mysql-test/suite/encryption/t/innodb-bad-key-change.test
index e9537847..a5060cb8 100644
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change.test
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change.test
@@ -16,6 +16,7 @@ call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page n
call mtr.add_suppression("failed to read \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=[1-9][0-9]*, page number=3\\] in file .*test.t1.ibd looks corrupted; key_version=1");
call mtr.add_suppression("File '.*mysql-test.std_data.keysbad3\\.txt' not found");
+call mtr.add_suppression("File '.*mariadb-test.std_data.keysbad3\\.txt' not found");
# for innodb_checksum_algorithm=full_crc32 only
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space=");
@@ -23,8 +24,6 @@ call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space="
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
-- source include/restart_mysqld.inc
-SET GLOBAL innodb_file_per_table = ON;
-
CREATE TABLE t1 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=2;
INSERT INTO t1 VALUES ('foobar');
ALTER TABLE t1 ADD COLUMN c2 INT;
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change2.test b/mysql-test/suite/encryption/t/innodb-bad-key-change2.test
index 9ae3c722..ac8e18b4 100644
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change2.test
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change2.test
@@ -23,8 +23,6 @@ call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space="
--let $restart_parameters=--plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
--source include/restart_mysqld.inc
-SET GLOBAL innodb_file_per_table = ON;
-
CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB
ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change4.combinations b/mysql-test/suite/encryption/t/innodb-bad-key-change4.combinations
deleted file mode 100644
index 72938059..00000000
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change4.combinations
+++ /dev/null
@@ -1,5 +0,0 @@
-[strict_crc32]
---innodb-checksum-algorithm=strict_crc32
-
-[strict_full_crc32]
---innodb-checksum-algorithm=strict_full_crc32
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change4.opt b/mysql-test/suite/encryption/t/innodb-bad-key-change4.opt
deleted file mode 100644
index ce4c31a5..00000000
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change4.opt
+++ /dev/null
@@ -1,5 +0,0 @@
---loose-innodb-buffer-pool-stats
---loose-innodb-buffer-page
---loose-innodb-buffer-page-lru
---innodb-defragment=1
---skip-innodb-fast-shutdown
diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change4.test b/mysql-test/suite/encryption/t/innodb-bad-key-change4.test
deleted file mode 100644
index c37eb365..00000000
--- a/mysql-test/suite/encryption/t/innodb-bad-key-change4.test
+++ /dev/null
@@ -1,44 +0,0 @@
---source include/have_innodb.inc
-# embedded does not support restart
--- source include/not_embedded.inc
--- source filekeys_plugin_exists.inc
-#
-# MDEV-8769: Server crash at file btr0btr.ic line 122 when defragmenting encrypted table using incorrect keys
-# MDEV-8768: Server crash at file btr0btr.ic line 122 when checking encrypted table using incorrect keys
-#
-
-call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page)");
-call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t1\\.ibd' cannot be decrypted; key_version=1");
-call mtr.add_suppression("InnoDB: Recovery failed to read page");
-# Suppression for builds where file_key_management plugin is linked statically
-call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
-call mtr.add_suppression("Table .*t1.* is corrupted");
-# for innodb_checksum_algorithm=full_crc32 only
-call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space=");
-
---let $restart_parameters=--plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
---source include/restart_mysqld.inc
-
-SET GLOBAL innodb_file_per_table = ON;
-
-CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB
-ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
-INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
-
---let $restart_parameters=--plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt
---source include/restart_mysqld.inc
-
---replace_regex /key_id [1-9][0-9]*/\1 /
-OPTIMIZE TABLE t1;
---replace_regex /key_id [1-9][0-9]*/\1 /
-SHOW WARNINGS;
-
---replace_regex /key_id [1-9][0-9]*/\1 /
-CHECK TABLE t1;
---replace_regex /key_id [1-9][0-9]*/\1 /
-SHOW WARNINGS;
-
---let $restart_parameters=--plugin-load-add=file_key_management --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
---source include/restart_mysqld.inc
-
-DROP TABLE t1;
diff --git a/mysql-test/suite/encryption/t/innodb-checksum-algorithm.test b/mysql-test/suite/encryption/t/innodb-checksum-algorithm.test
index 157fb25b..2de7c171 100644
--- a/mysql-test/suite/encryption/t/innodb-checksum-algorithm.test
+++ b/mysql-test/suite/encryption/t/innodb-checksum-algorithm.test
@@ -2,12 +2,10 @@
-- source include/innodb_page_size.inc
-- source include/have_file_key_management_plugin.inc
-SET @saved_file_per_table = @@global.innodb_file_per_table;
SET @saved_encrypt_tables = @@global.innodb_encrypt_tables;
SET @saved_encryption_threads = @@global.innodb_encryption_threads;
SET @saved_encryption_key_id = @@global.innodb_default_encryption_key_id;
-SET GLOBAL innodb_file_per_table = ON;
SET GLOBAL innodb_encrypt_tables = ON;
SET GLOBAL innodb_encryption_threads = 4;
@@ -77,7 +75,6 @@ update tp set b=substr(b,1);
CHECK TABLE tce, tc, te, t, tpe, tp;
DROP TABLE tce, tc, te, t, tpe, tp;
-SET GLOBAL innodb_file_per_table = @saved_file_per_table;
SET GLOBAL innodb_encrypt_tables = @saved_encrypt_tables;
SET GLOBAL innodb_encryption_threads = @saved_encryption_threads;
SET GLOBAL innodb_default_encryption_key_id = @saved_encryption_key_id;
diff --git a/mysql-test/suite/encryption/t/innodb-compressed-blob.test b/mysql-test/suite/encryption/t/innodb-compressed-blob.test
index 645c7235..124b3ed1 100644
--- a/mysql-test/suite/encryption/t/innodb-compressed-blob.test
+++ b/mysql-test/suite/encryption/t/innodb-compressed-blob.test
@@ -13,8 +13,6 @@ call mtr.add_suppression("Table `test`\\.`t[12]` is corrupted");
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
-- source include/restart_mysqld.inc
-SET GLOBAL innodb_file_per_table = ON;
-
set GLOBAL innodb_default_encryption_key_id=4;
create table t1(a int not null primary key, b blob, index(b(10))) engine=innodb row_format=compressed;
create table t2(a int not null primary key, b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes;
diff --git a/mysql-test/suite/encryption/t/innodb-force-corrupt.test b/mysql-test/suite/encryption/t/innodb-force-corrupt.test
index 861cc78c..32205dec 100644
--- a/mysql-test/suite/encryption/t/innodb-force-corrupt.test
+++ b/mysql-test/suite/encryption/t/innodb-force-corrupt.test
@@ -12,7 +12,6 @@ call mtr.add_suppression("InnoDB: Encrypted page \\[page id: space=\\d+, page nu
call mtr.add_suppression("\\[ERROR\\] InnoDB: We detected index corruption in an InnoDB type table");
call mtr.add_suppression("\\[ERROR\\] (mysqld|mariadbd).*: Index for table 't2' is corrupt; try to repair it");
-SET GLOBAL innodb_file_per_table = ON;
set global innodb_compression_algorithm = 1;
--echo # Create and populate tables to be corrupted
diff --git a/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test b/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test
index d360d5f8..1bd69365 100644
--- a/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test
+++ b/mysql-test/suite/encryption/t/innodb-key-rotation-disable.test
@@ -4,7 +4,6 @@
-- source include/not_embedded.inc
let $encryption = `SELECT @@innodb_encrypt_tables`;
-SET GLOBAL innodb_file_per_table = ON;
# zlib
set global innodb_compression_algorithm = 1;
diff --git a/mysql-test/suite/encryption/t/innodb-redo-badkey.opt b/mysql-test/suite/encryption/t/innodb-redo-badkey.opt
index 0efdc8a7..a5182c76 100644
--- a/mysql-test/suite/encryption/t/innodb-redo-badkey.opt
+++ b/mysql-test/suite/encryption/t/innodb-redo-badkey.opt
@@ -1,4 +1,3 @@
---innodb-change-buffering=all
--innodb-encrypt-tables=on
--innodb-tablespaces-encryption
--innodb-encryption-threads=2
diff --git a/mysql-test/suite/encryption/t/innodb-redo-badkey.test b/mysql-test/suite/encryption/t/innodb-redo-badkey.test
index 393ca4ad..de6d7f2f 100644
--- a/mysql-test/suite/encryption/t/innodb-redo-badkey.test
+++ b/mysql-test/suite/encryption/t/innodb-redo-badkey.test
@@ -31,8 +31,6 @@ call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot decrypt \\[page id: space="
--let $wait_condition=SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
--source include/wait_condition.inc
-SET GLOBAL innodb_file_per_table = ON;
-
create table t1(a int not null primary key auto_increment, c char(250), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes encryption_key_id=4;
create table t2(a int not null primary key auto_increment, c char(250), b blob, index(b(10))) engine=innodb row_format=compressed;
create table t3(a int not null primary key auto_increment, c char(250), b blob, index(b(10))) engine=innodb encrypted=yes encryption_key_id=4;
diff --git a/mysql-test/suite/encryption/t/innodb-redo-nokeys.opt b/mysql-test/suite/encryption/t/innodb-redo-nokeys.opt
index 6190ad24..4e7b2290 100644
--- a/mysql-test/suite/encryption/t/innodb-redo-nokeys.opt
+++ b/mysql-test/suite/encryption/t/innodb-redo-nokeys.opt
@@ -1,2 +1 @@
---innodb-change-buffering=none
--innodb-default-encryption-key-id=20
diff --git a/mysql-test/suite/encryption/t/innodb-redo-nokeys.test b/mysql-test/suite/encryption/t/innodb-redo-nokeys.test
index 9cf515f5..87a9e7a1 100644
--- a/mysql-test/suite/encryption/t/innodb-redo-nokeys.test
+++ b/mysql-test/suite/encryption/t/innodb-redo-nokeys.test
@@ -21,8 +21,6 @@ call mtr.add_suppression("InnoDB: Encryption key is not found for");
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
-- source include/restart_mysqld.inc
-SET GLOBAL innodb_file_per_table = ON;
-
create table t1(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes encryption_key_id=20;
create table t2(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes;
create table t3(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb encrypted=yes encryption_key_id=20;
diff --git a/mysql-test/suite/encryption/t/innodb_encrypt_freed.test b/mysql-test/suite/encryption/t/innodb_encrypt_freed.test
index 26c1e8df..408e874a 100644
--- a/mysql-test/suite/encryption/t/innodb_encrypt_freed.test
+++ b/mysql-test/suite/encryption/t/innodb_encrypt_freed.test
@@ -21,7 +21,7 @@ CREATE TABLE t1(f1 BIGINT PRIMARY KEY, f2 int not null,
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
CREATE TABLE t2 (f1 int not null)engine=innodb;
-let $restart_parameters=--debug=d,ib_log_checkpoint_avoid;
+let $restart_parameters=--debug-dbug=d,ib_log_checkpoint_avoid;
--source include/restart_mysqld.inc
# Stop the purge
diff --git a/mysql-test/suite/encryption/t/innodb_import.test b/mysql-test/suite/encryption/t/innodb_import.test
index 2e5470c5..91bae752 100644
--- a/mysql-test/suite/encryption/t/innodb_import.test
+++ b/mysql-test/suite/encryption/t/innodb_import.test
@@ -21,3 +21,22 @@ ALTER TABLE t2 DROP KEY idx;
ALTER TABLE t2 IMPORT TABLESPACE;
SELECT * FROM t2;
DROP TABLE t1, t2;
+
+--echo #
+--echo # MDEV-26137 ALTER TABLE IMPORT enhancement
+--echo #
+
+--echo # with encryption and page_compressed
+CREATE TABLE t1 (a int, b varchar(50)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=6 PAGE_COMPRESSED=1;
+INSERT INTO t1 VALUES(42, "hello");
+FLUSH TABLES t1 FOR EXPORT;
+--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg
+--copy_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/t2.frm
+--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd
+UNLOCK TABLES;
+ALTER TABLE t2 IMPORT TABLESPACE;
+SHOW CREATE TABLE t2;
+SELECT * FROM t2;
+DROP TABLE t1, t2;
+
+# Embedded server uses absolute path, causing result mismatch in warning messages when .cfg is not copied over. Given we have tested importing without copying cfg in other tests, we don't do it here.
diff --git a/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test b/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test
index 9f61bf11..dc6d1e6f 100644
--- a/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test
+++ b/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test
@@ -75,8 +75,6 @@ set autocommit=1;
-- source include/start_mysqld.inc
-SET GLOBAL innodb_file_per_table = ON;
-
ALTER TABLE t1 ADD COLUMN b int default 2;
ALTER TABLE t2 ADD COLUMN b int default 2;
ALTER TABLE t7 ADD COLUMN b int default 2;
diff --git a/mysql-test/suite/engines/funcs/r/rpl_000010.result b/mysql-test/suite/engines/funcs/r/rpl_000010.result
index a86d71bd..0b3a67bf 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_000010.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_000010.result
@@ -16,4 +16,5 @@ n
connection master;
drop table t1;
connection slave;
+include/wait_for_slave_to_start.inc
include/rpl_end.inc
diff --git a/mysql-test/suite/engines/funcs/r/rpl_drop_db.result b/mysql-test/suite/engines/funcs/r/rpl_drop_db.result
index 3712527a..1b132c20 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_drop_db.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_drop_db.result
@@ -6,8 +6,6 @@ create database mysqltest1;
create table mysqltest1.t1 (n int);
insert into mysqltest1.t1 values (1);
select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt';
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create table mysqltest1.t2 (n int);
create table mysqltest1.t3 (n int);
drop database mysqltest1;
diff --git a/mysql-test/suite/engines/funcs/r/rpl_dual_pos_advance.result b/mysql-test/suite/engines/funcs/r/rpl_dual_pos_advance.result
index ed9060f8..dd25cdc4 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_dual_pos_advance.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_dual_pos_advance.result
@@ -3,7 +3,7 @@ include/master-slave.inc
connection slave;
reset master;
connection master;
-change master to master_host="127.0.0.1",master_port=SLAVE_PORT,master_user="root";
+change master to master_host="127.0.0.1",master_port=SLAVE_PORT,master_user="root",master_ssl_verify_server_cert=0;
include/start_slave.inc
connection slave;
create table t1 (n int);
@@ -25,4 +25,5 @@ include/stop_slave.inc
reset slave;
drop table t1,t4,t5,t6;
connection slave;
+include/wait_for_slave_to_start.inc
include/rpl_end.inc
diff --git a/mysql-test/suite/engines/funcs/r/rpl_flushlog_loop.result b/mysql-test/suite/engines/funcs/r/rpl_flushlog_loop.result
index 527dd8dc..56e428b3 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_flushlog_loop.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_flushlog_loop.result
@@ -3,11 +3,11 @@ include/master-slave.inc
connection slave;
include/stop_slave.inc
change master to master_host='127.0.0.1',master_user='root',
-master_password='',master_port=MASTER_PORT;
+master_password='',master_port=MASTER_PORT, master_ssl_verify_server_cert=0;
include/start_slave.inc
connection master;
change master to master_host='127.0.0.1',master_user='root',
-master_password='',master_port=SLAVE_PORT;
+master_password='',master_port=SLAVE_PORT, master_ssl_verify_server_cert=0;
include/start_slave.inc
flush logs;
include/stop_slave.inc
diff --git a/mysql-test/suite/engines/funcs/r/rpl_misc_functions.result b/mysql-test/suite/engines/funcs/r/rpl_misc_functions.result
index 302cf235..6c20623d 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_misc_functions.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_misc_functions.result
@@ -42,8 +42,6 @@ INSERT INTO t1 (col_a) VALUES (test_replication_sf());
INSERT INTO t1 (col_a) VALUES (test_replication_sf());
connection slave;
select * from t1 into outfile "../../tmp/t1_slave.txt";
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
connection master;
create temporary table t1_slave select * from t1 where 1=0;
load data infile '../../tmp/t1_slave.txt' into table t1_slave;
diff --git a/mysql-test/suite/engines/funcs/r/rpl_row_drop.result b/mysql-test/suite/engines/funcs/r/rpl_row_drop.result
index 8753764e..8546960b 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_row_drop.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_row_drop.result
@@ -6,6 +6,7 @@ CREATE TABLE t2 (a int);
CREATE TEMPORARY TABLE t2 (a int, b int);
SHOW TABLES;
Tables_in_test
+t2
t1
t2
connection slave;
@@ -28,6 +29,7 @@ connection master;
CREATE TEMPORARY TABLE t2 (a int, b int);
SHOW TABLES;
Tables_in_test
+t2
t1
t2
connection slave;
diff --git a/mysql-test/suite/engines/funcs/r/rpl_sp,myisam,mix.rdiff b/mysql-test/suite/engines/funcs/r/rpl_sp,myisam,mix.rdiff
index da41283e..cbf297f8 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_sp,myisam,mix.rdiff
+++ b/mysql-test/suite/engines/funcs/r/rpl_sp,myisam,mix.rdiff
@@ -1,5 +1,5 @@
---- /home/alice/git/10.3/mysql-test/suite/engines/funcs/r/rpl_sp,myisam,mix.result~ 2021-03-19 17:27:12.935559866 +0100
-+++ /home/alice/git/10.3/mysql-test/suite/engines/funcs/r/rpl_sp,myisam,mix.reject 2021-03-19 17:27:14.071534938 +0100
+--- /home/alice/git/10.3/mysql-test/suite/engines/funcs/r/rpl_sp,myisam,mix.result~
++++ /home/alice/git/10.3/mysql-test/suite/engines/funcs/r/rpl_sp,myisam,mix.reject
@@ -126,12 +126,15 @@
show warnings;
Level Code Message
diff --git a/mysql-test/suite/engines/funcs/r/rpl_temporary.result b/mysql-test/suite/engines/funcs/r/rpl_temporary.result
index 492e9ac3..3651ead1 100644
--- a/mysql-test/suite/engines/funcs/r/rpl_temporary.result
+++ b/mysql-test/suite/engines/funcs/r/rpl_temporary.result
@@ -42,12 +42,12 @@ connect con3,localhost,zedjzlcsjhd,,;
connection con3;
SET @save_select_limit=@@session.sql_select_limit;
SET @@session.sql_select_limit=10, @@session.pseudo_thread_id=100;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG REPLAY privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG REPLAY privilege(s) for this operation
SELECT @@session.sql_select_limit = @save_select_limit;
@@session.sql_select_limit = @save_select_limit
1
SET @@session.sql_select_limit=10, @@session.sql_log_bin=0;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SELECT @@session.sql_select_limit = @save_select_limit;
@@session.sql_select_limit = @save_select_limit
1
diff --git a/mysql-test/suite/engines/funcs/r/tc_temporary_column.result b/mysql-test/suite/engines/funcs/r/tc_temporary_column.result
index 03627817..e2efd0d4 100644
--- a/mysql-test/suite/engines/funcs/r/tc_temporary_column.result
+++ b/mysql-test/suite/engines/funcs/r/tc_temporary_column.result
@@ -2,6 +2,7 @@ DROP TABLE IF EXISTS t1;
CREATE TEMPORARY TABLE t1(c1 BIT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -13,6 +14,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 TINYINT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -24,6 +26,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 SMALLINT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -35,6 +38,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 MEDIUMINT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -46,6 +50,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 INT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -57,6 +62,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 INTEGER NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -68,6 +74,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 BIGINT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -79,6 +86,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 DECIMAL NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -90,6 +98,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 DEC NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -101,6 +110,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 FIXED NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -112,6 +122,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 NUMERIC NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -123,6 +134,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 DOUBLE NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -134,6 +146,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 REAL NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -145,6 +158,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 DOUBLE PRECISION NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -156,6 +170,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 FLOAT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -167,6 +182,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 DATE NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -178,6 +194,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 TIME NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -189,6 +206,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 TIMESTAMP NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -200,6 +218,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 DATETIME NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -211,6 +230,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 YEAR NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -222,6 +242,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 TINYBLOB NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -233,6 +254,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 BLOB NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -244,6 +266,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 MEDIUMBLOB NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -255,6 +278,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 LONGBLOB NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -266,6 +290,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 TINYTEXT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -277,6 +302,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 TEXT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -288,6 +314,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 MEDIUMTEXT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -299,6 +326,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 LONGTEXT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -310,6 +338,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 BIT NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -321,6 +350,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 TINYINT NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -332,6 +362,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 SMALLINT NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -343,6 +374,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 MEDIUMINT NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -354,6 +386,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 INT NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -365,6 +398,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 INTEGER NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -376,6 +410,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 BIGINT NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -387,6 +422,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 DECIMAL NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -398,6 +434,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 DEC NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -409,6 +446,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 FIXED NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -420,6 +458,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 NUMERIC NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -431,6 +470,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 DOUBLE NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -442,6 +482,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 REAL NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -453,6 +494,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 DOUBLE PRECISION NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -464,6 +506,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 FLOAT NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -475,6 +518,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 DATE NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -486,6 +530,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 TIME NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -497,6 +542,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 TIMESTAMP NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -508,6 +554,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 DATETIME NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -519,6 +566,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 YEAR NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -530,6 +578,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 TINYBLOB NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -541,6 +590,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 BLOB NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -552,6 +602,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 MEDIUMBLOB NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -563,6 +614,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 LONGBLOB NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -574,6 +626,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 TINYTEXT NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -585,6 +638,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 TEXT NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -596,6 +650,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 MEDIUMTEXT NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
@@ -607,6 +662,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t1(c1 LONGTEXT NOT NULL);
SHOW TABLES;
Tables_in_test
+t1
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
diff --git a/mysql-test/suite/engines/funcs/r/tc_temporary_column_length.result b/mysql-test/suite/engines/funcs/r/tc_temporary_column_length.result
index f1a9a775..659043d9 100644
--- a/mysql-test/suite/engines/funcs/r/tc_temporary_column_length.result
+++ b/mysql-test/suite/engines/funcs/r/tc_temporary_column_length.result
@@ -2,6 +2,7 @@ DROP TABLE IF EXISTS t5;
CREATE TEMPORARY TABLE t5(c1 BIT(10) NULL);
SHOW TABLES;
Tables_in_test
+t5
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TEMPORARY TABLE `t5` (
@@ -13,6 +14,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t5(c1 TINYINT(10) NULL);
SHOW TABLES;
Tables_in_test
+t5
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TEMPORARY TABLE `t5` (
@@ -24,6 +26,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t5(c1 SMALLINT(10) NULL);
SHOW TABLES;
Tables_in_test
+t5
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TEMPORARY TABLE `t5` (
@@ -35,6 +38,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t5(c1 MEDIUMINT(10) NULL);
SHOW TABLES;
Tables_in_test
+t5
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TEMPORARY TABLE `t5` (
@@ -46,6 +50,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t5(c1 INT(10) NULL);
SHOW TABLES;
Tables_in_test
+t5
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TEMPORARY TABLE `t5` (
@@ -57,6 +62,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t5(c1 INTEGER(10) NULL);
SHOW TABLES;
Tables_in_test
+t5
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TEMPORARY TABLE `t5` (
@@ -68,6 +74,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t5(c1 BIGINT(10) NULL);
SHOW TABLES;
Tables_in_test
+t5
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TEMPORARY TABLE `t5` (
@@ -79,6 +86,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t5(c1 CHAR(10) NULL);
SHOW TABLES;
Tables_in_test
+t5
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TEMPORARY TABLE `t5` (
@@ -90,6 +98,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t5(c1 VARCHAR(10) NULL);
SHOW TABLES;
Tables_in_test
+t5
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TEMPORARY TABLE `t5` (
@@ -101,6 +110,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t5(c1 BINARY(10) NULL);
SHOW TABLES;
Tables_in_test
+t5
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TEMPORARY TABLE `t5` (
@@ -112,6 +122,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t5(c1 VARBINARY(10) NULL);
SHOW TABLES;
Tables_in_test
+t5
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TEMPORARY TABLE `t5` (
@@ -123,6 +134,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t5(c1 BIT(10) NOT NULL);
SHOW TABLES;
Tables_in_test
+t5
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TEMPORARY TABLE `t5` (
@@ -134,6 +146,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t5(c1 TINYINT(10) NOT NULL);
SHOW TABLES;
Tables_in_test
+t5
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TEMPORARY TABLE `t5` (
@@ -145,6 +158,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t5(c1 SMALLINT(10) NOT NULL);
SHOW TABLES;
Tables_in_test
+t5
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TEMPORARY TABLE `t5` (
@@ -156,6 +170,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t5(c1 MEDIUMINT(10) NOT NULL);
SHOW TABLES;
Tables_in_test
+t5
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TEMPORARY TABLE `t5` (
@@ -167,6 +182,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t5(c1 INT(10) NOT NULL);
SHOW TABLES;
Tables_in_test
+t5
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TEMPORARY TABLE `t5` (
@@ -178,6 +194,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t5(c1 INTEGER(10) NOT NULL);
SHOW TABLES;
Tables_in_test
+t5
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TEMPORARY TABLE `t5` (
@@ -189,6 +206,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t5(c1 BIGINT(10) NOT NULL);
SHOW TABLES;
Tables_in_test
+t5
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TEMPORARY TABLE `t5` (
@@ -200,6 +218,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t5(c1 CHAR(10) NOT NULL);
SHOW TABLES;
Tables_in_test
+t5
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TEMPORARY TABLE `t5` (
@@ -211,6 +230,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t5(c1 VARCHAR(10) NOT NULL);
SHOW TABLES;
Tables_in_test
+t5
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TEMPORARY TABLE `t5` (
@@ -222,6 +242,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t5(c1 BINARY(10) NOT NULL);
SHOW TABLES;
Tables_in_test
+t5
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TEMPORARY TABLE `t5` (
@@ -233,6 +254,7 @@ Tables_in_test
CREATE TEMPORARY TABLE t5(c1 VARBINARY(10) NOT NULL);
SHOW TABLES;
Tables_in_test
+t5
SHOW CREATE TABLE t5;
Table Create Table
t5 CREATE TEMPORARY TABLE `t5` (
diff --git a/mysql-test/suite/engines/funcs/t/rpl_dual_pos_advance.test b/mysql-test/suite/engines/funcs/t/rpl_dual_pos_advance.test
index bf5e8415..a61904ed 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_dual_pos_advance.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_dual_pos_advance.test
@@ -16,7 +16,7 @@ reset master;
connection master;
--replace_result $SLAVE_MYPORT SLAVE_PORT
-eval change master to master_host="127.0.0.1",master_port=$SLAVE_MYPORT,master_user="root";
+eval change master to master_host="127.0.0.1",master_port=$SLAVE_MYPORT,master_user="root",master_ssl_verify_server_cert=0;
--source include/start_slave.inc
@@ -100,6 +100,7 @@ reset slave;
drop table t1,t4,t5,t6; # add t2 and t3 later
--sync_slave_with_master
+--source include/wait_for_slave_to_start.inc
# End of 4.1 tests
--source include/rpl_end.inc
diff --git a/mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test b/mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test
index b4742246..38da16ff 100644
--- a/mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test
+++ b/mysql-test/suite/engines/funcs/t/rpl_flushlog_loop.test
@@ -11,7 +11,7 @@ connection slave;
--replace_result $MASTER_MYPORT MASTER_PORT
eval change master to master_host='127.0.0.1',master_user='root',
- master_password='',master_port=$MASTER_MYPORT;
+ master_password='',master_port=$MASTER_MYPORT, master_ssl_verify_server_cert=0;
--source include/start_slave.inc
#
# Start replication slave -> master
@@ -20,7 +20,7 @@ connection master;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval change master to master_host='127.0.0.1',master_user='root',
- master_password='',master_port=$SLAVE_MYPORT;
+ master_password='',master_port=$SLAVE_MYPORT, master_ssl_verify_server_cert=0;
--source include/start_slave.inc
#
diff --git a/mysql-test/suite/engines/iuds/r/delete_year.result b/mysql-test/suite/engines/iuds/r/delete_year.result
index c82f0dae..9a2cf750 100644
--- a/mysql-test/suite/engines/iuds/r/delete_year.result
+++ b/mysql-test/suite/engines/iuds/r/delete_year.result
@@ -3,12 +3,12 @@ CREATE TABLE t1(c1 YEAR NOT NULL,c2 YEAR, PRIMARY KEY(c1));
CREATE TABLE t2(c1 YEAR NOT NULL, c2 YEAR, UNIQUE INDEX idx(c1,c2));
CREATE TABLE t3(c1 YEAR(2) NOT NULL,c2 YEAR(2), PRIMARY KEY(c1));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
CREATE TABLE t4(c1 YEAR(2), c2 YEAR(2), UNIQUE INDEX idx(c1,c2));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
INSERT INTO t1 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155);
INSERT INTO t2 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155);
INSERT INTO t3 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155);
diff --git a/mysql-test/suite/engines/iuds/r/insert_year.result b/mysql-test/suite/engines/iuds/r/insert_year.result
index 8065f606..4bd5e618 100644
--- a/mysql-test/suite/engines/iuds/r/insert_year.result
+++ b/mysql-test/suite/engines/iuds/r/insert_year.result
@@ -3250,20 +3250,20 @@ c1 c2 c3 c4
DROP TABLE t1,t2,t3,t4;
CREATE TABLE t1(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME, PRIMARY KEY(c1), UNIQUE INDEX(c2));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
CREATE TABLE t2(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME, PRIMARY KEY(c1,c2));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
CREATE TABLE t3(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME, UNIQUE INDEX idx(c1,c2));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
CREATE TABLE t4(c1 YEAR(2) NOT NULL, c2 YEAR(2) NULL, c3 DATE, c4 DATETIME);
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
INSERT INTO t1 VALUES('1901','1901','98-12-31','98.12.31 11:30:45'),('1999','1999','98-12-30','98.12.30 11:30:45'),('2000','2000','98-12-29','98.12.29 11:30:45'),('2001','2001','98-12-28','98.12.28 11:30:45'),('2099','2099','98-12-27','98.12.27 11:30:45'),('2100','2100','98-12-26','98.12.26 11:30:45'),('2155','2155','98-12-26','98.12.26 11:30:45');
INSERT INTO t2 VALUES('1901','1901','98-12-31','98.12.31 11:30:45'),('1999','1999','98-12-30','98.12.30 11:30:45'),('2000','2000','98-12-29','98.12.29 11:30:45'),('2001','2001','98-12-28','98.12.28 11:30:45'),('2099','2099','98-12-27','98.12.27 11:30:45'),('2100','2100','98-12-26','98.12.26 11:30:45'),('2155','2155','98-12-26','98.12.26 11:30:45');
INSERT INTO t3 VALUES('1901','1901','98-12-31','98.12.31 11:30:45'),('1999','1999','98-12-30','98.12.30 11:30:45'),('2000','2000','98-12-29','98.12.29 11:30:45'),('2001','2001','98-12-28','98.12.28 11:30:45'),('2099','2099','98-12-27','98.12.27 11:30:45'),('2100','2100','98-12-26','98.12.26 11:30:45'),('2155','2155','98-12-26','98.12.26 11:30:45');
diff --git a/mysql-test/suite/engines/iuds/r/type_bit_iuds.result b/mysql-test/suite/engines/iuds/r/type_bit_iuds.result
index 93ed7a9f..6f48a430 100644
--- a/mysql-test/suite/engines/iuds/r/type_bit_iuds.result
+++ b/mysql-test/suite/engines/iuds/r/type_bit_iuds.result
@@ -568,9 +568,18 @@ UPDATE IGNORE t5 SET c2=c2+10 WHERE c1 IN (b'001',b'101',b'111');
SELECT hex(c1),hex(c2) FROM t5;
hex(c1) hex(c2)
1 1
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -1399,9 +1408,18 @@ UPDATE IGNORE t5 SET c2=c2+10 WHERE c1 IN (b'001',b'101',b'111');
SELECT hex(c1),hex(c2) FROM t5;
hex(c1) hex(c2)
1 1
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -2252,10 +2270,17 @@ hex(c1) hex(c2)
1 3
2 2
3 3
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
-Warning 1264 Out of range value for column 'c2' at row 2
-Warning 1264 Out of range value for column 'c2' at row 3
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -3191,7 +3216,7 @@ hex(c1) hex(c2)
8 D
9 D
A A
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
@@ -11797,9 +11822,18 @@ UPDATE IGNORE t5 SET c2=c2+10 WHERE c1 IN (b'001',b'101',b'111');
SELECT hex(c1),hex(c2) FROM t5;
hex(c1) hex(c2)
1 1
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -12628,9 +12662,18 @@ UPDATE IGNORE t5 SET c2=c2+10 WHERE c1 IN (b'001',b'101',b'111');
SELECT hex(c1),hex(c2) FROM t5;
hex(c1) hex(c2)
1 1
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -13481,10 +13524,17 @@ hex(c1) hex(c2)
1 3
2 2
3 3
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
-Warning 1264 Out of range value for column 'c2' at row 2
-Warning 1264 Out of range value for column 'c2' at row 3
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -14420,7 +14470,7 @@ hex(c1) hex(c2)
8 D
9 D
A A
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
@@ -23032,9 +23082,18 @@ UPDATE IGNORE t5 SET c2=c2+10 WHERE c1 IN (b'001',b'101',b'111');
SELECT hex(c1),hex(c2) FROM t5;
hex(c1) hex(c2)
1 1
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -23869,9 +23928,18 @@ UPDATE IGNORE t5 SET c2=c2+10 WHERE c1 IN (b'001',b'101',b'111');
SELECT hex(c1),hex(c2) FROM t5;
hex(c1) hex(c2)
1 1
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -24722,10 +24790,17 @@ hex(c1) hex(c2)
1 3
2 2
3 3
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
-Warning 1264 Out of range value for column 'c2' at row 2
-Warning 1264 Out of range value for column 'c2' at row 3
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -25661,7 +25736,7 @@ hex(c1) hex(c2)
8 D
9 D
A A
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
@@ -34273,9 +34348,18 @@ UPDATE IGNORE t5 SET c2=c2+10 WHERE c1 IN (b'001',b'101',b'111');
SELECT hex(c1),hex(c2) FROM t5;
hex(c1) hex(c2)
1 1
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -35110,9 +35194,18 @@ UPDATE IGNORE t5 SET c2=c2+10 WHERE c1 IN (b'001',b'101',b'111');
SELECT hex(c1),hex(c2) FROM t5;
hex(c1) hex(c2)
1 1
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -35969,10 +36062,17 @@ hex(c1) hex(c2)
1 3
2 2
3 3
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
-Warning 1264 Out of range value for column 'c2' at row 2
-Warning 1264 Out of range value for column 'c2' at row 3
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -36908,7 +37008,7 @@ hex(c1) hex(c2)
8 D
9 D
A A
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
@@ -45520,9 +45620,18 @@ UPDATE IGNORE t5 SET c2=c2+10 WHERE c1 IN (b'001',b'101',b'111');
SELECT hex(c1),hex(c2) FROM t5;
hex(c1) hex(c2)
1 1
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -46357,9 +46466,18 @@ UPDATE IGNORE t5 SET c2=c2+10 WHERE c1 IN (b'001',b'101',b'111');
SELECT hex(c1),hex(c2) FROM t5;
hex(c1) hex(c2)
1 1
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -47216,10 +47334,17 @@ hex(c1) hex(c2)
1 3
2 2
3 3
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
-Warning 1264 Out of range value for column 'c2' at row 2
-Warning 1264 Out of range value for column 'c2' at row 3
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -48161,7 +48286,7 @@ hex(c1) hex(c2)
8 D
9 D
A A
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
@@ -56781,9 +56906,18 @@ UPDATE IGNORE t5 SET c2=c2+10 WHERE c1 IN (b'001',b'101',b'111');
SELECT hex(c1),hex(c2) FROM t5;
hex(c1) hex(c2)
1 1
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -57620,9 +57754,18 @@ UPDATE IGNORE t5 SET c2=c2+10 WHERE c1 IN (b'001',b'101',b'111');
SELECT hex(c1),hex(c2) FROM t5;
hex(c1) hex(c2)
1 1
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -58481,10 +58624,17 @@ hex(c1) hex(c2)
1 3
2 2
3 3
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
-Warning 1264 Out of range value for column 'c2' at row 2
-Warning 1264 Out of range value for column 'c2' at row 3
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -59428,7 +59578,7 @@ hex(c1) hex(c2)
8 D
9 D
A A
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
@@ -68059,9 +68209,18 @@ UPDATE IGNORE t5 SET c2=c2+10 WHERE c1 IN (b'001',b'101',b'111');
SELECT hex(c1),hex(c2) FROM t5;
hex(c1) hex(c2)
1 1
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -68895,9 +69054,18 @@ UPDATE IGNORE t5 SET c2=c2+10 WHERE c1 IN (b'001',b'101',b'111');
SELECT hex(c1),hex(c2) FROM t5;
hex(c1) hex(c2)
1 1
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -69753,10 +69921,17 @@ hex(c1) hex(c2)
1 3
2 2
3 3
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
-Warning 1264 Out of range value for column 'c2' at row 2
-Warning 1264 Out of range value for column 'c2' at row 3
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -70697,7 +70872,7 @@ hex(c1) hex(c2)
8 D
9 D
A A
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
@@ -79322,9 +79497,18 @@ UPDATE IGNORE t5 SET c2=c2+10 WHERE c1 IN (b'001',b'101',b'111');
SELECT hex(c1),hex(c2) FROM t5;
hex(c1) hex(c2)
1 1
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -80158,9 +80342,18 @@ UPDATE IGNORE t5 SET c2=c2+10 WHERE c1 IN (b'001',b'101',b'111');
SELECT hex(c1),hex(c2) FROM t5;
hex(c1) hex(c2)
1 1
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -81016,10 +81209,17 @@ hex(c1) hex(c2)
1 3
2 2
3 3
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
-Warning 1264 Out of range value for column 'c2' at row 2
-Warning 1264 Out of range value for column 'c2' at row 3
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
+Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
TRUNCATE t6;
INSERT IGNORE INTO t5 VALUES (95, 46), (31, 438), (61, 152), (78, 123), (88, 411), (122, 118), (0, 177),(75, 42), (108, 67), (79, 349), (59, 188), (69, 206), (49, 345), (118, 380),(111, 368), (94, 468), (56, 379), (77, 133), (29, 399), (9, 363), (23, 36),(116, 390), (119, 368), (87, 351), (123, 411), (24, 398), (34, 202), (28, 499),(30, 83), (5, 178), (60, 343), (4, 245), (104, 280), (106, 446), (127, 403),(44, 307), (68, 454), (57, 135);
@@ -81960,7 +82160,7 @@ hex(c1) hex(c2)
8 D
9 D
A A
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
Warnings:
Warning 1264 Out of range value for column 'c2' at row 1
TRUNCATE t5;
diff --git a/mysql-test/suite/engines/iuds/r/update_delete_number.result b/mysql-test/suite/engines/iuds/r/update_delete_number.result
index 1cd2a62c..1534f93b 100644
--- a/mysql-test/suite/engines/iuds/r/update_delete_number.result
+++ b/mysql-test/suite/engines/iuds/r/update_delete_number.result
@@ -739,8 +739,21 @@ c1 c2 c3 c1 c2 c3
DELETE FROM a1, a2 USING t1 AS a1 INNER JOIN t2 AS a2 WHERE a2.c1=a1.c2;
SELECT * FROM t1,t2 WHERE t2.c1=t1.c2;
c1 c2 c3 c1 c2 c3
-DELETE FROM t1,t2 using t1,t2 where t1.c1=(select c1 from t1);
-ERROR HY000: Table 't1' is specified twice, both as a target for 'DELETE' and as a separate source for data
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t2;
+INSERT INTO t1 VALUES(254,127,1),(0,-128,2),(1,127,3),(3,NULL,5);
+INSERT INTO t2 VALUES(127,255,1),(127,1,2),(-128,0,3),(-1,NULL,5);
+DELETE FROM t1,t2 using t1,t2
+where t1.c1=(select c1 from t1 where c2 < 10) and t2.c2 < 10;
+SELECT * FROM t1;
+c1 c2 c3
+1 127 3
+254 127 1
+3 NULL 5
+SELECT * FROM t2;
+c1 c2 c3
+-1 NULL 5
+127 255 1
CREATE TABLE t3(c1 INT UNSIGNED NOT NULL PRIMARY KEY, c2 INT SIGNED NULL, c3 INT);
CREATE TABLE t4(c1 INT UNSIGNED, c2 INT);
INSERT INTO t3 VALUES(200,126,1),(250,-127,2);
@@ -981,7 +994,6 @@ create table mt1 (col1 int);
create table mt2 (col1 int);
update mt1,mt2 set mt1.col1 = (select max(col1) from mt1) where mt1.col1 = mt2.col1;
delete mt1 from mt1,mt2 where mt1.col1 < (select max(col1) from mt1) and mt1.col1 = mt2.col1;
-ERROR HY000: Table 'mt1' is specified twice, both as a target for 'DELETE' and as a separate source for data
drop table mt1,mt2;
CREATE TABLE IF NOT EXISTS `mt1` (`id` int(11) NOT NULL auto_increment, `tst` text, `tsmt1` text, PRIMARY KEY (`id`));
CREATE TABLE IF NOT EXISTS `mt2` (`ID` int(11) NOT NULL auto_increment, `ParId` int(11) default NULL, `tst` text, `tsmt1` text, PRIMARY KEY (`ID`), KEY `IX_ParId_mt2` (`ParId`), FOREIGN KEY (`ParId`) REFERENCES `mt1` (`id`));
@@ -1852,7 +1864,6 @@ DELETE FROM a1, a2 USING t1 AS a1 INNER JOIN t2 AS a2 WHERE a2.c1=a1.c2;
SELECT * FROM t1,t2 WHERE t2.c1=t1.c2;
c1 c2 c3 c1 c2 c3
DELETE FROM t1,t2 using t1,t2 where t1.c1=(select c1 from t1);
-ERROR HY000: Table 't1' is specified twice, both as a target for 'DELETE' and as a separate source for data
CREATE TABLE t3(c1 TINYINT UNSIGNED NOT NULL PRIMARY KEY, c2 TINYINT SIGNED NULL, c3 INT);
CREATE TABLE t4(c1 TINYINT UNSIGNED, c2 INT);
INSERT INTO t3 VALUES(200,126,1),(250,-127,2);
@@ -2599,7 +2610,6 @@ DELETE FROM a1, a2 USING t1 AS a1 INNER JOIN t2 AS a2 WHERE a2.c1=a1.c2;
SELECT * FROM t1,t2 WHERE t2.c1=t1.c2;
c1 c2 c3 c1 c2 c3
DELETE FROM t1,t2 using t1,t2 where t1.c1=(select c1 from t1);
-ERROR HY000: Table 't1' is specified twice, both as a target for 'DELETE' and as a separate source for data
CREATE TABLE t3(c1 SMALLINT UNSIGNED NOT NULL PRIMARY KEY, c2 SMALLINT SIGNED NULL, c3 INT);
CREATE TABLE t4(c1 SMALLINT UNSIGNED, c2 INT);
INSERT INTO t3 VALUES(200,126,1),(250,-127,2);
@@ -3346,7 +3356,6 @@ DELETE FROM a1, a2 USING t1 AS a1 INNER JOIN t2 AS a2 WHERE a2.c1=a1.c2;
SELECT * FROM t1,t2 WHERE t2.c1=t1.c2;
c1 c2 c3 c1 c2 c3
DELETE FROM t1,t2 using t1,t2 where t1.c1=(select c1 from t1);
-ERROR HY000: Table 't1' is specified twice, both as a target for 'DELETE' and as a separate source for data
CREATE TABLE t3(c1 MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY, c2 MEDIUMINT SIGNED NULL, c3 INT);
CREATE TABLE t4(c1 MEDIUMINT UNSIGNED, c2 INT);
INSERT INTO t3 VALUES(200,126,1),(250,-127,2);
@@ -4093,7 +4102,6 @@ DELETE FROM a1, a2 USING t1 AS a1 INNER JOIN t2 AS a2 WHERE a2.c1=a1.c2;
SELECT * FROM t1,t2 WHERE t2.c1=t1.c2;
c1 c2 c3 c1 c2 c3
DELETE FROM t1,t2 using t1,t2 where t1.c1=(select c1 from t1);
-ERROR HY000: Table 't1' is specified twice, both as a target for 'DELETE' and as a separate source for data
CREATE TABLE t3(c1 BIGINT UNSIGNED NOT NULL PRIMARY KEY, c2 BIGINT SIGNED NULL, c3 INT);
CREATE TABLE t4(c1 BIGINT UNSIGNED, c2 INT);
INSERT INTO t3 VALUES(200,126,1),(250,-127,2);
diff --git a/mysql-test/suite/engines/iuds/r/update_year.result b/mysql-test/suite/engines/iuds/r/update_year.result
index b766531f..f465e22e 100644
--- a/mysql-test/suite/engines/iuds/r/update_year.result
+++ b/mysql-test/suite/engines/iuds/r/update_year.result
@@ -3,12 +3,12 @@ CREATE TABLE t1(c1 YEAR NOT NULL,c2 YEAR, PRIMARY KEY(c1));
CREATE TABLE t2(c1 YEAR NOT NULL, c2 YEAR, UNIQUE INDEX idx(c1,c2));
CREATE TABLE t3(c1 YEAR(2) NOT NULL,c2 YEAR(2), PRIMARY KEY(c1));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
CREATE TABLE t4(c1 YEAR(2), c2 YEAR(2), UNIQUE INDEX idx(c1,c2));
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
INSERT INTO t1 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155);
INSERT INTO t2 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155);
INSERT INTO t3 VALUES (1901,1901),(1970,1970),(1999,1999),(2000,2000),(2155,2155);
diff --git a/mysql-test/suite/engines/iuds/t/type_bit_iuds.test b/mysql-test/suite/engines/iuds/t/type_bit_iuds.test
index 8f48d50f..fac2505f 100644
--- a/mysql-test/suite/engines/iuds/t/type_bit_iuds.test
+++ b/mysql-test/suite/engines/iuds/t/type_bit_iuds.test
@@ -227,7 +227,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -513,7 +513,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -799,7 +799,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -1085,7 +1085,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -2515,7 +2515,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -2801,7 +2801,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -3087,7 +3087,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -3373,7 +3373,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -4803,7 +4803,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -5089,7 +5089,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -5375,7 +5375,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -5661,7 +5661,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -7091,7 +7091,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -7377,7 +7377,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -7663,7 +7663,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -7949,7 +7949,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -9379,7 +9379,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -9665,7 +9665,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -9951,7 +9951,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -10237,7 +10237,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -11667,7 +11667,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -11953,7 +11953,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -12239,7 +12239,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -12525,7 +12525,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -13956,7 +13956,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -14243,7 +14243,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -14530,7 +14530,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -14817,7 +14817,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -16252,7 +16252,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -16539,7 +16539,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -16826,7 +16826,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
@@ -17113,7 +17113,7 @@ SELECT hex(c1),hex(c2) FROM t5;
# Update using eq_ref
# EXPLAIN SELECT * FROM t5,t6 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
-UPDATE IGNORE t5,t6 SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
+UPDATE IGNORE t6 straight_join t5 force index(PRIMARY) SET t5.c2=t6.c1+t6.c2 WHERE t5.c1=t6.c1 AND t5.c2=t6.c2;
############# DELETE ###########
diff --git a/mysql-test/suite/engines/iuds/t/update_delete_number.test b/mysql-test/suite/engines/iuds/t/update_delete_number.test
index ce3f9014..4347d060 100644
--- a/mysql-test/suite/engines/iuds/t/update_delete_number.test
+++ b/mysql-test/suite/engines/iuds/t/update_delete_number.test
@@ -285,8 +285,18 @@ SELECT * FROM t1,t2 WHERE t2.c1=t1.c2;
DELETE FROM a1, a2 USING t1 AS a1 INNER JOIN t2 AS a2 WHERE a2.c1=a1.c2;
--sorted_result
SELECT * FROM t1,t2 WHERE t2.c1=t1.c2;
---error ER_UPDATE_TABLE_USED
-DELETE FROM t1,t2 using t1,t2 where t1.c1=(select c1 from t1);
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t2;
+INSERT INTO t1 VALUES(254,127,1),(0,-128,2),(1,127,3),(3,NULL,5);
+INSERT INTO t2 VALUES(127,255,1),(127,1,2),(-128,0,3),(-1,NULL,5);
+# After the patch for MDEV-28883 this should not report
+# ER_UPDATE_TABLE_USED anymore
+DELETE FROM t1,t2 using t1,t2
+ where t1.c1=(select c1 from t1 where c2 < 10) and t2.c2 < 10;
+--sorted_result
+SELECT * FROM t1;
+--sorted_result
+SELECT * FROM t2;
# eq-ref join
CREATE TABLE t3(c1 INT UNSIGNED NOT NULL PRIMARY KEY, c2 INT SIGNED NULL, c3 INT);
@@ -496,7 +506,7 @@ drop table mt1, mt2, mt3;
create table mt1 (col1 int);
create table mt2 (col1 int);
update mt1,mt2 set mt1.col1 = (select max(col1) from mt1) where mt1.col1 = mt2.col1;
--- error ER_UPDATE_TABLE_USED
+# -- error ER_UPDATE_TABLE_USED
delete mt1 from mt1,mt2 where mt1.col1 < (select max(col1) from mt1) and mt1.col1 = mt2.col1;
drop table mt1,mt2;
@@ -865,7 +875,6 @@ SELECT * FROM t1,t2 WHERE t2.c1=t1.c2;
DELETE FROM a1, a2 USING t1 AS a1 INNER JOIN t2 AS a2 WHERE a2.c1=a1.c2;
--sorted_result
SELECT * FROM t1,t2 WHERE t2.c1=t1.c2;
---error ER_UPDATE_TABLE_USED
DELETE FROM t1,t2 using t1,t2 where t1.c1=(select c1 from t1);
# eq-ref join
@@ -1166,7 +1175,6 @@ SELECT * FROM t1,t2 WHERE t2.c1=t1.c2;
DELETE FROM a1, a2 USING t1 AS a1 INNER JOIN t2 AS a2 WHERE a2.c1=a1.c2;
--sorted_result
SELECT * FROM t1,t2 WHERE t2.c1=t1.c2;
---error ER_UPDATE_TABLE_USED
DELETE FROM t1,t2 using t1,t2 where t1.c1=(select c1 from t1);
# eq-ref join
@@ -1467,7 +1475,6 @@ SELECT * FROM t1,t2 WHERE t2.c1=t1.c2;
DELETE FROM a1, a2 USING t1 AS a1 INNER JOIN t2 AS a2 WHERE a2.c1=a1.c2;
--sorted_result
SELECT * FROM t1,t2 WHERE t2.c1=t1.c2;
---error ER_UPDATE_TABLE_USED
DELETE FROM t1,t2 using t1,t2 where t1.c1=(select c1 from t1);
# eq-ref join
@@ -1768,7 +1775,6 @@ SELECT * FROM t1,t2 WHERE t2.c1=t1.c2;
DELETE FROM a1, a2 USING t1 AS a1 INNER JOIN t2 AS a2 WHERE a2.c1=a1.c2;
--sorted_result
SELECT * FROM t1,t2 WHERE t2.c1=t1.c2;
---error ER_UPDATE_TABLE_USED
DELETE FROM t1,t2 using t1,t2 where t1.c1=(select c1 from t1);
# eq-ref join
diff --git a/mysql-test/suite/engines/rr_trx/include/rr_init.test b/mysql-test/suite/engines/rr_trx/include/rr_init.test
index 7d08c456..95ace24b 100644
--- a/mysql-test/suite/engines/rr_trx/include/rr_init.test
+++ b/mysql-test/suite/engines/rr_trx/include/rr_init.test
@@ -9,7 +9,6 @@ if (`SELECT @@default_storage_engine LIKE 'InnoDB' AND @@version LIKE '%6.%'`)
# Not applicable to 5.1 server or earlier.
--disable_query_log
SET GLOBAL optimizer_use_mrr='disable';
- SET GLOBAL engine_condition_pushdown=off;
--enable_query_log
}
@@ -17,7 +16,7 @@ if (`SELECT @@default_storage_engine LIKE 'InnoDB' AND @@version LIKE '%6.%'`)
SHOW VARIABLES LIKE 'default_storage_engine';
# Verify default isolation level
-SHOW VARIABLES LIKE 'tx_isolation';
+SHOW VARIABLES LIKE 'transaction_isolation';
#
# Create table for keeping track of test metadata/statistics (counters etc.).
diff --git a/mysql-test/suite/engines/rr_trx/r/init_innodb.result b/mysql-test/suite/engines/rr_trx/r/init_innodb.result
index 292575a6..cecaeab4 100644
--- a/mysql-test/suite/engines/rr_trx/r/init_innodb.result
+++ b/mysql-test/suite/engines/rr_trx/r/init_innodb.result
@@ -2,9 +2,9 @@ SET @@default_storage_engine = 'InnoDB';
SHOW VARIABLES LIKE 'default_storage_engine';
Variable_name Value
storage_engine InnoDB
-SHOW VARIABLES LIKE 'tx_isolation';
+SHOW VARIABLES LIKE 'transaction_isolation';
Variable_name Value
-tx_isolation REPEATABLE-READ
+transaction_isolation REPEATABLE-READ
CREATE TABLE statistics (
tx_errors INTEGER NOT NULL
);
diff --git a/mysql-test/suite/events/disabled.def b/mysql-test/suite/events/disabled.def
new file mode 100644
index 00000000..d895d7d2
--- /dev/null
+++ b/mysql-test/suite/events/disabled.def
@@ -0,0 +1,12 @@
+##############################################################################
+#
+# List the test cases that are to be disabled temporarily.
+#
+# Separate the test case name and the comment with ':'.
+#
+# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
+#
+# Do not use any TAB characters for whitespace.
+#
+##############################################################################
+events_time_zone : Test is not predictable as it depends on precise timing.
diff --git a/mysql-test/main/events_1.result b/mysql-test/suite/events/events_1.result
index 2f2a9511..2db478ad 100644
--- a/mysql-test/main/events_1.result
+++ b/mysql-test/suite/events/events_1.result
@@ -1,10 +1,7 @@
set sql_mode="";
call mtr.add_suppression("Column count of mysql.event is wrong. Expected .*, found .*\. The table is probably corrupted");
call mtr.add_suppression("Incorrect definition of table mysql.event:.*");
-drop database if exists events_test;
-drop database if exists db_x;
-drop database if exists mysqltest_db2;
-drop database if exists mysqltest_no_such_database;
+call mtr.add_suppression("Event Scheduler: .* DROP command denied to user");
create database events_test;
use events_test;
CREATE USER pauline@localhost;
diff --git a/mysql-test/main/events_1.test b/mysql-test/suite/events/events_1.test
index ba8a2059..cace9eb3 100644
--- a/mysql-test/main/events_1.test
+++ b/mysql-test/suite/events/events_1.test
@@ -9,13 +9,8 @@ set sql_mode="";
call mtr.add_suppression("Column count of mysql.event is wrong. Expected .*, found .*\. The table is probably corrupted");
call mtr.add_suppression("Incorrect definition of table mysql.event:.*");
+call mtr.add_suppression("Event Scheduler: .* DROP command denied to user");
---disable_warnings
-drop database if exists events_test;
-drop database if exists db_x;
-drop database if exists mysqltest_db2;
-drop database if exists mysqltest_no_such_database;
---enable_warnings
create database events_test;
use events_test;
@@ -43,6 +38,8 @@ DROP EVENT e_x1;
DROP EVENT e_x2;
disconnect priv_conn;
connection default;
+let $wait_condition= SELECT count(*)=1 from information_schema.processlist;
+--source include/wait_condition.inc
DROP DATABASE db_x;
DROP USER pauline@localhost;
USE events_test;
@@ -102,6 +99,8 @@ delimiter ;|
set global event_scheduler = on;
let $wait_condition= SELECT count(*)>0 from mysql.event where name='e_43' and interval_value= 5;
--source include/wait_condition.inc
+let $wait_condition= SELECT count(*)=2 from information_schema.processlist;
+--source include/wait_condition.inc
select db, name, body, status, interval_field, interval_value from mysql.event;
drop event e_43;
drop table test_nested;
diff --git a/mysql-test/main/events_2.result b/mysql-test/suite/events/events_2.result
index 1753fa41..1753fa41 100644
--- a/mysql-test/main/events_2.result
+++ b/mysql-test/suite/events/events_2.result
diff --git a/mysql-test/main/events_2.test b/mysql-test/suite/events/events_2.test
index cd0d908b..cd0d908b 100644
--- a/mysql-test/main/events_2.test
+++ b/mysql-test/suite/events/events_2.test
diff --git a/mysql-test/main/events_bugs-master.opt b/mysql-test/suite/events/events_bugs-master.opt
index f93413a6..f93413a6 100644
--- a/mysql-test/main/events_bugs-master.opt
+++ b/mysql-test/suite/events/events_bugs-master.opt
diff --git a/mysql-test/main/events_bugs.result b/mysql-test/suite/events/events_bugs.result
index e3984bcd..ee4411e6 100644
--- a/mysql-test/main/events_bugs.result
+++ b/mysql-test/suite/events/events_bugs.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression('Event Scheduler:');
SET SQL_MODE="";
drop database if exists events_test;
drop database if exists mysqltest_db1;
@@ -405,7 +406,7 @@ SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
event_name definer
e1 mysqltest_u1@localhost
ALTER DEFINER=root@localhost EVENT e1 ON SCHEDULE EVERY 1 HOUR;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, SET USER privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the SET USER privilege(s) for this operation
SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
event_name definer
e1 mysqltest_u1@localhost
@@ -418,7 +419,7 @@ event_name definer
e1 mysqltest_u1@localhost
DROP EVENT e1;
CREATE DEFINER=root@localhost EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, SET USER privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the SET USER privilege(s) for this operation
DROP EVENT e1;
ERROR HY000: Unknown event 'e1'
disconnect conn1;
diff --git a/mysql-test/main/events_bugs.test b/mysql-test/suite/events/events_bugs.test
index fe744de8..04ce048a 100644
--- a/mysql-test/main/events_bugs.test
+++ b/mysql-test/suite/events/events_bugs.test
@@ -1,7 +1,7 @@
# Tests will be skipped for the view protocol because the view protocol creates
# an additional util connection and other statistics data
-- source include/no_view_protocol.inc
-
+call mtr.add_suppression('Event Scheduler:');
#### t/events_bugs.test
#
# Last change:
diff --git a/mysql-test/main/events_embedded.result b/mysql-test/suite/events/events_embedded.result
index 1a02188f..1a02188f 100644
--- a/mysql-test/main/events_embedded.result
+++ b/mysql-test/suite/events/events_embedded.result
diff --git a/mysql-test/main/events_embedded.test b/mysql-test/suite/events/events_embedded.test
index f6921f30..c607573b 100644
--- a/mysql-test/main/events_embedded.test
+++ b/mysql-test/suite/events/events_embedded.test
@@ -1,4 +1,4 @@
--source include/is_embedded.inc
---error 1193
+--error ER_UNKNOWN_SYSTEM_VARIABLE
set global event_scheduler=ON;
diff --git a/mysql-test/main/events_grant.result b/mysql-test/suite/events/events_grant.result
index 5952097a..6441d7b3 100644
--- a/mysql-test/main/events_grant.result
+++ b/mysql-test/suite/events/events_grant.result
@@ -27,7 +27,7 @@ Grants for ev_test@localhost
GRANT USAGE ON *.* TO `ev_test`@`localhost`
GRANT ALL PRIVILEGES ON `test`.* TO `ev_test`@`localhost`
GRANT ALL PRIVILEGES ON `events_test`.* TO `ev_test`@`localhost`
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, TRIGGER, DELETE HISTORY ON `events_test2`.* TO `ev_test`@`localhost`
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, TRIGGER, DELETE HISTORY, SHOW CREATE ROUTINE ON `events_test2`.* TO `ev_test`@`localhost`
"Here comes an error:";
SHOW EVENTS;
ERROR 42000: Access denied for user 'ev_test'@'localhost' to database 'events_test2'
diff --git a/mysql-test/main/events_grant.test b/mysql-test/suite/events/events_grant.test
index 2fe39a6c..2fe39a6c 100644
--- a/mysql-test/main/events_grant.test
+++ b/mysql-test/suite/events/events_grant.test
diff --git a/mysql-test/main/events_logs_tests-master.opt b/mysql-test/suite/events/events_logs_tests-master.opt
index 73d26b72..73d26b72 100644
--- a/mysql-test/main/events_logs_tests-master.opt
+++ b/mysql-test/suite/events/events_logs_tests-master.opt
diff --git a/mysql-test/main/events_logs_tests.result b/mysql-test/suite/events/events_logs_tests.result
index d332767a..d332767a 100644
--- a/mysql-test/main/events_logs_tests.result
+++ b/mysql-test/suite/events/events_logs_tests.result
diff --git a/mysql-test/main/events_logs_tests.test b/mysql-test/suite/events/events_logs_tests.test
index f7445352..f7445352 100644
--- a/mysql-test/main/events_logs_tests.test
+++ b/mysql-test/suite/events/events_logs_tests.test
diff --git a/mysql-test/main/events_microsec.result b/mysql-test/suite/events/events_microsec.result
index 2a9f3587..2a9f3587 100644
--- a/mysql-test/main/events_microsec.result
+++ b/mysql-test/suite/events/events_microsec.result
diff --git a/mysql-test/main/events_microsec.test b/mysql-test/suite/events/events_microsec.test
index 3e9abf6e..3e9abf6e 100644
--- a/mysql-test/main/events_microsec.test
+++ b/mysql-test/suite/events/events_microsec.test
diff --git a/mysql-test/main/events_restart-master.opt b/mysql-test/suite/events/events_restart-master.opt
index f93413a6..f93413a6 100644
--- a/mysql-test/main/events_restart-master.opt
+++ b/mysql-test/suite/events/events_restart-master.opt
diff --git a/mysql-test/main/events_restart.result b/mysql-test/suite/events/events_restart.result
index 58401c7b..6099414e 100644
--- a/mysql-test/main/events_restart.result
+++ b/mysql-test/suite/events/events_restart.result
@@ -1,6 +1,6 @@
-call mtr.add_suppression("Column count of mysql.event is wrong. Expected .*, found .*\. The table is probably corrupted");
+call mtr.add_suppression('Column count of mysql.event is wrong. Expected .*, found .*\. The table is probably corrupted');
+call mtr.add_suppression('Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler');
set global event_scheduler=off;
-drop database if exists events_test;
create database events_test;
use events_test;
create table execution_log(name char(10));
@@ -20,7 +20,7 @@ create table event_like like mysql.event;
insert into event_like select * from mysql.event;
alter table mysql.event
change column body body longtext character set utf8 collate utf8_bin;
-"Now we restart the server"
+# Now we restart the server
call mtr.add_suppression("Incorrect definition of table mysql.event:.*");
# restart
use events_test;
@@ -54,8 +54,8 @@ ERROR HY000: Event Scheduler: An error occurred when initializing system tables.
show variables like 'event_scheduler';
Variable_name Value
event_scheduler OFF
-Make sure that we still can create and drop databases,
-and no warnings are produced.
+# Make sure that we still can create and drop databases,
+# and no warnings are produced.
drop database if exists mysqltest_database_not_exists;
Warnings:
Note 1008 Can't drop database 'mysqltest_database_not_exists'; database doesn't exist
@@ -63,10 +63,10 @@ create database mysqltest_db1;
drop database mysqltest_db1;
Warnings:
Error 1545 Failed to open mysql.event
-Restore the original mysql.event table
+# Restore the original mysql.event table
drop table mysql.event;
rename table event_like to mysql.event;
-check that we can now enable events without restart
+# check that we can now enable events without restart
set global event_scheduler=original;
Warnings:
Note 1408 Event Scheduler: Loaded 3 events
@@ -82,7 +82,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
events_test abc1 root@localhost SYSTEM RECURRING # 1 SECOND # # ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
events_test abc2 root@localhost SYSTEM RECURRING # 1 SECOND # # ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
events_test abc3 root@localhost SYSTEM RECURRING # 1 SECOND # # ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
-Now let's restart the server again
+# Now let's restart the server again
# restart
use events_test;
select @@event_scheduler;
@@ -103,7 +103,7 @@ CREATE EVENT e1 ON SCHEDULE EVERY 1 SECOND DISABLE DO SELECT 1;
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
test e1 root@localhost SYSTEM RECURRING # 1 SECOND # # DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
-"Now we restart the server"
+# Now we restart the server
# restart
USE test;
SELECT @@event_scheduler;
diff --git a/mysql-test/main/events_restart.test b/mysql-test/suite/events/events_restart.test
index 6f7c01d8..e1db3d0c 100644
--- a/mysql-test/main/events_restart.test
+++ b/mysql-test/suite/events/events_restart.test
@@ -1,6 +1,7 @@
# Can't test with embedded server that doesn't support grants
-- source include/not_embedded.inc
-call mtr.add_suppression("Column count of mysql.event is wrong. Expected .*, found .*\. The table is probably corrupted");
+call mtr.add_suppression('Column count of mysql.event is wrong. Expected .*, found .*\. The table is probably corrupted');
+call mtr.add_suppression('Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler');
let $collation_server=`select @@collation_server`;
#
@@ -11,9 +12,6 @@ let $collation_server=`select @@collation_server`;
# Switch off the scheduler for now.
set global event_scheduler=off;
---disable_warnings
-drop database if exists events_test;
---enable_warnings
create database events_test;
use events_test;
create table execution_log(name char(10));
@@ -43,7 +41,7 @@ insert into event_like select * from mysql.event;
# Now let's alter the table and restart the server
alter table mysql.event
change column body body longtext character set utf8 collate utf8_bin;
---echo "Now we restart the server"
+--echo # Now we restart the server
call mtr.add_suppression("Incorrect definition of table mysql.event:.*");
--source include/restart_mysqld.inc
@@ -77,16 +75,16 @@ set global event_scheduler=on;
--error ER_STARTUP
set global event_scheduler=off;
show variables like 'event_scheduler';
---echo Make sure that we still can create and drop databases,
---echo and no warnings are produced.
+--echo # Make sure that we still can create and drop databases,
+--echo # and no warnings are produced.
drop database if exists mysqltest_database_not_exists;
create database mysqltest_db1;
drop database mysqltest_db1;
---echo Restore the original mysql.event table
+--echo # Restore the original mysql.event table
drop table mysql.event;
rename table event_like to mysql.event;
---echo check that we can now enable events without restart
+--echo # check that we can now enable events without restart
set global event_scheduler=original;
select @@global.event_scheduler;
set global event_scheduler=on;
@@ -96,7 +94,7 @@ select @@global.event_scheduler;
--replace_result $collation_server latin1_swedish_ci
show events;
---echo Now let's restart the server again
+--echo # Now let's restart the server again
--source include/restart_mysqld.inc
@@ -132,7 +130,7 @@ CREATE EVENT e1 ON SCHEDULE EVERY 1 SECOND DISABLE DO SELECT 1;
--replace_column 6 # 9 # 10 #
SHOW EVENTS;
---echo "Now we restart the server"
+--echo # Now we restart the server
--source include/restart_mysqld.inc
USE test;
SELECT @@event_scheduler;
diff --git a/mysql-test/main/events_scheduling.result b/mysql-test/suite/events/events_scheduling.result
index 262caea3..1739c607 100644
--- a/mysql-test/main/events_scheduling.result
+++ b/mysql-test/suite/events/events_scheduling.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression("Event Scheduler: .* Table 'events_test.t1' doesn't exist");
CREATE DATABASE IF NOT EXISTS events_test;
USE events_test;
SET @event_scheduler=@@global.event_scheduler;
diff --git a/mysql-test/main/events_scheduling.test b/mysql-test/suite/events/events_scheduling.test
index 5f16f8be..fee6274e 100644
--- a/mysql-test/main/events_scheduling.test
+++ b/mysql-test/suite/events/events_scheduling.test
@@ -1,6 +1,8 @@
# Can't test with embedded server that doesn't support events
-- source include/not_embedded.inc
+call mtr.add_suppression("Event Scheduler: .* Table 'events_test.t1' doesn't exist");
+
CREATE DATABASE IF NOT EXISTS events_test;
USE events_test;
diff --git a/mysql-test/suite/events/events_skip_grant_tables.opt b/mysql-test/suite/events/events_skip_grant_tables.opt
new file mode 100644
index 00000000..3cf61728
--- /dev/null
+++ b/mysql-test/suite/events/events_skip_grant_tables.opt
@@ -0,0 +1 @@
+--event-scheduler=ON --skip-grant-tables
diff --git a/mysql-test/suite/events/events_skip_grant_tables.result b/mysql-test/suite/events/events_skip_grant_tables.result
new file mode 100644
index 00000000..beaeaa50
--- /dev/null
+++ b/mysql-test/suite/events/events_skip_grant_tables.result
@@ -0,0 +1,12 @@
+call mtr.add_suppression("Event Scheduler will not function when starting with --skip-grant-tables");
+#
+# MDEV-29827 Misleading error messages about event scheduler when using --skip-grant-tables
+#
+FOUND 1 /Event Scheduler will not function when starting with --skip-grant-tables/ in mysqld.1.err
+CREATE EVENT test ON SCHEDULE AT CURRENT_TIMESTAMP DO DO NULL;
+ERROR HY000: The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement
+select (@@global.event_scheduler='DISABLED') as expect_1;
+expect_1
+1
+set global event_scheduler=1;
+ERROR HY000: The MariaDB server is running with the --skip-grant-tables option so it cannot execute this statement
diff --git a/mysql-test/suite/events/events_skip_grant_tables.test b/mysql-test/suite/events/events_skip_grant_tables.test
new file mode 100644
index 00000000..843ead2b
--- /dev/null
+++ b/mysql-test/suite/events/events_skip_grant_tables.test
@@ -0,0 +1,26 @@
+# Can't test with embedded server that doesn't support grants
+-- source include/not_embedded.inc
+call mtr.add_suppression("Event Scheduler will not function when starting with --skip-grant-tables");
+
+--echo #
+--echo # MDEV-29827 Misleading error messages about event scheduler when using --skip-grant-tables
+--echo #
+
+# Verify that if server is started with
+# --event-scheduler=ON --skip-grant-tables, we get an error
+# with a distinct explanation that the latter disables the former.
+
+let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err;
+let SEARCH_PATTERN=Event Scheduler will not function when starting with --skip-grant-tables;
+source include/search_pattern_in_file.inc;
+
+--error ER_OPTION_PREVENTS_STATEMENT
+CREATE EVENT test ON SCHEDULE AT CURRENT_TIMESTAMP DO DO NULL;
+
+# Although --event-scheduler=ON was specified (see -master.opt), it should
+# have been changed to 'DISABLED' at startup.
+select (@@global.event_scheduler='DISABLED') as expect_1;
+
+# Verify that we cannot (re)enable event scheduler
+--error ER_OPTION_PREVENTS_STATEMENT
+set global event_scheduler=1;
diff --git a/mysql-test/main/events_slowlog.result b/mysql-test/suite/events/events_slowlog.result
index be0a1e78..be0a1e78 100644
--- a/mysql-test/main/events_slowlog.result
+++ b/mysql-test/suite/events/events_slowlog.result
diff --git a/mysql-test/main/events_slowlog.test b/mysql-test/suite/events/events_slowlog.test
index 9679714d..9679714d 100644
--- a/mysql-test/main/events_slowlog.test
+++ b/mysql-test/suite/events/events_slowlog.test
diff --git a/mysql-test/main/events_stress.result b/mysql-test/suite/events/events_stress.result
index 1a91ff0f..1a91ff0f 100644
--- a/mysql-test/main/events_stress.result
+++ b/mysql-test/suite/events/events_stress.result
diff --git a/mysql-test/main/events_stress.test b/mysql-test/suite/events/events_stress.test
index 92b084a3..92b084a3 100644
--- a/mysql-test/main/events_stress.test
+++ b/mysql-test/suite/events/events_stress.test
diff --git a/mysql-test/main/events_time_zone.result b/mysql-test/suite/events/events_time_zone.result
index 155a9d15..155a9d15 100644
--- a/mysql-test/main/events_time_zone.result
+++ b/mysql-test/suite/events/events_time_zone.result
diff --git a/mysql-test/main/events_time_zone.test b/mysql-test/suite/events/events_time_zone.test
index 5291eb96..5291eb96 100644
--- a/mysql-test/main/events_time_zone.test
+++ b/mysql-test/suite/events/events_time_zone.test
diff --git a/mysql-test/main/events_trans.result b/mysql-test/suite/events/events_trans.result
index a7b268fe..a7b268fe 100644
--- a/mysql-test/main/events_trans.result
+++ b/mysql-test/suite/events/events_trans.result
diff --git a/mysql-test/main/events_trans.test b/mysql-test/suite/events/events_trans.test
index cc83fa6e..cc83fa6e 100644
--- a/mysql-test/main/events_trans.test
+++ b/mysql-test/suite/events/events_trans.test
diff --git a/mysql-test/main/events_trans_notembedded.result b/mysql-test/suite/events/events_trans_notembedded.result
index 324e28dd..324e28dd 100644
--- a/mysql-test/main/events_trans_notembedded.result
+++ b/mysql-test/suite/events/events_trans_notembedded.result
diff --git a/mysql-test/main/events_trans_notembedded.test b/mysql-test/suite/events/events_trans_notembedded.test
index 3cf823bf..3cf823bf 100644
--- a/mysql-test/main/events_trans_notembedded.test
+++ b/mysql-test/suite/events/events_trans_notembedded.test
diff --git a/mysql-test/suite/federated/federated_bug_25714.result b/mysql-test/suite/federated/federated_bug_25714.result
index 9ac15672..8d695a86 100644
--- a/mysql-test/suite/federated/federated_bug_25714.result
+++ b/mysql-test/suite/federated/federated_bug_25714.result
@@ -7,10 +7,13 @@ CREATE DATABASE federated;
connection master;
SET @OLD_MASTER_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= 0;
+create user fed@127.0.0.1 identified by 'def';
+grant all privileges on federated.* to fed@127.0.0.1;
connection slave;
SET @OLD_SLAVE_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= 0;
-DROP TABLE IF EXISTS federated.bug_13118_table;
+create user fed@127.0.0.1 identified by 'def';
+grant all privileges on federated.* to fed@127.0.0.1;
CREATE TABLE federated.t1 (
`id` int auto_increment primary key,
`value` int
@@ -19,7 +22,6 @@ INSERT INTO federated.t1 SET value=1;
INSERT INTO federated.t1 SET value=2;
INSERT INTO federated.t1 SET value=2;
connection master;
-DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int auto_increment primary key,
`value` int
@@ -51,9 +53,11 @@ id value
7 54
8 55
DROP TABLE federated.t1;
+drop user fed@127.0.0.1;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
connection slave;
DROP TABLE federated.t1;
+drop user fed@127.0.0.1;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
connection master;
DROP TABLE IF EXISTS federated.t1;
diff --git a/mysql-test/suite/federated/federated_bug_25714.test b/mysql-test/suite/federated/federated_bug_25714.test
index bb5dcfe5..c979e55a 100644
--- a/mysql-test/suite/federated/federated_bug_25714.test
+++ b/mysql-test/suite/federated/federated_bug_25714.test
@@ -13,12 +13,20 @@ connection master;
SET @OLD_MASTER_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= 0;
+#
+# use a user with the password, so that the test client $MYSQL_BUG25714
+# would be able to connect when ssl and certificate validation are
+# enabled by default (MDEV-31857, MDEV-31855)
+#
+create user fed@127.0.0.1 identified by 'def';
+grant all privileges on federated.* to fed@127.0.0.1;
+
connection slave;
SET @OLD_SLAVE_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= 0;
---disable_warnings
-DROP TABLE IF EXISTS federated.bug_13118_table;
---enable_warnings
+
+create user fed@127.0.0.1 identified by 'def';
+grant all privileges on federated.* to fed@127.0.0.1;
CREATE TABLE federated.t1 (
`id` int auto_increment primary key,
@@ -29,9 +37,6 @@ INSERT INTO federated.t1 SET value=2;
INSERT INTO federated.t1 SET value=2;
connection master;
---disable_warnings
-DROP TABLE IF EXISTS federated.t1;
---enable_warnings
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval CREATE TABLE federated.t1 (
@@ -52,11 +57,11 @@ SELECT LAST_INSERT_ID();
SELECT * from federated.t1;
DROP TABLE federated.t1;
+drop user fed@127.0.0.1;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
connection slave;
DROP TABLE federated.t1;
+drop user fed@127.0.0.1;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
-
-
source suite/federated/include/federated_cleanup.inc;
diff --git a/mysql-test/suite/federated/federated_server.result b/mysql-test/suite/federated/federated_server.result
index d25676e7..1207a4bb 100644
--- a/mysql-test/suite/federated/federated_server.result
+++ b/mysql-test/suite/federated/federated_server.result
@@ -197,7 +197,7 @@ OWNER 'root');
create user guest_select@localhost;
grant select on federated.* to guest_select@localhost;
create user guest_super@localhost;
-grant select,SUPER,RELOAD on *.* to guest_super@localhost;
+grant select,FEDERATED ADMIN,RELOAD on *.* to guest_super@localhost;
create user guest_usage@localhost;
grant usage on *.* to guest_usage@localhost;
CREATE TABLE federated.t1 (
@@ -212,7 +212,7 @@ connect conn_usage,127.0.0.1,guest_usage,,,$MASTER_MYPORT;
connect conn_super,127.0.0.1,guest_super,,,$MASTER_MYPORT;
connection conn_select;
alter server s1 options (database 'db_bogus');
-ERROR 42000: Access denied; you need (at least one of) the SUPER, FEDERATED ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the FEDERATED ADMIN privilege(s) for this operation
connection master;
flush tables;
select * from federated.t1;
@@ -220,7 +220,7 @@ id name
1 this is legitimate
connection conn_usage;
alter server s1 options (database 'db_bogus');
-ERROR 42000: Access denied; you need (at least one of) the SUPER, FEDERATED ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the FEDERATED ADMIN privilege(s) for this operation
connection master;
flush tables;
select * from federated.t1;
@@ -234,7 +234,7 @@ select * from federated.t1;
Got one of the listed errors
connection conn_select;
drop server if exists 's1';
-ERROR 42000: Access denied; you need (at least one of) the SUPER, FEDERATED ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the FEDERATED ADMIN privilege(s) for this operation
create server 's1' foreign data wrapper 'mysql' options
(HOST '127.0.0.1',
DATABASE 'db_legitimate',
@@ -243,7 +243,7 @@ PASSWORD 'foo',
PORT SLAVE_PORT,
SOCKET '',
OWNER 'root');
-ERROR 42000: Access denied; you need (at least one of) the SUPER, FEDERATED ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the FEDERATED ADMIN privilege(s) for this operation
connection conn_super;
drop server 's1';
create server 's1' foreign data wrapper 'mysql' options
diff --git a/mysql-test/suite/federated/federated_server.test b/mysql-test/suite/federated/federated_server.test
index 3d491b1d..10f383d4 100644
--- a/mysql-test/suite/federated/federated_server.test
+++ b/mysql-test/suite/federated/federated_server.test
@@ -162,7 +162,7 @@ drop database second_db;
#
# Bug#25671 - CREATE/DROP/ALTER SERVER should require privileges
#
-# Changes to SERVER declarations should require SUPER privilege.
+# Changes to SERVER declarations should require FEDERATED ADMIN privilege.
# Based upon test case by Giuseppe Maxia
create database db_legitimate;
@@ -202,7 +202,7 @@ create user guest_select@localhost;
grant select on federated.* to guest_select@localhost;
create user guest_super@localhost;
-grant select,SUPER,RELOAD on *.* to guest_super@localhost;
+grant select,FEDERATED ADMIN,RELOAD on *.* to guest_super@localhost;
create user guest_usage@localhost;
grant usage on *.* to guest_usage@localhost;
diff --git a/mysql-test/suite/federated/federatedx.result b/mysql-test/suite/federated/federatedx.result
index 3054060b..e75fb253 100644
--- a/mysql-test/suite/federated/federatedx.result
+++ b/mysql-test/suite/federated/federatedx.result
@@ -2358,6 +2358,22 @@ DROP TABLE t2_fed, t1, t2;
set @@optimizer_switch=@save_optimizer_switch;
DROP SERVER s;
# End of 10.5 tests
+#
+# MDEV-30569: Assertion ...ha_table_flags() failed in Duplicate_weedout_picker::check_qep
+#
+create server s foreign data wrapper mysql options
+(host "127.0.0.1", database "test", user "root", port $MASTER_MYPORT);
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2 (b INT);
+INSERT INTO t2 VALUES (3),(4);
+CREATE TABLE t1_fed ENGINE=FEDERATED CONNECTION='s/t1';
+CREATE VIEW v AS SELECT * FROM t1_fed;
+SELECT * FROM v WHERE a IN ( SELECT b FROM t2);
+a
+DROP VIEW v;
+DROP TABLE t1_fed, t1, t2;
+DROP SERVER s;
connection master;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/suite/federated/federatedx.test b/mysql-test/suite/federated/federatedx.test
index 7e5a335b..579316be 100644
--- a/mysql-test/suite/federated/federatedx.test
+++ b/mysql-test/suite/federated/federatedx.test
@@ -2090,4 +2090,26 @@ DROP SERVER s;
--echo # End of 10.5 tests
+--echo #
+--echo # MDEV-30569: Assertion ...ha_table_flags() failed in Duplicate_weedout_picker::check_qep
+--echo #
+
+evalp create server s foreign data wrapper mysql options
+ (host "127.0.0.1", database "test", user "root", port $MASTER_MYPORT);
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+
+CREATE TABLE t2 (b INT);
+INSERT INTO t2 VALUES (3),(4);
+
+CREATE TABLE t1_fed ENGINE=FEDERATED CONNECTION='s/t1';
+CREATE VIEW v AS SELECT * FROM t1_fed;
+
+SELECT * FROM v WHERE a IN ( SELECT b FROM t2);
+
+DROP VIEW v;
+DROP TABLE t1_fed, t1, t2;
+DROP SERVER s;
+
source include/federated_cleanup.inc;
diff --git a/mysql-test/suite/federated/federatedx_create_handlers.result b/mysql-test/suite/federated/federatedx_create_handlers.result
index 7288c520..698dfab9 100644
--- a/mysql-test/suite/federated/federatedx_create_handlers.result
+++ b/mysql-test/suite/federated/federatedx_create_handlers.result
@@ -150,7 +150,7 @@ FROM federated.t3, (SELECT * FROM federated.t1 WHERE id > 3) t
WHERE federated.t3.name=t.name;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 7
-1 PRIMARY <derived2> ref key0 key0 18 federated.t3.name 2
+1 PRIMARY <derived2> ref key0 key0 18 federated.t3.name 1
2 PUSHED DERIVED NULL NULL NULL NULL NULL NULL NULL NULL
EXPLAIN FORMAT=JSON
SELECT *
@@ -160,12 +160,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"rows": 7,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -178,7 +181,9 @@ EXPLAIN
"key_length": "18",
"used_key_parts": ["name"],
"ref": ["federated.t3.name"],
- "rows": 2,
+ "loops": 7,
+ "rows": 1,
+ "cost": "COST_REPLACED",
"filtered": 100,
"materialized": {
"query_block": {
@@ -199,7 +204,7 @@ FROM federated.t3, (SELECT * FROM federated.t1 WHERE id > 3) t
WHERE federated.t3.name=t.name;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 7 7.00 100.00 100.00
-1 PRIMARY <derived2> ref key0 key0 18 federated.t3.name 2 1.00 100.00 100.00
+1 PRIMARY <derived2> ref key0 key0 18 federated.t3.name 1 1.00 100.00 100.00
2 PUSHED DERIVED NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
SELECT *
FROM federated.t3, (SELECT t1.name FROM federated.t1
@@ -216,7 +221,7 @@ FROM federated.t2 GROUP BY name)) t
WHERE federated.t3.name=t.name;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 7
-1 PRIMARY <derived2> ref key0 key0 18 federated.t3.name 2
+1 PRIMARY <derived2> ref key0 key0 18 federated.t3.name 1
2 PUSHED DERIVED NULL NULL NULL NULL NULL NULL NULL NULL
ANALYZE FORMAT=JSON
SELECT *
@@ -231,6 +236,7 @@ ANALYZE
},
"query_block": {
"select_id": 1,
+ "cost": "REPLACED",
"r_loops": 1,
"r_total_time_ms": "REPLACED",
"nested_loop": [
@@ -238,9 +244,11 @@ ANALYZE
"table": {
"table_name": "t3",
"access_type": "ALL",
+ "loops": 1,
"r_loops": 1,
"rows": 7,
"r_rows": 7,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"r_engine_stats": REPLACED,
@@ -257,9 +265,11 @@ ANALYZE
"key_length": "18",
"used_key_parts": ["name"],
"ref": ["federated.t3.name"],
+ "loops": 7,
"r_loops": 7,
- "rows": 2,
+ "rows": 1,
"r_rows": 0.142857143,
+ "cost": "REPLACED",
"r_table_time_ms": "REPLACED",
"r_other_time_ms": "REPLACED",
"filtered": 100,
@@ -299,7 +309,7 @@ SELECT * FROM federated.t1 WHERE id >= 5) t
WHERE federated.t3.name=t.name;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 7
-1 PRIMARY <derived2> ref key0 key0 18 federated.t3.name 2
+1 PRIMARY <derived2> ref key1,distinct_key key1 18 federated.t3.name 1
2 PUSHED DERIVED NULL NULL NULL NULL NULL NULL NULL NULL
#
# MDEV-21887: federatedx crashes on SELECT ... INTO query in select_handler code
@@ -365,12 +375,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "t5",
"access_type": "ALL",
+ "loops": 1,
"rows": 2,
+ "cost": "COST_REPLACED",
"filtered": 100
}
},
@@ -379,7 +392,9 @@ EXPLAIN
"table": {
"table_name": "<derived2>",
"access_type": "ALL",
+ "loops": 2,
"rows": 5,
+ "cost": "COST_REPLACED",
"filtered": 100
},
"buffer_type": "flat",
@@ -536,8 +551,7 @@ EXPLAIN
SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM t1 where id=3) dt3
WHERE id=3) dt2) dt;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY <derived4> ALL NULL NULL NULL NULL 5 Using where
-4 PUSHED DERIVED NULL NULL NULL NULL NULL NULL NULL NULL
+1 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL
connection slave;
CREATE TABLE federated.t10 (a INT,b INT);
CREATE TABLE federated.t11 (a INT, b INT);
@@ -606,6 +620,702 @@ id name
4 xxx
5 yyy
DEALLOCATE PREPARE stmt;
+DROP TABLES federated.t1, federated.t2, federated.t3, federated.t10,
+federated.t11;
+connection slave;
+DROP TABLES federated.t1, federated.t2, federated.t3, federated.t10,
+federated.t11;
+# MDEV-25080: Allow pushdown of queries involving UNIONs
+# in outer select to foreign engines
+#
+connection slave;
+CREATE TABLE federated.t1 (
+a varchar(10)
+)
+DEFAULT CHARSET=latin1;
+CREATE TABLE federated.t2 (
+a varchar(16) NOT NULL default ''
+)
+DEFAULT CHARSET=latin1;
+INSERT INTO federated.t1 VALUES ('bcd'), ('abc'), ('cde');
+INSERT INTO federated.t2 VALUES ('cde'), ('efg'), ('abc'), ('bcd'), ('def');
+connection master;
+CREATE TABLE federated.t1 (
+a varchar(10)
+)
+ENGINE="FEDERATED" DEFAULT CHARSET=latin1
+CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
+CREATE TABLE federated.t2 (
+a varchar(16) NOT NULL default ''
+)
+ENGINE="FEDERATED" DEFAULT CHARSET=latin1
+CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t2';
+CREATE TABLE t3 (a varchar(30)) ENGINE=MyISAM;
+CREATE TABLE t4 (a varchar(30)) ENGINE=MyISAM;
+INSERT INTO t3 VALUES ('t3_myisam1'), ('t3_myisam2'), ('t3_myisam3');
+INSERT INTO t4 VALUES ('t4_myisam1'), ('t4_myisam2'), ('t4_myisam3');
+# Pushdown of the whole UNION
+SELECT * from federated.t1 UNION SELECT * from federated.t2;
+a
+abc
+bcd
+cde
+def
+efg
+EXPLAIN SELECT * from federated.t1 UNION SELECT * from federated.t2;
+id select_type table type possible_keys key key_len ref rows Extra
+NULL PUSHED UNION NULL NULL NULL NULL NULL NULL NULL NULL
+# Pushdown of a part of the UNION
+SELECT * from federated.t1 UNION SELECT * from t3;
+a
+abc
+bcd
+cde
+t3_myisam1
+t3_myisam2
+t3_myisam3
+EXPLAIN SELECT * from federated.t1 UNION SELECT * from t3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL
+2 UNION t3 ALL NULL NULL NULL NULL 3
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
+SELECT * from federated.t1 UNION ALL SELECT * from federated.t2;
+a
+abc
+abc
+bcd
+bcd
+cde
+cde
+def
+efg
+EXPLAIN SELECT * from federated.t1 UNION ALL SELECT * from federated.t2;
+id select_type table type possible_keys key key_len ref rows Extra
+NULL PUSHED UNION NULL NULL NULL NULL NULL NULL NULL NULL
+EXPLAIN FORMAT=JSON SELECT * from federated.t1 UNION ALL
+SELECT * from federated.t2;
+EXPLAIN
+{
+ "query_block": {
+ "union_result": {
+ "message": "PUSHED UNION"
+ }
+ }
+}
+ANALYZE SELECT * from federated.t1 UNION ALL SELECT * from federated.t2;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+NULL PUSHED UNION NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+ANALYZE FORMAT=JSON SELECT * from federated.t1 UNION ALL
+SELECT * from federated.t2;
+ANALYZE
+{
+ "query_optimization": {
+ "r_total_time_ms": "REPLACED"
+ },
+ "query_block": {
+ "union_result": {
+ "message": "PUSHED UNION"
+ }
+ }
+}
+SELECT * from federated.t1 EXCEPT SELECT * from federated.t2;
+a
+EXPLAIN EXTENDED SELECT * from federated.t1 EXCEPT
+SELECT * from federated.t2;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+NULL PUSHED EXCEPT NULL NULL NULL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 /* select#1 */ select `federated`.`t1`.`a` AS `a` from `federated`.`t1` except /* select#2 */ select `federated`.`t2`.`a` AS `a` from `federated`.`t2`
+EXPLAIN FORMAT=JSON SELECT * from federated.t1 EXCEPT
+SELECT * from federated.t2;
+EXPLAIN
+{
+ "query_block": {
+ "union_result": {
+ "message": "PUSHED EXCEPT"
+ }
+ }
+}
+SELECT * from federated.t1 INTERSECT SELECT * from federated.t2;
+a
+abc
+bcd
+cde
+EXPLAIN PARTITIONS SELECT * from federated.t1 INTERSECT
+SELECT * from federated.t2;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+NULL PUSHED INTERSECT NULL NULL NULL NULL NULL NULL NULL NULL NULL
+EXPLAIN FORMAT=JSON SELECT * from federated.t1 INTERSECT
+SELECT * from federated.t2;
+EXPLAIN
+{
+ "query_block": {
+ "union_result": {
+ "message": "PUSHED INTERSECT"
+ }
+ }
+}
+# More than two SELECTs in a UNIT:
+SELECT * from federated.t1 INTERSECT
+SELECT * from federated.t2 UNION ALL
+SELECT * from federated.t2 EXCEPT
+SELECT * from federated.t1;
+a
+def
+efg
+EXPLAIN
+SELECT count(*) from federated.t1 INTERSECT
+SELECT count(*) from federated.t2 UNION ALL
+SELECT count(*)+20 from federated.t2 EXCEPT
+SELECT count(*)+5 from federated.t1;
+id select_type table type possible_keys key key_len ref rows Extra
+NULL PUSHED UNIT NULL NULL NULL NULL NULL NULL NULL NULL
+EXPLAIN FORMAT=JSON
+SELECT count(*) from federated.t1 INTERSECT
+SELECT count(*) from federated.t2 UNION ALL
+SELECT count(*)+20 from federated.t2 EXCEPT
+SELECT count(*)+5 from federated.t1;
+EXPLAIN
+{
+ "query_block": {
+ "union_result": {
+ "message": "PUSHED UNIT"
+ }
+ }
+}
+ANALYZE
+SELECT count(*) from federated.t1 INTERSECT
+SELECT count(*) from federated.t2 UNION
+SELECT count(*)+20 from federated.t2 EXCEPT
+SELECT count(*)+5 from federated.t1;
+id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
+NULL PUSHED UNIT NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
+# UNION inside a derived table: the whole derived table must be pushed
+SELECT * FROM
+(SELECT * FROM federated.t1 UNION ALL SELECT * FROM federated.t2) q;
+a
+abc
+abc
+bcd
+bcd
+cde
+cde
+def
+efg
+EXPLAIN
+SELECT * FROM
+(SELECT a FROM federated.t1 UNION ALL SELECT * FROM federated.t2) q;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL
+# There is an uncacheable side effect due to fetch into @var,
+# so the UNION cannot be pushed down as a whole.
+# But separate SELECTs can be pushed, and the results are combined
+# at the server side
+SELECT count(*) FROM federated.t1 UNION
+SELECT count(*) FROM federated.t1 EXCEPT
+SELECT count(*)+1 FROM federated.t1
+INTO @var;
+EXPLAIN SELECT count(*) FROM federated.t1 UNION
+SELECT count(*) FROM federated.t2 EXCEPT
+SELECT count(*)+1 FROM federated.t1
+INTO @var;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL
+2 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL
+3 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL
+NULL UNIT RESULT <unit1,2,3> ALL NULL NULL NULL NULL NULL
+EXPLAIN FORMAT=JSON SELECT count(*) FROM federated.t1 UNION
+SELECT count(*) FROM federated.t2 EXCEPT
+SELECT count(*)+2 FROM federated.t2
+INTO @var;
+EXPLAIN
+{
+ "query_block": {
+ "union_result": {
+ "table_name": "<unit1,2,3>",
+ "access_type": "ALL",
+ "query_specifications": [
+ {
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "message": "Pushed select"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 2,
+ "operation": "UNION",
+ "table": {
+ "message": "Pushed select"
+ }
+ }
+ },
+ {
+ "query_block": {
+ "select_id": 3,
+ "operation": "EXCEPT",
+ "table": {
+ "message": "Pushed select"
+ }
+ }
+ }
+ ]
+ }
+ }
+}
+# Prepared statements
+PREPARE stmt FROM "SELECT * from federated.t1 INTERSECT
+ SELECT * from federated.t2 UNION ALL
+ SELECT * from federated.t2 EXCEPT
+ SELECT * from federated.t1";
+EXECUTE stmt;
+a
+def
+efg
+EXECUTE stmt;
+a
+def
+efg
+EXECUTE stmt;
+a
+def
+efg
+PREPARE stmt FROM "EXPLAIN SELECT * from federated.t1 INTERSECT
+ SELECT * from federated.t2 UNION ALL
+ SELECT * from federated.t2 EXCEPT
+ SELECT * from federated.t1";
+EXECUTE stmt;
+id select_type table type possible_keys key key_len ref rows Extra
+NULL PUSHED UNIT NULL NULL NULL NULL NULL NULL NULL NULL
+EXECUTE stmt;
+id select_type table type possible_keys key key_len ref rows Extra
+NULL PUSHED UNIT NULL NULL NULL NULL NULL NULL NULL NULL
+# UNIONs of mixed Federated/MyISAM tables, pushing parts of UNIONs
+SELECT * FROM federated.t1 UNION SELECT * FROM t3;
+a
+abc
+bcd
+cde
+t3_myisam1
+t3_myisam2
+t3_myisam3
+EXPLAIN SELECT * FROM federated.t1 UNION SELECT * FROM t3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL
+2 UNION t3 ALL NULL NULL NULL NULL 3
+NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
+SELECT * FROM federated.t1 UNION ALL
+SELECT * FROM t3 EXCEPT
+SELECT * FROM federated.t2;
+a
+t3_myisam1
+t3_myisam2
+t3_myisam3
+EXPLAIN SELECT * FROM federated.t1 UNION ALL
+SELECT * FROM t3 EXCEPT
+SELECT * FROM federated.t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL
+2 UNION t3 ALL NULL NULL NULL NULL 3
+3 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL
+NULL UNIT RESULT <unit1,2,3> ALL NULL NULL NULL NULL NULL
+SELECT * FROM t3 UNION ALL
+SELECT * FROM federated.t1 EXCEPT
+SELECT * FROM t4 INTERSECT
+SELECT * FROM federated.t2;
+a
+abc
+bcd
+cde
+t3_myisam1
+t3_myisam2
+t3_myisam3
+EXPLAIN SELECT * FROM t3 UNION ALL
+SELECT * FROM federated.t1 EXCEPT
+SELECT * FROM t4 INTERSECT
+SELECT * FROM federated.t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t3 ALL NULL NULL NULL NULL 3
+2 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL
+5 EXCEPT <derived3> ALL NULL NULL NULL NULL 3
+3 DERIVED t4 ALL NULL NULL NULL NULL 3
+4 INTERSECT t2 ALL NULL NULL NULL NULL 5
+NULL INTERSECT RESULT <intersect3,4> ALL NULL NULL NULL NULL NULL
+NULL UNIT RESULT <unit1,2,5> ALL NULL NULL NULL NULL NULL
+SELECT * FROM federated.t2 UNION ALL
+SELECT * FROM t3 EXCEPT
+SELECT * FROM t4 INTERSECT
+SELECT * FROM federated.t1;
+a
+abc
+bcd
+cde
+def
+efg
+t3_myisam1
+t3_myisam2
+t3_myisam3
+EXPLAIN SELECT * FROM federated.t2 UNION ALL
+SELECT * FROM t3 EXCEPT
+SELECT * FROM t4 INTERSECT
+SELECT * FROM federated.t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL
+2 UNION t3 ALL NULL NULL NULL NULL 3
+5 EXCEPT <derived3> ALL NULL NULL NULL NULL 3
+3 DERIVED t4 ALL NULL NULL NULL NULL 3
+4 INTERSECT t1 ALL NULL NULL NULL NULL 3
+NULL INTERSECT RESULT <intersect3,4> ALL NULL NULL NULL NULL NULL
+NULL UNIT RESULT <unit1,2,5> ALL NULL NULL NULL NULL NULL
+# Parenthesis must not prevent the whole UNIONs pushdown
+EXPLAIN (SELECT * FROM federated.t1 UNION
+SELECT * FROM federated.t2) UNION ALL
+SELECT * FROM federated.t1;
+id select_type table type possible_keys key key_len ref rows Extra
+NULL PUSHED UNION NULL NULL NULL NULL NULL NULL NULL NULL
+(SELECT * FROM federated.t1 UNION
+SELECT * FROM federated.t2) UNION ALL
+SELECT * FROM federated.t1;
+a
+abc
+abc
+bcd
+bcd
+cde
+cde
+def
+efg
+EXPLAIN (SELECT * FROM federated.t1 UNION SELECT * FROM federated.t2)
+UNION ALL (SELECT * FROM federated.t1 UNION SELECT * FROM federated.t2);
+id select_type table type possible_keys key key_len ref rows Extra
+NULL PUSHED UNION NULL NULL NULL NULL NULL NULL NULL NULL
+(SELECT * FROM federated.t1 UNION SELECT * FROM federated.t2) UNION ALL
+(SELECT * FROM federated.t1 UNION SELECT * FROM federated.t2);
+a
+abc
+abc
+bcd
+bcd
+cde
+cde
+def
+def
+efg
+efg
+# Union of tables containing different INT data types
+connection slave;
+CREATE TABLE federated.t11 (a smallint(6) NOT NULL);
+INSERT INTO federated.t11 VALUES (-32678), (-1), (0);
+CREATE TABLE federated.t12 (a int(10) UNSIGNED NOT NULL);
+INSERT INTO federated.t12 VALUES (0), (1), (32767);
+connection master;
+CREATE TABLE federated.t11 (a smallint(6) NOT NULL)
+ENGINE="FEDERATED"
+CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t11';
+CREATE TABLE federated.t12 (a int(10) UNSIGNED NOT NULL)
+ENGINE="FEDERATED"
+CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t12';
+# Entire UNION pushdown
+SELECT a FROM federated.t12 UNION ALL SELECT a FROM federated.t11;
+a
+-1
+-32678
+0
+0
+1
+32767
+EXPLAIN SELECT a FROM federated.t12 UNION ALL SELECT a FROM federated.t11;
+id select_type table type possible_keys key key_len ref rows Extra
+NULL PUSHED UNION NULL NULL NULL NULL NULL NULL NULL NULL
+SELECT a FROM federated.t11 UNION SELECT a FROM federated.t12;
+a
+-1
+-32678
+0
+1
+32767
+# Partial pushdown of SELECTs composing the UNION
+SELECT a FROM federated.t12 UNION SELECT a FROM federated.t11 UNION SELECT 123;
+a
+-1
+-32678
+0
+1
+123
+32767
+EXPLAIN
+SELECT a FROM federated.t12 UNION SELECT a FROM federated.t11
+UNION SELECT 123;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL
+2 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL
+3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,2,3> ALL NULL NULL NULL NULL NULL
+SELECT a FROM federated.t12 EXCEPT
+SELECT 1 UNION ALL
+SELECT a FROM federated.t11 EXCEPT
+SELECT 0;
+a
+-1
+-32678
+32767
+# Union of tables containing different string data types
+connection slave;
+CREATE TABLE federated.t13 (a CHAR(6));
+INSERT INTO federated.t13 VALUES ('t13abc'), ('t13xx'), ('common');
+CREATE TABLE federated.t14 (a VARCHAR(8));
+INSERT INTO federated.t14 VALUES ('t14abcde'), ('t14xyzzz'), ('common');
+connection master;
+CREATE TABLE federated.t13 (a CHAR(6))
+ENGINE="FEDERATED"
+CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t13';
+CREATE TABLE federated.t14 (a VARCHAR(8))
+ENGINE="FEDERATED"
+CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t14';
+SELECT * FROM federated.t13 UNION SELECT * FROM federated.t14;
+a
+common
+t13abc
+t13xx
+t14abcde
+t14xyzzz
+EXPLAIN SELECT * FROM federated.t13 UNION SELECT * FROM federated.t14;
+id select_type table type possible_keys key key_len ref rows Extra
+NULL PUSHED UNION NULL NULL NULL NULL NULL NULL NULL NULL
+SELECT * FROM federated.t14 UNION ALL SELECT * FROM federated.t13;
+a
+common
+common
+t13abc
+t13xx
+t14abcde
+t14xyzzz
+SELECT * FROM federated.t14 UNION
+SELECT * FROM federated.t13 UNION
+SELECT '123456789000';
+a
+t14abcde
+t14xyzzz
+common
+t13abc
+t13xx
+123456789000
+EXPLAIN SELECT * FROM federated.t14 UNION
+SELECT * FROM federated.t13 UNION
+SELECT '123456789000';
+id select_type table type possible_keys key key_len ref rows Extra
+1 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL
+2 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL
+3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union1,2,3> ALL NULL NULL NULL NULL NULL
+SELECT * FROM federated.t13 UNION
+SELECT '123456789000' UNION
+SELECT * FROM federated.t14;
+a
+123456789000
+common
+t13abc
+t13xx
+t14abcde
+t14xyzzz
+# CREATE TABLE .. AS from a pushed UNION
+CREATE TABLE t5 AS SELECT * FROM federated.t13 UNION
+SELECT * FROM federated.t14;
+SHOW CREATE TABLE t5;
+Table Create Table
+t5 CREATE TABLE `t5` (
+ `a` varchar(8) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t5;
+a
+common
+t13abc
+t13xx
+t14abcde
+t14xyzzz
+CREATE TABLE t6 AS SELECT a FROM federated.t12 EXCEPT
+SELECT 1 UNION ALL
+SELECT a FROM federated.t11 EXCEPT
+SELECT 0;
+SHOW CREATE TABLE t6;
+Table Create Table
+t6 CREATE TABLE `t6` (
+ `a` decimal(10,0) NOT NULL DEFAULT 0
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t6;
+a
+-1
+-32678
+32767
+#
+# MDEV-30828 ORDER BY clause using an integer (positional argument)
+#
+SELECT a FROM federated.t1 UNION SELECT a FROM federated.t2 ORDER BY 1;
+a
+abc
+bcd
+cde
+def
+efg
+SELECT a FROM federated.t1 UNION ALL SELECT a FROM federated.t2 ORDER BY a DESC;
+a
+efg
+def
+cde
+cde
+bcd
+bcd
+abc
+abc
+# Check handling of incorrect ORDER BY clause
+SELECT a FROM federated.t1 UNION SELECT a FROM federated.t2 ORDER BY 2;
+ERROR 42S22: Unknown column '2' in 'order clause'
+PREPARE stmt FROM
+"SELECT a FROM federated.t1 UNION ALL SELECT a FROM federated.t2 ORDER BY 2";
+ERROR 42S22: Unknown column '2' in 'order clause'
+SELECT a FROM federated.t1 UNION ALL SELECT a FROM federated.t2 ORDER BY 2,1,3;
+ERROR 42S22: Unknown column '2' in 'order clause'
+SELECT a FROM federated.t1 UNION ALL SELECT a FROM federated.t2 ORDER BY t1.a;
+ERROR 42000: Table 't1' from one of the SELECTs cannot be used in ORDER clause
+SELECT * from federated.t1 INTERSECT
+SELECT * from federated.t2 UNION ALL
+SELECT * from federated.t2 EXCEPT
+SELECT * from federated.t1
+ORDER BY 1;
+a
+def
+efg
+SELECT * from federated.t1 INTERSECT
+SELECT * from federated.t2 UNION ALL
+SELECT * from federated.t2 EXCEPT
+SELECT * from federated.t1
+ORDER BY 3;
+ERROR 42S22: Unknown column '3' in 'order clause'
+# UNION of mixed Federated/MyISAM tables, pushing parts of UNIONs
+SELECT * FROM federated.t1 UNION SELECT * FROM t3 ORDER BY a;
+a
+abc
+bcd
+cde
+t3_myisam1
+t3_myisam2
+t3_myisam3
+SELECT * FROM federated.t1 UNION SELECT * FROM t3 ORDER BY 2;
+ERROR 42S22: Unknown column '2' in 'order clause'
+#
+# MDEV-32382 FederatedX error on pushdown of statement having CTE
+#
+# Single SELECT with CTE
+WITH cte AS (SELECT * FROM federated.t1)
+SELECT * FROM cte;
+a
+bcd
+abc
+cde
+explain extended WITH cte AS (SELECT * FROM federated.t1)
+SELECT * FROM cte;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PUSHED SELECT NULL NULL NULL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 with cte as (/* select#2 */ select `federated`.`t1`.`a` AS `a` from `federated`.`t1`)/* select#1 */ select `cte`.`a` AS `a` from `cte`
+# Pushdown of a UNION having CTE's
+WITH cte AS (SELECT * FROM federated.t1),
+cte2 AS (SELECT * FROM federated.t2)
+SELECT * FROM cte
+UNION
+SELECT * FROM cte2;
+a
+abc
+bcd
+cde
+def
+efg
+explain extended WITH cte AS (SELECT * FROM federated.t1),
+cte2 AS (SELECT * FROM federated.t2)
+SELECT * FROM cte
+UNION
+SELECT * FROM cte2;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+NULL PUSHED UNION NULL NULL NULL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 with cte as (/* select#2 */ select `federated`.`t1`.`a` AS `a` from `federated`.`t1`), cte2 as (/* select#3 */ select `federated`.`t2`.`a` AS `a` from `federated`.`t2`)/* select#1 */ select `cte`.`a` AS `a` from `cte` union /* select#4 */ select `cte2`.`a` AS `a` from `cte2`
+# Partial pushdown is not allowed for unions with CTE's, however a CTE
+# may be pushed down a derived table
+WITH cte AS (SELECT * FROM federated.t1)
+SELECT * FROM cte
+UNION ALL
+SELECT * FROM t3;
+a
+abc
+bcd
+cde
+t3_myisam1
+t3_myisam2
+t3_myisam3
+explain extended WITH cte AS (SELECT * FROM federated.t1)
+SELECT * FROM cte
+UNION ALL
+SELECT * FROM t3;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 100.00
+2 PUSHED DERIVED NULL NULL NULL NULL NULL NULL NULL NULL NULL
+3 UNION t3 ALL NULL NULL NULL NULL 3 100.00
+Warnings:
+Note 1003 with cte as (/* select#2 */ select `federated`.`t1`.`a` AS `a` from `federated`.`t1`)/* select#1 */ select `cte`.`a` AS `a` from `cte` union all /* select#3 */ select `federated`.`t3`.`a` AS `a` from `federated`.`t3`
+WITH cte AS (SELECT * FROM federated.t1 UNION SELECT * FROM t3)
+SELECT * FROM cte;
+a
+abc
+bcd
+cde
+t3_myisam1
+t3_myisam2
+t3_myisam3
+explain extended WITH cte AS (SELECT * FROM federated.t1 UNION SELECT * FROM t3)
+SELECT * FROM cte;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY <derived2> ALL NULL NULL NULL NULL 6 100.00
+2 DERIVED t1 ALL NULL NULL NULL NULL 3 100.00
+3 UNION t3 ALL NULL NULL NULL NULL 3 100.00
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 with cte as (/* select#2 */ select `federated`.`t1`.`a` AS `a` from `federated`.`t1` union /* select#3 */ select `federated`.`t3`.`a` AS `a` from `federated`.`t3`)/* select#1 */ select `cte`.`a` AS `a` from `cte`
+# Two CTE's where one CTE refers to another
+WITH cte AS (SELECT * FROM federated.t1),
+cte2 AS (SELECT * FROM t3
+WHERE t3.a NOT IN (SELECT * FROM cte))
+SELECT * FROM cte JOIN cte2;
+a a
+abc t3_myisam1
+abc t3_myisam2
+abc t3_myisam3
+bcd t3_myisam1
+bcd t3_myisam2
+bcd t3_myisam3
+cde t3_myisam1
+cde t3_myisam2
+cde t3_myisam3
+explain extended WITH cte AS (SELECT * FROM federated.t1),
+cte2 AS (SELECT * FROM t3
+WHERE t3.a NOT IN (SELECT * FROM cte))
+SELECT * FROM cte JOIN cte2;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY <derived5> ALL NULL NULL NULL NULL 3 100.00
+1 PRIMARY t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
+5 PUSHED DERIVED NULL NULL NULL NULL NULL NULL NULL NULL NULL
+4 MATERIALIZED <derived2> ALL NULL NULL NULL NULL 3 100.00
+2 PUSHED DERIVED NULL NULL NULL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1003 with cte as (/* select#2 */ select `federated`.`t1`.`a` AS `a` from `federated`.`t1`), cte2 as (/* select#3 */ select `federated`.`t3`.`a` AS `a` from `federated`.`t3` where !<expr_cache><`federated`.`t3`.`a`>(<in_optimizer>(`federated`.`t3`.`a`,`federated`.`t3`.`a` in ( <materialize> (/* select#4 */ select `cte`.`a` from `cte` ), <primary_index_lookup>(`federated`.`t3`.`a` in <temporary table> on distinct_key where `federated`.`t3`.`a` = `<subquery4>`.`a`)))))/* select#1 */ select `cte`.`a` AS `a`,`federated`.`t3`.`a` AS `a` from `cte` join `federated`.`t3` where !<expr_cache><`federated`.`t3`.`a`>(<in_optimizer>(`federated`.`t3`.`a`,`federated`.`t3`.`a` in ( <materialize> (/* select#4 */ select `cte`.`a` from `cte` ), <primary_index_lookup>(`federated`.`t3`.`a` in <temporary table> on distinct_key where `federated`.`t3`.`a` = `<subquery4>`.`a`))))
+connection master;
+DROP TABLES federated.t1, federated.t2, t3, t4, t5, t6, federated.t11,
+federated.t12, federated.t13, federated.t14;
+connection slave;
+DROP TABLES federated.t1, federated.t2, federated.t11, federated.t12,
+federated.t13, federated.t14;
+connection default;
set global federated_pushdown=0;
connection master;
DROP TABLE IF EXISTS federated.t1;
diff --git a/mysql-test/suite/federated/federatedx_create_handlers.test b/mysql-test/suite/federated/federatedx_create_handlers.test
index c5ac36de..736d42e9 100644
--- a/mysql-test/suite/federated/federatedx_create_handlers.test
+++ b/mysql-test/suite/federated/federatedx_create_handlers.test
@@ -76,6 +76,7 @@ SELECT id FROM federated.t1 WHERE id < 5;
EXPLAIN EXTENDED
SELECT id FROM federated.t1 WHERE id < 5;
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON
SELECT id FROM federated.t1 WHERE id < 5;
@@ -103,6 +104,7 @@ SELECT *
FROM federated.t3, (SELECT * FROM federated.t1 WHERE id > 3) t
WHERE federated.t3.name=t.name;
+--source include/explain-no-costs.inc
EXPLAIN FORMAT=JSON
SELECT *
FROM federated.t3, (SELECT * FROM federated.t1 WHERE id > 3) t
@@ -182,6 +184,7 @@ explain
select * from federated.t1
where name in (select name from federated.t2);
+--source include/explain-no-costs.inc
explain format=json
select * from federated.t1
where name in (select name from federated.t2);
@@ -201,6 +204,7 @@ select * from t5,
where name in (select name from federated.t2) or name like 'foo%') as TQ;
--echo # Must not show elements with select_id=3
+--source include/explain-no-costs.inc
explain format=json
select * from t5,
(select id from federated.t1
@@ -434,6 +438,423 @@ EXECUTE stmt;
DEALLOCATE PREPARE stmt;
+DROP TABLES federated.t1, federated.t2, federated.t3, federated.t10,
+ federated.t11;
+connection slave;
+DROP TABLES federated.t1, federated.t2, federated.t3, federated.t10,
+ federated.t11;
+
+
+--echo # MDEV-25080: Allow pushdown of queries involving UNIONs
+--echo # in outer select to foreign engines
+--echo #
+
+connection slave;
+
+CREATE TABLE federated.t1 (
+ a varchar(10)
+)
+DEFAULT CHARSET=latin1;
+
+CREATE TABLE federated.t2 (
+ a varchar(16) NOT NULL default ''
+)
+DEFAULT CHARSET=latin1;
+
+INSERT INTO federated.t1 VALUES ('bcd'), ('abc'), ('cde');
+INSERT INTO federated.t2 VALUES ('cde'), ('efg'), ('abc'), ('bcd'), ('def');
+
+connection master;
+
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval
+CREATE TABLE federated.t1 (
+ a varchar(10)
+)
+ENGINE="FEDERATED" DEFAULT CHARSET=latin1
+CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1';
+
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval
+CREATE TABLE federated.t2 (
+ a varchar(16) NOT NULL default ''
+)
+ENGINE="FEDERATED" DEFAULT CHARSET=latin1
+CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t2';
+
+CREATE TABLE t3 (a varchar(30)) ENGINE=MyISAM;
+CREATE TABLE t4 (a varchar(30)) ENGINE=MyISAM;
+
+INSERT INTO t3 VALUES ('t3_myisam1'), ('t3_myisam2'), ('t3_myisam3');
+INSERT INTO t4 VALUES ('t4_myisam1'), ('t4_myisam2'), ('t4_myisam3');
+
+--echo # Pushdown of the whole UNION
+--sorted_result
+SELECT * from federated.t1 UNION SELECT * from federated.t2;
+EXPLAIN SELECT * from federated.t1 UNION SELECT * from federated.t2;
+
+--echo # Pushdown of a part of the UNION
+--sorted_result
+SELECT * from federated.t1 UNION SELECT * from t3;
+EXPLAIN SELECT * from federated.t1 UNION SELECT * from t3;
+
+--sorted_result
+SELECT * from federated.t1 UNION ALL SELECT * from federated.t2;
+EXPLAIN SELECT * from federated.t1 UNION ALL SELECT * from federated.t2;
+
+EXPLAIN FORMAT=JSON SELECT * from federated.t1 UNION ALL
+ SELECT * from federated.t2;
+
+ANALYZE SELECT * from federated.t1 UNION ALL SELECT * from federated.t2;
+
+--source include/analyze-format.inc
+ANALYZE FORMAT=JSON SELECT * from federated.t1 UNION ALL
+ SELECT * from federated.t2;
+
+--sorted_result
+SELECT * from federated.t1 EXCEPT SELECT * from federated.t2;
+
+EXPLAIN EXTENDED SELECT * from federated.t1 EXCEPT
+ SELECT * from federated.t2;
+
+EXPLAIN FORMAT=JSON SELECT * from federated.t1 EXCEPT
+ SELECT * from federated.t2;
+
+--sorted_result
+SELECT * from federated.t1 INTERSECT SELECT * from federated.t2;
+
+EXPLAIN PARTITIONS SELECT * from federated.t1 INTERSECT
+ SELECT * from federated.t2;
+
+EXPLAIN FORMAT=JSON SELECT * from federated.t1 INTERSECT
+ SELECT * from federated.t2;
+
+--echo # More than two SELECTs in a UNIT:
+--sorted_result
+SELECT * from federated.t1 INTERSECT
+ SELECT * from federated.t2 UNION ALL
+ SELECT * from federated.t2 EXCEPT
+ SELECT * from federated.t1;
+
+EXPLAIN
+ SELECT count(*) from federated.t1 INTERSECT
+ SELECT count(*) from federated.t2 UNION ALL
+ SELECT count(*)+20 from federated.t2 EXCEPT
+ SELECT count(*)+5 from federated.t1;
+
+EXPLAIN FORMAT=JSON
+ SELECT count(*) from federated.t1 INTERSECT
+ SELECT count(*) from federated.t2 UNION ALL
+ SELECT count(*)+20 from federated.t2 EXCEPT
+ SELECT count(*)+5 from federated.t1;
+
+ANALYZE
+ SELECT count(*) from federated.t1 INTERSECT
+ SELECT count(*) from federated.t2 UNION
+ SELECT count(*)+20 from federated.t2 EXCEPT
+ SELECT count(*)+5 from federated.t1;
+
+--echo # UNION inside a derived table: the whole derived table must be pushed
+--sorted_result
+SELECT * FROM
+ (SELECT * FROM federated.t1 UNION ALL SELECT * FROM federated.t2) q;
+
+EXPLAIN
+ SELECT * FROM
+ (SELECT a FROM federated.t1 UNION ALL SELECT * FROM federated.t2) q;
+
+--echo # There is an uncacheable side effect due to fetch into @var,
+--echo # so the UNION cannot be pushed down as a whole.
+--echo # But separate SELECTs can be pushed, and the results are combined
+--echo # at the server side
+
+--disable_warnings
+--sorted_result
+SELECT count(*) FROM federated.t1 UNION
+ SELECT count(*) FROM federated.t1 EXCEPT
+ SELECT count(*)+1 FROM federated.t1
+ INTO @var;
+
+EXPLAIN SELECT count(*) FROM federated.t1 UNION
+ SELECT count(*) FROM federated.t2 EXCEPT
+ SELECT count(*)+1 FROM federated.t1
+ INTO @var;
+
+EXPLAIN FORMAT=JSON SELECT count(*) FROM federated.t1 UNION
+ SELECT count(*) FROM federated.t2 EXCEPT
+ SELECT count(*)+2 FROM federated.t2
+ INTO @var;
+--enable_warnings
+
+--echo # Prepared statements
+PREPARE stmt FROM "SELECT * from federated.t1 INTERSECT
+ SELECT * from federated.t2 UNION ALL
+ SELECT * from federated.t2 EXCEPT
+ SELECT * from federated.t1";
+
+--sorted_result
+EXECUTE stmt;
+--sorted_result
+EXECUTE stmt;
+--sorted_result
+EXECUTE stmt;
+
+PREPARE stmt FROM "EXPLAIN SELECT * from federated.t1 INTERSECT
+ SELECT * from federated.t2 UNION ALL
+ SELECT * from federated.t2 EXCEPT
+ SELECT * from federated.t1";
+
+--sorted_result
+EXECUTE stmt;
+--sorted_result
+EXECUTE stmt;
+
+--echo # UNIONs of mixed Federated/MyISAM tables, pushing parts of UNIONs
+--sorted_result
+SELECT * FROM federated.t1 UNION SELECT * FROM t3;
+EXPLAIN SELECT * FROM federated.t1 UNION SELECT * FROM t3;
+
+--sorted_result
+SELECT * FROM federated.t1 UNION ALL
+ SELECT * FROM t3 EXCEPT
+ SELECT * FROM federated.t2;
+EXPLAIN SELECT * FROM federated.t1 UNION ALL
+ SELECT * FROM t3 EXCEPT
+ SELECT * FROM federated.t2;
+
+--sorted_result
+SELECT * FROM t3 UNION ALL
+ SELECT * FROM federated.t1 EXCEPT
+ SELECT * FROM t4 INTERSECT
+ SELECT * FROM federated.t2;
+EXPLAIN SELECT * FROM t3 UNION ALL
+ SELECT * FROM federated.t1 EXCEPT
+ SELECT * FROM t4 INTERSECT
+ SELECT * FROM federated.t2;
+
+--sorted_result
+SELECT * FROM federated.t2 UNION ALL
+ SELECT * FROM t3 EXCEPT
+ SELECT * FROM t4 INTERSECT
+ SELECT * FROM federated.t1;
+EXPLAIN SELECT * FROM federated.t2 UNION ALL
+ SELECT * FROM t3 EXCEPT
+ SELECT * FROM t4 INTERSECT
+ SELECT * FROM federated.t1;
+
+--echo # Parenthesis must not prevent the whole UNIONs pushdown
+EXPLAIN (SELECT * FROM federated.t1 UNION
+ SELECT * FROM federated.t2) UNION ALL
+ SELECT * FROM federated.t1;
+
+--sorted_result
+(SELECT * FROM federated.t1 UNION
+ SELECT * FROM federated.t2) UNION ALL
+ SELECT * FROM federated.t1;
+
+EXPLAIN (SELECT * FROM federated.t1 UNION SELECT * FROM federated.t2)
+ UNION ALL (SELECT * FROM federated.t1 UNION SELECT * FROM federated.t2);
+
+--sorted_result
+(SELECT * FROM federated.t1 UNION SELECT * FROM federated.t2) UNION ALL
+ (SELECT * FROM federated.t1 UNION SELECT * FROM federated.t2);
+
+--echo # Union of tables containing different INT data types
+connection slave;
+
+CREATE TABLE federated.t11 (a smallint(6) NOT NULL);
+INSERT INTO federated.t11 VALUES (-32678), (-1), (0);
+
+CREATE TABLE federated.t12 (a int(10) UNSIGNED NOT NULL);
+INSERT INTO federated.t12 VALUES (0), (1), (32767);
+
+connection master;
+
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval
+CREATE TABLE federated.t11 (a smallint(6) NOT NULL)
+ENGINE="FEDERATED"
+CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t11';
+
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval
+CREATE TABLE federated.t12 (a int(10) UNSIGNED NOT NULL)
+ENGINE="FEDERATED"
+CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t12';
+
+--echo # Entire UNION pushdown
+--sorted_result
+SELECT a FROM federated.t12 UNION ALL SELECT a FROM federated.t11;
+EXPLAIN SELECT a FROM federated.t12 UNION ALL SELECT a FROM federated.t11;
+
+--sorted_result
+SELECT a FROM federated.t11 UNION SELECT a FROM federated.t12;
+
+--echo # Partial pushdown of SELECTs composing the UNION
+--sorted_result
+SELECT a FROM federated.t12 UNION SELECT a FROM federated.t11 UNION SELECT 123;
+EXPLAIN
+ SELECT a FROM federated.t12 UNION SELECT a FROM federated.t11
+ UNION SELECT 123;
+
+--sorted_result
+SELECT a FROM federated.t12 EXCEPT
+ SELECT 1 UNION ALL
+ SELECT a FROM federated.t11 EXCEPT
+ SELECT 0;
+
+--echo # Union of tables containing different string data types
+connection slave;
+CREATE TABLE federated.t13 (a CHAR(6));
+INSERT INTO federated.t13 VALUES ('t13abc'), ('t13xx'), ('common');
+
+CREATE TABLE federated.t14 (a VARCHAR(8));
+INSERT INTO federated.t14 VALUES ('t14abcde'), ('t14xyzzz'), ('common');
+
+connection master;
+
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval
+CREATE TABLE federated.t13 (a CHAR(6))
+ENGINE="FEDERATED"
+CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t13';
+
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval
+CREATE TABLE federated.t14 (a VARCHAR(8))
+ENGINE="FEDERATED"
+CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t14';
+
+--sorted_result
+SELECT * FROM federated.t13 UNION SELECT * FROM federated.t14;
+EXPLAIN SELECT * FROM federated.t13 UNION SELECT * FROM federated.t14;
+
+--sorted_result
+SELECT * FROM federated.t14 UNION ALL SELECT * FROM federated.t13;
+
+SELECT * FROM federated.t14 UNION
+ SELECT * FROM federated.t13 UNION
+ SELECT '123456789000';
+
+EXPLAIN SELECT * FROM federated.t14 UNION
+ SELECT * FROM federated.t13 UNION
+ SELECT '123456789000';
+
+--sorted_result
+SELECT * FROM federated.t13 UNION
+ SELECT '123456789000' UNION
+ SELECT * FROM federated.t14;
+
+--echo # CREATE TABLE .. AS from a pushed UNION
+CREATE TABLE t5 AS SELECT * FROM federated.t13 UNION
+ SELECT * FROM federated.t14;
+SHOW CREATE TABLE t5;
+--sorted_result
+SELECT * FROM t5;
+
+CREATE TABLE t6 AS SELECT a FROM federated.t12 EXCEPT
+ SELECT 1 UNION ALL
+ SELECT a FROM federated.t11 EXCEPT
+ SELECT 0;
+SHOW CREATE TABLE t6;
+--sorted_result
+SELECT * FROM t6;
+
+--echo #
+--echo # MDEV-30828 ORDER BY clause using an integer (positional argument)
+--echo #
+SELECT a FROM federated.t1 UNION SELECT a FROM federated.t2 ORDER BY 1;
+
+SELECT a FROM federated.t1 UNION ALL SELECT a FROM federated.t2 ORDER BY a DESC;
+
+--echo # Check handling of incorrect ORDER BY clause
+--error ER_BAD_FIELD_ERROR
+SELECT a FROM federated.t1 UNION SELECT a FROM federated.t2 ORDER BY 2;
+--error ER_BAD_FIELD_ERROR
+PREPARE stmt FROM
+ "SELECT a FROM federated.t1 UNION ALL SELECT a FROM federated.t2 ORDER BY 2";
+
+--error ER_BAD_FIELD_ERROR
+SELECT a FROM federated.t1 UNION ALL SELECT a FROM federated.t2 ORDER BY 2,1,3;
+--error ER_TABLENAME_NOT_ALLOWED_HERE
+SELECT a FROM federated.t1 UNION ALL SELECT a FROM federated.t2 ORDER BY t1.a;
+SELECT * from federated.t1 INTERSECT
+ SELECT * from federated.t2 UNION ALL
+ SELECT * from federated.t2 EXCEPT
+ SELECT * from federated.t1
+ ORDER BY 1;
+--error ER_BAD_FIELD_ERROR
+SELECT * from federated.t1 INTERSECT
+ SELECT * from federated.t2 UNION ALL
+ SELECT * from federated.t2 EXCEPT
+ SELECT * from federated.t1
+ ORDER BY 3;
+--echo # UNION of mixed Federated/MyISAM tables, pushing parts of UNIONs
+SELECT * FROM federated.t1 UNION SELECT * FROM t3 ORDER BY a;
+--error ER_BAD_FIELD_ERROR
+SELECT * FROM federated.t1 UNION SELECT * FROM t3 ORDER BY 2;
+
+
+--echo #
+--echo # MDEV-32382 FederatedX error on pushdown of statement having CTE
+--echo #
+
+--echo # Single SELECT with CTE
+let $query= WITH cte AS (SELECT * FROM federated.t1)
+ SELECT * FROM cte;
+eval $query;
+eval explain extended $query;
+
+--echo # Pushdown of a UNION having CTE's
+let $query= WITH cte AS (SELECT * FROM federated.t1),
+ cte2 AS (SELECT * FROM federated.t2)
+ SELECT * FROM cte
+ UNION
+ SELECT * FROM cte2;
+--sorted_result
+eval $query;
+eval explain extended $query;
+
+# CREATE TABLE t3 (a int);
+# INSERT INTO t3 VALUES (101),(102),(103);
+
+--echo # Partial pushdown is not allowed for unions with CTE's, however a CTE
+--echo # may be pushed down a derived table
+let $query= WITH cte AS (SELECT * FROM federated.t1)
+ SELECT * FROM cte
+ UNION ALL
+ SELECT * FROM t3;
+--sorted_result
+eval $query;
+eval explain extended $query;
+
+let $query= WITH cte AS (SELECT * FROM federated.t1 UNION SELECT * FROM t3)
+ SELECT * FROM cte;
+--sorted_result
+eval $query;
+eval explain extended $query;
+
+--echo # Two CTE's where one CTE refers to another
+let $query= WITH cte AS (SELECT * FROM federated.t1),
+ cte2 AS (SELECT * FROM t3
+ WHERE t3.a NOT IN (SELECT * FROM cte))
+ SELECT * FROM cte JOIN cte2;
+--sorted_result
+eval $query;
+eval explain extended $query;
+
+
+# Cleanup
+connection master;
+DROP TABLES federated.t1, federated.t2, t3, t4, t5, t6, federated.t11,
+ federated.t12, federated.t13, federated.t14;
+
+connection slave;
+DROP TABLES federated.t1, federated.t2, federated.t11, federated.t12,
+ federated.t13, federated.t14;
+
+connection default;
+
set global federated_pushdown=0;
source include/federated_cleanup.inc;
diff --git a/mysql-test/suite/federated/my.cnf b/mysql-test/suite/federated/my.cnf
index b97f8266..21fd1b39 100644
--- a/mysql-test/suite/federated/my.cnf
+++ b/mysql-test/suite/federated/my.cnf
@@ -1,6 +1,5 @@
# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
-!include include/default_client.cnf
+!include include/default_my.cnf
[mysqld.1]
federated
diff --git a/mysql-test/suite/funcs_1/datadict/processlist_priv.inc b/mysql-test/suite/funcs_1/datadict/processlist_priv.inc
index 90bc19f2..298a026e 100644
--- a/mysql-test/suite/funcs_1/datadict/processlist_priv.inc
+++ b/mysql-test/suite/funcs_1/datadict/processlist_priv.inc
@@ -161,7 +161,7 @@ eval SHOW CREATE TABLE $table;
--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
eval SHOW $table;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 E_ROWS 16 S_ROWS 17 QUERY_ID 19 TID
eval SELECT * FROM $table $select_where ORDER BY id;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID
eval SELECT $columns FROM $table $select_where ORDER BY id;
@@ -182,7 +182,7 @@ eval SHOW CREATE TABLE $table;
--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
eval SHOW $table;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 E_ROWS 16 S_ROWS 17 QUERY_ID 19 TID
eval SELECT * FROM $table $select_where ORDER BY id;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 ROWS 15 QUERY_ID 17 TID
eval SELECT $columns FROM $table $select_where ORDER BY id;
@@ -209,7 +209,7 @@ SHOW GRANTS;
--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 E_ROWS 16 S_ROWS 17 QUERY_ID 19 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -222,7 +222,7 @@ SHOW GRANTS;
--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 E_ROWS 16 S_ROWS 17 QUERY_ID 19 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -246,7 +246,7 @@ SHOW GRANTS;
--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 E_ROWS 16 S_ROWS 17 QUERY_ID 19 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -269,7 +269,7 @@ SHOW GRANTS;
--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 E_ROWS 16 S_ROWS 17 QUERY_ID 19 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -296,7 +296,7 @@ if ($fixed_bug_30395)
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
}
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 E_ROWS 16 S_ROWS 17 QUERY_ID 19 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -318,7 +318,7 @@ SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 E_ROWS 16 S_ROWS 17 QUERY_ID 19 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -341,7 +341,7 @@ SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 E_ROWS 16 S_ROWS 17 QUERY_ID 19 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -389,7 +389,7 @@ SHOW GRANTS FOR 'ddicttestuser2'@'localhost';
--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 E_ROWS 16 S_ROWS 17 QUERY_ID 19 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -411,7 +411,7 @@ SHOW GRANTS;
--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 E_ROWS 16 S_ROWS 17 QUERY_ID 19 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -435,7 +435,7 @@ GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 E_ROWS 16 S_ROWS 17 QUERY_ID 19 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
@@ -460,7 +460,7 @@ SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
---replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
+--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 E_ROWS 16 S_ROWS 17 QUERY_ID 19 TID
SELECT * FROM information_schema.processlist;
--real_sleep 0.3
diff --git a/mysql-test/suite/funcs_1/datadict/processlist_val.inc b/mysql-test/suite/funcs_1/datadict/processlist_val.inc
index fa6ed404..ab248239 100644
--- a/mysql-test/suite/funcs_1/datadict/processlist_val.inc
+++ b/mysql-test/suite/funcs_1/datadict/processlist_val.inc
@@ -92,7 +92,7 @@ echo
# - INFO must contain the corresponding SHOW/SELECT PROCESSLIST
#
# 1. Just dump what we get
---replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <ROWS> 16 <QUERY_ID> 18 <TID>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <E_ROWS> 16 <S_ROWS> 17 <QUERY_ID> 19 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_result Execute Query
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS>
@@ -160,7 +160,7 @@ let $wait_condition= SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE COMMAND = 'Sleep' AND USER = 'test_user';
--source include/wait_condition.inc
# 1. Just dump what we get
---replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 7 <STATE> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <ROWS> 16 <QUERY_ID> 18 <TID>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 7 <STATE> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <E_ROWS> 16 <S_ROWS> 17 <QUERY_ID> 19 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_result Execute Query
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
@@ -203,7 +203,7 @@ echo
#----------------------------------------------------------------------------
;
connection con1;
---replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <ROWS> 16 <QUERY_ID> 18 <TID>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <E_ROWS> 16 <S_ROWS> 17 <QUERY_ID> 19 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_result Execute Query
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
@@ -229,7 +229,7 @@ let $wait_condition= SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST
--source include/wait_condition.inc
connection con2;
# Just dump what we get
---replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <ROWS> 16 <QUERY_ID> 18 <TID>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <E_ROWS> 16 <S_ROWS> 17 <QUERY_ID> 19 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_result Execute Query
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
@@ -281,7 +281,7 @@ WHERE ID = @test_user_con2_id AND Command IN('Query','Execute')
AND State = 'User sleep' AND INFO IS NOT NULL ;
--source include/wait_condition.inc
# 1. Just dump what we get
---replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <ROWS> 16 <QUERY_ID> 18 <TID>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <E_ROWS> 16 <S_ROWS> 17 <QUERY_ID> 19 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_result Execute Query
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
@@ -341,7 +341,7 @@ let $wait_condition= SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST
#
# Expect to see the state 'Waiting for table metadata lock' for the third
# connection because the SELECT collides with the WRITE TABLE LOCK.
---replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <ROWS> 16 <QUERY_ID> 18 <TID>
+--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <E_ROWS> 16 <S_ROWS> 17 <QUERY_ID> 19 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
UNLOCK TABLES;
#
@@ -388,7 +388,7 @@ echo
# SHOW FULL PROCESSLIST Complete statement
# SHOW PROCESSLIST statement truncated after 100 char
;
---replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <ROWS> 16 <QUERY_ID> 18 <TID>
+--replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <E_ROWS> 16 <S_ROWS> 17 <QUERY_ID> 19 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_result Execute Query
--replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE>
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_03.result b/mysql-test/suite/funcs_1/r/innodb_trig_03.result
index f0f1777b..808744a8 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_03.result
@@ -78,7 +78,7 @@ grant ALL on *.* to test_noprivs@localhost;
revoke TRIGGER on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR, SHOW CREATE ROUTINE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
@@ -168,7 +168,7 @@ grant ALL on *.* to test_noprivs@localhost;
revoke UPDATE on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR, SHOW CREATE ROUTINE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
@@ -183,7 +183,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR, SHOW CREATE ROUTINE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
@@ -248,7 +248,7 @@ connection no_privs_424b;
show grants;
Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY, SHOW CREATE ROUTINE ON `priv_db`.* TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4b_1 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-1b';
@@ -441,7 +441,7 @@ grant ALL on *.* to test_noprivs@localhost;
revoke SELECT on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR, SHOW CREATE ROUTINE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
@@ -457,7 +457,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR, SHOW CREATE ROUTINE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
connection default;
@@ -503,7 +503,7 @@ revoke SELECT on priv_db.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY, SHOW CREATE ROUTINE ON `priv_db`.* TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.* to test_yesprivs@localhost;
@@ -518,7 +518,7 @@ connection no_privs_425b;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY, SHOW CREATE ROUTINE ON `priv_db`.* TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5b_1 before UPDATE on t1 for each row
set @test_var= new.f1;
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_03e.result b/mysql-test/suite/funcs_1/r/innodb_trig_03e.result
index 51f4eca4..1cfb45fd 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_03e.result
@@ -606,7 +606,7 @@ trig 1_1-yes
revoke TRIGGER on *.* from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR, SHOW CREATE ROUTINE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
disconnect yes_privs;
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
select current_user;
@@ -659,7 +659,7 @@ root@localhost
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR, SHOW CREATE ROUTINE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
trigger privilege on db level for create:
@@ -930,7 +930,7 @@ grant TRIGGER on priv1_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, DELETE HISTORY ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, DELETE HISTORY, SHOW CREATE ROUTINE ON `priv1_db`.* TO `test_yesprivs`@`localhost`
GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
GRANT TRIGGER ON `priv1_db`.`t1` TO `test_yesprivs`@`localhost`
@@ -1353,7 +1353,7 @@ drop trigger trg1_0;
create definer=not_ex_user@localhost trigger trg1_0
before INSERT on t1 for each row
set new.f1 = 'trig 1_0-yes';
-ERROR 42000: Access denied; you need (at least one of) the SUPER, SET USER privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the SET USER privilege(s) for this operation
create definer=current_user trigger trg1_1
before INSERT on t1 for each row
set new.f1 = 'trig 1_1-yes';
@@ -1388,7 +1388,7 @@ GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`loca
create definer=not_ex_user@localhost trigger trg1_3
after UPDATE on t1 for each row
set @var1 = 'trig 1_3-yes';
-ERROR 42000: Access denied; you need (at least one of) the SUPER, SET USER privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the SET USER privilege(s) for this operation
connection default;
select current_user;
current_user
diff --git a/mysql-test/suite/funcs_1/r/innodb_views.result b/mysql-test/suite/funcs_1/r/innodb_views.result
index 5bd48cf9..1c3e5648 100644
--- a/mysql-test/suite/funcs_1/r/innodb_views.result
+++ b/mysql-test/suite/funcs_1/r/innodb_views.result
@@ -54,7 +54,7 @@ f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = innodb;
Warnings:
-Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt'
into table tb2;
DROP DATABASE IF EXISTS test1;
@@ -115,7 +115,7 @@ f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = innodb;
Warnings:
-Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt'
into table tb2;
USE test;
diff --git a/mysql-test/suite/funcs_1/r/is_cml_innodb.result b/mysql-test/suite/funcs_1/r/is_cml_innodb.result
index 38eaff54..4dce3e10 100644
--- a/mysql-test/suite/funcs_1/r/is_cml_innodb.result
+++ b/mysql-test/suite/funcs_1/r/is_cml_innodb.result
@@ -16,17 +16,17 @@ f11 LONGTEXT UNICODE
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
-def test t1 f1 1 NULL YES char 1 2 NULL NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references NEVER NULL
-def test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references NEVER NULL
-def test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references NEVER NULL
-def test t1 f2 2 NULL YES char 0 0 NULL NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references NEVER NULL
-def test t1 f3 3 NULL YES char 10 20 NULL NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references NEVER NULL
-def test t1 f5 4 NULL YES varchar 0 0 NULL NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references NEVER NULL
-def test t1 f6 5 NULL YES varchar 255 510 NULL NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references NEVER NULL
-def test t1 f7 6 NULL YES varchar 260 520 NULL NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references NEVER NULL
-def test t1 f8 7 NULL YES text 32767 65535 NULL NULL NULL ucs2 ucs2_general_ci text select,insert,update,references NEVER NULL
-def test t1 f9 8 NULL YES tinytext 127 255 NULL NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references NEVER NULL
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
+def test t1 f1 1 NULL YES char 1 2 NULL NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references NEVER NULL NO NO
+def test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references NEVER NULL NO NO
+def test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references NEVER NULL NO NO
+def test t1 f2 2 NULL YES char 0 0 NULL NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references NEVER NULL NO NO
+def test t1 f3 3 NULL YES char 10 20 NULL NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references NEVER NULL NO NO
+def test t1 f5 4 NULL YES varchar 0 0 NULL NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references NEVER NULL NO NO
+def test t1 f6 5 NULL YES varchar 255 510 NULL NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references NEVER NULL NO NO
+def test t1 f7 6 NULL YES varchar 260 520 NULL NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references NEVER NULL NO NO
+def test t1 f8 7 NULL YES text 32767 65535 NULL NULL NULL ucs2 ucs2_general_ci text select,insert,update,references NEVER NULL NO NO
+def test t1 f9 8 NULL YES tinytext 127 255 NULL NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references NEVER NULL NO NO
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_cml_memory.result b/mysql-test/suite/funcs_1/r/is_cml_memory.result
index 1f9b7d81..abb31f3e 100644
--- a/mysql-test/suite/funcs_1/r/is_cml_memory.result
+++ b/mysql-test/suite/funcs_1/r/is_cml_memory.result
@@ -13,13 +13,13 @@ f7 VARCHAR(260) UNICODE
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
-def test t1 f1 1 NULL YES char 1 2 NULL NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references NEVER NULL
-def test t1 f2 2 NULL YES char 0 0 NULL NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references NEVER NULL
-def test t1 f3 3 NULL YES char 10 20 NULL NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references NEVER NULL
-def test t1 f5 4 NULL YES varchar 0 0 NULL NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references NEVER NULL
-def test t1 f6 5 NULL YES varchar 255 510 NULL NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references NEVER NULL
-def test t1 f7 6 NULL YES varchar 260 520 NULL NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references NEVER NULL
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
+def test t1 f1 1 NULL YES char 1 2 NULL NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references NEVER NULL NO NO
+def test t1 f2 2 NULL YES char 0 0 NULL NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references NEVER NULL NO NO
+def test t1 f3 3 NULL YES char 10 20 NULL NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references NEVER NULL NO NO
+def test t1 f5 4 NULL YES varchar 0 0 NULL NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references NEVER NULL NO NO
+def test t1 f6 5 NULL YES varchar 255 510 NULL NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references NEVER NULL NO NO
+def test t1 f7 6 NULL YES varchar 260 520 NULL NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references NEVER NULL NO NO
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_cml_myisam.result b/mysql-test/suite/funcs_1/r/is_cml_myisam.result
index 3a6e3daa..6f3dce02 100644
--- a/mysql-test/suite/funcs_1/r/is_cml_myisam.result
+++ b/mysql-test/suite/funcs_1/r/is_cml_myisam.result
@@ -17,17 +17,17 @@ f11 LONGTEXT UNICODE
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
-def test t1 f1 1 NULL YES char 1 2 NULL NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references NEVER NULL
-def test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references NEVER NULL
-def test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references NEVER NULL
-def test t1 f2 2 NULL YES char 0 0 NULL NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references NEVER NULL
-def test t1 f3 3 NULL YES char 10 20 NULL NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references NEVER NULL
-def test t1 f5 4 NULL YES varchar 0 0 NULL NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references NEVER NULL
-def test t1 f6 5 NULL YES varchar 255 510 NULL NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references NEVER NULL
-def test t1 f7 6 NULL YES varchar 260 520 NULL NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references NEVER NULL
-def test t1 f8 7 NULL YES text 32767 65535 NULL NULL NULL ucs2 ucs2_general_ci text select,insert,update,references NEVER NULL
-def test t1 f9 8 NULL YES tinytext 127 255 NULL NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references NEVER NULL
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
+def test t1 f1 1 NULL YES char 1 2 NULL NULL NULL ucs2 ucs2_general_ci char(1) select,insert,update,references NEVER NULL NO NO
+def test t1 f10 9 NULL YES mediumtext 8388607 16777215 NULL NULL NULL ucs2 ucs2_general_ci mediumtext select,insert,update,references NEVER NULL NO NO
+def test t1 f11 10 NULL YES longtext 2147483647 4294967295 NULL NULL NULL ucs2 ucs2_general_ci longtext select,insert,update,references NEVER NULL NO NO
+def test t1 f2 2 NULL YES char 0 0 NULL NULL NULL ucs2 ucs2_general_ci char(0) select,insert,update,references NEVER NULL NO NO
+def test t1 f3 3 NULL YES char 10 20 NULL NULL NULL ucs2 ucs2_general_ci char(10) select,insert,update,references NEVER NULL NO NO
+def test t1 f5 4 NULL YES varchar 0 0 NULL NULL NULL ucs2 ucs2_general_ci varchar(0) select,insert,update,references NEVER NULL NO NO
+def test t1 f6 5 NULL YES varchar 255 510 NULL NULL NULL ucs2 ucs2_general_ci varchar(255) select,insert,update,references NEVER NULL NO NO
+def test t1 f7 6 NULL YES varchar 260 520 NULL NULL NULL ucs2 ucs2_general_ci varchar(260) select,insert,update,references NEVER NULL NO NO
+def test t1 f8 7 NULL YES text 32767 65535 NULL NULL NULL ucs2 ucs2_general_ci text select,insert,update,references NEVER NULL NO NO
+def test t1 f9 8 NULL YES tinytext 127 255 NULL NULL NULL ucs2 ucs2_general_ci tinytext select,insert,update,references NEVER NULL NO NO
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_collations.result b/mysql-test/suite/funcs_1/r/is_collations.result
index 979b477b..6007742a 100644
--- a/mysql-test/suite/funcs_1/r/is_collations.result
+++ b/mysql-test/suite/funcs_1/r/is_collations.result
@@ -66,7 +66,7 @@ INSERT INTO information_schema.collations
(collation_name,character_set_name,id,is_default,is_compiled,sortlen)
VALUES ( 'cp1251_bin', 'cp1251',50, '', '',0);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
-UPDATE information_schema.collations SET description = 'just updated';
+UPDATE information_schema.collations SET collation_name = 'just updated';
Got one of the listed errors
DELETE FROM information_schema.collations WHERE table_name = 't1';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
diff --git a/mysql-test/suite/funcs_1/r/is_column_privileges.result b/mysql-test/suite/funcs_1/r/is_column_privileges.result
index 3e64f217..6c001ee2 100644
--- a/mysql-test/suite/funcs_1/r/is_column_privileges.result
+++ b/mysql-test/suite/funcs_1/r/is_column_privileges.result
@@ -149,6 +149,7 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'testuser3'@'localhost' def db_datadict LOCK TABLES NO
'testuser3'@'localhost' def db_datadict REFERENCES NO
'testuser3'@'localhost' def db_datadict SELECT NO
+'testuser3'@'localhost' def db_datadict SHOW CREATE ROUTINE NO
'testuser3'@'localhost' def db_datadict SHOW VIEW NO
'testuser3'@'localhost' def db_datadict TRIGGER NO
'testuser3'@'localhost' def db_datadict UPDATE NO
diff --git a/mysql-test/suite/funcs_1/r/is_columns.result b/mysql-test/suite/funcs_1/r/is_columns.result
index 3d03a1d2..da251483 100644
--- a/mysql-test/suite/funcs_1/r/is_columns.result
+++ b/mysql-test/suite/funcs_1/r/is_columns.result
@@ -50,6 +50,8 @@ PRIVILEGES varchar(80) NO NULL
COLUMN_COMMENT varchar(1024) NO NULL
IS_GENERATED varchar(6) NO NULL
GENERATION_EXPRESSION longtext YES NULL
+IS_SYSTEM_TIME_PERIOD_START varchar(3) NO NULL
+IS_SYSTEM_TIME_PERIOD_END varchar(3) NO NULL
SHOW CREATE TABLE information_schema.COLUMNS;
Table Create Table
COLUMNS CREATE TEMPORARY TABLE `COLUMNS` (
@@ -74,7 +76,9 @@ COLUMNS CREATE TEMPORARY TABLE `COLUMNS` (
`PRIVILEGES` varchar(80) NOT NULL,
`COLUMN_COMMENT` varchar(1024) NOT NULL,
`IS_GENERATED` varchar(6) NOT NULL,
- `GENERATION_EXPRESSION` longtext
+ `GENERATION_EXPRESSION` longtext,
+ `IS_SYSTEM_TIME_PERIOD_START` varchar(3) NOT NULL,
+ `IS_SYSTEM_TIME_PERIOD_END` varchar(3) NOT NULL
) DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
SHOW COLUMNS FROM information_schema.COLUMNS;
Field Type Null Key Default Extra
@@ -100,6 +104,8 @@ PRIVILEGES varchar(80) NO NULL
COLUMN_COMMENT varchar(1024) NO NULL
IS_GENERATED varchar(6) NO NULL
GENERATION_EXPRESSION longtext YES NULL
+IS_SYSTEM_TIME_PERIOD_START varchar(3) NO NULL
+IS_SYSTEM_TIME_PERIOD_END varchar(3) NO NULL
SELECT table_catalog, table_schema, table_name, column_name
FROM information_schema.columns WHERE table_catalog IS NULL OR table_catalog <> 'def';
table_catalog table_schema table_name column_name
@@ -130,17 +136,17 @@ GRANT INSERT(f1, f2) ON db_datadict.t2 TO 'testuser2'@'localhost';
SELECT * FROM information_schema.columns
WHERE table_schema = 'db_datadict'
ORDER BY table_schema, table_name, ordinal_position;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
-def db_datadict t1 f1 1 NULL YES char 10 10 NULL NULL NULL latin1 latin1_swedish_ci char(10) MUL select,insert,update,references NEVER NULL
-def db_datadict t1 f2 2 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text select,insert,update,references NEVER NULL
-def db_datadict t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def db_datadict t1 f4 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) PRI auto_increment select,insert,update,references NEVER NULL
-def db_datadict t2 f1 1 NULL NO char 10 10 NULL NULL NULL latin1 latin1_swedish_ci char(10) PRI select,insert,update,references NEVER NULL
-def db_datadict t2 f2 2 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text select,insert,update,references NEVER NULL
-def db_datadict t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def db_datadict t2 f4 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) PRI select,insert,update,references NEVER NULL
-def db_datadict v1 f1 1 0 NO int NULL NULL 10 0 NULL NULL NULL int(1) select,insert,update,references NEVER NULL
-def db_datadict v1 f2 2 0 NO int NULL NULL 10 0 NULL NULL NULL int(1) select,insert,update,references NEVER NULL
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
+def db_datadict t1 f1 1 NULL YES char 10 10 NULL NULL NULL latin1 latin1_swedish_ci char(10) MUL select,insert,update,references NEVER NULL NO NO
+def db_datadict t1 f2 2 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text select,insert,update,references NEVER NULL NO NO
+def db_datadict t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def db_datadict t1 f4 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) PRI auto_increment select,insert,update,references NEVER NULL NO NO
+def db_datadict t2 f1 1 NULL NO char 10 10 NULL NULL NULL latin1 latin1_swedish_ci char(10) PRI select,insert,update,references NEVER NULL NO NO
+def db_datadict t2 f2 2 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text select,insert,update,references NEVER NULL NO NO
+def db_datadict t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def db_datadict t2 f4 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) PRI select,insert,update,references NEVER NULL NO NO
+def db_datadict v1 f1 1 0 NO int NULL NULL 10 0 NULL NULL NULL int(1) select,insert,update,references NEVER NULL NO NO
+def db_datadict v1 f2 2 0 NO int NULL NULL 10 0 NULL NULL NULL int(1) select,insert,update,references NEVER NULL NO NO
SHOW COLUMNS FROM db_datadict.t1;
Field Type Null Key Default Extra
f1 char(10) YES MUL NULL
@@ -161,10 +167,10 @@ connect testuser1, localhost, testuser1, , db_datadict;
SELECT * FROM information_schema.columns
WHERE table_schema = 'db_datadict'
ORDER BY table_schema, table_name, ordinal_position;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
-def db_datadict t1 f1 1 NULL YES char 10 10 NULL NULL NULL latin1 latin1_swedish_ci char(10) MUL select NEVER NULL
-def db_datadict t1 f2 2 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text select NEVER NULL
-def db_datadict v1 f2 2 0 NO int NULL NULL 10 0 NULL NULL NULL int(1) select NEVER NULL
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
+def db_datadict t1 f1 1 NULL YES char 10 10 NULL NULL NULL latin1 latin1_swedish_ci char(10) MUL select NEVER NULL NO NO
+def db_datadict t1 f2 2 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text select NEVER NULL NO NO
+def db_datadict v1 f2 2 0 NO int NULL NULL 10 0 NULL NULL NULL int(1) select NEVER NULL NO NO
SHOW COLUMNS FROM db_datadict.t1;
Field Type Null Key Default Extra
f1 char(10) YES MUL NULL
@@ -178,9 +184,9 @@ connect testuser2, localhost, testuser2, , db_datadict;
SELECT * FROM information_schema.columns
WHERE table_schema = 'db_datadict'
ORDER BY table_schema, table_name, ordinal_position;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
-def db_datadict t2 f1 1 NULL NO char 10 10 NULL NULL NULL latin1 latin1_swedish_ci char(10) PRI insert NEVER NULL
-def db_datadict t2 f2 2 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text insert NEVER NULL
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
+def db_datadict t2 f1 1 NULL NO char 10 10 NULL NULL NULL latin1 latin1_swedish_ci char(10) PRI insert NEVER NULL NO NO
+def db_datadict t2 f2 2 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text insert NEVER NULL NO NO
SHOW COLUMNS FROM db_datadict.t1;
ERROR 42000: SELECT command denied to user 'testuser2'@'localhost' for table `db_datadict`.`t1`
SHOW COLUMNS FROM db_datadict.t2;
@@ -231,6 +237,8 @@ PRIVILEGES select,insert,update,references
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
SELECT table_name FROM information_schema.columns
WHERE table_name LIKE 't1_my_table%';
table_name
@@ -439,6 +447,8 @@ PRIVILEGES select,insert,update,references
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
TABLE_CATALOG def
TABLE_SCHEMA test
TABLE_NAME t1_my_tablex
@@ -461,6 +471,8 @@ PRIVILEGES select,insert,update,references
COLUMN_COMMENT
IS_GENERATED NEVER
GENERATION_EXPRESSION NULL
+IS_SYSTEM_TIME_PERIOD_START NO
+IS_SYSTEM_TIME_PERIOD_END NO
DROP VIEW test.t1_my_tablex;
SELECT table_name FROM information_schema.columns
WHERE table_name = 't1_my_tablex';
diff --git a/mysql-test/suite/funcs_1/r/is_columns_innodb.result b/mysql-test/suite/funcs_1/r/is_columns_innodb.result
index beb8ad88..4f82a877 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_innodb.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_innodb.result
@@ -133,7 +133,7 @@ f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = innodb;
Warnings:
-Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt'
into table tb2;
drop table if exists tb3 ;
@@ -265,7 +265,7 @@ f240 varchar(2000),
f241 char(100)
) engine = innodb;
Warnings:
-Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb4.txt'
into table tb4;
USE test1;
@@ -324,7 +324,7 @@ f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = innodb;
Warnings:
-Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/innodb_tb2.txt'
into table tb2;
USE test;
@@ -368,333 +368,333 @@ LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' INTO TABLE t9;
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
-def test t1 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t1 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test t1 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t1 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t1 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t10 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t10 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t10 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test t10 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t10 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t10 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t11 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t11 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t11 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test t11 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t11 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t11 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t2 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t2 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test t2 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t2 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t2 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t3 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t3 f2 2 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t3 f3 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t4 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t4 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t4 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test t4 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t4 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t4 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t7 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t7 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t7 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test t7 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t8 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t8 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t8 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test t8 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t9 f1 1 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t9 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t9 f3 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test tb1 f1 1 NULL YES char 0 0 NULL NULL NULL latin1 latin1_swedish_ci char(0) select,insert,update,references NEVER NULL
-def test tb1 f10 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL NULL mediumblob select,insert,update,references NEVER NULL
-def test tb1 f11 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL
-def test tb1 f12 12 NULL YES binary 1 1 NULL NULL NULL NULL NULL binary(1) select,insert,update,references NEVER NULL
-def test tb1 f13 13 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(4) select,insert,update,references NEVER NULL
-def test tb1 f14 14 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned select,insert,update,references NEVER NULL
-def test tb1 f15 15 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f16 16 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f17 17 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(6) select,insert,update,references NEVER NULL
-def test tb1 f18 18 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned select,insert,update,references NEVER NULL
-def test tb1 f19 19 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f2 2 NULL YES char 0 0 NULL NULL NULL latin1 latin1_bin char(0) select,insert,update,references NEVER NULL
-def test tb1 f20 20 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f21 21 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) select,insert,update,references NEVER NULL
-def test tb1 f22 22 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL
-def test tb1 f23 23 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f24 24 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f25 25 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test tb1 f26 26 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
-def test tb1 f27 27 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f28 28 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f29 29 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def test tb1 f3 3 NULL YES char 0 0 NULL NULL NULL latin1 latin1_swedish_ci char(0) select,insert,update,references NEVER NULL
-def test tb1 f30 30 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def test tb1 f31 31 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f32 32 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f33 33 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb1 f34 34 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb1 f35 35 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f36 36 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f37 37 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb1 f38 38 10 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL
-def test tb1 f39 39 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb1 f4 4 NULL YES tinytext 255 255 NULL NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NEVER NULL
-def test tb1 f40 40 10 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL
-def test tb1 f41 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f42 42 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f43 43 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f44 44 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f45 45 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb1 f46 46 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL
-def test tb1 f47 47 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb1 f48 48 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL
-def test tb1 f49 49 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f5 5 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text select,insert,update,references NEVER NULL
-def test tb1 f50 50 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f51 51 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f52 52 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f53 53 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb1 f54 54 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb1 f55 55 0000000099 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f56 56 0000000099 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f57 57 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb1 f58 58 99 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL
-def test tb1 f6 6 NULL YES mediumtext 16777215 16777215 NULL NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references NEVER NULL
-def test tb1 f7 7 NULL YES longtext 4294967295 4294967295 NULL NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references NEVER NULL
-def test tb1 f8 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL NULL tinyblob select,insert,update,references NEVER NULL
-def test tb1 f9 9 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob select,insert,update,references NEVER NULL
-def test tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f101 43 '2000-01-01' NO date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test tb2 f102 44 '00:00:20' NO time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL
-def test tb2 f103 45 '0002-02-02 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL
-def test tb2 f104 46 '2000-12-31 23:59:59' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL
-def test tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test tb2 f108 50 '1enum' NO enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL
-def test tb2 f109 51 '1set' NO set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL
-def test tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL
-def test tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL
-def test tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL
-def test tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f118 1 'a' NO char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references NEVER NULL
-def test tb3 f119 2 '' NO char 1 1 NULL NULL NULL latin1 latin1_bin char(1) select,insert,update,references NEVER NULL
-def test tb3 f120 3 '' NO char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references NEVER NULL
-def test tb3 f121 4 NULL YES tinytext 255 255 NULL NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NEVER NULL
-def test tb3 f122 5 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text select,insert,update,references NEVER NULL
-def test tb3 f123 6 NULL YES mediumtext 16777215 16777215 NULL NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references NEVER NULL
-def test tb3 f124 7 NULL YES longtext 4294967295 4294967295 NULL NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references NEVER NULL
-def test tb3 f125 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL NULL tinyblob select,insert,update,references NEVER NULL
-def test tb3 f126 9 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob select,insert,update,references NEVER NULL
-def test tb3 f127 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL NULL mediumblob select,insert,update,references NEVER NULL
-def test tb3 f128 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL
-def test tb3 f129 12 '' NO binary 1 1 NULL NULL NULL NULL NULL binary(1) select,insert,update,references NEVER NULL
-def test tb3 f130 13 99 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(4) select,insert,update,references NEVER NULL
-def test tb3 f131 14 99 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned select,insert,update,references NEVER NULL
-def test tb3 f132 15 099 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f133 16 099 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f134 17 999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(6) select,insert,update,references NEVER NULL
-def test tb3 f135 18 999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned select,insert,update,references NEVER NULL
-def test tb3 f136 19 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f137 20 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f138 21 9999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) select,insert,update,references NEVER NULL
-def test tb3 f139 22 9999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL
-def test tb3 f140 23 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f141 24 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f142 25 99999 NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test tb3 f143 26 99999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
-def test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f145 28 0000099999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f146 29 999999 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def test tb3 f147 30 999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f150 33 1000 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb3 f151 34 999 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb3 f152 35 0000001000 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f153 36 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f154 37 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb3 f155 38 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL
-def test tb3 f156 39 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb3 f157 40 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL
-def test tb3 f158 41 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f159 42 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f160 43 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f161 44 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f162 45 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb3 f163 46 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL
-def test tb3 f164 47 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb3 f165 48 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL
-def test tb3 f166 49 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f167 50 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f168 51 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f169 52 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f170 53 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb3 f171 54 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb3 f172 55 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f173 56 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f174 57 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb3 f175 58 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL
-def test tb4 f176 1 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb4 f177 2 9 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL
-def test tb4 f178 3 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f179 4 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f180 5 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f181 6 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f182 7 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb4 f183 8 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL
-def test tb4 f184 9 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb4 f185 10 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL
-def test tb4 f186 11 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f187 12 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f188 13 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f189 14 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f190 15 88.8 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test tb4 f191 16 88.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test tb4 f192 17 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f193 18 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f194 19 55.5 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test tb4 f195 20 55.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test tb4 f196 21 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f197 22 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f198 23 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb4 f199 24 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb4 f200 25 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f201 26 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f202 27 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb4 f203 28 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb4 f204 29 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb4 f205 30 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb4 f206 31 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f207 32 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f208 33 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f209 34 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f210 35 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb4 f211 36 NULL YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test tb4 f212 37 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb4 f213 38 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test tb4 f214 39 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f215 40 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f216 41 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test tb4 f219 44 NULL YES time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL
-def test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL
-def test tb4 f221 46 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL
-def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test tb4 f225 50 NULL YES enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL
-def test tb4 f226 51 NULL YES set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL
-def test tb4 f235 52 NULL YES char 0 0 NULL NULL NULL latin1 latin1_swedish_ci char(0) select,insert,update,references NEVER NULL
-def test tb4 f236 53 NULL YES char 90 90 NULL NULL NULL latin1 latin1_swedish_ci char(90) select,insert,update,references NEVER NULL
-def test tb4 f237 54 NULL YES char 255 255 NULL NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references NEVER NULL
-def test tb4 f238 55 NULL YES varchar 0 0 NULL NULL NULL latin1 latin1_swedish_ci varchar(0) select,insert,update,references NEVER NULL
-def test tb4 f239 56 NULL YES varchar 20000 20000 NULL NULL NULL latin1 latin1_bin varchar(20000) select,insert,update,references NEVER NULL
-def test tb4 f240 57 NULL YES varchar 2000 2000 NULL NULL NULL latin1 latin1_swedish_ci varchar(2000) select,insert,update,references NEVER NULL
-def test tb4 f241 58 NULL YES char 100 100 NULL NULL NULL latin1 latin1_swedish_ci char(100) select,insert,update,references NEVER NULL
-def test1 tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f101 43 '2000-01-01' NO date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test1 tb2 f102 44 '00:00:20' NO time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL
-def test1 tb2 f103 45 '0002-02-02 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL
-def test1 tb2 f104 46 '2000-12-31 23:59:59' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL
-def test1 tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test1 tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test1 tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test1 tb2 f108 50 '1enum' NO enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL
-def test1 tb2 f109 51 '1set' NO set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL
-def test1 tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test1 tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL
-def test1 tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test1 tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test1 tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test1 tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test1 tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test1 tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test1 tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test1 tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test4 t6 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test4 t6 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test4 t6 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test4 t6 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test4 t6 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test4 t6 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
+def test t1 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t1 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test t1 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t1 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t1 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t10 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t10 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t10 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test t10 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t10 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t10 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t11 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t11 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t11 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test t11 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t11 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t11 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t2 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t2 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test t2 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t2 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t2 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t3 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t3 f2 2 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t3 f3 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t4 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t4 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t4 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test t4 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t4 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t4 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t7 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t7 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t7 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test t7 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t8 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t8 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t8 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test t8 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t9 f1 1 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t9 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t9 f3 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test tb1 f1 1 NULL YES char 0 0 NULL NULL NULL latin1 latin1_swedish_ci char(0) select,insert,update,references NEVER NULL NO NO
+def test tb1 f10 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL NULL mediumblob select,insert,update,references NEVER NULL NO NO
+def test tb1 f11 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL NO NO
+def test tb1 f12 12 NULL YES binary 1 1 NULL NULL NULL NULL NULL binary(1) select,insert,update,references NEVER NULL NO NO
+def test tb1 f13 13 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(4) select,insert,update,references NEVER NULL NO NO
+def test tb1 f14 14 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f15 15 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f16 16 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f17 17 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(6) select,insert,update,references NEVER NULL NO NO
+def test tb1 f18 18 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f19 19 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f2 2 NULL YES char 0 0 NULL NULL NULL latin1 latin1_bin char(0) select,insert,update,references NEVER NULL NO NO
+def test tb1 f20 20 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f21 21 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) select,insert,update,references NEVER NULL NO NO
+def test tb1 f22 22 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f23 23 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f24 24 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f25 25 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test tb1 f26 26 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f27 27 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f28 28 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f29 29 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL NO NO
+def test tb1 f3 3 NULL YES char 0 0 NULL NULL NULL latin1 latin1_swedish_ci char(0) select,insert,update,references NEVER NULL NO NO
+def test tb1 f30 30 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f31 31 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f32 32 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f33 33 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb1 f34 34 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f35 35 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f36 36 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f37 37 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb1 f38 38 10 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL NO NO
+def test tb1 f39 39 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f4 4 NULL YES tinytext 255 255 NULL NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NEVER NULL NO NO
+def test tb1 f40 40 10 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f41 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f42 42 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f43 43 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f44 44 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f45 45 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb1 f46 46 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL NO NO
+def test tb1 f47 47 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f48 48 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f49 49 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f5 5 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text select,insert,update,references NEVER NULL NO NO
+def test tb1 f50 50 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f51 51 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f52 52 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f53 53 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb1 f54 54 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f55 55 0000000099 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f56 56 0000000099 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f57 57 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb1 f58 58 99 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL NO NO
+def test tb1 f6 6 NULL YES mediumtext 16777215 16777215 NULL NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references NEVER NULL NO NO
+def test tb1 f7 7 NULL YES longtext 4294967295 4294967295 NULL NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references NEVER NULL NO NO
+def test tb1 f8 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL NULL tinyblob select,insert,update,references NEVER NULL NO NO
+def test tb1 f9 9 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob select,insert,update,references NEVER NULL NO NO
+def test tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f101 43 '2000-01-01' NO date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test tb2 f102 44 '00:00:20' NO time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL NO NO
+def test tb2 f103 45 '0002-02-02 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL NO NO
+def test tb2 f104 46 '2000-12-31 23:59:59' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL NO NO
+def test tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test tb2 f108 50 '1enum' NO enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL NO NO
+def test tb2 f109 51 '1set' NO set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL NO NO
+def test tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL NO NO
+def test tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f118 1 'a' NO char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references NEVER NULL NO NO
+def test tb3 f119 2 '' NO char 1 1 NULL NULL NULL latin1 latin1_bin char(1) select,insert,update,references NEVER NULL NO NO
+def test tb3 f120 3 '' NO char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references NEVER NULL NO NO
+def test tb3 f121 4 NULL YES tinytext 255 255 NULL NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NEVER NULL NO NO
+def test tb3 f122 5 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text select,insert,update,references NEVER NULL NO NO
+def test tb3 f123 6 NULL YES mediumtext 16777215 16777215 NULL NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references NEVER NULL NO NO
+def test tb3 f124 7 NULL YES longtext 4294967295 4294967295 NULL NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references NEVER NULL NO NO
+def test tb3 f125 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL NULL tinyblob select,insert,update,references NEVER NULL NO NO
+def test tb3 f126 9 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob select,insert,update,references NEVER NULL NO NO
+def test tb3 f127 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL NULL mediumblob select,insert,update,references NEVER NULL NO NO
+def test tb3 f128 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL NO NO
+def test tb3 f129 12 '' NO binary 1 1 NULL NULL NULL NULL NULL binary(1) select,insert,update,references NEVER NULL NO NO
+def test tb3 f130 13 99 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(4) select,insert,update,references NEVER NULL NO NO
+def test tb3 f131 14 99 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f132 15 099 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f133 16 099 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f134 17 999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(6) select,insert,update,references NEVER NULL NO NO
+def test tb3 f135 18 999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f136 19 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f137 20 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f138 21 9999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) select,insert,update,references NEVER NULL NO NO
+def test tb3 f139 22 9999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f140 23 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f141 24 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f142 25 99999 NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test tb3 f143 26 99999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f145 28 0000099999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f146 29 999999 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL NO NO
+def test tb3 f147 30 999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f150 33 1000 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb3 f151 34 999 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f152 35 0000001000 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f153 36 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f154 37 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb3 f155 38 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL NO NO
+def test tb3 f156 39 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f157 40 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f158 41 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f159 42 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f160 43 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f161 44 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f162 45 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb3 f163 46 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL NO NO
+def test tb3 f164 47 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f165 48 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f166 49 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f167 50 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f168 51 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f169 52 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f170 53 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb3 f171 54 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f172 55 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f173 56 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f174 57 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb3 f175 58 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL NO NO
+def test tb4 f176 1 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f177 2 9 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f178 3 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f179 4 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f180 5 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f181 6 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f182 7 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb4 f183 8 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL NO NO
+def test tb4 f184 9 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f185 10 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f186 11 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f187 12 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f188 13 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f189 14 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f190 15 88.8 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test tb4 f191 16 88.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f192 17 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f193 18 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f194 19 55.5 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test tb4 f195 20 55.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f196 21 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f197 22 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f198 23 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb4 f199 24 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f200 25 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f201 26 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f202 27 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb4 f203 28 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb4 f204 29 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f205 30 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f206 31 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f207 32 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f208 33 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f209 34 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f210 35 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb4 f211 36 NULL YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test tb4 f212 37 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f213 38 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f214 39 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f215 40 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f216 41 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test tb4 f219 44 NULL YES time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL NO NO
+def test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL NO NO
+def test tb4 f221 46 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL NO NO
+def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test tb4 f225 50 NULL YES enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL NO NO
+def test tb4 f226 51 NULL YES set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL NO NO
+def test tb4 f235 52 NULL YES char 0 0 NULL NULL NULL latin1 latin1_swedish_ci char(0) select,insert,update,references NEVER NULL NO NO
+def test tb4 f236 53 NULL YES char 90 90 NULL NULL NULL latin1 latin1_swedish_ci char(90) select,insert,update,references NEVER NULL NO NO
+def test tb4 f237 54 NULL YES char 255 255 NULL NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references NEVER NULL NO NO
+def test tb4 f238 55 NULL YES varchar 0 0 NULL NULL NULL latin1 latin1_swedish_ci varchar(0) select,insert,update,references NEVER NULL NO NO
+def test tb4 f239 56 NULL YES varchar 20000 20000 NULL NULL NULL latin1 latin1_bin varchar(20000) select,insert,update,references NEVER NULL NO NO
+def test tb4 f240 57 NULL YES varchar 2000 2000 NULL NULL NULL latin1 latin1_swedish_ci varchar(2000) select,insert,update,references NEVER NULL NO NO
+def test tb4 f241 58 NULL YES char 100 100 NULL NULL NULL latin1 latin1_swedish_ci char(100) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f101 43 '2000-01-01' NO date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f102 44 '00:00:20' NO time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f103 45 '0002-02-02 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f104 46 '2000-12-31 23:59:59' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f108 50 '1enum' NO enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f109 51 '1set' NO set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test4 t6 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test4 t6 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test4 t6 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test4 t6 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test4 t6 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test4 t6 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is.result b/mysql-test/suite/funcs_1/r/is_columns_is.result
index be9d2b4c..1b97125b 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result
@@ -2,495 +2,524 @@ SELECT * FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name <> 'profiling' AND table_name not like 'innodb_%'
ORDER BY table_schema, table_name, column_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
-def information_schema ALL_PLUGINS LOAD_OPTION 11 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_AUTH_VERSION 13 NULL YES varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_LICENSE 10 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_MATURITY 12 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) select NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_STATUS 3 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_TYPE 4 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_TYPE_VERSION 5 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_VERSION 2 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL
-def information_schema APPLICABLE_ROLES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) select NEVER NULL
-def information_schema APPLICABLE_ROLES IS_DEFAULT 4 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL
-def information_schema APPLICABLE_ROLES IS_GRANTABLE 3 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL
-def information_schema APPLICABLE_ROLES ROLE_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select NEVER NULL
-def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL
-def information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema CHARACTER_SETS DESCRIPTION 3 NULL NO varchar 60 180 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(60) select NEVER NULL
-def information_schema CHARACTER_SETS MAXLEN 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) select NEVER NULL
-def information_schema CHECK_CONSTRAINTS CHECK_CLAUSE 6 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL
-def information_schema CHECK_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema CHECK_CONSTRAINTS LEVEL 5 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) select NEVER NULL
-def information_schema CHECK_CONSTRAINTS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema CLIENT_STATISTICS ACCESS_DENIED 22 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema CLIENT_STATISTICS BINLOG_BYTES_WRITTEN 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema CLIENT_STATISTICS BUSY_TIME 5 NULL NO double NULL NULL 21 NULL NULL NULL NULL double select NEVER NULL
-def information_schema CLIENT_STATISTICS BYTES_RECEIVED 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema CLIENT_STATISTICS BYTES_SENT 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema CLIENT_STATISTICS CLIENT 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema CLIENT_STATISTICS COMMIT_TRANSACTIONS 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema CLIENT_STATISTICS CONCURRENT_CONNECTIONS 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema CLIENT_STATISTICS CONNECTED_TIME 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema CLIENT_STATISTICS CPU_TIME 6 NULL NO double NULL NULL 21 NULL NULL NULL NULL double select NEVER NULL
-def information_schema CLIENT_STATISTICS DENIED_CONNECTIONS 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema CLIENT_STATISTICS EMPTY_QUERIES 23 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema CLIENT_STATISTICS LOST_CONNECTIONS 21 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema CLIENT_STATISTICS MAX_STATEMENT_TIME_EXCEEDED 25 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema CLIENT_STATISTICS OTHER_COMMANDS 17 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema CLIENT_STATISTICS ROLLBACK_TRANSACTIONS 19 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema CLIENT_STATISTICS ROWS_DELETED 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema CLIENT_STATISTICS ROWS_INSERTED 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema CLIENT_STATISTICS ROWS_READ 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema CLIENT_STATISTICS ROWS_SENT 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema CLIENT_STATISTICS ROWS_UPDATED 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema CLIENT_STATISTICS SELECT_COMMANDS 15 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema CLIENT_STATISTICS TOTAL_CONNECTIONS 2 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema CLIENT_STATISTICS TOTAL_SSL_CONNECTIONS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema CLIENT_STATISTICS UPDATE_COMMANDS 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema COLLATIONS CHARACTER_SET_NAME 2 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL
-def information_schema COLLATIONS COLLATION_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema COLLATIONS ID 3 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(11) select NEVER NULL
-def information_schema COLLATIONS IS_COMPILED 5 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL
-def information_schema COLLATIONS IS_DEFAULT 4 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL
-def information_schema COLLATIONS SORTLEN 6 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) select NEVER NULL
-def information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL
-def information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema COLLATION_CHARACTER_SET_APPLICABILITY FULL_COLLATION_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema COLLATION_CHARACTER_SET_APPLICABILITY ID 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(11) select NEVER NULL
-def information_schema COLLATION_CHARACTER_SET_APPLICABILITY IS_DEFAULT 5 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL
-def information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema COLUMNS CHARACTER_SET_NAME 14 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL
-def information_schema COLUMNS COLLATION_NAME 15 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema COLUMNS COLUMN_COMMENT 20 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select NEVER NULL
-def information_schema COLUMNS COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL
-def information_schema COLUMNS COLUMN_KEY 17 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL
-def information_schema COLUMNS COLUMN_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema COLUMNS COLUMN_TYPE 16 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL
-def information_schema COLUMNS DATA_TYPE 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema COLUMNS DATETIME_PRECISION 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema COLUMNS EXTRA 18 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL
-def information_schema COLUMNS GENERATION_EXPRESSION 22 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL
-def information_schema COLUMNS IS_GENERATED 21 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) select NEVER NULL
-def information_schema COLUMNS IS_NULLABLE 7 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL
-def information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema COLUMNS ORDINAL_POSITION 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema COLUMNS PRIVILEGES 19 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL
-def information_schema COLUMNS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema COLUMNS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema COLUMNS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema COLUMN_PRIVILEGES COLUMN_NAME 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema COLUMN_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) select NEVER NULL
-def information_schema COLUMN_PRIVILEGES IS_GRANTABLE 7 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL
-def information_schema COLUMN_PRIVILEGES PRIVILEGE_TYPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema COLUMN_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema COLUMN_PRIVILEGES TABLE_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema COLUMN_PRIVILEGES TABLE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema ENABLED_ROLES ROLE_NAME 1 NULL YES varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select NEVER NULL
-def information_schema ENGINES COMMENT 3 NULL NO varchar 160 480 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(160) select NEVER NULL
-def information_schema ENGINES ENGINE 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema ENGINES SAVEPOINTS 6 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL
-def information_schema ENGINES SUPPORT 2 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) select NEVER NULL
-def information_schema ENGINES TRANSACTIONS 4 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL
-def information_schema ENGINES XA 5 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL
-def information_schema EVENTS CHARACTER_SET_CLIENT 22 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL
-def information_schema EVENTS COLLATION_CONNECTION 23 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema EVENTS CREATED 17 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL
-def information_schema EVENTS DATABASE_COLLATION 24 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema EVENTS DEFINER 4 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) select NEVER NULL
-def information_schema EVENTS ENDS 14 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL
-def information_schema EVENTS EVENT_BODY 6 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) select NEVER NULL
-def information_schema EVENTS EVENT_CATALOG 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema EVENTS EVENT_COMMENT 20 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema EVENTS EVENT_DEFINITION 7 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL
-def information_schema EVENTS EVENT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema EVENTS EVENT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema EVENTS EVENT_TYPE 8 NULL NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) select NEVER NULL
-def information_schema EVENTS EXECUTE_AT 9 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL
-def information_schema EVENTS INTERVAL_FIELD 11 NULL YES varchar 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(18) select NEVER NULL
-def information_schema EVENTS INTERVAL_VALUE 10 NULL YES varchar 256 768 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(256) select NEVER NULL
-def information_schema EVENTS LAST_ALTERED 18 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL
-def information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL
-def information_schema EVENTS ON_COMPLETION 16 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) select NEVER NULL
-def information_schema EVENTS ORIGINATOR 21 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) select NEVER NULL
-def information_schema EVENTS SQL_MODE 12 NULL NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) select NEVER NULL
-def information_schema EVENTS STARTS 13 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL
-def information_schema EVENTS STATUS 15 NULL NO varchar 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(18) select NEVER NULL
-def information_schema EVENTS TIME_ZONE 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema FILES AUTOEXTEND_SIZE 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema FILES AVG_ROW_LENGTH 28 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema FILES CHECK_TIME 35 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL
-def information_schema FILES CREATE_TIME 33 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL
-def information_schema FILES CREATION_TIME 20 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL
-def information_schema FILES DATA_FREE 32 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema FILES DATA_LENGTH 29 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema FILES DELETED_ROWS 12 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL
-def information_schema FILES ENGINE 10 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema FILES EXTENT_SIZE 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL
-def information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(255) select NEVER NULL
-def information_schema FILES FILE_ID 1 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL
-def information_schema FILES FILE_NAME 2 NULL YES varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema FILES FILE_TYPE 3 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL
-def information_schema FILES FREE_EXTENTS 14 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL
-def information_schema FILES FULLTEXT_KEYS 11 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema FILES INDEX_LENGTH 31 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema FILES INITIAL_SIZE 17 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema FILES LAST_ACCESS_TIME 22 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL
-def information_schema FILES LAST_UPDATE_TIME 21 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL
-def information_schema FILES LOGFILE_GROUP_NAME 8 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema FILES LOGFILE_GROUP_NUMBER 9 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL
-def information_schema FILES MAXIMUM_SIZE 18 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema FILES MAX_DATA_LENGTH 30 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema FILES RECOVER_TIME 23 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL
-def information_schema FILES ROW_FORMAT 26 NULL YES varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) select NEVER NULL
-def information_schema FILES STATUS 37 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL
-def information_schema FILES TABLESPACE_NAME 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema FILES TABLE_CATALOG 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema FILES TABLE_NAME 7 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema FILES TABLE_ROWS 27 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema FILES TABLE_SCHEMA 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema FILES TOTAL_EXTENTS 15 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL
-def information_schema FILES TRANSACTION_COUNTER 24 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL
-def information_schema FILES UPDATE_COUNT 13 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL
-def information_schema FILES UPDATE_TIME 34 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL
-def information_schema FILES VERSION 25 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema GEOMETRY_COLUMNS COORD_DIMENSION 11 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select NEVER NULL
-def information_schema GEOMETRY_COLUMNS F_GEOMETRY_COLUMN 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema GEOMETRY_COLUMNS F_TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema GEOMETRY_COLUMNS F_TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema GEOMETRY_COLUMNS F_TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema GEOMETRY_COLUMNS GEOMETRY_TYPE 10 NULL NO int NULL NULL 10 0 NULL NULL NULL int(7) select NEVER NULL
-def information_schema GEOMETRY_COLUMNS G_GEOMETRY_COLUMN 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema GEOMETRY_COLUMNS G_TABLE_CATALOG 5 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema GEOMETRY_COLUMNS G_TABLE_NAME 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema GEOMETRY_COLUMNS G_TABLE_SCHEMA 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema GEOMETRY_COLUMNS MAX_PPR 12 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select NEVER NULL
-def information_schema GEOMETRY_COLUMNS SRID 13 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) select NEVER NULL
-def information_schema GEOMETRY_COLUMNS STORAGE_TYPE 9 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select NEVER NULL
-def information_schema GLOBAL_STATUS VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL NO varchar 4096 12288 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(4096) select NEVER NULL
-def information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL NO varchar 4096 12288 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(4096) select NEVER NULL
-def information_schema INDEX_STATISTICS INDEX_NAME 3 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL
-def information_schema INDEX_STATISTICS ROWS_READ 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema INDEX_STATISTICS TABLE_NAME 2 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL
-def information_schema INDEX_STATISTICS TABLE_SCHEMA 1 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL
-def information_schema KEYWORDS WORD 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema KEY_CACHES BLOCK_SIZE 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema KEY_CACHES DIRTY_BLOCKS 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema KEY_CACHES FULL_SIZE 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema KEY_CACHES KEY_CACHE_NAME 1 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL
-def information_schema KEY_CACHES READS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema KEY_CACHES READ_REQUESTS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema KEY_CACHES SEGMENTS 2 NULL YES int NULL NULL 10 0 NULL NULL NULL int(3) unsigned select NEVER NULL
-def information_schema KEY_CACHES SEGMENT_NUMBER 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(3) unsigned select NEVER NULL
-def information_schema KEY_CACHES UNUSED_BLOCKS 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema KEY_CACHES USED_BLOCKS 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema KEY_CACHES WRITES 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema KEY_CACHES WRITE_REQUESTS 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema KEY_COLUMN_USAGE COLUMN_NAME 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema KEY_COLUMN_USAGE ORDINAL_POSITION 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) select NEVER NULL
-def information_schema KEY_COLUMN_USAGE POSITION_IN_UNIQUE_CONSTRAINT 9 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(10) select NEVER NULL
-def information_schema KEY_COLUMN_USAGE REFERENCED_COLUMN_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_NAME 11 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA 10 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema KEY_COLUMN_USAGE TABLE_NAME 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema KEY_COLUMN_USAGE TABLE_SCHEMA 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema OPTIMIZER_TRACE INSUFFICIENT_PRIVILEGES 4 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) select NEVER NULL
-def information_schema OPTIMIZER_TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(20) select NEVER NULL
-def information_schema OPTIMIZER_TRACE QUERY 1 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL
-def information_schema OPTIMIZER_TRACE TRACE 2 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL
-def information_schema PARAMETERS CHARACTER_MAXIMUM_LENGTH 8 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL
-def information_schema PARAMETERS CHARACTER_OCTET_LENGTH 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL
-def information_schema PARAMETERS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema PARAMETERS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema PARAMETERS DATA_TYPE 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema PARAMETERS DATETIME_PRECISION 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema PARAMETERS DTD_IDENTIFIER 15 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL
-def information_schema PARAMETERS NUMERIC_PRECISION 10 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL
-def information_schema PARAMETERS NUMERIC_SCALE 11 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL
-def information_schema PARAMETERS ORDINAL_POSITION 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL
-def information_schema PARAMETERS PARAMETER_MODE 5 NULL YES varchar 5 15 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(5) select NEVER NULL
-def information_schema PARAMETERS PARAMETER_NAME 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema PARAMETERS ROUTINE_TYPE 16 NULL NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) select NEVER NULL
-def information_schema PARAMETERS SPECIFIC_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema PARAMETERS SPECIFIC_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema PARAMETERS SPECIFIC_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema PARTITIONS AVG_ROW_LENGTH 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema PARTITIONS CHECKSUM 22 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema PARTITIONS CHECK_TIME 21 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL
-def information_schema PARTITIONS CREATE_TIME 19 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL
-def information_schema PARTITIONS DATA_FREE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema PARTITIONS DATA_LENGTH 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema PARTITIONS INDEX_LENGTH 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema PARTITIONS MAX_DATA_LENGTH 16 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema PARTITIONS NODEGROUP 24 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) select NEVER NULL
-def information_schema PARTITIONS PARTITION_COMMENT 23 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL
-def information_schema PARTITIONS PARTITION_DESCRIPTION 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL
-def information_schema PARTITIONS PARTITION_EXPRESSION 10 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL
-def information_schema PARTITIONS PARTITION_METHOD 8 NULL YES varchar 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(18) select NEVER NULL
-def information_schema PARTITIONS PARTITION_NAME 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema PARTITIONS PARTITION_ORDINAL_POSITION 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema PARTITIONS SUBPARTITION_EXPRESSION 11 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL
-def information_schema PARTITIONS SUBPARTITION_METHOD 9 NULL YES varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) select NEVER NULL
-def information_schema PARTITIONS SUBPARTITION_NAME 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema PARTITIONS SUBPARTITION_ORDINAL_POSITION 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema PARTITIONS TABLESPACE_NAME 25 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema PARTITIONS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema PARTITIONS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema PARTITIONS TABLE_ROWS 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema PARTITIONS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema PARTITIONS UPDATE_TIME 20 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL
-def information_schema PLUGINS LOAD_OPTION 11 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema PLUGINS PLUGIN_AUTH_VERSION 13 NULL YES varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL
-def information_schema PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL
-def information_schema PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL
-def information_schema PLUGINS PLUGIN_LICENSE 10 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL
-def information_schema PLUGINS PLUGIN_MATURITY 12 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) select NEVER NULL
-def information_schema PLUGINS PLUGIN_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema PLUGINS PLUGIN_STATUS 3 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select NEVER NULL
-def information_schema PLUGINS PLUGIN_TYPE 4 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL
-def information_schema PLUGINS PLUGIN_TYPE_VERSION 5 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL
-def information_schema PLUGINS PLUGIN_VERSION 2 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL
-def information_schema PROCESSLIST COMMAND 5 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select NEVER NULL
-def information_schema PROCESSLIST DB 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema PROCESSLIST EXAMINED_ROWS 15 NULL NO int NULL NULL 10 0 NULL NULL NULL int(7) select NEVER NULL
-def information_schema PROCESSLIST HOST 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema PROCESSLIST ID 1 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL
-def information_schema PROCESSLIST INFO 8 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL
-def information_schema PROCESSLIST INFO_BINARY 17 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob select NEVER NULL
-def information_schema PROCESSLIST MAX_MEMORY_USED 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(7) select NEVER NULL
-def information_schema PROCESSLIST MAX_STAGE 11 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select NEVER NULL
-def information_schema PROCESSLIST MEMORY_USED 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(7) select NEVER NULL
-def information_schema PROCESSLIST PROGRESS 12 NULL NO decimal NULL NULL 7 3 NULL NULL NULL decimal(7,3) select NEVER NULL
-def information_schema PROCESSLIST QUERY_ID 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL
-def information_schema PROCESSLIST STAGE 10 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select NEVER NULL
-def information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema PROCESSLIST TID 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL
-def information_schema PROCESSLIST TIME 6 NULL NO int NULL NULL 10 0 NULL NULL NULL int(7) select NEVER NULL
-def information_schema PROCESSLIST TIME_MS 9 NULL NO decimal NULL NULL 22 3 NULL NULL NULL decimal(22,3) select NEVER NULL
-def information_schema PROCESSLIST USER 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select NEVER NULL
-def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema REFERENTIAL_CONSTRAINTS DELETE_RULE 9 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema REFERENTIAL_CONSTRAINTS MATCH_OPTION 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema REFERENTIAL_CONSTRAINTS REFERENCED_TABLE_NAME 11 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema REFERENTIAL_CONSTRAINTS TABLE_NAME 10 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_CATALOG 4 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_NAME 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_SCHEMA 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema REFERENTIAL_CONSTRAINTS UPDATE_RULE 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema ROUTINES CHARACTER_MAXIMUM_LENGTH 7 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL
-def information_schema ROUTINES CHARACTER_OCTET_LENGTH 8 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL
-def information_schema ROUTINES CHARACTER_SET_CLIENT 29 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL
-def information_schema ROUTINES CHARACTER_SET_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema ROUTINES COLLATION_CONNECTION 30 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema ROUTINES COLLATION_NAME 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema ROUTINES CREATED 24 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL
-def information_schema ROUTINES DATABASE_COLLATION 31 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema ROUTINES DATA_TYPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema ROUTINES DATETIME_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema ROUTINES DEFINER 28 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) select NEVER NULL
-def information_schema ROUTINES DTD_IDENTIFIER 14 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL
-def information_schema ROUTINES EXTERNAL_LANGUAGE 18 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema ROUTINES EXTERNAL_NAME 17 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema ROUTINES IS_DETERMINISTIC 20 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL
-def information_schema ROUTINES LAST_ALTERED 25 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL
-def information_schema ROUTINES NUMERIC_PRECISION 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL
-def information_schema ROUTINES NUMERIC_SCALE 10 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL
-def information_schema ROUTINES PARAMETER_STYLE 19 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) select NEVER NULL
-def information_schema ROUTINES ROUTINE_BODY 15 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) select NEVER NULL
-def information_schema ROUTINES ROUTINE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema ROUTINES ROUTINE_COMMENT 27 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL
-def information_schema ROUTINES ROUTINE_DEFINITION 16 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL
-def information_schema ROUTINES ROUTINE_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema ROUTINES ROUTINE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema ROUTINES ROUTINE_TYPE 5 NULL NO varchar 13 39 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(13) select NEVER NULL
-def information_schema ROUTINES SECURITY_TYPE 23 NULL NO varchar 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(7) select NEVER NULL
-def information_schema ROUTINES SPECIFIC_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema ROUTINES SQL_DATA_ACCESS 21 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema ROUTINES SQL_MODE 26 NULL NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) select NEVER NULL
-def information_schema ROUTINES SQL_PATH 22 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema SCHEMATA CATALOG_NAME 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME 3 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL
-def information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema SCHEMATA SCHEMA_COMMENT 6 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select NEVER NULL
-def information_schema SCHEMATA SCHEMA_NAME 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema SCHEMATA SQL_PATH 5 NULL YES varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema SCHEMA_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) select NEVER NULL
-def information_schema SCHEMA_PRIVILEGES IS_GRANTABLE 5 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL
-def information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema SESSION_STATUS VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL NO varchar 4096 12288 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(4096) select NEVER NULL
-def information_schema SESSION_VARIABLES VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL NO varchar 4096 12288 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(4096) select NEVER NULL
-def information_schema SPATIAL_REF_SYS AUTH_NAME 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema SPATIAL_REF_SYS AUTH_SRID 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(5) select NEVER NULL
-def information_schema SPATIAL_REF_SYS SRID 1 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) select NEVER NULL
-def information_schema SPATIAL_REF_SYS SRTEXT 4 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL
-def information_schema SQL_FUNCTIONS FUNCTION 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1) select NEVER NULL
-def information_schema STATISTICS COLUMN_NAME 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema STATISTICS COMMENT 15 NULL YES varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select NEVER NULL
-def information_schema STATISTICS IGNORED 17 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL
-def information_schema STATISTICS INDEX_COMMENT 16 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select NEVER NULL
-def information_schema STATISTICS INDEX_NAME 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema STATISTICS INDEX_SCHEMA 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema STATISTICS INDEX_TYPE 14 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select NEVER NULL
-def information_schema STATISTICS NON_UNIQUE 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(1) select NEVER NULL
-def information_schema STATISTICS NULLABLE 13 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL
-def information_schema STATISTICS PACKED 12 NULL YES varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) select NEVER NULL
-def information_schema STATISTICS SEQ_IN_INDEX 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(2) select NEVER NULL
-def information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(3) select NEVER NULL
-def information_schema STATISTICS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema STATISTICS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema STATISTICS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema SYSTEM_VARIABLES COMMAND_LINE_ARGUMENT 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema SYSTEM_VARIABLES DEFAULT_VALUE 5 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL
-def information_schema SYSTEM_VARIABLES ENUM_VALUE_LIST 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL
-def information_schema SYSTEM_VARIABLES GLOBAL_VALUE 3 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL
-def information_schema SYSTEM_VARIABLES GLOBAL_VALUE_ORIGIN 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema SYSTEM_VARIABLES GLOBAL_VALUE_PATH 15 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL
-def information_schema SYSTEM_VARIABLES NUMERIC_BLOCK_SIZE 11 NULL YES varchar 21 63 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(21) select NEVER NULL
-def information_schema SYSTEM_VARIABLES NUMERIC_MAX_VALUE 10 NULL YES varchar 21 63 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(21) select NEVER NULL
-def information_schema SYSTEM_VARIABLES NUMERIC_MIN_VALUE 9 NULL YES varchar 21 63 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(21) select NEVER NULL
-def information_schema SYSTEM_VARIABLES READ_ONLY 13 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL
-def information_schema SYSTEM_VARIABLES SESSION_VALUE 2 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL
-def information_schema SYSTEM_VARIABLES VARIABLE_COMMENT 8 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL
-def information_schema SYSTEM_VARIABLES VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema SYSTEM_VARIABLES VARIABLE_SCOPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema SYSTEM_VARIABLES VARIABLE_TYPE 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL
-def information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL
-def information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL
-def information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema TABLES ENGINE 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema TABLES MAX_INDEX_LENGTH 22 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema TABLES ROW_FORMAT 7 NULL YES varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) select NEVER NULL
-def information_schema TABLES TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TABLES TABLE_COMMENT 21 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL
-def information_schema TABLES TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema TABLES TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TABLES TABLE_TYPE 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TABLES TEMPORARY 23 NULL YES varchar 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1) select NEVER NULL
-def information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL
-def information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema TABLESPACES AUTOEXTEND_SIZE 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema TABLESPACES ENGINE 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TABLESPACES EXTENT_SIZE 5 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema TABLESPACES LOGFILE_GROUP_NAME 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TABLESPACES MAXIMUM_SIZE 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema TABLESPACES NODEGROUP_ID 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema TABLESPACES TABLESPACE_COMMENT 9 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL
-def information_schema TABLESPACES TABLESPACE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TABLESPACES TABLESPACE_TYPE 3 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TABLE_CONSTRAINTS CONSTRAINT_TYPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TABLE_CONSTRAINTS TABLE_NAME 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TABLE_CONSTRAINTS TABLE_SCHEMA 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TABLE_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) select NEVER NULL
-def information_schema TABLE_PRIVILEGES IS_GRANTABLE 6 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL
-def information_schema TABLE_PRIVILEGES PRIVILEGE_TYPE 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TABLE_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema TABLE_PRIVILEGES TABLE_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TABLE_PRIVILEGES TABLE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TABLE_STATISTICS ROWS_CHANGED 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema TABLE_STATISTICS ROWS_CHANGED_X_INDEXES 5 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema TABLE_STATISTICS ROWS_READ 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema TABLE_STATISTICS TABLE_NAME 2 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL
-def information_schema TABLE_STATISTICS TABLE_SCHEMA 1 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL
-def information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL
-def information_schema TRIGGERS ACTION_ORDER 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL
-def information_schema TRIGGERS ACTION_ORIENTATION 11 NULL NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) select NEVER NULL
-def information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL
-def information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL
-def information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL
-def information_schema TRIGGERS ACTION_TIMING 12 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) select NEVER NULL
-def information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL
-def information_schema TRIGGERS COLLATION_CONNECTION 21 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL 2 NULL NULL datetime(2) select NEVER NULL
-def information_schema TRIGGERS DATABASE_COLLATION 22 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TRIGGERS DEFINER 19 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) select NEVER NULL
-def information_schema TRIGGERS EVENT_MANIPULATION 4 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) select NEVER NULL
-def information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TRIGGERS SQL_MODE 18 NULL NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) select NEVER NULL
-def information_schema TRIGGERS TRIGGER_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema TRIGGERS TRIGGER_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema TRIGGERS TRIGGER_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema USER_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) select NEVER NULL
-def information_schema USER_PRIVILEGES IS_GRANTABLE 4 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL
-def information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema USER_STATISTICS ACCESS_DENIED 22 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema USER_STATISTICS BINLOG_BYTES_WRITTEN 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema USER_STATISTICS BUSY_TIME 5 NULL NO double NULL NULL 21 NULL NULL NULL NULL double select NEVER NULL
-def information_schema USER_STATISTICS BYTES_RECEIVED 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema USER_STATISTICS BYTES_SENT 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema USER_STATISTICS COMMIT_TRANSACTIONS 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema USER_STATISTICS CONCURRENT_CONNECTIONS 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select NEVER NULL
-def information_schema USER_STATISTICS CONNECTED_TIME 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select NEVER NULL
-def information_schema USER_STATISTICS CPU_TIME 6 NULL NO double NULL NULL 21 NULL NULL NULL NULL double select NEVER NULL
-def information_schema USER_STATISTICS DENIED_CONNECTIONS 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema USER_STATISTICS EMPTY_QUERIES 23 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema USER_STATISTICS LOST_CONNECTIONS 21 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema USER_STATISTICS MAX_STATEMENT_TIME_EXCEEDED 25 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema USER_STATISTICS OTHER_COMMANDS 17 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema USER_STATISTICS ROLLBACK_TRANSACTIONS 19 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema USER_STATISTICS ROWS_DELETED 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema USER_STATISTICS ROWS_INSERTED 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema USER_STATISTICS ROWS_READ 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema USER_STATISTICS ROWS_SENT 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema USER_STATISTICS ROWS_UPDATED 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema USER_STATISTICS SELECT_COMMANDS 15 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema USER_STATISTICS TOTAL_CONNECTIONS 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select NEVER NULL
-def information_schema USER_STATISTICS TOTAL_SSL_CONNECTIONS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL
-def information_schema USER_STATISTICS UPDATE_COMMANDS 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
-def information_schema USER_STATISTICS USER 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select NEVER NULL
-def information_schema VIEWS ALGORITHM 11 NULL NO varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) select NEVER NULL
-def information_schema VIEWS CHARACTER_SET_CLIENT 9 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL
-def information_schema VIEWS CHECK_OPTION 5 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) select NEVER NULL
-def information_schema VIEWS COLLATION_CONNECTION 10 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema VIEWS DEFINER 7 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) select NEVER NULL
-def information_schema VIEWS IS_UPDATABLE 6 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL
-def information_schema VIEWS SECURITY_TYPE 8 NULL NO varchar 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(7) select NEVER NULL
-def information_schema VIEWS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL
-def information_schema VIEWS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema VIEWS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL
-def information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
+def information_schema ALL_PLUGINS LOAD_OPTION 11 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_AUTH_VERSION 13 NULL YES varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_LICENSE 10 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_MATURITY 12 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) select NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_STATUS 3 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_TYPE 4 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_TYPE_VERSION 5 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_VERSION 2 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL NO NO
+def information_schema APPLICABLE_ROLES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) select NEVER NULL NO NO
+def information_schema APPLICABLE_ROLES IS_DEFAULT 4 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
+def information_schema APPLICABLE_ROLES IS_GRANTABLE 3 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
+def information_schema APPLICABLE_ROLES ROLE_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select NEVER NULL NO NO
+def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL NO NO
+def information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema CHARACTER_SETS DESCRIPTION 3 NULL NO varchar 60 180 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(60) select NEVER NULL NO NO
+def information_schema CHARACTER_SETS MAXLEN 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) select NEVER NULL NO NO
+def information_schema CHECK_CONSTRAINTS CHECK_CLAUSE 6 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL NO NO
+def information_schema CHECK_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema CHECK_CONSTRAINTS LEVEL 5 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) select NEVER NULL NO NO
+def information_schema CHECK_CONSTRAINTS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS ACCESS_DENIED 22 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS BINLOG_BYTES_WRITTEN 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS BUSY_TIME 5 NULL NO double NULL NULL 21 NULL NULL NULL NULL double select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS BYTES_RECEIVED 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS BYTES_SENT 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS CLIENT 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS COMMIT_TRANSACTIONS 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS CONCURRENT_CONNECTIONS 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS CONNECTED_TIME 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS CPU_TIME 6 NULL NO double NULL NULL 21 NULL NULL NULL NULL double select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS DENIED_CONNECTIONS 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS EMPTY_QUERIES 23 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS LOST_CONNECTIONS 21 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS MAX_STATEMENT_TIME_EXCEEDED 25 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS OTHER_COMMANDS 17 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS ROLLBACK_TRANSACTIONS 19 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS ROWS_DELETED 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS ROWS_INSERTED 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS ROWS_READ 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS ROWS_SENT 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS ROWS_UPDATED 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS SELECT_COMMANDS 15 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS TOTAL_CONNECTIONS 2 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS TOTAL_SSL_CONNECTIONS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS UPDATE_COMMANDS 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema COLLATIONS CHARACTER_SET_NAME 2 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL NO NO
+def information_schema COLLATIONS COLLATION_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema COLLATIONS ID 3 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(11) select NEVER NULL NO NO
+def information_schema COLLATIONS IS_COMPILED 5 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
+def information_schema COLLATIONS IS_DEFAULT 4 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
+def information_schema COLLATIONS SORTLEN 6 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) select NEVER NULL NO NO
+def information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL NO NO
+def information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema COLLATION_CHARACTER_SET_APPLICABILITY FULL_COLLATION_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema COLLATION_CHARACTER_SET_APPLICABILITY ID 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(11) select NEVER NULL NO NO
+def information_schema COLLATION_CHARACTER_SET_APPLICABILITY IS_DEFAULT 5 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
+def information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema COLUMNS CHARACTER_SET_NAME 14 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL NO NO
+def information_schema COLUMNS COLLATION_NAME 15 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema COLUMNS COLUMN_COMMENT 20 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select NEVER NULL NO NO
+def information_schema COLUMNS COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL NO NO
+def information_schema COLUMNS COLUMN_KEY 17 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
+def information_schema COLUMNS COLUMN_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema COLUMNS COLUMN_TYPE 16 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL NO NO
+def information_schema COLUMNS DATA_TYPE 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema COLUMNS DATETIME_PRECISION 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema COLUMNS EXTRA 18 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL NO NO
+def information_schema COLUMNS GENERATION_EXPRESSION 22 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL NO NO
+def information_schema COLUMNS IS_GENERATED 21 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) select NEVER NULL NO NO
+def information_schema COLUMNS IS_NULLABLE 7 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
+def information_schema COLUMNS IS_SYSTEM_TIME_PERIOD_END 24 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
+def information_schema COLUMNS IS_SYSTEM_TIME_PERIOD_START 23 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
+def information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema COLUMNS ORDINAL_POSITION 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema COLUMNS PRIVILEGES 19 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL NO NO
+def information_schema COLUMNS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema COLUMNS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema COLUMNS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema COLUMN_PRIVILEGES COLUMN_NAME 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema COLUMN_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) select NEVER NULL NO NO
+def information_schema COLUMN_PRIVILEGES IS_GRANTABLE 7 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
+def information_schema COLUMN_PRIVILEGES PRIVILEGE_TYPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema COLUMN_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema COLUMN_PRIVILEGES TABLE_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema COLUMN_PRIVILEGES TABLE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema ENABLED_ROLES ROLE_NAME 1 NULL YES varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select NEVER NULL NO NO
+def information_schema ENGINES COMMENT 3 NULL NO varchar 160 480 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(160) select NEVER NULL NO NO
+def information_schema ENGINES ENGINE 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema ENGINES SAVEPOINTS 6 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
+def information_schema ENGINES SUPPORT 2 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) select NEVER NULL NO NO
+def information_schema ENGINES TRANSACTIONS 4 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
+def information_schema ENGINES XA 5 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
+def information_schema EVENTS CHARACTER_SET_CLIENT 22 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL NO NO
+def information_schema EVENTS COLLATION_CONNECTION 23 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema EVENTS CREATED 17 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL NO NO
+def information_schema EVENTS DATABASE_COLLATION 24 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema EVENTS DEFINER 4 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) select NEVER NULL NO NO
+def information_schema EVENTS ENDS 14 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL NO NO
+def information_schema EVENTS EVENT_BODY 6 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) select NEVER NULL NO NO
+def information_schema EVENTS EVENT_CATALOG 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema EVENTS EVENT_COMMENT 20 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema EVENTS EVENT_DEFINITION 7 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL NO NO
+def information_schema EVENTS EVENT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema EVENTS EVENT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema EVENTS EVENT_TYPE 8 NULL NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) select NEVER NULL NO NO
+def information_schema EVENTS EXECUTE_AT 9 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL NO NO
+def information_schema EVENTS INTERVAL_FIELD 11 NULL YES varchar 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(18) select NEVER NULL NO NO
+def information_schema EVENTS INTERVAL_VALUE 10 NULL YES varchar 256 768 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(256) select NEVER NULL NO NO
+def information_schema EVENTS LAST_ALTERED 18 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL NO NO
+def information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL NO NO
+def information_schema EVENTS ON_COMPLETION 16 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) select NEVER NULL NO NO
+def information_schema EVENTS ORIGINATOR 21 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) select NEVER NULL NO NO
+def information_schema EVENTS SQL_MODE 12 NULL NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) select NEVER NULL NO NO
+def information_schema EVENTS STARTS 13 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL NO NO
+def information_schema EVENTS STATUS 15 NULL NO varchar 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(18) select NEVER NULL NO NO
+def information_schema EVENTS TIME_ZONE 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema FILES AUTOEXTEND_SIZE 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema FILES AVG_ROW_LENGTH 28 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema FILES CHECK_TIME 35 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL NO NO
+def information_schema FILES CREATE_TIME 33 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL NO NO
+def information_schema FILES CREATION_TIME 20 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL NO NO
+def information_schema FILES DATA_FREE 32 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema FILES DATA_LENGTH 29 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema FILES DELETED_ROWS 12 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL NO NO
+def information_schema FILES ENGINE 10 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema FILES EXTENT_SIZE 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL NO NO
+def information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(255) select NEVER NULL NO NO
+def information_schema FILES FILE_ID 1 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL NO NO
+def information_schema FILES FILE_NAME 2 NULL YES varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema FILES FILE_TYPE 3 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL NO NO
+def information_schema FILES FREE_EXTENTS 14 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL NO NO
+def information_schema FILES FULLTEXT_KEYS 11 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema FILES INDEX_LENGTH 31 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema FILES INITIAL_SIZE 17 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema FILES LAST_ACCESS_TIME 22 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL NO NO
+def information_schema FILES LAST_UPDATE_TIME 21 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL NO NO
+def information_schema FILES LOGFILE_GROUP_NAME 8 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema FILES LOGFILE_GROUP_NUMBER 9 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL NO NO
+def information_schema FILES MAXIMUM_SIZE 18 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema FILES MAX_DATA_LENGTH 30 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema FILES RECOVER_TIME 23 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL NO NO
+def information_schema FILES ROW_FORMAT 26 NULL YES varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) select NEVER NULL NO NO
+def information_schema FILES STATUS 37 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL NO NO
+def information_schema FILES TABLESPACE_NAME 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema FILES TABLE_CATALOG 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema FILES TABLE_NAME 7 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema FILES TABLE_ROWS 27 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema FILES TABLE_SCHEMA 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema FILES TOTAL_EXTENTS 15 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL NO NO
+def information_schema FILES TRANSACTION_COUNTER 24 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL NO NO
+def information_schema FILES UPDATE_COUNT 13 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL NO NO
+def information_schema FILES UPDATE_TIME 34 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL NO NO
+def information_schema FILES VERSION 25 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS COORD_DIMENSION 11 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS F_GEOMETRY_COLUMN 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS F_TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS F_TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS F_TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS GEOMETRY_TYPE 10 NULL NO int NULL NULL 10 0 NULL NULL NULL int(7) select NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS G_GEOMETRY_COLUMN 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS G_TABLE_CATALOG 5 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS G_TABLE_NAME 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS G_TABLE_SCHEMA 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS MAX_PPR 12 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS SRID 13 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) select NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS STORAGE_TYPE 9 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select NEVER NULL NO NO
+def information_schema GLOBAL_STATUS VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL NO varchar 4096 12288 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(4096) select NEVER NULL NO NO
+def information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL NO varchar 4096 12288 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(4096) select NEVER NULL NO NO
+def information_schema INDEX_STATISTICS INDEX_NAME 3 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL NO NO
+def information_schema INDEX_STATISTICS ROWS_READ 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema INDEX_STATISTICS TABLE_NAME 2 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL NO NO
+def information_schema INDEX_STATISTICS TABLE_SCHEMA 1 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL NO NO
+def information_schema KEYWORDS WORD 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema KEY_CACHES BLOCK_SIZE 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema KEY_CACHES DIRTY_BLOCKS 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema KEY_CACHES FULL_SIZE 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema KEY_CACHES KEY_CACHE_NAME 1 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL NO NO
+def information_schema KEY_CACHES READS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema KEY_CACHES READ_REQUESTS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema KEY_CACHES SEGMENTS 2 NULL YES int NULL NULL 10 0 NULL NULL NULL int(3) unsigned select NEVER NULL NO NO
+def information_schema KEY_CACHES SEGMENT_NUMBER 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(3) unsigned select NEVER NULL NO NO
+def information_schema KEY_CACHES UNUSED_BLOCKS 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema KEY_CACHES USED_BLOCKS 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema KEY_CACHES WRITES 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema KEY_CACHES WRITE_REQUESTS 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE COLUMN_NAME 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE ORDINAL_POSITION 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) select NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE POSITION_IN_UNIQUE_CONSTRAINT 9 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(10) select NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE REFERENCED_COLUMN_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_NAME 11 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA 10 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE TABLE_NAME 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE TABLE_SCHEMA 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema KEY_PERIOD_USAGE CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema KEY_PERIOD_USAGE CONSTRAINT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema KEY_PERIOD_USAGE CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema KEY_PERIOD_USAGE PERIOD_NAME 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema KEY_PERIOD_USAGE TABLE_CATALOG 4 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema KEY_PERIOD_USAGE TABLE_NAME 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema KEY_PERIOD_USAGE TABLE_SCHEMA 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS ENGINE 1 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_DISK_READ_COST 2 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) select NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_DISK_READ_RATIO 8 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) select NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_INDEX_BLOCK_COPY_COST 3 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) select NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_KEY_COMPARE_COST 4 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) select NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_KEY_COPY_COST 5 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) select NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_KEY_LOOKUP_COST 6 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) select NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_KEY_NEXT_FIND_COST 7 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) select NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_ROWID_COMPARE_COST 12 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) select NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_ROWID_COPY_COST 13 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) select NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_ROW_COPY_COST 9 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) select NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_ROW_LOOKUP_COST 10 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) select NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_ROW_NEXT_FIND_COST 11 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) select NEVER NULL NO NO
+def information_schema OPTIMIZER_TRACE INSUFFICIENT_PRIVILEGES 4 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) select NEVER NULL NO NO
+def information_schema OPTIMIZER_TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(20) select NEVER NULL NO NO
+def information_schema OPTIMIZER_TRACE QUERY 1 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL NO NO
+def information_schema OPTIMIZER_TRACE TRACE 2 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL NO NO
+def information_schema PARAMETERS CHARACTER_MAXIMUM_LENGTH 8 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL NO NO
+def information_schema PARAMETERS CHARACTER_OCTET_LENGTH 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL NO NO
+def information_schema PARAMETERS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema PARAMETERS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema PARAMETERS DATA_TYPE 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema PARAMETERS DATETIME_PRECISION 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema PARAMETERS DTD_IDENTIFIER 15 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL NO NO
+def information_schema PARAMETERS NUMERIC_PRECISION 10 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL NO NO
+def information_schema PARAMETERS NUMERIC_SCALE 11 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL NO NO
+def information_schema PARAMETERS ORDINAL_POSITION 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL NO NO
+def information_schema PARAMETERS PARAMETER_MODE 5 NULL YES varchar 5 15 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(5) select NEVER NULL NO NO
+def information_schema PARAMETERS PARAMETER_NAME 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema PARAMETERS ROUTINE_TYPE 16 NULL NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) select NEVER NULL NO NO
+def information_schema PARAMETERS SPECIFIC_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema PARAMETERS SPECIFIC_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema PARAMETERS SPECIFIC_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema PARTITIONS AVG_ROW_LENGTH 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema PARTITIONS CHECKSUM 22 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema PARTITIONS CHECK_TIME 21 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL NO NO
+def information_schema PARTITIONS CREATE_TIME 19 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL NO NO
+def information_schema PARTITIONS DATA_FREE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema PARTITIONS DATA_LENGTH 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema PARTITIONS INDEX_LENGTH 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema PARTITIONS MAX_DATA_LENGTH 16 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema PARTITIONS NODEGROUP 24 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) select NEVER NULL NO NO
+def information_schema PARTITIONS PARTITION_COMMENT 23 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL NO NO
+def information_schema PARTITIONS PARTITION_DESCRIPTION 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL NO NO
+def information_schema PARTITIONS PARTITION_EXPRESSION 10 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL NO NO
+def information_schema PARTITIONS PARTITION_METHOD 8 NULL YES varchar 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(18) select NEVER NULL NO NO
+def information_schema PARTITIONS PARTITION_NAME 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema PARTITIONS PARTITION_ORDINAL_POSITION 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema PARTITIONS SUBPARTITION_EXPRESSION 11 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL NO NO
+def information_schema PARTITIONS SUBPARTITION_METHOD 9 NULL YES varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) select NEVER NULL NO NO
+def information_schema PARTITIONS SUBPARTITION_NAME 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema PARTITIONS SUBPARTITION_ORDINAL_POSITION 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema PARTITIONS TABLESPACE_NAME 25 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema PARTITIONS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema PARTITIONS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema PARTITIONS TABLE_ROWS 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema PARTITIONS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema PARTITIONS UPDATE_TIME 20 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL NO NO
+def information_schema PERIODS END_COLUMN_NAME 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema PERIODS PERIOD 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema PERIODS START_COLUMN_NAME 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema PERIODS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema PERIODS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema PERIODS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema PLUGINS LOAD_OPTION 11 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_AUTH_VERSION 13 NULL YES varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_LICENSE 10 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_MATURITY 12 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) select NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_STATUS 3 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_TYPE 4 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) select NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_TYPE_VERSION 5 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_VERSION 2 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) select NEVER NULL NO NO
+def information_schema PROCESSLIST COMMAND 5 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select NEVER NULL NO NO
+def information_schema PROCESSLIST DB 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema PROCESSLIST EXAMINED_ROWS 15 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) select NEVER NULL NO NO
+def information_schema PROCESSLIST HOST 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema PROCESSLIST ID 1 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL NO NO
+def information_schema PROCESSLIST INFO 8 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL NO NO
+def information_schema PROCESSLIST INFO_BINARY 18 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob select NEVER NULL NO NO
+def information_schema PROCESSLIST MAX_MEMORY_USED 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) select NEVER NULL NO NO
+def information_schema PROCESSLIST MAX_STAGE 11 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select NEVER NULL NO NO
+def information_schema PROCESSLIST MEMORY_USED 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) select NEVER NULL NO NO
+def information_schema PROCESSLIST PROGRESS 12 NULL NO decimal NULL NULL 7 3 NULL NULL NULL decimal(7,3) select NEVER NULL NO NO
+def information_schema PROCESSLIST QUERY_ID 17 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) select NEVER NULL NO NO
+def information_schema PROCESSLIST SENT_ROWS 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) select NEVER NULL NO NO
+def information_schema PROCESSLIST STAGE 10 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) select NEVER NULL NO NO
+def information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema PROCESSLIST TID 19 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) select NEVER NULL NO NO
+def information_schema PROCESSLIST TIME 6 NULL NO int NULL NULL 10 0 NULL NULL NULL int(7) select NEVER NULL NO NO
+def information_schema PROCESSLIST TIME_MS 9 NULL NO decimal NULL NULL 22 3 NULL NULL NULL decimal(22,3) select NEVER NULL NO NO
+def information_schema PROCESSLIST USER 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select NEVER NULL NO NO
+def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema REFERENTIAL_CONSTRAINTS DELETE_RULE 9 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema REFERENTIAL_CONSTRAINTS MATCH_OPTION 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema REFERENTIAL_CONSTRAINTS REFERENCED_TABLE_NAME 11 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema REFERENTIAL_CONSTRAINTS TABLE_NAME 10 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_CATALOG 4 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_NAME 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_SCHEMA 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema REFERENTIAL_CONSTRAINTS UPDATE_RULE 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema ROUTINES CHARACTER_MAXIMUM_LENGTH 7 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL NO NO
+def information_schema ROUTINES CHARACTER_OCTET_LENGTH 8 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL NO NO
+def information_schema ROUTINES CHARACTER_SET_CLIENT 29 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL NO NO
+def information_schema ROUTINES CHARACTER_SET_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema ROUTINES COLLATION_CONNECTION 30 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema ROUTINES COLLATION_NAME 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema ROUTINES CREATED 24 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL NO NO
+def information_schema ROUTINES DATABASE_COLLATION 31 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema ROUTINES DATA_TYPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema ROUTINES DATETIME_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema ROUTINES DEFINER 28 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) select NEVER NULL NO NO
+def information_schema ROUTINES DTD_IDENTIFIER 14 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL NO NO
+def information_schema ROUTINES EXTERNAL_LANGUAGE 18 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema ROUTINES EXTERNAL_NAME 17 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema ROUTINES IS_DETERMINISTIC 20 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
+def information_schema ROUTINES LAST_ALTERED 25 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL NO NO
+def information_schema ROUTINES NUMERIC_PRECISION 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL NO NO
+def information_schema ROUTINES NUMERIC_SCALE 10 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) select NEVER NULL NO NO
+def information_schema ROUTINES PARAMETER_STYLE 19 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) select NEVER NULL NO NO
+def information_schema ROUTINES ROUTINE_BODY 15 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) select NEVER NULL NO NO
+def information_schema ROUTINES ROUTINE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema ROUTINES ROUTINE_COMMENT 27 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL NO NO
+def information_schema ROUTINES ROUTINE_DEFINITION 16 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL NO NO
+def information_schema ROUTINES ROUTINE_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema ROUTINES ROUTINE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema ROUTINES ROUTINE_TYPE 5 NULL NO varchar 13 39 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(13) select NEVER NULL NO NO
+def information_schema ROUTINES SECURITY_TYPE 23 NULL NO varchar 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(7) select NEVER NULL NO NO
+def information_schema ROUTINES SPECIFIC_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema ROUTINES SQL_DATA_ACCESS 21 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema ROUTINES SQL_MODE 26 NULL NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) select NEVER NULL NO NO
+def information_schema ROUTINES SQL_PATH 22 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema SCHEMATA CATALOG_NAME 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME 3 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL NO NO
+def information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema SCHEMATA SCHEMA_COMMENT 6 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select NEVER NULL NO NO
+def information_schema SCHEMATA SCHEMA_NAME 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema SCHEMATA SQL_PATH 5 NULL YES varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema SCHEMA_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) select NEVER NULL NO NO
+def information_schema SCHEMA_PRIVILEGES IS_GRANTABLE 5 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
+def information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema SESSION_STATUS VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL NO varchar 4096 12288 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(4096) select NEVER NULL NO NO
+def information_schema SESSION_VARIABLES VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL NO varchar 4096 12288 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(4096) select NEVER NULL NO NO
+def information_schema SPATIAL_REF_SYS AUTH_NAME 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema SPATIAL_REF_SYS AUTH_SRID 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(5) select NEVER NULL NO NO
+def information_schema SPATIAL_REF_SYS SRID 1 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) select NEVER NULL NO NO
+def information_schema SPATIAL_REF_SYS SRTEXT 4 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL NO NO
+def information_schema SQL_FUNCTIONS FUNCTION 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1) select NEVER NULL NO NO
+def information_schema STATISTICS COLUMN_NAME 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema STATISTICS COMMENT 15 NULL YES varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select NEVER NULL NO NO
+def information_schema STATISTICS IGNORED 17 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
+def information_schema STATISTICS INDEX_COMMENT 16 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select NEVER NULL NO NO
+def information_schema STATISTICS INDEX_NAME 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema STATISTICS INDEX_SCHEMA 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema STATISTICS INDEX_TYPE 14 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select NEVER NULL NO NO
+def information_schema STATISTICS NON_UNIQUE 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(1) select NEVER NULL NO NO
+def information_schema STATISTICS NULLABLE 13 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
+def information_schema STATISTICS PACKED 12 NULL YES varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) select NEVER NULL NO NO
+def information_schema STATISTICS SEQ_IN_INDEX 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(2) select NEVER NULL NO NO
+def information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(3) select NEVER NULL NO NO
+def information_schema STATISTICS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema STATISTICS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema STATISTICS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES COMMAND_LINE_ARGUMENT 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES DEFAULT_VALUE 5 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES ENUM_VALUE_LIST 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES GLOBAL_VALUE 3 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES GLOBAL_VALUE_ORIGIN 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES GLOBAL_VALUE_PATH 15 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES NUMERIC_BLOCK_SIZE 11 NULL YES varchar 21 63 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(21) select NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES NUMERIC_MAX_VALUE 10 NULL YES varchar 21 63 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(21) select NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES NUMERIC_MIN_VALUE 9 NULL YES varchar 21 63 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(21) select NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES READ_ONLY 13 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES SESSION_VALUE 2 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES VARIABLE_COMMENT 8 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES VARIABLE_SCOPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES VARIABLE_TYPE 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL NO NO
+def information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL NO NO
+def information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL NO NO
+def information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema TABLES ENGINE 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema TABLES MAX_INDEX_LENGTH 22 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema TABLES ROW_FORMAT 7 NULL YES varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) select NEVER NULL NO NO
+def information_schema TABLES TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TABLES TABLE_COMMENT 21 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL NO NO
+def information_schema TABLES TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema TABLES TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TABLES TABLE_TYPE 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TABLES TEMPORARY 23 NULL YES varchar 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1) select NEVER NULL NO NO
+def information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select NEVER NULL NO NO
+def information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema TABLESPACES AUTOEXTEND_SIZE 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema TABLESPACES ENGINE 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TABLESPACES EXTENT_SIZE 5 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema TABLESPACES LOGFILE_GROUP_NAME 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TABLESPACES MAXIMUM_SIZE 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema TABLESPACES NODEGROUP_ID 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema TABLESPACES TABLESPACE_COMMENT 9 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select NEVER NULL NO NO
+def information_schema TABLESPACES TABLESPACE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TABLESPACES TABLESPACE_TYPE 3 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TABLE_CONSTRAINTS CONSTRAINT_TYPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TABLE_CONSTRAINTS TABLE_NAME 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TABLE_CONSTRAINTS TABLE_SCHEMA 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TABLE_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) select NEVER NULL NO NO
+def information_schema TABLE_PRIVILEGES IS_GRANTABLE 6 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
+def information_schema TABLE_PRIVILEGES PRIVILEGE_TYPE 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TABLE_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema TABLE_PRIVILEGES TABLE_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TABLE_PRIVILEGES TABLE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TABLE_STATISTICS ROWS_CHANGED 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema TABLE_STATISTICS ROWS_CHANGED_X_INDEXES 5 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema TABLE_STATISTICS ROWS_READ 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema TABLE_STATISTICS TABLE_NAME 2 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL NO NO
+def information_schema TABLE_STATISTICS TABLE_SCHEMA 1 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) select NEVER NULL NO NO
+def information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL NO NO
+def information_schema TRIGGERS ACTION_ORDER 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) select NEVER NULL NO NO
+def information_schema TRIGGERS ACTION_ORIENTATION 11 NULL NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) select NEVER NULL NO NO
+def information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
+def information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
+def information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL NO NO
+def information_schema TRIGGERS ACTION_TIMING 12 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) select NEVER NULL NO NO
+def information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL NO NO
+def information_schema TRIGGERS COLLATION_CONNECTION 21 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL 2 NULL NULL datetime(2) select NEVER NULL NO NO
+def information_schema TRIGGERS DATABASE_COLLATION 22 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TRIGGERS DEFINER 19 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) select NEVER NULL NO NO
+def information_schema TRIGGERS EVENT_MANIPULATION 4 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) select NEVER NULL NO NO
+def information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TRIGGERS SQL_MODE 18 NULL NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) select NEVER NULL NO NO
+def information_schema TRIGGERS TRIGGER_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema TRIGGERS TRIGGER_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema TRIGGERS TRIGGER_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema USER_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) select NEVER NULL NO NO
+def information_schema USER_PRIVILEGES IS_GRANTABLE 4 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
+def information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema USER_STATISTICS ACCESS_DENIED 22 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema USER_STATISTICS BINLOG_BYTES_WRITTEN 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema USER_STATISTICS BUSY_TIME 5 NULL NO double NULL NULL 21 NULL NULL NULL NULL double select NEVER NULL NO NO
+def information_schema USER_STATISTICS BYTES_RECEIVED 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema USER_STATISTICS BYTES_SENT 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema USER_STATISTICS COMMIT_TRANSACTIONS 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema USER_STATISTICS CONCURRENT_CONNECTIONS 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select NEVER NULL NO NO
+def information_schema USER_STATISTICS CONNECTED_TIME 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select NEVER NULL NO NO
+def information_schema USER_STATISTICS CPU_TIME 6 NULL NO double NULL NULL 21 NULL NULL NULL NULL double select NEVER NULL NO NO
+def information_schema USER_STATISTICS DENIED_CONNECTIONS 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema USER_STATISTICS EMPTY_QUERIES 23 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema USER_STATISTICS LOST_CONNECTIONS 21 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema USER_STATISTICS MAX_STATEMENT_TIME_EXCEEDED 25 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema USER_STATISTICS OTHER_COMMANDS 17 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema USER_STATISTICS ROLLBACK_TRANSACTIONS 19 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema USER_STATISTICS ROWS_DELETED 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema USER_STATISTICS ROWS_INSERTED 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema USER_STATISTICS ROWS_READ 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema USER_STATISTICS ROWS_SENT 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema USER_STATISTICS ROWS_UPDATED 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema USER_STATISTICS SELECT_COMMANDS 15 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema USER_STATISTICS TOTAL_CONNECTIONS 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select NEVER NULL NO NO
+def information_schema USER_STATISTICS TOTAL_SSL_CONNECTIONS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select NEVER NULL NO NO
+def information_schema USER_STATISTICS UPDATE_COMMANDS 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL NO NO
+def information_schema USER_STATISTICS USER 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select NEVER NULL NO NO
+def information_schema VIEWS ALGORITHM 11 NULL NO varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) select NEVER NULL NO NO
+def information_schema VIEWS CHARACTER_SET_CLIENT 9 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select NEVER NULL NO NO
+def information_schema VIEWS CHECK_OPTION 5 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) select NEVER NULL NO NO
+def information_schema VIEWS COLLATION_CONNECTION 10 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema VIEWS DEFINER 7 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) select NEVER NULL NO NO
+def information_schema VIEWS IS_UPDATABLE 6 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) select NEVER NULL NO NO
+def information_schema VIEWS SECURITY_TYPE 8 NULL NO varchar 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(7) select NEVER NULL NO NO
+def information_schema VIEWS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
+def information_schema VIEWS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema VIEWS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
+def information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select NEVER NULL NO NO
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
@@ -639,6 +668,8 @@ NULL information_schema COLUMNS DATETIME_PRECISION bigint NULL NULL NULL NULL bi
3.0000 information_schema COLUMNS COLUMN_COMMENT varchar 1024 3072 utf8mb3 utf8mb3_general_ci varchar(1024)
3.0000 information_schema COLUMNS IS_GENERATED varchar 6 18 utf8mb3 utf8mb3_general_ci varchar(6)
1.0000 information_schema COLUMNS GENERATION_EXPRESSION longtext 4294967295 4294967295 utf8mb3 utf8mb3_general_ci longtext
+3.0000 information_schema COLUMNS IS_SYSTEM_TIME_PERIOD_START varchar 3 9 utf8mb3 utf8mb3_general_ci varchar(3)
+3.0000 information_schema COLUMNS IS_SYSTEM_TIME_PERIOD_END varchar 3 9 utf8mb3 utf8mb3_general_ci varchar(3)
3.0000 information_schema COLUMN_PRIVILEGES GRANTEE varchar 385 1155 utf8mb3 utf8mb3_general_ci varchar(385)
3.0000 information_schema COLUMN_PRIVILEGES TABLE_CATALOG varchar 512 1536 utf8mb3 utf8mb3_general_ci varchar(512)
3.0000 information_schema COLUMN_PRIVILEGES TABLE_SCHEMA varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
@@ -761,6 +792,26 @@ NULL information_schema KEY_COLUMN_USAGE POSITION_IN_UNIQUE_CONSTRAINT bigint NU
3.0000 information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
3.0000 information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
3.0000 information_schema KEY_COLUMN_USAGE REFERENCED_COLUMN_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
+3.0000 information_schema KEY_PERIOD_USAGE CONSTRAINT_CATALOG varchar 512 1536 utf8mb3 utf8mb3_general_ci varchar(512)
+3.0000 information_schema KEY_PERIOD_USAGE CONSTRAINT_SCHEMA varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
+3.0000 information_schema KEY_PERIOD_USAGE CONSTRAINT_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
+3.0000 information_schema KEY_PERIOD_USAGE TABLE_CATALOG varchar 512 1536 utf8mb3 utf8mb3_general_ci varchar(512)
+3.0000 information_schema KEY_PERIOD_USAGE TABLE_SCHEMA varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
+3.0000 information_schema KEY_PERIOD_USAGE TABLE_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
+3.0000 information_schema KEY_PERIOD_USAGE PERIOD_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
+3.0000 information_schema OPTIMIZER_COSTS ENGINE varchar 192 576 utf8mb3 utf8mb3_general_ci varchar(192)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_DISK_READ_COST decimal NULL NULL NULL NULL decimal(9,6)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_INDEX_BLOCK_COPY_COST decimal NULL NULL NULL NULL decimal(9,6)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_KEY_COMPARE_COST decimal NULL NULL NULL NULL decimal(9,6)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_KEY_COPY_COST decimal NULL NULL NULL NULL decimal(9,6)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_KEY_LOOKUP_COST decimal NULL NULL NULL NULL decimal(9,6)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_KEY_NEXT_FIND_COST decimal NULL NULL NULL NULL decimal(9,6)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_DISK_READ_RATIO decimal NULL NULL NULL NULL decimal(9,6)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_ROW_COPY_COST decimal NULL NULL NULL NULL decimal(9,6)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_ROW_LOOKUP_COST decimal NULL NULL NULL NULL decimal(9,6)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_ROW_NEXT_FIND_COST decimal NULL NULL NULL NULL decimal(9,6)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_ROWID_COMPARE_COST decimal NULL NULL NULL NULL decimal(9,6)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_ROWID_COPY_COST decimal NULL NULL NULL NULL decimal(9,6)
1.0000 information_schema OPTIMIZER_TRACE QUERY longtext 4294967295 4294967295 utf8mb3 utf8mb3_general_ci longtext
1.0000 information_schema OPTIMIZER_TRACE TRACE longtext 4294967295 4294967295 utf8mb3 utf8mb3_general_ci longtext
NULL information_schema OPTIMIZER_TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE int NULL NULL NULL NULL int(20)
@@ -806,6 +857,12 @@ NULL information_schema PARTITIONS CHECKSUM bigint NULL NULL NULL NULL bigint(21
3.0000 information_schema PARTITIONS PARTITION_COMMENT varchar 80 240 utf8mb3 utf8mb3_general_ci varchar(80)
3.0000 information_schema PARTITIONS NODEGROUP varchar 12 36 utf8mb3 utf8mb3_general_ci varchar(12)
3.0000 information_schema PARTITIONS TABLESPACE_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
+3.0000 information_schema PERIODS TABLE_CATALOG varchar 512 1536 utf8mb3 utf8mb3_general_ci varchar(512)
+3.0000 information_schema PERIODS TABLE_SCHEMA varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
+3.0000 information_schema PERIODS TABLE_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
+3.0000 information_schema PERIODS PERIOD varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
+3.0000 information_schema PERIODS START_COLUMN_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
+3.0000 information_schema PERIODS END_COLUMN_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
3.0000 information_schema PLUGINS PLUGIN_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
3.0000 information_schema PLUGINS PLUGIN_VERSION varchar 20 60 utf8mb3 utf8mb3_general_ci varchar(20)
3.0000 information_schema PLUGINS PLUGIN_STATUS varchar 16 48 utf8mb3 utf8mb3_general_ci varchar(16)
@@ -831,12 +888,13 @@ NULL information_schema PROCESSLIST TIME_MS decimal NULL NULL NULL NULL decimal(
NULL information_schema PROCESSLIST STAGE tinyint NULL NULL NULL NULL tinyint(2)
NULL information_schema PROCESSLIST MAX_STAGE tinyint NULL NULL NULL NULL tinyint(2)
NULL information_schema PROCESSLIST PROGRESS decimal NULL NULL NULL NULL decimal(7,3)
-NULL information_schema PROCESSLIST MEMORY_USED bigint NULL NULL NULL NULL bigint(7)
-NULL information_schema PROCESSLIST MAX_MEMORY_USED bigint NULL NULL NULL NULL bigint(7)
-NULL information_schema PROCESSLIST EXAMINED_ROWS int NULL NULL NULL NULL int(7)
-NULL information_schema PROCESSLIST QUERY_ID bigint NULL NULL NULL NULL bigint(4)
+NULL information_schema PROCESSLIST MEMORY_USED bigint NULL NULL NULL NULL bigint(10)
+NULL information_schema PROCESSLIST MAX_MEMORY_USED bigint NULL NULL NULL NULL bigint(10)
+NULL information_schema PROCESSLIST EXAMINED_ROWS bigint NULL NULL NULL NULL bigint(10)
+NULL information_schema PROCESSLIST SENT_ROWS bigint NULL NULL NULL NULL bigint(10)
+NULL information_schema PROCESSLIST QUERY_ID bigint NULL NULL NULL NULL bigint(10)
1.0000 information_schema PROCESSLIST INFO_BINARY blob 65535 65535 NULL NULL blob
-NULL information_schema PROCESSLIST TID bigint NULL NULL NULL NULL bigint(4)
+NULL information_schema PROCESSLIST TID bigint NULL NULL NULL NULL bigint(10)
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG varchar 512 1536 utf8mb3 utf8mb3_general_ci varchar(512)
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
diff --git a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
index 79c43e18..686853d8 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_is_embedded.result
@@ -2,495 +2,524 @@ SELECT * FROM information_schema.columns
WHERE table_schema = 'information_schema'
AND table_name <> 'profiling' AND table_name not like 'innodb_%'
ORDER BY table_schema, table_name, column_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
-def information_schema ALL_PLUGINS LOAD_OPTION 11 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_AUTH_VERSION 13 NULL YES varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_LICENSE 10 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_MATURITY 12 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_STATUS 3 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_TYPE 4 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_TYPE_VERSION 5 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL
-def information_schema ALL_PLUGINS PLUGIN_VERSION 2 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL
-def information_schema APPLICABLE_ROLES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) NEVER NULL
-def information_schema APPLICABLE_ROLES IS_DEFAULT 4 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL
-def information_schema APPLICABLE_ROLES IS_GRANTABLE 3 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL
-def information_schema APPLICABLE_ROLES ROLE_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) NEVER NULL
-def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL
-def information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema CHARACTER_SETS DESCRIPTION 3 NULL NO varchar 60 180 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(60) NEVER NULL
-def information_schema CHARACTER_SETS MAXLEN 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) NEVER NULL
-def information_schema CHECK_CONSTRAINTS CHECK_CLAUSE 6 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL
-def information_schema CHECK_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema CHECK_CONSTRAINTS LEVEL 5 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) NEVER NULL
-def information_schema CHECK_CONSTRAINTS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema CLIENT_STATISTICS ACCESS_DENIED 22 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema CLIENT_STATISTICS BINLOG_BYTES_WRITTEN 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema CLIENT_STATISTICS BUSY_TIME 5 NULL NO double NULL NULL 21 NULL NULL NULL NULL double NEVER NULL
-def information_schema CLIENT_STATISTICS BYTES_RECEIVED 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema CLIENT_STATISTICS BYTES_SENT 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema CLIENT_STATISTICS CLIENT 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema CLIENT_STATISTICS COMMIT_TRANSACTIONS 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema CLIENT_STATISTICS CONCURRENT_CONNECTIONS 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema CLIENT_STATISTICS CONNECTED_TIME 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema CLIENT_STATISTICS CPU_TIME 6 NULL NO double NULL NULL 21 NULL NULL NULL NULL double NEVER NULL
-def information_schema CLIENT_STATISTICS DENIED_CONNECTIONS 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema CLIENT_STATISTICS EMPTY_QUERIES 23 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema CLIENT_STATISTICS LOST_CONNECTIONS 21 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema CLIENT_STATISTICS MAX_STATEMENT_TIME_EXCEEDED 25 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema CLIENT_STATISTICS OTHER_COMMANDS 17 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema CLIENT_STATISTICS ROLLBACK_TRANSACTIONS 19 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema CLIENT_STATISTICS ROWS_DELETED 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema CLIENT_STATISTICS ROWS_INSERTED 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema CLIENT_STATISTICS ROWS_READ 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema CLIENT_STATISTICS ROWS_SENT 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema CLIENT_STATISTICS ROWS_UPDATED 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema CLIENT_STATISTICS SELECT_COMMANDS 15 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema CLIENT_STATISTICS TOTAL_CONNECTIONS 2 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema CLIENT_STATISTICS TOTAL_SSL_CONNECTIONS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema CLIENT_STATISTICS UPDATE_COMMANDS 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema COLLATIONS CHARACTER_SET_NAME 2 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL
-def information_schema COLLATIONS COLLATION_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema COLLATIONS ID 3 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(11) NEVER NULL
-def information_schema COLLATIONS IS_COMPILED 5 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL
-def information_schema COLLATIONS IS_DEFAULT 4 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL
-def information_schema COLLATIONS SORTLEN 6 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) NEVER NULL
-def information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL
-def information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema COLLATION_CHARACTER_SET_APPLICABILITY FULL_COLLATION_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema COLLATION_CHARACTER_SET_APPLICABILITY ID 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(11) NEVER NULL
-def information_schema COLLATION_CHARACTER_SET_APPLICABILITY IS_DEFAULT 5 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL
-def information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema COLUMNS CHARACTER_SET_NAME 14 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL
-def information_schema COLUMNS COLLATION_NAME 15 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema COLUMNS COLUMN_COMMENT 20 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) NEVER NULL
-def information_schema COLUMNS COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL
-def information_schema COLUMNS COLUMN_KEY 17 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL
-def information_schema COLUMNS COLUMN_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema COLUMNS COLUMN_TYPE 16 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL
-def information_schema COLUMNS DATA_TYPE 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema COLUMNS DATETIME_PRECISION 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema COLUMNS EXTRA 18 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL
-def information_schema COLUMNS GENERATION_EXPRESSION 22 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL
-def information_schema COLUMNS IS_GENERATED 21 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) NEVER NULL
-def information_schema COLUMNS IS_NULLABLE 7 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL
-def information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema COLUMNS ORDINAL_POSITION 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema COLUMNS PRIVILEGES 19 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL
-def information_schema COLUMNS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema COLUMNS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema COLUMNS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema COLUMN_PRIVILEGES COLUMN_NAME 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema COLUMN_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) NEVER NULL
-def information_schema COLUMN_PRIVILEGES IS_GRANTABLE 7 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL
-def information_schema COLUMN_PRIVILEGES PRIVILEGE_TYPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema COLUMN_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema COLUMN_PRIVILEGES TABLE_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema COLUMN_PRIVILEGES TABLE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema ENABLED_ROLES ROLE_NAME 1 NULL YES varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) NEVER NULL
-def information_schema ENGINES COMMENT 3 NULL NO varchar 160 480 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(160) NEVER NULL
-def information_schema ENGINES ENGINE 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema ENGINES SAVEPOINTS 6 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL
-def information_schema ENGINES SUPPORT 2 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) NEVER NULL
-def information_schema ENGINES TRANSACTIONS 4 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL
-def information_schema ENGINES XA 5 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL
-def information_schema EVENTS CHARACTER_SET_CLIENT 22 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL
-def information_schema EVENTS COLLATION_CONNECTION 23 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema EVENTS CREATED 17 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def information_schema EVENTS DATABASE_COLLATION 24 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema EVENTS DEFINER 4 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) NEVER NULL
-def information_schema EVENTS ENDS 14 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def information_schema EVENTS EVENT_BODY 6 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) NEVER NULL
-def information_schema EVENTS EVENT_CATALOG 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema EVENTS EVENT_COMMENT 20 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema EVENTS EVENT_DEFINITION 7 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL
-def information_schema EVENTS EVENT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema EVENTS EVENT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema EVENTS EVENT_TYPE 8 NULL NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) NEVER NULL
-def information_schema EVENTS EXECUTE_AT 9 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def information_schema EVENTS INTERVAL_FIELD 11 NULL YES varchar 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(18) NEVER NULL
-def information_schema EVENTS INTERVAL_VALUE 10 NULL YES varchar 256 768 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(256) NEVER NULL
-def information_schema EVENTS LAST_ALTERED 18 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def information_schema EVENTS ON_COMPLETION 16 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) NEVER NULL
-def information_schema EVENTS ORIGINATOR 21 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) NEVER NULL
-def information_schema EVENTS SQL_MODE 12 NULL NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) NEVER NULL
-def information_schema EVENTS STARTS 13 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def information_schema EVENTS STATUS 15 NULL NO varchar 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(18) NEVER NULL
-def information_schema EVENTS TIME_ZONE 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema FILES AUTOEXTEND_SIZE 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema FILES AVG_ROW_LENGTH 28 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema FILES CHECK_TIME 35 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def information_schema FILES CREATE_TIME 33 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def information_schema FILES CREATION_TIME 20 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def information_schema FILES DATA_FREE 32 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema FILES DATA_LENGTH 29 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema FILES DELETED_ROWS 12 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL
-def information_schema FILES ENGINE 10 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema FILES EXTENT_SIZE 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL
-def information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(255) NEVER NULL
-def information_schema FILES FILE_ID 1 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL
-def information_schema FILES FILE_NAME 2 NULL YES varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema FILES FILE_TYPE 3 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL
-def information_schema FILES FREE_EXTENTS 14 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL
-def information_schema FILES FULLTEXT_KEYS 11 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema FILES INDEX_LENGTH 31 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema FILES INITIAL_SIZE 17 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema FILES LAST_ACCESS_TIME 22 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def information_schema FILES LAST_UPDATE_TIME 21 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def information_schema FILES LOGFILE_GROUP_NAME 8 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema FILES LOGFILE_GROUP_NUMBER 9 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL
-def information_schema FILES MAXIMUM_SIZE 18 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema FILES MAX_DATA_LENGTH 30 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema FILES RECOVER_TIME 23 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL
-def information_schema FILES ROW_FORMAT 26 NULL YES varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) NEVER NULL
-def information_schema FILES STATUS 37 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL
-def information_schema FILES TABLESPACE_NAME 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema FILES TABLE_CATALOG 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema FILES TABLE_NAME 7 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema FILES TABLE_ROWS 27 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema FILES TABLE_SCHEMA 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema FILES TOTAL_EXTENTS 15 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL
-def information_schema FILES TRANSACTION_COUNTER 24 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL
-def information_schema FILES UPDATE_COUNT 13 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL
-def information_schema FILES UPDATE_TIME 34 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def information_schema FILES VERSION 25 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema GEOMETRY_COLUMNS COORD_DIMENSION 11 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) NEVER NULL
-def information_schema GEOMETRY_COLUMNS F_GEOMETRY_COLUMN 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema GEOMETRY_COLUMNS F_TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema GEOMETRY_COLUMNS F_TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema GEOMETRY_COLUMNS F_TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema GEOMETRY_COLUMNS GEOMETRY_TYPE 10 NULL NO int NULL NULL 10 0 NULL NULL NULL int(7) NEVER NULL
-def information_schema GEOMETRY_COLUMNS G_GEOMETRY_COLUMN 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema GEOMETRY_COLUMNS G_TABLE_CATALOG 5 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema GEOMETRY_COLUMNS G_TABLE_NAME 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema GEOMETRY_COLUMNS G_TABLE_SCHEMA 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema GEOMETRY_COLUMNS MAX_PPR 12 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) NEVER NULL
-def information_schema GEOMETRY_COLUMNS SRID 13 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) NEVER NULL
-def information_schema GEOMETRY_COLUMNS STORAGE_TYPE 9 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) NEVER NULL
-def information_schema GLOBAL_STATUS VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL NO varchar 4096 12288 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(4096) NEVER NULL
-def information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL NO varchar 4096 12288 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(4096) NEVER NULL
-def information_schema INDEX_STATISTICS INDEX_NAME 3 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL
-def information_schema INDEX_STATISTICS ROWS_READ 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema INDEX_STATISTICS TABLE_NAME 2 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL
-def information_schema INDEX_STATISTICS TABLE_SCHEMA 1 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL
-def information_schema KEYWORDS WORD 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema KEY_CACHES BLOCK_SIZE 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema KEY_CACHES DIRTY_BLOCKS 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema KEY_CACHES FULL_SIZE 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema KEY_CACHES KEY_CACHE_NAME 1 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL
-def information_schema KEY_CACHES READS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema KEY_CACHES READ_REQUESTS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema KEY_CACHES SEGMENTS 2 NULL YES int NULL NULL 10 0 NULL NULL NULL int(3) unsigned NEVER NULL
-def information_schema KEY_CACHES SEGMENT_NUMBER 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(3) unsigned NEVER NULL
-def information_schema KEY_CACHES UNUSED_BLOCKS 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema KEY_CACHES USED_BLOCKS 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema KEY_CACHES WRITES 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema KEY_CACHES WRITE_REQUESTS 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema KEY_COLUMN_USAGE COLUMN_NAME 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema KEY_COLUMN_USAGE ORDINAL_POSITION 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) NEVER NULL
-def information_schema KEY_COLUMN_USAGE POSITION_IN_UNIQUE_CONSTRAINT 9 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(10) NEVER NULL
-def information_schema KEY_COLUMN_USAGE REFERENCED_COLUMN_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_NAME 11 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA 10 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema KEY_COLUMN_USAGE TABLE_NAME 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema KEY_COLUMN_USAGE TABLE_SCHEMA 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema OPTIMIZER_TRACE INSUFFICIENT_PRIVILEGES 4 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) NEVER NULL
-def information_schema OPTIMIZER_TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(20) NEVER NULL
-def information_schema OPTIMIZER_TRACE QUERY 1 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL
-def information_schema OPTIMIZER_TRACE TRACE 2 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL
-def information_schema PARAMETERS CHARACTER_MAXIMUM_LENGTH 8 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL
-def information_schema PARAMETERS CHARACTER_OCTET_LENGTH 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL
-def information_schema PARAMETERS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema PARAMETERS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema PARAMETERS DATA_TYPE 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema PARAMETERS DATETIME_PRECISION 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema PARAMETERS DTD_IDENTIFIER 15 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL
-def information_schema PARAMETERS NUMERIC_PRECISION 10 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL
-def information_schema PARAMETERS NUMERIC_SCALE 11 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL
-def information_schema PARAMETERS ORDINAL_POSITION 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL
-def information_schema PARAMETERS PARAMETER_MODE 5 NULL YES varchar 5 15 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(5) NEVER NULL
-def information_schema PARAMETERS PARAMETER_NAME 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema PARAMETERS ROUTINE_TYPE 16 NULL NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) NEVER NULL
-def information_schema PARAMETERS SPECIFIC_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema PARAMETERS SPECIFIC_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema PARAMETERS SPECIFIC_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema PARTITIONS AVG_ROW_LENGTH 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema PARTITIONS CHECKSUM 22 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema PARTITIONS CHECK_TIME 21 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def information_schema PARTITIONS CREATE_TIME 19 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def information_schema PARTITIONS DATA_FREE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema PARTITIONS DATA_LENGTH 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema PARTITIONS INDEX_LENGTH 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema PARTITIONS MAX_DATA_LENGTH 16 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema PARTITIONS NODEGROUP 24 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) NEVER NULL
-def information_schema PARTITIONS PARTITION_COMMENT 23 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL
-def information_schema PARTITIONS PARTITION_DESCRIPTION 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL
-def information_schema PARTITIONS PARTITION_EXPRESSION 10 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL
-def information_schema PARTITIONS PARTITION_METHOD 8 NULL YES varchar 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(18) NEVER NULL
-def information_schema PARTITIONS PARTITION_NAME 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema PARTITIONS PARTITION_ORDINAL_POSITION 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema PARTITIONS SUBPARTITION_EXPRESSION 11 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL
-def information_schema PARTITIONS SUBPARTITION_METHOD 9 NULL YES varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) NEVER NULL
-def information_schema PARTITIONS SUBPARTITION_NAME 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema PARTITIONS SUBPARTITION_ORDINAL_POSITION 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema PARTITIONS TABLESPACE_NAME 25 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema PARTITIONS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema PARTITIONS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema PARTITIONS TABLE_ROWS 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema PARTITIONS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema PARTITIONS UPDATE_TIME 20 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def information_schema PLUGINS LOAD_OPTION 11 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema PLUGINS PLUGIN_AUTH_VERSION 13 NULL YES varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL
-def information_schema PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL
-def information_schema PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL
-def information_schema PLUGINS PLUGIN_LICENSE 10 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL
-def information_schema PLUGINS PLUGIN_MATURITY 12 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) NEVER NULL
-def information_schema PLUGINS PLUGIN_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema PLUGINS PLUGIN_STATUS 3 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) NEVER NULL
-def information_schema PLUGINS PLUGIN_TYPE 4 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL
-def information_schema PLUGINS PLUGIN_TYPE_VERSION 5 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL
-def information_schema PLUGINS PLUGIN_VERSION 2 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL
-def information_schema PROCESSLIST COMMAND 5 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) NEVER NULL
-def information_schema PROCESSLIST DB 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema PROCESSLIST EXAMINED_ROWS 15 NULL NO int NULL NULL 10 0 NULL NULL NULL int(7) NEVER NULL
-def information_schema PROCESSLIST HOST 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema PROCESSLIST ID 1 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL
-def information_schema PROCESSLIST INFO 8 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL
-def information_schema PROCESSLIST INFO_BINARY 17 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob NEVER NULL
-def information_schema PROCESSLIST MAX_MEMORY_USED 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(7) NEVER NULL
-def information_schema PROCESSLIST MAX_STAGE 11 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) NEVER NULL
-def information_schema PROCESSLIST MEMORY_USED 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(7) NEVER NULL
-def information_schema PROCESSLIST PROGRESS 12 NULL NO decimal NULL NULL 7 3 NULL NULL NULL decimal(7,3) NEVER NULL
-def information_schema PROCESSLIST QUERY_ID 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL
-def information_schema PROCESSLIST STAGE 10 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) NEVER NULL
-def information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema PROCESSLIST TID 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL
-def information_schema PROCESSLIST TIME 6 NULL NO int NULL NULL 10 0 NULL NULL NULL int(7) NEVER NULL
-def information_schema PROCESSLIST TIME_MS 9 NULL NO decimal NULL NULL 22 3 NULL NULL NULL decimal(22,3) NEVER NULL
-def information_schema PROCESSLIST USER 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) NEVER NULL
-def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema REFERENTIAL_CONSTRAINTS DELETE_RULE 9 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema REFERENTIAL_CONSTRAINTS MATCH_OPTION 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema REFERENTIAL_CONSTRAINTS REFERENCED_TABLE_NAME 11 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema REFERENTIAL_CONSTRAINTS TABLE_NAME 10 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_CATALOG 4 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_NAME 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_SCHEMA 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema REFERENTIAL_CONSTRAINTS UPDATE_RULE 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema ROUTINES CHARACTER_MAXIMUM_LENGTH 7 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL
-def information_schema ROUTINES CHARACTER_OCTET_LENGTH 8 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL
-def information_schema ROUTINES CHARACTER_SET_CLIENT 29 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL
-def information_schema ROUTINES CHARACTER_SET_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema ROUTINES COLLATION_CONNECTION 30 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema ROUTINES COLLATION_NAME 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema ROUTINES CREATED 24 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def information_schema ROUTINES DATABASE_COLLATION 31 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema ROUTINES DATA_TYPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema ROUTINES DATETIME_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema ROUTINES DEFINER 28 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) NEVER NULL
-def information_schema ROUTINES DTD_IDENTIFIER 14 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL
-def information_schema ROUTINES EXTERNAL_LANGUAGE 18 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema ROUTINES EXTERNAL_NAME 17 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema ROUTINES IS_DETERMINISTIC 20 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL
-def information_schema ROUTINES LAST_ALTERED 25 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def information_schema ROUTINES NUMERIC_PRECISION 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL
-def information_schema ROUTINES NUMERIC_SCALE 10 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL
-def information_schema ROUTINES PARAMETER_STYLE 19 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) NEVER NULL
-def information_schema ROUTINES ROUTINE_BODY 15 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) NEVER NULL
-def information_schema ROUTINES ROUTINE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema ROUTINES ROUTINE_COMMENT 27 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL
-def information_schema ROUTINES ROUTINE_DEFINITION 16 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL
-def information_schema ROUTINES ROUTINE_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema ROUTINES ROUTINE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema ROUTINES ROUTINE_TYPE 5 NULL NO varchar 13 39 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(13) NEVER NULL
-def information_schema ROUTINES SECURITY_TYPE 23 NULL NO varchar 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(7) NEVER NULL
-def information_schema ROUTINES SPECIFIC_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema ROUTINES SQL_DATA_ACCESS 21 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema ROUTINES SQL_MODE 26 NULL NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) NEVER NULL
-def information_schema ROUTINES SQL_PATH 22 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema SCHEMATA CATALOG_NAME 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME 3 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL
-def information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema SCHEMATA SCHEMA_COMMENT 6 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) NEVER NULL
-def information_schema SCHEMATA SCHEMA_NAME 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema SCHEMATA SQL_PATH 5 NULL YES varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema SCHEMA_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) NEVER NULL
-def information_schema SCHEMA_PRIVILEGES IS_GRANTABLE 5 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL
-def information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema SESSION_STATUS VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL NO varchar 4096 12288 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(4096) NEVER NULL
-def information_schema SESSION_VARIABLES VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL NO varchar 4096 12288 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(4096) NEVER NULL
-def information_schema SPATIAL_REF_SYS AUTH_NAME 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema SPATIAL_REF_SYS AUTH_SRID 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(5) NEVER NULL
-def information_schema SPATIAL_REF_SYS SRID 1 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) NEVER NULL
-def information_schema SPATIAL_REF_SYS SRTEXT 4 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL
-def information_schema SQL_FUNCTIONS FUNCTION 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1) NEVER NULL
-def information_schema STATISTICS COLUMN_NAME 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema STATISTICS COMMENT 15 NULL YES varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) NEVER NULL
-def information_schema STATISTICS IGNORED 17 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL
-def information_schema STATISTICS INDEX_COMMENT 16 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) NEVER NULL
-def information_schema STATISTICS INDEX_NAME 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema STATISTICS INDEX_SCHEMA 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema STATISTICS INDEX_TYPE 14 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) NEVER NULL
-def information_schema STATISTICS NON_UNIQUE 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(1) NEVER NULL
-def information_schema STATISTICS NULLABLE 13 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL
-def information_schema STATISTICS PACKED 12 NULL YES varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) NEVER NULL
-def information_schema STATISTICS SEQ_IN_INDEX 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(2) NEVER NULL
-def information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(3) NEVER NULL
-def information_schema STATISTICS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema STATISTICS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema STATISTICS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema SYSTEM_VARIABLES COMMAND_LINE_ARGUMENT 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema SYSTEM_VARIABLES DEFAULT_VALUE 5 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL
-def information_schema SYSTEM_VARIABLES ENUM_VALUE_LIST 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL
-def information_schema SYSTEM_VARIABLES GLOBAL_VALUE 3 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL
-def information_schema SYSTEM_VARIABLES GLOBAL_VALUE_ORIGIN 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema SYSTEM_VARIABLES GLOBAL_VALUE_PATH 15 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL
-def information_schema SYSTEM_VARIABLES NUMERIC_BLOCK_SIZE 11 NULL YES varchar 21 63 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(21) NEVER NULL
-def information_schema SYSTEM_VARIABLES NUMERIC_MAX_VALUE 10 NULL YES varchar 21 63 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(21) NEVER NULL
-def information_schema SYSTEM_VARIABLES NUMERIC_MIN_VALUE 9 NULL YES varchar 21 63 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(21) NEVER NULL
-def information_schema SYSTEM_VARIABLES READ_ONLY 13 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL
-def information_schema SYSTEM_VARIABLES SESSION_VALUE 2 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL
-def information_schema SYSTEM_VARIABLES VARIABLE_COMMENT 8 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL
-def information_schema SYSTEM_VARIABLES VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema SYSTEM_VARIABLES VARIABLE_SCOPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema SYSTEM_VARIABLES VARIABLE_TYPE 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL
-def information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema TABLES ENGINE 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema TABLES MAX_INDEX_LENGTH 22 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema TABLES ROW_FORMAT 7 NULL YES varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) NEVER NULL
-def information_schema TABLES TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TABLES TABLE_COMMENT 21 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL
-def information_schema TABLES TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema TABLES TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TABLES TABLE_TYPE 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TABLES TEMPORARY 23 NULL YES varchar 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1) NEVER NULL
-def information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema TABLESPACES AUTOEXTEND_SIZE 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema TABLESPACES ENGINE 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TABLESPACES EXTENT_SIZE 5 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema TABLESPACES LOGFILE_GROUP_NAME 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TABLESPACES MAXIMUM_SIZE 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema TABLESPACES NODEGROUP_ID 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema TABLESPACES TABLESPACE_COMMENT 9 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL
-def information_schema TABLESPACES TABLESPACE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TABLESPACES TABLESPACE_TYPE 3 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TABLE_CONSTRAINTS CONSTRAINT_TYPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TABLE_CONSTRAINTS TABLE_NAME 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TABLE_CONSTRAINTS TABLE_SCHEMA 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TABLE_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) NEVER NULL
-def information_schema TABLE_PRIVILEGES IS_GRANTABLE 6 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL
-def information_schema TABLE_PRIVILEGES PRIVILEGE_TYPE 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TABLE_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema TABLE_PRIVILEGES TABLE_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TABLE_PRIVILEGES TABLE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TABLE_STATISTICS ROWS_CHANGED 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema TABLE_STATISTICS ROWS_CHANGED_X_INDEXES 5 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema TABLE_STATISTICS ROWS_READ 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema TABLE_STATISTICS TABLE_NAME 2 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL
-def information_schema TABLE_STATISTICS TABLE_SCHEMA 1 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL
-def information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL
-def information_schema TRIGGERS ACTION_ORDER 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL
-def information_schema TRIGGERS ACTION_ORIENTATION 11 NULL NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) NEVER NULL
-def information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL
-def information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL
-def information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL
-def information_schema TRIGGERS ACTION_TIMING 12 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) NEVER NULL
-def information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL
-def information_schema TRIGGERS COLLATION_CONNECTION 21 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL 2 NULL NULL datetime(2) NEVER NULL
-def information_schema TRIGGERS DATABASE_COLLATION 22 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TRIGGERS DEFINER 19 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) NEVER NULL
-def information_schema TRIGGERS EVENT_MANIPULATION 4 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) NEVER NULL
-def information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TRIGGERS SQL_MODE 18 NULL NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) NEVER NULL
-def information_schema TRIGGERS TRIGGER_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema TRIGGERS TRIGGER_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema TRIGGERS TRIGGER_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema USER_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) NEVER NULL
-def information_schema USER_PRIVILEGES IS_GRANTABLE 4 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL
-def information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema USER_STATISTICS ACCESS_DENIED 22 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema USER_STATISTICS BINLOG_BYTES_WRITTEN 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema USER_STATISTICS BUSY_TIME 5 NULL NO double NULL NULL 21 NULL NULL NULL NULL double NEVER NULL
-def information_schema USER_STATISTICS BYTES_RECEIVED 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema USER_STATISTICS BYTES_SENT 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema USER_STATISTICS COMMIT_TRANSACTIONS 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema USER_STATISTICS CONCURRENT_CONNECTIONS 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def information_schema USER_STATISTICS CONNECTED_TIME 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def information_schema USER_STATISTICS CPU_TIME 6 NULL NO double NULL NULL 21 NULL NULL NULL NULL double NEVER NULL
-def information_schema USER_STATISTICS DENIED_CONNECTIONS 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema USER_STATISTICS EMPTY_QUERIES 23 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema USER_STATISTICS LOST_CONNECTIONS 21 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema USER_STATISTICS MAX_STATEMENT_TIME_EXCEEDED 25 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema USER_STATISTICS OTHER_COMMANDS 17 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema USER_STATISTICS ROLLBACK_TRANSACTIONS 19 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema USER_STATISTICS ROWS_DELETED 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema USER_STATISTICS ROWS_INSERTED 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema USER_STATISTICS ROWS_READ 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema USER_STATISTICS ROWS_SENT 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema USER_STATISTICS ROWS_UPDATED 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema USER_STATISTICS SELECT_COMMANDS 15 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema USER_STATISTICS TOTAL_CONNECTIONS 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def information_schema USER_STATISTICS TOTAL_SSL_CONNECTIONS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def information_schema USER_STATISTICS UPDATE_COMMANDS 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def information_schema USER_STATISTICS USER 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) NEVER NULL
-def information_schema VIEWS ALGORITHM 11 NULL NO varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) NEVER NULL
-def information_schema VIEWS CHARACTER_SET_CLIENT 9 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL
-def information_schema VIEWS CHECK_OPTION 5 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) NEVER NULL
-def information_schema VIEWS COLLATION_CONNECTION 10 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema VIEWS DEFINER 7 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) NEVER NULL
-def information_schema VIEWS IS_UPDATABLE 6 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL
-def information_schema VIEWS SECURITY_TYPE 8 NULL NO varchar 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(7) NEVER NULL
-def information_schema VIEWS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def information_schema VIEWS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema VIEWS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
+def information_schema ALL_PLUGINS LOAD_OPTION 11 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_AUTH_VERSION 13 NULL YES varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_LICENSE 10 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_MATURITY 12 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_STATUS 3 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_TYPE 4 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_TYPE_VERSION 5 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL NO NO
+def information_schema ALL_PLUGINS PLUGIN_VERSION 2 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL NO NO
+def information_schema APPLICABLE_ROLES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) NEVER NULL NO NO
+def information_schema APPLICABLE_ROLES IS_DEFAULT 4 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
+def information_schema APPLICABLE_ROLES IS_GRANTABLE 3 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
+def information_schema APPLICABLE_ROLES ROLE_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) NEVER NULL NO NO
+def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL NO NO
+def information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema CHARACTER_SETS DESCRIPTION 3 NULL NO varchar 60 180 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(60) NEVER NULL NO NO
+def information_schema CHARACTER_SETS MAXLEN 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) NEVER NULL NO NO
+def information_schema CHECK_CONSTRAINTS CHECK_CLAUSE 6 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL NO NO
+def information_schema CHECK_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema CHECK_CONSTRAINTS LEVEL 5 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) NEVER NULL NO NO
+def information_schema CHECK_CONSTRAINTS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS ACCESS_DENIED 22 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS BINLOG_BYTES_WRITTEN 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS BUSY_TIME 5 NULL NO double NULL NULL 21 NULL NULL NULL NULL double NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS BYTES_RECEIVED 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS BYTES_SENT 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS CLIENT 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS COMMIT_TRANSACTIONS 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS CONCURRENT_CONNECTIONS 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS CONNECTED_TIME 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS CPU_TIME 6 NULL NO double NULL NULL 21 NULL NULL NULL NULL double NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS DENIED_CONNECTIONS 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS EMPTY_QUERIES 23 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS LOST_CONNECTIONS 21 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS MAX_STATEMENT_TIME_EXCEEDED 25 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS OTHER_COMMANDS 17 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS ROLLBACK_TRANSACTIONS 19 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS ROWS_DELETED 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS ROWS_INSERTED 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS ROWS_READ 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS ROWS_SENT 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS ROWS_UPDATED 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS SELECT_COMMANDS 15 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS TOTAL_CONNECTIONS 2 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS TOTAL_SSL_CONNECTIONS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema CLIENT_STATISTICS UPDATE_COMMANDS 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema COLLATIONS CHARACTER_SET_NAME 2 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL NO NO
+def information_schema COLLATIONS COLLATION_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema COLLATIONS ID 3 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(11) NEVER NULL NO NO
+def information_schema COLLATIONS IS_COMPILED 5 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
+def information_schema COLLATIONS IS_DEFAULT 4 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
+def information_schema COLLATIONS SORTLEN 6 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) NEVER NULL NO NO
+def information_schema COLLATION_CHARACTER_SET_APPLICABILITY CHARACTER_SET_NAME 2 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL NO NO
+def information_schema COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema COLLATION_CHARACTER_SET_APPLICABILITY FULL_COLLATION_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema COLLATION_CHARACTER_SET_APPLICABILITY ID 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(11) NEVER NULL NO NO
+def information_schema COLLATION_CHARACTER_SET_APPLICABILITY IS_DEFAULT 5 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
+def information_schema COLUMNS CHARACTER_MAXIMUM_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema COLUMNS CHARACTER_OCTET_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema COLUMNS CHARACTER_SET_NAME 14 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL NO NO
+def information_schema COLUMNS COLLATION_NAME 15 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema COLUMNS COLUMN_COMMENT 20 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) NEVER NULL NO NO
+def information_schema COLUMNS COLUMN_DEFAULT 6 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL NO NO
+def information_schema COLUMNS COLUMN_KEY 17 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
+def information_schema COLUMNS COLUMN_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema COLUMNS COLUMN_TYPE 16 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL NO NO
+def information_schema COLUMNS DATA_TYPE 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema COLUMNS DATETIME_PRECISION 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema COLUMNS EXTRA 18 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL NO NO
+def information_schema COLUMNS GENERATION_EXPRESSION 22 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL NO NO
+def information_schema COLUMNS IS_GENERATED 21 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) NEVER NULL NO NO
+def information_schema COLUMNS IS_NULLABLE 7 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
+def information_schema COLUMNS IS_SYSTEM_TIME_PERIOD_END 24 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
+def information_schema COLUMNS IS_SYSTEM_TIME_PERIOD_START 23 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
+def information_schema COLUMNS NUMERIC_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema COLUMNS NUMERIC_SCALE 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema COLUMNS ORDINAL_POSITION 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema COLUMNS PRIVILEGES 19 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL NO NO
+def information_schema COLUMNS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema COLUMNS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema COLUMNS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema COLUMN_PRIVILEGES COLUMN_NAME 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema COLUMN_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) NEVER NULL NO NO
+def information_schema COLUMN_PRIVILEGES IS_GRANTABLE 7 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
+def information_schema COLUMN_PRIVILEGES PRIVILEGE_TYPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema COLUMN_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema COLUMN_PRIVILEGES TABLE_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema COLUMN_PRIVILEGES TABLE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema ENABLED_ROLES ROLE_NAME 1 NULL YES varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) NEVER NULL NO NO
+def information_schema ENGINES COMMENT 3 NULL NO varchar 160 480 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(160) NEVER NULL NO NO
+def information_schema ENGINES ENGINE 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema ENGINES SAVEPOINTS 6 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
+def information_schema ENGINES SUPPORT 2 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) NEVER NULL NO NO
+def information_schema ENGINES TRANSACTIONS 4 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
+def information_schema ENGINES XA 5 NULL YES varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
+def information_schema EVENTS CHARACTER_SET_CLIENT 22 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL NO NO
+def information_schema EVENTS COLLATION_CONNECTION 23 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema EVENTS CREATED 17 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def information_schema EVENTS DATABASE_COLLATION 24 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema EVENTS DEFINER 4 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) NEVER NULL NO NO
+def information_schema EVENTS ENDS 14 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def information_schema EVENTS EVENT_BODY 6 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) NEVER NULL NO NO
+def information_schema EVENTS EVENT_CATALOG 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema EVENTS EVENT_COMMENT 20 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema EVENTS EVENT_DEFINITION 7 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL NO NO
+def information_schema EVENTS EVENT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema EVENTS EVENT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema EVENTS EVENT_TYPE 8 NULL NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) NEVER NULL NO NO
+def information_schema EVENTS EXECUTE_AT 9 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def information_schema EVENTS INTERVAL_FIELD 11 NULL YES varchar 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(18) NEVER NULL NO NO
+def information_schema EVENTS INTERVAL_VALUE 10 NULL YES varchar 256 768 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(256) NEVER NULL NO NO
+def information_schema EVENTS LAST_ALTERED 18 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def information_schema EVENTS LAST_EXECUTED 19 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def information_schema EVENTS ON_COMPLETION 16 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) NEVER NULL NO NO
+def information_schema EVENTS ORIGINATOR 21 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) NEVER NULL NO NO
+def information_schema EVENTS SQL_MODE 12 NULL NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) NEVER NULL NO NO
+def information_schema EVENTS STARTS 13 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def information_schema EVENTS STATUS 15 NULL NO varchar 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(18) NEVER NULL NO NO
+def information_schema EVENTS TIME_ZONE 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema FILES AUTOEXTEND_SIZE 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema FILES AVG_ROW_LENGTH 28 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema FILES CHECKSUM 36 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema FILES CHECK_TIME 35 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def information_schema FILES CREATE_TIME 33 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def information_schema FILES CREATION_TIME 20 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def information_schema FILES DATA_FREE 32 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema FILES DATA_LENGTH 29 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema FILES DELETED_ROWS 12 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL NO NO
+def information_schema FILES ENGINE 10 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema FILES EXTENT_SIZE 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL NO NO
+def information_schema FILES EXTRA 38 NULL YES varchar 255 765 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(255) NEVER NULL NO NO
+def information_schema FILES FILE_ID 1 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL NO NO
+def information_schema FILES FILE_NAME 2 NULL YES varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema FILES FILE_TYPE 3 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL NO NO
+def information_schema FILES FREE_EXTENTS 14 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL NO NO
+def information_schema FILES FULLTEXT_KEYS 11 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema FILES INDEX_LENGTH 31 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema FILES INITIAL_SIZE 17 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema FILES LAST_ACCESS_TIME 22 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def information_schema FILES LAST_UPDATE_TIME 21 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def information_schema FILES LOGFILE_GROUP_NAME 8 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema FILES LOGFILE_GROUP_NUMBER 9 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL NO NO
+def information_schema FILES MAXIMUM_SIZE 18 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema FILES MAX_DATA_LENGTH 30 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema FILES RECOVER_TIME 23 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL NO NO
+def information_schema FILES ROW_FORMAT 26 NULL YES varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) NEVER NULL NO NO
+def information_schema FILES STATUS 37 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL NO NO
+def information_schema FILES TABLESPACE_NAME 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema FILES TABLE_CATALOG 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema FILES TABLE_NAME 7 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema FILES TABLE_ROWS 27 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema FILES TABLE_SCHEMA 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema FILES TOTAL_EXTENTS 15 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL NO NO
+def information_schema FILES TRANSACTION_COUNTER 24 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL NO NO
+def information_schema FILES UPDATE_COUNT 13 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL NO NO
+def information_schema FILES UPDATE_TIME 34 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def information_schema FILES VERSION 25 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS COORD_DIMENSION 11 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS F_GEOMETRY_COLUMN 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS F_TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS F_TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS F_TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS GEOMETRY_TYPE 10 NULL NO int NULL NULL 10 0 NULL NULL NULL int(7) NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS G_GEOMETRY_COLUMN 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS G_TABLE_CATALOG 5 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS G_TABLE_NAME 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS G_TABLE_SCHEMA 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS MAX_PPR 12 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS SRID 13 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) NEVER NULL NO NO
+def information_schema GEOMETRY_COLUMNS STORAGE_TYPE 9 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) NEVER NULL NO NO
+def information_schema GLOBAL_STATUS VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema GLOBAL_STATUS VARIABLE_VALUE 2 NULL NO varchar 4096 12288 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(4096) NEVER NULL NO NO
+def information_schema GLOBAL_VARIABLES VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema GLOBAL_VARIABLES VARIABLE_VALUE 2 NULL NO varchar 4096 12288 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(4096) NEVER NULL NO NO
+def information_schema INDEX_STATISTICS INDEX_NAME 3 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL NO NO
+def information_schema INDEX_STATISTICS ROWS_READ 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema INDEX_STATISTICS TABLE_NAME 2 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL NO NO
+def information_schema INDEX_STATISTICS TABLE_SCHEMA 1 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL NO NO
+def information_schema KEYWORDS WORD 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema KEY_CACHES BLOCK_SIZE 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema KEY_CACHES DIRTY_BLOCKS 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema KEY_CACHES FULL_SIZE 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema KEY_CACHES KEY_CACHE_NAME 1 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL NO NO
+def information_schema KEY_CACHES READS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema KEY_CACHES READ_REQUESTS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema KEY_CACHES SEGMENTS 2 NULL YES int NULL NULL 10 0 NULL NULL NULL int(3) unsigned NEVER NULL NO NO
+def information_schema KEY_CACHES SEGMENT_NUMBER 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(3) unsigned NEVER NULL NO NO
+def information_schema KEY_CACHES UNUSED_BLOCKS 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema KEY_CACHES USED_BLOCKS 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema KEY_CACHES WRITES 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema KEY_CACHES WRITE_REQUESTS 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE COLUMN_NAME 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE CONSTRAINT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE ORDINAL_POSITION 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE POSITION_IN_UNIQUE_CONSTRAINT 9 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(10) NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE REFERENCED_COLUMN_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_NAME 11 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA 10 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE TABLE_CATALOG 4 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE TABLE_NAME 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema KEY_COLUMN_USAGE TABLE_SCHEMA 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema KEY_PERIOD_USAGE CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema KEY_PERIOD_USAGE CONSTRAINT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema KEY_PERIOD_USAGE CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema KEY_PERIOD_USAGE PERIOD_NAME 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema KEY_PERIOD_USAGE TABLE_CATALOG 4 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema KEY_PERIOD_USAGE TABLE_NAME 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema KEY_PERIOD_USAGE TABLE_SCHEMA 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS ENGINE 1 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_DISK_READ_COST 2 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_DISK_READ_RATIO 8 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_INDEX_BLOCK_COPY_COST 3 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_KEY_COMPARE_COST 4 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_KEY_COPY_COST 5 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_KEY_LOOKUP_COST 6 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_KEY_NEXT_FIND_COST 7 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_ROWID_COMPARE_COST 12 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_ROWID_COPY_COST 13 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_ROW_COPY_COST 9 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_ROW_LOOKUP_COST 10 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) NEVER NULL NO NO
+def information_schema OPTIMIZER_COSTS OPTIMIZER_ROW_NEXT_FIND_COST 11 NULL NO decimal NULL NULL 9 6 NULL NULL NULL decimal(9,6) NEVER NULL NO NO
+def information_schema OPTIMIZER_TRACE INSUFFICIENT_PRIVILEGES 4 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) NEVER NULL NO NO
+def information_schema OPTIMIZER_TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(20) NEVER NULL NO NO
+def information_schema OPTIMIZER_TRACE QUERY 1 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL NO NO
+def information_schema OPTIMIZER_TRACE TRACE 2 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL NO NO
+def information_schema PARAMETERS CHARACTER_MAXIMUM_LENGTH 8 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL NO NO
+def information_schema PARAMETERS CHARACTER_OCTET_LENGTH 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL NO NO
+def information_schema PARAMETERS CHARACTER_SET_NAME 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema PARAMETERS COLLATION_NAME 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema PARAMETERS DATA_TYPE 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema PARAMETERS DATETIME_PRECISION 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema PARAMETERS DTD_IDENTIFIER 15 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL NO NO
+def information_schema PARAMETERS NUMERIC_PRECISION 10 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL NO NO
+def information_schema PARAMETERS NUMERIC_SCALE 11 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL NO NO
+def information_schema PARAMETERS ORDINAL_POSITION 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL NO NO
+def information_schema PARAMETERS PARAMETER_MODE 5 NULL YES varchar 5 15 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(5) NEVER NULL NO NO
+def information_schema PARAMETERS PARAMETER_NAME 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema PARAMETERS ROUTINE_TYPE 16 NULL NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) NEVER NULL NO NO
+def information_schema PARAMETERS SPECIFIC_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema PARAMETERS SPECIFIC_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema PARAMETERS SPECIFIC_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema PARTITIONS AVG_ROW_LENGTH 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema PARTITIONS CHECKSUM 22 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema PARTITIONS CHECK_TIME 21 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def information_schema PARTITIONS CREATE_TIME 19 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def information_schema PARTITIONS DATA_FREE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema PARTITIONS DATA_LENGTH 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema PARTITIONS INDEX_LENGTH 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema PARTITIONS MAX_DATA_LENGTH 16 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema PARTITIONS NODEGROUP 24 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) NEVER NULL NO NO
+def information_schema PARTITIONS PARTITION_COMMENT 23 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL NO NO
+def information_schema PARTITIONS PARTITION_DESCRIPTION 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL NO NO
+def information_schema PARTITIONS PARTITION_EXPRESSION 10 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL NO NO
+def information_schema PARTITIONS PARTITION_METHOD 8 NULL YES varchar 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(18) NEVER NULL NO NO
+def information_schema PARTITIONS PARTITION_NAME 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema PARTITIONS PARTITION_ORDINAL_POSITION 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema PARTITIONS SUBPARTITION_EXPRESSION 11 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL NO NO
+def information_schema PARTITIONS SUBPARTITION_METHOD 9 NULL YES varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) NEVER NULL NO NO
+def information_schema PARTITIONS SUBPARTITION_NAME 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema PARTITIONS SUBPARTITION_ORDINAL_POSITION 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema PARTITIONS TABLESPACE_NAME 25 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema PARTITIONS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema PARTITIONS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema PARTITIONS TABLE_ROWS 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema PARTITIONS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema PARTITIONS UPDATE_TIME 20 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def information_schema PERIODS END_COLUMN_NAME 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema PERIODS PERIOD 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema PERIODS START_COLUMN_NAME 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema PERIODS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema PERIODS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema PERIODS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema PLUGINS LOAD_OPTION 11 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_AUTH_VERSION 13 NULL YES varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_LICENSE 10 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_MATURITY 12 NULL NO varchar 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(12) NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_STATUS 3 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_TYPE 4 NULL NO varchar 80 240 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(80) NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_TYPE_VERSION 5 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL NO NO
+def information_schema PLUGINS PLUGIN_VERSION 2 NULL NO varchar 20 60 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(20) NEVER NULL NO NO
+def information_schema PROCESSLIST COMMAND 5 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) NEVER NULL NO NO
+def information_schema PROCESSLIST DB 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema PROCESSLIST EXAMINED_ROWS 15 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) NEVER NULL NO NO
+def information_schema PROCESSLIST HOST 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema PROCESSLIST ID 1 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL NO NO
+def information_schema PROCESSLIST INFO 8 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL NO NO
+def information_schema PROCESSLIST INFO_BINARY 18 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob NEVER NULL NO NO
+def information_schema PROCESSLIST MAX_MEMORY_USED 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) NEVER NULL NO NO
+def information_schema PROCESSLIST MAX_STAGE 11 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) NEVER NULL NO NO
+def information_schema PROCESSLIST MEMORY_USED 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) NEVER NULL NO NO
+def information_schema PROCESSLIST PROGRESS 12 NULL NO decimal NULL NULL 7 3 NULL NULL NULL decimal(7,3) NEVER NULL NO NO
+def information_schema PROCESSLIST QUERY_ID 17 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) NEVER NULL NO NO
+def information_schema PROCESSLIST SENT_ROWS 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) NEVER NULL NO NO
+def information_schema PROCESSLIST STAGE 10 NULL NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(2) NEVER NULL NO NO
+def information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema PROCESSLIST TID 19 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) NEVER NULL NO NO
+def information_schema PROCESSLIST TIME 6 NULL NO int NULL NULL 10 0 NULL NULL NULL int(7) NEVER NULL NO NO
+def information_schema PROCESSLIST TIME_MS 9 NULL NO decimal NULL NULL 22 3 NULL NULL NULL decimal(22,3) NEVER NULL NO NO
+def information_schema PROCESSLIST USER 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) NEVER NULL NO NO
+def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema REFERENTIAL_CONSTRAINTS DELETE_RULE 9 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema REFERENTIAL_CONSTRAINTS MATCH_OPTION 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema REFERENTIAL_CONSTRAINTS REFERENCED_TABLE_NAME 11 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema REFERENTIAL_CONSTRAINTS TABLE_NAME 10 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_CATALOG 4 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_NAME 6 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema REFERENTIAL_CONSTRAINTS UNIQUE_CONSTRAINT_SCHEMA 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema REFERENTIAL_CONSTRAINTS UPDATE_RULE 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema ROUTINES CHARACTER_MAXIMUM_LENGTH 7 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL NO NO
+def information_schema ROUTINES CHARACTER_OCTET_LENGTH 8 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL NO NO
+def information_schema ROUTINES CHARACTER_SET_CLIENT 29 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL NO NO
+def information_schema ROUTINES CHARACTER_SET_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema ROUTINES COLLATION_CONNECTION 30 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema ROUTINES COLLATION_NAME 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema ROUTINES CREATED 24 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def information_schema ROUTINES DATABASE_COLLATION 31 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema ROUTINES DATA_TYPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema ROUTINES DATETIME_PRECISION 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema ROUTINES DEFINER 28 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) NEVER NULL NO NO
+def information_schema ROUTINES DTD_IDENTIFIER 14 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL NO NO
+def information_schema ROUTINES EXTERNAL_LANGUAGE 18 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema ROUTINES EXTERNAL_NAME 17 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema ROUTINES IS_DETERMINISTIC 20 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
+def information_schema ROUTINES LAST_ALTERED 25 NULL NO datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def information_schema ROUTINES NUMERIC_PRECISION 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL NO NO
+def information_schema ROUTINES NUMERIC_SCALE 10 NULL YES int NULL NULL 10 0 NULL NULL NULL int(21) NEVER NULL NO NO
+def information_schema ROUTINES PARAMETER_STYLE 19 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) NEVER NULL NO NO
+def information_schema ROUTINES ROUTINE_BODY 15 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) NEVER NULL NO NO
+def information_schema ROUTINES ROUTINE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema ROUTINES ROUTINE_COMMENT 27 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL NO NO
+def information_schema ROUTINES ROUTINE_DEFINITION 16 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL NO NO
+def information_schema ROUTINES ROUTINE_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema ROUTINES ROUTINE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema ROUTINES ROUTINE_TYPE 5 NULL NO varchar 13 39 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(13) NEVER NULL NO NO
+def information_schema ROUTINES SECURITY_TYPE 23 NULL NO varchar 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(7) NEVER NULL NO NO
+def information_schema ROUTINES SPECIFIC_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema ROUTINES SQL_DATA_ACCESS 21 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema ROUTINES SQL_MODE 26 NULL NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) NEVER NULL NO NO
+def information_schema ROUTINES SQL_PATH 22 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema SCHEMATA CATALOG_NAME 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema SCHEMATA DEFAULT_CHARACTER_SET_NAME 3 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL NO NO
+def information_schema SCHEMATA DEFAULT_COLLATION_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema SCHEMATA SCHEMA_COMMENT 6 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) NEVER NULL NO NO
+def information_schema SCHEMATA SCHEMA_NAME 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema SCHEMATA SQL_PATH 5 NULL YES varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema SCHEMA_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) NEVER NULL NO NO
+def information_schema SCHEMA_PRIVILEGES IS_GRANTABLE 5 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
+def information_schema SCHEMA_PRIVILEGES PRIVILEGE_TYPE 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema SCHEMA_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema SCHEMA_PRIVILEGES TABLE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema SESSION_STATUS VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema SESSION_STATUS VARIABLE_VALUE 2 NULL NO varchar 4096 12288 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(4096) NEVER NULL NO NO
+def information_schema SESSION_VARIABLES VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema SESSION_VARIABLES VARIABLE_VALUE 2 NULL NO varchar 4096 12288 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(4096) NEVER NULL NO NO
+def information_schema SPATIAL_REF_SYS AUTH_NAME 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema SPATIAL_REF_SYS AUTH_SRID 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(5) NEVER NULL NO NO
+def information_schema SPATIAL_REF_SYS SRID 1 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) NEVER NULL NO NO
+def information_schema SPATIAL_REF_SYS SRTEXT 4 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL NO NO
+def information_schema SQL_FUNCTIONS FUNCTION 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema STATISTICS CARDINALITY 10 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema STATISTICS COLLATION 9 NULL YES varchar 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1) NEVER NULL NO NO
+def information_schema STATISTICS COLUMN_NAME 8 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema STATISTICS COMMENT 15 NULL YES varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) NEVER NULL NO NO
+def information_schema STATISTICS IGNORED 17 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
+def information_schema STATISTICS INDEX_COMMENT 16 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) NEVER NULL NO NO
+def information_schema STATISTICS INDEX_NAME 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema STATISTICS INDEX_SCHEMA 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema STATISTICS INDEX_TYPE 14 NULL NO varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) NEVER NULL NO NO
+def information_schema STATISTICS NON_UNIQUE 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(1) NEVER NULL NO NO
+def information_schema STATISTICS NULLABLE 13 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
+def information_schema STATISTICS PACKED 12 NULL YES varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) NEVER NULL NO NO
+def information_schema STATISTICS SEQ_IN_INDEX 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(2) NEVER NULL NO NO
+def information_schema STATISTICS SUB_PART 11 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(3) NEVER NULL NO NO
+def information_schema STATISTICS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema STATISTICS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema STATISTICS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES COMMAND_LINE_ARGUMENT 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES DEFAULT_VALUE 5 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES ENUM_VALUE_LIST 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES GLOBAL_VALUE 3 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES GLOBAL_VALUE_ORIGIN 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES GLOBAL_VALUE_PATH 15 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES NUMERIC_BLOCK_SIZE 11 NULL YES varchar 21 63 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(21) NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES NUMERIC_MAX_VALUE 10 NULL YES varchar 21 63 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(21) NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES NUMERIC_MIN_VALUE 9 NULL YES varchar 21 63 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(21) NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES READ_ONLY 13 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES SESSION_VALUE 2 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES VARIABLE_COMMENT 8 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES VARIABLE_SCOPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema SYSTEM_VARIABLES VARIABLE_TYPE 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TABLES AUTO_INCREMENT 14 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema TABLES AVG_ROW_LENGTH 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema TABLES CHECKSUM 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema TABLES CHECK_TIME 17 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def information_schema TABLES CREATE_OPTIONS 20 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL NO NO
+def information_schema TABLES CREATE_TIME 15 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def information_schema TABLES DATA_FREE 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema TABLES DATA_LENGTH 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema TABLES ENGINE 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TABLES INDEX_LENGTH 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema TABLES MAX_DATA_LENGTH 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema TABLES MAX_INDEX_LENGTH 22 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema TABLES ROW_FORMAT 7 NULL YES varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) NEVER NULL NO NO
+def information_schema TABLES TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema TABLES TABLE_COLLATION 18 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TABLES TABLE_COMMENT 21 NULL NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL NO NO
+def information_schema TABLES TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TABLES TABLE_ROWS 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema TABLES TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TABLES TABLE_TYPE 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TABLES TEMPORARY 23 NULL YES varchar 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1) NEVER NULL NO NO
+def information_schema TABLES UPDATE_TIME 16 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def information_schema TABLES VERSION 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema TABLESPACES AUTOEXTEND_SIZE 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema TABLESPACES ENGINE 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TABLESPACES EXTENT_SIZE 5 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema TABLESPACES LOGFILE_GROUP_NAME 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TABLESPACES MAXIMUM_SIZE 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema TABLESPACES NODEGROUP_ID 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema TABLESPACES TABLESPACE_COMMENT 9 NULL YES varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL NO NO
+def information_schema TABLESPACES TABLESPACE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TABLESPACES TABLESPACE_TYPE 3 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TABLE_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema TABLE_CONSTRAINTS CONSTRAINT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TABLE_CONSTRAINTS CONSTRAINT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TABLE_CONSTRAINTS CONSTRAINT_TYPE 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TABLE_CONSTRAINTS TABLE_NAME 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TABLE_CONSTRAINTS TABLE_SCHEMA 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TABLE_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) NEVER NULL NO NO
+def information_schema TABLE_PRIVILEGES IS_GRANTABLE 6 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
+def information_schema TABLE_PRIVILEGES PRIVILEGE_TYPE 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TABLE_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema TABLE_PRIVILEGES TABLE_NAME 4 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TABLE_PRIVILEGES TABLE_SCHEMA 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TABLE_STATISTICS ROWS_CHANGED 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema TABLE_STATISTICS ROWS_CHANGED_X_INDEXES 5 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema TABLE_STATISTICS ROWS_READ 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema TABLE_STATISTICS TABLE_NAME 2 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL NO NO
+def information_schema TABLE_STATISTICS TABLE_SCHEMA 1 NULL NO varchar 192 576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(192) NEVER NULL NO NO
+def information_schema TRIGGERS ACTION_CONDITION 9 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL NO NO
+def information_schema TRIGGERS ACTION_ORDER 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(4) NEVER NULL NO NO
+def information_schema TRIGGERS ACTION_ORIENTATION 11 NULL NO varchar 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(9) NEVER NULL NO NO
+def information_schema TRIGGERS ACTION_REFERENCE_NEW_ROW 16 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
+def information_schema TRIGGERS ACTION_REFERENCE_NEW_TABLE 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TRIGGERS ACTION_REFERENCE_OLD_ROW 15 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
+def information_schema TRIGGERS ACTION_REFERENCE_OLD_TABLE 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TRIGGERS ACTION_STATEMENT 10 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL NO NO
+def information_schema TRIGGERS ACTION_TIMING 12 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) NEVER NULL NO NO
+def information_schema TRIGGERS CHARACTER_SET_CLIENT 20 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL NO NO
+def information_schema TRIGGERS COLLATION_CONNECTION 21 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TRIGGERS CREATED 17 NULL YES datetime NULL NULL NULL NULL 2 NULL NULL datetime(2) NEVER NULL NO NO
+def information_schema TRIGGERS DATABASE_COLLATION 22 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TRIGGERS DEFINER 19 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) NEVER NULL NO NO
+def information_schema TRIGGERS EVENT_MANIPULATION 4 NULL NO varchar 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(6) NEVER NULL NO NO
+def information_schema TRIGGERS EVENT_OBJECT_CATALOG 5 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema TRIGGERS EVENT_OBJECT_SCHEMA 6 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TRIGGERS EVENT_OBJECT_TABLE 7 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TRIGGERS SQL_MODE 18 NULL NO varchar 8192 24576 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8192) NEVER NULL NO NO
+def information_schema TRIGGERS TRIGGER_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema TRIGGERS TRIGGER_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema TRIGGERS TRIGGER_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema USER_PRIVILEGES GRANTEE 1 NULL NO varchar 385 1155 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(385) NEVER NULL NO NO
+def information_schema USER_PRIVILEGES IS_GRANTABLE 4 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
+def information_schema USER_PRIVILEGES PRIVILEGE_TYPE 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema USER_PRIVILEGES TABLE_CATALOG 2 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema USER_STATISTICS ACCESS_DENIED 22 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema USER_STATISTICS BINLOG_BYTES_WRITTEN 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema USER_STATISTICS BUSY_TIME 5 NULL NO double NULL NULL 21 NULL NULL NULL NULL double NEVER NULL NO NO
+def information_schema USER_STATISTICS BYTES_RECEIVED 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema USER_STATISTICS BYTES_SENT 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema USER_STATISTICS COMMIT_TRANSACTIONS 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema USER_STATISTICS CONCURRENT_CONNECTIONS 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def information_schema USER_STATISTICS CONNECTED_TIME 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def information_schema USER_STATISTICS CPU_TIME 6 NULL NO double NULL NULL 21 NULL NULL NULL NULL double NEVER NULL NO NO
+def information_schema USER_STATISTICS DENIED_CONNECTIONS 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema USER_STATISTICS EMPTY_QUERIES 23 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema USER_STATISTICS LOST_CONNECTIONS 21 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema USER_STATISTICS MAX_STATEMENT_TIME_EXCEEDED 25 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema USER_STATISTICS OTHER_COMMANDS 17 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema USER_STATISTICS ROLLBACK_TRANSACTIONS 19 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema USER_STATISTICS ROWS_DELETED 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema USER_STATISTICS ROWS_INSERTED 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema USER_STATISTICS ROWS_READ 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema USER_STATISTICS ROWS_SENT 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema USER_STATISTICS ROWS_UPDATED 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema USER_STATISTICS SELECT_COMMANDS 15 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema USER_STATISTICS TOTAL_CONNECTIONS 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def information_schema USER_STATISTICS TOTAL_SSL_CONNECTIONS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def information_schema USER_STATISTICS UPDATE_COMMANDS 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def information_schema USER_STATISTICS USER 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) NEVER NULL NO NO
+def information_schema VIEWS ALGORITHM 11 NULL NO varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) NEVER NULL NO NO
+def information_schema VIEWS CHARACTER_SET_CLIENT 9 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) NEVER NULL NO NO
+def information_schema VIEWS CHECK_OPTION 5 NULL NO varchar 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(8) NEVER NULL NO NO
+def information_schema VIEWS COLLATION_CONNECTION 10 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema VIEWS DEFINER 7 NULL NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(384) NEVER NULL NO NO
+def information_schema VIEWS IS_UPDATABLE 6 NULL NO varchar 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(3) NEVER NULL NO NO
+def information_schema VIEWS SECURITY_TYPE 8 NULL NO varchar 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(7) NEVER NULL NO NO
+def information_schema VIEWS TABLE_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def information_schema VIEWS TABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema VIEWS TABLE_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def information_schema VIEWS VIEW_DEFINITION 4 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext NEVER NULL NO NO
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
@@ -639,6 +668,8 @@ NULL information_schema COLUMNS DATETIME_PRECISION bigint NULL NULL NULL NULL bi
3.0000 information_schema COLUMNS COLUMN_COMMENT varchar 1024 3072 utf8mb3 utf8mb3_general_ci varchar(1024)
3.0000 information_schema COLUMNS IS_GENERATED varchar 6 18 utf8mb3 utf8mb3_general_ci varchar(6)
1.0000 information_schema COLUMNS GENERATION_EXPRESSION longtext 4294967295 4294967295 utf8mb3 utf8mb3_general_ci longtext
+3.0000 information_schema COLUMNS IS_SYSTEM_TIME_PERIOD_START varchar 3 9 utf8mb3 utf8mb3_general_ci varchar(3)
+3.0000 information_schema COLUMNS IS_SYSTEM_TIME_PERIOD_END varchar 3 9 utf8mb3 utf8mb3_general_ci varchar(3)
3.0000 information_schema COLUMN_PRIVILEGES GRANTEE varchar 385 1155 utf8mb3 utf8mb3_general_ci varchar(385)
3.0000 information_schema COLUMN_PRIVILEGES TABLE_CATALOG varchar 512 1536 utf8mb3 utf8mb3_general_ci varchar(512)
3.0000 information_schema COLUMN_PRIVILEGES TABLE_SCHEMA varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
@@ -761,6 +792,26 @@ NULL information_schema KEY_COLUMN_USAGE POSITION_IN_UNIQUE_CONSTRAINT bigint NU
3.0000 information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_SCHEMA varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
3.0000 information_schema KEY_COLUMN_USAGE REFERENCED_TABLE_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
3.0000 information_schema KEY_COLUMN_USAGE REFERENCED_COLUMN_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
+3.0000 information_schema KEY_PERIOD_USAGE CONSTRAINT_CATALOG varchar 512 1536 utf8mb3 utf8mb3_general_ci varchar(512)
+3.0000 information_schema KEY_PERIOD_USAGE CONSTRAINT_SCHEMA varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
+3.0000 information_schema KEY_PERIOD_USAGE CONSTRAINT_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
+3.0000 information_schema KEY_PERIOD_USAGE TABLE_CATALOG varchar 512 1536 utf8mb3 utf8mb3_general_ci varchar(512)
+3.0000 information_schema KEY_PERIOD_USAGE TABLE_SCHEMA varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
+3.0000 information_schema KEY_PERIOD_USAGE TABLE_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
+3.0000 information_schema KEY_PERIOD_USAGE PERIOD_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
+3.0000 information_schema OPTIMIZER_COSTS ENGINE varchar 192 576 utf8mb3 utf8mb3_general_ci varchar(192)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_DISK_READ_COST decimal NULL NULL NULL NULL decimal(9,6)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_INDEX_BLOCK_COPY_COST decimal NULL NULL NULL NULL decimal(9,6)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_KEY_COMPARE_COST decimal NULL NULL NULL NULL decimal(9,6)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_KEY_COPY_COST decimal NULL NULL NULL NULL decimal(9,6)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_KEY_LOOKUP_COST decimal NULL NULL NULL NULL decimal(9,6)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_KEY_NEXT_FIND_COST decimal NULL NULL NULL NULL decimal(9,6)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_DISK_READ_RATIO decimal NULL NULL NULL NULL decimal(9,6)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_ROW_COPY_COST decimal NULL NULL NULL NULL decimal(9,6)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_ROW_LOOKUP_COST decimal NULL NULL NULL NULL decimal(9,6)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_ROW_NEXT_FIND_COST decimal NULL NULL NULL NULL decimal(9,6)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_ROWID_COMPARE_COST decimal NULL NULL NULL NULL decimal(9,6)
+NULL information_schema OPTIMIZER_COSTS OPTIMIZER_ROWID_COPY_COST decimal NULL NULL NULL NULL decimal(9,6)
1.0000 information_schema OPTIMIZER_TRACE QUERY longtext 4294967295 4294967295 utf8mb3 utf8mb3_general_ci longtext
1.0000 information_schema OPTIMIZER_TRACE TRACE longtext 4294967295 4294967295 utf8mb3 utf8mb3_general_ci longtext
NULL information_schema OPTIMIZER_TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE int NULL NULL NULL NULL int(20)
@@ -806,6 +857,12 @@ NULL information_schema PARTITIONS CHECKSUM bigint NULL NULL NULL NULL bigint(21
3.0000 information_schema PARTITIONS PARTITION_COMMENT varchar 80 240 utf8mb3 utf8mb3_general_ci varchar(80)
3.0000 information_schema PARTITIONS NODEGROUP varchar 12 36 utf8mb3 utf8mb3_general_ci varchar(12)
3.0000 information_schema PARTITIONS TABLESPACE_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
+3.0000 information_schema PERIODS TABLE_CATALOG varchar 512 1536 utf8mb3 utf8mb3_general_ci varchar(512)
+3.0000 information_schema PERIODS TABLE_SCHEMA varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
+3.0000 information_schema PERIODS TABLE_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
+3.0000 information_schema PERIODS PERIOD varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
+3.0000 information_schema PERIODS START_COLUMN_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
+3.0000 information_schema PERIODS END_COLUMN_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
3.0000 information_schema PLUGINS PLUGIN_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
3.0000 information_schema PLUGINS PLUGIN_VERSION varchar 20 60 utf8mb3 utf8mb3_general_ci varchar(20)
3.0000 information_schema PLUGINS PLUGIN_STATUS varchar 16 48 utf8mb3 utf8mb3_general_ci varchar(16)
@@ -831,12 +888,13 @@ NULL information_schema PROCESSLIST TIME_MS decimal NULL NULL NULL NULL decimal(
NULL information_schema PROCESSLIST STAGE tinyint NULL NULL NULL NULL tinyint(2)
NULL information_schema PROCESSLIST MAX_STAGE tinyint NULL NULL NULL NULL tinyint(2)
NULL information_schema PROCESSLIST PROGRESS decimal NULL NULL NULL NULL decimal(7,3)
-NULL information_schema PROCESSLIST MEMORY_USED bigint NULL NULL NULL NULL bigint(7)
-NULL information_schema PROCESSLIST MAX_MEMORY_USED bigint NULL NULL NULL NULL bigint(7)
-NULL information_schema PROCESSLIST EXAMINED_ROWS int NULL NULL NULL NULL int(7)
-NULL information_schema PROCESSLIST QUERY_ID bigint NULL NULL NULL NULL bigint(4)
+NULL information_schema PROCESSLIST MEMORY_USED bigint NULL NULL NULL NULL bigint(10)
+NULL information_schema PROCESSLIST MAX_MEMORY_USED bigint NULL NULL NULL NULL bigint(10)
+NULL information_schema PROCESSLIST EXAMINED_ROWS bigint NULL NULL NULL NULL bigint(10)
+NULL information_schema PROCESSLIST SENT_ROWS bigint NULL NULL NULL NULL bigint(10)
+NULL information_schema PROCESSLIST QUERY_ID bigint NULL NULL NULL NULL bigint(10)
1.0000 information_schema PROCESSLIST INFO_BINARY blob 65535 65535 NULL NULL blob
-NULL information_schema PROCESSLIST TID bigint NULL NULL NULL NULL bigint(4)
+NULL information_schema PROCESSLIST TID bigint NULL NULL NULL NULL bigint(10)
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG varchar 512 1536 utf8mb3 utf8mb3_general_ci varchar(512)
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
diff --git a/mysql-test/suite/funcs_1/r/is_columns_memory.result b/mysql-test/suite/funcs_1/r/is_columns_memory.result
index b33d6a28..7f2d1788 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_memory.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_memory.result
@@ -129,7 +129,7 @@ f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = memory;
Warnings:
-Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt'
into table tb2 ;
drop table if exists tb3;
@@ -254,7 +254,7 @@ f239 varbinary(0),
f240 varchar(1200)
) engine = memory;
Warnings:
-Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb4.txt'
into table tb4;
USE test1;
@@ -313,7 +313,7 @@ f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = memory;
Warnings:
-Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt'
into table tb2 ;
USE test;
@@ -377,318 +377,318 @@ LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' INTO TABLE t9;
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
-def test t1 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t1 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test t1 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t1 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t1 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t10 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t10 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t10 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test t10 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t10 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t10 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t11 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t11 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t11 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test t11 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t11 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t11 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t2 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t2 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test t2 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t2 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t2 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t3 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t3 f2 2 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t3 f3 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t4 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t4 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t4 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test t4 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t4 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t4 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t7 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t7 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t7 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test t7 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t8 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t8 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t8 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test t8 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t9 f1 1 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t9 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t9 f3 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test tb1 f1 1 NULL YES char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references NEVER NULL
-def test tb1 f12 4 NULL YES binary 1 1 NULL NULL NULL NULL NULL binary(1) select,insert,update,references NEVER NULL
-def test tb1 f13 5 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(4) select,insert,update,references NEVER NULL
-def test tb1 f14 6 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned select,insert,update,references NEVER NULL
-def test tb1 f15 7 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f16 8 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f17 9 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(6) select,insert,update,references NEVER NULL
-def test tb1 f18 10 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned select,insert,update,references NEVER NULL
-def test tb1 f19 11 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f2 2 NULL YES char 1 1 NULL NULL NULL latin1 latin1_bin char(1) select,insert,update,references NEVER NULL
-def test tb1 f20 12 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f21 13 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) select,insert,update,references NEVER NULL
-def test tb1 f22 14 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL
-def test tb1 f23 15 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f24 16 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f25 17 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test tb1 f26 18 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
-def test tb1 f27 19 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f28 20 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f29 21 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def test tb1 f3 3 NULL YES char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references NEVER NULL
-def test tb1 f30 22 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def test tb1 f31 23 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f32 24 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f33 25 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb1 f34 26 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb1 f35 27 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f36 28 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f37 29 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb1 f38 30 10 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL
-def test tb1 f39 31 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb1 f40 32 10 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL
-def test tb1 f41 33 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f42 34 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f43 35 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f44 36 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f45 37 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb1 f46 38 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL
-def test tb1 f47 39 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb1 f48 40 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL
-def test tb1 f49 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f50 42 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f51 43 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f52 44 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f53 45 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb1 f54 46 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb1 f55 47 0000000099 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f56 48 0000000099 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f57 49 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb1 f58 50 99 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL
-def test tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f101 43 '2000-01-01' NO date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test tb2 f102 44 '00:00:20' NO time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL
-def test tb2 f103 45 '0002-02-02 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL
-def test tb2 f104 46 '2000-12-31 23:59:59' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL
-def test tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test tb2 f108 50 '1enum' NO enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL
-def test tb2 f109 51 '1set' NO set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL
-def test tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL
-def test tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL
-def test tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL
-def test tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f118 1 'a' NO char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references NEVER NULL
-def test tb3 f119 2 '' NO char 1 1 NULL NULL NULL latin1 latin1_bin char(1) select,insert,update,references NEVER NULL
-def test tb3 f120 3 '' NO char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references NEVER NULL
-def test tb3 f121 4 NULL YES char 50 50 NULL NULL NULL latin1 latin1_swedish_ci char(50) select,insert,update,references NEVER NULL
-def test tb3 f122 5 NULL YES char 50 50 NULL NULL NULL latin1 latin1_swedish_ci char(50) select,insert,update,references NEVER NULL
-def test tb3 f129 6 '' NO binary 1 1 NULL NULL NULL NULL NULL binary(1) select,insert,update,references NEVER NULL
-def test tb3 f130 7 99 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(4) select,insert,update,references NEVER NULL
-def test tb3 f131 8 99 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned select,insert,update,references NEVER NULL
-def test tb3 f132 9 099 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f133 10 099 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f134 11 999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(6) select,insert,update,references NEVER NULL
-def test tb3 f135 12 999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned select,insert,update,references NEVER NULL
-def test tb3 f136 13 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f137 14 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f138 15 9999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) select,insert,update,references NEVER NULL
-def test tb3 f139 16 9999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL
-def test tb3 f140 17 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f141 18 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f142 19 99999 NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test tb3 f143 20 99999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
-def test tb3 f144 21 0000099999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f145 22 0000099999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f146 23 999999 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def test tb3 f147 24 999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def test tb3 f148 25 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f149 26 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f150 27 1000 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb3 f151 28 999 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb3 f152 29 0000001000 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f153 30 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f154 31 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb3 f155 32 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL
-def test tb3 f156 33 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb3 f157 34 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL
-def test tb3 f158 35 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f159 36 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f160 37 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f161 38 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f162 39 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb3 f163 40 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL
-def test tb3 f164 41 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb3 f165 42 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL
-def test tb3 f166 43 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f167 44 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f168 45 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f169 46 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f170 47 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb3 f171 48 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb3 f172 49 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f173 50 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f174 51 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb3 f175 52 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL
-def test tb4 f176 1 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb4 f177 2 9 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL
-def test tb4 f178 3 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f179 4 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f180 5 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f181 6 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f182 7 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb4 f183 8 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL
-def test tb4 f184 9 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb4 f185 10 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL
-def test tb4 f186 11 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f187 12 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f188 13 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f189 14 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f190 15 88.8 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test tb4 f191 16 88.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test tb4 f192 17 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f193 18 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f194 19 55.5 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test tb4 f195 20 55.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test tb4 f196 21 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f197 22 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f198 23 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb4 f199 24 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb4 f200 25 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f201 26 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f202 27 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb4 f203 28 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb4 f204 29 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb4 f205 30 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb4 f206 31 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f207 32 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f208 33 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f209 34 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f210 35 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb4 f211 36 NULL YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test tb4 f212 37 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb4 f213 38 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test tb4 f214 39 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f215 40 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f216 41 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test tb4 f219 44 NULL YES time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL
-def test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL
-def test tb4 f221 46 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL
-def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test tb4 f225 50 NULL YES enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL
-def test tb4 f226 51 NULL YES set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL
-def test tb4 f236 52 NULL YES char 95 95 NULL NULL NULL latin1 latin1_swedish_ci char(95) select,insert,update,references NEVER NULL
-def test tb4 f237 54 NULL YES char 130 130 NULL NULL NULL latin1 latin1_bin char(130) select,insert,update,references NEVER NULL
-def test tb4 f238 55 NULL YES varchar 25000 25000 NULL NULL NULL latin1 latin1_bin varchar(25000) select,insert,update,references NEVER NULL
-def test tb4 f239 56 NULL YES varbinary 0 0 NULL NULL NULL NULL NULL varbinary(0) select,insert,update,references NEVER NULL
-def test tb4 f240 57 NULL YES varchar 1200 1200 NULL NULL NULL latin1 latin1_swedish_ci varchar(1200) select,insert,update,references NEVER NULL
-def test tb4 f241 53 NULL YES char 255 255 NULL NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references NEVER NULL
-def test1 tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f101 43 '2000-01-01' NO date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test1 tb2 f102 44 '00:00:20' NO time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL
-def test1 tb2 f103 45 '0002-02-02 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL
-def test1 tb2 f104 46 '2000-12-31 23:59:59' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL
-def test1 tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test1 tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test1 tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test1 tb2 f108 50 '1enum' NO enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL
-def test1 tb2 f109 51 '1set' NO set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL
-def test1 tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test1 tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL
-def test1 tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test1 tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test1 tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test1 tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test1 tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test1 tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test1 tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test1 tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test4 t6 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test4 t6 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test4 t6 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test4 t6 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test4 t6 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test4 t6 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
+def test t1 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t1 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test t1 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t1 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t1 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t10 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t10 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t10 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test t10 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t10 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t10 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t11 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t11 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t11 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test t11 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t11 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t11 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t2 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t2 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test t2 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t2 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t2 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t3 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t3 f2 2 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t3 f3 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t4 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t4 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t4 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test t4 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t4 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t4 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t7 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t7 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t7 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test t7 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t8 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t8 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t8 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test t8 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t9 f1 1 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t9 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t9 f3 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test tb1 f1 1 NULL YES char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references NEVER NULL NO NO
+def test tb1 f12 4 NULL YES binary 1 1 NULL NULL NULL NULL NULL binary(1) select,insert,update,references NEVER NULL NO NO
+def test tb1 f13 5 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(4) select,insert,update,references NEVER NULL NO NO
+def test tb1 f14 6 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f15 7 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f16 8 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f17 9 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(6) select,insert,update,references NEVER NULL NO NO
+def test tb1 f18 10 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f19 11 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f2 2 NULL YES char 1 1 NULL NULL NULL latin1 latin1_bin char(1) select,insert,update,references NEVER NULL NO NO
+def test tb1 f20 12 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f21 13 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) select,insert,update,references NEVER NULL NO NO
+def test tb1 f22 14 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f23 15 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f24 16 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f25 17 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test tb1 f26 18 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f27 19 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f28 20 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f29 21 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL NO NO
+def test tb1 f3 3 NULL YES char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references NEVER NULL NO NO
+def test tb1 f30 22 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f31 23 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f32 24 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f33 25 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb1 f34 26 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f35 27 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f36 28 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f37 29 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb1 f38 30 10 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL NO NO
+def test tb1 f39 31 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f40 32 10 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f41 33 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f42 34 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f43 35 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f44 36 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f45 37 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb1 f46 38 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL NO NO
+def test tb1 f47 39 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f48 40 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f49 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f50 42 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f51 43 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f52 44 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f53 45 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb1 f54 46 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f55 47 0000000099 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f56 48 0000000099 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f57 49 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb1 f58 50 99 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL NO NO
+def test tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f101 43 '2000-01-01' NO date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test tb2 f102 44 '00:00:20' NO time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL NO NO
+def test tb2 f103 45 '0002-02-02 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL NO NO
+def test tb2 f104 46 '2000-12-31 23:59:59' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL NO NO
+def test tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test tb2 f108 50 '1enum' NO enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL NO NO
+def test tb2 f109 51 '1set' NO set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL NO NO
+def test tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL NO NO
+def test tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f118 1 'a' NO char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references NEVER NULL NO NO
+def test tb3 f119 2 '' NO char 1 1 NULL NULL NULL latin1 latin1_bin char(1) select,insert,update,references NEVER NULL NO NO
+def test tb3 f120 3 '' NO char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references NEVER NULL NO NO
+def test tb3 f121 4 NULL YES char 50 50 NULL NULL NULL latin1 latin1_swedish_ci char(50) select,insert,update,references NEVER NULL NO NO
+def test tb3 f122 5 NULL YES char 50 50 NULL NULL NULL latin1 latin1_swedish_ci char(50) select,insert,update,references NEVER NULL NO NO
+def test tb3 f129 6 '' NO binary 1 1 NULL NULL NULL NULL NULL binary(1) select,insert,update,references NEVER NULL NO NO
+def test tb3 f130 7 99 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(4) select,insert,update,references NEVER NULL NO NO
+def test tb3 f131 8 99 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f132 9 099 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f133 10 099 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f134 11 999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(6) select,insert,update,references NEVER NULL NO NO
+def test tb3 f135 12 999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f136 13 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f137 14 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f138 15 9999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) select,insert,update,references NEVER NULL NO NO
+def test tb3 f139 16 9999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f140 17 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f141 18 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f142 19 99999 NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test tb3 f143 20 99999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f144 21 0000099999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f145 22 0000099999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f146 23 999999 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL NO NO
+def test tb3 f147 24 999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f148 25 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f149 26 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f150 27 1000 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb3 f151 28 999 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f152 29 0000001000 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f153 30 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f154 31 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb3 f155 32 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL NO NO
+def test tb3 f156 33 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f157 34 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f158 35 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f159 36 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f160 37 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f161 38 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f162 39 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb3 f163 40 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL NO NO
+def test tb3 f164 41 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f165 42 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f166 43 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f167 44 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f168 45 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f169 46 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f170 47 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb3 f171 48 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f172 49 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f173 50 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f174 51 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb3 f175 52 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL NO NO
+def test tb4 f176 1 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f177 2 9 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f178 3 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f179 4 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f180 5 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f181 6 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f182 7 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb4 f183 8 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL NO NO
+def test tb4 f184 9 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f185 10 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f186 11 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f187 12 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f188 13 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f189 14 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f190 15 88.8 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test tb4 f191 16 88.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f192 17 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f193 18 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f194 19 55.5 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test tb4 f195 20 55.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f196 21 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f197 22 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f198 23 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb4 f199 24 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f200 25 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f201 26 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f202 27 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb4 f203 28 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb4 f204 29 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f205 30 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f206 31 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f207 32 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f208 33 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f209 34 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f210 35 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb4 f211 36 NULL YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test tb4 f212 37 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f213 38 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f214 39 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f215 40 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f216 41 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test tb4 f219 44 NULL YES time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL NO NO
+def test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL NO NO
+def test tb4 f221 46 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL NO NO
+def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test tb4 f225 50 NULL YES enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL NO NO
+def test tb4 f226 51 NULL YES set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL NO NO
+def test tb4 f236 52 NULL YES char 95 95 NULL NULL NULL latin1 latin1_swedish_ci char(95) select,insert,update,references NEVER NULL NO NO
+def test tb4 f237 54 NULL YES char 130 130 NULL NULL NULL latin1 latin1_bin char(130) select,insert,update,references NEVER NULL NO NO
+def test tb4 f238 55 NULL YES varchar 25000 25000 NULL NULL NULL latin1 latin1_bin varchar(25000) select,insert,update,references NEVER NULL NO NO
+def test tb4 f239 56 NULL YES varbinary 0 0 NULL NULL NULL NULL NULL varbinary(0) select,insert,update,references NEVER NULL NO NO
+def test tb4 f240 57 NULL YES varchar 1200 1200 NULL NULL NULL latin1 latin1_swedish_ci varchar(1200) select,insert,update,references NEVER NULL NO NO
+def test tb4 f241 53 NULL YES char 255 255 NULL NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f101 43 '2000-01-01' NO date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f102 44 '00:00:20' NO time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f103 45 '0002-02-02 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f104 46 '2000-12-31 23:59:59' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f108 50 '1enum' NO enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f109 51 '1set' NO set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test4 t6 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test4 t6 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test4 t6 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test4 t6 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test4 t6 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test4 t6 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam.result b/mysql-test/suite/funcs_1/r/is_columns_myisam.result
index e7a8a176..f1d61611 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_myisam.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_myisam.result
@@ -145,7 +145,7 @@ f116 VARBINARY(64) null,
f117 VARBINARY(192) null
) engine = myisam;
Warnings:
-Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt'
into table tb2;
drop table if exists tb3 ;
@@ -286,7 +286,7 @@ f241 char(100),
f242 bit(30)
) engine = myisam;
Warnings:
-Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb4.txt'
into table tb4;
USE test1;
@@ -353,7 +353,7 @@ f116 VARBINARY(64) null,
f117 VARBINARY(192) null
) engine = myisam;
Warnings:
-Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt'
into table tb2;
USE test;
@@ -417,358 +417,358 @@ LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' INTO TABLE t9;
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
-def test t1 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t1 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test t1 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t1 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t1 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t10 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t10 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t10 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test t10 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t10 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t10 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t11 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t11 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t11 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test t11 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t11 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t11 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t2 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t2 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test t2 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t2 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t2 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t3 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t3 f2 2 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t3 f3 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t4 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t4 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t4 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test t4 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t4 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t4 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t7 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t7 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t7 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test t7 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t8 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test t8 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t8 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test t8 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t9 f1 1 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test t9 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test t9 f3 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test tb1 f1 1 NULL YES char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references NEVER NULL
-def test tb1 f10 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL NULL mediumblob select,insert,update,references NEVER NULL
-def test tb1 f11 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL
-def test tb1 f12 12 NULL YES binary 1 1 NULL NULL NULL NULL NULL binary(1) select,insert,update,references NEVER NULL
-def test tb1 f13 13 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(4) select,insert,update,references NEVER NULL
-def test tb1 f14 14 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned select,insert,update,references NEVER NULL
-def test tb1 f15 15 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f16 16 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f17 17 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(6) select,insert,update,references NEVER NULL
-def test tb1 f18 18 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned select,insert,update,references NEVER NULL
-def test tb1 f19 19 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f2 2 NULL YES char 1 1 NULL NULL NULL latin1 latin1_bin char(1) select,insert,update,references NEVER NULL
-def test tb1 f20 20 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f21 21 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) select,insert,update,references NEVER NULL
-def test tb1 f22 22 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL
-def test tb1 f23 23 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f24 24 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f25 25 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test tb1 f26 26 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
-def test tb1 f27 27 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f28 28 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f29 29 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def test tb1 f3 3 NULL YES char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references NEVER NULL
-def test tb1 f30 30 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def test tb1 f31 31 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f32 32 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f33 33 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb1 f34 34 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb1 f35 35 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f36 36 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f37 37 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb1 f38 38 10 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL
-def test tb1 f39 39 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb1 f4 4 NULL YES tinytext 255 255 NULL NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NEVER NULL
-def test tb1 f40 40 10 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL
-def test tb1 f41 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f42 42 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f43 43 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f44 44 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f45 45 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb1 f46 46 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL
-def test tb1 f47 47 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb1 f48 48 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL
-def test tb1 f49 49 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f5 5 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text select,insert,update,references NEVER NULL
-def test tb1 f50 50 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f51 51 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f52 52 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f53 53 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb1 f54 54 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb1 f55 55 0000000099 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f56 56 0000000099 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb1 f57 57 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb1 f58 58 99 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL
-def test tb1 f6 6 NULL YES mediumtext 16777215 16777215 NULL NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references NEVER NULL
-def test tb1 f7 7 NULL YES longtext 4294967295 4294967295 NULL NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references NEVER NULL
-def test tb1 f8 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL NULL tinyblob select,insert,update,references NEVER NULL
-def test tb1 f9 9 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob select,insert,update,references NEVER NULL
-def test tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f101 43 '2000-01-01' NO date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test tb2 f102 44 '00:00:20' NO time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL
-def test tb2 f103 45 '0002-02-02 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL
-def test tb2 f104 46 '2000-12-31 23:59:59' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL
-def test tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test tb2 f108 50 '1enum' NO enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL
-def test tb2 f109 51 '1set' NO set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL
-def test tb2 f110 52 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) select,insert,update,references NEVER NULL
-def test tb2 f111 53 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) select,insert,update,references NEVER NULL
-def test tb2 f112 54 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) select,insert,update,references NEVER NULL
-def test tb2 f113 55 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) select,insert,update,references NEVER NULL
-def test tb2 f114 56 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) select,insert,update,references NEVER NULL
-def test tb2 f115 57 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) select,insert,update,references NEVER NULL
-def test tb2 f116 58 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) select,insert,update,references NEVER NULL
-def test tb2 f117 59 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) select,insert,update,references NEVER NULL
-def test tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL
-def test tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL
-def test tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL
-def test tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f118 1 'a' NO char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references NEVER NULL
-def test tb3 f119 2 '' NO char 1 1 NULL NULL NULL latin1 latin1_bin char(1) select,insert,update,references NEVER NULL
-def test tb3 f120 3 '' NO char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references NEVER NULL
-def test tb3 f121 4 NULL YES tinytext 255 255 NULL NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NEVER NULL
-def test tb3 f122 5 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text select,insert,update,references NEVER NULL
-def test tb3 f123 6 NULL YES mediumtext 16777215 16777215 NULL NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references NEVER NULL
-def test tb3 f124 7 NULL YES longtext 4294967295 4294967295 NULL NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references NEVER NULL
-def test tb3 f125 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL NULL tinyblob select,insert,update,references NEVER NULL
-def test tb3 f126 9 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob select,insert,update,references NEVER NULL
-def test tb3 f127 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL NULL mediumblob select,insert,update,references NEVER NULL
-def test tb3 f128 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL
-def test tb3 f129 12 '' NO binary 1 1 NULL NULL NULL NULL NULL binary(1) select,insert,update,references NEVER NULL
-def test tb3 f130 13 99 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(4) select,insert,update,references NEVER NULL
-def test tb3 f131 14 99 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned select,insert,update,references NEVER NULL
-def test tb3 f132 15 099 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f133 16 099 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f134 17 999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(6) select,insert,update,references NEVER NULL
-def test tb3 f135 18 999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned select,insert,update,references NEVER NULL
-def test tb3 f136 19 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f137 20 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f138 21 9999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) select,insert,update,references NEVER NULL
-def test tb3 f139 22 9999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL
-def test tb3 f140 23 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f141 24 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f142 25 99999 NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test tb3 f143 26 99999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
-def test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f145 28 0000099999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f146 29 999999 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL
-def test tb3 f147 30 999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f150 33 1000 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb3 f151 34 999 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb3 f152 35 0000001000 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f153 36 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f154 37 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb3 f155 38 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL
-def test tb3 f156 39 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb3 f157 40 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL
-def test tb3 f158 41 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f159 42 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f160 43 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f161 44 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f162 45 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb3 f163 46 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL
-def test tb3 f164 47 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb3 f165 48 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL
-def test tb3 f166 49 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f167 50 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f168 51 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f169 52 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f170 53 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb3 f171 54 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb3 f172 55 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f173 56 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb3 f174 57 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb3 f175 58 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL
-def test tb4 f176 1 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb4 f177 2 9 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL
-def test tb4 f178 3 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f179 4 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f180 5 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f181 6 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f182 7 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test tb4 f183 8 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL
-def test tb4 f184 9 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test tb4 f185 10 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL
-def test tb4 f186 11 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f187 12 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f188 13 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f189 14 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f190 15 88.8 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test tb4 f191 16 88.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test tb4 f192 17 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f193 18 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f194 19 55.5 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test tb4 f195 20 55.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test tb4 f196 21 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f197 22 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f198 23 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb4 f199 24 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb4 f200 25 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f201 26 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f202 27 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb4 f203 28 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb4 f204 29 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb4 f205 30 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb4 f206 31 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f207 32 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f208 33 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f209 34 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f210 35 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test tb4 f211 36 NULL YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test tb4 f212 37 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test tb4 f213 38 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test tb4 f214 39 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f215 40 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f216 41 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test tb4 f219 44 NULL YES time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL
-def test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL
-def test tb4 f221 46 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL
-def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test tb4 f225 50 NULL YES enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL
-def test tb4 f226 51 NULL YES set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL
-def test tb4 f227 52 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) select,insert,update,references NEVER NULL
-def test tb4 f228 53 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) select,insert,update,references NEVER NULL
-def test tb4 f229 54 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) select,insert,update,references NEVER NULL
-def test tb4 f230 55 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) select,insert,update,references NEVER NULL
-def test tb4 f231 56 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) select,insert,update,references NEVER NULL
-def test tb4 f232 57 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) select,insert,update,references NEVER NULL
-def test tb4 f233 58 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) select,insert,update,references NEVER NULL
-def test tb4 f234 59 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) select,insert,update,references NEVER NULL
-def test tb4 f235 60 NULL YES char 255 255 NULL NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references NEVER NULL
-def test tb4 f236 61 NULL YES char 60 60 NULL NULL NULL latin1 latin1_swedish_ci char(60) select,insert,update,references NEVER NULL
-def test tb4 f237 62 NULL YES char 255 255 NULL NULL NULL latin1 latin1_bin char(255) select,insert,update,references NEVER NULL
-def test tb4 f238 63 NULL YES varchar 0 0 NULL NULL NULL latin1 latin1_bin varchar(0) select,insert,update,references NEVER NULL
-def test tb4 f239 64 NULL YES varbinary 1000 1000 NULL NULL NULL NULL NULL varbinary(1000) select,insert,update,references NEVER NULL
-def test tb4 f240 65 NULL YES varchar 120 120 NULL NULL NULL latin1 latin1_swedish_ci varchar(120) select,insert,update,references NEVER NULL
-def test tb4 f241 66 NULL YES char 100 100 NULL NULL NULL latin1 latin1_swedish_ci char(100) select,insert,update,references NEVER NULL
-def test tb4 f242 67 NULL YES bit NULL NULL 30 NULL NULL NULL NULL bit(30) select,insert,update,references NEVER NULL
-def test1 tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f101 43 '2000-01-01' NO date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test1 tb2 f102 44 '00:00:20' NO time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL
-def test1 tb2 f103 45 '0002-02-02 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL
-def test1 tb2 f104 46 '2000-12-31 23:59:59' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL
-def test1 tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test1 tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test1 tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL
-def test1 tb2 f108 50 '1enum' NO enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL
-def test1 tb2 f109 51 '1set' NO set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL
-def test1 tb2 f110 52 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) select,insert,update,references NEVER NULL
-def test1 tb2 f111 53 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) select,insert,update,references NEVER NULL
-def test1 tb2 f112 54 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) select,insert,update,references NEVER NULL
-def test1 tb2 f113 55 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) select,insert,update,references NEVER NULL
-def test1 tb2 f114 56 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) select,insert,update,references NEVER NULL
-def test1 tb2 f115 57 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) select,insert,update,references NEVER NULL
-def test1 tb2 f116 58 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) select,insert,update,references NEVER NULL
-def test1 tb2 f117 59 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) select,insert,update,references NEVER NULL
-def test1 tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL
-def test1 tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL
-def test1 tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test1 tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test1 tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test1 tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test1 tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test1 tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL
-def test1 tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL
-def test1 tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL
-def test1 tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL
-def test1 tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL
-def test4 t6 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL
-def test4 t6 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test4 t6 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL
-def test4 t6 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def test4 t6 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL
-def test4 t6 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
+def test t1 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t1 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test t1 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t1 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t1 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t10 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t10 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t10 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test t10 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t10 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t10 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t11 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t11 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t11 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test t11 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t11 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t11 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t2 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t2 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test t2 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t2 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t2 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t3 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t3 f2 2 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t3 f3 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t4 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t4 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t4 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test t4 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t4 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t4 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t7 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t7 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t7 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test t7 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t8 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test t8 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t8 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test t8 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t9 f1 1 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test t9 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test t9 f3 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test tb1 f1 1 NULL YES char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references NEVER NULL NO NO
+def test tb1 f10 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL NULL mediumblob select,insert,update,references NEVER NULL NO NO
+def test tb1 f11 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL NO NO
+def test tb1 f12 12 NULL YES binary 1 1 NULL NULL NULL NULL NULL binary(1) select,insert,update,references NEVER NULL NO NO
+def test tb1 f13 13 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(4) select,insert,update,references NEVER NULL NO NO
+def test tb1 f14 14 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f15 15 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f16 16 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f17 17 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(6) select,insert,update,references NEVER NULL NO NO
+def test tb1 f18 18 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f19 19 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f2 2 NULL YES char 1 1 NULL NULL NULL latin1 latin1_bin char(1) select,insert,update,references NEVER NULL NO NO
+def test tb1 f20 20 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f21 21 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) select,insert,update,references NEVER NULL NO NO
+def test tb1 f22 22 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f23 23 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f24 24 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f25 25 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test tb1 f26 26 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f27 27 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f28 28 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f29 29 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL NO NO
+def test tb1 f3 3 NULL YES char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references NEVER NULL NO NO
+def test tb1 f30 30 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f31 31 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f32 32 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f33 33 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb1 f34 34 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f35 35 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f36 36 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f37 37 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb1 f38 38 10 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL NO NO
+def test tb1 f39 39 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f4 4 NULL YES tinytext 255 255 NULL NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NEVER NULL NO NO
+def test tb1 f40 40 10 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f41 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f42 42 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f43 43 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f44 44 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f45 45 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb1 f46 46 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL NO NO
+def test tb1 f47 47 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f48 48 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f49 49 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f5 5 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text select,insert,update,references NEVER NULL NO NO
+def test tb1 f50 50 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f51 51 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f52 52 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f53 53 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb1 f54 54 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb1 f55 55 0000000099 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f56 56 0000000099 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb1 f57 57 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb1 f58 58 99 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL NO NO
+def test tb1 f6 6 NULL YES mediumtext 16777215 16777215 NULL NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references NEVER NULL NO NO
+def test tb1 f7 7 NULL YES longtext 4294967295 4294967295 NULL NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references NEVER NULL NO NO
+def test tb1 f8 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL NULL tinyblob select,insert,update,references NEVER NULL NO NO
+def test tb1 f9 9 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob select,insert,update,references NEVER NULL NO NO
+def test tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f101 43 '2000-01-01' NO date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test tb2 f102 44 '00:00:20' NO time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL NO NO
+def test tb2 f103 45 '0002-02-02 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL NO NO
+def test tb2 f104 46 '2000-12-31 23:59:59' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL NO NO
+def test tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test tb2 f108 50 '1enum' NO enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL NO NO
+def test tb2 f109 51 '1set' NO set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL NO NO
+def test tb2 f110 52 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) select,insert,update,references NEVER NULL NO NO
+def test tb2 f111 53 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) select,insert,update,references NEVER NULL NO NO
+def test tb2 f112 54 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) select,insert,update,references NEVER NULL NO NO
+def test tb2 f113 55 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) select,insert,update,references NEVER NULL NO NO
+def test tb2 f114 56 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) select,insert,update,references NEVER NULL NO NO
+def test tb2 f115 57 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) select,insert,update,references NEVER NULL NO NO
+def test tb2 f116 58 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) select,insert,update,references NEVER NULL NO NO
+def test tb2 f117 59 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) select,insert,update,references NEVER NULL NO NO
+def test tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL NO NO
+def test tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f118 1 'a' NO char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references NEVER NULL NO NO
+def test tb3 f119 2 '' NO char 1 1 NULL NULL NULL latin1 latin1_bin char(1) select,insert,update,references NEVER NULL NO NO
+def test tb3 f120 3 '' NO char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) select,insert,update,references NEVER NULL NO NO
+def test tb3 f121 4 NULL YES tinytext 255 255 NULL NULL NULL latin1 latin1_swedish_ci tinytext select,insert,update,references NEVER NULL NO NO
+def test tb3 f122 5 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text select,insert,update,references NEVER NULL NO NO
+def test tb3 f123 6 NULL YES mediumtext 16777215 16777215 NULL NULL NULL latin1 latin1_swedish_ci mediumtext select,insert,update,references NEVER NULL NO NO
+def test tb3 f124 7 NULL YES longtext 4294967295 4294967295 NULL NULL NULL latin1 latin1_swedish_ci longtext select,insert,update,references NEVER NULL NO NO
+def test tb3 f125 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL NULL tinyblob select,insert,update,references NEVER NULL NO NO
+def test tb3 f126 9 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob select,insert,update,references NEVER NULL NO NO
+def test tb3 f127 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL NULL mediumblob select,insert,update,references NEVER NULL NO NO
+def test tb3 f128 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL NO NO
+def test tb3 f129 12 '' NO binary 1 1 NULL NULL NULL NULL NULL binary(1) select,insert,update,references NEVER NULL NO NO
+def test tb3 f130 13 99 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(4) select,insert,update,references NEVER NULL NO NO
+def test tb3 f131 14 99 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f132 15 099 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f133 16 099 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f134 17 999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(6) select,insert,update,references NEVER NULL NO NO
+def test tb3 f135 18 999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f136 19 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f137 20 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f138 21 9999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) select,insert,update,references NEVER NULL NO NO
+def test tb3 f139 22 9999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f140 23 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f141 24 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f142 25 99999 NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test tb3 f143 26 99999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f145 28 0000099999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f146 29 999999 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references NEVER NULL NO NO
+def test tb3 f147 30 999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f150 33 1000 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb3 f151 34 999 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f152 35 0000001000 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f153 36 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f154 37 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb3 f155 38 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL NO NO
+def test tb3 f156 39 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f157 40 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f158 41 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f159 42 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f160 43 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f161 44 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f162 45 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb3 f163 46 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL NO NO
+def test tb3 f164 47 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f165 48 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f166 49 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f167 50 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f168 51 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f169 52 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f170 53 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb3 f171 54 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb3 f172 55 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f173 56 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb3 f174 57 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb3 f175 58 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) select,insert,update,references NEVER NULL NO NO
+def test tb4 f176 1 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f177 2 9 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f178 3 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f179 4 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f180 5 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f181 6 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f182 7 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test tb4 f183 8 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL NO NO
+def test tb4 f184 9 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f185 10 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f186 11 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f187 12 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f188 13 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f189 14 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f190 15 88.8 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test tb4 f191 16 88.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f192 17 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f193 18 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f194 19 55.5 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test tb4 f195 20 55.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f196 21 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f197 22 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f198 23 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb4 f199 24 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f200 25 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f201 26 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f202 27 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb4 f203 28 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb4 f204 29 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f205 30 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f206 31 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f207 32 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f208 33 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f209 34 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f210 35 NULL YES float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test tb4 f211 36 NULL YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test tb4 f212 37 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f213 38 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test tb4 f214 39 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f215 40 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f216 41 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test tb4 f219 44 NULL YES time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL NO NO
+def test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL NO NO
+def test tb4 f221 46 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL NO NO
+def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test tb4 f225 50 NULL YES enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL NO NO
+def test tb4 f226 51 NULL YES set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL NO NO
+def test tb4 f227 52 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) select,insert,update,references NEVER NULL NO NO
+def test tb4 f228 53 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) select,insert,update,references NEVER NULL NO NO
+def test tb4 f229 54 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) select,insert,update,references NEVER NULL NO NO
+def test tb4 f230 55 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) select,insert,update,references NEVER NULL NO NO
+def test tb4 f231 56 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) select,insert,update,references NEVER NULL NO NO
+def test tb4 f232 57 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) select,insert,update,references NEVER NULL NO NO
+def test tb4 f233 58 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) select,insert,update,references NEVER NULL NO NO
+def test tb4 f234 59 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) select,insert,update,references NEVER NULL NO NO
+def test tb4 f235 60 NULL YES char 255 255 NULL NULL NULL latin1 latin1_swedish_ci char(255) select,insert,update,references NEVER NULL NO NO
+def test tb4 f236 61 NULL YES char 60 60 NULL NULL NULL latin1 latin1_swedish_ci char(60) select,insert,update,references NEVER NULL NO NO
+def test tb4 f237 62 NULL YES char 255 255 NULL NULL NULL latin1 latin1_bin char(255) select,insert,update,references NEVER NULL NO NO
+def test tb4 f238 63 NULL YES varchar 0 0 NULL NULL NULL latin1 latin1_bin varchar(0) select,insert,update,references NEVER NULL NO NO
+def test tb4 f239 64 NULL YES varbinary 1000 1000 NULL NULL NULL NULL NULL varbinary(1000) select,insert,update,references NEVER NULL NO NO
+def test tb4 f240 65 NULL YES varchar 120 120 NULL NULL NULL latin1 latin1_swedish_ci varchar(120) select,insert,update,references NEVER NULL NO NO
+def test tb4 f241 66 NULL YES char 100 100 NULL NULL NULL latin1 latin1_swedish_ci char(100) select,insert,update,references NEVER NULL NO NO
+def test tb4 f242 67 NULL YES bit NULL NULL 30 NULL NULL NULL NULL bit(30) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f101 43 '2000-01-01' NO date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f102 44 '00:00:20' NO time NULL NULL NULL NULL 0 NULL NULL time select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f103 45 '0002-02-02 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f104 46 '2000-12-31 23:59:59' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f108 50 '1enum' NO enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f109 51 '1set' NO set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f110 52 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f111 53 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f112 54 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f113 55 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f114 56 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f115 57 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f116 58 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f117 59 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test1 tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill select,insert,update,references NEVER NULL NO NO
+def test4 t6 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) select,insert,update,references NEVER NULL NO NO
+def test4 t6 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test4 t6 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date select,insert,update,references NEVER NULL NO NO
+def test4 t6 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def test4 t6 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) select,insert,update,references NEVER NULL NO NO
+def test4 t6 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result
index d44732f5..413f7ed5 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_myisam_embedded.result
@@ -145,7 +145,7 @@ f116 VARBINARY(64) null,
f117 VARBINARY(192) null
) engine = myisam;
Warnings:
-Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt'
into table tb2;
drop table if exists tb3 ;
@@ -286,7 +286,7 @@ f241 char(100),
f242 bit(30)
) engine = myisam;
Warnings:
-Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb4.txt'
into table tb4;
USE test1;
@@ -353,7 +353,7 @@ f116 VARBINARY(64) null,
f117 VARBINARY(192) null
) engine = myisam;
Warnings:
-Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt'
into table tb2;
USE test;
@@ -417,358 +417,358 @@ LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data/funcs_1/t9.txt' INTO TABLE t9;
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
-def test t1 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) NEVER NULL
-def test t1 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL
-def test t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date NEVER NULL
-def test t1 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def test t1 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL
-def test t1 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def test t10 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) NEVER NULL
-def test t10 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL
-def test t10 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date NEVER NULL
-def test t10 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def test t10 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL
-def test t10 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def test t11 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) NEVER NULL
-def test t11 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL
-def test t11 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date NEVER NULL
-def test t11 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def test t11 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL
-def test t11 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def test t2 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) NEVER NULL
-def test t2 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL
-def test t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date NEVER NULL
-def test t2 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def test t2 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL
-def test t2 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def test t3 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) NEVER NULL
-def test t3 f2 2 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) NEVER NULL
-def test t3 f3 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def test t4 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) NEVER NULL
-def test t4 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL
-def test t4 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date NEVER NULL
-def test t4 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def test t4 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL
-def test t4 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def test t7 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) NEVER NULL
-def test t7 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL
-def test t7 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date NEVER NULL
-def test t7 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def test t8 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) NEVER NULL
-def test t8 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL
-def test t8 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date NEVER NULL
-def test t8 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def test t9 f1 1 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def test t9 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL
-def test t9 f3 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def test tb1 f1 1 NULL YES char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) NEVER NULL
-def test tb1 f10 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL NULL mediumblob NEVER NULL
-def test tb1 f11 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob NEVER NULL
-def test tb1 f12 12 NULL YES binary 1 1 NULL NULL NULL NULL NULL binary(1) NEVER NULL
-def test tb1 f13 13 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(4) NEVER NULL
-def test tb1 f14 14 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned NEVER NULL
-def test tb1 f15 15 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill NEVER NULL
-def test tb1 f16 16 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill NEVER NULL
-def test tb1 f17 17 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(6) NEVER NULL
-def test tb1 f18 18 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned NEVER NULL
-def test tb1 f19 19 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill NEVER NULL
-def test tb1 f2 2 NULL YES char 1 1 NULL NULL NULL latin1 latin1_bin char(1) NEVER NULL
-def test tb1 f20 20 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill NEVER NULL
-def test tb1 f21 21 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) NEVER NULL
-def test tb1 f22 22 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned NEVER NULL
-def test tb1 f23 23 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill NEVER NULL
-def test tb1 f24 24 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill NEVER NULL
-def test tb1 f25 25 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def test tb1 f26 26 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned NEVER NULL
-def test tb1 f27 27 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill NEVER NULL
-def test tb1 f28 28 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill NEVER NULL
-def test tb1 f29 29 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) NEVER NULL
-def test tb1 f3 3 NULL YES char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) NEVER NULL
-def test tb1 f30 30 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned NEVER NULL
-def test tb1 f31 31 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill NEVER NULL
-def test tb1 f32 32 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill NEVER NULL
-def test tb1 f33 33 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL
-def test tb1 f34 34 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL
-def test tb1 f35 35 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb1 f36 36 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb1 f37 37 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL
-def test tb1 f38 38 10 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) NEVER NULL
-def test tb1 f39 39 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL
-def test tb1 f4 4 NULL YES tinytext 255 255 NULL NULL NULL latin1 latin1_swedish_ci tinytext NEVER NULL
-def test tb1 f40 40 10 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned NEVER NULL
-def test tb1 f41 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb1 f42 42 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill NEVER NULL
-def test tb1 f43 43 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb1 f44 44 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill NEVER NULL
-def test tb1 f45 45 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL
-def test tb1 f46 46 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) NEVER NULL
-def test tb1 f47 47 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL
-def test tb1 f48 48 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned NEVER NULL
-def test tb1 f49 49 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb1 f5 5 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text NEVER NULL
-def test tb1 f50 50 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill NEVER NULL
-def test tb1 f51 51 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb1 f52 52 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill NEVER NULL
-def test tb1 f53 53 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL
-def test tb1 f54 54 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL
-def test tb1 f55 55 0000000099 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb1 f56 56 0000000099 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb1 f57 57 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL
-def test tb1 f58 58 99 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) NEVER NULL
-def test tb1 f6 6 NULL YES mediumtext 16777215 16777215 NULL NULL NULL latin1 latin1_swedish_ci mediumtext NEVER NULL
-def test tb1 f7 7 NULL YES longtext 4294967295 4294967295 NULL NULL NULL latin1 latin1_swedish_ci longtext NEVER NULL
-def test tb1 f8 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL NULL tinyblob NEVER NULL
-def test tb1 f9 9 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob NEVER NULL
-def test tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL
-def test tb2 f101 43 '2000-01-01' NO date NULL NULL NULL NULL NULL NULL NULL date NEVER NULL
-def test tb2 f102 44 '00:00:20' NO time NULL NULL NULL NULL 0 NULL NULL time NEVER NULL
-def test tb2 f103 45 '0002-02-02 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def test tb2 f104 46 '2000-12-31 23:59:59' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp NEVER NULL
-def test tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) NEVER NULL
-def test tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) NEVER NULL
-def test tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) NEVER NULL
-def test tb2 f108 50 '1enum' NO enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') NEVER NULL
-def test tb2 f109 51 '1set' NO set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') NEVER NULL
-def test tb2 f110 52 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) NEVER NULL
-def test tb2 f111 53 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) NEVER NULL
-def test tb2 f112 54 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) NEVER NULL
-def test tb2 f113 55 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) NEVER NULL
-def test tb2 f114 56 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) NEVER NULL
-def test tb2 f115 57 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) NEVER NULL
-def test tb2 f116 58 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) NEVER NULL
-def test tb2 f117 59 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) NEVER NULL
-def test tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL
-def test tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned NEVER NULL
-def test tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill NEVER NULL
-def test tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill NEVER NULL
-def test tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL
-def test tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) NEVER NULL
-def test tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL
-def test tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned NEVER NULL
-def test tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill NEVER NULL
-def test tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill NEVER NULL
-def test tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL NULL double NEVER NULL
-def test tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned NEVER NULL
-def test tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL
-def test tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL
-def test tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double NEVER NULL
-def test tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned NEVER NULL
-def test tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL
-def test tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL
-def test tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL
-def test tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL
-def test tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL
-def test tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL
-def test tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL
-def test tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL
-def test tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL
-def test tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double NEVER NULL
-def test tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL
-def test tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned NEVER NULL
-def test tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL
-def test tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test tb3 f118 1 'a' NO char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) NEVER NULL
-def test tb3 f119 2 '' NO char 1 1 NULL NULL NULL latin1 latin1_bin char(1) NEVER NULL
-def test tb3 f120 3 '' NO char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) NEVER NULL
-def test tb3 f121 4 NULL YES tinytext 255 255 NULL NULL NULL latin1 latin1_swedish_ci tinytext NEVER NULL
-def test tb3 f122 5 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text NEVER NULL
-def test tb3 f123 6 NULL YES mediumtext 16777215 16777215 NULL NULL NULL latin1 latin1_swedish_ci mediumtext NEVER NULL
-def test tb3 f124 7 NULL YES longtext 4294967295 4294967295 NULL NULL NULL latin1 latin1_swedish_ci longtext NEVER NULL
-def test tb3 f125 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL NULL tinyblob NEVER NULL
-def test tb3 f126 9 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob NEVER NULL
-def test tb3 f127 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL NULL mediumblob NEVER NULL
-def test tb3 f128 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob NEVER NULL
-def test tb3 f129 12 '' NO binary 1 1 NULL NULL NULL NULL NULL binary(1) NEVER NULL
-def test tb3 f130 13 99 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(4) NEVER NULL
-def test tb3 f131 14 99 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned NEVER NULL
-def test tb3 f132 15 099 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill NEVER NULL
-def test tb3 f133 16 099 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill NEVER NULL
-def test tb3 f134 17 999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(6) NEVER NULL
-def test tb3 f135 18 999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned NEVER NULL
-def test tb3 f136 19 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill NEVER NULL
-def test tb3 f137 20 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill NEVER NULL
-def test tb3 f138 21 9999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) NEVER NULL
-def test tb3 f139 22 9999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned NEVER NULL
-def test tb3 f140 23 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill NEVER NULL
-def test tb3 f141 24 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill NEVER NULL
-def test tb3 f142 25 99999 NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def test tb3 f143 26 99999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned NEVER NULL
-def test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill NEVER NULL
-def test tb3 f145 28 0000099999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill NEVER NULL
-def test tb3 f146 29 999999 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) NEVER NULL
-def test tb3 f147 30 999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned NEVER NULL
-def test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill NEVER NULL
-def test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill NEVER NULL
-def test tb3 f150 33 1000 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL
-def test tb3 f151 34 999 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL
-def test tb3 f152 35 0000001000 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb3 f153 36 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb3 f154 37 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL
-def test tb3 f155 38 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) NEVER NULL
-def test tb3 f156 39 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL
-def test tb3 f157 40 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned NEVER NULL
-def test tb3 f158 41 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb3 f159 42 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill NEVER NULL
-def test tb3 f160 43 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb3 f161 44 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill NEVER NULL
-def test tb3 f162 45 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL
-def test tb3 f163 46 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) NEVER NULL
-def test tb3 f164 47 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL
-def test tb3 f165 48 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned NEVER NULL
-def test tb3 f166 49 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb3 f167 50 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill NEVER NULL
-def test tb3 f168 51 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb3 f169 52 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill NEVER NULL
-def test tb3 f170 53 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL
-def test tb3 f171 54 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL
-def test tb3 f172 55 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb3 f173 56 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb3 f174 57 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL
-def test tb3 f175 58 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) NEVER NULL
-def test tb4 f176 1 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL
-def test tb4 f177 2 9 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned NEVER NULL
-def test tb4 f178 3 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb4 f179 4 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill NEVER NULL
-def test tb4 f180 5 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb4 f181 6 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill NEVER NULL
-def test tb4 f182 7 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL
-def test tb4 f183 8 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) NEVER NULL
-def test tb4 f184 9 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL
-def test tb4 f185 10 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned NEVER NULL
-def test tb4 f186 11 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb4 f187 12 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill NEVER NULL
-def test tb4 f188 13 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test tb4 f189 14 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill NEVER NULL
-def test tb4 f190 15 88.8 NO double NULL NULL 22 NULL NULL NULL NULL double NEVER NULL
-def test tb4 f191 16 88.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned NEVER NULL
-def test tb4 f192 17 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL
-def test tb4 f193 18 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL
-def test tb4 f194 19 55.5 NO double NULL NULL 22 NULL NULL NULL NULL double NEVER NULL
-def test tb4 f195 20 55.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned NEVER NULL
-def test tb4 f196 21 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL
-def test tb4 f197 22 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL
-def test tb4 f198 23 NULL YES float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL
-def test tb4 f199 24 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL
-def test tb4 f200 25 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test tb4 f201 26 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test tb4 f202 27 NULL YES float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL
-def test tb4 f203 28 NULL YES float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL
-def test tb4 f204 29 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL
-def test tb4 f205 30 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL
-def test tb4 f206 31 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test tb4 f207 32 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test tb4 f208 33 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test tb4 f209 34 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test tb4 f210 35 NULL YES float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL
-def test tb4 f211 36 NULL YES double NULL NULL 22 NULL NULL NULL NULL double NEVER NULL
-def test tb4 f212 37 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL
-def test tb4 f213 38 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned NEVER NULL
-def test tb4 f214 39 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test tb4 f215 40 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL
-def test tb4 f216 41 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL
-def test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL NULL date NEVER NULL
-def test tb4 f219 44 NULL YES time NULL NULL NULL NULL 0 NULL NULL time NEVER NULL
-def test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def test tb4 f221 46 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() NEVER NULL
-def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) NEVER NULL
-def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) NEVER NULL
-def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) NEVER NULL
-def test tb4 f225 50 NULL YES enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') NEVER NULL
-def test tb4 f226 51 NULL YES set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') NEVER NULL
-def test tb4 f227 52 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) NEVER NULL
-def test tb4 f228 53 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) NEVER NULL
-def test tb4 f229 54 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) NEVER NULL
-def test tb4 f230 55 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) NEVER NULL
-def test tb4 f231 56 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) NEVER NULL
-def test tb4 f232 57 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) NEVER NULL
-def test tb4 f233 58 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) NEVER NULL
-def test tb4 f234 59 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) NEVER NULL
-def test tb4 f235 60 NULL YES char 255 255 NULL NULL NULL latin1 latin1_swedish_ci char(255) NEVER NULL
-def test tb4 f236 61 NULL YES char 60 60 NULL NULL NULL latin1 latin1_swedish_ci char(60) NEVER NULL
-def test tb4 f237 62 NULL YES char 255 255 NULL NULL NULL latin1 latin1_bin char(255) NEVER NULL
-def test tb4 f238 63 NULL YES varchar 0 0 NULL NULL NULL latin1 latin1_bin varchar(0) NEVER NULL
-def test tb4 f239 64 NULL YES varbinary 1000 1000 NULL NULL NULL NULL NULL varbinary(1000) NEVER NULL
-def test tb4 f240 65 NULL YES varchar 120 120 NULL NULL NULL latin1 latin1_swedish_ci varchar(120) NEVER NULL
-def test tb4 f241 66 NULL YES char 100 100 NULL NULL NULL latin1 latin1_swedish_ci char(100) NEVER NULL
-def test tb4 f242 67 NULL YES bit NULL NULL 30 NULL NULL NULL NULL bit(30) NEVER NULL
-def test1 tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL
-def test1 tb2 f101 43 '2000-01-01' NO date NULL NULL NULL NULL NULL NULL NULL date NEVER NULL
-def test1 tb2 f102 44 '00:00:20' NO time NULL NULL NULL NULL 0 NULL NULL time NEVER NULL
-def test1 tb2 f103 45 '0002-02-02 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def test1 tb2 f104 46 '2000-12-31 23:59:59' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp NEVER NULL
-def test1 tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) NEVER NULL
-def test1 tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) NEVER NULL
-def test1 tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) NEVER NULL
-def test1 tb2 f108 50 '1enum' NO enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') NEVER NULL
-def test1 tb2 f109 51 '1set' NO set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') NEVER NULL
-def test1 tb2 f110 52 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) NEVER NULL
-def test1 tb2 f111 53 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) NEVER NULL
-def test1 tb2 f112 54 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) NEVER NULL
-def test1 tb2 f113 55 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) NEVER NULL
-def test1 tb2 f114 56 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) NEVER NULL
-def test1 tb2 f115 57 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) NEVER NULL
-def test1 tb2 f116 58 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) NEVER NULL
-def test1 tb2 f117 59 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) NEVER NULL
-def test1 tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL
-def test1 tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned NEVER NULL
-def test1 tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test1 tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill NEVER NULL
-def test1 tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test1 tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill NEVER NULL
-def test1 tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL
-def test1 tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) NEVER NULL
-def test1 tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL
-def test1 tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned NEVER NULL
-def test1 tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test1 tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill NEVER NULL
-def test1 tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL
-def test1 tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill NEVER NULL
-def test1 tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL NULL double NEVER NULL
-def test1 tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned NEVER NULL
-def test1 tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL
-def test1 tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL
-def test1 tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double NEVER NULL
-def test1 tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned NEVER NULL
-def test1 tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL
-def test1 tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL
-def test1 tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL
-def test1 tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL
-def test1 tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test1 tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test1 tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL
-def test1 tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL
-def test1 tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL
-def test1 tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL
-def test1 tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test1 tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test1 tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test1 tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test1 tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL
-def test1 tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double NEVER NULL
-def test1 tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL
-def test1 tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned NEVER NULL
-def test1 tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test1 tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL
-def test1 tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL
-def test4 t6 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) NEVER NULL
-def test4 t6 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL
-def test4 t6 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date NEVER NULL
-def test4 t6 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def test4 t6 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL
-def test4 t6 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
+def test t1 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) NEVER NULL NO NO
+def test t1 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL NO NO
+def test t1 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date NEVER NULL NO NO
+def test t1 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def test t1 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL NO NO
+def test t1 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def test t10 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) NEVER NULL NO NO
+def test t10 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL NO NO
+def test t10 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date NEVER NULL NO NO
+def test t10 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def test t10 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL NO NO
+def test t10 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def test t11 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) NEVER NULL NO NO
+def test t11 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL NO NO
+def test t11 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date NEVER NULL NO NO
+def test t11 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def test t11 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL NO NO
+def test t11 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def test t2 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) NEVER NULL NO NO
+def test t2 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL NO NO
+def test t2 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date NEVER NULL NO NO
+def test t2 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def test t2 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL NO NO
+def test t2 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def test t3 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) NEVER NULL NO NO
+def test t3 f2 2 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) NEVER NULL NO NO
+def test t3 f3 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def test t4 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) NEVER NULL NO NO
+def test t4 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL NO NO
+def test t4 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date NEVER NULL NO NO
+def test t4 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def test t4 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL NO NO
+def test t4 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def test t7 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) NEVER NULL NO NO
+def test t7 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL NO NO
+def test t7 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date NEVER NULL NO NO
+def test t7 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def test t8 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) NEVER NULL NO NO
+def test t8 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL NO NO
+def test t8 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date NEVER NULL NO NO
+def test t8 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def test t9 f1 1 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def test t9 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL NO NO
+def test t9 f3 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def test tb1 f1 1 NULL YES char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) NEVER NULL NO NO
+def test tb1 f10 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL NULL mediumblob NEVER NULL NO NO
+def test tb1 f11 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob NEVER NULL NO NO
+def test tb1 f12 12 NULL YES binary 1 1 NULL NULL NULL NULL NULL binary(1) NEVER NULL NO NO
+def test tb1 f13 13 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(4) NEVER NULL NO NO
+def test tb1 f14 14 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned NEVER NULL NO NO
+def test tb1 f15 15 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill NEVER NULL NO NO
+def test tb1 f16 16 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill NEVER NULL NO NO
+def test tb1 f17 17 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(6) NEVER NULL NO NO
+def test tb1 f18 18 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned NEVER NULL NO NO
+def test tb1 f19 19 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill NEVER NULL NO NO
+def test tb1 f2 2 NULL YES char 1 1 NULL NULL NULL latin1 latin1_bin char(1) NEVER NULL NO NO
+def test tb1 f20 20 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill NEVER NULL NO NO
+def test tb1 f21 21 NULL YES mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) NEVER NULL NO NO
+def test tb1 f22 22 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned NEVER NULL NO NO
+def test tb1 f23 23 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill NEVER NULL NO NO
+def test tb1 f24 24 NULL YES mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill NEVER NULL NO NO
+def test tb1 f25 25 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def test tb1 f26 26 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned NEVER NULL NO NO
+def test tb1 f27 27 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill NEVER NULL NO NO
+def test tb1 f28 28 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill NEVER NULL NO NO
+def test tb1 f29 29 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) NEVER NULL NO NO
+def test tb1 f3 3 NULL YES char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) NEVER NULL NO NO
+def test tb1 f30 30 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned NEVER NULL NO NO
+def test tb1 f31 31 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill NEVER NULL NO NO
+def test tb1 f32 32 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill NEVER NULL NO NO
+def test tb1 f33 33 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL NO NO
+def test tb1 f34 34 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL NO NO
+def test tb1 f35 35 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb1 f36 36 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb1 f37 37 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL NO NO
+def test tb1 f38 38 10 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) NEVER NULL NO NO
+def test tb1 f39 39 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL NO NO
+def test tb1 f4 4 NULL YES tinytext 255 255 NULL NULL NULL latin1 latin1_swedish_ci tinytext NEVER NULL NO NO
+def test tb1 f40 40 10 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned NEVER NULL NO NO
+def test tb1 f41 41 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb1 f42 42 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill NEVER NULL NO NO
+def test tb1 f43 43 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb1 f44 44 0000000000000000000000000000000000000000000000000000000000000010 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill NEVER NULL NO NO
+def test tb1 f45 45 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL NO NO
+def test tb1 f46 46 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) NEVER NULL NO NO
+def test tb1 f47 47 10 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL NO NO
+def test tb1 f48 48 9.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned NEVER NULL NO NO
+def test tb1 f49 49 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb1 f5 5 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text NEVER NULL NO NO
+def test tb1 f50 50 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill NEVER NULL NO NO
+def test tb1 f51 51 0000000010 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb1 f52 52 000000000000000000000000000000009.900000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill NEVER NULL NO NO
+def test tb1 f53 53 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL NO NO
+def test tb1 f54 54 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL NO NO
+def test tb1 f55 55 0000000099 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb1 f56 56 0000000099 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb1 f57 57 99 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL NO NO
+def test tb1 f58 58 99 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) NEVER NULL NO NO
+def test tb1 f6 6 NULL YES mediumtext 16777215 16777215 NULL NULL NULL latin1 latin1_swedish_ci mediumtext NEVER NULL NO NO
+def test tb1 f7 7 NULL YES longtext 4294967295 4294967295 NULL NULL NULL latin1 latin1_swedish_ci longtext NEVER NULL NO NO
+def test tb1 f8 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL NULL tinyblob NEVER NULL NO NO
+def test tb1 f9 9 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob NEVER NULL NO NO
+def test tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL NO NO
+def test tb2 f101 43 '2000-01-01' NO date NULL NULL NULL NULL NULL NULL NULL date NEVER NULL NO NO
+def test tb2 f102 44 '00:00:20' NO time NULL NULL NULL NULL 0 NULL NULL time NEVER NULL NO NO
+def test tb2 f103 45 '0002-02-02 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def test tb2 f104 46 '2000-12-31 23:59:59' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp NEVER NULL NO NO
+def test tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) NEVER NULL NO NO
+def test tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) NEVER NULL NO NO
+def test tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) NEVER NULL NO NO
+def test tb2 f108 50 '1enum' NO enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') NEVER NULL NO NO
+def test tb2 f109 51 '1set' NO set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') NEVER NULL NO NO
+def test tb2 f110 52 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) NEVER NULL NO NO
+def test tb2 f111 53 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) NEVER NULL NO NO
+def test tb2 f112 54 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) NEVER NULL NO NO
+def test tb2 f113 55 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) NEVER NULL NO NO
+def test tb2 f114 56 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) NEVER NULL NO NO
+def test tb2 f115 57 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) NEVER NULL NO NO
+def test tb2 f116 58 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) NEVER NULL NO NO
+def test tb2 f117 59 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) NEVER NULL NO NO
+def test tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL NO NO
+def test tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned NEVER NULL NO NO
+def test tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill NEVER NULL NO NO
+def test tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill NEVER NULL NO NO
+def test tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL NO NO
+def test tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) NEVER NULL NO NO
+def test tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL NO NO
+def test tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned NEVER NULL NO NO
+def test tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill NEVER NULL NO NO
+def test tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill NEVER NULL NO NO
+def test tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL NULL double NEVER NULL NO NO
+def test tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned NEVER NULL NO NO
+def test tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL NO NO
+def test tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL NO NO
+def test tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double NEVER NULL NO NO
+def test tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned NEVER NULL NO NO
+def test tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL NO NO
+def test tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL NO NO
+def test tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL NO NO
+def test tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL NO NO
+def test tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL NO NO
+def test tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL NO NO
+def test tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL NO NO
+def test tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL NO NO
+def test tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL NO NO
+def test tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double NEVER NULL NO NO
+def test tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL NO NO
+def test tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned NEVER NULL NO NO
+def test tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL NO NO
+def test tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test tb3 f118 1 'a' NO char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) NEVER NULL NO NO
+def test tb3 f119 2 '' NO char 1 1 NULL NULL NULL latin1 latin1_bin char(1) NEVER NULL NO NO
+def test tb3 f120 3 '' NO char 1 1 NULL NULL NULL latin1 latin1_swedish_ci char(1) NEVER NULL NO NO
+def test tb3 f121 4 NULL YES tinytext 255 255 NULL NULL NULL latin1 latin1_swedish_ci tinytext NEVER NULL NO NO
+def test tb3 f122 5 NULL YES text 65535 65535 NULL NULL NULL latin1 latin1_swedish_ci text NEVER NULL NO NO
+def test tb3 f123 6 NULL YES mediumtext 16777215 16777215 NULL NULL NULL latin1 latin1_swedish_ci mediumtext NEVER NULL NO NO
+def test tb3 f124 7 NULL YES longtext 4294967295 4294967295 NULL NULL NULL latin1 latin1_swedish_ci longtext NEVER NULL NO NO
+def test tb3 f125 8 NULL YES tinyblob 255 255 NULL NULL NULL NULL NULL tinyblob NEVER NULL NO NO
+def test tb3 f126 9 NULL YES blob 65535 65535 NULL NULL NULL NULL NULL blob NEVER NULL NO NO
+def test tb3 f127 10 NULL YES mediumblob 16777215 16777215 NULL NULL NULL NULL NULL mediumblob NEVER NULL NO NO
+def test tb3 f128 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob NEVER NULL NO NO
+def test tb3 f129 12 '' NO binary 1 1 NULL NULL NULL NULL NULL binary(1) NEVER NULL NO NO
+def test tb3 f130 13 99 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(4) NEVER NULL NO NO
+def test tb3 f131 14 99 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned NEVER NULL NO NO
+def test tb3 f132 15 099 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill NEVER NULL NO NO
+def test tb3 f133 16 099 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned zerofill NEVER NULL NO NO
+def test tb3 f134 17 999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(6) NEVER NULL NO NO
+def test tb3 f135 18 999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned NEVER NULL NO NO
+def test tb3 f136 19 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill NEVER NULL NO NO
+def test tb3 f137 20 00999 NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned zerofill NEVER NULL NO NO
+def test tb3 f138 21 9999 NO mediumint NULL NULL 7 0 NULL NULL NULL mediumint(9) NEVER NULL NO NO
+def test tb3 f139 22 9999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned NEVER NULL NO NO
+def test tb3 f140 23 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill NEVER NULL NO NO
+def test tb3 f141 24 00009999 NO mediumint NULL NULL 8 0 NULL NULL NULL mediumint(8) unsigned zerofill NEVER NULL NO NO
+def test tb3 f142 25 99999 NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def test tb3 f143 26 99999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned NEVER NULL NO NO
+def test tb3 f144 27 0000099999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill NEVER NULL NO NO
+def test tb3 f145 28 0000099999 NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned zerofill NEVER NULL NO NO
+def test tb3 f146 29 999999 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) NEVER NULL NO NO
+def test tb3 f147 30 999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned NEVER NULL NO NO
+def test tb3 f148 31 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill NEVER NULL NO NO
+def test tb3 f149 32 00000000000000999999 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned zerofill NEVER NULL NO NO
+def test tb3 f150 33 1000 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL NO NO
+def test tb3 f151 34 999 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL NO NO
+def test tb3 f152 35 0000001000 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb3 f153 36 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb3 f154 37 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL NO NO
+def test tb3 f155 38 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) NEVER NULL NO NO
+def test tb3 f156 39 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL NO NO
+def test tb3 f157 40 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned NEVER NULL NO NO
+def test tb3 f158 41 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb3 f159 42 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill NEVER NULL NO NO
+def test tb3 f160 43 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb3 f161 44 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill NEVER NULL NO NO
+def test tb3 f162 45 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL NO NO
+def test tb3 f163 46 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) NEVER NULL NO NO
+def test tb3 f164 47 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL NO NO
+def test tb3 f165 48 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned NEVER NULL NO NO
+def test tb3 f166 49 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb3 f167 50 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill NEVER NULL NO NO
+def test tb3 f168 51 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb3 f169 52 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill NEVER NULL NO NO
+def test tb3 f170 53 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL NO NO
+def test tb3 f171 54 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL NO NO
+def test tb3 f172 55 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb3 f173 56 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb3 f174 57 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL NO NO
+def test tb3 f175 58 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) NEVER NULL NO NO
+def test tb4 f176 1 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL NO NO
+def test tb4 f177 2 9 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned NEVER NULL NO NO
+def test tb4 f178 3 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb4 f179 4 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill NEVER NULL NO NO
+def test tb4 f180 5 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb4 f181 6 0000000000000000000000000000000000000000000000000000000000000009 NO decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill NEVER NULL NO NO
+def test tb4 f182 7 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL NO NO
+def test tb4 f183 8 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) NEVER NULL NO NO
+def test tb4 f184 9 9 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL NO NO
+def test tb4 f185 10 9.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned NEVER NULL NO NO
+def test tb4 f186 11 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb4 f187 12 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill NEVER NULL NO NO
+def test tb4 f188 13 0000000009 NO decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test tb4 f189 14 000000000000000000000000000000009.000000000000000000000000000000 NO decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill NEVER NULL NO NO
+def test tb4 f190 15 88.8 NO double NULL NULL 22 NULL NULL NULL NULL double NEVER NULL NO NO
+def test tb4 f191 16 88.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned NEVER NULL NO NO
+def test tb4 f192 17 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL NO NO
+def test tb4 f193 18 00000000000000000088.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL NO NO
+def test tb4 f194 19 55.5 NO double NULL NULL 22 NULL NULL NULL NULL double NEVER NULL NO NO
+def test tb4 f195 20 55.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned NEVER NULL NO NO
+def test tb4 f196 21 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL NO NO
+def test tb4 f197 22 00000000000000000055.5 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL NO NO
+def test tb4 f198 23 NULL YES float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL NO NO
+def test tb4 f199 24 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL NO NO
+def test tb4 f200 25 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test tb4 f201 26 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test tb4 f202 27 NULL YES float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL NO NO
+def test tb4 f203 28 NULL YES float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL NO NO
+def test tb4 f204 29 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL NO NO
+def test tb4 f205 30 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL NO NO
+def test tb4 f206 31 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test tb4 f207 32 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test tb4 f208 33 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test tb4 f209 34 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test tb4 f210 35 NULL YES float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL NO NO
+def test tb4 f211 36 NULL YES double NULL NULL 22 NULL NULL NULL NULL double NEVER NULL NO NO
+def test tb4 f212 37 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL NO NO
+def test tb4 f213 38 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned NEVER NULL NO NO
+def test tb4 f214 39 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test tb4 f215 40 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL NO NO
+def test tb4 f216 41 NULL YES float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test tb4 f217 42 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL NO NO
+def test tb4 f218 43 NULL YES date NULL NULL NULL NULL NULL NULL NULL date NEVER NULL NO NO
+def test tb4 f219 44 NULL YES time NULL NULL NULL NULL 0 NULL NULL time NEVER NULL NO NO
+def test tb4 f220 45 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def test tb4 f221 46 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() NEVER NULL NO NO
+def test tb4 f222 47 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) NEVER NULL NO NO
+def test tb4 f223 48 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) NEVER NULL NO NO
+def test tb4 f224 49 NULL YES year NULL NULL NULL NULL NULL NULL NULL year(4) NEVER NULL NO NO
+def test tb4 f225 50 NULL YES enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') NEVER NULL NO NO
+def test tb4 f226 51 NULL YES set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') NEVER NULL NO NO
+def test tb4 f227 52 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) NEVER NULL NO NO
+def test tb4 f228 53 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) NEVER NULL NO NO
+def test tb4 f229 54 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) NEVER NULL NO NO
+def test tb4 f230 55 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) NEVER NULL NO NO
+def test tb4 f231 56 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) NEVER NULL NO NO
+def test tb4 f232 57 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) NEVER NULL NO NO
+def test tb4 f233 58 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) NEVER NULL NO NO
+def test tb4 f234 59 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) NEVER NULL NO NO
+def test tb4 f235 60 NULL YES char 255 255 NULL NULL NULL latin1 latin1_swedish_ci char(255) NEVER NULL NO NO
+def test tb4 f236 61 NULL YES char 60 60 NULL NULL NULL latin1 latin1_swedish_ci char(60) NEVER NULL NO NO
+def test tb4 f237 62 NULL YES char 255 255 NULL NULL NULL latin1 latin1_bin char(255) NEVER NULL NO NO
+def test tb4 f238 63 NULL YES varchar 0 0 NULL NULL NULL latin1 latin1_bin varchar(0) NEVER NULL NO NO
+def test tb4 f239 64 NULL YES varbinary 1000 1000 NULL NULL NULL NULL NULL varbinary(1000) NEVER NULL NO NO
+def test tb4 f240 65 NULL YES varchar 120 120 NULL NULL NULL latin1 latin1_swedish_ci varchar(120) NEVER NULL NO NO
+def test tb4 f241 66 NULL YES char 100 100 NULL NULL NULL latin1 latin1_swedish_ci char(100) NEVER NULL NO NO
+def test tb4 f242 67 NULL YES bit NULL NULL 30 NULL NULL NULL NULL bit(30) NEVER NULL NO NO
+def test1 tb2 f100 42 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL NO NO
+def test1 tb2 f101 43 '2000-01-01' NO date NULL NULL NULL NULL NULL NULL NULL date NEVER NULL NO NO
+def test1 tb2 f102 44 '00:00:20' NO time NULL NULL NULL NULL 0 NULL NULL time NEVER NULL NO NO
+def test1 tb2 f103 45 '0002-02-02 00:00:00' NO datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def test1 tb2 f104 46 '2000-12-31 23:59:59' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp NEVER NULL NO NO
+def test1 tb2 f105 47 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) NEVER NULL NO NO
+def test1 tb2 f106 48 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) NEVER NULL NO NO
+def test1 tb2 f107 49 2000 NO year NULL NULL NULL NULL NULL NULL NULL year(4) NEVER NULL NO NO
+def test1 tb2 f108 50 '1enum' NO enum 5 5 NULL NULL NULL latin1 latin1_swedish_ci enum('1enum','2enum') NEVER NULL NO NO
+def test1 tb2 f109 51 '1set' NO set 9 9 NULL NULL NULL latin1 latin1_swedish_ci set('1set','2set') NEVER NULL NO NO
+def test1 tb2 f110 52 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) NEVER NULL NO NO
+def test1 tb2 f111 53 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) NEVER NULL NO NO
+def test1 tb2 f112 54 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) NEVER NULL NO NO
+def test1 tb2 f113 55 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) NEVER NULL NO NO
+def test1 tb2 f114 56 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) NEVER NULL NO NO
+def test1 tb2 f115 57 NULL YES varbinary 27 27 NULL NULL NULL NULL NULL varbinary(27) NEVER NULL NO NO
+def test1 tb2 f116 58 NULL YES varbinary 64 64 NULL NULL NULL NULL NULL varbinary(64) NEVER NULL NO NO
+def test1 tb2 f117 59 NULL YES varbinary 192 192 NULL NULL NULL NULL NULL varbinary(192) NEVER NULL NO NO
+def test1 tb2 f59 1 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL NO NO
+def test1 tb2 f60 2 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned NEVER NULL NO NO
+def test1 tb2 f61 3 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test1 tb2 f62 4 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill NEVER NULL NO NO
+def test1 tb2 f63 5 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test1 tb2 f64 6 NULL YES decimal NULL NULL 64 0 NULL NULL NULL decimal(64,0) unsigned zerofill NEVER NULL NO NO
+def test1 tb2 f65 7 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) NEVER NULL NO NO
+def test1 tb2 f66 8 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) NEVER NULL NO NO
+def test1 tb2 f67 9 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned NEVER NULL NO NO
+def test1 tb2 f68 10 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned NEVER NULL NO NO
+def test1 tb2 f69 11 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test1 tb2 f70 12 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill NEVER NULL NO NO
+def test1 tb2 f71 13 NULL YES decimal NULL NULL 10 0 NULL NULL NULL decimal(10,0) unsigned zerofill NEVER NULL NO NO
+def test1 tb2 f72 14 NULL YES decimal NULL NULL 63 30 NULL NULL NULL decimal(63,30) unsigned zerofill NEVER NULL NO NO
+def test1 tb2 f73 15 NULL YES double NULL NULL 22 NULL NULL NULL NULL double NEVER NULL NO NO
+def test1 tb2 f74 16 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned NEVER NULL NO NO
+def test1 tb2 f75 17 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL NO NO
+def test1 tb2 f76 18 NULL YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL NO NO
+def test1 tb2 f77 19 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double NEVER NULL NO NO
+def test1 tb2 f78 20 7.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned NEVER NULL NO NO
+def test1 tb2 f79 21 00000000000000000007.7 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL NO NO
+def test1 tb2 f80 22 00000000000000000008.8 YES double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL NO NO
+def test1 tb2 f81 23 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL NO NO
+def test1 tb2 f82 24 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL NO NO
+def test1 tb2 f83 25 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test1 tb2 f84 26 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test1 tb2 f85 27 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL NO NO
+def test1 tb2 f86 28 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL NO NO
+def test1 tb2 f87 29 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL NO NO
+def test1 tb2 f88 30 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL NO NO
+def test1 tb2 f89 31 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test1 tb2 f90 32 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test1 tb2 f91 33 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test1 tb2 f92 34 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test1 tb2 f93 35 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float NEVER NULL NO NO
+def test1 tb2 f94 36 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double NEVER NULL NO NO
+def test1 tb2 f95 37 8.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned NEVER NULL NO NO
+def test1 tb2 f96 38 8.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned NEVER NULL NO NO
+def test1 tb2 f97 39 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test1 tb2 f98 40 00000000000000000008.8 NO double NULL NULL 22 NULL NULL NULL NULL double unsigned zerofill NEVER NULL NO NO
+def test1 tb2 f99 41 0000000008.8 NO float NULL NULL 12 NULL NULL NULL NULL float unsigned zerofill NEVER NULL NO NO
+def test4 t6 f1 1 NULL YES char 20 20 NULL NULL NULL latin1 latin1_swedish_ci char(20) NEVER NULL NO NO
+def test4 t6 f2 2 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL NO NO
+def test4 t6 f3 3 NULL YES date NULL NULL NULL NULL NULL NULL NULL date NEVER NULL NO NO
+def test4 t6 f4 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def test4 t6 f5 5 NULL YES char 25 25 NULL NULL NULL latin1 latin1_swedish_ci char(25) NEVER NULL NO NO
+def test4 t6 f6 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql.result b/mysql-test/suite/funcs_1/r/is_columns_mysql.result
index 154eaef5..4cc89240 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_mysql.result
@@ -1,261 +1,262 @@
SELECT * FROM information_schema.columns
WHERE table_schema = 'mysql'
ORDER BY table_schema, table_name, column_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
-def mysql columns_priv Column_name 5 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI select,insert,update,references NEVER NULL
-def mysql columns_priv Column_priv 7 '' NO set 31 93 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('Select','Insert','Update','References') select,insert,update,references NEVER NULL
-def mysql columns_priv Db 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI select,insert,update,references NEVER NULL
-def mysql columns_priv Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI select,insert,update,references NEVER NULL
-def mysql columns_priv Table_name 4 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI select,insert,update,references NEVER NULL
-def mysql columns_priv Timestamp 6 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL
-def mysql columns_priv User 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI select,insert,update,references NEVER NULL
-def mysql column_stats avg_frequency 8 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) select,insert,update,references NEVER NULL
-def mysql column_stats avg_length 7 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) select,insert,update,references NEVER NULL
-def mysql column_stats column_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL
-def mysql column_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL
-def mysql column_stats histogram 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL
-def mysql column_stats hist_size 9 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned select,insert,update,references NEVER NULL
-def mysql column_stats hist_type 10 NULL YES enum 14 42 NULL NULL NULL utf8mb3 utf8mb3_bin enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB') select,insert,update,references NEVER NULL
-def mysql column_stats max_value 5 NULL YES varbinary 255 255 NULL NULL NULL NULL NULL varbinary(255) select,insert,update,references NEVER NULL
-def mysql column_stats min_value 4 NULL YES varbinary 255 255 NULL NULL NULL NULL NULL varbinary(255) select,insert,update,references NEVER NULL
-def mysql column_stats nulls_ratio 6 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) select,insert,update,references NEVER NULL
-def mysql column_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL
-def mysql db Alter_priv 13 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql db Alter_routine_priv 19 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql db Create_priv 8 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql db Create_routine_priv 18 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql db Create_tmp_table_priv 14 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql db Create_view_priv 16 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql db Db 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI select,insert,update,references NEVER NULL
-def mysql db Delete_history_priv 23 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql db Delete_priv 7 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql db Drop_priv 9 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql db Event_priv 21 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql db Execute_priv 20 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql db Grant_priv 10 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql db Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI select,insert,update,references NEVER NULL
-def mysql db Index_priv 12 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql db Insert_priv 5 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql db Lock_tables_priv 15 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql db References_priv 11 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql db Select_priv 4 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql db Show_view_priv 17 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql db Trigger_priv 22 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql db Update_priv 6 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql db User 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI select,insert,update,references NEVER NULL
-def mysql event body 3 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL
-def mysql event body_utf8 22 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL
-def mysql event character_set_client 19 NULL YES char 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin char(32) select,insert,update,references NEVER NULL
-def mysql event collation_connection 20 NULL YES char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) select,insert,update,references NEVER NULL
-def mysql event comment 16 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) select,insert,update,references NEVER NULL
-def mysql event created 8 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL
-def mysql event db 1 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI select,insert,update,references NEVER NULL
-def mysql event db_collation 21 NULL YES char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) select,insert,update,references NEVER NULL
-def mysql event definer 4 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(384) select,insert,update,references NEVER NULL
-def mysql event ends 12 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL
-def mysql event execute_at 5 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL
-def mysql event interval_field 7 NULL YES enum 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') select,insert,update,references NEVER NULL
-def mysql event interval_value 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def mysql event last_executed 10 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL
-def mysql event modified 9 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL
-def mysql event name 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) PRI select,insert,update,references NEVER NULL
-def mysql event on_completion 14 'DROP' NO enum 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('DROP','PRESERVE') select,insert,update,references NEVER NULL
-def mysql event originator 17 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
-def mysql event sql_mode 15 '' NO set 561 1683 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT','TIME_ROUND_FRACTIONAL') select,insert,update,references NEVER NULL
-def mysql event starts 11 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL
-def mysql event status 13 'ENABLED' NO enum 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') select,insert,update,references NEVER NULL
-def mysql event time_zone 18 'SYSTEM' NO char 64 64 NULL NULL NULL latin1 latin1_swedish_ci char(64) select,insert,update,references NEVER NULL
-def mysql func dl 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references NEVER NULL
-def mysql func name 1 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI select,insert,update,references NEVER NULL
-def mysql func ret 2 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) select,insert,update,references NEVER NULL
-def mysql func type 4 NULL NO enum 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('function','aggregate') select,insert,update,references NEVER NULL
-def mysql general_log argument 6 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8mb3 utf8mb3_general_ci mediumtext select,insert,update,references NEVER NULL
-def mysql general_log command_type 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NEVER NULL
-def mysql general_log event_time 1 current_timestamp(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update current_timestamp(6) select,insert,update,references NEVER NULL
-def mysql general_log server_id 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
-def mysql general_log thread_id 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select,insert,update,references NEVER NULL
-def mysql general_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8mb3 utf8mb3_general_ci mediumtext select,insert,update,references NEVER NULL
-def mysql global_priv Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI select,insert,update,references NEVER NULL
-def mysql global_priv Priv 3 '{}' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext select,insert,update,references NEVER NULL
-def mysql global_priv User 2 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI select,insert,update,references NEVER NULL
-def mysql gtid_slave_pos domain_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references NEVER NULL
-def mysql gtid_slave_pos seq_no 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def mysql gtid_slave_pos server_id 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
-def mysql gtid_slave_pos sub_id 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned PRI select,insert,update,references NEVER NULL
-def mysql help_category help_category_id 1 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned PRI select,insert,update,references NEVER NULL
-def mysql help_category name 2 NULL NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) UNI select,insert,update,references NEVER NULL
-def mysql help_category parent_category_id 3 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned select,insert,update,references NEVER NULL
-def mysql help_category url 4 NULL NO text 65535 65535 NULL NULL NULL utf8mb3 utf8mb3_general_ci text select,insert,update,references NEVER NULL
-def mysql help_keyword help_keyword_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references NEVER NULL
-def mysql help_keyword name 2 NULL NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) UNI select,insert,update,references NEVER NULL
-def mysql help_relation help_keyword_id 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references NEVER NULL
-def mysql help_relation help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references NEVER NULL
-def mysql help_topic description 4 NULL NO text 65535 65535 NULL NULL NULL utf8mb3 utf8mb3_general_ci text select,insert,update,references NEVER NULL
-def mysql help_topic example 5 NULL NO text 65535 65535 NULL NULL NULL utf8mb3 utf8mb3_general_ci text select,insert,update,references NEVER NULL
-def mysql help_topic help_category_id 3 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned select,insert,update,references NEVER NULL
-def mysql help_topic help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references NEVER NULL
-def mysql help_topic name 2 NULL NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) UNI select,insert,update,references NEVER NULL
-def mysql help_topic url 6 NULL NO text 65535 65535 NULL NULL NULL utf8mb3 utf8mb3_general_ci text select,insert,update,references NEVER NULL
-def mysql index_stats avg_frequency 5 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) select,insert,update,references NEVER NULL
-def mysql index_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL
-def mysql index_stats index_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL
-def mysql index_stats prefix_arity 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned PRI select,insert,update,references NEVER NULL
-def mysql index_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL
-def mysql innodb_index_stats database_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL
-def mysql innodb_index_stats index_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL
-def mysql innodb_index_stats last_update 4 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL
-def mysql innodb_index_stats sample_size 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def mysql innodb_index_stats stat_description 8 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(1024) select,insert,update,references NEVER NULL
-def mysql innodb_index_stats stat_name 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL
-def mysql innodb_index_stats stat_value 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def mysql innodb_index_stats table_name 2 NULL NO varchar 199 597 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(199) PRI select,insert,update,references NEVER NULL
-def mysql innodb_table_stats clustered_index_size 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def mysql innodb_table_stats database_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL
-def mysql innodb_table_stats last_update 3 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL
-def mysql innodb_table_stats n_rows 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def mysql innodb_table_stats sum_of_other_index_sizes 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def mysql innodb_table_stats table_name 2 NULL NO varchar 199 597 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(199) PRI select,insert,update,references NEVER NULL
-def mysql plugin dl 2 '' NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references NEVER NULL
-def mysql plugin name 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) PRI select,insert,update,references NEVER NULL
-def mysql proc aggregate 21 'NONE' NO enum 5 15 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('NONE','GROUP') select,insert,update,references NEVER NULL
-def mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL
-def mysql proc body_utf8 20 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL
-def mysql proc character_set_client 17 NULL YES char 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin char(32) select,insert,update,references NEVER NULL
-def mysql proc collation_connection 18 NULL YES char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) select,insert,update,references NEVER NULL
-def mysql proc comment 16 NULL NO text 65535 65535 NULL NULL NULL utf8mb3 utf8mb3_bin text select,insert,update,references NEVER NULL
-def mysql proc created 13 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL
-def mysql proc db 1 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI select,insert,update,references NEVER NULL
-def mysql proc db_collation 19 NULL YES char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) select,insert,update,references NEVER NULL
-def mysql proc definer 12 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(384) select,insert,update,references NEVER NULL
-def mysql proc is_deterministic 7 'NO' NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references NEVER NULL
-def mysql proc language 5 'SQL' NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('SQL') select,insert,update,references NEVER NULL
-def mysql proc modified 14 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL
-def mysql proc name 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) PRI select,insert,update,references NEVER NULL
-def mysql proc param_list 9 NULL NO blob 65535 65535 NULL NULL NULL NULL NULL blob select,insert,update,references NEVER NULL
-def mysql proc returns 10 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL
-def mysql proc security_type 8 'DEFINER' NO enum 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('INVOKER','DEFINER') select,insert,update,references NEVER NULL
-def mysql proc specific_name 4 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) select,insert,update,references NEVER NULL
-def mysql proc sql_data_access 6 'CONTAINS_SQL' NO enum 17 51 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') select,insert,update,references NEVER NULL
-def mysql proc sql_mode 15 '' NO set 561 1683 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT','TIME_ROUND_FRACTIONAL') select,insert,update,references NEVER NULL
-def mysql proc type 3 NULL NO enum 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') PRI select,insert,update,references NEVER NULL
-def mysql procs_priv Db 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI select,insert,update,references NEVER NULL
-def mysql procs_priv Grantor 6 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(384) MUL select,insert,update,references NEVER NULL
-def mysql procs_priv Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI select,insert,update,references NEVER NULL
-def mysql procs_priv Proc_priv 7 '' NO set 27 81 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('Execute','Alter Routine','Grant') select,insert,update,references NEVER NULL
-def mysql procs_priv Routine_name 4 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) PRI select,insert,update,references NEVER NULL
-def mysql procs_priv Routine_type 5 NULL NO enum 12 36 NULL NULL NULL utf8mb3 utf8mb3_bin enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') PRI select,insert,update,references NEVER NULL
-def mysql procs_priv Timestamp 8 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL
-def mysql procs_priv User 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI select,insert,update,references NEVER NULL
-def mysql proxies_priv Grantor 6 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(384) MUL select,insert,update,references NEVER NULL
-def mysql proxies_priv Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI select,insert,update,references NEVER NULL
-def mysql proxies_priv Proxied_host 3 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI select,insert,update,references NEVER NULL
-def mysql proxies_priv Proxied_user 4 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI select,insert,update,references NEVER NULL
-def mysql proxies_priv Timestamp 7 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL
-def mysql proxies_priv User 2 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI select,insert,update,references NEVER NULL
-def mysql proxies_priv With_grant 5 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) select,insert,update,references NEVER NULL
-def mysql roles_mapping Admin_option 4 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL
-def mysql roles_mapping Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI select,insert,update,references NEVER NULL
-def mysql roles_mapping Role 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI select,insert,update,references NEVER NULL
-def mysql roles_mapping User 2 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI select,insert,update,references NEVER NULL
-def mysql servers Db 3 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) select,insert,update,references NEVER NULL
-def mysql servers Host 2 '' NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select,insert,update,references NEVER NULL
-def mysql servers Owner 9 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references NEVER NULL
-def mysql servers Password 5 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) select,insert,update,references NEVER NULL
-def mysql servers Port 6 0 NO int NULL NULL 10 0 NULL NULL NULL int(4) select,insert,update,references NEVER NULL
-def mysql servers Server_name 1 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) PRI select,insert,update,references NEVER NULL
-def mysql servers Socket 7 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) select,insert,update,references NEVER NULL
-def mysql servers Username 4 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(128) select,insert,update,references NEVER NULL
-def mysql servers Wrapper 8 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) select,insert,update,references NEVER NULL
-def mysql slow_log db 7 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references NEVER NULL
-def mysql slow_log insert_id 9 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def mysql slow_log last_insert_id 8 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def mysql slow_log lock_time 4 NULL NO time NULL NULL NULL NULL 6 NULL NULL time(6) select,insert,update,references NEVER NULL
-def mysql slow_log query_time 3 NULL NO time NULL NULL NULL NULL 6 NULL NULL time(6) select,insert,update,references NEVER NULL
-def mysql slow_log rows_affected 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def mysql slow_log rows_examined 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def mysql slow_log rows_sent 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def mysql slow_log server_id 10 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
-def mysql slow_log sql_text 11 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8mb3 utf8mb3_general_ci mediumtext select,insert,update,references NEVER NULL
-def mysql slow_log start_time 1 current_timestamp(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update current_timestamp(6) select,insert,update,references NEVER NULL
-def mysql slow_log thread_id 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select,insert,update,references NEVER NULL
-def mysql slow_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8mb3 utf8mb3_general_ci mediumtext select,insert,update,references NEVER NULL
-def mysql tables_priv Column_priv 8 '' NO set 31 93 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('Select','Insert','Update','References') select,insert,update,references NEVER NULL
-def mysql tables_priv Db 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI select,insert,update,references NEVER NULL
-def mysql tables_priv Grantor 5 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(384) MUL select,insert,update,references NEVER NULL
-def mysql tables_priv Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI select,insert,update,references NEVER NULL
-def mysql tables_priv Table_name 4 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI select,insert,update,references NEVER NULL
-def mysql tables_priv Table_priv 7 '' NO set 121 363 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger','Delete versioning rows') select,insert,update,references NEVER NULL
-def mysql tables_priv Timestamp 6 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL
-def mysql tables_priv User 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI select,insert,update,references NEVER NULL
-def mysql table_stats cardinality 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select,insert,update,references NEVER NULL
-def mysql table_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL
-def mysql table_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL
-def mysql time_zone Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI auto_increment select,insert,update,references NEVER NULL
-def mysql time_zone Use_leap_seconds 2 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('Y','N') select,insert,update,references NEVER NULL
-def mysql time_zone_leap_second Correction 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def mysql time_zone_leap_second Transition_time 1 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) PRI select,insert,update,references NEVER NULL
-def mysql time_zone_name Name 1 NULL NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) PRI select,insert,update,references NEVER NULL
-def mysql time_zone_name Time_zone_id 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
-def mysql time_zone_transition Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references NEVER NULL
-def mysql time_zone_transition Transition_time 2 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) PRI select,insert,update,references NEVER NULL
-def mysql time_zone_transition Transition_type_id 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL
-def mysql time_zone_transition_type Abbreviation 5 '' NO char 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(8) select,insert,update,references NEVER NULL
-def mysql time_zone_transition_type Is_DST 4 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned select,insert,update,references NEVER NULL
-def mysql time_zone_transition_type Offset 3 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL
-def mysql time_zone_transition_type Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references NEVER NULL
-def mysql time_zone_transition_type Transition_type_id 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references NEVER NULL
-def mysql transaction_registry begin_timestamp 3 '0000-00-00 00:00:00.000000' NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) MUL select,insert,update,references NEVER NULL
-def mysql transaction_registry commit_id 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned UNI select,insert,update,references NEVER NULL
-def mysql transaction_registry commit_timestamp 4 '0000-00-00 00:00:00.000000' NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) MUL select,insert,update,references NEVER NULL
-def mysql transaction_registry isolation_level 5 NULL NO enum 16 48 NULL NULL NULL utf8mb3 utf8mb3_bin enum('READ-UNCOMMITTED','READ-COMMITTED','REPEATABLE-READ','SERIALIZABLE') select,insert,update,references NEVER NULL
-def mysql transaction_registry transaction_id 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned PRI select,insert,update,references NEVER NULL
-def mysql user Alter_priv 17 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user Alter_routine_priv 28 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user authentication_string 43 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext select,insert,update,references NEVER NULL
-def mysql user Create_priv 8 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user Create_routine_priv 27 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user Create_tablespace_priv 32 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user Create_tmp_table_priv 20 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user Create_user_priv 29 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user Create_view_priv 25 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user default_role 46 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext select,insert,update,references NEVER NULL
-def mysql user Delete_history_priv 33 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user Delete_priv 7 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user Drop_priv 9 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user Event_priv 30 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user Execute_priv 22 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user File_priv 13 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user Grant_priv 14 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) select,insert,update,references NEVER NULL
-def mysql user Index_priv 16 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user Insert_priv 5 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user is_role 45 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user Lock_tables_priv 21 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user max_connections 40 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def mysql user max_questions 38 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def mysql user max_statement_time 47 0.000000 NO decimal NULL NULL 12 6 NULL NULL NULL decimal(12,6) select,insert,update,references NEVER NULL
-def mysql user max_updates 39 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL
-def mysql user max_user_connections 41 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select,insert,update,references NEVER NULL
-def mysql user Password 3 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext select,insert,update,references NEVER NULL
-def mysql user password_expired 44 '' NO varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user plugin 42 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext select,insert,update,references NEVER NULL
-def mysql user Process_priv 12 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user References_priv 15 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user Reload_priv 10 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user Repl_client_priv 24 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user Repl_slave_priv 23 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user Select_priv 4 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user Show_db_priv 18 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user Show_view_priv 26 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user Shutdown_priv 11 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user ssl_cipher 35 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext select,insert,update,references NEVER NULL
-def mysql user ssl_type 34 NULL YES varchar 9 9 NULL NULL NULL latin1 latin1_swedish_ci varchar(9) select,insert,update,references NEVER NULL
-def mysql user Super_priv 19 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user Trigger_priv 31 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user Update_priv 6 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL
-def mysql user User 2 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references NEVER NULL
-def mysql user x509_issuer 36 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext select,insert,update,references NEVER NULL
-def mysql user x509_subject 37 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext select,insert,update,references NEVER NULL
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
+def mysql columns_priv Column_name 5 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql columns_priv Column_priv 7 '' NO set 31 93 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('Select','Insert','Update','References') select,insert,update,references NEVER NULL NO NO
+def mysql columns_priv Db 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql columns_priv Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI select,insert,update,references NEVER NULL NO NO
+def mysql columns_priv Table_name 4 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql columns_priv Timestamp 6 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL NO NO
+def mysql columns_priv User 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI select,insert,update,references NEVER NULL NO NO
+def mysql column_stats avg_frequency 8 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) select,insert,update,references NEVER NULL NO NO
+def mysql column_stats avg_length 7 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) select,insert,update,references NEVER NULL NO NO
+def mysql column_stats column_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql column_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql column_stats histogram 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL NO NO
+def mysql column_stats hist_size 9 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql column_stats hist_type 10 NULL YES enum 14 42 NULL NULL NULL utf8mb3 utf8mb3_bin enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB') select,insert,update,references NEVER NULL NO NO
+def mysql column_stats max_value 5 NULL YES varbinary 255 255 NULL NULL NULL NULL NULL varbinary(255) select,insert,update,references NEVER NULL NO NO
+def mysql column_stats min_value 4 NULL YES varbinary 255 255 NULL NULL NULL NULL NULL varbinary(255) select,insert,update,references NEVER NULL NO NO
+def mysql column_stats nulls_ratio 6 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) select,insert,update,references NEVER NULL NO NO
+def mysql column_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql db Alter_priv 13 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL NO NO
+def mysql db Alter_routine_priv 19 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL NO NO
+def mysql db Create_priv 8 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL NO NO
+def mysql db Create_routine_priv 18 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL NO NO
+def mysql db Create_tmp_table_priv 14 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL NO NO
+def mysql db Create_view_priv 16 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL NO NO
+def mysql db Db 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql db Delete_history_priv 23 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL NO NO
+def mysql db Delete_priv 7 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL NO NO
+def mysql db Drop_priv 9 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL NO NO
+def mysql db Event_priv 21 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL NO NO
+def mysql db Execute_priv 20 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL NO NO
+def mysql db Grant_priv 10 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL NO NO
+def mysql db Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI select,insert,update,references NEVER NULL NO NO
+def mysql db Index_priv 12 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL NO NO
+def mysql db Insert_priv 5 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL NO NO
+def mysql db Lock_tables_priv 15 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL NO NO
+def mysql db References_priv 11 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL NO NO
+def mysql db Select_priv 4 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL NO NO
+def mysql db Show_create_routine_priv 24 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL NO NO
+def mysql db Show_view_priv 17 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL NO NO
+def mysql db Trigger_priv 22 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL NO NO
+def mysql db Update_priv 6 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL NO NO
+def mysql db User 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI select,insert,update,references NEVER NULL NO NO
+def mysql event body 3 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL NO NO
+def mysql event body_utf8 22 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL NO NO
+def mysql event character_set_client 19 NULL YES char 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin char(32) select,insert,update,references NEVER NULL NO NO
+def mysql event collation_connection 20 NULL YES char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) select,insert,update,references NEVER NULL NO NO
+def mysql event comment 16 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) select,insert,update,references NEVER NULL NO NO
+def mysql event created 8 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL NO NO
+def mysql event db 1 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql event db_collation 21 NULL YES char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) select,insert,update,references NEVER NULL NO NO
+def mysql event definer 4 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(384) select,insert,update,references NEVER NULL NO NO
+def mysql event ends 12 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL NO NO
+def mysql event execute_at 5 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL NO NO
+def mysql event interval_field 7 NULL YES enum 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') select,insert,update,references NEVER NULL NO NO
+def mysql event interval_value 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def mysql event last_executed 10 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL NO NO
+def mysql event modified 9 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL NO NO
+def mysql event name 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql event on_completion 14 'DROP' NO enum 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('DROP','PRESERVE') select,insert,update,references NEVER NULL NO NO
+def mysql event originator 17 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql event sql_mode 15 '' NO set 561 1683 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT','TIME_ROUND_FRACTIONAL') select,insert,update,references NEVER NULL NO NO
+def mysql event starts 11 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime select,insert,update,references NEVER NULL NO NO
+def mysql event status 13 'ENABLED' NO enum 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') select,insert,update,references NEVER NULL NO NO
+def mysql event time_zone 18 'SYSTEM' NO char 64 64 NULL NULL NULL latin1 latin1_swedish_ci char(64) select,insert,update,references NEVER NULL NO NO
+def mysql func dl 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references NEVER NULL NO NO
+def mysql func name 1 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql func ret 2 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) select,insert,update,references NEVER NULL NO NO
+def mysql func type 4 NULL NO enum 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('function','aggregate') select,insert,update,references NEVER NULL NO NO
+def mysql general_log argument 6 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8mb3 utf8mb3_general_ci mediumtext select,insert,update,references NEVER NULL NO NO
+def mysql general_log command_type 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NEVER NULL NO NO
+def mysql general_log event_time 1 current_timestamp(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update current_timestamp(6) select,insert,update,references NEVER NULL NO NO
+def mysql general_log server_id 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql general_log thread_id 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql general_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8mb3 utf8mb3_general_ci mediumtext select,insert,update,references NEVER NULL NO NO
+def mysql global_priv Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI select,insert,update,references NEVER NULL NO NO
+def mysql global_priv Priv 3 '{}' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext select,insert,update,references NEVER NULL NO NO
+def mysql global_priv User 2 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI select,insert,update,references NEVER NULL NO NO
+def mysql gtid_slave_pos domain_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references NEVER NULL NO NO
+def mysql gtid_slave_pos seq_no 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql gtid_slave_pos server_id 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql gtid_slave_pos sub_id 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned PRI select,insert,update,references NEVER NULL NO NO
+def mysql help_category help_category_id 1 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned PRI select,insert,update,references NEVER NULL NO NO
+def mysql help_category name 2 NULL NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) UNI select,insert,update,references NEVER NULL NO NO
+def mysql help_category parent_category_id 3 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql help_category url 4 NULL NO text 65535 65535 NULL NULL NULL utf8mb3 utf8mb3_general_ci text select,insert,update,references NEVER NULL NO NO
+def mysql help_keyword help_keyword_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references NEVER NULL NO NO
+def mysql help_keyword name 2 NULL NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) UNI select,insert,update,references NEVER NULL NO NO
+def mysql help_relation help_keyword_id 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references NEVER NULL NO NO
+def mysql help_relation help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references NEVER NULL NO NO
+def mysql help_topic description 4 NULL NO text 65535 65535 NULL NULL NULL utf8mb3 utf8mb3_general_ci text select,insert,update,references NEVER NULL NO NO
+def mysql help_topic example 5 NULL NO text 65535 65535 NULL NULL NULL utf8mb3 utf8mb3_general_ci text select,insert,update,references NEVER NULL NO NO
+def mysql help_topic help_category_id 3 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql help_topic help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references NEVER NULL NO NO
+def mysql help_topic name 2 NULL NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) UNI select,insert,update,references NEVER NULL NO NO
+def mysql help_topic url 6 NULL NO text 65535 65535 NULL NULL NULL utf8mb3 utf8mb3_general_ci text select,insert,update,references NEVER NULL NO NO
+def mysql index_stats avg_frequency 5 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) select,insert,update,references NEVER NULL NO NO
+def mysql index_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql index_stats index_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql index_stats prefix_arity 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned PRI select,insert,update,references NEVER NULL NO NO
+def mysql index_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql innodb_index_stats database_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql innodb_index_stats index_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql innodb_index_stats last_update 4 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL NO NO
+def mysql innodb_index_stats sample_size 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql innodb_index_stats stat_description 8 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(1024) select,insert,update,references NEVER NULL NO NO
+def mysql innodb_index_stats stat_name 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql innodb_index_stats stat_value 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql innodb_index_stats table_name 2 NULL NO varchar 199 597 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(199) PRI select,insert,update,references NEVER NULL NO NO
+def mysql innodb_table_stats clustered_index_size 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql innodb_table_stats database_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql innodb_table_stats last_update 3 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL NO NO
+def mysql innodb_table_stats n_rows 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql innodb_table_stats sum_of_other_index_sizes 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql innodb_table_stats table_name 2 NULL NO varchar 199 597 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(199) PRI select,insert,update,references NEVER NULL NO NO
+def mysql plugin dl 2 '' NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references NEVER NULL NO NO
+def mysql plugin name 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql proc aggregate 21 'NONE' NO enum 5 15 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('NONE','GROUP') select,insert,update,references NEVER NULL NO NO
+def mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL NO NO
+def mysql proc body_utf8 20 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL NO NO
+def mysql proc character_set_client 17 NULL YES char 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin char(32) select,insert,update,references NEVER NULL NO NO
+def mysql proc collation_connection 18 NULL YES char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) select,insert,update,references NEVER NULL NO NO
+def mysql proc comment 16 NULL NO text 65535 65535 NULL NULL NULL utf8mb3 utf8mb3_bin text select,insert,update,references NEVER NULL NO NO
+def mysql proc created 13 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL NO NO
+def mysql proc db 1 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql proc db_collation 19 NULL YES char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) select,insert,update,references NEVER NULL NO NO
+def mysql proc definer 12 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(384) select,insert,update,references NEVER NULL NO NO
+def mysql proc is_deterministic 7 'NO' NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references NEVER NULL NO NO
+def mysql proc language 5 'SQL' NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('SQL') select,insert,update,references NEVER NULL NO NO
+def mysql proc modified 14 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references NEVER NULL NO NO
+def mysql proc name 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql proc param_list 9 NULL NO blob 65535 65535 NULL NULL NULL NULL NULL blob select,insert,update,references NEVER NULL NO NO
+def mysql proc returns 10 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references NEVER NULL NO NO
+def mysql proc security_type 8 'DEFINER' NO enum 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('INVOKER','DEFINER') select,insert,update,references NEVER NULL NO NO
+def mysql proc specific_name 4 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) select,insert,update,references NEVER NULL NO NO
+def mysql proc sql_data_access 6 'CONTAINS_SQL' NO enum 17 51 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') select,insert,update,references NEVER NULL NO NO
+def mysql proc sql_mode 15 '' NO set 561 1683 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT','TIME_ROUND_FRACTIONAL') select,insert,update,references NEVER NULL NO NO
+def mysql proc type 3 NULL NO enum 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') PRI select,insert,update,references NEVER NULL NO NO
+def mysql procs_priv Db 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql procs_priv Grantor 6 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(384) MUL select,insert,update,references NEVER NULL NO NO
+def mysql procs_priv Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI select,insert,update,references NEVER NULL NO NO
+def mysql procs_priv Proc_priv 7 '' NO set 47 141 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('Execute','Alter Routine','Grant','Show Create Routine') select,insert,update,references NEVER NULL NO NO
+def mysql procs_priv Routine_name 4 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql procs_priv Routine_type 5 NULL NO enum 12 36 NULL NULL NULL utf8mb3 utf8mb3_bin enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') PRI select,insert,update,references NEVER NULL NO NO
+def mysql procs_priv Timestamp 8 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL NO NO
+def mysql procs_priv User 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI select,insert,update,references NEVER NULL NO NO
+def mysql proxies_priv Grantor 6 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(384) MUL select,insert,update,references NEVER NULL NO NO
+def mysql proxies_priv Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI select,insert,update,references NEVER NULL NO NO
+def mysql proxies_priv Proxied_host 3 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI select,insert,update,references NEVER NULL NO NO
+def mysql proxies_priv Proxied_user 4 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI select,insert,update,references NEVER NULL NO NO
+def mysql proxies_priv Timestamp 7 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL NO NO
+def mysql proxies_priv User 2 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI select,insert,update,references NEVER NULL NO NO
+def mysql proxies_priv With_grant 5 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) select,insert,update,references NEVER NULL NO NO
+def mysql roles_mapping Admin_option 4 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') select,insert,update,references NEVER NULL NO NO
+def mysql roles_mapping Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI select,insert,update,references NEVER NULL NO NO
+def mysql roles_mapping Role 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI select,insert,update,references NEVER NULL NO NO
+def mysql roles_mapping User 2 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI select,insert,update,references NEVER NULL NO NO
+def mysql servers Db 3 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) select,insert,update,references NEVER NULL NO NO
+def mysql servers Host 2 '' NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) select,insert,update,references NEVER NULL NO NO
+def mysql servers Owner 9 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references NEVER NULL NO NO
+def mysql servers Password 5 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) select,insert,update,references NEVER NULL NO NO
+def mysql servers Port 6 0 NO int NULL NULL 10 0 NULL NULL NULL int(4) select,insert,update,references NEVER NULL NO NO
+def mysql servers Server_name 1 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql servers Socket 7 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) select,insert,update,references NEVER NULL NO NO
+def mysql servers Username 4 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(128) select,insert,update,references NEVER NULL NO NO
+def mysql servers Wrapper 8 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) select,insert,update,references NEVER NULL NO NO
+def mysql slow_log db 7 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references NEVER NULL NO NO
+def mysql slow_log insert_id 9 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def mysql slow_log last_insert_id 8 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def mysql slow_log lock_time 4 NULL NO time NULL NULL NULL NULL 6 NULL NULL time(6) select,insert,update,references NEVER NULL NO NO
+def mysql slow_log query_time 3 NULL NO time NULL NULL NULL NULL 6 NULL NULL time(6) select,insert,update,references NEVER NULL NO NO
+def mysql slow_log rows_affected 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql slow_log rows_examined 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql slow_log rows_sent 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql slow_log server_id 10 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql slow_log sql_text 11 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8mb3 utf8mb3_general_ci mediumtext select,insert,update,references NEVER NULL NO NO
+def mysql slow_log start_time 1 current_timestamp(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update current_timestamp(6) select,insert,update,references NEVER NULL NO NO
+def mysql slow_log thread_id 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql slow_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8mb3 utf8mb3_general_ci mediumtext select,insert,update,references NEVER NULL NO NO
+def mysql tables_priv Column_priv 8 '' NO set 31 93 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('Select','Insert','Update','References') select,insert,update,references NEVER NULL NO NO
+def mysql tables_priv Db 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql tables_priv Grantor 5 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(384) MUL select,insert,update,references NEVER NULL NO NO
+def mysql tables_priv Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI select,insert,update,references NEVER NULL NO NO
+def mysql tables_priv Table_name 4 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql tables_priv Table_priv 7 '' NO set 121 363 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger','Delete versioning rows') select,insert,update,references NEVER NULL NO NO
+def mysql tables_priv Timestamp 6 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references NEVER NULL NO NO
+def mysql tables_priv User 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI select,insert,update,references NEVER NULL NO NO
+def mysql table_stats cardinality 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql table_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql table_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql time_zone Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI auto_increment select,insert,update,references NEVER NULL NO NO
+def mysql time_zone Use_leap_seconds 2 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('Y','N') select,insert,update,references NEVER NULL NO NO
+def mysql time_zone_leap_second Correction 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def mysql time_zone_leap_second Transition_time 1 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) PRI select,insert,update,references NEVER NULL NO NO
+def mysql time_zone_name Name 1 NULL NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) PRI select,insert,update,references NEVER NULL NO NO
+def mysql time_zone_name Time_zone_id 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql time_zone_transition Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references NEVER NULL NO NO
+def mysql time_zone_transition Transition_time 2 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) PRI select,insert,update,references NEVER NULL NO NO
+def mysql time_zone_transition Transition_type_id 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql time_zone_transition_type Abbreviation 5 '' NO char 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(8) select,insert,update,references NEVER NULL NO NO
+def mysql time_zone_transition_type Is_DST 4 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql time_zone_transition_type Offset 3 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references NEVER NULL NO NO
+def mysql time_zone_transition_type Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references NEVER NULL NO NO
+def mysql time_zone_transition_type Transition_type_id 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI select,insert,update,references NEVER NULL NO NO
+def mysql transaction_registry begin_timestamp 3 '0000-00-00 00:00:00.000000' NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) MUL select,insert,update,references NEVER NULL NO NO
+def mysql transaction_registry commit_id 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned UNI select,insert,update,references NEVER NULL NO NO
+def mysql transaction_registry commit_timestamp 4 '0000-00-00 00:00:00.000000' NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) MUL select,insert,update,references NEVER NULL NO NO
+def mysql transaction_registry isolation_level 5 NULL NO enum 16 48 NULL NULL NULL utf8mb3 utf8mb3_bin enum('READ-UNCOMMITTED','READ-COMMITTED','REPEATABLE-READ','SERIALIZABLE') select,insert,update,references NEVER NULL NO NO
+def mysql transaction_registry transaction_id 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned PRI select,insert,update,references NEVER NULL NO NO
+def mysql user Alter_priv 17 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user Alter_routine_priv 28 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user authentication_string 43 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext select,insert,update,references NEVER NULL NO NO
+def mysql user Create_priv 8 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user Create_routine_priv 27 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user Create_tablespace_priv 32 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user Create_tmp_table_priv 20 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user Create_user_priv 29 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user Create_view_priv 25 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user default_role 46 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext select,insert,update,references NEVER NULL NO NO
+def mysql user Delete_history_priv 33 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user Delete_priv 7 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user Drop_priv 9 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user Event_priv 30 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user Execute_priv 22 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user File_priv 13 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user Grant_priv 14 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) select,insert,update,references NEVER NULL NO NO
+def mysql user Index_priv 16 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user Insert_priv 5 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user is_role 45 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user Lock_tables_priv 21 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user max_connections 40 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql user max_questions 38 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql user max_statement_time 47 0.000000 NO decimal NULL NULL 12 6 NULL NULL NULL decimal(12,6) select,insert,update,references NEVER NULL NO NO
+def mysql user max_updates 39 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NEVER NULL NO NO
+def mysql user max_user_connections 41 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select,insert,update,references NEVER NULL NO NO
+def mysql user Password 3 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext select,insert,update,references NEVER NULL NO NO
+def mysql user password_expired 44 '' NO varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user plugin 42 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext select,insert,update,references NEVER NULL NO NO
+def mysql user Process_priv 12 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user References_priv 15 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user Reload_priv 10 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user Repl_client_priv 24 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user Repl_slave_priv 23 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user Select_priv 4 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user Show_db_priv 18 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user Show_view_priv 26 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user Shutdown_priv 11 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user ssl_cipher 35 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext select,insert,update,references NEVER NULL NO NO
+def mysql user ssl_type 34 NULL YES varchar 9 9 NULL NULL NULL latin1 latin1_swedish_ci varchar(9) select,insert,update,references NEVER NULL NO NO
+def mysql user Super_priv 19 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user Trigger_priv 31 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user Update_priv 6 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) select,insert,update,references NEVER NULL NO NO
+def mysql user User 2 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references NEVER NULL NO NO
+def mysql user x509_issuer 36 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext select,insert,update,references NEVER NULL NO NO
+def mysql user x509_subject 37 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext select,insert,update,references NEVER NULL NO NO
##########################################################################
# Show the quotient of CHARACTER_OCTET_LENGTH and CHARACTER_MAXIMUM_LENGTH
##########################################################################
@@ -370,6 +371,7 @@ NULL mysql column_stats hist_size tinyint NULL NULL NULL NULL tinyint(3) unsigne
3.0000 mysql db Event_priv enum 1 3 utf8mb3 utf8mb3_general_ci enum('N','Y')
3.0000 mysql db Trigger_priv enum 1 3 utf8mb3 utf8mb3_general_ci enum('N','Y')
3.0000 mysql db Delete_history_priv enum 1 3 utf8mb3 utf8mb3_general_ci enum('N','Y')
+3.0000 mysql db Show_create_routine_priv enum 1 3 utf8mb3 utf8mb3_general_ci enum('N','Y')
3.0000 mysql event db char 64 192 utf8mb3 utf8mb3_bin char(64)
3.0000 mysql event name char 64 192 utf8mb3 utf8mb3_general_ci char(64)
1.0000 mysql event body longblob 4294967295 4294967295 NULL NULL longblob
@@ -471,7 +473,7 @@ NULL mysql proc modified timestamp NULL NULL NULL NULL timestamp
3.0000 mysql procs_priv Routine_name char 64 192 utf8mb3 utf8mb3_general_ci char(64)
3.0000 mysql procs_priv Routine_type enum 12 36 utf8mb3 utf8mb3_bin enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY')
3.0000 mysql procs_priv Grantor varchar 384 1152 utf8mb3 utf8mb3_bin varchar(384)
-3.0000 mysql procs_priv Proc_priv set 27 81 utf8mb3 utf8mb3_general_ci set('Execute','Alter Routine','Grant')
+3.0000 mysql procs_priv Proc_priv set 47 141 utf8mb3 utf8mb3_general_ci set('Execute','Alter Routine','Grant','Show Create Routine')
NULL mysql procs_priv Timestamp timestamp NULL NULL NULL NULL timestamp
3.0000 mysql proxies_priv Host char 255 765 utf8mb3 utf8mb3_bin char(255)
3.0000 mysql proxies_priv User char 128 384 utf8mb3 utf8mb3_bin char(128)
diff --git a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result
index 9fac1a22..3dd78073 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result
@@ -1,242 +1,243 @@
SELECT * FROM information_schema.columns
WHERE table_schema = 'mysql'
ORDER BY table_schema, table_name, column_name;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
-def mysql columns_priv Column_name 5 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI NEVER NULL
-def mysql columns_priv Column_priv 7 '' NO set 31 93 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('Select','Insert','Update','References') NEVER NULL
-def mysql columns_priv Db 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI NEVER NULL
-def mysql columns_priv Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI NEVER NULL
-def mysql columns_priv Table_name 4 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI NEVER NULL
-def mysql columns_priv Timestamp 6 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() NEVER NULL
-def mysql columns_priv User 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI NEVER NULL
-def mysql column_stats avg_frequency 8 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) NEVER NULL
-def mysql column_stats avg_length 7 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) NEVER NULL
-def mysql column_stats column_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI NEVER NULL
-def mysql column_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI NEVER NULL
-def mysql column_stats histogram 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob NEVER NULL
-def mysql column_stats hist_size 9 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned NEVER NULL
-def mysql column_stats hist_type 10 NULL YES enum 14 42 NULL NULL NULL utf8mb3 utf8mb3_bin enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB') NEVER NULL
-def mysql column_stats max_value 5 NULL YES varbinary 255 255 NULL NULL NULL NULL NULL varbinary(255) NEVER NULL
-def mysql column_stats min_value 4 NULL YES varbinary 255 255 NULL NULL NULL NULL NULL varbinary(255) NEVER NULL
-def mysql column_stats nulls_ratio 6 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) NEVER NULL
-def mysql column_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI NEVER NULL
-def mysql db Alter_priv 13 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL
-def mysql db Alter_routine_priv 19 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL
-def mysql db Create_priv 8 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL
-def mysql db Create_routine_priv 18 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL
-def mysql db Create_tmp_table_priv 14 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL
-def mysql db Create_view_priv 16 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL
-def mysql db Db 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI NEVER NULL
-def mysql db Delete_history_priv 23 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL
-def mysql db Delete_priv 7 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL
-def mysql db Drop_priv 9 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL
-def mysql db Event_priv 21 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL
-def mysql db Execute_priv 20 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL
-def mysql db Grant_priv 10 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL
-def mysql db Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI NEVER NULL
-def mysql db Index_priv 12 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL
-def mysql db Insert_priv 5 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL
-def mysql db Lock_tables_priv 15 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL
-def mysql db References_priv 11 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL
-def mysql db Select_priv 4 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL
-def mysql db Show_view_priv 17 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL
-def mysql db Trigger_priv 22 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL
-def mysql db Update_priv 6 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL
-def mysql db User 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI NEVER NULL
-def mysql event body 3 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob NEVER NULL
-def mysql event body_utf8 22 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob NEVER NULL
-def mysql event character_set_client 19 NULL YES char 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin char(32) NEVER NULL
-def mysql event collation_connection 20 NULL YES char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) NEVER NULL
-def mysql event comment 16 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) NEVER NULL
-def mysql event created 8 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() NEVER NULL
-def mysql event db 1 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI NEVER NULL
-def mysql event db_collation 21 NULL YES char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) NEVER NULL
-def mysql event definer 4 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(384) NEVER NULL
-def mysql event ends 12 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def mysql event execute_at 5 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def mysql event interval_field 7 NULL YES enum 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') NEVER NULL
-def mysql event interval_value 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def mysql event last_executed 10 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def mysql event modified 9 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp NEVER NULL
-def mysql event name 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) PRI NEVER NULL
-def mysql event on_completion 14 'DROP' NO enum 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('DROP','PRESERVE') NEVER NULL
-def mysql event originator 17 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned NEVER NULL
-def mysql event sql_mode 15 '' NO set 561 1683 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT','TIME_ROUND_FRACTIONAL') NEVER NULL
-def mysql event starts 11 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL
-def mysql event status 13 'ENABLED' NO enum 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') NEVER NULL
-def mysql event time_zone 18 'SYSTEM' NO char 64 64 NULL NULL NULL latin1 latin1_swedish_ci char(64) NEVER NULL
-def mysql func dl 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) NEVER NULL
-def mysql func name 1 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI NEVER NULL
-def mysql func ret 2 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) NEVER NULL
-def mysql func type 4 NULL NO enum 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('function','aggregate') NEVER NULL
-def mysql general_log argument 6 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8mb3 utf8mb3_general_ci mediumtext NEVER NULL
-def mysql general_log command_type 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL
-def mysql general_log event_time 1 current_timestamp(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update current_timestamp(6) NEVER NULL
-def mysql general_log server_id 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned NEVER NULL
-def mysql general_log thread_id 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def mysql general_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8mb3 utf8mb3_general_ci mediumtext NEVER NULL
-def mysql global_priv Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI NEVER NULL
-def mysql global_priv Priv 3 '{}' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext NEVER NULL
-def mysql global_priv User 2 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI NEVER NULL
-def mysql gtid_slave_pos domain_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI NEVER NULL
-def mysql gtid_slave_pos seq_no 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned NEVER NULL
-def mysql gtid_slave_pos server_id 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned NEVER NULL
-def mysql gtid_slave_pos sub_id 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned PRI NEVER NULL
-def mysql help_category help_category_id 1 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned PRI NEVER NULL
-def mysql help_category name 2 NULL NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) UNI NEVER NULL
-def mysql help_category parent_category_id 3 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned NEVER NULL
-def mysql help_category url 4 NULL NO text 65535 65535 NULL NULL NULL utf8mb3 utf8mb3_general_ci text NEVER NULL
-def mysql help_keyword help_keyword_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI NEVER NULL
-def mysql help_keyword name 2 NULL NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) UNI NEVER NULL
-def mysql help_relation help_keyword_id 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI NEVER NULL
-def mysql help_relation help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI NEVER NULL
-def mysql help_topic description 4 NULL NO text 65535 65535 NULL NULL NULL utf8mb3 utf8mb3_general_ci text NEVER NULL
-def mysql help_topic example 5 NULL NO text 65535 65535 NULL NULL NULL utf8mb3 utf8mb3_general_ci text NEVER NULL
-def mysql help_topic help_category_id 3 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned NEVER NULL
-def mysql help_topic help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI NEVER NULL
-def mysql help_topic name 2 NULL NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) UNI NEVER NULL
-def mysql help_topic url 6 NULL NO text 65535 65535 NULL NULL NULL utf8mb3 utf8mb3_general_ci text NEVER NULL
-def mysql index_stats avg_frequency 5 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) NEVER NULL
-def mysql index_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI NEVER NULL
-def mysql index_stats index_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI NEVER NULL
-def mysql index_stats prefix_arity 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned PRI NEVER NULL
-def mysql index_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI NEVER NULL
-def mysql plugin dl 2 '' NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) NEVER NULL
-def mysql plugin name 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) PRI NEVER NULL
-def mysql proc aggregate 21 'NONE' NO enum 5 15 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('NONE','GROUP') NEVER NULL
-def mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob NEVER NULL
-def mysql proc body_utf8 20 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob NEVER NULL
-def mysql proc character_set_client 17 NULL YES char 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin char(32) NEVER NULL
-def mysql proc collation_connection 18 NULL YES char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) NEVER NULL
-def mysql proc comment 16 NULL NO text 65535 65535 NULL NULL NULL utf8mb3 utf8mb3_bin text NEVER NULL
-def mysql proc created 13 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() NEVER NULL
-def mysql proc db 1 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI NEVER NULL
-def mysql proc db_collation 19 NULL YES char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) NEVER NULL
-def mysql proc definer 12 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(384) NEVER NULL
-def mysql proc is_deterministic 7 'NO' NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') NEVER NULL
-def mysql proc language 5 'SQL' NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('SQL') NEVER NULL
-def mysql proc modified 14 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp NEVER NULL
-def mysql proc name 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) PRI NEVER NULL
-def mysql proc param_list 9 NULL NO blob 65535 65535 NULL NULL NULL NULL NULL blob NEVER NULL
-def mysql proc returns 10 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob NEVER NULL
-def mysql proc security_type 8 'DEFINER' NO enum 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('INVOKER','DEFINER') NEVER NULL
-def mysql proc specific_name 4 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) NEVER NULL
-def mysql proc sql_data_access 6 'CONTAINS_SQL' NO enum 17 51 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') NEVER NULL
-def mysql proc sql_mode 15 '' NO set 561 1683 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT','TIME_ROUND_FRACTIONAL') NEVER NULL
-def mysql proc type 3 NULL NO enum 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') PRI NEVER NULL
-def mysql procs_priv Db 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI NEVER NULL
-def mysql procs_priv Grantor 6 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(384) MUL NEVER NULL
-def mysql procs_priv Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI NEVER NULL
-def mysql procs_priv Proc_priv 7 '' NO set 27 81 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('Execute','Alter Routine','Grant') NEVER NULL
-def mysql procs_priv Routine_name 4 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) PRI NEVER NULL
-def mysql procs_priv Routine_type 5 NULL NO enum 12 36 NULL NULL NULL utf8mb3 utf8mb3_bin enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') PRI NEVER NULL
-def mysql procs_priv Timestamp 8 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() NEVER NULL
-def mysql procs_priv User 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI NEVER NULL
-def mysql proxies_priv Grantor 6 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(384) MUL NEVER NULL
-def mysql proxies_priv Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI NEVER NULL
-def mysql proxies_priv Proxied_host 3 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI NEVER NULL
-def mysql proxies_priv Proxied_user 4 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI NEVER NULL
-def mysql proxies_priv Timestamp 7 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() NEVER NULL
-def mysql proxies_priv User 2 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI NEVER NULL
-def mysql proxies_priv With_grant 5 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) NEVER NULL
-def mysql roles_mapping Admin_option 4 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL
-def mysql roles_mapping Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI NEVER NULL
-def mysql roles_mapping Role 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI NEVER NULL
-def mysql roles_mapping User 2 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI NEVER NULL
-def mysql servers Db 3 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) NEVER NULL
-def mysql servers Host 2 '' NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL
-def mysql servers Owner 9 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def mysql servers Password 5 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) NEVER NULL
-def mysql servers Port 6 0 NO int NULL NULL 10 0 NULL NULL NULL int(4) NEVER NULL
-def mysql servers Server_name 1 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) PRI NEVER NULL
-def mysql servers Socket 7 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) NEVER NULL
-def mysql servers Username 4 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(128) NEVER NULL
-def mysql servers Wrapper 8 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) NEVER NULL
-def mysql slow_log db 7 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL
-def mysql slow_log insert_id 9 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def mysql slow_log last_insert_id 8 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def mysql slow_log lock_time 4 NULL NO time NULL NULL NULL NULL 6 NULL NULL time(6) NEVER NULL
-def mysql slow_log query_time 3 NULL NO time NULL NULL NULL NULL 6 NULL NULL time(6) NEVER NULL
-def mysql slow_log rows_affected 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned NEVER NULL
-def mysql slow_log rows_examined 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned NEVER NULL
-def mysql slow_log rows_sent 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned NEVER NULL
-def mysql slow_log server_id 10 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned NEVER NULL
-def mysql slow_log sql_text 11 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8mb3 utf8mb3_general_ci mediumtext NEVER NULL
-def mysql slow_log start_time 1 current_timestamp(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update current_timestamp(6) NEVER NULL
-def mysql slow_log thread_id 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def mysql slow_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8mb3 utf8mb3_general_ci mediumtext NEVER NULL
-def mysql tables_priv Column_priv 8 '' NO set 31 93 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('Select','Insert','Update','References') NEVER NULL
-def mysql tables_priv Db 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI NEVER NULL
-def mysql tables_priv Grantor 5 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(384) MUL NEVER NULL
-def mysql tables_priv Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI NEVER NULL
-def mysql tables_priv Table_name 4 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI NEVER NULL
-def mysql tables_priv Table_priv 7 '' NO set 121 363 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger','Delete versioning rows') NEVER NULL
-def mysql tables_priv Timestamp 6 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() NEVER NULL
-def mysql tables_priv User 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI NEVER NULL
-def mysql table_stats cardinality 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL
-def mysql table_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI NEVER NULL
-def mysql table_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI NEVER NULL
-def mysql time_zone Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI auto_increment NEVER NULL
-def mysql time_zone Use_leap_seconds 2 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('Y','N') NEVER NULL
-def mysql time_zone_leap_second Correction 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def mysql time_zone_leap_second Transition_time 1 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) PRI NEVER NULL
-def mysql time_zone_name Name 1 NULL NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) PRI NEVER NULL
-def mysql time_zone_name Time_zone_id 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned NEVER NULL
-def mysql time_zone_transition Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI NEVER NULL
-def mysql time_zone_transition Transition_time 2 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) PRI NEVER NULL
-def mysql time_zone_transition Transition_type_id 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned NEVER NULL
-def mysql time_zone_transition_type Abbreviation 5 '' NO char 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(8) NEVER NULL
-def mysql time_zone_transition_type Is_DST 4 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned NEVER NULL
-def mysql time_zone_transition_type Offset 3 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL
-def mysql time_zone_transition_type Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI NEVER NULL
-def mysql time_zone_transition_type Transition_type_id 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI NEVER NULL
-def mysql user Alter_priv 17 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user Alter_routine_priv 28 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user authentication_string 43 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext NEVER NULL
-def mysql user Create_priv 8 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user Create_routine_priv 27 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user Create_tablespace_priv 32 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user Create_tmp_table_priv 20 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user Create_user_priv 29 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user Create_view_priv 25 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user default_role 46 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext NEVER NULL
-def mysql user Delete_history_priv 33 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user Delete_priv 7 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user Drop_priv 9 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user Event_priv 30 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user Execute_priv 22 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user File_priv 13 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user Grant_priv 14 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) NEVER NULL
-def mysql user Index_priv 16 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user Insert_priv 5 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user is_role 45 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user Lock_tables_priv 21 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user max_connections 40 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned NEVER NULL
-def mysql user max_questions 38 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned NEVER NULL
-def mysql user max_statement_time 47 0.000000 NO decimal NULL NULL 12 6 NULL NULL NULL decimal(12,6) NEVER NULL
-def mysql user max_updates 39 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned NEVER NULL
-def mysql user max_user_connections 41 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
-def mysql user Password 3 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext NEVER NULL
-def mysql user password_expired 44 '' NO varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user plugin 42 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext NEVER NULL
-def mysql user Process_priv 12 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user References_priv 15 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user Reload_priv 10 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user Repl_client_priv 24 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user Repl_slave_priv 23 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user Select_priv 4 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user Show_db_priv 18 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user Show_view_priv 26 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user Shutdown_priv 11 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user ssl_cipher 35 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext NEVER NULL
-def mysql user ssl_type 34 NULL YES varchar 9 9 NULL NULL NULL latin1 latin1_swedish_ci varchar(9) NEVER NULL
-def mysql user Super_priv 19 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user Trigger_priv 31 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user Update_priv 6 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL
-def mysql user User 2 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) NEVER NULL
-def mysql user x509_issuer 36 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext NEVER NULL
-def mysql user x509_subject 37 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext NEVER NULL
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
+def mysql columns_priv Column_name 5 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI NEVER NULL NO NO
+def mysql columns_priv Column_priv 7 '' NO set 31 93 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('Select','Insert','Update','References') NEVER NULL NO NO
+def mysql columns_priv Db 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI NEVER NULL NO NO
+def mysql columns_priv Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI NEVER NULL NO NO
+def mysql columns_priv Table_name 4 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI NEVER NULL NO NO
+def mysql columns_priv Timestamp 6 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() NEVER NULL NO NO
+def mysql columns_priv User 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI NEVER NULL NO NO
+def mysql column_stats avg_frequency 8 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) NEVER NULL NO NO
+def mysql column_stats avg_length 7 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) NEVER NULL NO NO
+def mysql column_stats column_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI NEVER NULL NO NO
+def mysql column_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI NEVER NULL NO NO
+def mysql column_stats histogram 11 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob NEVER NULL NO NO
+def mysql column_stats hist_size 9 NULL YES tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned NEVER NULL NO NO
+def mysql column_stats hist_type 10 NULL YES enum 14 42 NULL NULL NULL utf8mb3 utf8mb3_bin enum('SINGLE_PREC_HB','DOUBLE_PREC_HB','JSON_HB') NEVER NULL NO NO
+def mysql column_stats max_value 5 NULL YES varbinary 255 255 NULL NULL NULL NULL NULL varbinary(255) NEVER NULL NO NO
+def mysql column_stats min_value 4 NULL YES varbinary 255 255 NULL NULL NULL NULL NULL varbinary(255) NEVER NULL NO NO
+def mysql column_stats nulls_ratio 6 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) NEVER NULL NO NO
+def mysql column_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI NEVER NULL NO NO
+def mysql db Alter_priv 13 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL NO NO
+def mysql db Alter_routine_priv 19 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL NO NO
+def mysql db Create_priv 8 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL NO NO
+def mysql db Create_routine_priv 18 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL NO NO
+def mysql db Create_tmp_table_priv 14 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL NO NO
+def mysql db Create_view_priv 16 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL NO NO
+def mysql db Db 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI NEVER NULL NO NO
+def mysql db Delete_history_priv 23 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL NO NO
+def mysql db Delete_priv 7 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL NO NO
+def mysql db Drop_priv 9 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL NO NO
+def mysql db Event_priv 21 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL NO NO
+def mysql db Execute_priv 20 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL NO NO
+def mysql db Grant_priv 10 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL NO NO
+def mysql db Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI NEVER NULL NO NO
+def mysql db Index_priv 12 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL NO NO
+def mysql db Insert_priv 5 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL NO NO
+def mysql db Lock_tables_priv 15 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL NO NO
+def mysql db References_priv 11 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL NO NO
+def mysql db Select_priv 4 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL NO NO
+def mysql db Show_create_routine_priv 24 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL NO NO
+def mysql db Show_view_priv 17 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL NO NO
+def mysql db Trigger_priv 22 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL NO NO
+def mysql db Update_priv 6 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL NO NO
+def mysql db User 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI NEVER NULL NO NO
+def mysql event body 3 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob NEVER NULL NO NO
+def mysql event body_utf8 22 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob NEVER NULL NO NO
+def mysql event character_set_client 19 NULL YES char 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin char(32) NEVER NULL NO NO
+def mysql event collation_connection 20 NULL YES char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) NEVER NULL NO NO
+def mysql event comment 16 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) NEVER NULL NO NO
+def mysql event created 8 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() NEVER NULL NO NO
+def mysql event db 1 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI NEVER NULL NO NO
+def mysql event db_collation 21 NULL YES char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) NEVER NULL NO NO
+def mysql event definer 4 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(384) NEVER NULL NO NO
+def mysql event ends 12 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def mysql event execute_at 5 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def mysql event interval_field 7 NULL YES enum 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') NEVER NULL NO NO
+def mysql event interval_value 6 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def mysql event last_executed 10 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def mysql event modified 9 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp NEVER NULL NO NO
+def mysql event name 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) PRI NEVER NULL NO NO
+def mysql event on_completion 14 'DROP' NO enum 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('DROP','PRESERVE') NEVER NULL NO NO
+def mysql event originator 17 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned NEVER NULL NO NO
+def mysql event sql_mode 15 '' NO set 561 1683 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT','TIME_ROUND_FRACTIONAL') NEVER NULL NO NO
+def mysql event starts 11 NULL YES datetime NULL NULL NULL NULL 0 NULL NULL datetime NEVER NULL NO NO
+def mysql event status 13 'ENABLED' NO enum 18 54 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') NEVER NULL NO NO
+def mysql event time_zone 18 'SYSTEM' NO char 64 64 NULL NULL NULL latin1 latin1_swedish_ci char(64) NEVER NULL NO NO
+def mysql func dl 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) NEVER NULL NO NO
+def mysql func name 1 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI NEVER NULL NO NO
+def mysql func ret 2 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) NEVER NULL NO NO
+def mysql func type 4 NULL NO enum 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('function','aggregate') NEVER NULL NO NO
+def mysql general_log argument 6 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8mb3 utf8mb3_general_ci mediumtext NEVER NULL NO NO
+def mysql general_log command_type 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
+def mysql general_log event_time 1 current_timestamp(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update current_timestamp(6) NEVER NULL NO NO
+def mysql general_log server_id 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned NEVER NULL NO NO
+def mysql general_log thread_id 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def mysql general_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8mb3 utf8mb3_general_ci mediumtext NEVER NULL NO NO
+def mysql global_priv Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI NEVER NULL NO NO
+def mysql global_priv Priv 3 '{}' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext NEVER NULL NO NO
+def mysql global_priv User 2 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI NEVER NULL NO NO
+def mysql gtid_slave_pos domain_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI NEVER NULL NO NO
+def mysql gtid_slave_pos seq_no 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned NEVER NULL NO NO
+def mysql gtid_slave_pos server_id 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned NEVER NULL NO NO
+def mysql gtid_slave_pos sub_id 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned PRI NEVER NULL NO NO
+def mysql help_category help_category_id 1 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned PRI NEVER NULL NO NO
+def mysql help_category name 2 NULL NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) UNI NEVER NULL NO NO
+def mysql help_category parent_category_id 3 NULL YES smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned NEVER NULL NO NO
+def mysql help_category url 4 NULL NO text 65535 65535 NULL NULL NULL utf8mb3 utf8mb3_general_ci text NEVER NULL NO NO
+def mysql help_keyword help_keyword_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI NEVER NULL NO NO
+def mysql help_keyword name 2 NULL NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) UNI NEVER NULL NO NO
+def mysql help_relation help_keyword_id 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI NEVER NULL NO NO
+def mysql help_relation help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI NEVER NULL NO NO
+def mysql help_topic description 4 NULL NO text 65535 65535 NULL NULL NULL utf8mb3 utf8mb3_general_ci text NEVER NULL NO NO
+def mysql help_topic example 5 NULL NO text 65535 65535 NULL NULL NULL utf8mb3 utf8mb3_general_ci text NEVER NULL NO NO
+def mysql help_topic help_category_id 3 NULL NO smallint NULL NULL 5 0 NULL NULL NULL smallint(5) unsigned NEVER NULL NO NO
+def mysql help_topic help_topic_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI NEVER NULL NO NO
+def mysql help_topic name 2 NULL NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) UNI NEVER NULL NO NO
+def mysql help_topic url 6 NULL NO text 65535 65535 NULL NULL NULL utf8mb3 utf8mb3_general_ci text NEVER NULL NO NO
+def mysql index_stats avg_frequency 5 NULL YES decimal NULL NULL 12 4 NULL NULL NULL decimal(12,4) NEVER NULL NO NO
+def mysql index_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI NEVER NULL NO NO
+def mysql index_stats index_name 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI NEVER NULL NO NO
+def mysql index_stats prefix_arity 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) unsigned PRI NEVER NULL NO NO
+def mysql index_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI NEVER NULL NO NO
+def mysql plugin dl 2 '' NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) NEVER NULL NO NO
+def mysql plugin name 1 '' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) PRI NEVER NULL NO NO
+def mysql proc aggregate 21 'NONE' NO enum 5 15 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('NONE','GROUP') NEVER NULL NO NO
+def mysql proc body 11 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob NEVER NULL NO NO
+def mysql proc body_utf8 20 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob NEVER NULL NO NO
+def mysql proc character_set_client 17 NULL YES char 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin char(32) NEVER NULL NO NO
+def mysql proc collation_connection 18 NULL YES char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) NEVER NULL NO NO
+def mysql proc comment 16 NULL NO text 65535 65535 NULL NULL NULL utf8mb3 utf8mb3_bin text NEVER NULL NO NO
+def mysql proc created 13 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() NEVER NULL NO NO
+def mysql proc db 1 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI NEVER NULL NO NO
+def mysql proc db_collation 19 NULL YES char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) NEVER NULL NO NO
+def mysql proc definer 12 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(384) NEVER NULL NO NO
+def mysql proc is_deterministic 7 'NO' NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') NEVER NULL NO NO
+def mysql proc language 5 'SQL' NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('SQL') NEVER NULL NO NO
+def mysql proc modified 14 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp NEVER NULL NO NO
+def mysql proc name 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) PRI NEVER NULL NO NO
+def mysql proc param_list 9 NULL NO blob 65535 65535 NULL NULL NULL NULL NULL blob NEVER NULL NO NO
+def mysql proc returns 10 NULL NO longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob NEVER NULL NO NO
+def mysql proc security_type 8 'DEFINER' NO enum 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('INVOKER','DEFINER') NEVER NULL NO NO
+def mysql proc specific_name 4 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) NEVER NULL NO NO
+def mysql proc sql_data_access 6 'CONTAINS_SQL' NO enum 17 51 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') NEVER NULL NO NO
+def mysql proc sql_mode 15 '' NO set 561 1683 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH','EMPTY_STRING_IS_NULL','SIMULTANEOUS_ASSIGNMENT','TIME_ROUND_FRACTIONAL') NEVER NULL NO NO
+def mysql proc type 3 NULL NO enum 12 36 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') PRI NEVER NULL NO NO
+def mysql procs_priv Db 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI NEVER NULL NO NO
+def mysql procs_priv Grantor 6 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(384) MUL NEVER NULL NO NO
+def mysql procs_priv Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI NEVER NULL NO NO
+def mysql procs_priv Proc_priv 7 '' NO set 47 141 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('Execute','Alter Routine','Grant','Show Create Routine') NEVER NULL NO NO
+def mysql procs_priv Routine_name 4 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) PRI NEVER NULL NO NO
+def mysql procs_priv Routine_type 5 NULL NO enum 12 36 NULL NULL NULL utf8mb3 utf8mb3_bin enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY') PRI NEVER NULL NO NO
+def mysql procs_priv Timestamp 8 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() NEVER NULL NO NO
+def mysql procs_priv User 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI NEVER NULL NO NO
+def mysql proxies_priv Grantor 6 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(384) MUL NEVER NULL NO NO
+def mysql proxies_priv Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI NEVER NULL NO NO
+def mysql proxies_priv Proxied_host 3 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI NEVER NULL NO NO
+def mysql proxies_priv Proxied_user 4 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI NEVER NULL NO NO
+def mysql proxies_priv Timestamp 7 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() NEVER NULL NO NO
+def mysql proxies_priv User 2 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI NEVER NULL NO NO
+def mysql proxies_priv With_grant 5 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(1) NEVER NULL NO NO
+def mysql roles_mapping Admin_option 4 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('N','Y') NEVER NULL NO NO
+def mysql roles_mapping Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI NEVER NULL NO NO
+def mysql roles_mapping Role 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI NEVER NULL NO NO
+def mysql roles_mapping User 2 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI NEVER NULL NO NO
+def mysql servers Db 3 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) NEVER NULL NO NO
+def mysql servers Host 2 '' NO varchar 2048 6144 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(2048) NEVER NULL NO NO
+def mysql servers Owner 9 '' NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def mysql servers Password 5 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) NEVER NULL NO NO
+def mysql servers Port 6 0 NO int NULL NULL 10 0 NULL NULL NULL int(4) NEVER NULL NO NO
+def mysql servers Server_name 1 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) PRI NEVER NULL NO NO
+def mysql servers Socket 7 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) NEVER NULL NO NO
+def mysql servers Username 4 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(128) NEVER NULL NO NO
+def mysql servers Wrapper 8 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) NEVER NULL NO NO
+def mysql slow_log db 7 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
+def mysql slow_log insert_id 9 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def mysql slow_log last_insert_id 8 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def mysql slow_log lock_time 4 NULL NO time NULL NULL NULL NULL 6 NULL NULL time(6) NEVER NULL NO NO
+def mysql slow_log query_time 3 NULL NO time NULL NULL NULL NULL 6 NULL NULL time(6) NEVER NULL NO NO
+def mysql slow_log rows_affected 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned NEVER NULL NO NO
+def mysql slow_log rows_examined 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned NEVER NULL NO NO
+def mysql slow_log rows_sent 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned NEVER NULL NO NO
+def mysql slow_log server_id 10 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned NEVER NULL NO NO
+def mysql slow_log sql_text 11 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8mb3 utf8mb3_general_ci mediumtext NEVER NULL NO NO
+def mysql slow_log start_time 1 current_timestamp(6) NO timestamp NULL NULL NULL NULL 6 NULL NULL timestamp(6) on update current_timestamp(6) NEVER NULL NO NO
+def mysql slow_log thread_id 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def mysql slow_log user_host 2 NULL NO mediumtext 16777215 16777215 NULL NULL NULL utf8mb3 utf8mb3_general_ci mediumtext NEVER NULL NO NO
+def mysql tables_priv Column_priv 8 '' NO set 31 93 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('Select','Insert','Update','References') NEVER NULL NO NO
+def mysql tables_priv Db 2 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI NEVER NULL NO NO
+def mysql tables_priv Grantor 5 '' NO varchar 384 1152 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(384) MUL NEVER NULL NO NO
+def mysql tables_priv Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) PRI NEVER NULL NO NO
+def mysql tables_priv Table_name 4 '' NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin char(64) PRI NEVER NULL NO NO
+def mysql tables_priv Table_priv 7 '' NO set 121 363 NULL NULL NULL utf8mb3 utf8mb3_general_ci set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger','Delete versioning rows') NEVER NULL NO NO
+def mysql tables_priv Timestamp 6 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() NEVER NULL NO NO
+def mysql tables_priv User 3 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) PRI NEVER NULL NO NO
+def mysql table_stats cardinality 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(21) unsigned NEVER NULL NO NO
+def mysql table_stats db_name 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI NEVER NULL NO NO
+def mysql table_stats table_name 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(64) PRI NEVER NULL NO NO
+def mysql time_zone Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI auto_increment NEVER NULL NO NO
+def mysql time_zone Use_leap_seconds 2 'N' NO enum 1 3 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('Y','N') NEVER NULL NO NO
+def mysql time_zone_leap_second Correction 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def mysql time_zone_leap_second Transition_time 1 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) PRI NEVER NULL NO NO
+def mysql time_zone_name Name 1 NULL NO char 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(64) PRI NEVER NULL NO NO
+def mysql time_zone_name Time_zone_id 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned NEVER NULL NO NO
+def mysql time_zone_transition Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI NEVER NULL NO NO
+def mysql time_zone_transition Transition_time 2 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) PRI NEVER NULL NO NO
+def mysql time_zone_transition Transition_type_id 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned NEVER NULL NO NO
+def mysql time_zone_transition_type Abbreviation 5 '' NO char 8 24 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(8) NEVER NULL NO NO
+def mysql time_zone_transition_type Is_DST 4 0 NO tinyint NULL NULL 3 0 NULL NULL NULL tinyint(3) unsigned NEVER NULL NO NO
+def mysql time_zone_transition_type Offset 3 0 NO int NULL NULL 10 0 NULL NULL NULL int(11) NEVER NULL NO NO
+def mysql time_zone_transition_type Time_zone_id 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI NEVER NULL NO NO
+def mysql time_zone_transition_type Transition_type_id 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned PRI NEVER NULL NO NO
+def mysql user Alter_priv 17 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user Alter_routine_priv 28 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user authentication_string 43 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext NEVER NULL NO NO
+def mysql user Create_priv 8 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user Create_routine_priv 27 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user Create_tablespace_priv 32 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user Create_tmp_table_priv 20 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user Create_user_priv 29 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user Create_view_priv 25 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user default_role 46 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext NEVER NULL NO NO
+def mysql user Delete_history_priv 33 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user Delete_priv 7 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user Drop_priv 9 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user Event_priv 30 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user Execute_priv 22 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user File_priv 13 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user Grant_priv 14 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user Host 1 '' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) NEVER NULL NO NO
+def mysql user Index_priv 16 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user Insert_priv 5 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user is_role 45 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user Lock_tables_priv 21 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user max_connections 40 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned NEVER NULL NO NO
+def mysql user max_questions 38 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned NEVER NULL NO NO
+def mysql user max_statement_time 47 0.000000 NO decimal NULL NULL 12 6 NULL NULL NULL decimal(12,6) NEVER NULL NO NO
+def mysql user max_updates 39 0 NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned NEVER NULL NO NO
+def mysql user max_user_connections 41 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL NO NO
+def mysql user Password 3 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext NEVER NULL NO NO
+def mysql user password_expired 44 '' NO varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user plugin 42 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext NEVER NULL NO NO
+def mysql user Process_priv 12 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user References_priv 15 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user Reload_priv 10 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user Repl_client_priv 24 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user Repl_slave_priv 23 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user Select_priv 4 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user Show_db_priv 18 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user Show_view_priv 26 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user Shutdown_priv 11 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user ssl_cipher 35 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext NEVER NULL NO NO
+def mysql user ssl_type 34 NULL YES varchar 9 9 NULL NULL NULL latin1 latin1_swedish_ci varchar(9) NEVER NULL NO NO
+def mysql user Super_priv 19 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user Trigger_priv 31 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user Update_priv 6 NULL YES varchar 1 1 NULL NULL NULL latin1 latin1_swedish_ci varchar(1) NEVER NULL NO NO
+def mysql user User 2 '' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) NEVER NULL NO NO
+def mysql user x509_issuer 36 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext NEVER NULL NO NO
+def mysql user x509_subject 37 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb4 utf8mb4_bin longtext NEVER NULL NO NO
Warnings:
Warning 1286 Unknown storage engine 'InnoDB'
Warning 1286 Unknown storage engine 'InnoDB'
@@ -367,6 +368,7 @@ NULL mysql column_stats hist_size tinyint NULL NULL NULL NULL tinyint(3) unsigne
3.0000 mysql db Event_priv enum 1 3 utf8mb3 utf8mb3_general_ci enum('N','Y')
3.0000 mysql db Trigger_priv enum 1 3 utf8mb3 utf8mb3_general_ci enum('N','Y')
3.0000 mysql db Delete_history_priv enum 1 3 utf8mb3 utf8mb3_general_ci enum('N','Y')
+3.0000 mysql db Show_create_routine_priv enum 1 3 utf8mb3 utf8mb3_general_ci enum('N','Y')
3.0000 mysql event db char 64 192 utf8mb3 utf8mb3_bin char(64)
3.0000 mysql event name char 64 192 utf8mb3 utf8mb3_general_ci char(64)
1.0000 mysql event body longblob 4294967295 4294967295 NULL NULL longblob
@@ -454,7 +456,7 @@ NULL mysql proc modified timestamp NULL NULL NULL NULL timestamp
3.0000 mysql procs_priv Routine_name char 64 192 utf8mb3 utf8mb3_general_ci char(64)
3.0000 mysql procs_priv Routine_type enum 12 36 utf8mb3 utf8mb3_bin enum('FUNCTION','PROCEDURE','PACKAGE','PACKAGE BODY')
3.0000 mysql procs_priv Grantor varchar 384 1152 utf8mb3 utf8mb3_bin varchar(384)
-3.0000 mysql procs_priv Proc_priv set 27 81 utf8mb3 utf8mb3_general_ci set('Execute','Alter Routine','Grant')
+3.0000 mysql procs_priv Proc_priv set 47 141 utf8mb3 utf8mb3_general_ci set('Execute','Alter Routine','Grant','Show Create Routine')
NULL mysql procs_priv Timestamp timestamp NULL NULL NULL NULL timestamp
3.0000 mysql proxies_priv Host char 255 765 utf8mb3 utf8mb3_bin char(255)
3.0000 mysql proxies_priv User char 128 384 utf8mb3 utf8mb3_bin char(128)
diff --git a/mysql-test/suite/funcs_1/r/is_tables.result b/mysql-test/suite/funcs_1/r/is_tables.result
index 35f7d43d..67bbb0ae 100644
--- a/mysql-test/suite/funcs_1/r/is_tables.result
+++ b/mysql-test/suite/funcs_1/r/is_tables.result
@@ -387,6 +387,8 @@ ENGINE = <other_engine_type>
AS SELECT 1;
SELECT table_name, table_type FROM information_schema.tables
WHERE table_name = 't1_my_tablex';
+table_name t1_my_tablex
+table_type TEMPORARY
DROP TEMPORARY TABLE test.t1_my_tablex;
CREATE TABLE db_datadict.t1_my_tablex
ENGINE = <engine_type> AS
diff --git a/mysql-test/suite/funcs_1/r/is_tables_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_embedded.result
index de0c2fb4..4761ed8d 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_embedded.result
@@ -395,6 +395,8 @@ ENGINE = <other_engine_type>
AS SELECT 1;
SELECT table_name, table_type FROM information_schema.tables
WHERE table_name = 't1_my_tablex';
+table_name t1_my_tablex
+table_type TEMPORARY
DROP TEMPORARY TABLE test.t1_my_tablex;
CREATE TABLE db_datadict.t1_my_tablex
ENGINE = <engine_type> AS
diff --git a/mysql-test/suite/funcs_1/r/is_tables_is.result b/mysql-test/suite/funcs_1/r/is_tables_is.result
index c18f733c..c7db64e3 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_is.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_is.result
@@ -514,6 +514,56 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME KEY_PERIOD_USAGE
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8mb3_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME OPTIMIZER_COSTS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8mb3_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME OPTIMIZER_TRACE
TABLE_TYPE SYSTEM VIEW
ENGINE MYISAM_OR_MARIA
@@ -589,6 +639,31 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME PERIODS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8mb3_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME PLUGINS
TABLE_TYPE SYSTEM VIEW
ENGINE MYISAM_OR_MARIA
@@ -1630,6 +1705,56 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME KEY_PERIOD_USAGE
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8mb3_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME OPTIMIZER_COSTS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8mb3_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME OPTIMIZER_TRACE
TABLE_TYPE SYSTEM VIEW
ENGINE MYISAM_OR_MARIA
@@ -1705,6 +1830,31 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME PERIODS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8mb3_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME PLUGINS
TABLE_TYPE SYSTEM VIEW
ENGINE MYISAM_OR_MARIA
diff --git a/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result
index c18f733c..c7db64e3 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result
@@ -514,6 +514,56 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME KEY_PERIOD_USAGE
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8mb3_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME OPTIMIZER_COSTS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8mb3_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME OPTIMIZER_TRACE
TABLE_TYPE SYSTEM VIEW
ENGINE MYISAM_OR_MARIA
@@ -589,6 +639,31 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME PERIODS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8mb3_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME PLUGINS
TABLE_TYPE SYSTEM VIEW
ENGINE MYISAM_OR_MARIA
@@ -1630,6 +1705,56 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME KEY_PERIOD_USAGE
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8mb3_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME OPTIMIZER_COSTS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8mb3_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME OPTIMIZER_TRACE
TABLE_TYPE SYSTEM VIEW
ENGINE MYISAM_OR_MARIA
@@ -1705,6 +1830,31 @@ user_comment
Separator -----------------------------------------------------
TABLE_CATALOG def
TABLE_SCHEMA information_schema
+TABLE_NAME PERIODS
+TABLE_TYPE SYSTEM VIEW
+ENGINE MEMORY
+VERSION 11
+ROW_FORMAT Fixed
+TABLE_ROWS #TBLR#
+AVG_ROW_LENGTH #ARL#
+DATA_LENGTH #DL#
+MAX_DATA_LENGTH #MDL#
+INDEX_LENGTH #IL#
+DATA_FREE #DF#
+AUTO_INCREMENT NULL
+CREATE_TIME #CRT#
+UPDATE_TIME #UT#
+CHECK_TIME #CT#
+TABLE_COLLATION utf8mb3_general_ci
+CHECKSUM NULL
+CREATE_OPTIONS #CO#
+TABLE_COMMENT #TC#
+MAX_INDEX_LENGTH #MIL#
+TEMPORARY Y
+user_comment
+Separator -----------------------------------------------------
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
TABLE_NAME PLUGINS
TABLE_TYPE SYSTEM VIEW
ENGINE MYISAM_OR_MARIA
diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql.result b/mysql-test/suite/funcs_1/r/is_tables_mysql.result
index 7cfef92c..177b7150 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_mysql.result
@@ -623,7 +623,7 @@ DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
INDEX_LENGTH #IL#
DATA_FREE #DF#
-AUTO_INCREMENT 6
+AUTO_INCREMENT 7
CREATE_TIME #CRT#
UPDATE_TIME #UT#
CHECK_TIME #CT#
diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
index 450f0f5f..9ee806bf 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
@@ -623,7 +623,7 @@ DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
INDEX_LENGTH #IL#
DATA_FREE #DF#
-AUTO_INCREMENT 6
+AUTO_INCREMENT 7
CREATE_TIME #CRT#
UPDATE_TIME #UT#
CHECK_TIME #CT#
@@ -1412,7 +1412,7 @@ DATA_LENGTH #DL#
MAX_DATA_LENGTH #MDL#
INDEX_LENGTH #IL#
DATA_FREE #DF#
-AUTO_INCREMENT 6
+AUTO_INCREMENT 7
CREATE_TIME #CRT#
UPDATE_TIME #UT#
CHECK_TIME #CT#
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_03.result b/mysql-test/suite/funcs_1/r/memory_trig_03.result
index c1c1c6f8..91ed0b69 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_03.result
@@ -78,7 +78,7 @@ grant ALL on *.* to test_noprivs@localhost;
revoke TRIGGER on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR, SHOW CREATE ROUTINE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
@@ -168,7 +168,7 @@ grant ALL on *.* to test_noprivs@localhost;
revoke UPDATE on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR, SHOW CREATE ROUTINE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
@@ -183,7 +183,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR, SHOW CREATE ROUTINE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
@@ -248,7 +248,7 @@ connection no_privs_424b;
show grants;
Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY, SHOW CREATE ROUTINE ON `priv_db`.* TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4b_1 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-1b';
@@ -441,7 +441,7 @@ grant ALL on *.* to test_noprivs@localhost;
revoke SELECT on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR, SHOW CREATE ROUTINE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
@@ -457,7 +457,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR, SHOW CREATE ROUTINE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
connection default;
@@ -503,7 +503,7 @@ revoke SELECT on priv_db.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY, SHOW CREATE ROUTINE ON `priv_db`.* TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.* to test_yesprivs@localhost;
@@ -518,7 +518,7 @@ connection no_privs_425b;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY, SHOW CREATE ROUTINE ON `priv_db`.* TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5b_1 before UPDATE on t1 for each row
set @test_var= new.f1;
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_03e.result b/mysql-test/suite/funcs_1/r/memory_trig_03e.result
index 9397e076..14963305 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_03e.result
@@ -607,7 +607,7 @@ trig 1_1-yes
revoke TRIGGER on *.* from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR, SHOW CREATE ROUTINE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
disconnect yes_privs;
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
select current_user;
@@ -660,7 +660,7 @@ root@localhost
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR, SHOW CREATE ROUTINE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
trigger privilege on db level for create:
@@ -931,7 +931,7 @@ grant TRIGGER on priv1_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, DELETE HISTORY ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, DELETE HISTORY, SHOW CREATE ROUTINE ON `priv1_db`.* TO `test_yesprivs`@`localhost`
GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
GRANT TRIGGER ON `priv1_db`.`t1` TO `test_yesprivs`@`localhost`
@@ -1354,7 +1354,7 @@ drop trigger trg1_0;
create definer=not_ex_user@localhost trigger trg1_0
before INSERT on t1 for each row
set new.f1 = 'trig 1_0-yes';
-ERROR 42000: Access denied; you need (at least one of) the SUPER, SET USER privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the SET USER privilege(s) for this operation
create definer=current_user trigger trg1_1
before INSERT on t1 for each row
set new.f1 = 'trig 1_1-yes';
@@ -1389,7 +1389,7 @@ GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`loca
create definer=not_ex_user@localhost trigger trg1_3
after UPDATE on t1 for each row
set @var1 = 'trig 1_3-yes';
-ERROR 42000: Access denied; you need (at least one of) the SUPER, SET USER privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the SET USER privilege(s) for this operation
connection default;
select current_user;
current_user
diff --git a/mysql-test/suite/funcs_1/r/memory_views.result b/mysql-test/suite/funcs_1/r/memory_views.result
index 8ce1e1c7..800c51e6 100644
--- a/mysql-test/suite/funcs_1/r/memory_views.result
+++ b/mysql-test/suite/funcs_1/r/memory_views.result
@@ -55,7 +55,7 @@ f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = memory;
Warnings:
-Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt'
into table tb2 ;
DROP DATABASE IF EXISTS test1;
@@ -116,7 +116,7 @@ f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = memory;
Warnings:
-Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/memory_tb2.txt'
into table tb2 ;
USE test;
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_03.result b/mysql-test/suite/funcs_1/r/myisam_trig_03.result
index c1c1c6f8..91ed0b69 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_03.result
@@ -78,7 +78,7 @@ grant ALL on *.* to test_noprivs@localhost;
revoke TRIGGER on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR, SHOW CREATE ROUTINE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
@@ -168,7 +168,7 @@ grant ALL on *.* to test_noprivs@localhost;
revoke UPDATE on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR, SHOW CREATE ROUTINE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
@@ -183,7 +183,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR, SHOW CREATE ROUTINE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
@@ -248,7 +248,7 @@ connection no_privs_424b;
show grants;
Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
+GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY, SHOW CREATE ROUTINE ON `priv_db`.* TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg4b_1 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-1b';
@@ -441,7 +441,7 @@ grant ALL on *.* to test_noprivs@localhost;
revoke SELECT on *.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR, SHOW CREATE ROUTINE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
@@ -457,7 +457,7 @@ test_noprivs@localhost
use priv_db;
show grants;
Grants for test_noprivs@localhost
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR, SHOW CREATE ROUTINE ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
connection default;
@@ -503,7 +503,7 @@ revoke SELECT on priv_db.* from test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY, SHOW CREATE ROUTINE ON `priv_db`.* TO `test_noprivs`@`localhost`
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
grant TRIGGER on *.* to test_yesprivs@localhost;
grant SELECT on priv_db.* to test_yesprivs@localhost;
@@ -518,7 +518,7 @@ connection no_privs_425b;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO `test_noprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY ON `priv_db`.* TO `test_noprivs`@`localhost`
+GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER, DELETE HISTORY, SHOW CREATE ROUTINE ON `priv_db`.* TO `test_noprivs`@`localhost`
use priv_db;
create trigger trg5b_1 before UPDATE on t1 for each row
set @test_var= new.f1;
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_03e.result b/mysql-test/suite/funcs_1/r/myisam_trig_03e.result
index b16beda5..68cdb58c 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_03e.result
@@ -607,7 +607,7 @@ trig 1_1-yes
revoke TRIGGER on *.* from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR, SHOW CREATE ROUTINE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
disconnect yes_privs;
connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
select current_user;
@@ -660,7 +660,7 @@ root@localhost
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, BINLOG MONITOR, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE, DELETE HISTORY, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR, SHOW CREATE ROUTINE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT TRIGGER ON `priv_db`.* TO `test_yesprivs`@`localhost`
trigger privilege on db level for create:
@@ -931,7 +931,7 @@ grant TRIGGER on priv1_db.t1 to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO `test_yesprivs`@`localhost` IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
-GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, DELETE HISTORY ON `priv1_db`.* TO `test_yesprivs`@`localhost`
+GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, DELETE HISTORY, SHOW CREATE ROUTINE ON `priv1_db`.* TO `test_yesprivs`@`localhost`
GRANT SELECT, UPDATE ON `priv2_db`.* TO `test_yesprivs`@`localhost`
GRANT TRIGGER ON `priv1_db`.`t1` TO `test_yesprivs`@`localhost`
@@ -1354,7 +1354,7 @@ drop trigger trg1_0;
create definer=not_ex_user@localhost trigger trg1_0
before INSERT on t1 for each row
set new.f1 = 'trig 1_0-yes';
-ERROR 42000: Access denied; you need (at least one of) the SUPER, SET USER privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the SET USER privilege(s) for this operation
create definer=current_user trigger trg1_1
before INSERT on t1 for each row
set new.f1 = 'trig 1_1-yes';
@@ -1389,7 +1389,7 @@ GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO `test_yesprivs`@`loca
create definer=not_ex_user@localhost trigger trg1_3
after UPDATE on t1 for each row
set @var1 = 'trig 1_3-yes';
-ERROR 42000: Access denied; you need (at least one of) the SUPER, SET USER privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the SET USER privilege(s) for this operation
connection default;
select current_user;
current_user
diff --git a/mysql-test/suite/funcs_1/r/myisam_views-big.result b/mysql-test/suite/funcs_1/r/myisam_views-big.result
index 984ae74f..e80fa2c7 100644
--- a/mysql-test/suite/funcs_1/r/myisam_views-big.result
+++ b/mysql-test/suite/funcs_1/r/myisam_views-big.result
@@ -63,7 +63,7 @@ f116 VARBINARY(64) null,
f117 VARBINARY(192) null
) engine = myisam;
Warnings:
-Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt'
into table tb2;
DROP DATABASE IF EXISTS test1;
@@ -132,7 +132,7 @@ f116 VARBINARY(64) null,
f117 VARBINARY(192) null
) engine = myisam;
Warnings:
-Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/myisam_tb2.txt'
into table tb2;
USE test;
diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
index 2bba1c06..0f8e16fb 100644
--- a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
+++ b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
@@ -38,21 +38,22 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`STAGE` tinyint(2) NOT NULL,
`MAX_STAGE` tinyint(2) NOT NULL,
`PROGRESS` decimal(7,3) NOT NULL,
- `MEMORY_USED` bigint(7) NOT NULL,
- `MAX_MEMORY_USED` bigint(7) NOT NULL,
- `EXAMINED_ROWS` int(7) NOT NULL,
- `QUERY_ID` bigint(4) NOT NULL,
+ `MEMORY_USED` bigint(10) NOT NULL,
+ `MAX_MEMORY_USED` bigint(10) NOT NULL,
+ `EXAMINED_ROWS` bigint(10) NOT NULL,
+ `SENT_ROWS` bigint(10) NOT NULL,
+ `QUERY_ID` bigint(10) NOT NULL,
`INFO_BINARY` blob,
- `TID` bigint(4) NOT NULL
+ `TID` bigint(10) NOT NULL
) DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
SHOW processlist;
Id User Host db Command Time State Info Progress
ID root HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
SELECT * FROM processlist ORDER BY id;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID root HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM processlist ORDER BY id TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID root HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM processlist ORDER BY id TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id;
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY
ID root HOST_NAME information_schema Query TIME Filling schema table SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id
@@ -118,19 +119,20 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`STAGE` tinyint(2) NOT NULL,
`MAX_STAGE` tinyint(2) NOT NULL,
`PROGRESS` decimal(7,3) NOT NULL,
- `MEMORY_USED` bigint(7) NOT NULL,
- `MAX_MEMORY_USED` bigint(7) NOT NULL,
- `EXAMINED_ROWS` int(7) NOT NULL,
- `QUERY_ID` bigint(4) NOT NULL,
+ `MEMORY_USED` bigint(10) NOT NULL,
+ `MAX_MEMORY_USED` bigint(10) NOT NULL,
+ `EXAMINED_ROWS` bigint(10) NOT NULL,
+ `SENT_ROWS` bigint(10) NOT NULL,
+ `QUERY_ID` bigint(10) NOT NULL,
`INFO_BINARY` blob,
- `TID` bigint(4) NOT NULL
+ `TID` bigint(10) NOT NULL
) DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
SELECT * FROM processlist ORDER BY id;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM processlist ORDER BY id TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM processlist ORDER BY id TID
SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id;
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id
@@ -196,8 +198,8 @@ SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
####################################################################################
4.2 New connection con101 (ddicttestuser1 with PROCESS privilege)
SHOW/SELECT shows all processes/threads.
@@ -213,10 +215,10 @@ ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
####################################################################################
5 Grant PROCESS privilege to anonymous user.
connection default (user=root)
@@ -240,11 +242,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
####################################################################################
6 Revoke PROCESS privilege from ddicttestuser1
connection default (user=root)
@@ -267,10 +269,10 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
####################################################################################
7 Revoke PROCESS privilege from anonymous user
connection default (user=root)
@@ -287,9 +289,9 @@ SHOW GRANTS FOR ''@'localhost';
Grants for @localhost
GRANT USAGE ON *.* TO ``@`localhost`
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
-ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
####################################################################################
8 Grant SUPER (does not imply PROCESS) privilege to ddicttestuser1
connection default (user=root)
@@ -312,11 +314,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
####################################################################################
9 Revoke SUPER privilege from user ddicttestuser1
connection default (user=root)
@@ -341,12 +343,12 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
####################################################################################
10 Grant SUPER privilege with grant option to user ddicttestuser1.
connection default (user=root)
@@ -403,18 +405,18 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser2 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID ddicttestuser2 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser2 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
####################################################################################
11 User ddicttestuser1 revokes PROCESS privilege from user ddicttestuser2
connection ddicttestuser1;
@@ -435,9 +437,9 @@ Id User Host db Command Time State Info Progress
ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser2 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID ddicttestuser2 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
-ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser2 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
####################################################################################
11.2 Revoke SUPER,PROCESS,GRANT OPTION privilege from user ddicttestuser1
connection default (user=root)
@@ -467,15 +469,15 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
####################################################################################
12 Revoke the SELECT privilege from user ddicttestuser1
connection default (user=root)
@@ -506,16 +508,16 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
####################################################################################
12.2 Revoke only the SELECT privilege on the information_schema from ddicttestuser1.
connection default (user=root)
diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
index 94bc1544..e41f2d49 100644
--- a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
+++ b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
@@ -38,21 +38,22 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`STAGE` tinyint(2) NOT NULL,
`MAX_STAGE` tinyint(2) NOT NULL,
`PROGRESS` decimal(7,3) NOT NULL,
- `MEMORY_USED` bigint(7) NOT NULL,
- `MAX_MEMORY_USED` bigint(7) NOT NULL,
- `EXAMINED_ROWS` int(7) NOT NULL,
- `QUERY_ID` bigint(4) NOT NULL,
+ `MEMORY_USED` bigint(10) NOT NULL,
+ `MAX_MEMORY_USED` bigint(10) NOT NULL,
+ `EXAMINED_ROWS` bigint(10) NOT NULL,
+ `SENT_ROWS` bigint(10) NOT NULL,
+ `QUERY_ID` bigint(10) NOT NULL,
`INFO_BINARY` blob,
- `TID` bigint(4) NOT NULL
+ `TID` bigint(10) NOT NULL
) DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
SHOW processlist;
Id User Host db Command Time State Info Progress
ID root HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
SELECT * FROM processlist ORDER BY id;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID root HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM processlist ORDER BY id TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID root HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM processlist ORDER BY id TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id;
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY
ID root HOST_NAME information_schema Execute TIME Filling schema table SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id
@@ -118,19 +119,20 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`STAGE` tinyint(2) NOT NULL,
`MAX_STAGE` tinyint(2) NOT NULL,
`PROGRESS` decimal(7,3) NOT NULL,
- `MEMORY_USED` bigint(7) NOT NULL,
- `MAX_MEMORY_USED` bigint(7) NOT NULL,
- `EXAMINED_ROWS` int(7) NOT NULL,
- `QUERY_ID` bigint(4) NOT NULL,
+ `MEMORY_USED` bigint(10) NOT NULL,
+ `MAX_MEMORY_USED` bigint(10) NOT NULL,
+ `EXAMINED_ROWS` bigint(10) NOT NULL,
+ `SENT_ROWS` bigint(10) NOT NULL,
+ `QUERY_ID` bigint(10) NOT NULL,
`INFO_BINARY` blob,
- `TID` bigint(4) NOT NULL
+ `TID` bigint(10) NOT NULL
) DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
SELECT * FROM processlist ORDER BY id;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM processlist ORDER BY id TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM processlist ORDER BY id TID
SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id;
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY
ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id
@@ -196,8 +198,8 @@ SHOW processlist;
Id User Host db Command Time State Info Progress
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
####################################################################################
4.2 New connection con101 (ddicttestuser1 with PROCESS privilege)
SHOW/SELECT shows all processes/threads.
@@ -213,10 +215,10 @@ ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
####################################################################################
5 Grant PROCESS privilege to anonymous user.
connection default (user=root)
@@ -240,11 +242,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
####################################################################################
6 Revoke PROCESS privilege from ddicttestuser1
connection default (user=root)
@@ -267,10 +269,10 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
####################################################################################
7 Revoke PROCESS privilege from anonymous user
connection default (user=root)
@@ -287,9 +289,9 @@ SHOW GRANTS FOR ''@'localhost';
Grants for @localhost
GRANT USAGE ON *.* TO ``@`localhost`
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
-ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
####################################################################################
8 Grant SUPER (does not imply PROCESS) privilege to ddicttestuser1
connection default (user=root)
@@ -312,11 +314,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
####################################################################################
9 Revoke SUPER privilege from user ddicttestuser1
connection default (user=root)
@@ -341,12 +343,12 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
####################################################################################
10 Grant SUPER privilege with grant option to user ddicttestuser1.
connection default (user=root)
@@ -403,18 +405,18 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser2 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID ddicttestuser2 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser2 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
####################################################################################
11 User ddicttestuser1 revokes PROCESS privilege from user ddicttestuser2
connection ddicttestuser1;
@@ -435,9 +437,9 @@ Id User Host db Command Time State Info Progress
ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser2 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID ddicttestuser2 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
-ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser2 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
####################################################################################
11.2 Revoke SUPER,PROCESS,GRANT OPTION privilege from user ddicttestuser1
connection default (user=root)
@@ -467,15 +469,15 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
####################################################################################
12 Revoke the SELECT privilege from user ddicttestuser1
connection default (user=root)
@@ -506,16 +508,16 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
SELECT * FROM information_schema.processlist;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
-ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY ROWS QUERY_ID NULL TID
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
+ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
####################################################################################
12.2 Revoke only the SELECT privilege on the information_schema from ddicttestuser1.
connection default (user=root)
diff --git a/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
index dba8de65..632b908a 100644
--- a/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
+++ b/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
@@ -24,19 +24,20 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`STAGE` tinyint(2) NOT NULL,
`MAX_STAGE` tinyint(2) NOT NULL,
`PROGRESS` decimal(7,3) NOT NULL,
- `MEMORY_USED` bigint(7) NOT NULL,
- `MAX_MEMORY_USED` bigint(7) NOT NULL,
- `EXAMINED_ROWS` int(7) NOT NULL,
- `QUERY_ID` bigint(4) NOT NULL,
+ `MEMORY_USED` bigint(10) NOT NULL,
+ `MAX_MEMORY_USED` bigint(10) NOT NULL,
+ `EXAMINED_ROWS` bigint(10) NOT NULL,
+ `SENT_ROWS` bigint(10) NOT NULL,
+ `QUERY_ID` bigint(10) NOT NULL,
`INFO_BINARY` blob,
- `TID` bigint(4) NOT NULL
+ `TID` bigint(10) NOT NULL
) DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
# Ensure that the information about the own connection is correct.
#--------------------------------------------------------------------------
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-<ID> root <HOST_NAME> test Query <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+<ID> root <HOST_NAME> test Query <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> test Query <TIME> starting SHOW FULL PROCESSLIST <TIME_MS>
@@ -80,9 +81,9 @@ connection default;
# Poll till the connection con1 is in state COMMAND = 'Sleep'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> <STATE> NULL <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> NULL <TID>
-<ID> root <HOST_NAME> information_schema Query <TIME> <STATE> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> <STATE> NULL <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> NULL <TID>
+<ID> root <HOST_NAME> information_schema Query <TIME> <STATE> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> information_schema Query <TIME> starting SHOW FULL PROCESSLIST 0.000
@@ -113,8 +114,8 @@ Expect 1
connection con1;
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-<ID> test_user <HOST_NAME> information_schema Query <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema Query <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> test_user <HOST_NAME> information_schema Query <TIME> starting SHOW FULL PROCESSLIST 0.000
@@ -127,9 +128,9 @@ connection default;
connection con2;
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-<ID> test_user <HOST_NAME> information_schema Query <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> NULL <TID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema Query <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> NULL <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL 0.000
@@ -150,10 +151,10 @@ connection default;
# Poll till connection con2 is in state 'User sleep'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-<ID> test_user <HOST_NAME> information_schema Query <TIME> User sleep SELECT sleep(10), 17 <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> SELECT sleep(10), 17 <TID>
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> NULL <TID>
-<ID> root <HOST_NAME> information_schema Query <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema Query <TIME> User sleep SELECT sleep(10), 17 <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> SELECT sleep(10), 17 <TID>
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> NULL <TID>
+<ID> root <HOST_NAME> information_schema Query <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> information_schema Query <TIME> starting SHOW FULL PROCESSLIST 0.000
@@ -193,10 +194,10 @@ connection default;
# Poll till INFO is no more NULL and State = 'Waiting for table metadata lock'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-<ID> test_user <HOST_NAME> information_schema Query <TIME> Waiting for table metadata lock SELECT COUNT(*) FROM test.t1 <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> SELECT COUNT(*) FROM test.t1 <TID>
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> NULL <TID>
-<ID> root <HOST_NAME> information_schema Query <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema Query <TIME> Waiting for table metadata lock SELECT COUNT(*) FROM test.t1 <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> SELECT COUNT(*) FROM test.t1 <TID>
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> NULL <TID>
+<ID> root <HOST_NAME> information_schema Query <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
UNLOCK TABLES;
connection con2;
# Pull("reap") the result set from the statement executed with "send".
@@ -223,10 +224,10 @@ connection default;
# SHOW PROCESSLIST statement truncated after 100 char
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END' AS "Long string" FROM test.t1 <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END' AS "Long string" FROM test.t1 <TID>
-<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> NULL <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> NULL <TID>
-<ID> root <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END' AS "Long string" FROM test.t1 <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END' AS "Long string" FROM test.t1 <TID>
+<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> NULL <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> NULL <TID>
+<ID> root <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SHOW FULL PROCESSLIST 0.000
diff --git a/mysql-test/suite/funcs_1/r/processlist_val_ps.result b/mysql-test/suite/funcs_1/r/processlist_val_ps.result
index 0806f00f..b9b89132 100644
--- a/mysql-test/suite/funcs_1/r/processlist_val_ps.result
+++ b/mysql-test/suite/funcs_1/r/processlist_val_ps.result
@@ -24,19 +24,20 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
`STAGE` tinyint(2) NOT NULL,
`MAX_STAGE` tinyint(2) NOT NULL,
`PROGRESS` decimal(7,3) NOT NULL,
- `MEMORY_USED` bigint(7) NOT NULL,
- `MAX_MEMORY_USED` bigint(7) NOT NULL,
- `EXAMINED_ROWS` int(7) NOT NULL,
- `QUERY_ID` bigint(4) NOT NULL,
+ `MEMORY_USED` bigint(10) NOT NULL,
+ `MAX_MEMORY_USED` bigint(10) NOT NULL,
+ `EXAMINED_ROWS` bigint(10) NOT NULL,
+ `SENT_ROWS` bigint(10) NOT NULL,
+ `QUERY_ID` bigint(10) NOT NULL,
`INFO_BINARY` blob,
- `TID` bigint(4) NOT NULL
+ `TID` bigint(10) NOT NULL
) DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
# Ensure that the information about the own connection is correct.
#--------------------------------------------------------------------------
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-<ID> root <HOST_NAME> test Execute <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+<ID> root <HOST_NAME> test Execute <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> test Query <TIME> starting SHOW FULL PROCESSLIST <TIME_MS>
@@ -80,9 +81,9 @@ connection default;
# Poll till the connection con1 is in state COMMAND = 'Sleep'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> <STATE> NULL <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> NULL <TID>
-<ID> root <HOST_NAME> information_schema Execute <TIME> <STATE> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> <STATE> NULL <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> NULL <TID>
+<ID> root <HOST_NAME> information_schema Execute <TIME> <STATE> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> information_schema Query <TIME> starting SHOW FULL PROCESSLIST 0.000
@@ -113,8 +114,8 @@ Expect 1
connection con1;
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-<ID> test_user <HOST_NAME> information_schema Execute <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema Execute <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> test_user <HOST_NAME> information_schema Query <TIME> starting SHOW FULL PROCESSLIST 0.000
@@ -127,9 +128,9 @@ connection default;
connection con2;
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-<ID> test_user <HOST_NAME> information_schema Execute <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> NULL <TID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema Execute <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> NULL <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL 0.000
@@ -150,10 +151,10 @@ connection default;
# Poll till connection con2 is in state 'User sleep'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-<ID> test_user <HOST_NAME> information_schema Query <TIME> User sleep SELECT sleep(10), 17 <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> SELECT sleep(10), 17 <TID>
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> NULL <TID>
-<ID> root <HOST_NAME> information_schema Execute <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema Query <TIME> User sleep SELECT sleep(10), 17 <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> SELECT sleep(10), 17 <TID>
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> NULL <TID>
+<ID> root <HOST_NAME> information_schema Execute <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> information_schema Query <TIME> starting SHOW FULL PROCESSLIST 0.000
@@ -193,10 +194,10 @@ connection default;
# Poll till INFO is no more NULL and State = 'Waiting for table metadata lock'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-<ID> test_user <HOST_NAME> information_schema Query <TIME> Waiting for table metadata lock SELECT COUNT(*) FROM test.t1 <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> SELECT COUNT(*) FROM test.t1 <TID>
-<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> NULL <TID>
-<ID> root <HOST_NAME> information_schema Execute <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema Query <TIME> Waiting for table metadata lock SELECT COUNT(*) FROM test.t1 <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> SELECT COUNT(*) FROM test.t1 <TID>
+<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> NULL <TID>
+<ID> root <HOST_NAME> information_schema Execute <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
UNLOCK TABLES;
connection con2;
# Pull("reap") the result set from the statement executed with "send".
@@ -223,10 +224,10 @@ connection default;
# SHOW PROCESSLIST statement truncated after 100 char
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
-ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
-<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END' AS "Long string" FROM test.t1 <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END' AS "Long string" FROM test.t1 <TID>
-<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> NULL <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> NULL <TID>
-<ID> root <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
+ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
+<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END' AS "Long string" FROM test.t1 <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END' AS "Long string" FROM test.t1 <TID>
+<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> NULL <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> NULL <TID>
+<ID> root <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <MAX_MEMORY> <E_ROWS> <S_ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> root <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SHOW FULL PROCESSLIST 0.000
diff --git a/mysql-test/suite/funcs_1/r/storedproc.result b/mysql-test/suite/funcs_1/r/storedproc.result
index 39be8c82..c043ea3f 100644
--- a/mysql-test/suite/funcs_1/r/storedproc.result
+++ b/mysql-test/suite/funcs_1/r/storedproc.result
@@ -7526,12 +7526,12 @@ declare x, y, z year(3) default 2005;
SELECT x, y, z;
END//
Warnings:
-Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
CALL sp1();
x y z
2005 2005 2005
Warnings:
-Note 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(3)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
diff --git a/mysql-test/suite/funcs_1/t/is_collations.test b/mysql-test/suite/funcs_1/t/is_collations.test
index db34a7b7..aa199b51 100644
--- a/mysql-test/suite/funcs_1/t/is_collations.test
+++ b/mysql-test/suite/funcs_1/t/is_collations.test
@@ -83,7 +83,7 @@ INSERT INTO information_schema.collations
VALUES ( 'cp1251_bin', 'cp1251',50, '', '',0);
--error ER_DBACCESS_DENIED_ERROR,ER_NON_UPDATABLE_TABLE
-UPDATE information_schema.collations SET description = 'just updated';
+UPDATE information_schema.collations SET collation_name = 'just updated';
--error ER_DBACCESS_DENIED_ERROR
DELETE FROM information_schema.collations WHERE table_name = 't1';
diff --git a/mysql-test/suite/galera/galera_2nodes.cnf b/mysql-test/suite/galera/galera_2nodes.cnf
index 3532c1f2..eefb9452 100644
--- a/mysql-test/suite/galera/galera_2nodes.cnf
+++ b/mysql-test/suite/galera/galera_2nodes.cnf
@@ -1,5 +1,5 @@
# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
+!include include/default_my.cnf
[mysqld]
loose-innodb
diff --git a/mysql-test/suite/galera/galera_2nodes_as_master.cnf b/mysql-test/suite/galera/galera_2nodes_as_master.cnf
index ba53d606..28970d05 100644
--- a/mysql-test/suite/galera/galera_2nodes_as_master.cnf
+++ b/mysql-test/suite/galera/galera_2nodes_as_master.cnf
@@ -4,7 +4,7 @@
#
# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
+!include include/default_my.cnf
[mysqld]
loose-innodb
diff --git a/mysql-test/suite/galera/galera_2nodes_as_slave.cnf b/mysql-test/suite/galera/galera_2nodes_as_slave.cnf
index f25c7cc6..dbf1544d 100644
--- a/mysql-test/suite/galera/galera_2nodes_as_slave.cnf
+++ b/mysql-test/suite/galera/galera_2nodes_as_slave.cnf
@@ -3,7 +3,7 @@
#
# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
+!include include/default_my.cnf
[mysqld]
loose-innodb
diff --git a/mysql-test/suite/galera/galera_2x2nodes.cnf b/mysql-test/suite/galera/galera_2x2nodes.cnf
index 922906ea..0311ff09 100644
--- a/mysql-test/suite/galera/galera_2x2nodes.cnf
+++ b/mysql-test/suite/galera/galera_2x2nodes.cnf
@@ -1,5 +1,5 @@
# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
+!include include/default_my.cnf
[mysqld]
loose-innodb
diff --git a/mysql-test/suite/galera/galera_3nodes_as_slave.cnf b/mysql-test/suite/galera/galera_3nodes_as_slave.cnf
index 0ecf877b..79b49886 100644
--- a/mysql-test/suite/galera/galera_3nodes_as_slave.cnf
+++ b/mysql-test/suite/galera/galera_3nodes_as_slave.cnf
@@ -3,7 +3,7 @@
#
# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
+!include include/default_my.cnf
[mysqld]
loose-innodb
diff --git a/mysql-test/suite/galera/galera_4nodes.cnf b/mysql-test/suite/galera/galera_4nodes.cnf
index 3ad1a66b..e39f206a 100644
--- a/mysql-test/suite/galera/galera_4nodes.cnf
+++ b/mysql-test/suite/galera/galera_4nodes.cnf
@@ -1,5 +1,5 @@
# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
+!include include/default_my.cnf
[mysqld]
loose-innodb
diff --git a/mysql-test/suite/galera/r/MDEV-29142.result b/mysql-test/suite/galera/r/MDEV-29142.result
index 2528520e..2e567666 100644
--- a/mysql-test/suite/galera/r/MDEV-29142.result
+++ b/mysql-test/suite/galera/r/MDEV-29142.result
@@ -11,7 +11,7 @@ call mtr.add_suppression("WSREP: Failed to open table mysql.wsrep_streaming_log
call mtr.add_suppression("WSREP: Failed to open SR table for write");
call mtr.add_suppression("WSREP: Failed to recover SR transactions from schema: wsrep_on : 0");
call mtr.add_suppression("WSREP: Inconsistency detected: Inconsistent by consensus on.*");
-SET @@global.tx_read_only = ON;
+SET @@global.transaction_read_only = ON;
SET default_storage_engine = SEQUENCE;
create table t1 (c1 int);
ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by the engine")
diff --git a/mysql-test/suite/galera/r/galera_defaults.result b/mysql-test/suite/galera/r/galera_defaults.result
index 84dd7829..59dd4703 100644
--- a/mysql-test/suite/galera/r/galera_defaults.result
+++ b/mysql-test/suite/galera/r/galera_defaults.result
@@ -19,7 +19,6 @@ ORDER BY VARIABLE_NAME;
VARIABLE_NAME VARIABLE_VALUE
WSREP_ALLOWLIST
WSREP_AUTO_INCREMENT_CONTROL ON
-WSREP_CAUSAL_READS ON
WSREP_CERTIFICATION_RULES strict
WSREP_CERTIFY_NONPK ON
WSREP_CLUSTER_ADDRESS gcomm://
diff --git a/mysql-test/suite/galera/r/galera_event_node_evict.result b/mysql-test/suite/galera/r/galera_event_node_evict.result
new file mode 100644
index 00000000..62911fac
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_event_node_evict.result
@@ -0,0 +1,21 @@
+connection node_2;
+connection node_1;
+# Correct Galera library found
+connection node_1;
+CALL mtr.add_suppression("\\[Warning\\] WSREP: evicting member .* at .* permanently from group");
+connection node_2;
+CALL mtr.add_suppression("\\[Warning\\] WSREP: handshake with .* .* failed: 'evicted'");
+CALL mtr.add_suppression("\\[ERROR\\] WSREP: exception from gcomm, backend must be restarted: this node has been evicted out of the cluster, gcomm backend restart is required \\(FATAL\\)");
+connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
+CALL mtr.add_suppression("\\[Warning\\] WSREP: evicting member .* at .* permanently from group");
+connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4;
+CALL mtr.add_suppression("\\[Warning\\] WSREP: evicting member .* at .* permanently from group");
+connection node_1;
+connection node_2;
+connection node_3;
+connection node_4;
+connection node_2;
+SET SESSION wsrep_on = ON;
+SET SESSION wsrep_sync_wait = 15;
+SET GLOBAL wsrep_on = OFF;
+include/assert_grep.inc [Node evicted]
diff --git a/mysql-test/suite/galera/r/galera_gtid_server_id.result b/mysql-test/suite/galera/r/galera_gtid_server_id.result
index 8765fcc1..2dbe67b8 100644
--- a/mysql-test/suite/galera/r/galera_gtid_server_id.result
+++ b/mysql-test/suite/galera/r/galera_gtid_server_id.result
@@ -14,6 +14,9 @@ CREATE TABLE t1(id int not null primary key) engine=innodb;
INSERT INTO t1 values (1);
show global variables like '%gtid%';
Variable_name Value
+binlog_gtid_index ON
+binlog_gtid_index_page_size 4096
+binlog_gtid_index_span_min 65536
gtid_binlog_pos 1-11-2
gtid_binlog_state 1-11-2
gtid_cleanup_batch_size 64
@@ -29,6 +32,9 @@ connection node_2;
SET SESSION wsrep_sync_wait=15;
show global variables like '%gtid%';
Variable_name Value
+binlog_gtid_index ON
+binlog_gtid_index_page_size 4096
+binlog_gtid_index_span_min 65536
gtid_binlog_pos 0-12-1,1-11-2
gtid_binlog_state 0-12-1,1-11-2
gtid_cleanup_batch_size 64
@@ -55,6 +61,9 @@ Error 1231 Variable 'server_id' can't be set to the value of '200'
INSERT INTO t1 values(2);
show global variables like '%gtid%';
Variable_name Value
+binlog_gtid_index ON
+binlog_gtid_index_page_size 4096
+binlog_gtid_index_span_min 65536
gtid_binlog_pos 0-12-1,1-11-3
gtid_binlog_state 0-12-1,1-11-3
gtid_cleanup_batch_size 64
@@ -69,6 +78,9 @@ wsrep_gtid_mode ON
connection node_1;
show global variables like '%gtid%';
Variable_name Value
+binlog_gtid_index ON
+binlog_gtid_index_page_size 4096
+binlog_gtid_index_span_min 65536
gtid_binlog_pos 1-11-3
gtid_binlog_state 1-11-3
gtid_cleanup_batch_size 64
diff --git a/mysql-test/suite/galera/r/galera_ist_MDEV-28423,debug.rdiff b/mysql-test/suite/galera/r/galera_ist_MDEV-28423,debug.rdiff
index 4eda9d7d..32c3949b 100644
--- a/mysql-test/suite/galera/r/galera_ist_MDEV-28423,debug.rdiff
+++ b/mysql-test/suite/galera/r/galera_ist_MDEV-28423,debug.rdiff
@@ -1,5 +1,5 @@
---- suite/galera/r/galera_ist_MDEV-28423.result 2022-06-13 09:40:33.073863796 +0300
-+++ suite/galera/r/galera_ist_MDEV-28423.reject 2022-06-13 09:58:59.936874991 +0300
+--- suite/galera/r/galera_ist_MDEV-28423.result
++++ suite/galera/r/galera_ist_MDEV-28423.reject
@@ -517,3 +517,187 @@
1
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_ist_MDEV-28583,debug.rdiff b/mysql-test/suite/galera/r/galera_ist_MDEV-28583,debug.rdiff
index 1c339163..c1bc37fb 100644
--- a/mysql-test/suite/galera/r/galera_ist_MDEV-28583,debug.rdiff
+++ b/mysql-test/suite/galera/r/galera_ist_MDEV-28583,debug.rdiff
@@ -1,5 +1,5 @@
---- suite/galera/r/galera_ist_MDEV-28583.result 2022-06-11 10:48:16.875034382 +0300
-+++ suite/galera/r/galera_ist_MDEV-28583,debug.reject 2022-06-11 11:25:55.616481509 +0300
+--- suite/galera/r/galera_ist_MDEV-28583.result
++++ suite/galera/r/galera_ist_MDEV-28583,debug.reject
@@ -517,3 +517,187 @@
1
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_ist_mariabackup,debug.rdiff b/mysql-test/suite/galera/r/galera_ist_mariabackup,debug.rdiff
index adf12c23..243b2a50 100644
--- a/mysql-test/suite/galera/r/galera_ist_mariabackup,debug.rdiff
+++ b/mysql-test/suite/galera/r/galera_ist_mariabackup,debug.rdiff
@@ -1,5 +1,5 @@
---- r/galera_ist_mariabackup.result 2021-04-10 14:21:16.141724901 +0300
-+++ r/galera_ist_mariabackup,debug.reject 2021-04-10 14:49:04.455785652 +0300
+--- r/galera_ist_mariabackup.result
++++ r/galera_ist_mariabackup,debug.reject
@@ -517,3 +517,187 @@
1
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs,debug.rdiff b/mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs,debug.rdiff
index c9457d70..b7a91b01 100644
--- a/mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs,debug.rdiff
+++ b/mysql-test/suite/galera/r/galera_ist_mariabackup_innodb_flush_logs,debug.rdiff
@@ -1,5 +1,5 @@
---- r/galera_ist_mariabackup_innodb_flush_logs.result 2021-04-10 14:21:52.661886653 +0300
-+++ r/galera_ist_mariabackup_innodb_flush_logs,debug.reject 2021-04-10 14:49:56.740062774 +0300
+--- r/galera_ist_mariabackup_innodb_flush_logs.result
++++ r/galera_ist_mariabackup_innodb_flush_logs,debug.reject
@@ -172,3 +172,187 @@
1
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_ist_rsync,debug.rdiff b/mysql-test/suite/galera/r/galera_ist_rsync,debug.rdiff
index e76b3783..f3df998b 100644
--- a/mysql-test/suite/galera/r/galera_ist_rsync,debug.rdiff
+++ b/mysql-test/suite/galera/r/galera_ist_rsync,debug.rdiff
@@ -1,5 +1,5 @@
---- r/galera_ist_rsync.result 2021-04-10 14:24:05.942467091 +0300
-+++ r/galera_ist_rsync,debug.reject 2021-04-10 14:52:14.236776538 +0300
+--- r/galera_ist_rsync.result
++++ r/galera_ist_rsync,debug.reject
@@ -517,3 +517,187 @@
1
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_many_indexes.result b/mysql-test/suite/galera/r/galera_many_indexes.result
index 963d3552..c0eabffd 100644
--- a/mysql-test/suite/galera/r/galera_many_indexes.result
+++ b/mysql-test/suite/galera/r/galera_many_indexes.result
@@ -74,7 +74,7 @@ LENGTH(f1) = 767
1
EXPLAIN SELECT COUNT(*) = 1 FROM t1 FORCE KEY (PRIMARY) WHERE f1 = REPEAT('a', 767);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 const PRIMARY PRIMARY 769 const 1 Using index
+1 SIMPLE t1 const PRIMARY PRIMARY 769 const 1
SELECT COUNT(*) = 1 FROM t1 FORCE KEY (PRIMARY) WHERE f1 = REPEAT('a', 767);
COUNT(*) = 1
1
diff --git a/mysql-test/suite/galera/r/galera_query_cache_invalidate.result b/mysql-test/suite/galera/r/galera_query_cache_invalidate.result
index fc23c0f1..24c6c388 100644
--- a/mysql-test/suite/galera/r/galera_query_cache_invalidate.result
+++ b/mysql-test/suite/galera/r/galera_query_cache_invalidate.result
@@ -7,7 +7,7 @@ call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node.");
connection node_4;
call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node.");
connection node_3;
-CHANGE MASTER TO master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_1, master_use_gtid=current_pos;;
+CHANGE MASTER TO master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_1, master_ssl_verify_server_cert=0, master_use_gtid=current_pos;
START SLAVE;
include/wait_for_slave_to_start.inc
connection node_1;
diff --git a/mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir,debug.rdiff
index 870b12de..875d53ad 100644
--- a/mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir,debug.rdiff
+++ b/mysql-test/suite/galera/r/galera_sst_mariabackup_data_dir,debug.rdiff
@@ -1,5 +1,5 @@
---- r/galera_sst_mariabackup_data_dir.result 2021-04-10 14:26:02.798965488 +0300
-+++ r/galera_sst_mariabackup_data_dir,debug.reject 2021-04-10 14:54:44.825538224 +0300
+--- r/galera_sst_mariabackup_data_dir.result
++++ r/galera_sst_mariabackup_data_dir,debug.reject
@@ -516,5 +516,189 @@
1
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_sst_mariabackup_force_recovery,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_mariabackup_force_recovery,debug.rdiff
index bad8355b..da294317 100644
--- a/mysql-test/suite/galera/r/galera_sst_mariabackup_force_recovery,debug.rdiff
+++ b/mysql-test/suite/galera/r/galera_sst_mariabackup_force_recovery,debug.rdiff
@@ -1,5 +1,5 @@
---- r/galera_sst_mariabackup.result 2021-04-10 14:25:04.142716409 +0300
-+++ r/galera_sst_mariabackup,debug.reject 2021-04-10 14:53:30.033162191 +0300
+--- r/galera_sst_mariabackup.result
++++ r/galera_sst_mariabackup,debug.reject
@@ -516,5 +516,189 @@
1
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff
index 14f67770..ae242e2b 100644
--- a/mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff
+++ b/mysql-test/suite/galera/r/galera_sst_rsync2,debug.rdiff
@@ -1,5 +1,5 @@
---- r/galera_sst_rsync2.result 2021-04-10 14:34:48.646288119 +0300
-+++ r/galera_sst_rsync2,debug.reject 2021-04-10 15:04:10.276286996 +0300
+--- r/galera_sst_rsync2.result
++++ r/galera_sst_rsync2,debug.reject
@@ -516,3 +516,187 @@
1
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_sst_rsync_data_dir,debug.rdiff b/mysql-test/suite/galera/r/galera_sst_rsync_data_dir,debug.rdiff
index 00b42d53..558a8e7c 100644
--- a/mysql-test/suite/galera/r/galera_sst_rsync_data_dir,debug.rdiff
+++ b/mysql-test/suite/galera/r/galera_sst_rsync_data_dir,debug.rdiff
@@ -1,5 +1,5 @@
---- r/galera_sst_rsync_data_dir.result 2021-04-10 14:35:28.090610315 +0300
-+++ r/galera_sst_rsync_data_dir,debug.reject 2021-04-10 15:50:26.945234998 +0300
+--- r/galera_sst_rsync_data_dir.result
++++ r/galera_sst_rsync_data_dir,debug.reject
@@ -516,3 +516,187 @@
1
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_var_sync_wait.result b/mysql-test/suite/galera/r/galera_var_sync_wait.result
index 80fbd3f3..d3d8f3ef 100644
--- a/mysql-test/suite/galera/r/galera_var_sync_wait.result
+++ b/mysql-test/suite/galera/r/galera_var_sync_wait.result
@@ -6,9 +6,6 @@ connection node_1;
SELECT @@global.wsrep_sync_wait;
@@global.wsrep_sync_wait
15
-SELECT @@global.wsrep_causal_reads;
-@@global.wsrep_causal_reads
-1
connection node_1;
CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB;
connection node_2;
diff --git a/mysql-test/suite/galera/r/rpl_galera_to_mariadb_clone_slave_using_mariadb-backup.result b/mysql-test/suite/galera/r/rpl_galera_to_mariadb_clone_slave_using_mariadb-backup.result
index 76c13fa7..71c84d01 100644
--- a/mysql-test/suite/galera/r/rpl_galera_to_mariadb_clone_slave_using_mariadb-backup.result
+++ b/mysql-test/suite/galera/r/rpl_galera_to_mariadb_clone_slave_using_mariadb-backup.result
@@ -45,13 +45,13 @@ connection master;
connection slave;
##############################################################
### Running `mariadb-backup --backup,--prepare` and checking
-### that xtrabackup_slave_info and xtrabackup_binlog_info are OK
+### that mariadb_backup_slave_info and mariadb_backup_binlog_info are OK
### Slave: Create a backup
### Slave: Prepare the backup
### Slave: xtrabackup files:
-############################ xtrabackup_slave_info
+############################ mariadb_backup_slave_info
CHANGE MASTER TO MASTER_LOG_FILE='master_after_tr01_show_master_status_file', MASTER_LOG_POS=master_after_tr01_show_master_status_position;
-############################ xtrabackup_binlog_info
+############################ mariadb_backup_binlog_info
slave_after_tr01_show_master_status_file slave_after_tr01_show_master_status_position slave_after_tr01_gtid_binlog_pos
############################
##############################################################
@@ -136,8 +136,8 @@ tr#01:stmt#00 - slave run#0, before backup
tr#01:stmt#01 - slave run#0, before backup
tr#01:stmt#02 - slave run#0, before backup
### Slave: Execute the CHANGE MASTER statement to set up the host and port
-CHANGE MASTER '' TO MASTER_USER='root', MASTER_HOST='127.0.0.1', MASTER_PORT=###, MASTER_CONNECT_RETRY=1;
-### Slave: Execute the CHANGE MASTER statement from xtrabackup_slave_info
+CHANGE MASTER '' TO MASTER_USER='root', MASTER_HOST='127.0.0.1', MASTER_PORT=###, MASTER_CONNECT_RETRY=1, MASTER_SSL_VERIFY_SERVER_CERT=0;
+### Slave: Execute the CHANGE MASTER statement from mariadb_backup_slave_info
CHANGE MASTER TO MASTER_LOG_FILE='master_after_tr01_show_master_status_file', MASTER_LOG_POS=master_after_tr01_show_master_status_position;
Warnings:
Note 4190 CHANGE MASTER TO is implicitly changing the value of 'Using_Gtid' from 'Slave_Pos' to 'No'
diff --git a/mysql-test/suite/galera/t/MDEV-28053.test b/mysql-test/suite/galera/t/MDEV-28053.test
index 85cb20c7..6a05682b 100644
--- a/mysql-test/suite/galera/t/MDEV-28053.test
+++ b/mysql-test/suite/galera/t/MDEV-28053.test
@@ -37,7 +37,7 @@ while ($counter) {
--connection node_2
--disable_query_log
--disable_result_log
---eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_3;
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0, MASTER_PORT=$NODE_MYPORT_3;
START SLAVE;
--eval SELECT MASTER_GTID_WAIT('$gtid', 600)
--enable_result_log
diff --git a/mysql-test/suite/galera/t/MDEV-29142.test b/mysql-test/suite/galera/t/MDEV-29142.test
index f7a8b329..c41302f9 100644
--- a/mysql-test/suite/galera/t/MDEV-29142.test
+++ b/mysql-test/suite/galera/t/MDEV-29142.test
@@ -18,7 +18,7 @@ call mtr.add_suppression("WSREP: Failed to open SR table for write");
call mtr.add_suppression("WSREP: Failed to recover SR transactions from schema: wsrep_on : 0");
call mtr.add_suppression("WSREP: Inconsistency detected: Inconsistent by consensus on.*");
-SET @@global.tx_read_only = ON;
+SET @@global.transaction_read_only = ON;
--error 0,1286
SET default_storage_engine = SEQUENCE;
--error 1005
diff --git a/mysql-test/suite/galera/t/MDEV-6860.test b/mysql-test/suite/galera/t/MDEV-6860.test
index 3a8c98f3..f92bf595 100644
--- a/mysql-test/suite/galera/t/MDEV-6860.test
+++ b/mysql-test/suite/galera/t/MDEV-6860.test
@@ -4,7 +4,7 @@
--connection node_2
--disable_query_log
---eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_3, MASTER_USE_GTID=slave_pos;
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_3, MASTER_SSL_VERIFY_SERVER_CERT=0, MASTER_USE_GTID=slave_pos;
--enable_query_log
START SLAVE;
diff --git a/mysql-test/suite/galera/t/MW-284.test b/mysql-test/suite/galera/t/MW-284.test
index d7da1dcd..52ef41b2 100644
--- a/mysql-test/suite/galera/t/MW-284.test
+++ b/mysql-test/suite/galera/t/MW-284.test
@@ -10,7 +10,7 @@ call mtr.add_suppression("\\[ERROR\\] Error reading packet from server: WSREP ha
call mtr.add_suppression("WSREP has not yet prepared node for application use");
--disable_query_log
---eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1, MASTER_USER='root', MASTER_CONNECT_RETRY=1;
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1, MASTER_USER='root', MASTER_CONNECT_RETRY=1, MASTER_SSL_VERIFY_SERVER_CERT=0;
--enable_query_log
--connection node_1
diff --git a/mysql-test/suite/galera/t/galera_as_master.test b/mysql-test/suite/galera/t/galera_as_master.test
index a5554a73..26fbd004 100644
--- a/mysql-test/suite/galera/t/galera_as_master.test
+++ b/mysql-test/suite/galera/t/galera_as_master.test
@@ -9,7 +9,7 @@
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--disable_query_log
---eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_1;
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0, MASTER_PORT=$NODE_MYPORT_1;
--enable_query_log
START SLAVE;
diff --git a/mysql-test/suite/galera/t/galera_as_master_large.test b/mysql-test/suite/galera/t/galera_as_master_large.test
index fa343cd9..cac5b12d 100644
--- a/mysql-test/suite/galera/t/galera_as_master_large.test
+++ b/mysql-test/suite/galera/t/galera_as_master_large.test
@@ -8,7 +8,7 @@
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--disable_query_log
---eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_1;
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0, MASTER_PORT=$NODE_MYPORT_1;
--enable_query_log
START SLAVE;
diff --git a/mysql-test/suite/galera/t/galera_as_slave.test b/mysql-test/suite/galera/t/galera_as_slave.test
index 859fe19c..581e050b 100644
--- a/mysql-test/suite/galera/t/galera_as_slave.test
+++ b/mysql-test/suite/galera/t/galera_as_slave.test
@@ -13,7 +13,7 @@
--connection node_2
--disable_query_log
---eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_3;
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0, MASTER_PORT=$NODE_MYPORT_3;
--enable_query_log
START SLAVE;
diff --git a/mysql-test/suite/galera/t/galera_as_slave_autoinc.test b/mysql-test/suite/galera/t/galera_as_slave_autoinc.test
index ce4c87e2..733875a1 100644
--- a/mysql-test/suite/galera/t/galera_as_slave_autoinc.test
+++ b/mysql-test/suite/galera/t/galera_as_slave_autoinc.test
@@ -13,7 +13,7 @@
--connection node_2
--disable_query_log
---eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_3;
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0, MASTER_PORT=$NODE_MYPORT_3;
--enable_query_log
START SLAVE;
diff --git a/mysql-test/suite/galera/t/galera_as_slave_gtid.inc b/mysql-test/suite/galera/t/galera_as_slave_gtid.inc
index ca6cce52..983f6ebd 100644
--- a/mysql-test/suite/galera/t/galera_as_slave_gtid.inc
+++ b/mysql-test/suite/galera/t/galera_as_slave_gtid.inc
@@ -17,7 +17,7 @@
--connection node_2
--disable_query_log
---eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_3;
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0, MASTER_PORT=$NODE_MYPORT_3;
--enable_query_log
START SLAVE;
diff --git a/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.test b/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.test
index 60476bc4..fd18de16 100644
--- a/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.test
+++ b/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.test
@@ -26,7 +26,7 @@ SELECT @@wsrep_on;
ALTER TABLE mysql.gtid_slave_pos engine = InnoDB;
--disable_query_log
---eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_3;
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0, MASTER_PORT=$NODE_MYPORT_3;
--enable_query_log
START SLAVE;
diff --git a/mysql-test/suite/galera/t/galera_as_slave_nonprim.test b/mysql-test/suite/galera/t/galera_as_slave_nonprim.test
index e22f0240..2fe608bb 100644
--- a/mysql-test/suite/galera/t/galera_as_slave_nonprim.test
+++ b/mysql-test/suite/galera/t/galera_as_slave_nonprim.test
@@ -18,7 +18,7 @@
--connection node_2
--disable_query_log
---eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_4, MASTER_USER='root';
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_4, MASTER_SSL_VERIFY_SERVER_CERT=0, MASTER_USER='root';
--enable_query_log
START SLAVE;
SET SESSION wsrep_sync_wait = 0;
diff --git a/mysql-test/suite/galera/t/galera_event_node_evict.cnf b/mysql-test/suite/galera/t/galera_event_node_evict.cnf
new file mode 100644
index 00000000..e9b669ba
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_event_node_evict.cnf
@@ -0,0 +1,14 @@
+!include ../galera_4nodes.cnf
+
+[mysqld.1]
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;evs.auto_evict=1'
+
+[mysqld.2]
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.auto_evict=1'
+wsrep_status_file='status2.json'
+
+[mysqld.3]
+wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.auto_evict=1'
+
+[mysqld.4]
+wsrep_provider_options='base_port=@mysqld.4.#galera_port;evs.auto_evict=1'
diff --git a/mysql-test/suite/galera/t/galera_event_node_evict.test b/mysql-test/suite/galera/t/galera_event_node_evict.test
new file mode 100644
index 00000000..9651bf09
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_event_node_evict.test
@@ -0,0 +1,96 @@
+#
+# Test that node eviction event is generated in the status file.
+#
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Make sure that Galera library has node eviction event reporting.
+--let $galera_version=26.4.14
+--source suite/wsrep/include/check_galera_version.inc
+
+--connection node_1
+CALL mtr.add_suppression("\\[Warning\\] WSREP: evicting member .* at .* permanently from group");
+
+--connection node_2
+CALL mtr.add_suppression("\\[Warning\\] WSREP: handshake with .* .* failed: 'evicted'");
+CALL mtr.add_suppression("\\[ERROR\\] WSREP: exception from gcomm, backend must be restarted: this node has been evicted out of the cluster, gcomm backend restart is required \\(FATAL\\)");
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+CALL mtr.add_suppression("\\[Warning\\] WSREP: evicting member .* at .* permanently from group");
+
+--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
+CALL mtr.add_suppression("\\[Warning\\] WSREP: evicting member .* at .* permanently from group");
+
+# Save original auto_increment_offset values.
+
+--let $node_1=node_1
+--let $node_2=node_2
+--let $node_3=node_3
+--let $node_4=node_4
+--source include/auto_increment_offset_save.inc
+
+# Repeatedly isolate the node from the cluster until it's evicted.
+
+--disable_query_log
+--disable_result_log
+
+--let $evicted = 0
+while (!$evicted)
+{
+ --connection node_2
+
+ --let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+ --source include/wait_condition.inc
+
+ --let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready';
+ --source include/wait_condition.inc
+
+ --disable_query_log
+ --disable_result_log
+
+ SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
+
+ --connection node_1
+ --let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+ --source include/wait_condition.inc
+
+ --disable_query_log
+ --disable_result_log
+
+ --connection node_2
+ SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
+
+ # As the cluster size doesn't change in case the node is evicted, there is
+ # no good condition to wait for in case the eviction happens, so sleep a bit.
+
+ --sleep 1
+
+ --connection node_1
+ --let $evicted = `SELECT VARIABLE_VALUE != '' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_evs_evict_list'`
+}
+
+--enable_query_log
+--enable_result_log
+
+--connection node_2
+--source include/wsrep_wait_disconnect.inc
+SET GLOBAL wsrep_on = OFF;
+
+# Check the status file to contain the eviction event message.
+
+--let $assert_count = 1
+--let $assert_file = $MYSQLTEST_VARDIR/mysqld.2/data/status2.json
+--let $assert_text = Node evicted
+--let $assert_select = "status": "evicted"
+--source include/assert_grep.inc
+
+# Re-join the node after restart.
+
+--source include/restart_mysqld.inc
+
+--let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+--source include/wait_condition.inc
+
+--source include/auto_increment_offset_restore.inc
diff --git a/mysql-test/suite/galera/t/galera_gtid_slave.test b/mysql-test/suite/galera/t/galera_gtid_slave.test
index b3fbbb02..7bcaac77 100644
--- a/mysql-test/suite/galera/t/galera_gtid_slave.test
+++ b/mysql-test/suite/galera/t/galera_gtid_slave.test
@@ -16,7 +16,7 @@
--connection node_2
--disable_query_log
---eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_3;
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0, MASTER_PORT=$NODE_MYPORT_3;
--enable_query_log
START SLAVE;
diff --git a/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.test b/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.test
index b2ddc7e1..6c83c7a3 100644
--- a/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.test
+++ b/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.test
@@ -16,7 +16,7 @@
--echo #Connection 2
--connection node_2
--disable_query_log
---eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_3,master_use_gtid=slave_pos;
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0, MASTER_PORT=$NODE_MYPORT_3,master_use_gtid=slave_pos;
--enable_query_log
START SLAVE;
--sleep 1
diff --git a/mysql-test/suite/galera/t/galera_ist_MDEV-28423.cnf b/mysql-test/suite/galera/t/galera_ist_MDEV-28423.cnf
index 691e5220..3d43138f 100644
--- a/mysql-test/suite/galera/t/galera_ist_MDEV-28423.cnf
+++ b/mysql-test/suite/galera/t/galera_ist_MDEV-28423.cnf
@@ -3,7 +3,6 @@
[mysqld.1]
# server-id=101
#wsrep-debug=1
-innodb_file_per_table
innodb_autoinc_lock_mode=2
#wsrep_sst_method=rsync
wsrep_sst_method=mariabackup
@@ -20,7 +19,6 @@ log_bin=binlog
[mysqld.2]
# server-id=102
#wsrep-debug=1
-innodb_file_per_table
innodb_autoinc_lock_mode=2
#wsrep_sst_method=rsync
wsrep_sst_method=mariabackup
diff --git a/mysql-test/suite/galera/t/galera_ist_MDEV-28583.cnf b/mysql-test/suite/galera/t/galera_ist_MDEV-28583.cnf
index 3835cd02..6fc6e342 100644
--- a/mysql-test/suite/galera/t/galera_ist_MDEV-28583.cnf
+++ b/mysql-test/suite/galera/t/galera_ist_MDEV-28583.cnf
@@ -3,7 +3,6 @@
[mysqld.1]
# server-id=101
#wsrep-debug=1
-innodb_file_per_table
innodb_autoinc_lock_mode=2
wsrep_sst_method=rsync
#wsrep_sst_method=mariabackup
@@ -20,7 +19,6 @@ log_bin=binlog
[mysqld.2]
# server-id=102
#wsrep-debug=1
-innodb_file_per_table
innodb_autoinc_lock_mode=2
wsrep_sst_method=rsync
#wsrep_sst_method=mariabackup
diff --git a/mysql-test/suite/galera/t/galera_load_data.cnf b/mysql-test/suite/galera/t/galera_load_data.cnf
index 43cc352c..3385fbac 100644
--- a/mysql-test/suite/galera/t/galera_load_data.cnf
+++ b/mysql-test/suite/galera/t/galera_load_data.cnf
@@ -2,7 +2,6 @@
[mysqld.1]
secure-file-priv = ""
-innodb_file_per_table = ON
innodb_stats_persistent=ON
innodb_stats_auto_recalc=ON
innodb_stats_persistent_sample_pages=20
@@ -11,7 +10,6 @@ skip-innodb-read-only-compressed
[mysqld.2]
secure-file-priv = ""
-innodb_file_per_table = ON
innodb_stats_persistent=ON
innodb_stats_auto_recalc=ON
innodb_stats_persistent_sample_pages=20
diff --git a/mysql-test/suite/galera/t/galera_query_cache_invalidate.test b/mysql-test/suite/galera/t/galera_query_cache_invalidate.test
index d72d8a9b..0ad9b966 100644
--- a/mysql-test/suite/galera/t/galera_query_cache_invalidate.test
+++ b/mysql-test/suite/galera/t/galera_query_cache_invalidate.test
@@ -29,7 +29,7 @@ call mtr.add_suppression("WSREP: Ignoring server id for non bootstrap node.");
--connection node_3
--replace_result $NODE_MYPORT_1 NODE_MYPORT_1
---eval CHANGE MASTER TO master_host='127.0.0.1', master_user='root', master_port=$NODE_MYPORT_1, master_use_gtid=current_pos;
+--eval CHANGE MASTER TO master_host='127.0.0.1', master_user='root', master_port=$NODE_MYPORT_1, master_ssl_verify_server_cert=0, master_use_gtid=current_pos
START SLAVE;
--source include/wait_for_slave_to_start.inc
diff --git a/mysql-test/suite/galera/t/galera_sst_encrypted.cnf b/mysql-test/suite/galera/t/galera_sst_encrypted.cnf
index e10c3e9f..596bb95a 100644
--- a/mysql-test/suite/galera/t/galera_sst_encrypted.cnf
+++ b/mysql-test/suite/galera/t/galera_sst_encrypted.cnf
@@ -7,7 +7,6 @@ loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt
loose-file-key-management-encryption-algorithm=aes_cbc
wsrep-debug=1
innodb_encryption_threads = 4
-innodb_file_per_table=1
wsrep_sst_method=rsync
[mysqld.1]
diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup.test b/mysql-test/suite/galera/t/galera_sst_mariabackup.test
index 7dead49e..96f8b4dc 100644
--- a/mysql-test/suite/galera/t/galera_sst_mariabackup.test
+++ b/mysql-test/suite/galera/t/galera_sst_mariabackup.test
@@ -1,6 +1,5 @@
--source include/big_test.inc
--source include/galera_cluster.inc
---source include/have_innodb.inc
--source include/have_mariabackup.inc
# Save original auto_increment_offset values.
diff --git a/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf b/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf
index d3fff4fc..857a4101 100644
--- a/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf
+++ b/mysql-test/suite/galera/t/galera_sst_mariabackup_table_options.cnf
@@ -4,7 +4,6 @@
wsrep_sst_method=mariabackup
wsrep_sst_auth="root:"
wsrep_debug=1
-innodb-file-per-table=ON
[mysqld.1]
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'
diff --git a/mysql-test/suite/galera/t/galera_sync_wait_upto-master.opt b/mysql-test/suite/galera/t/galera_sync_wait_upto-master.opt
index 0b352360..4d11610b 100644
--- a/mysql-test/suite/galera/t/galera_sync_wait_upto-master.opt
+++ b/mysql-test/suite/galera/t/galera_sync_wait_upto-master.opt
@@ -1 +1 @@
---wsrep-sync-wait=0 --wsrep-causal-reads=OFF \ No newline at end of file
+--wsrep-sync-wait=0
diff --git a/mysql-test/suite/galera/t/galera_var_sync_wait.test b/mysql-test/suite/galera/t/galera_var_sync_wait.test
index ecb0d92b..3022471c 100644
--- a/mysql-test/suite/galera/t/galera_var_sync_wait.test
+++ b/mysql-test/suite/galera/t/galera_var_sync_wait.test
@@ -10,7 +10,6 @@
--echo #
# galera_2nodes.cnf sets wsrep_sync_wait to 7
SELECT @@global.wsrep_sync_wait;
-SELECT @@global.wsrep_causal_reads;
--let $wsrep_sync_wait_orig = `SELECT @@wsrep_sync_wait`
diff --git a/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf b/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf
index cd7a892f..56da3150 100644
--- a/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf
+++ b/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf
@@ -1,5 +1,5 @@
# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
+!include include/default_my.cnf
[mysqld]
loose-innodb
diff --git a/mysql-test/suite/galera_3nodes/galera_3nodes.cnf b/mysql-test/suite/galera_3nodes/galera_3nodes.cnf
index a7dd4d21..d43f1373 100644
--- a/mysql-test/suite/galera_3nodes/galera_3nodes.cnf
+++ b/mysql-test/suite/galera_3nodes/galera_3nodes.cnf
@@ -1,5 +1,5 @@
# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
+!include include/default_my.cnf
[mysqld]
loose-innodb
diff --git a/mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc b/mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc
index 4cc10730..13b7dd19 100644
--- a/mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc
+++ b/mysql-test/suite/gcol/inc/gcol_blocked_sql_funcs_main.inc
@@ -257,9 +257,13 @@ drop table t1;
--echo #
create table t1 (a int);
---error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
+insert t1 values (1);
alter table t1 add column b binary(32) generated always as (random_bytes(a));
-alter table t1 add column b binary(32) default (random_bytes(a));
+select a,length(b) from t1;
+--error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
+alter table t1 add index (b);
+alter table t1 add column c binary(32) default (random_bytes(a));
+select a,length(b),length(c) from t1;
drop table t1;
--echo #
diff --git a/mysql-test/suite/gcol/inc/gcol_keys.inc b/mysql-test/suite/gcol/inc/gcol_keys.inc
index 4ae47afc..cc45e250 100644
--- a/mysql-test/suite/gcol/inc/gcol_keys.inc
+++ b/mysql-test/suite/gcol/inc/gcol_keys.inc
@@ -14,6 +14,8 @@
# Change: #
################################################################################
+--source include/have_sequence.inc
+
if (!$support_virtual_index) {
let $skip_spatial_index_check=1;
let $skip_foreign_key_check=1;
@@ -197,12 +199,16 @@ PRIMARY KEY (pk),
KEY (col_time_key),
KEY (col_datetime_key));
+--disable_warnings
INSERT INTO c ( col_time_nokey,col_datetime_nokey,col_varchar_nokey) values
('14:03:03.042673','2001-11-28 00:50:27.051028', 'c'),
('01:46:09.016386','2007-10-09 19:53:04.008332', NULL),
('16:21:18.052408','2001-11-08 21:02:12.009395', 'x'),
('18:56:33.027423','2003-04-01 00:00:00', 'i');
+insert into c (col_time_nokey,col_datetime_nokey,col_varchar_nokey) select '10:10:10', '2021-12-24 01:50:27', 'z' from seq_1_to_10;
+--enable_warnings
+
--replace_column 9 x 10 x
EXPLAIN SELECT
outr.col_time_key AS x
diff --git a/mysql-test/suite/gcol/inc/gcol_select.inc b/mysql-test/suite/gcol/inc/gcol_select.inc
index 2386c55f..8dc76276 100644
--- a/mysql-test/suite/gcol/inc/gcol_select.inc
+++ b/mysql-test/suite/gcol/inc/gcol_select.inc
@@ -545,11 +545,11 @@ CREATE TABLE cc (
);
INSERT INTO cc (col_int_nokey) VALUES (0),(1),(7),(0),(4),(5);
--replace_column 9 # 10 #
-EXPLAIN SELECT pk FROM cc WHERE col_int_key > 3;
-SELECT pk FROM cc WHERE col_int_key > 3;
+EXPLAIN SELECT pk FROM cc force index(col_int_key) WHERE col_int_key > 3;
+SELECT pk FROM cc force index(col_int_key) WHERE col_int_key > 3;
--replace_column 9 # 10 #
-EXPLAIN SELECT pk FROM cc WHERE col_int_key > 3 ORDER BY 1;
-SELECT pk FROM cc WHERE col_int_key > 3 ORDER BY 1;
+EXPLAIN SELECT pk FROM cc force index(col_int_key) WHERE col_int_key > 3 ORDER BY 1;
+SELECT pk FROM cc force index(col_int_key) WHERE col_int_key > 3 ORDER BY 1;
DROP TABLE cc;
--echo #
@@ -872,7 +872,10 @@ CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES(2147483647);
ALTER TABLE t1 ADD COLUMN h INT AS (a) VIRTUAL;
ALTER TABLE t1 CHANGE h i INT AS (a) VIRTUAL, ALGORITHM=COPY;
+# COPY/NONE is not supported in embedded
+--error ER_WARN_DATA_OUT_OF_RANGE,ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER TABLE t1 ADD COLUMN b SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=NONE;
+--error ER_WARN_DATA_OUT_OF_RANGE,ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER TABLE t1 ADD COLUMN e SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=NONE;
ALTER TABLE t1 ADD COLUMN f SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=SHARED;
ALTER TABLE t1 ADD COLUMN g SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=EXCLUSIVE;
diff --git a/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_innodb.result b/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_innodb.result
index a79ed43c..5810dc33 100644
--- a/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_innodb.result
+++ b/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_innodb.result
@@ -177,9 +177,17 @@ drop table t1;
# MDEV-29029 Index corruption and/or assertion failure upon using RANDOM_BYTES for indexed virtual column
#
create table t1 (a int);
+insert t1 values (1);
alter table t1 add column b binary(32) generated always as (random_bytes(a));
+select a,length(b) from t1;
+a length(b)
+1 32
+alter table t1 add index (b);
ERROR HY000: Function or expression 'random_bytes()' cannot be used in the GENERATED ALWAYS AS clause of `b`
-alter table t1 add column b binary(32) default (random_bytes(a));
+alter table t1 add column c binary(32) default (random_bytes(a));
+select a,length(b),length(c) from t1;
+a length(b) length(c)
+1 32 32
drop table t1;
#
#
diff --git a/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_myisam.result b/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_myisam.result
index ac8bd0a3..ffd407db 100644
--- a/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_myisam.result
+++ b/mysql-test/suite/gcol/r/gcol_blocked_sql_funcs_myisam.result
@@ -179,9 +179,17 @@ drop table t1;
# MDEV-29029 Index corruption and/or assertion failure upon using RANDOM_BYTES for indexed virtual column
#
create table t1 (a int);
+insert t1 values (1);
alter table t1 add column b binary(32) generated always as (random_bytes(a));
+select a,length(b) from t1;
+a length(b)
+1 32
+alter table t1 add index (b);
ERROR HY000: Function or expression 'random_bytes()' cannot be used in the GENERATED ALWAYS AS clause of `b`
-alter table t1 add column b binary(32) default (random_bytes(a));
+alter table t1 add column c binary(32) default (random_bytes(a));
+select a,length(b),length(c) from t1;
+a length(b) length(c)
+1 32 32
drop table t1;
#
#
diff --git a/mysql-test/suite/gcol/r/gcol_bugfixes.result b/mysql-test/suite/gcol/r/gcol_bugfixes.result
index 5dfa416a..f26b0ad3 100644
--- a/mysql-test/suite/gcol/r/gcol_bugfixes.result
+++ b/mysql-test/suite/gcol/r/gcol_bugfixes.result
@@ -638,10 +638,10 @@ DEFAULT SUBSTRING_INDEX(USER(),'@',1)
);
EXPLAIN UPDATE gafld SET nuigafld = 0 WHERE nuigafld = 10;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE gafld ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
EXPLAIN UPDATE gafld SET nuigafld = 0 WHERE nuigafld = 10;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE gafld ALL NULL NULL NULL NULL 1 Using where
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
DROP TABLE gafld;
# (duplicate) MDEV-17653 replace into generated columns is unstable
# Some columns are snipped from the MDEV test
diff --git a/mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result b/mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result
index 193ef064..bc3b5493 100644
--- a/mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result
+++ b/mysql-test/suite/gcol/r/gcol_ins_upd_innodb.result
@@ -497,7 +497,7 @@ WHERE OUTR1.pk = 1
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY OUTR1 const PRIMARY PRIMARY 4 const 1
1 PRIMARY INNR1 ALL NULL NULL NULL NULL 2 Using where; FirstMatch(OUTR1)
-1 PRIMARY OUTR2 index NULL PRIMARY 4 NULL 2 Using index
+1 PRIMARY OUTR2 ALL NULL NULL NULL NULL 2
DROP TABLE IF EXISTS b,bb,d;
#
# Bug#21216067 ASSERTION FAILED ROW_UPD_SEC_INDEX_ENTRY (INNOBASE/ROW/ROW0UPD.CC:2103)
diff --git a/mysql-test/suite/gcol/r/gcol_keys_innodb.result b/mysql-test/suite/gcol/r/gcol_keys_innodb.result
index 0228f9be..4b1e5b48 100644
--- a/mysql-test/suite/gcol/r/gcol_keys_innodb.result
+++ b/mysql-test/suite/gcol/r/gcol_keys_innodb.result
@@ -192,11 +192,7 @@ INSERT INTO c ( col_time_nokey,col_datetime_nokey,col_varchar_nokey) values
('01:46:09.016386','2007-10-09 19:53:04.008332', NULL),
('16:21:18.052408','2001-11-08 21:02:12.009395', 'x'),
('18:56:33.027423','2003-04-01 00:00:00', 'i');
-Warnings:
-Note 1265 Data truncated for column 'col_time_key' at row 1
-Note 1265 Data truncated for column 'col_time_key' at row 2
-Note 1265 Data truncated for column 'col_time_key' at row 3
-Note 1265 Data truncated for column 'col_time_key' at row 4
+insert into c (col_time_nokey,col_datetime_nokey,col_varchar_nokey) select '10:10:10', '2021-12-24 01:50:27', 'z' from seq_1_to_10;
EXPLAIN SELECT
outr.col_time_key AS x
FROM c as outr
diff --git a/mysql-test/suite/gcol/r/gcol_keys_myisam.result b/mysql-test/suite/gcol/r/gcol_keys_myisam.result
index 523ff3a3..3c9093cf 100644
--- a/mysql-test/suite/gcol/r/gcol_keys_myisam.result
+++ b/mysql-test/suite/gcol/r/gcol_keys_myisam.result
@@ -192,11 +192,7 @@ INSERT INTO c ( col_time_nokey,col_datetime_nokey,col_varchar_nokey) values
('01:46:09.016386','2007-10-09 19:53:04.008332', NULL),
('16:21:18.052408','2001-11-08 21:02:12.009395', 'x'),
('18:56:33.027423','2003-04-01 00:00:00', 'i');
-Warnings:
-Note 1265 Data truncated for column 'col_time_key' at row 1
-Note 1265 Data truncated for column 'col_time_key' at row 2
-Note 1265 Data truncated for column 'col_time_key' at row 3
-Note 1265 Data truncated for column 'col_time_key' at row 4
+insert into c (col_time_nokey,col_datetime_nokey,col_varchar_nokey) select '10:10:10', '2021-12-24 01:50:27', 'z' from seq_1_to_10;
EXPLAIN SELECT
outr.col_time_key AS x
FROM c as outr
diff --git a/mysql-test/suite/gcol/r/gcol_select_innodb.result b/mysql-test/suite/gcol/r/gcol_select_innodb.result
index 72d1e9f3..8423c3bc 100644
--- a/mysql-test/suite/gcol/r/gcol_select_innodb.result
+++ b/mysql-test/suite/gcol/r/gcol_select_innodb.result
@@ -146,7 +146,7 @@ count(distinct c)
3
explain select count(distinct c) from t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL c 5 NULL 6 Using index for group-by
+1 SIMPLE t1 range NULL c 5 NULL 5 Using index for group-by
###
### filesort & range-based utils
###
@@ -536,9 +536,9 @@ INSERT INTO t1 VALUES(2147483647);
ALTER TABLE t1 ADD COLUMN h INT AS (a) VIRTUAL;
ALTER TABLE t1 CHANGE h i INT AS (a) VIRTUAL, ALGORITHM=COPY;
ALTER TABLE t1 ADD COLUMN b SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=NONE;
-ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED
+Got one of the listed errors
ALTER TABLE t1 ADD COLUMN e SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=NONE;
-ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED
+Got one of the listed errors
ALTER TABLE t1 ADD COLUMN f SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=SHARED;
ERROR 22003: Out of range value for column 'f' at row 1
ALTER TABLE t1 ADD COLUMN g SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=EXCLUSIVE;
@@ -699,11 +699,10 @@ WHERE t4.c1 < 'o'
)
AND t1.i1 <= t3.i2_key;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2
-1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where
+1 PRIMARY t4 ALL NULL NULL NULL NULL 3 Using where; Start temporary
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join)
+1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where; End temporary
1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
-2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where
SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1
FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2
WHERE ( t3.pk IN
@@ -754,11 +753,10 @@ WHERE t4.c1 < 'o'
)
AND t1.i1 <= t3.i2_key;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2
-1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where
+1 PRIMARY t4 ALL NULL NULL NULL NULL 3 Using where; Start temporary
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join)
+1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where; End temporary
1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
-2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where
SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1
FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2
WHERE ( t3.pk IN
@@ -810,11 +808,10 @@ WHERE t4.c1 < 'o'
)
AND t1.i1 <= t3.i2_key;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2
-1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where
+1 PRIMARY t4 ALL NULL NULL NULL NULL 3 Using where; Start temporary
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join)
+1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where; End temporary
1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
-2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where
SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1
FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2
WHERE ( t3.pk IN
@@ -874,11 +871,10 @@ WHERE t4.c1 < 'o'
)
AND t1.i1 <= t3.i2_key;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2
-1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where
+1 PRIMARY t4 ALL NULL NULL NULL NULL 3 Using where; Start temporary
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join)
+1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where; End temporary
1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
-2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where
SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1, t3.i1
FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2
WHERE ( t3.pk IN
diff --git a/mysql-test/suite/gcol/r/gcol_select_myisam.result b/mysql-test/suite/gcol/r/gcol_select_myisam.result
index 0d18976f..df1fbd27 100644
--- a/mysql-test/suite/gcol/r/gcol_select_myisam.result
+++ b/mysql-test/suite/gcol/r/gcol_select_myisam.result
@@ -146,7 +146,7 @@ count(distinct c)
3
explain select count(distinct c) from t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL c 5 NULL 6 Using index for group-by
+1 SIMPLE t1 range NULL c 5 NULL 5 Using index for group-by
###
### filesort & range-based utils
###
@@ -792,18 +792,18 @@ PRIMARY KEY (pk),
KEY (col_int_key)
);
INSERT INTO cc (col_int_nokey) VALUES (0),(1),(7),(0),(4),(5);
-EXPLAIN SELECT pk FROM cc WHERE col_int_key > 3;
+EXPLAIN SELECT pk FROM cc force index(col_int_key) WHERE col_int_key > 3;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE cc range col_int_key col_int_key 5 NULL # #
-SELECT pk FROM cc WHERE col_int_key > 3;
+SELECT pk FROM cc force index(col_int_key) WHERE col_int_key > 3;
pk
5
6
3
-EXPLAIN SELECT pk FROM cc WHERE col_int_key > 3 ORDER BY 1;
+EXPLAIN SELECT pk FROM cc force index(col_int_key) WHERE col_int_key > 3 ORDER BY 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE cc range col_int_key col_int_key 5 NULL # #
-SELECT pk FROM cc WHERE col_int_key > 3 ORDER BY 1;
+SELECT pk FROM cc force index(col_int_key) WHERE col_int_key > 3 ORDER BY 1;
pk
3
5
@@ -1155,9 +1155,9 @@ INSERT INTO t1 VALUES(2147483647);
ALTER TABLE t1 ADD COLUMN h INT AS (a) VIRTUAL;
ALTER TABLE t1 CHANGE h i INT AS (a) VIRTUAL, ALGORITHM=COPY;
ALTER TABLE t1 ADD COLUMN b SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=NONE;
-ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED
+Got one of the listed errors
ALTER TABLE t1 ADD COLUMN e SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=NONE;
-ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED
+Got one of the listed errors
ALTER TABLE t1 ADD COLUMN f SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=SHARED;
ERROR 22003: Out of range value for column 'f' at row 1
ALTER TABLE t1 ADD COLUMN g SMALLINT AS (a) VIRTUAL, ALGORITHM=COPY, LOCK=EXCLUSIVE;
@@ -1325,11 +1325,10 @@ WHERE t4.c1 < 'o'
)
AND t1.i1 <= t3.i2_key;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2
-1 PRIMARY t3 eq_ref PRIMARY,v_idx PRIMARY 4 test.t4.i1 1 Using where
+1 PRIMARY t4 ALL NULL NULL NULL NULL 3 Using where; Start temporary
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join)
+1 PRIMARY t3 eq_ref PRIMARY,v_idx PRIMARY 4 test.t4.i1 1 Using where; End temporary
1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
-2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where
SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1
FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2
WHERE ( t3.pk IN
@@ -1381,11 +1380,10 @@ WHERE t4.c1 < 'o'
)
AND t1.i1 <= t3.i2_key;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2
-1 PRIMARY t3 eq_ref PRIMARY,v_idx,v_idx2 PRIMARY 4 test.t4.i1 1 Using where
+1 PRIMARY t4 ALL NULL NULL NULL NULL 3 Using where; Start temporary
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join)
+1 PRIMARY t3 eq_ref PRIMARY,v_idx,v_idx2 PRIMARY 4 test.t4.i1 1 Using where; End temporary
1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
-2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where
SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1
FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2
WHERE ( t3.pk IN
@@ -1439,11 +1437,10 @@ WHERE t4.c1 < 'o'
)
AND t1.i1 <= t3.i2_key;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2
-1 PRIMARY t3 eq_ref PRIMARY,v_idx2 PRIMARY 4 test.t4.i1 1 Using where
+1 PRIMARY t4 ALL NULL NULL NULL NULL 3 Using where; Start temporary
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join)
+1 PRIMARY t3 eq_ref PRIMARY,v_idx2 PRIMARY 4 test.t4.i1 1 Using where; End temporary
1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
-2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where
SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1
FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2
WHERE ( t3.pk IN
@@ -1506,11 +1503,10 @@ WHERE t4.c1 < 'o'
)
AND t1.i1 <= t3.i2_key;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 ALL NULL NULL NULL NULL 4
-1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2
-1 PRIMARY t3 eq_ref PRIMARY,v_idx PRIMARY 4 test.t4.i1 1 Using where
+1 PRIMARY t4 ALL NULL NULL NULL NULL 3 Using where; Start temporary
+1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join)
+1 PRIMARY t3 eq_ref PRIMARY,v_idx PRIMARY 4 test.t4.i1 1 Using where; End temporary
1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
-2 MATERIALIZED t4 ALL NULL NULL NULL NULL 3 Using where
SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1, t3.i1
FROM t1 STRAIGHT_JOIN t3 STRAIGHT_JOIN t2
WHERE ( t3.pk IN
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_basic.result b/mysql-test/suite/gcol/r/innodb_virtual_basic.result
index 38238871..db8e39d8 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_basic.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_basic.result
@@ -957,12 +957,12 @@ CREATE TABLE t1 (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), h VARCHAR(10));
INSERT INTO t1 VALUES (11, 3, DEFAULT, 'mm');
INSERT INTO t1 VALUES (18, 1, DEFAULT, 'mm');
INSERT INTO t1 VALUES (28, 1, DEFAULT, 'mm');
-ALTER TABLE t1 ADD INDEX idx12 (c) , FORCE, LOCK=NONE;
+ALTER TABLE t1 ADD INDEX idx12 (c), FORCE, ALGORITHM = INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
ALTER TABLE t1 ADD INDEX idx12 (c), LOCK=NONE;
-ALTER TABLE t1 DROP COLUMN h, ADD INDEX idx (c) , FORCE, LOCK=NONE;
+ALTER TABLE t1 DROP COLUMN h, ADD INDEX idx (c), FORCE, ALGORITHM = INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
-ALTER TABLE t1 DROP COLUMN h, ADD INDEX idx (c), LOCK=NONE;
+ALTER TABLE t1 DROP COLUMN h, ADD INDEX idx (c), ALGORITHM = INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
DROP TABLE t1 ;
CREATE TABLE t1 (a INT, b INT, c INT GENERATED ALWAYS AS(a+b), d INT GENERATED ALWAYS AS(a+b), h VARCHAR(10));
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_debug.result b/mysql-test/suite/gcol/r/innodb_virtual_debug.result
index e1b87938..1ca30b84 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_debug.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_debug.result
@@ -55,7 +55,7 @@ a b c h
18 1 19 mm
28 1 29 mm
NULL NULL NULL mx
-ALTER TABLE t FORCE, LOCK=NONE;
+ALTER TABLE t FORCE, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
disconnect con1;
DROP TABLE t;
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_rebuild.result b/mysql-test/suite/gcol/r/innodb_virtual_rebuild.result
index 35f37034..028ae023 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_rebuild.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_rebuild.result
@@ -6,30 +6,30 @@ CREATE TABLE t4 (i INT, v INT AS (i) VIRTUAL) ENGINE=InnoDB
ROW_FORMAT=REDUNDANT;
INSERT INTO t4 SET i=1;
ALTER TABLE t4 ADD INDEX(v), LOCK=NONE;
-ALTER TABLE t4 ADD COLUMN k INT, LOCK=NONE;
+ALTER TABLE t4 ADD COLUMN k INT, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
-ALTER TABLE t4 DROP k, LOCK=NONE;
+ALTER TABLE t4 DROP k, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 42000: Can't DROP COLUMN `k`; check that it exists
ALTER TABLE t4 DROP INDEX v, LOCK=NONE;
INSERT INTO t3 SET i=1;
ALTER TABLE t3 ADD INDEX(v), LOCK=NONE;
-ALTER TABLE t3 ADD COLUMN k INT, LOCK=NONE;
+ALTER TABLE t3 ADD COLUMN k INT, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
-ALTER TABLE t3 DROP k, LOCK=NONE;
+ALTER TABLE t3 DROP k, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 42000: Can't DROP COLUMN `k`; check that it exists
ALTER TABLE t3 DROP INDEX v, LOCK=NONE;
INSERT INTO t2 SET i=1;
ALTER TABLE t2 ADD INDEX(v), LOCK=NONE;
-ALTER TABLE t2 ADD COLUMN k INT, LOCK=NONE;
+ALTER TABLE t2 ADD COLUMN k INT, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
-ALTER TABLE t2 DROP k, LOCK=NONE;
+ALTER TABLE t2 DROP k, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 42000: Can't DROP COLUMN `k`; check that it exists
ALTER TABLE t2 DROP INDEX v, LOCK=NONE;
INSERT INTO t1 SET i=1;
ALTER TABLE t1 ADD INDEX(v), LOCK=NONE;
-ALTER TABLE t1 ADD COLUMN k INT, LOCK=NONE;
+ALTER TABLE t1 ADD COLUMN k INT, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: online rebuild with indexed virtual columns. Try LOCK=SHARED
-ALTER TABLE t1 DROP k, LOCK=NONE;
+ALTER TABLE t1 DROP k, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 42000: Can't DROP COLUMN `k`; check that it exists
ALTER TABLE t1 DROP INDEX v, LOCK=NONE;
connect ddl,localhost,root,,test;
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_basic.test b/mysql-test/suite/gcol/t/innodb_virtual_basic.test
index 32598758..cb4f2295 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_basic.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_basic.test
@@ -886,12 +886,12 @@ INSERT INTO t1 VALUES (18, 1, DEFAULT, 'mm');
INSERT INTO t1 VALUES (28, 1, DEFAULT, 'mm');
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-ALTER TABLE t1 ADD INDEX idx12 (c) , FORCE, LOCK=NONE;
+ALTER TABLE t1 ADD INDEX idx12 (c), FORCE, ALGORITHM = INPLACE, LOCK=NONE;
ALTER TABLE t1 ADD INDEX idx12 (c), LOCK=NONE;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-ALTER TABLE t1 DROP COLUMN h, ADD INDEX idx (c) , FORCE, LOCK=NONE;
+ALTER TABLE t1 DROP COLUMN h, ADD INDEX idx (c), FORCE, ALGORITHM = INPLACE, LOCK=NONE;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-ALTER TABLE t1 DROP COLUMN h, ADD INDEX idx (c), LOCK=NONE;
+ALTER TABLE t1 DROP COLUMN h, ADD INDEX idx (c), ALGORITHM = INPLACE, LOCK=NONE;
DROP TABLE t1 ;
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_debug.test b/mysql-test/suite/gcol/t/innodb_virtual_debug.test
index c359f3c8..337af3e5 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_debug.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_debug.test
@@ -58,7 +58,7 @@ SHOW CREATE TABLE t;
SELECT * FROM t;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-ALTER TABLE t FORCE, LOCK=NONE;
+ALTER TABLE t FORCE, ALGORITHM=INPLACE, LOCK=NONE;
if (0) {# MDEV-14341 TODO: re-enable this
SET DEBUG_SYNC = 'innodb_inplace_alter_table_enter SIGNAL start_create WAIT_FOR go_ahead';
--send ALTER TABLE t FORCE
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_rebuild.test b/mysql-test/suite/gcol/t/innodb_virtual_rebuild.test
index fe4f5e30..85707ca0 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_rebuild.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_rebuild.test
@@ -16,9 +16,9 @@ eval INSERT INTO t$n SET i=1;
eval ALTER TABLE t$n ADD INDEX(v), LOCK=NONE;
# MDEV-17468 FIXME: Fix this, and remove the 2 --error below.
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-eval ALTER TABLE t$n ADD COLUMN k INT, LOCK=NONE;
+eval ALTER TABLE t$n ADD COLUMN k INT, ALGORITHM=INPLACE, LOCK=NONE;
--error ER_CANT_DROP_FIELD_OR_KEY
-eval ALTER TABLE t$n DROP k, LOCK=NONE;
+eval ALTER TABLE t$n DROP k, ALGORITHM=INPLACE, LOCK=NONE;
eval ALTER TABLE t$n DROP INDEX v, LOCK=NONE;
dec $n;
}
diff --git a/mysql-test/suite/handler/aria.result b/mysql-test/suite/handler/aria.result
index b0a4a173..abed2cfc 100644
--- a/mysql-test/suite/handler/aria.result
+++ b/mysql-test/suite/handler/aria.result
@@ -1540,8 +1540,6 @@ BEGIN
SELECT 1 FROM t2 INTO @a;
RETURN 1;
END|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
SELECT f1();
ERROR 42S02: Table 'test.t2' doesn't exist
CREATE TABLE t1(a INT);
diff --git a/mysql-test/suite/handler/heap.result b/mysql-test/suite/handler/heap.result
index e66bccb1..75355ba0 100644
--- a/mysql-test/suite/handler/heap.result
+++ b/mysql-test/suite/handler/heap.result
@@ -1539,8 +1539,6 @@ BEGIN
SELECT 1 FROM t2 INTO @a;
RETURN 1;
END|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
SELECT f1();
ERROR 42S02: Table 'test.t2' doesn't exist
CREATE TABLE t1(a INT);
diff --git a/mysql-test/suite/handler/innodb.result b/mysql-test/suite/handler/innodb.result
index 5d44642d..5305a80a 100644
--- a/mysql-test/suite/handler/innodb.result
+++ b/mysql-test/suite/handler/innodb.result
@@ -1544,8 +1544,6 @@ BEGIN
SELECT 1 FROM t2 INTO @a;
RETURN 1;
END|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
SELECT f1();
ERROR 42S02: Table 'test.t2' doesn't exist
CREATE TABLE t1(a INT);
diff --git a/mysql-test/suite/handler/myisam.result b/mysql-test/suite/handler/myisam.result
index cc817ccd..94c3791d 100644
--- a/mysql-test/suite/handler/myisam.result
+++ b/mysql-test/suite/handler/myisam.result
@@ -1540,8 +1540,6 @@ BEGIN
SELECT 1 FROM t2 INTO @a;
RETURN 1;
END|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
SELECT f1();
ERROR 42S02: Table 'test.t2' doesn't exist
CREATE TABLE t1(a INT);
diff --git a/mysql-test/suite/heap/heap.result b/mysql-test/suite/heap/heap.result
index bef3913d..24c6aadb 100644
--- a/mysql-test/suite/heap/heap.result
+++ b/mysql-test/suite/heap/heap.result
@@ -398,9 +398,10 @@ qq
*a *a*a *
*a *a*a *
*a *a*a *
+flush tables;
explain select * from t1 where v='a';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref v v 13 const 10 Using where
+1 SIMPLE t1 ref v v 13 const 9 Using where
select v,count(*) from t1 group by v limit 10;
v count(*)
a 1
diff --git a/mysql-test/suite/heap/heap.test b/mysql-test/suite/heap/heap.test
index ef950da5..7d8b91b5 100644
--- a/mysql-test/suite/heap/heap.test
+++ b/mysql-test/suite/heap/heap.test
@@ -277,6 +277,7 @@ explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a '
--error ER_DUP_ENTRY
alter table t1 add unique(v);
select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a' order by length(concat('*',v,'*',c,'*',t,'*'));
+flush tables;
explain select * from t1 where v='a';
# GROUP BY
diff --git a/mysql-test/suite/heap/heap_btree.result b/mysql-test/suite/heap/heap_btree.result
index 526c76a5..3eb618a0 100644
--- a/mysql-test/suite/heap/heap_btree.result
+++ b/mysql-test/suite/heap/heap_btree.result
@@ -70,6 +70,10 @@ alter table t1 engine=myisam;
explain select * from t1 where a in (869751,736494,226312,802616);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range uniq_id uniq_id 4 NULL 4 Using where; Using index
+insert into t1 values (1),(2),(3),(4),(5),(6);
+explain select * from t1 where a in (869751,736494,226312,802616);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range uniq_id uniq_id 4 NULL 4 Using where; Using index
drop table t1;
create table t1 (x int not null, y int not null, key x using BTREE (x,y), unique y using BTREE (y))
engine=heap;
diff --git a/mysql-test/suite/heap/heap_btree.test b/mysql-test/suite/heap/heap_btree.test
index d3fbe4cc..e8f7c02c 100644
--- a/mysql-test/suite/heap/heap_btree.test
+++ b/mysql-test/suite/heap/heap_btree.test
@@ -48,6 +48,8 @@ select * from t1 where a in (869751,736494,226312,802616);
explain select * from t1 where a in (869751,736494,226312,802616);
alter table t1 engine=myisam;
explain select * from t1 where a in (869751,736494,226312,802616);
+insert into t1 values (1),(2),(3),(4),(5),(6);
+explain select * from t1 where a in (869751,736494,226312,802616);
drop table t1;
create table t1 (x int not null, y int not null, key x using BTREE (x,y), unique y using BTREE (y))
diff --git a/mysql-test/suite/innodb/include/import_begin.inc b/mysql-test/suite/innodb/include/import_begin.inc
new file mode 100644
index 00000000..5ee46b52
--- /dev/null
+++ b/mysql-test/suite/innodb/include/import_begin.inc
@@ -0,0 +1,32 @@
+--source include/innodb_row_format.inc
+--source include/innodb_row_format_2.inc
+--source include/innodb_checksum_algorithm.inc
+
+--echo #
+--echo # MDEV-26137 ALTER TABLE IMPORT enhancement
+--echo #
+
+let $MYSQLD_DATADIR = `SELECT @@datadir`;
+
+--disable_query_log
+let $ROW_FORMAT_OPTION=;
+if($MTR_COMBINATION_R_REDUNDANT) {
+ let $ROW_FORMAT_OPTION= ROW_FORMAT=REDUNDANT;
+}
+if($MTR_COMBINATION_R_COMPACT) {
+ let $ROW_FORMAT_OPTION= ROW_FORMAT=COMPACT;
+}
+if($MTR_COMBINATION_R_DYNAMIC) {
+ let $ROW_FORMAT_OPTION= ROW_FORMAT=DYNAMIC;
+}
+if($MTR_COMBINATION_R_COMPRESSED) {
+ let $ROW_FORMAT_OPTION= ROW_FORMAT=COMPRESSED;
+}
+let $CREATE_OPTIONS_REGEX= /ENGINE=InnoDB.*$ROW_FORMAT_OPTION/CREATE_OPTIONS/;
+--enable_query_log
+
+--replace_regex $CREATE_OPTIONS_REGEX
+eval
+CREATE TABLE t1(a INT PRIMARY KEY DEFAULT 42) ENGINE=InnoDB $ROW_FORMAT_OPTION;
+INSERT INTO t1() VALUES();
+FLUSH TABLES t1 FOR EXPORT;
diff --git a/mysql-test/suite/innodb/include/import_end.inc b/mysql-test/suite/innodb/include/import_end.inc
new file mode 100644
index 00000000..916306ea
--- /dev/null
+++ b/mysql-test/suite/innodb/include/import_end.inc
@@ -0,0 +1,8 @@
+--copy_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/t2.frm
+--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd
+UNLOCK TABLES;
+ALTER TABLE t2 IMPORT TABLESPACE;
+--replace_regex $CREATE_OPTIONS_REGEX
+SHOW CREATE TABLE t2;
+SELECT * FROM t2;
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/innodb/include/innodb_bulk_create_index.inc b/mysql-test/suite/innodb/include/innodb_bulk_create_index.inc
index 3c105179..438b7b17 100644
--- a/mysql-test/suite/innodb/include/innodb_bulk_create_index.inc
+++ b/mysql-test/suite/innodb/include/innodb_bulk_create_index.inc
@@ -35,8 +35,6 @@ if ($row_format != 'COMPRESSED')
if ($row_format == 'COMPRESSED')
{
- SET GLOBAL innodb_file_per_table=1;
-
eval CREATE TABLE t1(
class INT,
id INT,
@@ -176,10 +174,4 @@ SELECT CHAR_LENGTH(b) FROM t1 WHERE a=4975;
DROP TABLE t1;
-# Restore global variables
-if ($row_format == 'COMPRESSED')
-{
- SET GLOBAL innodb_file_per_table=default;
-}
-
DROP PROCEDURE populate_t1;
diff --git a/mysql-test/suite/innodb/include/innodb_bulk_create_index_debug.inc b/mysql-test/suite/innodb/include/innodb_bulk_create_index_debug.inc
index 85466e5e..dbdadd0b 100644
--- a/mysql-test/suite/innodb/include/innodb_bulk_create_index_debug.inc
+++ b/mysql-test/suite/innodb/include/innodb_bulk_create_index_debug.inc
@@ -38,8 +38,6 @@ if ($row_format != 'COMPRESSED')
if ($row_format == 'COMPRESSED')
{
- SET GLOBAL innodb_file_per_table=1;
-
eval CREATE TABLE t1(
class INT,
id INT,
@@ -69,8 +67,6 @@ if ($row_format != 'COMPRESSED') {
}
if ($row_format == 'COMPRESSED') {
- SET GLOBAL innodb_file_per_table=1;
-
eval CREATE TABLE t1(
a INT PRIMARY KEY,
b TEXT,
@@ -124,8 +120,6 @@ if ($row_format != 'COMPRESSED')
if ($row_format == 'COMPRESSED')
{
- SET GLOBAL innodb_file_per_table=1;
-
eval CREATE TABLE t1(
class INT,
id INT,
@@ -174,8 +168,6 @@ if ($row_format != 'COMPRESSED') {
}
if ($row_format == 'COMPRESSED') {
- SET GLOBAL innodb_file_per_table=1;
-
eval CREATE TABLE t1(
a INT PRIMARY KEY,
b TEXT,
diff --git a/mysql-test/suite/innodb/include/innodb_merge_threshold_delete.inc b/mysql-test/suite/innodb/include/innodb_merge_threshold_delete.inc
index 7d7188aa..2431d207 100644
--- a/mysql-test/suite/innodb/include/innodb_merge_threshold_delete.inc
+++ b/mysql-test/suite/innodb/include/innodb_merge_threshold_delete.inc
@@ -1,6 +1,6 @@
#
# Test to cause merge of the pages (by deleting)
-# test/tab1 should be created already with innodb_file_per_table=ON
+# test/tab1 should be created already
# The definition is intended to be based on
# "create table tab1 (a bigint primary key, b varchar(2048)) engine=InnoDB;"
#
diff --git a/mysql-test/suite/innodb/include/innodb_merge_threshold_secondary.inc b/mysql-test/suite/innodb/include/innodb_merge_threshold_secondary.inc
index 1d3aca87..2ffe1085 100644
--- a/mysql-test/suite/innodb/include/innodb_merge_threshold_secondary.inc
+++ b/mysql-test/suite/innodb/include/innodb_merge_threshold_secondary.inc
@@ -1,6 +1,6 @@
#
# Test to cause merge of the pages (at secondary index by deleting)
-# test/tab1 should be created already with innodb_file_per_table=ON
+# test/tab1 should be created already
# The definition is intended to be based on
# "create table tab1 (a bigint primary key, b blob) engine=InnoDB row_format=dynamic;"
# "create index index1 on tab1(b(750));"
diff --git a/mysql-test/suite/innodb/include/innodb_merge_threshold_update.inc b/mysql-test/suite/innodb/include/innodb_merge_threshold_update.inc
index f91a796d..a7537d60 100644
--- a/mysql-test/suite/innodb/include/innodb_merge_threshold_update.inc
+++ b/mysql-test/suite/innodb/include/innodb_merge_threshold_update.inc
@@ -1,6 +1,6 @@
#
# Test to cause merge of the pages (by updating to smaller)
-# test/tab1 should be created already with innodb_file_per_table=ON
+# test/tab1 should be created already
# The definition is intended to be based on
# "create table tab1 (a bigint primary key, b varchar(2048)) engine=InnoDB;"
#
diff --git a/mysql-test/suite/innodb/include/innodb_row_format_2.combinations b/mysql-test/suite/innodb/include/innodb_row_format_2.combinations
new file mode 100644
index 00000000..14a0281d
--- /dev/null
+++ b/mysql-test/suite/innodb/include/innodb_row_format_2.combinations
@@ -0,0 +1,5 @@
+[r_default]
+[r_redundant]
+[r_compact]
+[r_dynamic]
+[r_compressed]
diff --git a/mysql-test/suite/innodb/include/innodb_row_format_2.inc b/mysql-test/suite/innodb/include/innodb_row_format_2.inc
new file mode 100644
index 00000000..2d42f74a
--- /dev/null
+++ b/mysql-test/suite/innodb/include/innodb_row_format_2.inc
@@ -0,0 +1,4 @@
+# The goal of including this file is to add various row_format options
+# combinations (see include/innodb_row_format_2.combinations)
+
+--source include/have_innodb.inc
diff --git a/mysql-test/suite/innodb/r/alter_algorithm,INPLACE.rdiff b/mysql-test/suite/innodb/r/alter_algorithm,INPLACE.rdiff
index a176a9af..6c0b1bad 100644
--- a/mysql-test/suite/innodb/r/alter_algorithm,INPLACE.rdiff
+++ b/mysql-test/suite/innodb/r/alter_algorithm,INPLACE.rdiff
@@ -1,6 +1,6 @@
---- alter_algorithm.result 2020-04-30 21:39:48.923115511 +0530
-+++ alter_algorithm.reject 2020-04-30 21:45:04.131642093 +0530
-@@ -7,43 +7,43 @@
+--- alter_algorithm.result
++++ alter_algorithm.reject
+@@ -7,40 +7,40 @@
INSERT INTO t1(f1, f2, f3) VALUES(1, 1, 1);
SELECT @@alter_algorithm;
@@alter_algorithm
@@ -56,13 +56,8 @@
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE t1 FORCE, ALGORITHM=DEFAULT;
--affected rows: 1
--info: Records: 1 Duplicates: 0 Warnings: 0
-+affected rows: 0
-+info: Records: 0 Duplicates: 0 Warnings: 0
- DROP TABLE t1;
affected rows: 0
- CREATE TABLE t1(f1 INT PRIMARY KEY, f2 INT NOT NULL,
+ info: Records: 0 Duplicates: 0 Warnings: 0
@@ -56,22 +56,22 @@
FOREIGN KEY fidx(f1) REFERENCES t1(f1))ENGINE=INNODB;
INSERT INTO t1(f1, f2, f4, f5) VALUES(1, 2, 3, 4);
diff --git a/mysql-test/suite/innodb/r/alter_algorithm,INSTANT.rdiff b/mysql-test/suite/innodb/r/alter_algorithm,INSTANT.rdiff
index 414b7dc8..6a09338d 100644
--- a/mysql-test/suite/innodb/r/alter_algorithm,INSTANT.rdiff
+++ b/mysql-test/suite/innodb/r/alter_algorithm,INSTANT.rdiff
@@ -1,6 +1,6 @@
---- alter_algorithm.result 2020-04-30 21:39:48.923115511 +0530
-+++ alter_algorithm.reject 2020-04-30 21:47:08.245465018 +0530
-@@ -7,43 +7,35 @@
+--- alter_algorithm.result
++++ alter_algorithm.reject
+@@ -7,40 +7,32 @@
INSERT INTO t1(f1, f2, f3) VALUES(1, 1, 1);
SELECT @@alter_algorithm;
@@alter_algorithm
@@ -48,13 +48,8 @@
-info: Records: 1 Duplicates: 0 Warnings: 0
+Got one of the listed errors
ALTER TABLE t1 FORCE, ALGORITHM=DEFAULT;
--affected rows: 1
--info: Records: 1 Duplicates: 0 Warnings: 0
-+affected rows: 0
-+info: Records: 0 Duplicates: 0 Warnings: 0
- DROP TABLE t1;
affected rows: 0
- CREATE TABLE t1(f1 INT PRIMARY KEY, f2 INT NOT NULL,
+ info: Records: 0 Duplicates: 0 Warnings: 0
@@ -56,22 +48,17 @@
FOREIGN KEY fidx(f1) REFERENCES t1(f1))ENGINE=INNODB;
INSERT INTO t1(f1, f2, f4, f5) VALUES(1, 2, 3, 4);
diff --git a/mysql-test/suite/innodb/r/alter_algorithm,NOCOPY.rdiff b/mysql-test/suite/innodb/r/alter_algorithm,NOCOPY.rdiff
index 2aa8c722..31795863 100644
--- a/mysql-test/suite/innodb/r/alter_algorithm,NOCOPY.rdiff
+++ b/mysql-test/suite/innodb/r/alter_algorithm,NOCOPY.rdiff
@@ -1,6 +1,6 @@
---- alter_algorithm.result 2020-04-30 21:39:48.923115511 +0530
-+++ alter_algorithm.reject 2020-04-30 21:52:10.785967739 +0530
-@@ -7,43 +7,35 @@
+--- alter_algorithm.result
++++ alter_algorithm.reject
+@@ -7,40 +7,32 @@
INSERT INTO t1(f1, f2, f3) VALUES(1, 1, 1);
SELECT @@alter_algorithm;
@@alter_algorithm
@@ -48,13 +48,8 @@
-info: Records: 1 Duplicates: 0 Warnings: 0
+Got one of the listed errors
ALTER TABLE t1 FORCE, ALGORITHM=DEFAULT;
--affected rows: 1
--info: Records: 1 Duplicates: 0 Warnings: 0
-+affected rows: 0
-+info: Records: 0 Duplicates: 0 Warnings: 0
- DROP TABLE t1;
affected rows: 0
- CREATE TABLE t1(f1 INT PRIMARY KEY, f2 INT NOT NULL,
+ info: Records: 0 Duplicates: 0 Warnings: 0
@@ -56,22 +48,22 @@
FOREIGN KEY fidx(f1) REFERENCES t1(f1))ENGINE=INNODB;
INSERT INTO t1(f1, f2, f4, f5) VALUES(1, 2, 3, 4);
diff --git a/mysql-test/suite/innodb/r/alter_algorithm.result b/mysql-test/suite/innodb/r/alter_algorithm.result
index 717d31de..8d85aeb1 100644
--- a/mysql-test/suite/innodb/r/alter_algorithm.result
+++ b/mysql-test/suite/innodb/r/alter_algorithm.result
@@ -42,8 +42,8 @@ ALTER TABLE t1 ENGINE=INNODB;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
ALTER TABLE t1 FORCE, ALGORITHM=DEFAULT;
-affected rows: 1
-info: Records: 1 Duplicates: 0 Warnings: 0
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
DROP TABLE t1;
affected rows: 0
CREATE TABLE t1(f1 INT PRIMARY KEY, f2 INT NOT NULL,
diff --git a/mysql-test/suite/innodb/r/alter_kill.result b/mysql-test/suite/innodb/r/alter_kill.result
index 209a711d..af23efe9 100644
--- a/mysql-test/suite/innodb/r/alter_kill.result
+++ b/mysql-test/suite/innodb/r/alter_kill.result
@@ -1,7 +1,10 @@
+SELECT @@innodb_doublewrite;
+@@innodb_doublewrite
+OFF
+SET GLOBAL innodb_doublewrite=fast;
#
# Bug#16720368 INNODB CRASHES ON BROKEN #SQL*.IBD FILE AT STARTUP
#
-SET GLOBAL innodb_file_per_table=1;
SET GLOBAL innodb_stats_persistent=0;
CREATE TABLE bug16720368_1 (a INT PRIMARY KEY) ENGINE=InnoDB;
connect con1,localhost,root;
@@ -13,7 +16,10 @@ connection default;
disconnect con1;
# Corrupt FIL_PAGE_TYPE in bug16720368.ibd,
# and recompute innodb_checksum_algorithm=crc32
-# restart
+# restart: --innodb-flush-method=O_DIRECT
+SELECT @@innodb_doublewrite;
+@@innodb_doublewrite
+OFF
SELECT COUNT(*) FROM bug16720368;
ERROR HY000: Table `test`.`bug16720368` is corrupted. Please drop the table and recreate.
INSERT INTO bug16720368 VALUES(1);
@@ -30,7 +36,6 @@ DROP TABLE bug16720368, bug16720368_1;
# Bug#16735660 ASSERT TABLE2 == NULL, ROLLBACK OF RESURRECTED TXNS,
# DICT_TABLE_ADD_TO_CACHE
#
-SET GLOBAL innodb_file_per_table=1;
CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
BEGIN;
INSERT INTO t1 VALUES(42);
diff --git a/mysql-test/suite/innodb/r/alter_missing_tablespace.result b/mysql-test/suite/innodb/r/alter_missing_tablespace.result
index 3d071584..65b01d89 100644
--- a/mysql-test/suite/innodb/r/alter_missing_tablespace.result
+++ b/mysql-test/suite/innodb/r/alter_missing_tablespace.result
@@ -2,7 +2,6 @@
# Bug#13955083 ALLOW IN-PLACE DDL OPERATIONS ON MISSING
# OR DISCARDED TABLESPACES
#
-SET GLOBAL innodb_file_per_table=1;
CREATE TABLE t(a SERIAL)ENGINE=InnoDB;
CREATE TABLE `x..d` (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
CREATE TABLE t1(a SERIAL)ENGINE=InnoDB;
diff --git a/mysql-test/suite/innodb/r/alter_rename_existing.result b/mysql-test/suite/innodb/r/alter_rename_existing.result
index 1fdc2011..e4fee341 100644
--- a/mysql-test/suite/innodb/r/alter_rename_existing.result
+++ b/mysql-test/suite/innodb/r/alter_rename_existing.result
@@ -36,6 +36,8 @@ ERROR HY000: Error on rename of 'OLD_FILE_NAME' to 'NEW_FILE_NAME' (errno: 184 "
# Create another t1, but in the system tablespace.
#
SET GLOBAL innodb_file_per_table=OFF;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
CREATE TABLE t1 (a SERIAL, b CHAR(20)) ENGINE=InnoDB;
INSERT INTO t1(b) VALUES('one'), ('two'), ('three');
SHOW CREATE TABLE t1;
@@ -58,6 +60,8 @@ ALTER TABLE t1 ADD COLUMN d INT, ALGORITHM=COPY;
# while a blocking t1.ibd file exists.
#
SET GLOBAL innodb_file_per_table=ON;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
ALTER TABLE t1 FORCE, ALGORITHM=INPLACE;
ERROR HY000: Tablespace for table 'test/#sql-ib' exists. Please DISCARD the tablespace before IMPORT
ALTER TABLE t1 FORCE, ALGORITHM=COPY;
@@ -93,3 +97,5 @@ a b
2 two
3 three
DROP TABLE t1;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
diff --git a/mysql-test/suite/innodb/r/alter_table.result b/mysql-test/suite/innodb/r/alter_table.result
index 192584bc..a0778014 100644
--- a/mysql-test/suite/innodb/r/alter_table.result
+++ b/mysql-test/suite/innodb/r/alter_table.result
@@ -121,10 +121,16 @@ ERROR 42000: Incorrect column specifier for column 'c'
#
SET @save_file_per_table=@@GLOBAL.innodb_file_per_table;
SET GLOBAL innodb_file_per_table=0;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
CREATE TABLE t (c INT PRIMARY KEY) ENGINE=INNODB;
SET GLOBAL innodb_file_per_table=1;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
ALTER TABLE t page_compressed=1;
SET GLOBAL innodb_file_per_table=@save_file_per_table;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
SELECT space>0 FROM information_schema.innodb_sys_tables WHERE name='test/t';
space>0
1
diff --git a/mysql-test/suite/innodb/r/autoinc_persist.result b/mysql-test/suite/innodb/r/autoinc_persist.result
index 9e5cd4ad..f3e466a8 100644
--- a/mysql-test/suite/innodb/r/autoinc_persist.result
+++ b/mysql-test/suite/innodb/r/autoinc_persist.result
@@ -626,7 +626,7 @@ CREATE TABLE mdev6076a (b INT) ENGINE=InnoDB;
INSERT INTO mdev6076a VALUES(2),(1);
CREATE TABLE mdev6076b (b INT) ENGINE=InnoDB;
INSERT INTO mdev6076b VALUES(2),(1);
-ALTER TABLE mdev6076a ADD COLUMN a SERIAL FIRST, LOCK=NONE;
+ALTER TABLE mdev6076a ADD COLUMN a SERIAL FIRST, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Adding an auto-increment column requires a lock. Try LOCK=SHARED
ALTER TABLE mdev6076a ADD COLUMN a SERIAL FIRST, ALGORITHM=INPLACE;
ALTER TABLE mdev6076b ADD COLUMN a SERIAL FIRST, AUTO_INCREMENT=100,
diff --git a/mysql-test/suite/innodb/r/data_types.result b/mysql-test/suite/innodb/r/data_types.result
index 146f9bb0..695059bf 100644
--- a/mysql-test/suite/innodb/r/data_types.result
+++ b/mysql-test/suite/innodb/r/data_types.result
@@ -82,7 +82,7 @@ t1_VARCHAR_0 VARCHAR(0),
t1_VARMYSQL_0 VARCHAR(0) CHARACTER SET utf8
) ENGINE=InnoDB;
Warnings:
-Note 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
+Warning 1287 'YEAR(2)' is deprecated and will be removed in a future release. Please use YEAR(4) instead
INSERT INTO t1 () VALUES ();
SELECT
name,
diff --git a/mysql-test/suite/innodb/r/defrag_mdl-9155.result b/mysql-test/suite/innodb/r/defrag_mdl-9155.result
deleted file mode 100644
index 18b71f42..00000000
--- a/mysql-test/suite/innodb/r/defrag_mdl-9155.result
+++ /dev/null
@@ -1,18 +0,0 @@
-set global innodb_defragment=1;
-create table t1 (a int not null primary key auto_increment, b varchar(256), key second(a, b)) engine=innodb;
-insert t1 select null, repeat('a', 256) from seq_1_to_100;
-select count(*) from t1;
-count(*)
-100
-connect con1,localhost,root;
-start transaction;
-select count(*) from t1;
-count(*)
-100
-connection default;
-optimize table t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-connection con1;
-drop table t1;
-set global innodb_defragment=default;
diff --git a/mysql-test/suite/innodb/r/dropdb_cs.result b/mysql-test/suite/innodb/r/dropdb_cs.result
index 59f02c74..3837bf9e 100644
--- a/mysql-test/suite/innodb/r/dropdb_cs.result
+++ b/mysql-test/suite/innodb/r/dropdb_cs.result
@@ -3,6 +3,8 @@
#
SET @save_fpt=@@GLOBAL.innodb_file_per_table;
SET GLOBAL innodb_file_per_table=0;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
CREATE DATABASE Db;
CREATE TABLE Db.t1 (c1 INT KEY) ENGINE=InnoDB;
CREATE DATABASE DB;
@@ -14,3 +16,5 @@ DROP DATABASE Db;
SELECT * FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE NAME LIKE 'D%';
TABLE_ID NAME FLAG N_COLS SPACE ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE
SET GLOBAL innodb_file_per_table=@save_fpt;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
diff --git a/mysql-test/suite/innodb/r/gap_locks.result b/mysql-test/suite/innodb/r/gap_locks.result
index cd60b1fa..d98b7198 100644
--- a/mysql-test/suite/innodb/r/gap_locks.result
+++ b/mysql-test/suite/innodb/r/gap_locks.result
@@ -1,6 +1,6 @@
CREATE TABLE t1(a INT PRIMARY KEY, b VARCHAR(40), c INT, INDEX(b,c))
ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1,'1',1),(2,'2',1);
+INSERT INTO t1 VALUES (1,'1',1),(2,'2',1),(3,'3',1);
SET @save_locks= @@GLOBAL.innodb_status_output_locks;
SET GLOBAL INNODB_STATUS_OUTPUT_LOCKS = 'ON';
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
diff --git a/mysql-test/suite/innodb/r/ibuf_delete.result b/mysql-test/suite/innodb/r/ibuf_delete.result
deleted file mode 100644
index 7423d3cf..00000000
--- a/mysql-test/suite/innodb/r/ibuf_delete.result
+++ /dev/null
@@ -1,53 +0,0 @@
-SET @buffering= @@innodb_change_buffering;
-SET GLOBAL innodb_change_buffering= deletes;
-Warnings:
-Warning 1287 '@@innodb_change_buffering' is deprecated and will be removed in a future release
-SET @flush= @@innodb_flush_log_at_trx_commit;
-SET GLOBAL innodb_flush_log_at_trx_commit= 0;
-CREATE TABLE t1 (
-a varchar(1024),
-b varchar(1024),
-c varchar(1024),
-d varchar(1024),
-e varchar(1024),
-f varchar(1024),
-g varchar(1024),
-h varchar(1024),
-key (a),
-key (b),
-key (c),
-key (d)
-) ENGINE=InnoDB;
-INSERT INTO t1
-SELECT REPEAT('x',10), REPEAT('x',13), REPEAT('x',427), REPEAT('x',244),
-REPEAT('x',9), REPEAT('x',112), REPEAT('x',814), REPEAT('x',633)
-FROM seq_1_to_1024;
-CREATE TEMPORARY TABLE t2 (
-a varchar(1024),
-b varchar(1024),
-c varchar(1024),
-d varchar(1024),
-e varchar(1024),
-f varchar(1024),
-g varchar(1024),
-h varchar(1024),
-i varchar(1024),
-j varchar(1024),
-k varchar(1024),
-l varchar(1024),
-m varchar(1024),
-key (a),
-key (b),
-key (c),
-key (d),
-key (e),
-key (f)
-) ENGINE=InnoDB;
-SET @x=REPEAT('x',512);
-INSERT INTO t2 SELECT @x, @x, @x, @x, @x, @x, @x, @x, @x, @x, @x, @x, @x
-FROM seq_1_to_768;
-DROP TABLE t1, t2;
-SET GLOBAL innodb_change_buffering= @buffering;
-Warnings:
-Warning 1287 '@@innodb_change_buffering' is deprecated and will be removed in a future release
-SET GLOBAL innodb_flush_log_at_trx_commit= @flush;
diff --git a/mysql-test/suite/innodb/r/ibuf_not_empty.result b/mysql-test/suite/innodb/r/ibuf_not_empty.result
deleted file mode 100644
index 81ca907b..00000000
--- a/mysql-test/suite/innodb/r/ibuf_not_empty.result
+++ /dev/null
@@ -1,21 +0,0 @@
-CREATE TABLE t1(
-a INT AUTO_INCREMENT PRIMARY KEY,
-b CHAR(1),
-c INT,
-INDEX(b))
-ENGINE=InnoDB STATS_PERSISTENT=0;
-SET GLOBAL innodb_change_buffering_debug = 1;
-SET GLOBAL innodb_change_buffering=all;
-Warnings:
-Warning 1287 '@@innodb_change_buffering' is deprecated and will be removed in a future release
-INSERT INTO t1 SELECT 0,'x',1 FROM seq_1_to_1024;
-# restart: --innodb-force-recovery=6 --innodb-change-buffer-dump
-check table t1;
-Table Op Msg_type Msg_text
-test.t1 check Warning InnoDB: Index 'b' contains 990 entries, should be 1024.
-test.t1 check error Corrupt
-SET GLOBAL innodb_buf_flush_list_now=ON;
-# restart: --innodb-force_recovery=0
-SET GLOBAL innodb_fast_shutdown=0;
-# restart: --innodb-force_recovery=0
-DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/import.result b/mysql-test/suite/innodb/r/import.result
new file mode 100644
index 00000000..d1ed0945
--- /dev/null
+++ b/mysql-test/suite/innodb/r/import.result
@@ -0,0 +1,18 @@
+#
+# MDEV-26137 ALTER TABLE IMPORT enhancement
+#
+CREATE TABLE t1(a INT PRIMARY KEY DEFAULT 42) CREATE_OPTIONS;
+INSERT INTO t1() VALUES();
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+ALTER TABLE t2 IMPORT TABLESPACE;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) NOT NULL DEFAULT 42,
+ PRIMARY KEY (`a`)
+) CREATE_OPTIONS
+SELECT * FROM t2;
+a
+42
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/innodb/r/import_no_cfg.result b/mysql-test/suite/innodb/r/import_no_cfg.result
new file mode 100644
index 00000000..13570db2
--- /dev/null
+++ b/mysql-test/suite/innodb/r/import_no_cfg.result
@@ -0,0 +1,21 @@
+#
+# MDEV-26137 ALTER TABLE IMPORT enhancement
+#
+CREATE TABLE t1(a INT PRIMARY KEY DEFAULT 42) CREATE_OPTIONS;
+INSERT INTO t1() VALUES();
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+ALTER TABLE t2 IMPORT TABLESPACE;
+Warnings:
+Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t2.cfg', will attempt to import without schema verification
+Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t2.cfg', will attempt to import without schema verification
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) NOT NULL DEFAULT 42,
+ PRIMARY KEY (`a`)
+) CREATE_OPTIONS
+SELECT * FROM t2;
+a
+42
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/innodb/r/import_recovery.result b/mysql-test/suite/innodb/r/import_recovery.result
new file mode 100644
index 00000000..5b391ba6
--- /dev/null
+++ b/mysql-test/suite/innodb/r/import_recovery.result
@@ -0,0 +1,80 @@
+#
+# MDEV-26137 ALTER TABLE IMPORT enhancement
+#
+call mtr.add_suppression('InnoDB: Tablespace for table `test`.`t1` is set as discarded.');
+call mtr.add_suppression('InnoDB: Tablespace for table `test`.`t2` is set as discarded.');
+call mtr.add_suppression('InnoDB: Tablespace for table `test`.`t3` is set as discarded.');
+call mtr.add_suppression('InnoDB: ./test/t3.ibd: Page 0 at offset 0 looks corrupted.');
+call mtr.add_suppression("mariadbd.*: Index for table 't3' is corrupt; try to repair it");
+call mtr.add_suppression("InnoDB: Expected tablespace id \\d+ but found \\d+ in the file ./test/t3.ibd");
+call mtr.add_suppression("InnoDB: Corrupted page \\[page id: space=.*, page number=0\\] of datafile './test/t3.ibd' could not be found in the doublewrite buffer.");
+call mtr.add_suppression('InnoDB: Tablespace for table `test`.`t4` is set as discarded.');
+call mtr.add_suppression('InnoDB: ./test/t4.ibd: Page 0 at offset 0 looks corrupted.');
+call mtr.add_suppression("mariadbd.*: Index for table 't4' is corrupt; try to repair it");
+call mtr.add_suppression("InnoDB: Corrupted page \\[page id: space=.*, page number=0\\] of datafile './test/t4.ibd' could not be found in the doublewrite buffer.");
+# Recovery from crashes
+## t1: Creation of stub succeeds; server crashes; second import attempt succeeds
+## t2: Creation of stub succeeds; server crashes; drop table
+## t3: Creation of stub succeeds; server crashes; ibd corrupted; second import attempt fails; drop table
+## t4: Did not copy .cfg; creation of stub succeeds; server crashes; ibd corrupted; second import attempt fails; drop table
+CREATE TABLE t (a int) ENGINE=InnoDB;
+INSERT INTO t VALUES(42);
+FLUSH TABLES t FOR EXPORT;
+UNLOCK TABLES;
+SET GLOBAL innodb_max_dirty_pages_pct_lwm=0.0;
+SET GLOBAL innodb_max_dirty_pages_pct=0.0;
+connect hang1,localhost,root;
+SET DEBUG_SYNC='ib_after_create_stub_for_import SIGNAL hung WAIT_FOR ever';
+ALTER TABLE t1 IMPORT TABLESPACE;
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR hung';
+connect hang2,localhost,root;
+SET DEBUG_SYNC='ib_after_create_stub_for_import SIGNAL hung WAIT_FOR ever';
+ALTER TABLE t2 IMPORT TABLESPACE;
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR hung';
+connect hang3,localhost,root;
+SET DEBUG_SYNC='ib_after_create_stub_for_import SIGNAL hung WAIT_FOR ever';
+ALTER TABLE t3 IMPORT TABLESPACE;
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR hung';
+connect hang4,localhost,root;
+SET DEBUG_SYNC='ib_after_create_stub_for_import SIGNAL hung WAIT_FOR ever';
+ALTER TABLE t4 IMPORT TABLESPACE;
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR hung';
+# corrupting the 0th page
+# Restart mysqld after the crash and reconnect.
+# restart
+ALTER TABLE t1 IMPORT TABLESPACE;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t1;
+a
+42
+ALTER TABLE t3 IMPORT TABLESPACE;
+ERROR HY000: Internal error: Error importing tablespace for table `test`.`t3` : Data structure corruption
+ALTER TABLE t4 IMPORT TABLESPACE;
+ERROR HY000: Schema mismatch (Expected FSP_SPACE_FLAGS=0x15, .ibd file contains 0x1010115.)
+DROP TABLE t, t1, t2, t3, t4;
+# Recovery from corruption only, no server restart
+## t5: Recovery from corruption, with cfg
+## t6: Recovery from corruption, without cfg
+call mtr.add_suppression('InnoDB: ./test/t5.ibd: Page 0 at offset 0 looks corrupted.');
+call mtr.add_suppression("mariadbd.*: Index for table 't5' is corrupt; try to repair it");
+call mtr.add_suppression("InnoDB: Corrupted page \\[page id: space=.*, page number=0\\] of datafile './test/t5.ibd' could not be found in the doublewrite buffer.");
+call mtr.add_suppression("InnoDB: Corrupted page \\[page id: space=.*, page number=0\\] of datafile './test/t6.ibd' could not be found in the doublewrite buffer.");
+call mtr.add_suppression("mariadbd.*: Index for table 't6' is corrupt; try to repair it");
+CREATE TABLE t (a int) ENGINE=InnoDB;
+INSERT INTO t VALUES(42);
+FLUSH TABLES t FOR EXPORT;
+UNLOCK TABLES;
+# corrupting the 0th page
+ALTER TABLE t5 IMPORT TABLESPACE;
+ERROR HY000: Internal error: Error importing tablespace for table `test`.`t5` : Data structure corruption
+ALTER TABLE t6 IMPORT TABLESPACE;
+ERROR HY000: Schema mismatch (Expected FSP_SPACE_FLAGS=0x15, .ibd file contains 0x1010115.)
+DROP TABLE t, t5, t6;
diff --git a/mysql-test/suite/innodb/r/import_run_once.result b/mysql-test/suite/innodb/r/import_run_once.result
new file mode 100644
index 00000000..e49340b8
--- /dev/null
+++ b/mysql-test/suite/innodb/r/import_run_once.result
@@ -0,0 +1,104 @@
+#
+# MDEV-26137 ALTER TABLE IMPORT enhancement
+#
+# drop t1 before importing t2
+CREATE TABLE t1 (a int) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(42);
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+DROP TABLE t1;
+ALTER TABLE t2 IMPORT TABLESPACE;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+a
+42
+DROP TABLE t2;
+# created t2 but did not discard tablespace
+CREATE TABLE t1 (a int) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(42);
+CREATE TABLE t2 LIKE t1;
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+DROP TABLE t1;
+call mtr.add_suppression("InnoDB: Unable to import tablespace");
+ALTER TABLE t2 IMPORT TABLESPACE;
+ERROR HY000: Tablespace for table 'test/t2' exists. Please DISCARD the tablespace before IMPORT
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+a
+DROP TABLE t2;
+# attempt to import when there's no tablespace
+ALTER TABLE t2 IMPORT TABLESPACE;
+ERROR 42S02: Table 'test.t2' doesn't exist
+# with index
+CREATE TABLE t1 (a int, b varchar(50)) ENGINE=InnoDB;
+CREATE UNIQUE INDEX ai ON t1 (a);
+INSERT INTO t1 VALUES(42, "hello");
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+ALTER TABLE t2 IMPORT TABLESPACE;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(50) DEFAULT NULL,
+ UNIQUE KEY `ai` (`a`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+a b
+42 hello
+SHOW INDEX FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
+t1 0 ai 1 a A 1 NULL NULL YES BTREE NO
+SHOW INDEX FROM t2;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
+t2 0 ai 1 a A 1 NULL NULL YES BTREE NO
+DROP TABLE t1, t2;
+# with virtual column index
+CREATE TABLE t1 (a int, b int as (a * a)) ENGINE=InnoDB;
+CREATE UNIQUE INDEX ai ON t1 (b);
+INSERT INTO t1 VALUES(42, default);
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+ALTER TABLE t2 IMPORT TABLESPACE;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) GENERATED ALWAYS AS (`a` * `a`) VIRTUAL,
+ UNIQUE KEY `ai` (`b`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+SELECT * FROM t2;
+a b
+42 1764
+SELECT b FROM t2 USE INDEX (ai);
+b
+1764
+SHOW INDEX FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
+t1 0 ai 1 b A 1 NULL NULL YES BTREE NO
+SHOW INDEX FROM t2;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
+t2 0 ai 1 b A 1 NULL NULL YES BTREE NO
+CHECK TABLE t2 EXTENDED;
+Table Op Msg_type Msg_text
+test.t2 check status OK
+DROP TABLE t1, t2;
+# with auto_increment
+CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT, i2 INT, i1 INT)ENGINE=INNODB;
+INSERT INTO t1 (i2) SELECT 4 FROM seq_1_to_1024;
+FLUSH TABLE t1 FOR EXPORT;
+UNLOCK TABLES;
+ALTER TABLE t2 IMPORT TABLESPACE;
+CHECK TABLE t2 EXTENDED;
+Table Op Msg_type Msg_text
+test.t2 check status OK
+DROP TABLE t2, t1;
diff --git a/mysql-test/suite/innodb/r/import_update_stats.result b/mysql-test/suite/innodb/r/import_update_stats.result
index ddf78f18..91e6e33e 100644
--- a/mysql-test/suite/innodb/r/import_update_stats.result
+++ b/mysql-test/suite/innodb/r/import_update_stats.result
@@ -1,8 +1,3 @@
-SET @old_innodb_file_per_table = @@innodb_file_per_table;
-SET GLOBAL innodb_file_per_table = 1;
-SELECT @@innodb_file_per_table;
-@@innodb_file_per_table
-1
CREATE TABLE t1 (
col_1 CHAR (255),
col_2 VARCHAR (255)
@@ -14,13 +9,9 @@ Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_par
t1 1 idx1 1 col_1 A 0 NULL NULL YES BTREE NO
t1 1 idx2 1 col_2 A 0 NULL NULL YES BTREE NO
INSERT INTO t1 VALUES ("col1_00001", "col2_00001"), ("col1_00002", "col2_00002");
-SHOW INDEXES FROM t1;
-Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
-t1 1 idx1 1 col_1 A 2 NULL NULL YES BTREE NO
-t1 1 idx2 1 col_2 A 2 NULL NULL YES BTREE NO
+SET STATEMENT use_stat_tables=never FOR
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
-test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
SHOW INDEXES FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
@@ -69,4 +60,3 @@ Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_par
t1 1 idx1 1 col_1 A 2 NULL NULL YES BTREE NO
t1 1 idx2 1 col_2 A 2 NULL NULL YES BTREE NO
DROP TABLE t1;
-SET GLOBAL innodb_file_per_table = @old_innodb_file_per_table;
diff --git a/mysql-test/suite/innodb/r/index_tree_operation.result b/mysql-test/suite/innodb/r/index_tree_operation.result
index 29660962..92565333 100644
--- a/mysql-test/suite/innodb/r/index_tree_operation.result
+++ b/mysql-test/suite/innodb/r/index_tree_operation.result
@@ -2,7 +2,6 @@
# Bug#15923864 (Bug#67718):
# INNODB DRASTICALLY UNDER-FILLS PAGES IN CERTAIN CONDITIONS
#
-SET GLOBAL innodb_file_per_table=ON;
CREATE TABLE t1 (a BIGINT PRIMARY KEY, b VARCHAR(4096)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (0, REPEAT('a', 4096));
INSERT INTO t1 VALUES (1000, REPEAT('a', 4096));
diff --git a/mysql-test/suite/innodb/r/innodb-alter-autoinc.result b/mysql-test/suite/innodb/r/innodb-alter-autoinc.result
index 3186b00a..4aea9d14 100644
--- a/mysql-test/suite/innodb/r/innodb-alter-autoinc.result
+++ b/mysql-test/suite/innodb/r/innodb-alter-autoinc.result
@@ -5,7 +5,7 @@ SET @@sql_mode = 'STRICT_TRANS_TABLES';
ALTER TABLE t1 ADD PRIMARY KEY(a);
SET @@sql_mode = @old_sql_mode;
ALTER TABLE t1 DROP PRIMARY KEY, ADD id INT AUTO_INCREMENT PRIMARY KEY,
-LOCK=NONE;
+ALGORITHM=INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Adding an auto-increment column requires a lock. Try LOCK=SHARED
ALTER TABLE t1 ADD id INT AUTO_INCREMENT;
ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key
@@ -50,7 +50,7 @@ t1 CREATE TABLE `t1` (
KEY `id` (`id`,`a`)
) ENGINE=InnoDB AUTO_INCREMENT=75 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
ALTER TABLE t1 DROP PRIMARY KEY, ADD id INT AUTO_INCREMENT PRIMARY KEY,
-DROP COLUMN id, AUTO_INCREMENT = 42, LOCK=NONE;
+DROP COLUMN id, AUTO_INCREMENT = 42, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Adding an auto-increment column requires a lock. Try LOCK=SHARED
ALTER TABLE t1 DROP PRIMARY KEY, ADD id INT AUTO_INCREMENT PRIMARY KEY,
DROP COLUMN id, AUTO_INCREMENT = 42, ALGORITHM=INPLACE;
diff --git a/mysql-test/suite/innodb/r/innodb-alter-timestamp.result b/mysql-test/suite/innodb/r/innodb-alter-timestamp.result
index 1a68c540..fc26244d 100644
--- a/mysql-test/suite/innodb/r/innodb-alter-timestamp.result
+++ b/mysql-test/suite/innodb/r/innodb-alter-timestamp.result
@@ -86,8 +86,8 @@ ALTER TABLE t1 ADD COLUMN d2 TIMESTAMP DEFAULT '2017-05-08 16:23:45',
LOCK=NONE;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
-ALTER TABLE t1 ADD COLUMN d3 TIMESTAMP DEFAULT d1, LOCK=NONE;
-ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED
+ALTER TABLE t1 ADD COLUMN d3 TIMESTAMP DEFAULT d1, ALGORITHM=INPLACE, LOCK=NONE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
ALTER TABLE t1 ADD COLUMN d3 TIMESTAMP DEFAULT d1, ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
ALTER TABLE t1 ADD COLUMN d3 TIMESTAMP DEFAULT d1;
diff --git a/mysql-test/suite/innodb/r/innodb-alter.result b/mysql-test/suite/innodb/r/innodb-alter.result
index edeebac5..353ad2b3 100644
--- a/mysql-test/suite/innodb/r/innodb-alter.result
+++ b/mysql-test/suite/innodb/r/innodb-alter.result
@@ -438,28 +438,28 @@ tt CREATE TABLE `tt` (
PRIMARY KEY (`pk`),
FULLTEXT KEY `ct` (`ct`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-ALTER TABLE tt ADD COLUMN c CHAR(1) NOT NULL FIRST, LOCK=NONE;
-ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
-ALTER TABLE tt ADD COLUMN c CHAR(1) NOT NULL, LOCK=NONE;
-ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
+ALTER TABLE tt ADD COLUMN c CHAR(1) NOT NULL FIRST, ALGORITHM=INSTANT;
+ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE
+ALTER TABLE tt ADD COLUMN c CHAR(1) NOT NULL, ALGORITHM=INSTANT;
+ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE
CREATE TABLE tu (
pk INT PRIMARY KEY, FTS_DOC_ID BIGINT UNSIGNED NOT NULL, t TEXT,
FULLTEXT INDEX(t)
) ENGINE=InnoDB;
-ALTER TABLE tu ADD COLUMN c CHAR(1) NOT NULL FIRST, LOCK=NONE;
-ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
-ALTER TABLE tu ADD COLUMN c CHAR(1) NOT NULL, LOCK=NONE;
-ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
+ALTER TABLE tu ADD COLUMN c CHAR(1) NOT NULL FIRST, ALGORITHM=INSTANT;
+ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE
+ALTER TABLE tu ADD COLUMN c CHAR(1) NOT NULL, ALGORITHM=INSTANT;
+ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE
DROP TABLE tu;
CREATE TABLE tv (
pk INT PRIMARY KEY, FTS_DOC_ID BIGINT UNSIGNED NOT NULL, t TEXT,
UNIQUE INDEX FTS_DOC_ID_INDEX(FTS_DOC_ID),
FULLTEXT INDEX(t)
) ENGINE=InnoDB;
-ALTER TABLE tv ADD COLUMN c CHAR(1) NOT NULL FIRST, LOCK=NONE;
-ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
-ALTER TABLE tv ADD COLUMN c CHAR(1) NOT NULL, LOCK=NONE;
-ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
+ALTER TABLE tv ADD COLUMN c CHAR(1) NOT NULL FIRST, ALGORITHM=INSTANT;
+ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE
+ALTER TABLE tv ADD COLUMN c CHAR(1) NOT NULL, ALGORITHM=INSTANT;
+ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE
DROP TABLE tv;
ALTER TABLE t1o CHANGE c1 dB_row_Id INT, ALGORITHM=COPY;
ERROR 42000: Incorrect column name 'dB_row_Id'
diff --git a/mysql-test/suite/innodb/r/innodb-blob.result b/mysql-test/suite/innodb/r/innodb-blob.result
index 0be1ca5b..634a3ee9 100644
--- a/mysql-test/suite/innodb/r/innodb-blob.result
+++ b/mysql-test/suite/innodb/r/innodb-blob.result
@@ -19,7 +19,7 @@ a RIGHT(b,20)
1 aaaaaaaaaaaaaaaaaaaa
2 bbbbbbbbbbbbbbbbbbbb
connection default;
-SET DEBUG='+d,row_ins_extern_checkpoint';
+SET DEBUG_DBUG='+d,row_ins_extern_checkpoint';
SET DEBUG_SYNC='before_row_ins_extern_latch SIGNAL rec_not_blob WAIT_FOR crash';
ROLLBACK;
BEGIN;
@@ -27,8 +27,8 @@ INSERT INTO t1 VALUES (3,REPEAT('c',50000));
connection con1;
SET DEBUG_SYNC='now WAIT_FOR rec_not_blob';
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-SELECT @@tx_isolation;
-@@tx_isolation
+SELECT @@transaction_isolation;
+@@transaction_isolation
READ-UNCOMMITTED
SELECT a, RIGHT(b,20) FROM t1;
a RIGHT(b,20)
@@ -58,8 +58,8 @@ UPDATE t3 SET c=REPEAT('f',3000) WHERE a=1;
connect con1,localhost,root,,;
SET DEBUG_SYNC='now WAIT_FOR go_sel';
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-SELECT @@tx_isolation;
-@@tx_isolation
+SELECT @@transaction_isolation;
+@@transaction_isolation
READ-UNCOMMITTED
SELECT a, RIGHT(b,20), RIGHT(c,20) FROM t3;
a RIGHT(b,20) RIGHT(c,20)
@@ -85,7 +85,7 @@ connect con2,localhost,root,,;
BEGIN;
INSERT INTO t2 VALUES (347);
connection default;
-SET DEBUG='+d,row_upd_extern_checkpoint';
+SET DEBUG_DBUG='+d,row_upd_extern_checkpoint';
SET DEBUG_SYNC='before_row_upd_extern SIGNAL have_latch WAIT_FOR crash';
UPDATE t3 SET c=REPEAT('i',3000) WHERE a=2;
connection con2;
@@ -121,7 +121,7 @@ connect con2,localhost,root,,;
BEGIN;
INSERT INTO t2 VALUES (33101);
connection default;
-SET DEBUG='+d,row_upd_extern_checkpoint';
+SET DEBUG_DBUG='+d,row_upd_extern_checkpoint';
SET DEBUG_SYNC='after_row_upd_extern SIGNAL have_latch WAIT_FOR crash';
UPDATE t3 SET c=REPEAT('j',3000) WHERE a=2;
connection con2;
diff --git a/mysql-test/suite/innodb/r/innodb-fkcheck.result b/mysql-test/suite/innodb/r/innodb-fkcheck.result
index f86ba505..357d8aa1 100644
--- a/mysql-test/suite/innodb/r/innodb-fkcheck.result
+++ b/mysql-test/suite/innodb/r/innodb-fkcheck.result
@@ -1,6 +1,3 @@
-set global innodb_file_per_table = 1;
-drop table if exists b;
-drop database if exists bug_fk;
create database bug_fk;
use bug_fk;
CREATE TABLE b (
@@ -93,5 +90,5 @@ show warnings;
Level Code Message
b.frm
b.ibd
-drop table if exists b;
-drop database if exists bug_fk;
+drop table b;
+drop database bug_fk;
diff --git a/mysql-test/suite/innodb/r/innodb-index-debug.result b/mysql-test/suite/innodb/r/innodb-index-debug.result
index 7167a80f..d881f140 100644
--- a/mysql-test/suite/innodb/r/innodb-index-debug.result
+++ b/mysql-test/suite/innodb/r/innodb-index-debug.result
@@ -91,7 +91,7 @@ SIGNAL opened WAIT_FOR flushed';
ALTER TABLE t1 FORCE, ADD COLUMN k4 int;
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR opened';
-SET debug = '+d,row_log_tmpfile_fail';
+SET debug_dbug = '+d,row_log_tmpfile_fail';
INSERT INTO t1 select NULL,'aaa','bbb' from t480;
INSERT INTO t1 select NULL,'aaaa','bbbb' from t480;
SET DEBUG_SYNC= 'now SIGNAL flushed';
diff --git a/mysql-test/suite/innodb/r/innodb-index-online.result b/mysql-test/suite/innodb/r/innodb-index-online.result
index 5a287e58..e4951d33 100644
--- a/mysql-test/suite/innodb/r/innodb-index-online.result
+++ b/mysql-test/suite/innodb/r/innodb-index-online.result
@@ -1,8 +1,6 @@
SET GLOBAL innodb_monitor_reset_all=all;
SET GLOBAL innodb_monitor_reset_all=default;
call mtr.add_suppression("InnoDB: Warning: Small buffer pool size");
-SET @global_innodb_file_per_table_orig = @@global.innodb_file_per_table;
-SET GLOBAL innodb_file_per_table = on;
CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT, c3 TEXT)
ENGINE=InnoDB STATS_PERSISTENT=0;
INSERT INTO t1 VALUES (1,1,''), (2,2,''), (3,3,''), (4,4,''), (5,5,'');
@@ -209,7 +207,7 @@ CREATE INDEX c2d ON t1(c2);
SHOW INDEX FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
t1 0 PRIMARY 1 c1 A 80 NULL NULL BTREE NO
-t1 1 c2d 1 c2 A 10 NULL NULL YES BTREE NO
+t1 1 c2d 1 c2 A 5 NULL NULL YES BTREE NO
EXPLAIN SELECT COUNT(*) FROM t1 WHERE c2 > 3;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range c2d c2d 5 NULL 32 Using where; Using index
@@ -544,6 +542,5 @@ Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
SET DEBUG_SYNC = 'RESET';
-SET GLOBAL innodb_file_per_table = @global_innodb_file_per_table_orig;
SET GLOBAL innodb_monitor_enable = default;
SET GLOBAL innodb_monitor_disable = default;
diff --git a/mysql-test/suite/innodb/r/innodb-index.result b/mysql-test/suite/innodb/r/innodb-index.result
index a76837b9..8346b61d 100644
--- a/mysql-test/suite/innodb/r/innodb-index.result
+++ b/mysql-test/suite/innodb/r/innodb-index.result
@@ -853,10 +853,10 @@ test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
explain select * from t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 4 NULL 2 Using index
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2
explain select * from t1 order by a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 4 NULL 2 Using index
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 2
drop table t1;
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET FOREIGN_KEY_CHECKS=0;
@@ -1598,8 +1598,8 @@ create table t1(f1 int not null, f2 int not null,
primary key (f1), unique key(f1, f2))engine=innodb;
insert into t1 values(1,3), (2,2);
alter table t1 drop primary key, lock=none;
-alter table t1 drop index f1, lock=none;
-ERROR 0A000: LOCK=NONE is not supported. Reason: Dropping a primary key is not allowed without also adding a new primary key. Try LOCK=SHARED
+alter table t1 drop index f1, algorithm=inplace, lock=none;
+ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Dropping a primary key is not allowed without also adding a new primary key. Try ALGORITHM=COPY
drop table t1;
#
# BUG#21612714 ALTER TABLE SORTING SKIPPED WHEN CHANGE PK AND DROP
diff --git a/mysql-test/suite/innodb/r/innodb-isolation.result b/mysql-test/suite/innodb/r/innodb-isolation.result
index b6e512cc..8ff2c7f1 100644
--- a/mysql-test/suite/innodb/r/innodb-isolation.result
+++ b/mysql-test/suite/innodb/r/innodb-isolation.result
@@ -971,7 +971,7 @@ id select_type table type possible_keys key key_len ref rows Extra
2 SUBQUERY t1 index NULL k2 5 NULL # Using index
EXPLAIN SELECT COUNT(*) FROM t1 WHERE c1 > (SELECT AVG(c1) FROM t1);
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 range PRIMARY PRIMARY 4 NULL # Using where; Using index
+1 PRIMARY t1 range PRIMARY PRIMARY 4 NULL # Using where
2 SUBQUERY t1 index NULL k2 5 NULL # Using index
#
# Make all indexes in t2 obsolete to the active repeatable read transaction
diff --git a/mysql-test/suite/innodb/r/innodb-lock-inherit-read_commited.result b/mysql-test/suite/innodb/r/innodb-lock-inherit-read_commited.result
index ab0427ca..10995515 100644
--- a/mysql-test/suite/innodb/r/innodb-lock-inherit-read_commited.result
+++ b/mysql-test/suite/innodb/r/innodb-lock-inherit-read_commited.result
@@ -12,8 +12,8 @@ SET GLOBAL innodb_stats_auto_recalc = OFF;
connect purge_control,localhost,root;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection default;
-SET @old_tx_isolation = @@tx_isolation;
-SET GLOBAL tx_isolation = 'READ-COMMITTED';
+SET @old_tx_isolation = @@transaction_isolation;
+SET GLOBAL transaction_isolation = 'READ-COMMITTED';
SET @old_innodb_lock_wait_timeout = @@innodb_lock_wait_timeout;
SET GLOBAL innodb_lock_wait_timeout = 1;
connect con1,localhost,root,,;
@@ -58,7 +58,7 @@ Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
SET GLOBAL innodb_stats_auto_recalc = @old_innodb_stats_auto_recalc;
-SET GLOBAL tx_isolation = @old_tx_isolation;
+SET GLOBAL transaction_isolation = @old_tx_isolation;
SET GLOBAL innodb_lock_wait_timeout = @old_innodb_lock_wait_timeout;
CREATE TABLE t1 (
a INT NOT NULL,
@@ -71,8 +71,8 @@ SET GLOBAL innodb_stats_auto_recalc = OFF;
connect purge_control,localhost,root;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection default;
-SET @old_tx_isolation = @@tx_isolation;
-SET GLOBAL tx_isolation = 'READ-COMMITTED';
+SET @old_tx_isolation = @@transaction_isolation;
+SET GLOBAL transaction_isolation = 'READ-COMMITTED';
SET @old_innodb_lock_wait_timeout = @@innodb_lock_wait_timeout;
SET GLOBAL innodb_lock_wait_timeout = 1;
connect con1,localhost,root,,;
@@ -117,5 +117,5 @@ Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
SET GLOBAL innodb_stats_auto_recalc = @old_innodb_stats_auto_recalc;
-SET GLOBAL tx_isolation = @old_tx_isolation;
+SET GLOBAL transaction_isolation = @old_tx_isolation;
SET GLOBAL innodb_lock_wait_timeout = @old_innodb_lock_wait_timeout;
diff --git a/mysql-test/suite/innodb/r/innodb-online-alter-gis.result b/mysql-test/suite/innodb/r/innodb-online-alter-gis.result
index 6a57be49..59859303 100644
--- a/mysql-test/suite/innodb/r/innodb-online-alter-gis.result
+++ b/mysql-test/suite/innodb/r/innodb-online-alter-gis.result
@@ -23,7 +23,7 @@ t1 CREATE TABLE `t1` (
SPATIAL KEY `c` (`b`),
KEY `d` (`d`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-ALTER ONLINE TABLE t1 ADD PRIMARY KEY(a),DROP INDEX d;
+ALTER ONLINE TABLE t1 ADD PRIMARY KEY(a),DROP INDEX d, ALGORITHM=INPLACE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Do not support online operation on table with GIS index. Try LOCK=SHARED
show warnings;
Level Code Message
diff --git a/mysql-test/suite/innodb/r/innodb-system-table-view.result b/mysql-test/suite/innodb/r/innodb-system-table-view.result
index ac966d3f..ab1d6bc8 100644
--- a/mysql-test/suite/innodb/r/innodb-system-table-view.result
+++ b/mysql-test/suite/innodb/r/innodb-system-table-view.result
@@ -10,7 +10,7 @@ TABLE_ID NAME FLAG N_COLS SPACE ROW_FORMAT ZIP_PAGE_SIZE SPACE_TYPE
11 SYS_FOREIGN 0 7 0 Redundant 0 System
12 SYS_FOREIGN_COLS 0 7 0 Redundant 0 System
13 SYS_VIRTUAL 0 6 0 Redundant 0 System
-16 mysql/transaction_registry 33 8 3 Dynamic 0 Single
+16 mysql/transaction_registry 33 8 6 Dynamic 0 Single
SELECT table_id,pos,mtype,prtype,len,name
FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS
WHERE table_id NOT IN (@table_stats_id, @index_stats_id)
@@ -77,6 +77,9 @@ test/t_dynamic test/t_dynamic 33 5 Dynamic 0
test/t_redundant test/t_redundant 0 5 Redundant 0
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Page_Size Zip_Size Path
+innodb_undo001 DEFAULT DEFAULT MYSQLD_DATADIR//undo001
+innodb_undo002 DEFAULT DEFAULT MYSQLD_DATADIR//undo002
+innodb_undo003 DEFAULT DEFAULT MYSQLD_DATADIR//undo003
test/t_redundant DEFAULT DEFAULT MYSQLD_DATADIR/test/t_redundant.ibd
test/t_compact DEFAULT DEFAULT MYSQLD_DATADIR/test/t_compact.ibd
test/t_compressed DEFAULT 2048 MYSQLD_DATADIR/test/t_compressed.ibd
diff --git a/mysql-test/suite/innodb/r/innodb-table-online.result b/mysql-test/suite/innodb/r/innodb-table-online.result
index 76811ced..6948038a 100644
--- a/mysql-test/suite/innodb/r/innodb-table-online.result
+++ b/mysql-test/suite/innodb/r/innodb-table-online.result
@@ -3,8 +3,6 @@ SET GLOBAL innodb_monitor_reset_all=default;
call mtr.add_suppression("InnoDB: Warning: Small buffer pool size");
call mtr.add_suppression("InnoDB: Error: table 'test/t1'");
call mtr.add_suppression("MariaDB is trying to open a table handle but the .ibd file for");
-SET @global_innodb_file_per_table_orig = @@global.innodb_file_per_table;
-SET GLOBAL innodb_file_per_table = on;
CREATE TABLE t1 (c1 INT PRIMARY KEY, c2 INT NOT NULL, c3 CHAR(255) NOT NULL)
ENGINE = InnoDB;
INSERT INTO t1 VALUES (1,1,''), (2,2,''), (3,3,''), (4,4,''), (5,5,'');
@@ -39,11 +37,11 @@ SET @saved_debug_dbug = @@SESSION.debug_dbug;
SET DEBUG_DBUG = '+d,innodb_OOM_prepare_inplace_alter';
ALTER TABLE t1 ROW_FORMAT=REDUNDANT, ALGORITHM=INPLACE, LOCK=NONE;
ERROR HY000: Out of memory.
-SET SESSION DEBUG = @saved_debug_dbug;
-SET SESSION DEBUG = '+d,innodb_OOM_inplace_alter';
+SET SESSION DEBUG_DBUG = @saved_debug_dbug;
+SET SESSION DEBUG_DBUG = '+d,innodb_OOM_inplace_alter';
ALTER TABLE t1 ROW_FORMAT=REDUNDANT, ALGORITHM=INPLACE, LOCK=NONE;
ERROR HY000: Out of memory.
-SET SESSION DEBUG = @saved_debug_dbug;
+SET SESSION DEBUG_DBUG = @saved_debug_dbug;
ALTER TABLE t1 ROW_FORMAT=REDUNDANT, ALGORITHM=INPLACE, LOCK=NONE;
connection default;
SHOW CREATE TABLE t1;
@@ -492,6 +490,5 @@ test.t1 check status OK
DROP TABLE t1;
SET DEBUG_SYNC=RESET;
disconnect con1;
-SET GLOBAL innodb_file_per_table = @global_innodb_file_per_table_orig;
SET GLOBAL innodb_monitor_enable = default;
SET GLOBAL innodb_monitor_disable = default;
diff --git a/mysql-test/suite/innodb/r/innodb-wl5522-debug.result b/mysql-test/suite/innodb/r/innodb-wl5522-debug.result
index e7af2d94..1c3b10c0 100644
--- a/mysql-test/suite/innodb/r/innodb-wl5522-debug.result
+++ b/mysql-test/suite/innodb/r/innodb-wl5522-debug.result
@@ -12,21 +12,18 @@ call mtr.add_suppression("InnoDB: Cannot save statistics for table `test`\\.`t1`
call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed read of file '.*ibdata1' page");
call mtr.add_suppression("InnoDB: File '.*ibdata1' is corrupted");
FLUSH TABLES;
-SET GLOBAL innodb_file_per_table = 1;
CREATE TABLE t1 (c1 INT) ENGINE = InnoDB;
INSERT INTO t1 VALUES(1),(2),(3);
SET SESSION debug_dbug="+d,ib_discard_before_commit_crash";
ALTER TABLE t1 DISCARD TABLESPACE;
ERROR HY000: Lost connection to server during query
DROP TABLE t1;
-SET GLOBAL innodb_file_per_table = 1;
CREATE TABLE t1 (c1 INT) ENGINE = InnoDB;
INSERT INTO t1 VALUES(1),(2),(3);
SET SESSION debug_dbug="+d,ib_discard_after_commit_crash";
ALTER TABLE t1 DISCARD TABLESPACE;
ERROR HY000: Lost connection to server during query
DROP TABLE t1;
-SET GLOBAL innodb_file_per_table = 1;
CREATE TABLE t1 (c1 INT) ENGINE = Innodb;
INSERT INTO t1 VALUES (1), (2), (3), (4);
FLUSH TABLES t1 FOR EXPORT;
@@ -52,8 +49,6 @@ ERROR HY000: Lost connection to server during query
unlink: t1.ibd
unlink: t1.cfg
DROP TABLE t1;
-SET @file_per_table= @@innodb_file_per_table;
-SET GLOBAL innodb_file_per_table = 1;
CREATE TABLE t1 (c1 INT) ENGINE = Innodb;
ALTER TABLE t1 DISCARD TABLESPACE;
restore: t1 .ibd and .cfg files
@@ -459,11 +454,6 @@ ALTER TABLE t1 IMPORT TABLESPACE;
ERROR HY000: Got error 42 'Tablespace not found' from ./test/t1.ibd
SET SESSION debug_dbug=@saved_debug_dbug;
restore: t1 .ibd and .cfg files
-SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure";
-ALTER TABLE t1 IMPORT TABLESPACE;
-ERROR HY000: Index for table 't1' is corrupt; try to repair it
-SET SESSION debug_dbug=@saved_debug_dbug;
-restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_cluster_root_adjust_failure";
ALTER TABLE t1 IMPORT TABLESPACE;
ERROR HY000: Index for table 't1' is corrupt; try to repair it
@@ -943,4 +933,3 @@ SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE t1;
unlink: t1.ibd
unlink: t1.cfg
-SET GLOBAL INNODB_FILE_PER_TABLE=@file_per_table;
diff --git a/mysql-test/suite/innodb/r/innodb-wl5522.result b/mysql-test/suite/innodb/r/innodb-wl5522.result
index 6baa5df9..2733809e 100644
--- a/mysql-test/suite/innodb/r/innodb-wl5522.result
+++ b/mysql-test/suite/innodb/r/innodb-wl5522.result
@@ -134,7 +134,6 @@ ALTER TABLE t2 IMPORT TABLESPACE;
Warnings:
Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t2.cfg', will attempt to import without schema verification
DROP TABLE t2;
-SET GLOBAL innodb_file_per_table = 1;
SELECT @@innodb_file_per_table;
@@innodb_file_per_table
1
@@ -299,6 +298,8 @@ c1 c2
unlink: t1.cfg
DROP TABLE t1;
SET GLOBAL innodb_file_per_table = 0;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB;
@@ -316,6 +317,8 @@ Warning 1809 Table `test`.`t1` in system tablespace
UNLOCK TABLES;
DROP TABLE t1;
SET GLOBAL innodb_file_per_table = 1;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX idx(c2)) ENGINE=InnoDB;
diff --git a/mysql-test/suite/innodb/r/innodb-wl5980-alter.result b/mysql-test/suite/innodb/r/innodb-wl5980-alter.result
index 4d6ac474..5f729118 100644
--- a/mysql-test/suite/innodb/r/innodb-wl5980-alter.result
+++ b/mysql-test/suite/innodb/r/innodb-wl5980-alter.result
@@ -2,9 +2,7 @@
# This is a copy of innodb-alter.test except using remote tablespaces
# and showing those files.
#
-SET @innodb_file_per_table_orig=@@GLOBAL.innodb_file_per_table;
SET default_storage_engine=InnoDB;
-SET GLOBAL innodb_file_per_table=ON;
SET NAMES utf8mb4;
CREATE TABLE t1 (
c1 INT PRIMARY KEY, c2 INT DEFAULT 1, ct TEXT,
@@ -1385,8 +1383,8 @@ t1c.ibd
t1p.ibd
tt.ibd
ALTER TABLE t1o CHANGE FTS_DOC_ID foo_id BIGINT UNSIGNED NOT NULL,
-LOCK=NONE;
-ERROR 0A000: LOCK=NONE is not supported. Reason: Cannot drop or rename FTS_DOC_ID. Try LOCK=SHARED
+ALGORITHM=INPLACE, LOCK=NONE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot drop or rename FTS_DOC_ID. Try ALGORITHM=COPY
SELECT sc.pos FROM information_schema.innodb_sys_columns sc
INNER JOIN information_schema.innodb_sys_tables st
ON sc.TABLE_ID=st.TABLE_ID
@@ -1589,4 +1587,3 @@ DROP TABLE tt, t1o, sys_tables, sys_indexes, sys_foreign;
### files in MYSQL_DATA_DIR/test
db.opt
### files in MYSQL_TMP_DIR/alt_dir/test
-SET GLOBAL innodb_file_per_table = @innodb_file_per_table_orig;
diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result
index e9f70621..f1cf23d6 100644
--- a/mysql-test/suite/innodb/r/innodb.result
+++ b/mysql-test/suite/innodb/r/innodb.result
@@ -931,7 +931,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL # Using filesort
explain select a from t1 order by a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 4 NULL # Using index
+1 SIMPLE t1 index NULL PRIMARY 4 NULL #
explain select b from t1 order by b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL b 4 NULL # Using index
@@ -1017,8 +1017,8 @@ SET sql_mode = default;
create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=innodb;
BEGIN;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
-SELECT @@tx_isolation,@@global.tx_isolation;
-@@tx_isolation @@global.tx_isolation
+SELECT @@transaction_isolation, @@global.transaction_isolation;
+@@transaction_isolation @@global.transaction_isolation
SERIALIZABLE REPEATABLE-READ
insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David');
select id, code, name from t1 order by id;
@@ -1367,14 +1367,28 @@ PRIMARY KEY (`id`),
KEY `id_version` (`id_version`)
) ENGINE=InnoDB;
INSERT INTO t2 VALUES("3524", "1"),("3525", "1"),("1794", "4"),("102", "5"),("1822", "6"),("3382", "9");
+ANALYZE table t1,t2;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze Warning Engine-independent statistics are not collected for column 'description'
+test.t1 analyze status OK
+test.t2 analyze status Engine-independent statistics collected
+test.t2 analyze status OK
+explain SELECT t2.id, t1.`label` FROM t2 INNER JOIN
+(SELECT t1.id_object as id_object FROM t1 WHERE t1.`label` LIKE '%test%') AS lbl
+ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL id_object NULL NULL NULL 6 Using where
+1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.id_object 1
+1 SIMPLE t1 ref id_object id_object 5 test.t1.id_object 1
SELECT t2.id, t1.`label` FROM t2 INNER JOIN
(SELECT t1.id_object as id_object FROM t1 WHERE t1.`label` LIKE '%test%') AS lbl
ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object);
id label
-3382 Test
102 Le Pekin (Test)
1794 Test de resto
1822 Test 3
+3382 Test
3524 Societe Test
3525 Fournisseur Test
drop table t1,t2;
@@ -1676,7 +1690,7 @@ count(*)
0
explain select count(*) from t1 where x > -16;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index PRIMARY PRIMARY 8 NULL 2 Using where; Using index
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 2 Using where
select count(*) from t1 where x > -16;
count(*)
2
@@ -3129,7 +3143,7 @@ CONNECT c1,localhost,root,,;
CONNECT c2,localhost,root,,;
connection c1;
SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
+SET TRANSACTION_ISOLATION='read-committed';
SET AUTOCOMMIT=0;
DROP TABLE IF EXISTS t1, t2;
Warnings:
@@ -3140,7 +3154,7 @@ SELECT * FROM t2;
a
connection c2;
SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
+SET TRANSACTION_ISOLATION='read-committed';
SET AUTOCOMMIT=0;
INSERT INTO t1 VALUES (1);
COMMIT;
@@ -3154,13 +3168,13 @@ CONNECT c1,localhost,root,,;
CONNECT c2,localhost,root,,;
connection c1;
SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
+SET TRANSACTION_ISOLATION='read-committed';
SET AUTOCOMMIT=0;
SELECT * FROM t2;
a
connection c2;
SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
+SET TRANSACTION_ISOLATION='read-committed';
SET AUTOCOMMIT=0;
INSERT INTO t1 VALUES (2);
COMMIT;
diff --git a/mysql-test/suite/innodb/r/innodb_bug14147491.result b/mysql-test/suite/innodb/r/innodb_bug14147491.result
index 9d2b8e1d..77d53183 100644
--- a/mysql-test/suite/innodb/r/innodb_bug14147491.result
+++ b/mysql-test/suite/innodb/r/innodb_bug14147491.result
@@ -1,7 +1,6 @@
# Ensure that purge will not crash on the table after we corrupt it.
SET GLOBAL innodb_fast_shutdown=0;
# Create and populate the table to be corrupted
-set global innodb_file_per_table=ON;
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
INSERT INTO t1 (b) VALUES ('corrupt me');
INSERT INTO t1 (b) VALUES ('corrupt me');
diff --git a/mysql-test/suite/innodb/r/innodb_bug30423.result b/mysql-test/suite/innodb/r/innodb_bug30423.result
index 78604137..8f66ceda 100644
--- a/mysql-test/suite/innodb/r/innodb_bug30423.result
+++ b/mysql-test/suite/innodb/r/innodb_bug30423.result
@@ -54,7 +54,7 @@ ON orgs.org_id=sa_opportunities.org_id
LEFT JOIN bug30243_2 contacts
ON orgs.org_id=contacts.org_id ;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE orgs index NULL org_id 4 NULL ROWS Using index
+1 SIMPLE orgs ALL NULL NULL NULL NULL ROWS
1 SIMPLE sa_opportunities ref org_id org_id 5 test.orgs.org_id ROWS Using index
1 SIMPLE contacts ref contacts$org_id contacts$org_id 5 test.orgs.org_id ROWS Using index
select @@innodb_stats_method;
@@ -83,7 +83,7 @@ ON orgs.org_id=sa_opportunities.org_id
LEFT JOIN bug30243_2 contacts
ON orgs.org_id=contacts.org_id;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE orgs index NULL org_id 4 NULL ROWS Using index
+1 SIMPLE orgs ALL NULL NULL NULL NULL ROWS
1 SIMPLE sa_opportunities ref org_id org_id 5 test.orgs.org_id ROWS Using index
1 SIMPLE contacts ref contacts$org_id contacts$org_id 5 test.orgs.org_id ROWS Using index
SELECT COUNT(*) FROM table_bug30423 WHERE org_id IS NULL;
diff --git a/mysql-test/suite/innodb/r/innodb_bug30919.result b/mysql-test/suite/innodb/r/innodb_bug30919.result
index 0062df3f..42aa4ff3 100644
--- a/mysql-test/suite/innodb/r/innodb_bug30919.result
+++ b/mysql-test/suite/innodb/r/innodb_bug30919.result
@@ -35,10 +35,6 @@ FROM test.part_tbl; -- debug to show the problem
SET del_count = del_count - 2;
END WHILE;
END|
-Warnings:
-Level Warning
-Code 1287
-Message '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL test.proc_part();
internal_count del_count
999 1000
diff --git a/mysql-test/suite/innodb/r/innodb_bug40360.result b/mysql-test/suite/innodb/r/innodb_bug40360.result
index ef4cf463..46456bde 100644
--- a/mysql-test/suite/innodb/r/innodb_bug40360.result
+++ b/mysql-test/suite/innodb/r/innodb_bug40360.result
@@ -1,4 +1,4 @@
-SET TX_ISOLATION='READ-COMMITTED';
+SET TRANSACTION_ISOLATION='READ-COMMITTED';
CREATE TABLE bug40360 (a INT) engine=innodb;
INSERT INTO bug40360 VALUES (1);
DROP TABLE bug40360;
diff --git a/mysql-test/suite/innodb/r/innodb_bug49164.result b/mysql-test/suite/innodb/r/innodb_bug49164.result
index 857cd285..8cac84b4 100644
--- a/mysql-test/suite/innodb/r/innodb_bug49164.result
+++ b/mysql-test/suite/innodb/r/innodb_bug49164.result
@@ -1,7 +1,7 @@
connect con1,localhost,root,,;
connect con2,localhost,root,,;
connection con1;
-SET tx_isolation = 'READ-COMMITTED';
+SET transaction_isolation = 'READ-COMMITTED';
CREATE TABLE bug49164 (a INT, b BIGINT, c TINYINT, PRIMARY KEY (a, b))
ENGINE=InnoDB;
insert into bug49164 values (1,1,1), (2,2,2), (3,3,3);
@@ -21,7 +21,7 @@ a b c
begin;
update bug49164 set c=7;
connection con2;
-SET tx_isolation = 'READ-COMMITTED';
+SET transaction_isolation = 'READ-COMMITTED';
begin;
select * from bug49164;
a b c
diff --git a/mysql-test/suite/innodb/r/innodb_bug51920.result b/mysql-test/suite/innodb/r/innodb_bug51920.result
index 9bc35174..ddb9e29f 100644
--- a/mysql-test/suite/innodb/r/innodb_bug51920.result
+++ b/mysql-test/suite/innodb/r/innodb_bug51920.result
@@ -11,8 +11,6 @@ connection default;
SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE INFO="UPDATE bug51920 SET i=2"
INTO @thread_id;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
KILL @thread_id;
connection con1;
Got one of the listed errors
diff --git a/mysql-test/suite/innodb/r/innodb_bug53592.result b/mysql-test/suite/innodb/r/innodb_bug53592.result
index 9fea3dea..1d5b0f31 100644
--- a/mysql-test/suite/innodb/r/innodb_bug53592.result
+++ b/mysql-test/suite/innodb/r/innodb_bug53592.result
@@ -1,6 +1,4 @@
-set old_alter_table=0;
-Warnings:
-Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
+set alter_algorithm=0;
create table bug53592(a int) engine=innodb row_format=compact;
alter table bug53592 add column b text charset utf8;
alter table bug53592 add column c blob not null;
@@ -14,9 +12,7 @@ check table bug53592;
Table Op Msg_type Msg_text
test.bug53592 check status OK
drop table bug53592;
-set old_alter_table=1;
-Warnings:
-Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
+set alter_algorithm=1;
create table bug53592(a int) engine=innodb row_format=compact;
alter table bug53592 add column b text charset utf8;
alter table bug53592 add column c blob not null;
diff --git a/mysql-test/suite/innodb/r/innodb_bug53756.result b/mysql-test/suite/innodb/r/innodb_bug53756.result
index daa6113f..100d3715 100644
--- a/mysql-test/suite/innodb/r/innodb_bug53756.result
+++ b/mysql-test/suite/innodb/r/innodb_bug53756.result
@@ -9,8 +9,8 @@ COMMIT;
# Start a transaction in the default connection for isolation.
START TRANSACTION;
-SELECT @@tx_isolation;
-@@tx_isolation
+SELECT @@transaction_isolation;
+@@transaction_isolation
READ-COMMITTED
SELECT * FROM bug_53756;
pk c1
@@ -20,38 +20,38 @@ pk c1
4 44
connect con1,localhost,root,,;
START TRANSACTION;
-SELECT @@tx_isolation;
-@@tx_isolation
+SELECT @@transaction_isolation;
+@@transaction_isolation
READ-COMMITTED
DELETE FROM bug_53756 WHERE pk=1;
connect con2,localhost,root,,;
START TRANSACTION;
-SELECT @@tx_isolation;
-@@tx_isolation
+SELECT @@transaction_isolation;
+@@transaction_isolation
READ-COMMITTED
DELETE FROM bug_53756 WHERE pk=2;
connect con3,localhost,root,,;
START TRANSACTION;
-SELECT @@tx_isolation;
-@@tx_isolation
+SELECT @@transaction_isolation;
+@@transaction_isolation
READ-COMMITTED
UPDATE bug_53756 SET c1=77 WHERE pk=3;
connect con4,localhost,root,,;
START TRANSACTION;
-SELECT @@tx_isolation;
-@@tx_isolation
+SELECT @@transaction_isolation;
+@@transaction_isolation
READ-COMMITTED
UPDATE bug_53756 SET c1=88 WHERE pk=4;
connect con5,localhost,root,,;
START TRANSACTION;
-SELECT @@tx_isolation;
-@@tx_isolation
+SELECT @@transaction_isolation;
+@@transaction_isolation
READ-COMMITTED
INSERT INTO bug_53756 VALUES(5, 55);
connect con6,localhost,root,,;
START TRANSACTION;
-SELECT @@tx_isolation;
-@@tx_isolation
+SELECT @@transaction_isolation;
+@@transaction_isolation
READ-COMMITTED
INSERT INTO bug_53756 VALUES(6, 66);
connection con1;
diff --git a/mysql-test/suite/innodb/r/innodb_bug56947.result b/mysql-test/suite/innodb/r/innodb_bug56947.result
index aa922776..a4ed3bfc 100644
--- a/mysql-test/suite/innodb/r/innodb_bug56947.result
+++ b/mysql-test/suite/innodb/r/innodb_bug56947.result
@@ -1,4 +1,7 @@
-SET GLOBAL innodb_file_per_table=0;
+SET @save_fpt=@@GLOBAL.innodb_file_per_table;
+SET GLOBAL innodb_file_per_table=OFF;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
create table bug56947(a int not null) engine = innodb;
SET @saved_dbug = @@SESSION.debug_dbug;
SET DEBUG_DBUG='+d,ib_rebuild_cannot_rename';
@@ -8,5 +11,7 @@ check table bug56947;
Table Op Msg_type Msg_text
test.bug56947 check status OK
drop table bug56947;
-SET @@global.innodb_file_per_table=DEFAULT;
+SET GLOBAL innodb_file_per_table=@save_fpt;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/innodb/r/innodb_bug57252.result b/mysql-test/suite/innodb/r/innodb_bug57252.result
index 66183c2c..18e47900 100644
--- a/mysql-test/suite/innodb/r/innodb_bug57252.result
+++ b/mysql-test/suite/innodb/r/innodb_bug57252.result
@@ -1,5 +1,5 @@
cardinality
-2
+1
Table Op Msg_type Msg_text
test.bug57252 analyze status Engine-independent statistics collected
test.bug57252 analyze status OK
diff --git a/mysql-test/suite/innodb/r/innodb_bug59733.result b/mysql-test/suite/innodb/r/innodb_bug59733.result
deleted file mode 100644
index c962cdfd..00000000
--- a/mysql-test/suite/innodb/r/innodb_bug59733.result
+++ /dev/null
@@ -1,18 +0,0 @@
-CREATE TABLE bug59733(a INT AUTO_INCREMENT PRIMARY KEY,b CHAR(1))ENGINE=InnoDB;
-INSERT INTO bug59733 VALUES(0,'x');
-INSERT INTO bug59733 SELECT 0,b FROM bug59733;
-INSERT INTO bug59733 SELECT 0,b FROM bug59733;
-INSERT INTO bug59733 SELECT 0,b FROM bug59733;
-INSERT INTO bug59733 SELECT 0,b FROM bug59733;
-INSERT INTO bug59733 SELECT 0,b FROM bug59733;
-INSERT INTO bug59733 SELECT 0,b FROM bug59733;
-INSERT INTO bug59733 SELECT 0,b FROM bug59733;
-INSERT INTO bug59733 SELECT 0,b FROM bug59733;
-INSERT INTO bug59733 SELECT 0,b FROM bug59733;
-INSERT INTO bug59733 SELECT 0,b FROM bug59733;
-INSERT INTO bug59733 SELECT 0,b FROM bug59733;
-CREATE INDEX b ON bug59733 (b);
-DELETE FROM bug59733 WHERE (a%100)=0;
-DROP INDEX b ON bug59733;
-CREATE INDEX b ON bug59733 (b);
-DROP TABLE bug59733;
diff --git a/mysql-test/suite/innodb/r/innodb_bug68148.result b/mysql-test/suite/innodb/r/innodb_bug68148.result
index 25bf7f58..1c79f881 100644
--- a/mysql-test/suite/innodb/r/innodb_bug68148.result
+++ b/mysql-test/suite/innodb/r/innodb_bug68148.result
@@ -1,4 +1,3 @@
-set global innodb_file_per_table=1;
CREATE TABLE ref_table1 (id int(11) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB;
CREATE TABLE ref_table2 (id int(11) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB;
CREATE TABLE `main` (
diff --git a/mysql-test/suite/innodb/r/innodb_bulk_create_index.result b/mysql-test/suite/innodb/r/innodb_bulk_create_index.result
index ec7ce044..060e9008 100644
--- a/mysql-test/suite/innodb/r/innodb_bulk_create_index.result
+++ b/mysql-test/suite/innodb/r/innodb_bulk_create_index.result
@@ -532,7 +532,6 @@ END|
SELECT @@innodb_fill_factor;
@@innodb_fill_factor
100
-SET GLOBAL innodb_file_per_table=1;
CREATE TABLE t1(
class INT,
id INT,
@@ -686,7 +685,6 @@ test.t1 check status OK
SELECT CHAR_LENGTH(b) FROM t1 WHERE a=4975;
CHAR_LENGTH(b)
DROP TABLE t1;
-SET GLOBAL innodb_file_per_table=default;
DROP PROCEDURE populate_t1;
SET GLOBAL innodb_fill_factor=10;
CREATE PROCEDURE populate_t1(load_even INT)
diff --git a/mysql-test/suite/innodb/r/innodb_bulk_create_index_debug.result b/mysql-test/suite/innodb/r/innodb_bulk_create_index_debug.result
index 295a9f1b..debb5d0f 100644
--- a/mysql-test/suite/innodb/r/innodb_bulk_create_index_debug.result
+++ b/mysql-test/suite/innodb/r/innodb_bulk_create_index_debug.result
@@ -407,7 +407,6 @@ SET i = i + 1;
END WHILE;
COMMIT;
END|
-SET GLOBAL innodb_file_per_table=1;
CREATE TABLE t1(
class INT,
id INT,
@@ -421,7 +420,6 @@ affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
RENAME TABLE t1 TO t0;
# Test Blob
-SET GLOBAL innodb_file_per_table=1;
CREATE TABLE t1(
a INT PRIMARY KEY,
b TEXT,
@@ -467,7 +465,6 @@ class id title
SELECT * FROM t1 WHERE title = 'a10010';
class id title
DROP TABLE t1;
-SET GLOBAL innodb_file_per_table=1;
CREATE TABLE t1(
class INT,
id INT,
@@ -501,7 +498,6 @@ SELECT * FROM t1 WHERE title = 'a10010';
class id title
DROP TABLE t1;
# Test Blob
-SET GLOBAL innodb_file_per_table=1;
CREATE TABLE t1(
a INT PRIMARY KEY,
b TEXT,
diff --git a/mysql-test/suite/innodb/r/innodb_bulk_create_index_small.result b/mysql-test/suite/innodb/r/innodb_bulk_create_index_small.result
index b48207d4..bdc40d1a 100644
--- a/mysql-test/suite/innodb/r/innodb_bulk_create_index_small.result
+++ b/mysql-test/suite/innodb/r/innodb_bulk_create_index_small.result
@@ -72,8 +72,6 @@ test.t1 check status OK
SELECT CHAR_LENGTH(b) FROM t1 WHERE a=4975;
CHAR_LENGTH(b)
DROP TABLE t1;
-SET GLOBAL innodb_file_per_table=default;
-SET GLOBAL innodb_file_per_table=1;
CREATE TABLE t1(
class INT,
id INT,
@@ -135,5 +133,4 @@ test.t1 check status OK
SELECT CHAR_LENGTH(b) FROM t1 WHERE a=4975;
CHAR_LENGTH(b)
DROP TABLE t1;
-SET GLOBAL innodb_file_per_table=default;
DROP PROCEDURE populate_t1;
diff --git a/mysql-test/suite/innodb/r/innodb_defrag_binlog.result b/mysql-test/suite/innodb/r/innodb_defrag_binlog.result
deleted file mode 100644
index b97061cc..00000000
--- a/mysql-test/suite/innodb/r/innodb_defrag_binlog.result
+++ /dev/null
@@ -1,31 +0,0 @@
-include/master-slave.inc
-[connection master]
-drop table if exists t1;
-create table t1(a int not null primary key auto_increment, b varchar(256), key second(b)) engine=innodb;
-insert into t1 values (1, REPEAT("a", 256));
-insert into t1 values (2, REPEAT("a", 256));
-optimize table t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-drop table t1;
-include/show_binlog_events.inc
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
-master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # use `test`; create table t1(a int not null primary key auto_increment, b varchar(256), key second(b)) engine=innodb
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Annotate_rows # # insert into t1 values (1, REPEAT("a", 256))
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Gtid # # BEGIN GTID #-#-#
-master-bin.000001 # Annotate_rows # # insert into t1 values (2, REPEAT("a", 256))
-master-bin.000001 # Table_map # # table_id: # (test.t1)
-master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
-master-bin.000001 # Xid # # COMMIT /* XID */
-master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # use `test`; optimize table t1
-master-bin.000001 # Gtid # # GTID #-#-#
-master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
-include/rpl_end.inc
diff --git a/mysql-test/suite/innodb/r/innodb_defrag_concurrent.result b/mysql-test/suite/innodb/r/innodb_defrag_concurrent.result
deleted file mode 100644
index 07c96e76..00000000
--- a/mysql-test/suite/innodb/r/innodb_defrag_concurrent.result
+++ /dev/null
@@ -1,102 +0,0 @@
-SET @n_pages= @@GLOBAL.innodb_defragment_n_pages;
-SET @accuracy= @@GLOBAL.innodb_defragment_stats_accuracy;
-SET @sp= @@GLOBAL.innodb_stats_persistent;
-SET GLOBAL innodb_stats_persistent = 0;
-set global innodb_defragment_stats_accuracy = 80;
-CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
-b VARCHAR(256),
-c INT,
-g GEOMETRY NOT NULL,
-t VARCHAR(256),
-KEY second(a, b),
-KEY third(c),
-SPATIAL gk(g),
-FULLTEXT INDEX fti(t)) ENGINE=INNODB;
-connect con1,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
-connect con2,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
-connect con3,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
-connect con4,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
-connection default;
-SET @@global.innodb_defragment_n_pages = 20;
-CREATE TEMPORARY TABLE tt (a INT, KEY(a)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
-INSERT INTO tt SELECT 0 FROM seq_1_to_180;
-INSERT INTO tt SELECT 5 FROM seq_1_to_160;
-INSERT INTO tt SELECT 1 FROM seq_1_to_1000;
-OPTIMIZE TABLE tt;
-Table Op Msg_type Msg_text
-test.tt optimize note Table does not support optimize, doing recreate + analyze instead
-test.tt optimize status OK
-select count(*) from t1;
-count(*)
-20000
-select count(*) from t1 force index (second);
-count(*)
-20000
-select count(*) from t1 force index (third);
-count(*)
-20000
-select count(*) from t1;
-count(*)
-15800
-select count(*) from t1 force index (second);
-count(*)
-15800
-select count(*) from t1 force index (third);
-count(*)
-15800
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-count(stat_value) > 0
-0
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-count(stat_value) > 0
-1
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-count(stat_value) > 0
-1
-connection con1;
-optimize table t1;;
-connection default;
-INSERT INTO t1 VALUES (400000, REPEAT('A', 256),300000, Point(1,1),'More like a test but different.');;
-connection con2;
-INSERT INTO t1 VALUES (500000, REPEAT('A', 256),400000, Point(1,1),'Totally different text book.');;
-connection con3;
-DELETE FROM t1 where a between 1 and 100;;
-connection con4;
-UPDATE t1 SET c = c + 1 where c between 2000 and 8000;;
-connection con1;
-connection con2;
-connection con3;
-connection con4;
-connection default;
-disconnect con1;
-disconnect con2;
-disconnect con3;
-disconnect con4;
-optimize table t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-check table t1 extended;
-Table Op Msg_type Msg_text
-test.t1 check status OK
-select count(*) from t1;
-count(*)
-15723
-select count(*) from t1 force index (second);
-count(*)
-15723
-select count(*) from t1 force index (third);
-count(*)
-15723
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-count(stat_value) > 0
-1
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-count(stat_value) > 0
-1
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-count(stat_value) > 0
-1
-drop table t1;
-SET GLOBAL innodb_defragment_n_pages = @n_pages;
-SET GLOBAL innodb_defragment_stats_accuracy = @accuracy;
-SET GLOBAL innodb_stats_persistent = @sp;
diff --git a/mysql-test/suite/innodb/r/innodb_defrag_stats.result b/mysql-test/suite/innodb/r/innodb_defrag_stats.result
deleted file mode 100644
index c6fd7006..00000000
--- a/mysql-test/suite/innodb/r/innodb_defrag_stats.result
+++ /dev/null
@@ -1,133 +0,0 @@
-SET GLOBAL innodb_defragment_stats_accuracy = 20;
-DELETE FROM mysql.innodb_index_stats;
-# Create table.
-CREATE TABLE t1 (a INT PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256),
-KEY SECOND(a, b)) ENGINE=INNODB STATS_PERSISTENT=0;
-INSERT INTO t1 SELECT 100*FLOOR(seq/70)+seq%70, REPEAT('A', 256)
-FROM seq_1_to_1024;
-# Not enough page splits to trigger persistent stats write yet.
-SELECT * FROM mysql.innodb_index_stats;
-database_name table_name index_name last_update stat_name stat_value sample_size stat_description
-INSERT INTO t1 SELECT 100*FLOOR(seq/70)+seq%70, REPEAT('A', 256)
-FROM seq_1025_to_1433;
-BEGIN;
-INSERT INTO t1 SELECT 100*20+seq, REPEAT('A', 256)
-FROM seq_70_to_99;
-INSERT INTO t1 SELECT 100*19+seq, REPEAT('A', 256)
-FROM seq_70_to_99;
-INSERT INTO t1 SELECT 100*18+seq, REPEAT('A', 256)
-FROM seq_70_to_99;
-INSERT INTO t1 SELECT 100*17+seq, REPEAT('A', 256)
-FROM seq_70_to_99;
-INSERT INTO t1 SELECT 100*16+seq, REPEAT('A', 256)
-FROM seq_70_to_99;
-INSERT INTO t1 SELECT 100*15+seq, REPEAT('A', 256)
-FROM seq_70_to_99;
-INSERT INTO t1 SELECT 100*14+seq, REPEAT('A', 256)
-FROM seq_70_to_99;
-INSERT INTO t1 SELECT 100*13+seq, REPEAT('A', 256)
-FROM seq_70_to_99;
-INSERT INTO t1 SELECT 100*12+seq, REPEAT('A', 256)
-FROM seq_70_to_99;
-INSERT INTO t1 SELECT 100*11+seq, REPEAT('A', 256)
-FROM seq_70_to_99;
-INSERT INTO t1 SELECT 100*10+seq, REPEAT('A', 256)
-FROM seq_70_to_99;
-INSERT INTO t1 SELECT 100*9+seq, REPEAT('A', 256)
-FROM seq_70_to_99;
-INSERT INTO t1 SELECT 100*8+seq, REPEAT('A', 256)
-FROM seq_70_to_99;
-INSERT INTO t1 SELECT 100*7+seq, REPEAT('A', 256)
-FROM seq_70_to_99;
-INSERT INTO t1 SELECT 100*6+seq, REPEAT('A', 256)
-FROM seq_70_to_99;
-INSERT INTO t1 SELECT 100*5+seq, REPEAT('A', 256)
-FROM seq_70_to_99;
-INSERT INTO t1 SELECT 100*4+seq, REPEAT('A', 256)
-FROM seq_70_to_99;
-INSERT INTO t1 SELECT 100*3+seq, REPEAT('A', 256)
-FROM seq_70_to_99;
-INSERT INTO t1 SELECT 100*2+seq, REPEAT('A', 256)
-FROM seq_70_to_99;
-INSERT INTO t1 SELECT 100*1+seq, REPEAT('A', 256)
-FROM seq_70_to_99;
-ROLLBACK;
-SELECT @@GLOBAL.innodb_force_recovery<2 "have background defragmentation";
-have background defragmentation
-1
-SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
-table_name index_name stat_name
-t1 PRIMARY n_leaf_pages_defrag
-t1 PRIMARY n_leaf_pages_reserved
-t1 PRIMARY n_page_split
-t1 SECOND n_leaf_pages_defrag
-t1 SECOND n_leaf_pages_reserved
-t1 SECOND n_page_split
-optimize table t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
-table_name index_name stat_name
-t1 PRIMARY n_leaf_pages_defrag
-t1 PRIMARY n_leaf_pages_reserved
-t1 PRIMARY n_page_split
-t1 PRIMARY n_pages_freed
-t1 SECOND n_leaf_pages_defrag
-t1 SECOND n_leaf_pages_reserved
-t1 SECOND n_page_split
-t1 SECOND n_pages_freed
-set global innodb_defragment_stats_accuracy = 40;
-INSERT INTO t1 (b) SELECT b from t1;
-SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
-table_name index_name stat_name
-t1 PRIMARY n_leaf_pages_defrag
-t1 PRIMARY n_leaf_pages_reserved
-t1 PRIMARY n_page_split
-t1 PRIMARY n_pages_freed
-t1 SECOND n_leaf_pages_defrag
-t1 SECOND n_leaf_pages_reserved
-t1 SECOND n_page_split
-t1 SECOND n_pages_freed
-INSERT INTO t1 (b) SELECT b from t1;
-SELECT stat_name FROM mysql.innodb_index_stats WHERE table_name='t1';
-stat_name
-n_leaf_pages_defrag
-n_leaf_pages_defrag
-n_leaf_pages_reserved
-n_leaf_pages_reserved
-n_page_split
-n_page_split
-n_pages_freed
-n_pages_freed
-# Table rename should cause stats rename.
-rename table t1 to t2;
-SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
-table_name index_name stat_name
-t2 PRIMARY n_leaf_pages_defrag
-t2 PRIMARY n_leaf_pages_reserved
-t2 PRIMARY n_page_split
-t2 PRIMARY n_pages_freed
-t2 SECOND n_leaf_pages_defrag
-t2 SECOND n_leaf_pages_reserved
-t2 SECOND n_page_split
-t2 SECOND n_pages_freed
-drop index SECOND on t2;
-#
-# MDEV-26636: Statistics must not be written for temporary tables
-#
-SET GLOBAL innodb_defragment_stats_accuracy = 1;
-CREATE TEMPORARY TABLE t (a INT PRIMARY KEY, c CHAR(255) NOT NULL)
-ENGINE=InnoDB;
-INSERT INTO t SELECT seq, '' FROM seq_1_to_100;
-# restart
-SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
-table_name index_name stat_name
-t2 PRIMARY n_leaf_pages_defrag
-t2 PRIMARY n_leaf_pages_reserved
-t2 PRIMARY n_page_split
-t2 PRIMARY n_pages_freed
-# Clean up
-ALTER TABLE t2 STATS_PERSISTENT=1;
-DROP TABLE t2;
-SELECT * FROM mysql.innodb_index_stats;
-database_name table_name index_name last_update stat_name stat_value sample_size stat_description
diff --git a/mysql-test/suite/innodb/r/innodb_defrag_stats_many_tables.result b/mysql-test/suite/innodb/r/innodb_defrag_stats_many_tables.result
deleted file mode 100644
index e668c38e..00000000
--- a/mysql-test/suite/innodb/r/innodb_defrag_stats_many_tables.result
+++ /dev/null
@@ -1,38 +0,0 @@
-DROP TABLE if exists t1;
-SET @start_table_definition_cache = @@global.table_definition_cache;
-SET @@global.table_definition_cache = 400;
-SET @start_flush_log_at_trx_commit = @@global.innodb_flush_log_at_trx_commit;
-SET @@global.innodb_flush_log_at_trx_commit=2;
-SET @start_innodb_defragment_stats_accuracy = @@global.innodb_defragment_stats_accuracy;
-SET @@global.innodb_defragment_stats_accuracy = 80;
-CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), KEY SECOND(a, b)) ENGINE=INNODB;
-INSERT INTO t1 VALUES(1, REPEAT('A', 256));
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-select stat_value > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name = 'n_page_split';
-stat_value > 0
-Create 505 table to overflow the table cache.
-Sleep for a while to make sure t1 is evicted.
-select sleep(15);
-sleep(15)
-0
-Reload t1 to get defrag stats from persistent storage
-INSERT INTO t1 (b) SELECT b from t1;
-make sure the stats thread will wake up and do the write even if there's a race condition between set and reset.
-select sleep(15);
-sleep(15)
-0
-select stat_value > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name = 'n_page_split';
-stat_value > 0
-SET @@global.innodb_defragment_stats_accuracy = @start_innodb_defragment_stats_accuracy;
-SET @@global.table_definition_cache = @start_table_definition_cache;
-DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb_defragment.result b/mysql-test/suite/innodb/r/innodb_defragment.result
deleted file mode 100644
index 533a39ee..00000000
--- a/mysql-test/suite/innodb/r/innodb_defragment.result
+++ /dev/null
@@ -1,133 +0,0 @@
-set global innodb_defragment_stats_accuracy = 80;
-CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), KEY SECOND(a, b)) ENGINE=INNODB;
-optimize table t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-INSERT INTO t1 VALUES (100000, REPEAT('A', 256));
-INSERT INTO t1 VALUES (200000, REPEAT('A', 256));
-INSERT INTO t1 VALUES (300000, REPEAT('A', 256));
-INSERT INTO t1 VALUES (400000, REPEAT('A', 256));
-optimize table t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-create procedure defragment()
-begin
-set @i = 0;
-repeat
-set @i = @i + 1;
-optimize table t1;
-until @i = 3 end repeat;
-end //
-select count(stat_value) from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-count(stat_value)
-0
-select count(stat_value) from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-count(stat_value)
-2
-select count(stat_value) from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-count(stat_value)
-2
-select count(*) from t1;
-count(*)
-10004
-connect con1,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
-connection con1;
-call defragment();
-connection default;
-connection con1;
-connection default;
-disconnect con1;
-optimize table t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# restart
-select count(*) from t1;
-count(*)
-7904
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-count(stat_value) = 0
-0
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-count(stat_value) > 0
-1
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-count(stat_value) > 0
-1
-select count(*) from t1 force index (second);
-count(*)
-7904
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_pages_freed');
-count(stat_value) = 0
-1
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_page_split');
-count(stat_value) = 0
-1
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_leaf_pages_defrag');
-count(stat_value) = 0
-1
-SET @@global.innodb_defragment_n_pages = 3;
-optimize table t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# restart
-select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-count(stat_value) < 3
-1
-select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-count(stat_value) < 3
-1
-select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-count(stat_value) < 3
-1
-select count(*) from t1;
-count(*)
-6904
-select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-count(stat_value) < 3
-1
-select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-count(stat_value) < 3
-1
-select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-count(stat_value) < 3
-1
-select count(*) from t1 force index (second);
-count(*)
-6904
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_pages_freed');
-count(stat_value) = 0
-1
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_page_split');
-count(stat_value) = 0
-1
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_leaf_pages_defrag');
-count(stat_value) = 0
-1
-SET @@global.innodb_defragment_n_pages = 10;
-optimize table t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-# restart
-select count(stat_value) > 1 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-count(stat_value) > 1
-1
-select count(stat_value) > 1 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-count(stat_value) > 1
-1
-select count(stat_value) > 1 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-count(stat_value) > 1
-1
-select count(*) from t1 force index (second);
-count(*)
-6904
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_pages_freed');
-count(stat_value) = 0
-1
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_page_split');
-count(stat_value) = 0
-1
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_leaf_pages_defrag');
-count(stat_value) = 0
-1
-DROP PROCEDURE defragment;
-DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb_defragment_small.result b/mysql-test/suite/innodb/r/innodb_defragment_small.result
deleted file mode 100644
index fcb3bf2e..00000000
--- a/mysql-test/suite/innodb/r/innodb_defragment_small.result
+++ /dev/null
@@ -1,40 +0,0 @@
-SET @innodb_defragment_orig=@@GLOBAL.innodb_defragment;
-SET @innodb_optimize_fulltext_orig=@@GLOBAL.innodb_optimize_fulltext_only;
-SET GLOBAL innodb_defragment = 1;
-SET GLOBAL innodb_optimize_fulltext_only = 0;
-#
-# MDEV-12198 innodb_defragment=1 crashes server on
-# OPTIMIZE TABLE when FULLTEXT index exists
-#
-CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(256),
-KEY(a, b), FULLTEXT KEY(b)) ENGINE=INNODB;
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-INSERT INTO t1 VALUES (100000, REPEAT('A', 256));
-INSERT INTO t1 VALUES (200000, REPEAT('A', 256));
-INSERT INTO t1 VALUES (300000, REPEAT('A', 256));
-INSERT INTO t1 VALUES (400000, REPEAT('A', 256));
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-#
-# MDEV-15824 innodb_defragment=ON trumps
-# innodb_optimize_fulltext_only=ON in OPTIMIZE TABLE
-#
-SET GLOBAL innodb_optimize_fulltext_only = 1;
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-SET GLOBAL innodb_defragment = 0;
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-DROP TABLE t1;
-CREATE TABLE t1 (c POINT PRIMARY KEY, SPATIAL INDEX(c)) ENGINE=InnoDB;
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-DROP TABLE t1;
-SET GLOBAL innodb_defragment = @innodb_defragment_orig;
-SET GLOBAL innodb_optimize_fulltext_only = @innodb_optimize_fulltext_orig;
diff --git a/mysql-test/suite/innodb/r/innodb_lock_wait_timeout_1.result b/mysql-test/suite/innodb/r/innodb_lock_wait_timeout_1.result
index 797c30d7..52b85cf6 100644
--- a/mysql-test/suite/innodb/r/innodb_lock_wait_timeout_1.result
+++ b/mysql-test/suite/innodb/r/innodb_lock_wait_timeout_1.result
@@ -87,9 +87,9 @@ drop table t1, t2;
# handler::unlock_row() in InnoDB does nothing.
# Thus in order to reproduce the condition that led to the
# warning, one needs to relax isolation by either
-# setting a weaker tx_isolation value, or by turning on
+# setting a weaker transaction_isolation value, or by turning on
# the unsafe replication switch.
-set @@session.tx_isolation="read-committed";
+set @@session.transaction_isolation="read-committed";
# Prepare data. We need a table with a unique index,
# for join_read_key to be used. The other column
# allows to control what passes WHERE clause filter.
@@ -354,7 +354,7 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
connection default;
commit;
disconnect con1;
-set @@session.tx_isolation=default;
+set @@session.transaction_isolation=default;
drop table t1;
#
# End of 5.1 tests
diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result
index 9d8ead7a..99e42e67 100644
--- a/mysql-test/suite/innodb/r/innodb_mysql.result
+++ b/mysql-test/suite/innodb/r/innodb_mysql.result
@@ -191,8 +191,8 @@ min(7)
7
explain select min(7) from t2i join t1i;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1i ALL NULL NULL NULL NULL 0
-1 SIMPLE t2i ALL NULL NULL NULL NULL 1 Using join buffer (flat, BNL join)
+1 SIMPLE t2i ALL NULL NULL NULL NULL 1
+1 SIMPLE t1i ALL NULL NULL NULL NULL 1 Using join buffer (flat, BNL join)
select min(7) from t2i join t1i;
min(7)
NULL
@@ -207,8 +207,8 @@ max(7)
7
explain select max(7) from t2i join t1i;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1i ALL NULL NULL NULL NULL 0
-1 SIMPLE t2i ALL NULL NULL NULL NULL 1 Using join buffer (flat, BNL join)
+1 SIMPLE t2i ALL NULL NULL NULL NULL 1
+1 SIMPLE t1i ALL NULL NULL NULL NULL 1 Using join buffer (flat, BNL join)
select max(7) from t2i join t1i;
max(7)
NULL
@@ -239,7 +239,7 @@ select 1, max(1) from t1i where 1=99;
explain select count(*), min(7), max(7) from t1m, t1i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1m system NULL NULL NULL NULL 0 Const row not found
-1 SIMPLE t1i ALL NULL NULL NULL NULL 0
+1 SIMPLE t1i ALL NULL NULL NULL NULL 1
select count(*), min(7), max(7) from t1m, t1i;
count(*) min(7) max(7)
0 NULL NULL
@@ -253,7 +253,7 @@ count(*) min(7) max(7)
explain select count(*), min(7), max(7) from t2m, t1i;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2m system NULL NULL NULL NULL 1
-1 SIMPLE t1i ALL NULL NULL NULL NULL 0
+1 SIMPLE t1i ALL NULL NULL NULL NULL 1
select count(*), min(7), max(7) from t2m, t1i;
count(*) min(7) max(7)
0 NULL NULL
@@ -346,10 +346,10 @@ insert into t1 values ( 1,"e"),(2,"a"),( 3,"c"),(4,"d");
alter table t1 drop primary key, add primary key (f2, f1);
explain select distinct f1 a, f1 b from t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 5 NULL 4 Using index; Using temporary
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using temporary
explain select distinct f1, f2 from t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL PRIMARY 5 NULL 4 Using index
+1 SIMPLE t1 ALL NULL NULL NULL NULL 4
drop table t1;
CREATE TABLE t1 (id int(11) NOT NULL PRIMARY KEY, name varchar(20),
INDEX (name));
@@ -396,7 +396,7 @@ test.t1 analyze status OK
flush tables;
EXPLAIN SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref name name 22 const 2 Using where; Using index
+1 SIMPLE t1 range name name 44 NULL 2 Using where; Using index for group-by
SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
name dept
rs5 cs10
@@ -405,7 +405,7 @@ DELETE FROM t1;
# Masking (#) number in "rows" column of the following EXPLAIN output, as it may vary (bug#47746).
EXPLAIN SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref name name 22 const # Using where; Using index
+1 SIMPLE t1 range name name 44 NULL # Using where; Using index for group-by
SELECT DISTINCT t1.name, t1.dept FROM t1 WHERE t1.name='rs5';
name dept
DROP TABLE t1;
@@ -1185,7 +1185,7 @@ INSERT INTO t1 SELECT a + 32, MOD(a + 32, 20), 1 FROM t1;
INSERT INTO t1 SELECT a + 64, MOD(a + 64, 20), 1 FROM t1;
EXPLAIN SELECT b, SUM(c) FROM t1 GROUP BY b;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL b 5 NULL 128
+1 SIMPLE t1 ALL NULL NULL NULL NULL 128 Using temporary; Using filesort
EXPLAIN SELECT SQL_BIG_RESULT b, SUM(c) FROM t1 GROUP BY b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 128 Using filesort
@@ -1300,13 +1300,13 @@ EXPLAIN SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY a;
id 1
select_type SIMPLE
table t1
-type range
+type index
possible_keys bkey
-key bkey
-key_len 5
+key PRIMARY
+key_len 4
ref NULL
rows 32
-Extra Using where; Using index; Using filesort
+Extra Using where
SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY a;
a b
1 2
@@ -1395,13 +1395,13 @@ EXPLAIN SELECT * FROM t2 WHERE b=1 ORDER BY a;
id 1
select_type SIMPLE
table t2
-type ref
+type index
possible_keys bkey
-key bkey
-key_len 5
-ref const
+key PRIMARY
+key_len 4
+ref NULL
rows 16
-Extra Using where; Using index; Using filesort
+Extra Using where
SELECT * FROM t2 WHERE b=1 ORDER BY a;
a b c
1 1 1
@@ -1617,7 +1617,7 @@ c b d
3 2 40
EXPLAIN SELECT c,b FROM t1 GROUP BY c,b;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL c 8 NULL 3 Using index
+1 SIMPLE t1 index NULL c 8 NULL 3
SELECT c,b FROM t1 GROUP BY c,b;
c b
1 1
@@ -1775,7 +1775,7 @@ INSERT INTO t1 VALUES
(191, 'member', 1), (NULL, 'member', 3), (NULL, 'member', 4), (201, 'member', 2);
EXPLAIN SELECT * FROM t1 WHERE id=191 OR id IS NULL ORDER BY d;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL idx NULL NULL NULL 4 Using where; Using filesort
+1 SIMPLE t1 ref_or_null idx idx 5 const 3 Using index condition; Using filesort
SELECT * FROM t1 WHERE id=191 OR id IS NULL ORDER BY d;
id type d
191 member 1
@@ -1785,13 +1785,16 @@ DROP TABLE t1;
set @my_innodb_autoextend_increment=@@global.innodb_autoextend_increment;
set global innodb_autoextend_increment=8;
set global innodb_autoextend_increment=@my_innodb_autoextend_increment;
+#
+# Bug #37830: ORDER BY ASC/DESC - no difference
+#
CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY (a), KEY t1_b (b))
ENGINE=InnoDB;
-INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1);
+INSERT INTO t1 (a,b,c) VALUES (1,1,1), (2,1,1), (3,1,1), (4,1,1), (100,2,2);
INSERT INTO t1 (a,b,c) SELECT a+4,b,c FROM t1;
EXPLAIN SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range t1_b t1_b 5 NULL 8 Using where
+1 SIMPLE t1 ref t1_b t1_b 5 const 8 Using where
SELECT a, b, c FROM t1 WHERE b = 1 ORDER BY a DESC LIMIT 5;
a b c
8 1 1
@@ -2286,10 +2289,10 @@ drop table t1, t2;
#
SET SESSION BINLOG_FORMAT=STATEMENT;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-select @@session.sql_log_bin, @@session.binlog_format, @@session.tx_isolation;
+select @@session.sql_log_bin, @@session.binlog_format, @@session.transaction_isolation;
@@session.sql_log_bin 1
@@session.binlog_format STATEMENT
-@@session.tx_isolation READ-COMMITTED
+@@session.transaction_isolation READ-COMMITTED
CREATE TABLE t1 ( a INT ) ENGINE=InnoDB;
INSERT INTO t1 VALUES(1);
DROP TABLE t1;
@@ -2330,24 +2333,24 @@ EXPLAIN SELECT c FROM bar WHERE b>2;;
id 1
select_type SIMPLE
table bar
-type ALL
+type range
possible_keys b
-key NULL
-key_len NULL
+key b
+key_len 5
ref NULL
-rows 6
-Extra Using where
+rows 5
+Extra Using index condition
EXPLAIN SELECT c FROM foo WHERE b>2;;
id 1
select_type SIMPLE
table foo
-type ALL
+type range
possible_keys b
-key NULL
-key_len NULL
+key b
+key_len 5
ref NULL
-rows 6
-Extra Using where
+rows 5
+Extra Using index condition
EXPLAIN SELECT c FROM foo2 WHERE b>2;;
id 1
select_type SIMPLE
@@ -2970,7 +2973,7 @@ NULL 75
EXPLAIN SELECT t1.id,t2.id FROM t2 LEFT JOIN t1 ON t1.id>=74 AND t1.id<=0
WHERE t2.id=75 AND t1.id IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 const PRIMARY NULL NULL NULL 1 Impossible ON condition
+1 SIMPLE t1 const PRIMARY NULL NULL NULL 0 Impossible ON condition
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where
DROP TABLE t1,t2;
#
@@ -3066,7 +3069,7 @@ f1 f2 f3 f4
EXPLAIN SELECT * FROM t1 WHERE f2 = 1 AND f4 = TRUE
ORDER BY f1 DESC LIMIT 5;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range f2,f4 f4 1 NULL 22 Using where
+1 SIMPLE t1 index f2,f4 PRIMARY 4 NULL 5 Using where
DROP TABLE t1;
#
# Bug#54117 crash in thr_multi_unlock, temporary table
@@ -3114,8 +3117,8 @@ select_type SIMPLE
table t1
type index
possible_keys NULL
-key PRIMARY
-key_len 8
+key b
+key_len 13
ref NULL
rows 3
Extra Using index
@@ -3127,8 +3130,8 @@ select_type SIMPLE
table t1
type index
possible_keys NULL
-key PRIMARY
-key_len 8
+key b
+key_len 18
ref NULL
rows 3
Extra Using index
@@ -3291,7 +3294,7 @@ SELECT t2.b FROM t1,t2 WHERE t1.a IN (SELECT 1 FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 1
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
-1 PRIMARY t2 index NULL PRIMARY 4 NULL 1 Using index; FirstMatch(t1); Using join buffer (incremental, BNL join)
+1 PRIMARY t2 ALL NULL NULL NULL NULL 1 FirstMatch(t1); Using join buffer (incremental, BNL join)
SELECT t2.b FROM t1,t2 WHERE t1.a IN (SELECT 1 FROM t2);
b
1
diff --git a/mysql-test/suite/innodb/r/innodb_scrub.result b/mysql-test/suite/innodb/r/innodb_scrub.result
index 475d4e74..eba4984f 100644
--- a/mysql-test/suite/innodb/r/innodb_scrub.result
+++ b/mysql-test/suite/innodb/r/innodb_scrub.result
@@ -18,9 +18,13 @@ SET @scrub= @@GLOBAL.innodb_immediate_scrub_data_uncompressed;
SET GLOBAL innodb_immediate_scrub_data_uncompressed= 1;
SET @fpt=@@GLOBAL.innodb_file_per_table;
SET GLOBAL innodb_file_per_table=0;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
CREATE TABLE t ENGINE=InnoDB AS SELECT 1;
DROP TABLE t;
SET GLOBAL innodb_file_per_table=@fpt;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
CREATE TEMPORARY TABLE tmp ENGINE=InnoDB AS SELECT 1;
DROP TABLE tmp;
SET GLOBAL INNODB_IMMEDIATE_SCRUB_DATA_UNCOMPRESSED= @scrub;
diff --git a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
index 94e40ee5..4fa95934 100644
--- a/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
+++ b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
@@ -114,12 +114,8 @@ buffer_LRU_unzip_search_num_scan buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL N
buffer_LRU_unzip_search_scanned_per_call buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 set_member Page scanned per single LRU unzip search
buffer_page_read_index_leaf buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Index Leaf Pages read
buffer_page_read_index_non_leaf buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Index Non-leaf Pages read
-buffer_page_read_index_ibuf_leaf buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Insert Buffer Index Leaf Pages read
-buffer_page_read_index_ibuf_non_leaf buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Insert Buffer Index Non-Leaf Pages read
buffer_page_read_undo_log buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Undo Log Pages read
buffer_page_read_index_inode buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Index Inode Pages read
-buffer_page_read_ibuf_free_list buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Insert Buffer Free List Pages read
-buffer_page_read_ibuf_bitmap buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Insert Buffer Bitmap Pages read
buffer_page_read_system_page buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of System Pages read
buffer_page_read_trx_system buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Transaction System Pages read
buffer_page_read_fsp_hdr buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of File Space Header Pages read
@@ -130,12 +126,8 @@ buffer_page_read_zblob2 buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NU
buffer_page_read_other buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of other/unknown (old version of InnoDB) Pages read
buffer_page_written_index_leaf buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Index Leaf Pages written
buffer_page_written_index_non_leaf buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Index Non-leaf Pages written
-buffer_page_written_index_ibuf_leaf buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Insert Buffer Index Leaf Pages written
-buffer_page_written_index_ibuf_non_leaf buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Insert Buffer Index Non-Leaf Pages written
buffer_page_written_undo_log buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Undo Log Pages written
buffer_page_written_index_inode buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Index Inode Pages written
-buffer_page_written_ibuf_free_list buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Insert Buffer Free List Pages written
-buffer_page_written_ibuf_bitmap buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Insert Buffer Bitmap Pages written
buffer_page_written_system_page buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of System Pages written
buffer_page_written_trx_system buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Transaction System Pages written
buffer_page_written_fsp_hdr buffer_page_io 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of File Space Header Pages written
@@ -203,14 +195,6 @@ adaptive_hash_rows_removed adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL
adaptive_hash_rows_deleted_no_hash_entry adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of rows deleted that did not have corresponding Adaptive Hash Index entries
adaptive_hash_rows_updated adaptive_hash_index 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of Adaptive Hash Index rows updated
file_num_open_files file_system 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 value Number of files currently open (innodb_num_open_files)
-ibuf_merges_insert change_buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of inserted records merged by change buffering
-ibuf_merges_delete_mark change_buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of deleted records merged by change buffering
-ibuf_merges_delete change_buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of purge records merged by change buffering
-ibuf_merges_discard_insert change_buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of insert merged operations discarded
-ibuf_merges_discard_delete_mark change_buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of deleted merged operations discarded
-ibuf_merges_discard_delete change_buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of purge merged operations discarded
-ibuf_merges change_buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Number of change buffer merges
-ibuf_size change_buffer 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Change buffer size in pages
innodb_master_thread_sleeps server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of times (seconds) master thread sleeps
innodb_activity_count server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 status_counter Current server activity count
innodb_master_active_loops server 0 NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL 0 counter Number of times master thread performs its tasks when server is active
diff --git a/mysql-test/suite/innodb/r/innodb_stats.result b/mysql-test/suite/innodb/r/innodb_stats.result
index b300af76..cb5247f0 100644
--- a/mysql-test/suite/innodb/r/innodb_stats.result
+++ b/mysql-test/suite/innodb/r/innodb_stats.result
@@ -151,7 +151,7 @@ INDEX_NAME a_key
SEQ_IN_INDEX 1
COLUMN_NAME a
COLLATION A
-CARDINALITY 2
+CARDINALITY 1
SUB_PART NULL
PACKED NULL
NULLABLE YES
@@ -204,7 +204,7 @@ INDEX_NAME a_key
SEQ_IN_INDEX 1
COLUMN_NAME a
COLLATION A
-CARDINALITY 3
+CARDINALITY 1
SUB_PART NULL
PACKED NULL
NULLABLE YES
@@ -257,7 +257,7 @@ INDEX_NAME a_key
SEQ_IN_INDEX 1
COLUMN_NAME a
COLLATION A
-CARDINALITY 2
+CARDINALITY 1
SUB_PART NULL
PACKED NULL
NULLABLE YES
@@ -522,7 +522,7 @@ INDEX_NAME a_key
SEQ_IN_INDEX 1
COLUMN_NAME a
COLLATION A
-CARDINALITY 10
+CARDINALITY 5
SUB_PART NULL
PACKED NULL
NULLABLE YES
diff --git a/mysql-test/suite/innodb/r/innodb_stats_fetch.result b/mysql-test/suite/innodb/r/innodb_stats_fetch.result
index cb205b18..ccc8d205 100644
--- a/mysql-test/suite/innodb/r/innodb_stats_fetch.result
+++ b/mysql-test/suite/innodb/r/innodb_stats_fetch.result
@@ -131,16 +131,16 @@ FROM information_schema.statistics WHERE table_name = 'test_ps_fetch'
ORDER BY index_name, seq_in_index;
seq_in_index 1
column_name c
-cardinality 6
+cardinality 3
seq_in_index 2
column_name d
-cardinality 22
+cardinality 11
seq_in_index 1
column_name a
-cardinality 40
+cardinality 20
seq_in_index 2
column_name b
-cardinality 200
+cardinality 90
SELECT
table_rows, avg_row_length, max_data_length, index_length
FROM information_schema.tables WHERE table_name = 'test_ps_fetch';
@@ -177,7 +177,7 @@ DROP TABLE t1;
#
# MDEV-33462 Disallow LOCK=NONE operation on statistics table
#
-ALTER TABLE mysql.innodb_table_stats FORCE, LOCK=NONE;
+ALTER TABLE mysql.innodb_table_stats FORCE, LOCK=NONE, ALGORITHM=INPLACE;
ERROR 0A000: LOCK=NONE is not supported. Reason: innodb_table_stats. Try LOCK=SHARED
-ALTER TABLE mysql.innodb_index_stats FORCE, LOCK=NONE;
+ALTER TABLE mysql.innodb_index_stats FORCE, LOCK=NONE, ALGORITHM=INPLACE;
ERROR 0A000: LOCK=NONE is not supported. Reason: innodb_index_stats. Try LOCK=SHARED
diff --git a/mysql-test/suite/innodb/r/innodb_stats_fetch_corrupted.result b/mysql-test/suite/innodb/r/innodb_stats_fetch_corrupted.result
index 1f847130..b1e6bb7f 100644
--- a/mysql-test/suite/innodb/r/innodb_stats_fetch_corrupted.result
+++ b/mysql-test/suite/innodb/r/innodb_stats_fetch_corrupted.result
@@ -24,7 +24,7 @@ FROM information_schema.statistics WHERE table_name = 'test_ps_fetch_corrupted'
ORDER BY index_name, seq_in_index;
seq_in_index 1
column_name a
-cardinality 0
+cardinality 1
SELECT table_rows, avg_row_length, max_data_length, index_length
FROM information_schema.tables WHERE table_name = 'test_ps_fetch_corrupted';
table_rows 0
@@ -38,7 +38,7 @@ FROM information_schema.statistics WHERE table_name = 'test_ps_fetch_corrupted'
ORDER BY index_name, seq_in_index;
seq_in_index 1
column_name a
-cardinality 0
+cardinality 1
SELECT table_rows, avg_row_length, max_data_length, index_length
FROM information_schema.tables WHERE table_name = 'test_ps_fetch_corrupted';
table_rows 0
diff --git a/mysql-test/suite/innodb/r/innodb_stats_fetch_nonexistent.result b/mysql-test/suite/innodb/r/innodb_stats_fetch_nonexistent.result
index 91bb2bf3..a6627417 100644
--- a/mysql-test/suite/innodb/r/innodb_stats_fetch_nonexistent.result
+++ b/mysql-test/suite/innodb/r/innodb_stats_fetch_nonexistent.result
@@ -22,7 +22,7 @@ FROM information_schema.statistics WHERE table_name = 'test_ps_fetch_nonexistent
ORDER BY index_name, seq_in_index;
seq_in_index 1
column_name a
-cardinality 0
+cardinality 1
SELECT table_rows, avg_row_length, max_data_length, index_length
FROM information_schema.tables WHERE table_name = 'test_ps_fetch_nonexistent';
table_rows 0
diff --git a/mysql-test/suite/innodb/r/innodb_status_variables.result b/mysql-test/suite/innodb/r/innodb_status_variables.result
index 3a86271c..2eeed4f1 100644
--- a/mysql-test/suite/innodb/r/innodb_status_variables.result
+++ b/mysql-test/suite/innodb/r/innodb_status_variables.result
@@ -45,16 +45,6 @@ INNODB_DBLWR_PAGES_WRITTEN
INNODB_DBLWR_WRITES
INNODB_DEADLOCKS
INNODB_HISTORY_LIST_LENGTH
-INNODB_IBUF_DISCARDED_DELETE_MARKS
-INNODB_IBUF_DISCARDED_DELETES
-INNODB_IBUF_DISCARDED_INSERTS
-INNODB_IBUF_FREE_LIST
-INNODB_IBUF_MERGED_DELETE_MARKS
-INNODB_IBUF_MERGED_DELETES
-INNODB_IBUF_MERGED_INSERTS
-INNODB_IBUF_MERGES
-INNODB_IBUF_SEGMENT_SIZE
-INNODB_IBUF_SIZE
INNODB_LOG_WAITS
INNODB_LOG_WRITE_REQUESTS
INNODB_LOG_WRITES
@@ -92,9 +82,6 @@ INNODB_HAVE_LZMA
INNODB_HAVE_BZIP2
INNODB_HAVE_SNAPPY
INNODB_HAVE_PUNCH_HOLE
-INNODB_DEFRAGMENT_COMPRESSION_FAILURES
-INNODB_DEFRAGMENT_FAILURES
-INNODB_DEFRAGMENT_COUNT
INNODB_INSTANT_ALTER_COLUMN
INNODB_ONLINEDDL_ROWLOG_ROWS
INNODB_ONLINEDDL_ROWLOG_PCT_USED
diff --git a/mysql-test/suite/innodb/r/insert_debug.result b/mysql-test/suite/innodb/r/insert_debug.result
index 3ac9df58..cafab4aa 100644
--- a/mysql-test/suite/innodb/r/insert_debug.result
+++ b/mysql-test/suite/innodb/r/insert_debug.result
@@ -2,12 +2,10 @@
# Bug#19904003 INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=1
# CAUSES INFINITE PAGE SPLIT
#
-SET GLOBAL innodb_change_buffering_debug=1;
SET GLOBAL innodb_limit_optimistic_insert_debug=1;
CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=InnoDB
PARTITION BY HASH (c1) PARTITIONS 15;
DROP TABLE t1;
-SET GLOBAL innodb_change_buffering_debug=0;
SET GLOBAL innodb_limit_optimistic_insert_debug=0;
#
# Bug#25082593 FOREIGN KEY VALIDATION DOESN'T NEED
diff --git a/mysql-test/suite/innodb/r/insert_into_empty.result b/mysql-test/suite/innodb/r/insert_into_empty.result
index 78d93494..d4ffaf89 100644
--- a/mysql-test/suite/innodb/r/insert_into_empty.result
+++ b/mysql-test/suite/innodb/r/insert_into_empty.result
@@ -41,7 +41,7 @@ SET GLOBAL innodb_adaptive_hash_index = @save_ahi;
#
CREATE TEMPORARY TABLE t (c INT) ENGINE=InnoDB;
CREATE TEMPORARY TABLE t2 (c INT) ENGINE=InnoDB;
-SET tx_read_only=1;
+SET transaction_read_only=1;
BEGIN;
INSERT INTO t2 VALUES(0);
INSERT INTO t VALUES(0);
@@ -53,7 +53,7 @@ COMMIT;
INSERT INTO t VALUES(0);
DROP TEMPORARY TABLE t,t2;
ERROR 25006: Cannot execute statement in a READ ONLY transaction
-SET tx_read_only=0;
+SET transaction_read_only=0;
DROP TEMPORARY TABLE t,t2;
#
# MDEV-24818 Optimize multiple INSERT into empty table
diff --git a/mysql-test/suite/innodb/r/instant_alter_debug.result b/mysql-test/suite/innodb/r/instant_alter_debug.result
index 733a85aa..dd032e1d 100644
--- a/mysql-test/suite/innodb/r/instant_alter_debug.result
+++ b/mysql-test/suite/innodb/r/instant_alter_debug.result
@@ -277,12 +277,6 @@ SET GLOBAL innodb_limit_optimistic_insert_debug = 2;
INSERT INTO t1 VALUES (1),(5),(4),(3),(2);
SET GLOBAL innodb_limit_optimistic_insert_debug = @old_limit;
ALTER TABLE t1 ADD COLUMN b INT, ALGORITHM=INSTANT;
-SET @old_defragment = @@innodb_defragment;
-SET GLOBAL innodb_defragment = 1;
-OPTIMIZE TABLE t1;
-Table Op Msg_type Msg_text
-test.t1 optimize status OK
-SET GLOBAL innodb_defragment = @old_defragment;
ALTER TABLE t1 ADD vb INT AS (b) VIRTUAL;
CHECK TABLE t1;
Table Op Msg_type Msg_text
diff --git a/mysql-test/suite/innodb/r/instant_alter_limit,16k.rdiff b/mysql-test/suite/innodb/r/instant_alter_limit,16k.rdiff
index 57d87f71..320df318 100644
--- a/mysql-test/suite/innodb/r/instant_alter_limit,16k.rdiff
+++ b/mysql-test/suite/innodb/r/instant_alter_limit,16k.rdiff
@@ -1,5 +1,5 @@
---- instant_alter_limit.result 2020-05-26 18:01:27.377946439 +0530
-+++ instant_alter_limit,16k.reject 2020-05-26 20:14:38.452463919 +0530
+--- instant_alter_limit.result
++++ instant_alter_limit,16k.reject
@@ -45,3 +45,10 @@
instants
502
diff --git a/mysql-test/suite/innodb/r/instant_alter_limit,32k.rdiff b/mysql-test/suite/innodb/r/instant_alter_limit,32k.rdiff
index 8f8cf64b..951f0ce2 100644
--- a/mysql-test/suite/innodb/r/instant_alter_limit,32k.rdiff
+++ b/mysql-test/suite/innodb/r/instant_alter_limit,32k.rdiff
@@ -1,5 +1,5 @@
---- instant_alter_limit.result 2020-05-26 18:01:27.377946439 +0530
-+++ instant_alter_limit,32k.reject 2020-05-26 19:59:19.743877366 +0530
+--- instant_alter_limit.result
++++ instant_alter_limit,32k.reject
@@ -43,5 +43,12 @@
FROM information_schema.global_status
WHERE variable_name = 'innodb_instant_alter_column';
diff --git a/mysql-test/suite/innodb/r/instant_alter_limit,4k.rdiff b/mysql-test/suite/innodb/r/instant_alter_limit,4k.rdiff
index dad28218..0ebd590a 100644
--- a/mysql-test/suite/innodb/r/instant_alter_limit,4k.rdiff
+++ b/mysql-test/suite/innodb/r/instant_alter_limit,4k.rdiff
@@ -1,5 +1,5 @@
---- instant_alter_limit.result 2020-05-26 18:01:27.377946439 +0530
-+++ instant_alter_limit,4k.reject 2020-05-26 20:17:53.314736548 +0530
+--- instant_alter_limit.result
++++ instant_alter_limit,4k.reject
@@ -5,6 +5,276 @@
ENGINE=InnoDB;
INSERT INTO t VALUES(1,2,3,4,5);
diff --git a/mysql-test/suite/innodb/r/instant_alter_limit,64k.rdiff b/mysql-test/suite/innodb/r/instant_alter_limit,64k.rdiff
index d7479dbb..7c58fa4a 100644
--- a/mysql-test/suite/innodb/r/instant_alter_limit,64k.rdiff
+++ b/mysql-test/suite/innodb/r/instant_alter_limit,64k.rdiff
@@ -1,5 +1,5 @@
---- instant_alter_limit.result 2020-05-26 18:01:27.377946439 +0530
-+++ instant_alter_limit,64k.reject 2020-05-26 20:00:22.499711222 +0530
+--- instant_alter_limit.result
++++ instant_alter_limit,64k.reject
@@ -43,5 +43,12 @@
FROM information_schema.global_status
WHERE variable_name = 'innodb_instant_alter_column';
diff --git a/mysql-test/suite/innodb/r/instant_alter_limit,8k.rdiff b/mysql-test/suite/innodb/r/instant_alter_limit,8k.rdiff
index 1fe3e1a5..d70156f3 100644
--- a/mysql-test/suite/innodb/r/instant_alter_limit,8k.rdiff
+++ b/mysql-test/suite/innodb/r/instant_alter_limit,8k.rdiff
@@ -1,5 +1,5 @@
---- instant_alter_limit.result 2020-05-26 18:01:27.377946439 +0530
-+++ instant_alter_limit,8k.reject 2020-05-26 20:19:50.881869095 +0530
+--- instant_alter_limit.result
++++ instant_alter_limit,8k.reject
@@ -5,6 +5,28 @@
ENGINE=InnoDB;
INSERT INTO t VALUES(1,2,3,4,5);
diff --git a/mysql-test/suite/innodb/r/log_data_file_size.result b/mysql-test/suite/innodb/r/log_data_file_size.result
index d33752b0..ddb8e694 100644
--- a/mysql-test/suite/innodb/r/log_data_file_size.result
+++ b/mysql-test/suite/innodb/r/log_data_file_size.result
@@ -1,6 +1,10 @@
SET GLOBAL innodb_file_per_table=0;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
CREATE TABLE t(a INT)ENGINE=InnoDB;
SET GLOBAL innodb_file_per_table=1;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
CREATE TABLE ibd4(a INT UNIQUE)ENGINE=InnoDB;
CREATE TABLE ibd4f(a INT UNIQUE)ENGINE=InnoDB;
CREATE TABLE ibd5(a INT UNIQUE, b INT UNIQUE)ENGINE=InnoDB;
diff --git a/mysql-test/suite/innodb/r/log_file_name.result b/mysql-test/suite/innodb/r/log_file_name.result
index a7f8cc8c..1839c9bc 100644
--- a/mysql-test/suite/innodb/r/log_file_name.result
+++ b/mysql-test/suite/innodb/r/log_file_name.result
@@ -1,5 +1,4 @@
call mtr.add_suppression("InnoDB: Header page consists of zero bytes in datafile:");
-SET GLOBAL innodb_file_per_table=ON;
FLUSH TABLES;
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
# restart
diff --git a/mysql-test/suite/innodb/r/log_file_size.result b/mysql-test/suite/innodb/r/log_file_size.result
index 7b4935e1..71fe06cf 100644
--- a/mysql-test/suite/innodb/r/log_file_size.result
+++ b/mysql-test/suite/innodb/r/log_file_size.result
@@ -31,7 +31,7 @@ connection default;
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /syntax error in innodb_log_group_home_dir/ in mysqld.1.err
-# restart: --debug=d,innodb_log_abort_1
+# restart: --debug-dbug=d,innodb_log_abort_1
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /InnoDB: Starting crash recovery from checkpoint LSN=.*/ in mysqld.1.err
@@ -39,7 +39,7 @@ FOUND 1 /InnoDB: Starting crash recovery from checkpoint LSN=.*/ in mysqld.1.err
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /InnoDB: innodb_read_only prevents crash recovery/ in mysqld.1.err
-# restart: --debug=d,innodb_log_abort_5
+# restart: --debug-dbug=d,innodb_log_abort_5
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
FOUND 1 /redo log from 5\.000MiB to [0-9.]*[KMGT]iB/ in mysqld.1.err
diff --git a/mysql-test/suite/innodb/r/log_upgrade_101_flags.result b/mysql-test/suite/innodb/r/log_upgrade_101_flags.result
index 6ae7c848..2458c51b 100644
--- a/mysql-test/suite/innodb/r/log_upgrade_101_flags.result
+++ b/mysql-test/suite/innodb/r/log_upgrade_101_flags.result
@@ -1,7 +1,7 @@
call mtr.add_suppression("InnoDB: The change buffer is corrupted");
call mtr.add_suppression("InnoDB: Tablespace size stored in header is 768 pages, but the sum of data file sizes is 384 pages");
call mtr.add_suppression("InnoDB: adjusting FSP_SPACE_FLAGS of file");
-# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_upgrade --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_upgrade --innodb-force-recovery=5 --innodb-log-file-size=4m --innodb_page_size=32k --innodb_buffer_pool_size=10M
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_upgrade --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_upgrade --innodb-undo-directory=MYSQLTEST_VARDIR/tmp/log_upgrade --innodb-force-recovery=5 --innodb-log-file-size=4m --innodb_page_size=32k --innodb_buffer_pool_size=10M
SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
diff --git a/mysql-test/suite/innodb/r/max_record_size,16k,compact.rdiff b/mysql-test/suite/innodb/r/max_record_size,16k,compact.rdiff
index 118145be..b9f51624 100644
--- a/mysql-test/suite/innodb/r/max_record_size,16k,compact.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,16k,compact.rdiff
@@ -1,5 +1,5 @@
---- max_record_size.result 2019-07-03 11:54:44.591421526 +0300
-+++ max_record_size.reject 2019-07-03 12:51:26.070418078 +0300
+--- max_record_size.result
++++ max_record_size.reject
@@ -3,45 +3,65 @@
c1 CHAR(255), c2 CHAR(255), c3 CHAR(255), c4 CHAR(255),
c5 CHAR(255), c6 CHAR(255), c7 CHAR(255), c8 CHAR(255),
diff --git a/mysql-test/suite/innodb/r/max_record_size,16k,dynamic.rdiff b/mysql-test/suite/innodb/r/max_record_size,16k,dynamic.rdiff
index 33067866..5effc664 100644
--- a/mysql-test/suite/innodb/r/max_record_size,16k,dynamic.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,16k,dynamic.rdiff
@@ -1,5 +1,5 @@
---- max_record_size.result 2019-07-03 11:54:44.591421526 +0300
-+++ max_record_size.reject 2019-07-03 12:52:54.580956978 +0300
+--- max_record_size.result
++++ max_record_size.reject
@@ -3,45 +3,207 @@
c1 CHAR(255), c2 CHAR(255), c3 CHAR(255), c4 CHAR(255),
c5 CHAR(255), c6 CHAR(255), c7 CHAR(255), c8 CHAR(255),
diff --git a/mysql-test/suite/innodb/r/max_record_size,16k,redundant.rdiff b/mysql-test/suite/innodb/r/max_record_size,16k,redundant.rdiff
index e50e4d2b..227b64a8 100644
--- a/mysql-test/suite/innodb/r/max_record_size,16k,redundant.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,16k,redundant.rdiff
@@ -1,5 +1,5 @@
---- max_record_size.result 2019-07-03 11:54:44.591421526 +0300
-+++ max_record_size.reject 2019-07-03 12:55:05.258762945 +0300
+--- max_record_size.result
++++ max_record_size.reject
@@ -3,45 +3,65 @@
c1 CHAR(255), c2 CHAR(255), c3 CHAR(255), c4 CHAR(255),
c5 CHAR(255), c6 CHAR(255), c7 CHAR(255), c8 CHAR(255),
diff --git a/mysql-test/suite/innodb/r/max_record_size,32k,compact.rdiff b/mysql-test/suite/innodb/r/max_record_size,32k,compact.rdiff
index 1bc03a5d..d236e12b 100644
--- a/mysql-test/suite/innodb/r/max_record_size,32k,compact.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,32k,compact.rdiff
@@ -1,5 +1,5 @@
---- max_record_size.result 2019-07-03 11:54:44.591421526 +0300
-+++ max_record_size.reject 2019-07-03 12:27:08.004932026 +0300
+--- max_record_size.result
++++ max_record_size.reject
@@ -3,45 +3,104 @@
c1 CHAR(255), c2 CHAR(255), c3 CHAR(255), c4 CHAR(255),
c5 CHAR(255), c6 CHAR(255), c7 CHAR(255), c8 CHAR(255),
diff --git a/mysql-test/suite/innodb/r/max_record_size,32k,dynamic.rdiff b/mysql-test/suite/innodb/r/max_record_size,32k,dynamic.rdiff
index 71c4c2e4..ce9462b6 100644
--- a/mysql-test/suite/innodb/r/max_record_size,32k,dynamic.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,32k,dynamic.rdiff
@@ -1,5 +1,5 @@
---- max_record_size.result 2019-07-03 11:54:44.591421526 +0300
-+++ max_record_size.reject 2019-07-03 12:38:41.609328820 +0300
+--- max_record_size.result
++++ max_record_size.reject
@@ -3,45 +3,351 @@
c1 CHAR(255), c2 CHAR(255), c3 CHAR(255), c4 CHAR(255),
c5 CHAR(255), c6 CHAR(255), c7 CHAR(255), c8 CHAR(255),
diff --git a/mysql-test/suite/innodb/r/max_record_size,32k,redundant.rdiff b/mysql-test/suite/innodb/r/max_record_size,32k,redundant.rdiff
index e42b3de8..53d6f76a 100644
--- a/mysql-test/suite/innodb/r/max_record_size,32k,redundant.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,32k,redundant.rdiff
@@ -1,5 +1,5 @@
---- max_record_size.result 2019-07-03 11:54:44.591421526 +0300
-+++ max_record_size.reject 2019-07-03 12:41:03.319664978 +0300
+--- max_record_size.result
++++ max_record_size.reject
@@ -3,45 +3,104 @@
c1 CHAR(255), c2 CHAR(255), c3 CHAR(255), c4 CHAR(255),
c5 CHAR(255), c6 CHAR(255), c7 CHAR(255), c8 CHAR(255),
diff --git a/mysql-test/suite/innodb/r/max_record_size,4k,compact.rdiff b/mysql-test/suite/innodb/r/max_record_size,4k,compact.rdiff
index 6f08dab3..37871798 100644
--- a/mysql-test/suite/innodb/r/max_record_size,4k,compact.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,4k,compact.rdiff
@@ -1,5 +1,5 @@
---- max_record_size.result 2019-07-03 11:54:44.591421526 +0300
-+++ max_record_size.reject 2019-07-03 12:56:23.489432164 +0300
+--- max_record_size.result
++++ max_record_size.reject
@@ -1,47 +1,37 @@
call mtr.add_suppression("Cannot add field `.*` in table `test`.`t1` because after adding it, the row size is");
CREATE TABLE t1 (
diff --git a/mysql-test/suite/innodb/r/max_record_size,4k,dynamic.rdiff b/mysql-test/suite/innodb/r/max_record_size,4k,dynamic.rdiff
index bd37d435..b0b6b007 100644
--- a/mysql-test/suite/innodb/r/max_record_size,4k,dynamic.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,4k,dynamic.rdiff
@@ -1,5 +1,5 @@
---- max_record_size.result 2019-07-03 11:54:44.591421526 +0300
-+++ max_record_size.reject 2019-07-03 12:57:38.636143710 +0300
+--- max_record_size.result
++++ max_record_size.reject
@@ -1,47 +1,103 @@
call mtr.add_suppression("Cannot add field `.*` in table `test`.`t1` because after adding it, the row size is");
CREATE TABLE t1 (
diff --git a/mysql-test/suite/innodb/r/max_record_size,4k,redundant.rdiff b/mysql-test/suite/innodb/r/max_record_size,4k,redundant.rdiff
index 93c39ff6..0db6450d 100644
--- a/mysql-test/suite/innodb/r/max_record_size,4k,redundant.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,4k,redundant.rdiff
@@ -1,5 +1,5 @@
---- max_record_size.result 2019-07-03 11:54:44.591421526 +0300
-+++ max_record_size.reject 2019-07-03 12:58:58.318768169 +0300
+--- max_record_size.result
++++ max_record_size.reject
@@ -1,47 +1,37 @@
call mtr.add_suppression("Cannot add field `.*` in table `test`.`t1` because after adding it, the row size is");
CREATE TABLE t1 (
diff --git a/mysql-test/suite/innodb/r/max_record_size,64k,compact.rdiff b/mysql-test/suite/innodb/r/max_record_size,64k,compact.rdiff
index 5e6c6221..ab75975e 100644
--- a/mysql-test/suite/innodb/r/max_record_size,64k,compact.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,64k,compact.rdiff
@@ -1,5 +1,5 @@
---- max_record_size.result 2019-07-03 11:54:44.591421526 +0300
-+++ max_record_size.reject 2019-07-03 12:45:21.760116841 +0300
+--- max_record_size.result
++++ max_record_size.reject
@@ -3,45 +3,186 @@
c1 CHAR(255), c2 CHAR(255), c3 CHAR(255), c4 CHAR(255),
c5 CHAR(255), c6 CHAR(255), c7 CHAR(255), c8 CHAR(255),
diff --git a/mysql-test/suite/innodb/r/max_record_size,64k,dynamic.rdiff b/mysql-test/suite/innodb/r/max_record_size,64k,dynamic.rdiff
index 2cbf4cd9..3e13a510 100644
--- a/mysql-test/suite/innodb/r/max_record_size,64k,dynamic.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,64k,dynamic.rdiff
@@ -1,5 +1,5 @@
---- max_record_size.result 2019-07-03 11:54:44.591421526 +0300
-+++ max_record_size.reject 2019-07-03 12:48:32.453208310 +0300
+--- max_record_size.result
++++ max_record_size.reject
@@ -3,45 +3,486 @@
c1 CHAR(255), c2 CHAR(255), c3 CHAR(255), c4 CHAR(255),
c5 CHAR(255), c6 CHAR(255), c7 CHAR(255), c8 CHAR(255),
diff --git a/mysql-test/suite/innodb/r/max_record_size,64k,redundant.rdiff b/mysql-test/suite/innodb/r/max_record_size,64k,redundant.rdiff
index c324969f..a31285a2 100644
--- a/mysql-test/suite/innodb/r/max_record_size,64k,redundant.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,64k,redundant.rdiff
@@ -1,5 +1,5 @@
---- max_record_size.result 2019-07-03 11:54:44.591421526 +0300
-+++ max_record_size.reject 2019-07-03 12:50:05.663724193 +0300
+--- max_record_size.result
++++ max_record_size.reject
@@ -3,45 +3,104 @@
c1 CHAR(255), c2 CHAR(255), c3 CHAR(255), c4 CHAR(255),
c5 CHAR(255), c6 CHAR(255), c7 CHAR(255), c8 CHAR(255),
diff --git a/mysql-test/suite/innodb/r/max_record_size,8k,compact.rdiff b/mysql-test/suite/innodb/r/max_record_size,8k,compact.rdiff
index 4db669a8..cafb5f25 100644
--- a/mysql-test/suite/innodb/r/max_record_size,8k,compact.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,8k,compact.rdiff
@@ -1,5 +1,5 @@
---- max_record_size.result 2019-07-03 11:54:44.591421526 +0300
-+++ max_record_size.reject 2019-07-03 13:00:25.037261867 +0300
+--- max_record_size.result
++++ max_record_size.reject
@@ -12,7 +12,7 @@
c9 CHAR(255), c10 CHAR(255), c11 CHAR(255), c12 CHAR(255),
c13 CHAR(255), c14 CHAR(255), c15 CHAR(255), c16 CHAR(255)
diff --git a/mysql-test/suite/innodb/r/max_record_size,8k,dynamic.rdiff b/mysql-test/suite/innodb/r/max_record_size,8k,dynamic.rdiff
index 5f79d77e..2f592fbb 100644
--- a/mysql-test/suite/innodb/r/max_record_size,8k,dynamic.rdiff
+++ b/mysql-test/suite/innodb/r/max_record_size,8k,dynamic.rdiff
@@ -1,5 +1,5 @@
---- max_record_size.result 2019-07-03 11:54:44.591421526 +0300
-+++ max_record_size.reject 2019-07-03 13:01:51.215756779 +0300
+--- max_record_size.result
++++ max_record_size.reject
@@ -12,7 +12,7 @@
c9 CHAR(255), c10 CHAR(255), c11 CHAR(255), c12 CHAR(255),
c13 CHAR(255), c14 CHAR(255), c15 CHAR(255), c16 CHAR(255)
diff --git a/mysql-test/suite/innodb/r/mdev-14846.result b/mysql-test/suite/innodb/r/mdev-14846.result
index a1ccfb6b..b5d8dcbe 100644
--- a/mysql-test/suite/innodb/r/mdev-14846.result
+++ b/mysql-test/suite/innodb/r/mdev-14846.result
@@ -34,13 +34,25 @@ SET DEBUG_SYNC='now SIGNAL default_dml';
SET DEBUG_SYNC='now SIGNAL con2_dml';
connection default;
SET DEBUG_SYNC='now WAIT_FOR default_dml';
-UPDATE t3 AS alias1 LEFT JOIN t3 AS alias2 ON ( alias1.f1 <> alias1.f2 ) SET alias1.f3 = 59 WHERE ( EXISTS ( SELECT t1.f3 FROM t1 WHERE t1.f1 = alias1.f1 ) ) OR alias2.f1 = 'h';
+explain UPDATE t3 AS alias1 LEFT JOIN t3 AS alias2 ON ( alias1.f1 <> alias1.f2 ) SET alias1.f3 = 59 WHERE ( EXISTS ( SELECT t1.f3 FROM t1 IGNORE INDEX (f1) WHERE t1.f1 = alias1.f1 ) ) OR alias2.f1 = 'h';
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY alias1 ALL NULL NULL NULL NULL #
+1 PRIMARY alias2 ALL NULL NULL NULL NULL # Using where
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL # Using where
+UPDATE t3 AS alias1 LEFT JOIN t3 AS alias2 ON ( alias1.f1 <> alias1.f2 ) SET alias1.f3 = 59 WHERE ( EXISTS ( SELECT t1.f3 FROM t1 IGNORE INDEX (f1) WHERE t1.f1 = alias1.f1 ) ) OR alias2.f1 = 'h';
connect con2,localhost,root,,test;
set debug_sync='now WAIT_FOR con2_dml';
SET DEBUG_SYNC='now SIGNAL con1_dml2';
disconnect con2;
connection con1;
SET DEBUG_SYNC='now WAIT_FOR con1_dml2';
+explain UPDATE v4, t1 SET t1.pk = 76 WHERE t1.f2 IN ( SELECT t2.f FROM t2 INNER JOIN t3 );
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 index NULL f1 12 NULL # Using index
+1 PRIMARY t1 ALL NULL NULL NULL NULL #
+1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 13 func #
+2 MATERIALIZED t3 ALL NULL NULL NULL NULL #
+2 MATERIALIZED t2 ALL NULL NULL NULL NULL #
UPDATE v4, t1 SET t1.pk = 76 WHERE t1.f2 IN ( SELECT t2.f FROM t2 INNER JOIN t3 );
connection default;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
diff --git a/mysql-test/suite/innodb/r/mdev-15707.result b/mysql-test/suite/innodb/r/mdev-15707.result
deleted file mode 100644
index 3967ce48..00000000
--- a/mysql-test/suite/innodb/r/mdev-15707.result
+++ /dev/null
@@ -1,24 +0,0 @@
-CREATE TABLE t1(
-a INT AUTO_INCREMENT PRIMARY KEY,
-b CHAR(255),
-INDEX(b))
-ENGINE=InnoDB;
-INSERT INTO t1(b) SELECT UUID();
-BEGIN;
-INSERT INTO t1(b) SELECT UUID() FROM t1;
-INSERT INTO t1(b) SELECT UUID() FROM t1;
-INSERT INTO t1(b) SELECT UUID() FROM t1;
-INSERT INTO t1(b) SELECT UUID() FROM t1;
-INSERT INTO t1(b) SELECT UUID() FROM t1;
-INSERT INTO t1(b) SELECT UUID() FROM t1;
-INSERT INTO t1(b) SELECT UUID() FROM t1;
-INSERT INTO t1(b) SELECT UUID() FROM t1;
-INSERT INTO t1(b) SELECT UUID() FROM t1;
-INSERT INTO t1(b) SELECT UUID() FROM t1;
-INSERT INTO t1(b) SELECT UUID() FROM t1;
-INSERT INTO t1(b) SELECT UUID() FROM t1;
-INSERT INTO t1(b) SELECT UUID() FROM t1;
-INSERT INTO t1(b) SELECT UUID() FROM t1;
-COMMIT;
-UPDATE t1 SET b=UUID();
-DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/monitor.result b/mysql-test/suite/innodb/r/monitor.result
index 1834032e..d97f741e 100644
--- a/mysql-test/suite/innodb/r/monitor.result
+++ b/mysql-test/suite/innodb/r/monitor.result
@@ -79,12 +79,8 @@ buffer_LRU_unzip_search_num_scan disabled
buffer_LRU_unzip_search_scanned_per_call disabled
buffer_page_read_index_leaf disabled
buffer_page_read_index_non_leaf disabled
-buffer_page_read_index_ibuf_leaf disabled
-buffer_page_read_index_ibuf_non_leaf disabled
buffer_page_read_undo_log disabled
buffer_page_read_index_inode disabled
-buffer_page_read_ibuf_free_list disabled
-buffer_page_read_ibuf_bitmap disabled
buffer_page_read_system_page disabled
buffer_page_read_trx_system disabled
buffer_page_read_fsp_hdr disabled
@@ -95,12 +91,8 @@ buffer_page_read_zblob2 disabled
buffer_page_read_other disabled
buffer_page_written_index_leaf disabled
buffer_page_written_index_non_leaf disabled
-buffer_page_written_index_ibuf_leaf disabled
-buffer_page_written_index_ibuf_non_leaf disabled
buffer_page_written_undo_log disabled
buffer_page_written_index_inode disabled
-buffer_page_written_ibuf_free_list disabled
-buffer_page_written_ibuf_bitmap disabled
buffer_page_written_system_page disabled
buffer_page_written_trx_system disabled
buffer_page_written_fsp_hdr disabled
@@ -168,14 +160,6 @@ adaptive_hash_rows_removed disabled
adaptive_hash_rows_deleted_no_hash_entry disabled
adaptive_hash_rows_updated disabled
file_num_open_files enabled
-ibuf_merges_insert enabled
-ibuf_merges_delete_mark enabled
-ibuf_merges_delete enabled
-ibuf_merges_discard_insert enabled
-ibuf_merges_discard_delete_mark enabled
-ibuf_merges_discard_delete enabled
-ibuf_merges enabled
-ibuf_size enabled
innodb_master_thread_sleeps disabled
innodb_activity_count enabled
innodb_master_active_loops disabled
diff --git a/mysql-test/suite/innodb/r/mvcc.result b/mysql-test/suite/innodb/r/mvcc.result
index 215b2165..3e6b0ad3 100644
--- a/mysql-test/suite/innodb/r/mvcc.result
+++ b/mysql-test/suite/innodb/r/mvcc.result
@@ -1,5 +1,3 @@
-SET @save_per_table= @@GLOBAL.innodb_file_per_table;
-SET GLOBAL innodb_file_per_table= 1;
#
# MDEV-15249 Crash in MVCC read after IMPORT TABLESPACE
#
@@ -43,4 +41,3 @@ $$
INSERT INTO t1 SET id=1,c294=1;
REPLACE t1 SET id=1,c294=1;
DROP TABLE t1;
-SET GLOBAL innodb_file_per_table= @save_per_table;
diff --git a/mysql-test/suite/innodb/r/page_reorganize.result b/mysql-test/suite/innodb/r/page_reorganize.result
index fe85926e..c86d0cf9 100644
--- a/mysql-test/suite/innodb/r/page_reorganize.result
+++ b/mysql-test/suite/innodb/r/page_reorganize.result
@@ -15,7 +15,7 @@ connection default;
SET @save_dbug = @@debug_dbug;
SET DEBUG_DBUG = '+d,do_page_reorganize,do_lock_reverse_page_reorganize';
insert into t1(f2) values (repeat('+', 100));
-SET DEBUG = @save_dbug;
+SET DEBUG_DBUG = @save_dbug;
commit;
connection con1;
f1
diff --git a/mysql-test/suite/innodb/r/partition_locking.result b/mysql-test/suite/innodb/r/partition_locking.result
index f25b8a15..b5e96f96 100644
--- a/mysql-test/suite/innodb/r/partition_locking.result
+++ b/mysql-test/suite/innodb/r/partition_locking.result
@@ -148,7 +148,7 @@ a b c d e
03 03 343 7 03_03_343
03 06 343 8 03_06_343
03 07 343 9 03_07_343
-SELECT a,count(b) FROM t1 GROUP BY a ORDER BY a LOCK IN SHARE MODE SKIP LOCKED;
+SELECT a,count(b) FROM t1 force index (a) GROUP BY a ORDER BY a LOCK IN SHARE MODE SKIP LOCKED;
a count(b)
01 5
03 3
diff --git a/mysql-test/suite/innodb/r/read_only_recovery.result b/mysql-test/suite/innodb/r/read_only_recovery.result
index 2cde5818..78815e56 100644
--- a/mysql-test/suite/innodb/r/read_only_recovery.result
+++ b/mysql-test/suite/innodb/r/read_only_recovery.result
@@ -29,6 +29,9 @@ UPDATE t SET a=3 WHERE a=1;
# Starting with MariaDB 10.2, innodb_read_only implies READ UNCOMMITTED.
# In earlier versions, this would return the last committed version
# (empty table)!
+SHOW VARIABLES LIKE "innodb_read_only";
+Variable_name Value
+innodb_read_only ON
SELECT * FROM t;
a
3
@@ -39,6 +42,8 @@ a
SET GLOBAL innodb_max_purge_lag_wait=0;
INSERT INTO mysql.innodb_index_stats
SELECT * FROM mysql.innodb_index_stats LIMIT 0;
+Test Temp tablespace truncate in read only mode
+SET GLOBAL innodb_truncate_temporary_tablespace_now=1;
# restart
SELECT * FROM t;
a
diff --git a/mysql-test/suite/innodb/r/restart,16k.rdiff b/mysql-test/suite/innodb/r/restart,16k.rdiff
index b36ed067..3149b9ae 100644
--- a/mysql-test/suite/innodb/r/restart,16k.rdiff
+++ b/mysql-test/suite/innodb/r/restart,16k.rdiff
@@ -1,5 +1,5 @@
---- ./suite/innodb/r/restart.result 2022-01-18 20:36:56.054653376 +1100
-+++ suite/innodb/r/restart.reject 2022-01-19 08:12:28.602794678 +1100
+--- ./suite/innodb/r/restart.result
++++ suite/innodb/r/restart.reject
@@ -32,10 +32,10 @@
SELECT @@innodb_buffer_pool_size INTO @innodb_buffer_pool_size_orig;
SELECT CEILING((256 + 64) * @@innodb_page_size / 1048576) * 1048576 INTO @min_pool_size;
diff --git a/mysql-test/suite/innodb/r/restart,32k.rdiff b/mysql-test/suite/innodb/r/restart,32k.rdiff
index 8fa05781..3f00646c 100644
--- a/mysql-test/suite/innodb/r/restart,32k.rdiff
+++ b/mysql-test/suite/innodb/r/restart,32k.rdiff
@@ -1,5 +1,5 @@
---- ./suite/innodb/r/restart.result 2022-01-18 20:36:56.054653376 +1100
-+++ suite/innodb/r/restart.reject 2022-01-19 08:07:57.402230887 +1100
+--- ./suite/innodb/r/restart.result
++++ suite/innodb/r/restart.reject
@@ -32,10 +32,10 @@
SELECT @@innodb_buffer_pool_size INTO @innodb_buffer_pool_size_orig;
SELECT CEILING((256 + 64) * @@innodb_page_size / 1048576) * 1048576 INTO @min_pool_size;
diff --git a/mysql-test/suite/innodb/r/restart,4k.rdiff b/mysql-test/suite/innodb/r/restart,4k.rdiff
index 7d084636..b00c56ef 100644
--- a/mysql-test/suite/innodb/r/restart,4k.rdiff
+++ b/mysql-test/suite/innodb/r/restart,4k.rdiff
@@ -1,5 +1,5 @@
---- ./suite/innodb/r/restart.result 2022-01-18 20:36:56.054653376 +1100
-+++ suite/innodb/r/restart.reject 2022-01-19 08:13:56.397475513 +1100
+--- ./suite/innodb/r/restart.result
++++ suite/innodb/r/restart.reject
@@ -32,10 +32,10 @@
SELECT @@innodb_buffer_pool_size INTO @innodb_buffer_pool_size_orig;
SELECT CEILING((256 + 64) * @@innodb_page_size / 1048576) * 1048576 INTO @min_pool_size;
diff --git a/mysql-test/suite/innodb/r/restart,64k.rdiff b/mysql-test/suite/innodb/r/restart,64k.rdiff
index 3ac9f45b..886cbcde 100644
--- a/mysql-test/suite/innodb/r/restart,64k.rdiff
+++ b/mysql-test/suite/innodb/r/restart,64k.rdiff
@@ -1,5 +1,5 @@
---- ./suite/innodb/r/restart.result 2022-01-18 20:36:56.054653376 +1100
-+++ suite/innodb/r/restart.reject 2022-01-19 08:11:32.418759095 +1100
+--- ./suite/innodb/r/restart.result
++++ suite/innodb/r/restart.reject
@@ -32,10 +32,10 @@
SELECT @@innodb_buffer_pool_size INTO @innodb_buffer_pool_size_orig;
SELECT CEILING((256 + 64) * @@innodb_page_size / 1048576) * 1048576 INTO @min_pool_size;
diff --git a/mysql-test/suite/innodb/r/restart,8k.rdiff b/mysql-test/suite/innodb/r/restart,8k.rdiff
index 4da55ebf..40a9e1ba 100644
--- a/mysql-test/suite/innodb/r/restart,8k.rdiff
+++ b/mysql-test/suite/innodb/r/restart,8k.rdiff
@@ -1,5 +1,5 @@
---- ./suite/innodb/r/restart.result 2022-01-18 20:36:56.054653376 +1100
-+++ suite/innodb/r/restart.reject 2022-01-19 08:13:11.027788852 +1100
+--- ./suite/innodb/r/restart.result
++++ suite/innodb/r/restart.reject
@@ -32,10 +32,10 @@
SELECT @@innodb_buffer_pool_size INTO @innodb_buffer_pool_size_orig;
SELECT CEILING((256 + 64) * @@innodb_page_size / 1048576) * 1048576 INTO @min_pool_size;
diff --git a/mysql-test/suite/innodb/r/row_format_redundant.result b/mysql-test/suite/innodb/r/row_format_redundant.result
index e3356c63..3fa0bf8e 100644
--- a/mysql-test/suite/innodb/r/row_format_redundant.result
+++ b/mysql-test/suite/innodb/r/row_format_redundant.result
@@ -1,11 +1,9 @@
SET GLOBAL innodb_fast_shutdown=0;
-# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-data-file-path=ibdata1:1M:autoextend --innodb-undo-tablespaces=0 --innodb-stats-persistent=0
-SET GLOBAL innodb_file_per_table=1;
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-data-file-path=ibdata1:1M:autoextend --innodb_undo_directory=MYSQLTEST_VARDIR/tmp/undo_dir --innodb-undo-tablespaces=0 --innodb-stats-persistent=0
#
# Bug#21644827 - FTS, ASSERT !SRV_READ_ONLY_MODE || M_IMPL.M_LOG_MODE ==
# MTR_LOG_NO_REDO
#
-SET GLOBAL innodb_file_per_table=ON;
create table t1 (a int not null, d varchar(15) not null, b
varchar(198) not null, c char(156)) engine=InnoDB
row_format=redundant;
@@ -16,6 +14,8 @@ insert into t values(789, 'abcdef', 'jghikl', 'mnop');
insert into t values(134, 'kasdfsdsadf', 'adfjlasdkfjasd', 'adfsadflkasdasdfljasdf');
insert into t1 select a,d,b,c from t, seq_1_to_1024;
SET GLOBAL innodb_file_per_table=OFF;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
create table t2 (a int not null, d varchar(15) not null, b
varchar(198) not null, c char(156), fulltext ftsic(c)) engine=InnoDB
row_format=redundant;
@@ -25,8 +25,7 @@ c varchar(150), index k1(c(99), b(56)), index k2(b(5), c(10))) engine=InnoDB
row_format=redundant;
insert into t3 values(444, 'dddd', 'bbbbb', 'aaaaa');
insert into t3 values(555, 'eeee', 'ccccc', 'aaaaa');
-SET GLOBAL innodb_fast_shutdown=0;
-# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-data-file-path=ibdata1:1M:autoextend --innodb-undo-tablespaces=0 --innodb-stats-persistent=0 --innodb-read-only
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-data-file-path=ibdata1:1M:autoextend --innodb_undo_directory=MYSQLTEST_VARDIR/tmp/undo_dir --innodb-undo-tablespaces=0 --innodb-stats-persistent=0 --innodb-read-only
SELECT COUNT(*) FROM t1;
COUNT(*)
4096
@@ -42,14 +41,14 @@ TRUNCATE TABLE t2;
ERROR HY000: Table 't2' is read only
TRUNCATE TABLE t3;
ERROR HY000: Table 't3' is read only
-# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-data-file-path=ibdata1:1M:autoextend --innodb-undo-tablespaces=0 --innodb-stats-persistent=0 --skip-innodb-fast-shutdown
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-data-file-path=ibdata1:1M:autoextend --innodb_undo_directory=MYSQLTEST_VARDIR/tmp/undo_dir --innodb-undo-tablespaces=0 --innodb-stats-persistent=0 --skip-innodb-fast-shutdown
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
TRUNCATE TABLE t3;
corrupted SYS_TABLES.MIX_LEN for test/t1
corrupted SYS_TABLES.MIX_LEN for test/t2
corrupted SYS_TABLES.MIX_LEN for test/t3
-# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-data-file-path=ibdata1:1M:autoextend --innodb-undo-tablespaces=0 --innodb-stats-persistent=0 --skip-innodb-fast-shutdown
+# restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/row_format_redundant --innodb-data-file-path=ibdata1:1M:autoextend --innodb_undo_directory=MYSQLTEST_VARDIR/tmp/undo_dir --innodb-undo-tablespaces=0 --innodb-stats-persistent=0 --skip-innodb-fast-shutdown
TRUNCATE TABLE t1;
ERROR 42S02: Table 'test.t1' doesn't exist in engine
TRUNCATE TABLE t2;
@@ -68,7 +67,7 @@ DROP TABLE t1;
Warnings:
Warning 1932 Table 'test.t1' doesn't exist in engine
DROP TABLE t2,t3;
-FOUND 5 /\[ERROR\] InnoDB: Table test/t1 in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=1 SYS_TABLES\.MIX_LEN=511\b/ in mysqld.1.err
+FOUND 1 /\[ERROR\] InnoDB: Table test/t1 in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=1 SYS_TABLES\.MIX_LEN=511\b.*/ in mysqld.1.err
# restart
ib_logfile0
ibdata1
diff --git a/mysql-test/suite/innodb/r/scrub.result b/mysql-test/suite/innodb/r/scrub.result
index 4b976c32..5b8dd17d 100644
--- a/mysql-test/suite/innodb/r/scrub.result
+++ b/mysql-test/suite/innodb/r/scrub.result
@@ -1,6 +1,8 @@
SET GLOBAL
innodb_file_per_table=OFF,
innodb_immediate_scrub_data_uncompressed=ON;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL,
f3 INT NOT NULL, INDEX(f1),
INDEX(f2), INDEX(f3))ENGINE=InnoDB;
diff --git a/mysql-test/suite/innodb/r/sys_truncate.result b/mysql-test/suite/innodb/r/sys_truncate.result
new file mode 100644
index 00000000..bb8eafbe
--- /dev/null
+++ b/mysql-test/suite/innodb/r/sys_truncate.result
@@ -0,0 +1,21 @@
+SET GLOBAL INNODB_FILE_PER_TABLE= 0;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
+SET UNIQUE_CHECKS=0, FOREIGN_KEY_CHECKS=0;
+CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL,
+f3 INT NOT NULL, INDEX(f1),
+INDEX(f2), INDEX(f3))ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+COMMIT;
+DROP TABLE t1;
+InnoDB 0 transactions not purged
+SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
+NAME FILE_SIZE
+innodb_system 77594624
+# restart
+SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
+NAME FILE_SIZE
+innodb_system 10485760
diff --git a/mysql-test/suite/innodb/r/sys_truncate_debug.result b/mysql-test/suite/innodb/r/sys_truncate_debug.result
new file mode 100644
index 00000000..f122e944
--- /dev/null
+++ b/mysql-test/suite/innodb/r/sys_truncate_debug.result
@@ -0,0 +1,49 @@
+call mtr.add_suppression("InnoDB: Cannot shrink the system tablespace");
+call mtr.add_suppression("InnoDB: Plugin initialization aborted");
+call mtr.add_suppression("Plugin 'InnoDB' init function returned error");
+call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
+SET GLOBAL INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=2;
+SET GLOBAL INNODB_FILE_PER_TABLE= 0;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
+SET UNIQUE_CHECKS=0, FOREIGN_KEY_CHECKS=0;
+CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL,
+f3 INT NOT NULL, INDEX(f1),
+INDEX(f2), INDEX(f3))ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+COMMIT;
+DROP TABLE t1;
+InnoDB 0 transactions not purged
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE = 0;
+NAME FILE_SIZE
+innodb_system 540016640
+# restart: --debug_dbug=+d,shrink_buffer_pool_full
+FOUND 1 /\[Warning\] InnoDB: Cannot shrink the system tablespace/ in mysqld.1.err
+SELECT * FROM INFORMATION_SCHEMA.ENGINES
+WHERE engine = 'innodb'
+AND support IN ('YES', 'DEFAULT', 'ENABLED');
+ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
+InnoDB YES Supports transactions, row-level locking, foreign keys and encryption for tables YES YES YES
+# restart: --debug_dbug=+d,mtr_log_max_size
+FOUND 1 /\[ERROR\] InnoDB: Cannot shrink the system tablespace/ in mysqld.1.err
+SELECT * FROM INFORMATION_SCHEMA.ENGINES
+WHERE engine = 'innodb'
+AND support IN ('YES', 'DEFAULT', 'ENABLED');
+ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
+InnoDB YES Supports transactions, row-level locking, foreign keys and encryption for tables YES YES YES
+# restart: --debug_dbug=+d,crash_after_sys_truncate
+SELECT * FROM INFORMATION_SCHEMA.ENGINES
+WHERE engine = 'innodb'
+AND support IN ('YES', 'DEFAULT', 'ENABLED');
+ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
+# restart: --innodb_buffer_pool_size=5M
+SELECT * FROM INFORMATION_SCHEMA.ENGINES
+WHERE engine = 'innodb'
+AND support IN ('YES', 'DEFAULT', 'ENABLED');
+ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
+InnoDB YES Supports transactions, row-level locking, foreign keys and encryption for tables YES YES YES
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE=0;
+NAME FILE_SIZE
+innodb_system 3145728
diff --git a/mysql-test/suite/innodb/r/sys_truncate_large.result b/mysql-test/suite/innodb/r/sys_truncate_large.result
new file mode 100644
index 00000000..3b085ec4
--- /dev/null
+++ b/mysql-test/suite/innodb/r/sys_truncate_large.result
@@ -0,0 +1,22 @@
+set global innodb_file_per_table=0;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
+set global innodb_limit_optimistic_insert_debug=2;
+set unique_checks=0, foreign_key_checks=0;
+create table t1(f1 int not null)engine=innodb;
+begin;
+insert into t1 select * from seq_1_to_8192;
+insert into t1 select * from seq_1_to_8192;
+insert into t1 select * from seq_1_to_65536;
+commit;
+create table t2(f1 int not null)engine=innodb;
+insert into t2 select * from seq_1_to_65536;
+create table t3(f1 int not null)engine=innodb;
+insert into t3 select * from seq_1_to_65536;
+CREATE TABLE t4(f1 int not null)engine=innodb;
+insert into t4 select * from seq_1_to_65536;
+drop table t2;
+drop table t4;
+InnoDB 0 transactions not purged
+# restart
+drop table t3, t1;
diff --git a/mysql-test/suite/innodb/r/sys_truncate_shutdown.result b/mysql-test/suite/innodb/r/sys_truncate_shutdown.result
new file mode 100644
index 00000000..ee567a76
--- /dev/null
+++ b/mysql-test/suite/innodb/r/sys_truncate_shutdown.result
@@ -0,0 +1,23 @@
+SET GLOBAL innodb_fast_shutdown=0;
+# restart
+SET GLOBAL INNODB_FILE_PER_TABLE= 0;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
+SET UNIQUE_CHECKS=0, FOREIGN_KEY_CHECKS=0;
+CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL,
+f3 INT NOT NULL, INDEX(f1),
+INDEX(f2), INDEX(f3))ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+COMMIT;
+DROP TABLE t1;
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE = 0;
+NAME FILE_SIZE
+innodb_system 70254592
+SET GLOBAL innodb_fast_shutdown=0;
+# restart
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE = 0;
+NAME FILE_SIZE
+innodb_system 3145728
diff --git a/mysql-test/suite/innodb/r/sys_truncate_shutdown_debug.result b/mysql-test/suite/innodb/r/sys_truncate_shutdown_debug.result
new file mode 100644
index 00000000..0aad5af9
--- /dev/null
+++ b/mysql-test/suite/innodb/r/sys_truncate_shutdown_debug.result
@@ -0,0 +1,41 @@
+call mtr.add_suppression("InnoDB: Cannot shrink the system tablespace");
+call mtr.add_suppression("InnoDB: Plugin initialization aborted");
+call mtr.add_suppression("Plugin 'InnoDB' init function returned error");
+call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
+SET GLOBAL innodb_fast_shutdown=0;
+# restart
+SET GLOBAL INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=2;
+SET GLOBAL INNODB_FILE_PER_TABLE= 0;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
+SET UNIQUE_CHECKS=0, FOREIGN_KEY_CHECKS=0;
+CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL,
+f3 INT NOT NULL, INDEX(f1),
+INDEX(f2), INDEX(f3))ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+COMMIT;
+DROP TABLE t1;
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE = 0;
+NAME FILE_SIZE
+innodb_system 540016640
+SET GLOBAL INNODB_FAST_SHUTDOWN=0;
+SET GLOBAL DEBUG_DBUG="+d,shrink_buffer_pool_full";
+# restart
+FOUND 1 /\[Warning\] InnoDB: Cannot shrink the system tablespace/ in mysqld.1.err
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE = 0;
+NAME FILE_SIZE
+innodb_system 540016640
+SET GLOBAL INNODB_FAST_SHUTDOWN=0;
+SET GLOBAL DEBUG_DBUG="+d,mtr_log_max_size";
+# restart
+FOUND 1 /\[ERROR\] InnoDB: Cannot shrink the system tablespace/ in mysqld.1.err
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE = 0;
+NAME FILE_SIZE
+innodb_system 540016640
+SET GLOBAL INNODB_FAST_SHUTDOWN=0;
+# restart: --debug_dbug=+d,crash_after_sys_truncate
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE = 0;
+NAME FILE_SIZE
+innodb_system 3145728
diff --git a/mysql-test/suite/innodb/r/table_flags.result b/mysql-test/suite/innodb/r/table_flags.result
index cc32472f..e38eb93e 100644
--- a/mysql-test/suite/innodb/r/table_flags.result
+++ b/mysql-test/suite/innodb/r/table_flags.result
@@ -1,5 +1,4 @@
# restart: with restart_parameters
-SET GLOBAL innodb_file_per_table=1;
CREATE TABLE tr(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
CREATE TABLE tc(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPACT;
CREATE TABLE td(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
diff --git a/mysql-test/suite/innodb/r/table_index_statistics.result b/mysql-test/suite/innodb/r/table_index_statistics.result
index 286c5f93..ddb23afd 100644
--- a/mysql-test/suite/innodb/r/table_index_statistics.result
+++ b/mysql-test/suite/innodb/r/table_index_statistics.result
@@ -14,13 +14,11 @@ ROWS_READ
10
SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';
ROWS_READ
-10
FLUSH TABLE_STATISTICS;
SELECT ROWS_READ FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME='t1';
ROWS_READ
SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';
ROWS_READ
-10
FLUSH INDEX_STATISTICS;
SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';
ROWS_READ
@@ -32,7 +30,6 @@ ROWS_READ
10
SELECT ROWS_READ FROM INFORMATION_SCHEMA.INDEX_STATISTICS WHERE TABLE_NAME='t1';
ROWS_READ
-10
DROP TABLE t1;
CREATE TABLE t2 (c1 INT UNSIGNED);
ALTER TABLE t2 MODIFY c1 FLOAT;
diff --git a/mysql-test/suite/innodb/r/temp_truncate.result b/mysql-test/suite/innodb/r/temp_truncate.result
new file mode 100644
index 00000000..2b241feb
--- /dev/null
+++ b/mysql-test/suite/innodb/r/temp_truncate.result
@@ -0,0 +1,46 @@
+# MDEV-33101 Server crashes when starting the server with
+# innodb-force-recovery=6 and enabling the
+# innodb_truncate_temporary_tablespace_now variable
+# restart: --innodb-force-recovery=6
+SHOW VARIABLES LIKE "innodb_read_only";
+Variable_name Value
+innodb_read_only ON
+SET GLOBAL innodb_truncate_temporary_tablespace_now=1;
+# restart
+CREATE TEMPORARY TABLE t1(f1 INT NOT NULL,
+f2 INT NOT NULL)ENGINE=InnoDB;
+INSERT INTO t1 SELECT seq, seq FROM seq_1_to_65536;
+DROP TABLE t1;
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE=4294967294;
+NAME FILE_SIZE
+innodb_temporary 72351744
+SET GLOBAL INNODB_TRUNCATE_TEMPORARY_TABLESPACE_NOW= 0;
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE=4294967294;
+NAME FILE_SIZE
+innodb_temporary 72351744
+SET GLOBAL INNODB_TRUNCATE_TEMPORARY_TABLESPACE_NOW= 1;
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE= 4294967294;
+NAME FILE_SIZE
+innodb_temporary 5242880
+CREATE TEMPORARY TABLE t1(f1 INT NOT NULL,
+f2 INT NOT NULL)ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t1 SELECT seq, seq FROM seq_1_to_65536;
+connect con1,localhost,root,,,;
+CREATE TEMPORARY TABLE t2(f1 INT NOT NULL,
+f2 INT NOT NULL)ENGINE=InnoDB;
+INSERT INTO t2 SELECT seq, seq FROM seq_1_to_65536;
+DROP TABLE t2;
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE=4294967294;
+NAME FILE_SIZE
+innodb_temporary 72351744
+SET GLOBAL INNODB_TRUNCATE_TEMPORARY_TABLESPACE_NOW= 1;
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE= 4294967294;
+NAME FILE_SIZE
+innodb_temporary 7340032
+connection default;
+COMMIT;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+65536
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/temp_truncate_debug.result b/mysql-test/suite/innodb/r/temp_truncate_debug.result
new file mode 100644
index 00000000..37809c0a
--- /dev/null
+++ b/mysql-test/suite/innodb/r/temp_truncate_debug.result
@@ -0,0 +1,22 @@
+call mtr.add_suppression("InnoDB: Cannot shrink the temporary tablespace");
+# restart
+SET GLOBAL INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=2;
+CREATE TEMPORARY TABLE t1(f1 INT NOT NULL,
+f2 INT NOT NULL)ENGINE=InnoDB;
+INSERT INTO t1 SELECT seq, seq FROM seq_1_to_65536;
+DROP TABLE t1;
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE= 4294967294;
+NAME FILE_SIZE
+innodb_temporary 1146093568
+SET @saved_debug_dbug = @@SESSION.debug_dbug;
+SET DEBUG_DBUG="+d,fail_temp_truncate";
+SET GLOBAL INNODB_TRUNCATE_TEMPORARY_TABLESPACE_NOW= 1;
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE= 4294967294;
+NAME FILE_SIZE
+innodb_temporary 1146093568
+SET DEBUG_DBUG=@saved_debug_dbug;
+SET GLOBAL INNODB_TRUNCATE_TEMPORARY_TABLESPACE_NOW= 1;
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE= 4294967294;
+NAME FILE_SIZE
+innodb_temporary 5242880
+SET GLOBAL INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=default;
diff --git a/mysql-test/suite/innodb/r/temporary_table.result b/mysql-test/suite/innodb/r/temporary_table.result
index ffcee726..e90302da 100644
--- a/mysql-test/suite/innodb/r/temporary_table.result
+++ b/mysql-test/suite/innodb/r/temporary_table.result
@@ -709,12 +709,12 @@ UPDATE t1 SET a= 2;
COMMIT;
DROP TABLE t1;
CREATE TEMPORARY TABLE t(c INT) ENGINE=InnoDB;
-SET SESSION tx_read_only=TRUE;
+SET SESSION TRANSACTION_READ_ONLY=TRUE;
LOCK TABLE test.t READ;
SELECT * FROM t;
c
INSERT INTO t VALUES(0xADC3);
-SET SESSION tx_read_only=FALSE;
+SET SESSION TRANSACTION_READ_ONLY=FALSE;
DROP TABLE t;
CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
@@ -748,27 +748,27 @@ COMMIT;
DROP TABLE t1;
CREATE TEMPORARY TABLE tmp (a INT) ENGINE=InnoDB;
INSERT INTO tmp () VALUES (),();
-SET TX_READ_ONLY= 1;
+SET TRANSACTION_READ_ONLY= 1;
INSERT INTO tmp SELECT * FROM tmp;
-SET TX_READ_ONLY= 0;
+SET TRANSACTION_READ_ONLY= 0;
DROP TABLE tmp;
SET sql_mode='';
-SET GLOBAL tx_read_only=TRUE;
+SET GLOBAL TRANSACTION_READ_ONLY=TRUE;
CREATE TEMPORARY TABLE t (c INT);
-SET SESSION tx_read_only=DEFAULT;
+SET SESSION TRANSACTION_READ_ONLY=DEFAULT;
INSERT INTO t VALUES(1);
INSERT INTO t SELECT * FROM t;
-SET SESSION tx_read_only=FALSE;
-SET GLOBAL tx_read_only=OFF;
+SET SESSION TRANSACTION_READ_ONLY=FALSE;
+SET GLOBAL TRANSACTION_READ_ONLY=OFF;
DROP TABLE t;
CREATE TEMPORARY TABLE t(a INT);
-SET SESSION tx_read_only=ON;
+SET SESSION TRANSACTION_READ_ONLY=ON;
LOCK TABLE t READ;
SELECT COUNT(*)FROM t;
COUNT(*)
0
INSERT INTO t VALUES (0);
-SET SESSION tx_read_only=OFF;
+SET SESSION TRANSACTION_READ_ONLY=OFF;
DROP TABLE t;
CREATE TEMPORARY TABLE t (a INT) ENGINE=InnoDB;
INSERT INTO t VALUES (1);
diff --git a/mysql-test/suite/innodb/r/undo_upgrade.result b/mysql-test/suite/innodb/r/undo_upgrade.result
index f2eca9e2..0f0b72f2 100644
--- a/mysql-test/suite/innodb/r/undo_upgrade.result
+++ b/mysql-test/suite/innodb/r/undo_upgrade.result
@@ -62,3 +62,27 @@ SELECT @@global.innodb_undo_tablespaces;
# Should list 2 undo log tablespaces, not 4
undo001
undo002
+#
+# MDEV-34200 InnoDB tries to write to read-only
+# system tablespace in buf_dblwr_t::init_or_load_pages()
+#
+SET GLOBAL innodb_fast_shutdown=0;
+# restart: --innodb_undo_tablespaces=4
+# Should list 4 undo log tablespaces
+undo001
+undo002
+undo003
+undo004
+set global innodb_fast_shutdown=0;
+# restart: --innodb_read_only=1
+set global innodb_fast_shutdown=0;
+# restart: --innodb-data-file-path=ibdata1:1M:autoextend --innodb_undo_directory=MYSQLTEST_VARDIR/tmp/undo_dir --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/bugdir --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/bugdir --innodb_undo_tablespaces=3
+# Should list 3 undo log tablespaces
+undo001
+undo002
+undo003
+set global innodb_fast_shutdown=0;
+# restart: --innodb-data-file-path=ibdata1:1M:autoextend --innodb_undo_directory=MYSQLTEST_VARDIR/tmp/undo_dir --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/bugdir_1 --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/bugdir_1 --innodb_undo_tablespaces=0
+# Shouldn't list 0 undo log tablespaces
+set global innodb_fast_shutdown=0;
+# restart
diff --git a/mysql-test/suite/innodb/t/alter_kill-master.opt b/mysql-test/suite/innodb/t/alter_kill-master.opt
index e472160c..9eb72834 100644
--- a/mysql-test/suite/innodb/t/alter_kill-master.opt
+++ b/mysql-test/suite/innodb/t/alter_kill-master.opt
@@ -1 +1 @@
---innodb-doublewrite=false
+--innodb-flush-method=O_DIRECT_NO_FSYNC --skip-innodb-doublewrite
diff --git a/mysql-test/suite/innodb/t/alter_kill.test b/mysql-test/suite/innodb/t/alter_kill.test
index 100beb76..3936b3fd 100644
--- a/mysql-test/suite/innodb/t/alter_kill.test
+++ b/mysql-test/suite/innodb/t/alter_kill.test
@@ -7,6 +7,9 @@
let MYSQLD_DATADIR=`select @@datadir`;
let PAGE_SIZE=`select @@innodb_page_size`;
+SELECT @@innodb_doublewrite;
+SET GLOBAL innodb_doublewrite=fast;
+
-- disable_query_log
call mtr.add_suppression("InnoDB: innodb_force_recovery is on.");
call mtr.add_suppression("InnoDB: Ignoring tablespace for.*bug16720368");
@@ -25,7 +28,6 @@ call mtr.add_suppression("Table .*bug16720368.* is corrupted");
-- echo # Bug#16720368 INNODB CRASHES ON BROKEN #SQL*.IBD FILE AT STARTUP
-- echo #
-SET GLOBAL innodb_file_per_table=1;
SET GLOBAL innodb_stats_persistent=0;
CREATE TABLE bug16720368_1 (a INT PRIMARY KEY) ENGINE=InnoDB;
@@ -74,8 +76,11 @@ syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n";
close(FILE) || die "Unable to close $file";
EOF
+-- let $restart_parameters=--innodb-flush-method=O_DIRECT
-- source include/start_mysqld.inc
+-- let $restart_parameters=
+SELECT @@innodb_doublewrite;
--error ER_TABLE_CORRUPT
SELECT COUNT(*) FROM bug16720368;
--error ER_TABLE_CORRUPT
@@ -129,8 +134,6 @@ DROP TABLE bug16720368, bug16720368_1;
-- echo # DICT_TABLE_ADD_TO_CACHE
-- echo #
-SET GLOBAL innodb_file_per_table=1;
-
CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
BEGIN;
INSERT INTO t1 VALUES(42);
diff --git a/mysql-test/suite/innodb/t/alter_missing_tablespace.test b/mysql-test/suite/innodb/t/alter_missing_tablespace.test
index 9742adc3..ff93ec5f 100644
--- a/mysql-test/suite/innodb/t/alter_missing_tablespace.test
+++ b/mysql-test/suite/innodb/t/alter_missing_tablespace.test
@@ -21,7 +21,6 @@ call mtr.add_suppression("InnoDB: ALTER TABLE `test`.`t` DISCARD TABLESPACE fail
--enable_query_log
let $MYSQLD_DATADIR=`select @@datadir`;
-SET GLOBAL innodb_file_per_table=1;
CREATE TABLE t(a SERIAL)ENGINE=InnoDB;
CREATE TABLE `x..d` (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
CREATE TABLE t1(a SERIAL)ENGINE=InnoDB;
diff --git a/mysql-test/suite/innodb/t/autoinc_persist.test b/mysql-test/suite/innodb/t/autoinc_persist.test
index ac933cc7..29e8c764 100644
--- a/mysql-test/suite/innodb/t/autoinc_persist.test
+++ b/mysql-test/suite/innodb/t/autoinc_persist.test
@@ -393,7 +393,7 @@ INSERT INTO mdev6076a VALUES(2),(1);
CREATE TABLE mdev6076b (b INT) ENGINE=InnoDB;
INSERT INTO mdev6076b VALUES(2),(1);
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-ALTER TABLE mdev6076a ADD COLUMN a SERIAL FIRST, LOCK=NONE;
+ALTER TABLE mdev6076a ADD COLUMN a SERIAL FIRST, ALGORITHM=INPLACE, LOCK=NONE;
ALTER TABLE mdev6076a ADD COLUMN a SERIAL FIRST, ALGORITHM=INPLACE;
ALTER TABLE mdev6076b ADD COLUMN a SERIAL FIRST, AUTO_INCREMENT=100,
ALGORITHM=INPLACE;
diff --git a/mysql-test/suite/innodb/t/defrag_mdl-9155.test b/mysql-test/suite/innodb/t/defrag_mdl-9155.test
deleted file mode 100644
index 1e1efb9c..00000000
--- a/mysql-test/suite/innodb/t/defrag_mdl-9155.test
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# MDEV-9155 Enabling Defragmenting in 10.1.8 still causes OPTIMIZE TABLE to take metadatalocks
-#
-source include/have_innodb.inc;
-source include/have_sequence.inc;
-
-set global innodb_defragment=1;
-create table t1 (a int not null primary key auto_increment, b varchar(256), key second(a, b)) engine=innodb;
-insert t1 select null, repeat('a', 256) from seq_1_to_100;
-select count(*) from t1;
-
-connect (con1,localhost,root);
-start transaction;
-select count(*) from t1;
-
-connection default;
-optimize table t1;
-
-connection con1;
-drop table t1;
-
-set global innodb_defragment=default;
diff --git a/mysql-test/suite/innodb/t/encryption_threads_shutdown.test b/mysql-test/suite/innodb/t/encryption_threads_shutdown.test
index 5a63df5d..d6e58a19 100644
--- a/mysql-test/suite/innodb/t/encryption_threads_shutdown.test
+++ b/mysql-test/suite/innodb/t/encryption_threads_shutdown.test
@@ -10,10 +10,20 @@ call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE faile
--let $MYSQLD_DATADIR=`SELECT @@datadir`
--let $DATA= $MYSQLD_DATADIR/ibdata1
--let $DATACOPY=$MYSQLTEST_VARDIR/tmp/ibdata1
+--let $UNDO_1= $MYSQLD_DATADIR/undo001
+--let $UNDO_2= $MYSQLD_DATADIR/undo002
+--let $UNDO_3= $MYSQLD_DATADIR/undo003
+--let $UNDO_1_COPY=$MYSQLTEST_VARDIR/tmp/undo001
+--let $UNDO_2_COPY=$MYSQLTEST_VARDIR/tmp/undo002
+--let $UNDO_3_COPY=$MYSQLTEST_VARDIR/tmp/undo003
+
CREATE TABLE t(a INT) ENGINE=InnoDB;
--source include/kill_mysqld.inc
# Move the file to cause srv_init_abort_low() call from srv_start()
--move_file $DATA $DATACOPY
+--move_file $UNDO_1 $UNDO_1_COPY
+--move_file $UNDO_2 $UNDO_2_COPY
+--move_file $UNDO_3 $UNDO_3_COPY
# If the bug is not fixed, the server will hang here. Note that the test is
# unstable because the condition
@@ -28,5 +38,8 @@ CREATE TABLE t(a INT) ENGINE=InnoDB;
SELECT * FROM t;
--source include/kill_mysqld.inc
--move_file $DATACOPY $DATA
+--move_file $UNDO_1_COPY $UNDO_1
+--move_file $UNDO_2_COPY $UNDO_2
+--move_file $UNDO_3_COPY $UNDO_3
--source include/start_mysqld.inc
DROP TABLE t;
diff --git a/mysql-test/suite/innodb/t/gap_locks.test b/mysql-test/suite/innodb/t/gap_locks.test
index 77ce2c84..575a966e 100644
--- a/mysql-test/suite/innodb/t/gap_locks.test
+++ b/mysql-test/suite/innodb/t/gap_locks.test
@@ -2,7 +2,7 @@
CREATE TABLE t1(a INT PRIMARY KEY, b VARCHAR(40), c INT, INDEX(b,c))
ENGINE=InnoDB;
-INSERT INTO t1 VALUES (1,'1',1),(2,'2',1);
+INSERT INTO t1 VALUES (1,'1',1),(2,'2',1),(3,'3',1);
SET @save_locks= @@GLOBAL.innodb_status_output_locks;
SET GLOBAL INNODB_STATUS_OUTPUT_LOCKS = 'ON';
diff --git a/mysql-test/suite/innodb/t/ibuf_delete.test b/mysql-test/suite/innodb/t/ibuf_delete.test
deleted file mode 100644
index 82b740b6..00000000
--- a/mysql-test/suite/innodb/t/ibuf_delete.test
+++ /dev/null
@@ -1,67 +0,0 @@
---source include/have_innodb.inc
---source include/have_sequence.inc
-
-SET @buffering= @@innodb_change_buffering;
-SET GLOBAL innodb_change_buffering= deletes;
-SET @flush= @@innodb_flush_log_at_trx_commit;
-SET GLOBAL innodb_flush_log_at_trx_commit= 0;
-
-CREATE TABLE t1 (
- a varchar(1024),
- b varchar(1024),
- c varchar(1024),
- d varchar(1024),
- e varchar(1024),
- f varchar(1024),
- g varchar(1024),
- h varchar(1024),
- key (a),
- key (b),
- key (c),
- key (d)
-) ENGINE=InnoDB;
-
-INSERT INTO t1
-SELECT REPEAT('x',10), REPEAT('x',13), REPEAT('x',427), REPEAT('x',244),
-REPEAT('x',9), REPEAT('x',112), REPEAT('x',814), REPEAT('x',633)
-FROM seq_1_to_1024;
-
-CREATE TEMPORARY TABLE t2 (
- a varchar(1024),
- b varchar(1024),
- c varchar(1024),
- d varchar(1024),
- e varchar(1024),
- f varchar(1024),
- g varchar(1024),
- h varchar(1024),
- i varchar(1024),
- j varchar(1024),
- k varchar(1024),
- l varchar(1024),
- m varchar(1024),
- key (a),
- key (b),
- key (c),
- key (d),
- key (e),
- key (f)
-) ENGINE=InnoDB;
-
-SET @x=REPEAT('x',512);
-INSERT INTO t2 SELECT @x, @x, @x, @x, @x, @x, @x, @x, @x, @x, @x, @x, @x
-FROM seq_1_to_768;
-
---disable_query_log
---let $run=1024
-while ($run)
-{
- eval DELETE FROM t1 LIMIT 1 /* $run */;
- --dec $run
-}
---enable_query_log
-
-# Cleanup
-DROP TABLE t1, t2;
-SET GLOBAL innodb_change_buffering= @buffering;
-SET GLOBAL innodb_flush_log_at_trx_commit= @flush;
diff --git a/mysql-test/suite/innodb/t/ibuf_not_empty.combinations b/mysql-test/suite/innodb/t/ibuf_not_empty.combinations
deleted file mode 100644
index c4b45dcc..00000000
--- a/mysql-test/suite/innodb/t/ibuf_not_empty.combinations
+++ /dev/null
@@ -1,9 +0,0 @@
-[strict_crc32]
---innodb-checksum-algorithm=strict_crc32
---innodb-page-size=4k
---innodb-force-recovery=2
-
-[strict_full_crc32]
---innodb-checksum-algorithm=strict_full_crc32
---innodb-page-size=4k
---innodb-force-recovery=2
diff --git a/mysql-test/suite/innodb/t/ibuf_not_empty.test b/mysql-test/suite/innodb/t/ibuf_not_empty.test
deleted file mode 100644
index b1f3c270..00000000
--- a/mysql-test/suite/innodb/t/ibuf_not_empty.test
+++ /dev/null
@@ -1,118 +0,0 @@
---source include/have_innodb.inc
---source include/no_valgrind_without_big.inc
-# innodb_change_buffering_debug option is debug only
---source include/have_debug.inc
-# Embedded server tests do not support restarting
---source include/not_embedded.inc
---source include/have_sequence.inc
-
---disable_query_log
-call mtr.add_suppression("InnoDB: Failed to find tablespace for table `test`\\.`t1` in the cache\\. Attempting to load the tablespace with space id");
-call mtr.add_suppression("InnoDB: Allocated tablespace ID \\d+ for test.t1, old maximum was");
-call mtr.add_suppression("InnoDB: Failed to find tablespace for table `mysql`\\.`transaction_registry` in the cache\\. Attempting to load the tablespace with space id");
-call mtr.add_suppression("InnoDB: Allocated tablespace ID \\d+ for mysql.transaction_registry, old maximum was");
-call mtr.add_suppression("InnoDB: Trying to read 4096 bytes");
-call mtr.add_suppression("InnoDB: File './test/t1.ibd' is corrupted");
---enable_query_log
-
-CREATE TABLE t1(
- a INT AUTO_INCREMENT PRIMARY KEY,
- b CHAR(1),
- c INT,
- INDEX(b))
-ENGINE=InnoDB STATS_PERSISTENT=0;
-
-# The flag innodb_change_buffering_debug is only available in debug builds.
-# It instructs InnoDB to try to evict pages from the buffer pool when
-# change buffering is possible, so that the change buffer will be used
-# whenever possible.
-SET GLOBAL innodb_change_buffering_debug = 1;
-SET GLOBAL innodb_change_buffering=all;
-
-# Create enough rows for the table, so that the change buffer will be
-# used for modifying the secondary index page. There must be multiple
-# index pages, because changes to the root page are never buffered.
-INSERT INTO t1 SELECT 0,'x',1 FROM seq_1_to_1024;
-let MYSQLD_DATADIR=`select @@datadir`;
-let PAGE_SIZE=`select @@innodb_page_size`;
-
---source include/shutdown_mysqld.inc
-
-# Corrupt the change buffer bitmap, to claim that pages are clean
-perl;
-do "$ENV{MTR_SUITE_DIR}/include/crc32.pl";
-my $file = "$ENV{MYSQLD_DATADIR}/test/t1.ibd";
-open(FILE, "+<$file") || die "Unable to open $file";
-binmode FILE;
-my $ps= $ENV{PAGE_SIZE};
-my $page;
-die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
-my $full_crc32 = unpack("N",substr($page,54,4)) & 0x10; # FIL_SPACE_FLAGS
-die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
-# Clean the change buffer bitmap.
-substr($page,38,$ps - 38 - 8) = chr(0) x ($ps - 38 - 8);
-my $polynomial = 0x82f63b78; # CRC-32C
-if ($full_crc32)
-{
- my $ck = mycrc32(substr($page, 0, $ps-4), 0, $polynomial);
- substr($page, $ps-4, 4) = pack("N", $ck);
-}
-else
-{
- my $ck= pack("N",mycrc32(substr($page, 4, 22), 0, $polynomial) ^
- mycrc32(substr($page, 38, $ps - 38 - 8), 0, $polynomial));
- substr($page,0,4)=$ck;
- substr($page,$ps-8,4)=$ck;
-}
-sysseek(FILE, $ps, 0) || die "Unable to rewind $file\n";
-syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n";
-close(FILE) || die "Unable to close $file";
-EOF
-
---let $restart_parameters= --innodb-force-recovery=6 --innodb-change-buffer-dump
---source include/start_mysqld.inc
-
---replace_regex /contains \d+ entries/contains 990 entries/
-check table t1;
-SET GLOBAL innodb_buf_flush_list_now=ON;
-
---source include/shutdown_mysqld.inc
-
-# Truncate the file to 5 pages, as if it were empty
-perl;
-do "$ENV{MTR_SUITE_DIR}/include/crc32.pl";
-my $file = "$ENV{MYSQLD_DATADIR}/test/t1.ibd";
-open(FILE, "+<$file") || die "Unable to open $file";
-binmode FILE;
-my $ps= $ENV{PAGE_SIZE};
-my $pages=5;
-my $page;
-die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
-my $full_crc32 = unpack("N",substr($page,54,4)) & 0x10; # FIL_SPACE_FLAGS
-substr($page,46,4)=pack("N", $pages);
-my $polynomial = 0x82f63b78; # CRC-32C
-if ($full_crc32)
-{
- my $ck = mycrc32(substr($page, 0, $ps-4), 0, $polynomial);
- substr($page, $ps-4, 4) = pack("N", $ck);
-}
-else
-{
- my $ck= pack("N",mycrc32(substr($page, 4, 22), 0, $polynomial) ^
- mycrc32(substr($page, 38, $ps - 38 - 8), 0, $polynomial));
- substr($page,0,4)=$ck;
- substr($page,$ps-8,4)=$ck;
-}
-sysseek(FILE, 0, 0) || die "Unable to rewind $file\n";
-syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n";
-truncate(FILE, $ps * $pages);
-close(FILE) || die "Unable to close $file";
-EOF
-
---let $restart_parameters=--innodb-force_recovery=0
---source include/start_mysqld.inc
-SET GLOBAL innodb_fast_shutdown=0;
---source include/restart_mysqld.inc
-
-# Cleanup
-DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/import.test b/mysql-test/suite/innodb/t/import.test
new file mode 100644
index 00000000..307d2b40
--- /dev/null
+++ b/mysql-test/suite/innodb/t/import.test
@@ -0,0 +1,3 @@
+--source include/import_begin.inc
+--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg
+--source include/import_end.inc
diff --git a/mysql-test/suite/innodb/t/import_no_cfg.test b/mysql-test/suite/innodb/t/import_no_cfg.test
new file mode 100644
index 00000000..d22814fe
--- /dev/null
+++ b/mysql-test/suite/innodb/t/import_no_cfg.test
@@ -0,0 +1,4 @@
+# embedded server uses absolute path, causing result mismatch in warning messages
+--source include/not_embedded.inc
+--source include/import_begin.inc
+--source include/import_end.inc
diff --git a/mysql-test/suite/innodb/t/import_recovery.test b/mysql-test/suite/innodb/t/import_recovery.test
new file mode 100644
index 00000000..ebaa25ff
--- /dev/null
+++ b/mysql-test/suite/innodb/t/import_recovery.test
@@ -0,0 +1,163 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/not_embedded.inc
+
+--echo #
+--echo # MDEV-26137 ALTER TABLE IMPORT enhancement
+--echo #
+
+let MYSQLD_DATADIR = `SELECT @@datadir`;
+let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
+
+call mtr.add_suppression('InnoDB: Tablespace for table `test`.`t1` is set as discarded.');
+call mtr.add_suppression('InnoDB: Tablespace for table `test`.`t2` is set as discarded.');
+call mtr.add_suppression('InnoDB: Tablespace for table `test`.`t3` is set as discarded.');
+call mtr.add_suppression('InnoDB: ./test/t3.ibd: Page 0 at offset 0 looks corrupted.');
+call mtr.add_suppression("mariadbd.*: Index for table 't3' is corrupt; try to repair it");
+call mtr.add_suppression("InnoDB: Expected tablespace id \\d+ but found \\d+ in the file ./test/t3.ibd");
+# In Windows etc.
+call mtr.add_suppression("InnoDB: Corrupted page \\[page id: space=.*, page number=0\\] of datafile './test/t3.ibd' could not be found in the doublewrite buffer.");
+call mtr.add_suppression('InnoDB: Tablespace for table `test`.`t4` is set as discarded.');
+call mtr.add_suppression('InnoDB: ./test/t4.ibd: Page 0 at offset 0 looks corrupted.');
+call mtr.add_suppression("mariadbd.*: Index for table 't4' is corrupt; try to repair it");
+# In Windows etc.
+call mtr.add_suppression("InnoDB: Corrupted page \\[page id: space=.*, page number=0\\] of datafile './test/t4.ibd' could not be found in the doublewrite buffer.");
+
+--echo # Recovery from crashes
+--echo ## t1: Creation of stub succeeds; server crashes; second import attempt succeeds
+--echo ## t2: Creation of stub succeeds; server crashes; drop table
+--echo ## t3: Creation of stub succeeds; server crashes; ibd corrupted; second import attempt fails; drop table
+--echo ## t4: Did not copy .cfg; creation of stub succeeds; server crashes; ibd corrupted; second import attempt fails; drop table
+CREATE TABLE t (a int) ENGINE=InnoDB;
+INSERT INTO t VALUES(42);
+FLUSH TABLES t FOR EXPORT;
+--copy_file $MYSQLD_DATADIR/test/t.cfg $MYSQLD_DATADIR/test/t1.cfg
+--copy_file $MYSQLD_DATADIR/test/t.frm $MYSQLD_DATADIR/test/t1.frm
+--copy_file $MYSQLD_DATADIR/test/t.ibd $MYSQLD_DATADIR/test/t1.ibd
+--copy_file $MYSQLD_DATADIR/test/t.cfg $MYSQLD_DATADIR/test/t2.cfg
+--copy_file $MYSQLD_DATADIR/test/t.frm $MYSQLD_DATADIR/test/t2.frm
+--copy_file $MYSQLD_DATADIR/test/t.ibd $MYSQLD_DATADIR/test/t2.ibd
+--copy_file $MYSQLD_DATADIR/test/t.cfg $MYSQLD_DATADIR/test/t3.cfg
+--copy_file $MYSQLD_DATADIR/test/t.frm $MYSQLD_DATADIR/test/t3.frm
+--copy_file $MYSQLD_DATADIR/test/t.ibd $MYSQLD_DATADIR/test/t3.ibd
+--copy_file $MYSQLD_DATADIR/test/t.frm $MYSQLD_DATADIR/test/t4.frm
+--copy_file $MYSQLD_DATADIR/test/t.ibd $MYSQLD_DATADIR/test/t4.ibd
+UNLOCK TABLES;
+
+SET GLOBAL innodb_max_dirty_pages_pct_lwm=0.0;
+SET GLOBAL innodb_max_dirty_pages_pct=0.0;
+
+let $wait_condition =
+SELECT variable_value = 0
+FROM information_schema.global_status
+WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY';
+--source include/wait_condition.inc
+
+connect (hang1,localhost,root);
+SET DEBUG_SYNC='ib_after_create_stub_for_import SIGNAL hung WAIT_FOR ever';
+send ALTER TABLE t1 IMPORT TABLESPACE;
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR hung';
+
+connect (hang2,localhost,root);
+SET DEBUG_SYNC='ib_after_create_stub_for_import SIGNAL hung WAIT_FOR ever';
+send ALTER TABLE t2 IMPORT TABLESPACE;
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR hung';
+
+connect (hang3,localhost,root);
+SET DEBUG_SYNC='ib_after_create_stub_for_import SIGNAL hung WAIT_FOR ever';
+send ALTER TABLE t3 IMPORT TABLESPACE;
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR hung';
+
+connect (hang4,localhost,root);
+SET DEBUG_SYNC='ib_after_create_stub_for_import SIGNAL hung WAIT_FOR ever';
+send ALTER TABLE t4 IMPORT TABLESPACE;
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR hung';
+
+let $shutdown_timeout=0;
+--source include/shutdown_mysqld.inc
+
+--echo # corrupting the 0th page
+perl;
+my $ps = $ENV{INNODB_PAGE_SIZE};
+
+@tables= ('t3', 't4');
+foreach $table (@tables) {
+ my $file = "$ENV{MYSQLD_DATADIR}/test/$table.ibd";
+ open(FILE, "+<$file") || die "Unable to open $file";
+ binmode FILE;
+ sysseek(FILE, 0, 0) || die "Unable to seek $file\n";
+ die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
+ # Replace all NUL bytes with SOH bytes.
+ $page =~ tr/\x0/\x1/;
+ sysseek(FILE, 0, 0) || die "Unable to seek $file\n";
+ syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n";
+ close FILE or die "close";
+}
+EOF
+
+--echo # Restart mysqld after the crash and reconnect.
+--source include/start_mysqld.inc
+
+ALTER TABLE t1 IMPORT TABLESPACE;
+SHOW CREATE TABLE t1;
+SELECT * FROM t1;
+
+--error ER_INTERNAL_ERROR
+ALTER TABLE t3 IMPORT TABLESPACE;
+
+--error ER_TABLE_SCHEMA_MISMATCH
+ALTER TABLE t4 IMPORT TABLESPACE;
+
+DROP TABLE t, t1, t2, t3, t4;
+
+--echo # Recovery from corruption only, no server restart
+--echo ## t5: Recovery from corruption, with cfg
+--echo ## t6: Recovery from corruption, without cfg
+call mtr.add_suppression('InnoDB: ./test/t5.ibd: Page 0 at offset 0 looks corrupted.');
+call mtr.add_suppression("mariadbd.*: Index for table 't5' is corrupt; try to repair it");
+# In Windows etc.
+call mtr.add_suppression("InnoDB: Corrupted page \\[page id: space=.*, page number=0\\] of datafile './test/t5.ibd' could not be found in the doublewrite buffer.");
+# In Windows etc.
+call mtr.add_suppression("InnoDB: Corrupted page \\[page id: space=.*, page number=0\\] of datafile './test/t6.ibd' could not be found in the doublewrite buffer.");
+call mtr.add_suppression("mariadbd.*: Index for table 't6' is corrupt; try to repair it");
+
+CREATE TABLE t (a int) ENGINE=InnoDB;
+INSERT INTO t VALUES(42);
+FLUSH TABLES t FOR EXPORT;
+--copy_file $MYSQLD_DATADIR/test/t.cfg $MYSQLD_DATADIR/test/t5.cfg
+--copy_file $MYSQLD_DATADIR/test/t.frm $MYSQLD_DATADIR/test/t5.frm
+--copy_file $MYSQLD_DATADIR/test/t.ibd $MYSQLD_DATADIR/test/t5.ibd
+--copy_file $MYSQLD_DATADIR/test/t.frm $MYSQLD_DATADIR/test/t6.frm
+--copy_file $MYSQLD_DATADIR/test/t.ibd $MYSQLD_DATADIR/test/t6.ibd
+UNLOCK TABLES;
+
+--echo # corrupting the 0th page
+perl;
+my $ps = $ENV{INNODB_PAGE_SIZE};
+
+@tables= ('t5', 't6');
+foreach $table (@tables) {
+ my $file = "$ENV{MYSQLD_DATADIR}/test/$table.ibd";
+ open(FILE, "+<$file") || die "Unable to open $file";
+ binmode FILE;
+ sysseek(FILE, 0, 0) || die "Unable to seek $file\n";
+ die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
+ # Replace all NUL bytes with SOH bytes.
+ $page =~ tr/\x0/\x1/;
+ sysseek(FILE, 0, 0) || die "Unable to seek $file\n";
+ syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n";
+ close FILE or die "close";
+}
+EOF
+
+--error ER_INTERNAL_ERROR
+ALTER TABLE t5 IMPORT TABLESPACE;
+
+--error ER_TABLE_SCHEMA_MISMATCH
+ALTER TABLE t6 IMPORT TABLESPACE;
+
+DROP TABLE t, t5, t6;
diff --git a/mysql-test/suite/innodb/t/import_run_once.test b/mysql-test/suite/innodb/t/import_run_once.test
new file mode 100644
index 00000000..867f6434
--- /dev/null
+++ b/mysql-test/suite/innodb/t/import_run_once.test
@@ -0,0 +1,86 @@
+--source include/have_innodb.inc
+--source include/have_sequence.inc
+let $MYSQLD_DATADIR = `SELECT @@datadir`;
+
+--echo #
+--echo # MDEV-26137 ALTER TABLE IMPORT enhancement
+--echo #
+
+--echo # drop t1 before importing t2
+CREATE TABLE t1 (a int) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(42);
+FLUSH TABLES t1 FOR EXPORT;
+--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg
+--copy_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/t2.frm
+--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd
+UNLOCK TABLES;
+DROP TABLE t1;
+ALTER TABLE t2 IMPORT TABLESPACE;
+SHOW CREATE TABLE t2;
+SELECT * FROM t2;
+DROP TABLE t2;
+
+--echo # created t2 but did not discard tablespace
+CREATE TABLE t1 (a int) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(42);
+CREATE TABLE t2 LIKE t1;
+FLUSH TABLES t1 FOR EXPORT;
+--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg
+UNLOCK TABLES;
+DROP TABLE t1;
+call mtr.add_suppression("InnoDB: Unable to import tablespace");
+--error ER_TABLESPACE_EXISTS
+ALTER TABLE t2 IMPORT TABLESPACE;
+SHOW CREATE TABLE t2;
+SELECT * FROM t2;
+DROP TABLE t2;
+
+--echo # attempt to import when there's no tablespace
+--error ER_NO_SUCH_TABLE
+ALTER TABLE t2 IMPORT TABLESPACE;
+
+--echo # with index
+CREATE TABLE t1 (a int, b varchar(50)) ENGINE=InnoDB;
+CREATE UNIQUE INDEX ai ON t1 (a);
+INSERT INTO t1 VALUES(42, "hello");
+FLUSH TABLES t1 FOR EXPORT;
+--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg
+--copy_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/t2.frm
+--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd
+UNLOCK TABLES;
+ALTER TABLE t2 IMPORT TABLESPACE;
+SHOW CREATE TABLE t2;
+SELECT * FROM t2;
+SHOW INDEX FROM t1;
+SHOW INDEX FROM t2;
+DROP TABLE t1, t2;
+
+--echo # with virtual column index
+CREATE TABLE t1 (a int, b int as (a * a)) ENGINE=InnoDB;
+CREATE UNIQUE INDEX ai ON t1 (b);
+INSERT INTO t1 VALUES(42, default);
+FLUSH TABLES t1 FOR EXPORT;
+--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg
+--copy_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/t2.frm
+--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd
+UNLOCK TABLES;
+ALTER TABLE t2 IMPORT TABLESPACE;
+SHOW CREATE TABLE t2;
+SELECT * FROM t2;
+SELECT b FROM t2 USE INDEX (ai);
+SHOW INDEX FROM t1;
+SHOW INDEX FROM t2;
+CHECK TABLE t2 EXTENDED;
+DROP TABLE t1, t2;
+
+--echo # with auto_increment
+CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT, i2 INT, i1 INT)ENGINE=INNODB;
+INSERT INTO t1 (i2) SELECT 4 FROM seq_1_to_1024;
+FLUSH TABLE t1 FOR EXPORT;
+--copy_file $MYSQLD_DATADIR/test/t1.frm $MYSQLD_DATADIR/test/t2.frm
+--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd
+--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_DATADIR/test/t2.cfg
+UNLOCK TABLES;
+ALTER TABLE t2 IMPORT TABLESPACE;
+CHECK TABLE t2 EXTENDED;
+DROP TABLE t2, t1;
diff --git a/mysql-test/suite/innodb/t/import_update_stats.test b/mysql-test/suite/innodb/t/import_update_stats.test
index e1b1ae5d..26a00b95 100644
--- a/mysql-test/suite/innodb/t/import_update_stats.test
+++ b/mysql-test/suite/innodb/t/import_update_stats.test
@@ -6,10 +6,6 @@
--source include/have_innodb.inc
let MYSQLD_DATADIR =`SELECT @@datadir`;
-SET @old_innodb_file_per_table = @@innodb_file_per_table;
-
-SET GLOBAL innodb_file_per_table = 1;
-SELECT @@innodb_file_per_table;
CREATE TABLE t1 (
col_1 CHAR (255),
@@ -23,8 +19,10 @@ SHOW INDEXES FROM t1;
INSERT INTO t1 VALUES ("col1_00001", "col2_00001"), ("col1_00002", "col2_00002");
-SHOW INDEXES FROM t1;
+# Here, the cardinality would sometimes be 2 (already updated), sometimes 1.
+# SHOW INDEXES FROM t1;
+SET STATEMENT use_stat_tables=never FOR
ANALYZE TABLE t1;
SHOW INDEXES FROM t1;
@@ -74,7 +72,5 @@ SHOW INDEXES FROM t1;
DROP TABLE t1;
-SET GLOBAL innodb_file_per_table = @old_innodb_file_per_table;
-
--remove_files_wildcard $MYSQLTEST_VARDIR/tmp t1*.ibd
--remove_files_wildcard $MYSQLTEST_VARDIR/tmp t1*.cfg
diff --git a/mysql-test/suite/innodb/t/index_tree_operation.test b/mysql-test/suite/innodb/t/index_tree_operation.test
index b9695db9..e7958b29 100644
--- a/mysql-test/suite/innodb/t/index_tree_operation.test
+++ b/mysql-test/suite/innodb/t/index_tree_operation.test
@@ -9,12 +9,6 @@
# Otherwise, the follwing records 999,998,997 cause each page per record.
#
---disable_query_log
-SET @old_innodb_file_per_table = @@innodb_file_per_table;
---enable_query_log
-
-SET GLOBAL innodb_file_per_table=ON;
-
CREATE TABLE t1 (a BIGINT PRIMARY KEY, b VARCHAR(4096)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (0, REPEAT('a', 4096));
INSERT INTO t1 VALUES (1000, REPEAT('a', 4096));
@@ -68,7 +62,3 @@ WHERE s1.space = s2.space AND name = 'test/t1'
AND page_type = "INDEX" ORDER BY page_number;
DROP TABLE t1;
-
---disable_query_log
-SET GLOBAL innodb_file_per_table = @old_innodb_file_per_table;
---enable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb-alter-autoinc.test b/mysql-test/suite/innodb/t/innodb-alter-autoinc.test
index e01c44aa..49b26691 100644
--- a/mysql-test/suite/innodb/t/innodb-alter-autoinc.test
+++ b/mysql-test/suite/innodb/t/innodb-alter-autoinc.test
@@ -11,7 +11,7 @@ SET @@sql_mode = @old_sql_mode;
# We cannot assign AUTO_INCREMENT values during online index creation.
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER TABLE t1 DROP PRIMARY KEY, ADD id INT AUTO_INCREMENT PRIMARY KEY,
- LOCK=NONE;
+ ALGORITHM=INPLACE, LOCK=NONE;
--error ER_WRONG_AUTO_KEY
ALTER TABLE t1 ADD id INT AUTO_INCREMENT;
@@ -42,7 +42,7 @@ SHOW CREATE TABLE t1;
# We cannot assign AUTO_INCREMENT values during online index creation.
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER TABLE t1 DROP PRIMARY KEY, ADD id INT AUTO_INCREMENT PRIMARY KEY,
- DROP COLUMN id, AUTO_INCREMENT = 42, LOCK=NONE;
+ DROP COLUMN id, AUTO_INCREMENT = 42, ALGORITHM=INPLACE, LOCK=NONE;
ALTER TABLE t1 DROP PRIMARY KEY, ADD id INT AUTO_INCREMENT PRIMARY KEY,
DROP COLUMN id, AUTO_INCREMENT = 42, ALGORITHM=INPLACE;
diff --git a/mysql-test/suite/innodb/t/innodb-alter-timestamp.test b/mysql-test/suite/innodb/t/innodb-alter-timestamp.test
index 95df8d6b..eeeeaa55 100644
--- a/mysql-test/suite/innodb/t/innodb-alter-timestamp.test
+++ b/mysql-test/suite/innodb/t/innodb-alter-timestamp.test
@@ -67,7 +67,7 @@ SELECT u1, COUNT(DISTINCT d1) FROM t1 GROUP BY u1;
ALTER TABLE t1 ADD COLUMN d2 TIMESTAMP DEFAULT '2017-05-08 16:23:45',
LOCK=NONE;
--error ER_ALTER_OPERATION_NOT_SUPPORTED
-ALTER TABLE t1 ADD COLUMN d3 TIMESTAMP DEFAULT d1, LOCK=NONE;
+ALTER TABLE t1 ADD COLUMN d3 TIMESTAMP DEFAULT d1, ALGORITHM=INPLACE, LOCK=NONE;
--error ER_ALTER_OPERATION_NOT_SUPPORTED
ALTER TABLE t1 ADD COLUMN d3 TIMESTAMP DEFAULT d1, ALGORITHM=INPLACE;
ALTER TABLE t1 ADD COLUMN d3 TIMESTAMP DEFAULT d1;
diff --git a/mysql-test/suite/innodb/t/innodb-alter.test b/mysql-test/suite/innodb/t/innodb-alter.test
index 5b121c70..dd00c361 100644
--- a/mysql-test/suite/innodb/t/innodb-alter.test
+++ b/mysql-test/suite/innodb/t/innodb-alter.test
@@ -195,20 +195,20 @@ ALGORITHM=INPLACE, LOCK=SHARED;
SHOW CREATE TABLE tt;
# Non-instant ADD COLUMN would require the table to be rebuilt.
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-ALTER TABLE tt ADD COLUMN c CHAR(1) NOT NULL FIRST, LOCK=NONE;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE tt ADD COLUMN c CHAR(1) NOT NULL FIRST, ALGORITHM=INSTANT;
# This is still non-instant ADD COLUMN, because FTS_DOC_ID is hidden.
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-ALTER TABLE tt ADD COLUMN c CHAR(1) NOT NULL, LOCK=NONE;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE tt ADD COLUMN c CHAR(1) NOT NULL, ALGORITHM=INSTANT;
CREATE TABLE tu (
pk INT PRIMARY KEY, FTS_DOC_ID BIGINT UNSIGNED NOT NULL, t TEXT,
FULLTEXT INDEX(t)
) ENGINE=InnoDB;
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-ALTER TABLE tu ADD COLUMN c CHAR(1) NOT NULL FIRST, LOCK=NONE;
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-ALTER TABLE tu ADD COLUMN c CHAR(1) NOT NULL, LOCK=NONE;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE tu ADD COLUMN c CHAR(1) NOT NULL FIRST, ALGORITHM=INSTANT;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE tu ADD COLUMN c CHAR(1) NOT NULL, ALGORITHM=INSTANT;
DROP TABLE tu;
CREATE TABLE tv (
@@ -216,10 +216,10 @@ CREATE TABLE tv (
UNIQUE INDEX FTS_DOC_ID_INDEX(FTS_DOC_ID),
FULLTEXT INDEX(t)
) ENGINE=InnoDB;
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-ALTER TABLE tv ADD COLUMN c CHAR(1) NOT NULL FIRST, LOCK=NONE;
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-ALTER TABLE tv ADD COLUMN c CHAR(1) NOT NULL, LOCK=NONE;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE tv ADD COLUMN c CHAR(1) NOT NULL FIRST, ALGORITHM=INSTANT;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE tv ADD COLUMN c CHAR(1) NOT NULL, ALGORITHM=INSTANT;
DROP TABLE tv;
# DB_ROW_ID, DB_TRX_ID, DB_ROLL_PTR are reserved InnoDB system column names.
diff --git a/mysql-test/suite/innodb/t/innodb-blob.test b/mysql-test/suite/innodb/t/innodb-blob.test
index 301966fb..3755bf54 100644
--- a/mysql-test/suite/innodb/t/innodb-blob.test
+++ b/mysql-test/suite/innodb/t/innodb-blob.test
@@ -50,7 +50,7 @@ connection con1;
reap;
connection default;
reap;
-SET DEBUG='+d,row_ins_extern_checkpoint';
+SET DEBUG_DBUG='+d,row_ins_extern_checkpoint';
SET DEBUG_SYNC='before_row_ins_extern_latch SIGNAL rec_not_blob WAIT_FOR crash';
ROLLBACK;
BEGIN;
@@ -60,7 +60,7 @@ INSERT INTO t1 VALUES (3,REPEAT('c',50000));
connection con1;
SET DEBUG_SYNC='now WAIT_FOR rec_not_blob';
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-SELECT @@tx_isolation;
+SELECT @@transaction_isolation;
# this one should see (3,NULL_BLOB)
SELECT a, RIGHT(b,20) FROM t1;
@@ -98,7 +98,7 @@ UPDATE t3 SET c=REPEAT('f',3000) WHERE a=1;
connect (con1,localhost,root,,);
SET DEBUG_SYNC='now WAIT_FOR go_sel';
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-SELECT @@tx_isolation;
+SELECT @@transaction_isolation;
SELECT a, RIGHT(b,20), RIGHT(c,20) FROM t3;
set debug_sync='now SIGNAL go_upd';
@@ -126,7 +126,7 @@ connection default;
# remain open while we are writing the off-page columns and are
# stuck in the DEBUG_SYNC. A checkpoint involves a flush, which
# would wait for the buffer-fix to cease.
-SET DEBUG='+d,row_upd_extern_checkpoint';
+SET DEBUG_DBUG='+d,row_upd_extern_checkpoint';
SET DEBUG_SYNC='before_row_upd_extern SIGNAL have_latch WAIT_FOR crash';
# This should move column b off-page.
--send
@@ -174,7 +174,7 @@ connection default;
# remain open while we are writing the off-page columns and are
# stuck in the DEBUG_SYNC. A checkpoint involves a flush, which
# would wait for the buffer-fix to cease.
-SET DEBUG='+d,row_upd_extern_checkpoint';
+SET DEBUG_DBUG='+d,row_upd_extern_checkpoint';
SET DEBUG_SYNC='after_row_upd_extern SIGNAL have_latch WAIT_FOR crash';
# This should move column b off-page.
--send
diff --git a/mysql-test/suite/innodb/t/innodb-bug-14068765.test b/mysql-test/suite/innodb/t/innodb-bug-14068765.test
index c2446e0f..4435ac68 100644
--- a/mysql-test/suite/innodb/t/innodb-bug-14068765.test
+++ b/mysql-test/suite/innodb/t/innodb-bug-14068765.test
@@ -2,7 +2,7 @@
let MYSQLD_DATADIR =`SELECT @@datadir`;
-# Export/import on the same instance, with --innodb-file-per-table=1
+# Export/import on the same instance
CREATE DATABASE testdb_wl5522;
CREATE TABLE testdb_wl5522.t1(col1 bit(1) , col2 boolean,col3 tinyint , col4 smallint , col5 mediumint ,col6 int , col7 bigint , col8 float (14,3) ,col9 double (14,3), col10 VARCHAR(20) CHARACTER SET utf8 , col11 TEXT CHARACTER SET binary , col12 ENUM('a','b','c') CHARACTER SET binary ,col13 TEXT CHARACTER SET latin1 COLLATE latin1_general_cs ,col14 CHAR(20) , col15 VARBINARY (400) , col16 BINARY(40), col17 BLOB (400) , col18 int not null primary key,col19 DATE ,col20 DATETIME , col21 TIMESTAMP ,col22 TIME , col23 YEAR ) ENGINE = Innodb;
diff --git a/mysql-test/suite/innodb/t/innodb-bug-14084530.test b/mysql-test/suite/innodb/t/innodb-bug-14084530.test
index f27fbbe3..2285b86c 100644
--- a/mysql-test/suite/innodb/t/innodb-bug-14084530.test
+++ b/mysql-test/suite/innodb/t/innodb-bug-14084530.test
@@ -4,7 +4,7 @@ let MYSQLD_DATADIR =`SELECT @@datadir`;
SET AUTOCOMMIT = 0;
-# Export/import on the same instance, with --innodb-file-per-table=1
+# Export/import on the same instance
CREATE DATABASE testdb_wl5522;
CREATE TABLE testdb_wl5522.t1 (c1 int ) engine = Innodb;
diff --git a/mysql-test/suite/innodb/t/innodb-enlarge-blob.opt b/mysql-test/suite/innodb/t/innodb-enlarge-blob.opt
index 2f9bf78f..1251c5f2 100644
--- a/mysql-test/suite/innodb/t/innodb-enlarge-blob.opt
+++ b/mysql-test/suite/innodb/t/innodb-enlarge-blob.opt
@@ -1,4 +1,3 @@
---innodb-file-per-table
--innodb-buffer-pool-size=32M
--innodb-page-size=64k
--innodb-strict-mode=OFF
diff --git a/mysql-test/suite/innodb/t/innodb-fkcheck.test b/mysql-test/suite/innodb/t/innodb-fkcheck.test
index 5ff3533f..bec4de7b 100644
--- a/mysql-test/suite/innodb/t/innodb-fkcheck.test
+++ b/mysql-test/suite/innodb/t/innodb-fkcheck.test
@@ -4,17 +4,6 @@
#
# MDEV-10083: Orphan ibd file when playing with foreign keys
#
---disable_query_log
-SET @start_global_fpt = @@global.innodb_file_per_table;
-SET @start_global_fkc = @@global.foreign_key_checks;
---enable_query_log
-
-set global innodb_file_per_table = 1;
-
---disable_warnings
-drop table if exists b;
-drop database if exists bug_fk;
---enable_warnings
let $MYSQLD_DATADIR = `select @@datadir`;
@@ -114,12 +103,6 @@ show warnings;
#
# Cleanup
#
---disable_query_log
-SET @@global.innodb_file_per_table = @start_global_fpt;
-SET @@global.foreign_key_checks = @start_global_fkc;
---enable_query_log
-
---disable_warnings
-drop table if exists b;
-drop database if exists bug_fk;
---enable_warnings
+
+drop table b;
+drop database bug_fk;
diff --git a/mysql-test/suite/innodb/t/innodb-index-debug.test b/mysql-test/suite/innodb/t/innodb-index-debug.test
index 736e1295..cfe893f5 100644
--- a/mysql-test/suite/innodb/t/innodb-index-debug.test
+++ b/mysql-test/suite/innodb/t/innodb-index-debug.test
@@ -106,7 +106,7 @@ SIGNAL opened WAIT_FOR flushed';
send ALTER TABLE t1 FORCE, ADD COLUMN k4 int;
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR opened';
-SET debug = '+d,row_log_tmpfile_fail';
+SET debug_dbug = '+d,row_log_tmpfile_fail';
INSERT INTO t1 select NULL,'aaa','bbb' from t480;
INSERT INTO t1 select NULL,'aaaa','bbbb' from t480;
SET DEBUG_SYNC= 'now SIGNAL flushed';
diff --git a/mysql-test/suite/innodb/t/innodb-index-online.test b/mysql-test/suite/innodb/t/innodb-index-online.test
index 96ee3149..70a10391 100644
--- a/mysql-test/suite/innodb/t/innodb-index-online.test
+++ b/mysql-test/suite/innodb/t/innodb-index-online.test
@@ -13,10 +13,6 @@ SELECT name, count FROM INFORMATION_SCHEMA.INNODB_METRICS WHERE subsystem = 'ddl
call mtr.add_suppression("InnoDB: Warning: Small buffer pool size");
-# DISCARD TABLESPACE needs file-per-table
-SET @global_innodb_file_per_table_orig = @@global.innodb_file_per_table;
-SET GLOBAL innodb_file_per_table = on;
-
# Save the initial number of concurrent sessions.
--source include/count_sessions.inc
@@ -522,7 +518,6 @@ SET DEBUG_SYNC = 'RESET';
# gone so execution of other tests won't be affected by their presence.
--source include/wait_until_count_sessions.inc
-SET GLOBAL innodb_file_per_table = @global_innodb_file_per_table_orig;
--disable_warnings
SET GLOBAL innodb_monitor_enable = default;
SET GLOBAL innodb_monitor_disable = default;
diff --git a/mysql-test/suite/innodb/t/innodb-index.test b/mysql-test/suite/innodb/t/innodb-index.test
index c80e3e6c..b434ef46 100644
--- a/mysql-test/suite/innodb/t/innodb-index.test
+++ b/mysql-test/suite/innodb/t/innodb-index.test
@@ -921,7 +921,7 @@ create table t1(f1 int not null, f2 int not null,
insert into t1 values(1,3), (2,2);
alter table t1 drop primary key, lock=none;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-alter table t1 drop index f1, lock=none;
+alter table t1 drop index f1, algorithm=inplace, lock=none;
drop table t1;
--echo #
diff --git a/mysql-test/suite/innodb/t/innodb-lock-inherit-read_commited.test b/mysql-test/suite/innodb/t/innodb-lock-inherit-read_commited.test
index 31bf8a73..0511e5f1 100644
--- a/mysql-test/suite/innodb/t/innodb-lock-inherit-read_commited.test
+++ b/mysql-test/suite/innodb/t/innodb-lock-inherit-read_commited.test
@@ -26,8 +26,8 @@ connect purge_control,localhost,root;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection default;
-SET @old_tx_isolation = @@tx_isolation;
-SET GLOBAL tx_isolation = 'READ-COMMITTED';
+SET @old_tx_isolation = @@transaction_isolation;
+SET GLOBAL transaction_isolation = 'READ-COMMITTED';
SET @old_innodb_lock_wait_timeout = @@innodb_lock_wait_timeout;
SET GLOBAL innodb_lock_wait_timeout = 1;
@@ -103,7 +103,7 @@ CHECK TABLE t1;
DROP TABLE t1;
SET GLOBAL innodb_stats_auto_recalc = @old_innodb_stats_auto_recalc;
-SET GLOBAL tx_isolation = @old_tx_isolation;
+SET GLOBAL transaction_isolation = @old_tx_isolation;
SET GLOBAL innodb_lock_wait_timeout = @old_innodb_lock_wait_timeout;
--inc $i
diff --git a/mysql-test/suite/innodb/t/innodb-online-alter-gis.test b/mysql-test/suite/innodb/t/innodb-online-alter-gis.test
index df0ab2e8..26311793 100644
--- a/mysql-test/suite/innodb/t/innodb-online-alter-gis.test
+++ b/mysql-test/suite/innodb/t/innodb-online-alter-gis.test
@@ -11,8 +11,8 @@ show errors;
drop table t1;
create table t1(a int not null, b geometry not null, d int,spatial key c(b), key d(d)) engine=innodb;
show create table t1;
---error 1846
-ALTER ONLINE TABLE t1 ADD PRIMARY KEY(a),DROP INDEX d;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+ALTER ONLINE TABLE t1 ADD PRIMARY KEY(a),DROP INDEX d, ALGORITHM=INPLACE;
show warnings;
show errors;
ALTER ONLINE TABLE t1 ADD PRIMARY KEY(a),DROP INDEX d, LOCK=SHARED;
diff --git a/mysql-test/suite/innodb/t/innodb-table-online.test b/mysql-test/suite/innodb/t/innodb-table-online.test
index 0612866a..24e18438 100644
--- a/mysql-test/suite/innodb/t/innodb-table-online.test
+++ b/mysql-test/suite/innodb/t/innodb-table-online.test
@@ -16,10 +16,6 @@ call mtr.add_suppression("InnoDB: Warning: Small buffer pool size");
call mtr.add_suppression("InnoDB: Error: table 'test/t1'");
call mtr.add_suppression("MariaDB is trying to open a table handle but the .ibd file for");
-# DISCARD TABLESPACE needs file-per-table
-SET @global_innodb_file_per_table_orig = @@global.innodb_file_per_table;
-SET GLOBAL innodb_file_per_table = on;
-
# Save the initial number of concurrent sessions.
--source include/count_sessions.inc
@@ -55,11 +51,11 @@ SET @saved_debug_dbug = @@SESSION.debug_dbug;
SET DEBUG_DBUG = '+d,innodb_OOM_prepare_inplace_alter';
--error ER_OUT_OF_RESOURCES
ALTER TABLE t1 ROW_FORMAT=REDUNDANT, ALGORITHM=INPLACE, LOCK=NONE;
-SET SESSION DEBUG = @saved_debug_dbug;
-SET SESSION DEBUG = '+d,innodb_OOM_inplace_alter';
+SET SESSION DEBUG_DBUG = @saved_debug_dbug;
+SET SESSION DEBUG_DBUG = '+d,innodb_OOM_inplace_alter';
--error ER_OUT_OF_RESOURCES
ALTER TABLE t1 ROW_FORMAT=REDUNDANT, ALGORITHM=INPLACE, LOCK=NONE;
-SET SESSION DEBUG = @saved_debug_dbug;
+SET SESSION DEBUG_DBUG = @saved_debug_dbug;
ALTER TABLE t1 ROW_FORMAT=REDUNDANT, ALGORITHM=INPLACE, LOCK=NONE;
connection default;
@@ -479,7 +475,6 @@ disconnect con1;
# gone so execution of other tests won't be affected by their presence.
--source include/wait_until_count_sessions.inc
-SET GLOBAL innodb_file_per_table = @global_innodb_file_per_table_orig;
--disable_warnings
SET GLOBAL innodb_monitor_enable = default;
SET GLOBAL innodb_monitor_disable = default;
diff --git a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test
index 2d3b5b3f..f83866b0 100644
--- a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test
+++ b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test
@@ -35,7 +35,6 @@ FLUSH TABLES;
let MYSQLD_DATADIR =`SELECT @@datadir`;
let $strerrfix=/ (\(.+\))//;
-SET GLOBAL innodb_file_per_table = 1;
CREATE TABLE t1 (c1 INT) ENGINE = InnoDB;
INSERT INTO t1 VALUES(1),(2),(3);
@@ -52,8 +51,6 @@ ALTER TABLE t1 DISCARD TABLESPACE;
DROP TABLE t1;
-SET GLOBAL innodb_file_per_table = 1;
-
CREATE TABLE t1 (c1 INT) ENGINE = InnoDB;
INSERT INTO t1 VALUES(1),(2),(3);
@@ -66,8 +63,6 @@ ALTER TABLE t1 DISCARD TABLESPACE;
DROP TABLE t1;
-SET GLOBAL innodb_file_per_table = 1;
-
# Create the table that we will use for crash recovery (during IMPORT)
CREATE TABLE t1 (c1 INT) ENGINE = Innodb;
INSERT INTO t1 VALUES (1), (2), (3), (4);
@@ -130,9 +125,6 @@ EOF
DROP TABLE t1;
-SET @file_per_table= @@innodb_file_per_table;
-SET GLOBAL innodb_file_per_table = 1;
-
CREATE TABLE t1 (c1 INT) ENGINE = Innodb;
ALTER TABLE t1 DISCARD TABLESPACE;
@@ -960,21 +952,6 @@ do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_restore_tablespaces("test", "t1");
EOF
-# Test failure after ibuf check
-SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure";
-
-# Need proper mapping of error codes :-(
---error ER_NOT_KEYFILE
-ALTER TABLE t1 IMPORT TABLESPACE;
-
-SET SESSION debug_dbug=@saved_debug_dbug;
-
-# Restore files
-perl;
-do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
-ib_restore_tablespaces("test", "t1");
-EOF
-
# Test failure after adjusting the cluster index root page
SET SESSION debug_dbug="+d,ib_import_cluster_root_adjust_failure";
@@ -1397,5 +1374,3 @@ call mtr.add_suppression("Index for table 't1' is corrupt; try to repair it");
#cleanup
--remove_file $MYSQLTEST_VARDIR/tmp/t1.cfg
--remove_file $MYSQLTEST_VARDIR/tmp/t1.ibd
-
-SET GLOBAL INNODB_FILE_PER_TABLE=@file_per_table;
diff --git a/mysql-test/suite/innodb/t/innodb-wl5522.test b/mysql-test/suite/innodb/t/innodb-wl5522.test
index 8eedb636..873cf6b3 100644
--- a/mysql-test/suite/innodb/t/innodb-wl5522.test
+++ b/mysql-test/suite/innodb/t/innodb-wl5522.test
@@ -97,7 +97,6 @@ if ($checksum_algorithm == "strict_full_crc32") {
ALTER TABLE t2 IMPORT TABLESPACE;
DROP TABLE t2;
-SET GLOBAL innodb_file_per_table = 1;
SELECT @@innodb_file_per_table;
let MYSQLD_DATADIR =`SELECT @@datadir`;
@@ -113,7 +112,7 @@ ALTER TABLE t1 IMPORT TABLESPACE;
SELECT * FROM t1;
DROP TABLE t1;
-# Export/import on the same instance, with --innodb-file-per-table=1
+# Export/import on the same instance
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB;
@@ -157,7 +156,7 @@ SELECT COUNT(*) FROM t1;
DROP TABLE t1;
-# Export/import on the same instance, with --innodb-file-per-table=1
+# Export/import on the same instance
# Insert some more records to move the LSN forward and then drop the
# table and restore
CREATE TABLE t1(
@@ -203,7 +202,7 @@ SELECT COUNT(*) FROM t1;
DROP TABLE t1;
-# Export/import on the same instance, with --innodb-file-per-table=1
+# Export/import on the same instance
# Insert some more records to move the LSN forward and then drop the
# table and restore, this time the table has a secondary index too.
CREATE TABLE t1(
@@ -244,7 +243,7 @@ SELECT COUNT(*) FROM t1 WHERE c2 = 1;
DROP TABLE t1;
-# Export/import on the same instance, with --innodb-file-per-table=1
+# Export/import on the same instance
# Insert some more records to move the LSN forward and then drop the
# table and restore, this time the table has a secondary index too.
# Rename the index on the create so that the IMPORT fails, drop index
diff --git a/mysql-test/suite/innodb/t/innodb-wl5980-alter.test b/mysql-test/suite/innodb/t/innodb-wl5980-alter.test
index 09c54db6..ec000057 100644
--- a/mysql-test/suite/innodb/t/innodb-wl5980-alter.test
+++ b/mysql-test/suite/innodb/t/innodb-wl5980-alter.test
@@ -6,7 +6,6 @@
--source include/have_innodb.inc
--source include/have_symlink.inc
-SET @innodb_file_per_table_orig=@@GLOBAL.innodb_file_per_table;
LET $regexp=/FTS_[0-9a-f_]+([A-Z0-9_]+)\.([islbd]{3})/FTS_AUX_\1.\2/;
# Set up some variables
@@ -14,7 +13,6 @@ LET $MYSQL_DATA_DIR = `select @@datadir`;
LET $data_directory_clause = DATA DIRECTORY='$MYSQL_TMP_DIR/alt_dir';
SET default_storage_engine=InnoDB;
-SET GLOBAL innodb_file_per_table=ON;
SET NAMES utf8mb4;
@@ -611,7 +609,7 @@ ALGORITHM=INPLACE;
# This would create a hidden FTS_DOC_ID column, which cannot be done online.
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER TABLE t1o CHANGE FTS_DOC_ID foo_id BIGINT UNSIGNED NOT NULL,
-LOCK=NONE;
+ALGORITHM=INPLACE, LOCK=NONE;
# This should not show duplicates.
SELECT sc.pos FROM information_schema.innodb_sys_columns sc
@@ -706,5 +704,3 @@ DROP TABLE tt, t1o, sys_tables, sys_indexes, sys_foreign;
--list_files $MYSQL_TMP_DIR/alt_dir/test
--rmdir $MYSQL_TMP_DIR/alt_dir/test
--rmdir $MYSQL_TMP_DIR/alt_dir
-
-SET GLOBAL innodb_file_per_table = @innodb_file_per_table_orig;
diff --git a/mysql-test/suite/innodb/t/innodb.opt b/mysql-test/suite/innodb/t/innodb.opt
deleted file mode 100644
index 59e43fea..00000000
--- a/mysql-test/suite/innodb/t/innodb.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb-defragment=0 \ No newline at end of file
diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test
index 30797d3a..c6967910 100644
--- a/mysql-test/suite/innodb/t/innodb.test
+++ b/mysql-test/suite/innodb/t/innodb.test
@@ -724,7 +724,7 @@ create table t1 (id int unsigned not null auto_increment, code tinyint unsigned
BEGIN;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
-SELECT @@tx_isolation,@@global.tx_isolation;
+SELECT @@transaction_isolation, @@global.transaction_isolation;
insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David');
select id, code, name from t1 order by id;
COMMIT;
@@ -1106,7 +1106,13 @@ CREATE TABLE t2 (
) ENGINE=InnoDB;
INSERT INTO t2 VALUES("3524", "1"),("3525", "1"),("1794", "4"),("102", "5"),("1822", "6"),("3382", "9");
+# We have to analyze the tables to make the row count stable
+ANALYZE table t1,t2;
+explain SELECT t2.id, t1.`label` FROM t2 INNER JOIN
+(SELECT t1.id_object as id_object FROM t1 WHERE t1.`label` LIKE '%test%') AS lbl
+ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object);
+--sorted_result
SELECT t2.id, t1.`label` FROM t2 INNER JOIN
(SELECT t1.id_object as id_object FROM t1 WHERE t1.`label` LIKE '%test%') AS lbl
ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object);
@@ -2377,7 +2383,7 @@ CONNECT (c1,localhost,root,,);
CONNECT (c2,localhost,root,,);
CONNECTION c1;
SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
+SET TRANSACTION_ISOLATION='read-committed';
SET AUTOCOMMIT=0;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 ( a int ) ENGINE=InnoDB;
@@ -2385,7 +2391,7 @@ CREATE TABLE t2 LIKE t1;
SELECT * FROM t2;
CONNECTION c2;
SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
+SET TRANSACTION_ISOLATION='read-committed';
SET AUTOCOMMIT=0;
INSERT INTO t1 VALUES (1);
COMMIT;
@@ -2397,12 +2403,12 @@ CONNECT (c1,localhost,root,,);
CONNECT (c2,localhost,root,,);
CONNECTION c1;
SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
+SET TRANSACTION_ISOLATION='read-committed';
SET AUTOCOMMIT=0;
SELECT * FROM t2;
CONNECTION c2;
SET binlog_format='MIXED';
-SET TX_ISOLATION='read-committed';
+SET TRANSACTION_ISOLATION='read-committed';
SET AUTOCOMMIT=0;
INSERT INTO t1 VALUES (2);
COMMIT;
diff --git a/mysql-test/suite/innodb/t/innodb_buffer_pool_load_now.test b/mysql-test/suite/innodb/t/innodb_buffer_pool_load_now.test
index baced6e9..c9e4dc25 100644
--- a/mysql-test/suite/innodb/t/innodb_buffer_pool_load_now.test
+++ b/mysql-test/suite/innodb/t/innodb_buffer_pool_load_now.test
@@ -69,7 +69,7 @@ EOF
--move_file $file $file.now
-# Complete purge (and change buffer merge).
+# Complete purge.
SET GLOBAL innodb_fast_shutdown=0;
--source include/shutdown_mysqld.inc
diff --git a/mysql-test/suite/innodb/t/innodb_bug14147491-master.opt b/mysql-test/suite/innodb/t/innodb_bug14147491-master.opt
index 614dd935..8434ff04 100644
--- a/mysql-test/suite/innodb/t/innodb_bug14147491-master.opt
+++ b/mysql-test/suite/innodb/t/innodb_bug14147491-master.opt
@@ -1,4 +1,3 @@
---innodb_file_per_table=1
--loose-skip-stack-trace
--skip-core-file
--loose-innodb_buffer_pool_load_at_startup=OFF
diff --git a/mysql-test/suite/innodb/t/innodb_bug14147491.test b/mysql-test/suite/innodb/t/innodb_bug14147491.test
index 10f3c98b..6fe4b319 100644
--- a/mysql-test/suite/innodb/t/innodb_bug14147491.test
+++ b/mysql-test/suite/innodb/t/innodb_bug14147491.test
@@ -20,8 +20,6 @@ SET GLOBAL innodb_fast_shutdown=0;
--echo # Create and populate the table to be corrupted
-set global innodb_file_per_table=ON;
-
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
INSERT INTO t1 (b) VALUES ('corrupt me');
--disable_query_log
diff --git a/mysql-test/suite/innodb/t/innodb_bug39438-master.opt b/mysql-test/suite/innodb/t/innodb_bug39438-master.opt
deleted file mode 100644
index 0746d13d..00000000
--- a/mysql-test/suite/innodb/t/innodb_bug39438-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb-file-per-table=1
diff --git a/mysql-test/suite/innodb/t/innodb_bug39438.test b/mysql-test/suite/innodb/t/innodb_bug39438.test
index 635d65f0..04275197 100644
--- a/mysql-test/suite/innodb/t/innodb_bug39438.test
+++ b/mysql-test/suite/innodb/t/innodb_bug39438.test
@@ -3,10 +3,6 @@
# Bug#39438 Testcase for Bug#39436 crashes on 5.1 in fil_space_get_latch
# http://bugs.mysql.com/39438
#
-# This test must be run with innodb_file_per_table=1 because the crash
-# only occurs if that option is turned on and DISCARD TABLESPACE only
-# works with innodb_file_per_table.
-#
SET default_storage_engine=InnoDB;
diff --git a/mysql-test/suite/innodb/t/innodb_bug40360.test b/mysql-test/suite/innodb/t/innodb_bug40360.test
index f5187d55..8e7b309e 100644
--- a/mysql-test/suite/innodb/t/innodb_bug40360.test
+++ b/mysql-test/suite/innodb/t/innodb_bug40360.test
@@ -5,7 +5,7 @@
-- source include/not_embedded.inc
-SET TX_ISOLATION='READ-COMMITTED';
+SET TRANSACTION_ISOLATION='READ-COMMITTED';
# This is the default since MySQL 5.1.29 SET BINLOG_FORMAT='STATEMENT';
diff --git a/mysql-test/suite/innodb/t/innodb_bug49164.test b/mysql-test/suite/innodb/t/innodb_bug49164.test
index 159475ba..f19fb519 100644
--- a/mysql-test/suite/innodb/t/innodb_bug49164.test
+++ b/mysql-test/suite/innodb/t/innodb_bug49164.test
@@ -8,7 +8,7 @@ connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
connection con1;
-SET tx_isolation = 'READ-COMMITTED';
+SET transaction_isolation = 'READ-COMMITTED';
CREATE TABLE bug49164 (a INT, b BIGINT, c TINYINT, PRIMARY KEY (a, b))
ENGINE=InnoDB;
@@ -25,7 +25,7 @@ update bug49164 set c=7;
connection con2;
-SET tx_isolation = 'READ-COMMITTED';
+SET transaction_isolation = 'READ-COMMITTED';
begin;
select * from bug49164;
commit;
diff --git a/mysql-test/suite/innodb/t/innodb_bug53592.test b/mysql-test/suite/innodb/t/innodb_bug53592.test
index a809afeb..f085cda7 100644
--- a/mysql-test/suite/innodb/t/innodb_bug53592.test
+++ b/mysql-test/suite/innodb/t/innodb_bug53592.test
@@ -5,7 +5,7 @@
--source include/have_innodb.inc
# Use FIC for index creation
-set old_alter_table=0;
+set alter_algorithm=0;
create table bug53592(a int) engine=innodb row_format=compact;
@@ -33,8 +33,8 @@ check table bug53592;
drop table bug53592;
-# Running the same set of test when "old_alter_table" is turned on
-set old_alter_table=1;
+# Running the same set of test when "alter_algorithm" is turned on
+set alter_algorithm=1;
create table bug53592(a int) engine=innodb row_format=compact;
diff --git a/mysql-test/suite/innodb/t/innodb_bug53756.test b/mysql-test/suite/innodb/t/innodb_bug53756.test
index a676868a..86633e1c 100644
--- a/mysql-test/suite/innodb/t/innodb_bug53756.test
+++ b/mysql-test/suite/innodb/t/innodb_bug53756.test
@@ -25,37 +25,37 @@ COMMIT;
--echo
--echo # Start a transaction in the default connection for isolation.
START TRANSACTION;
-SELECT @@tx_isolation;
+SELECT @@transaction_isolation;
SELECT * FROM bug_53756;
--connect (con1,localhost,root,,)
START TRANSACTION;
-SELECT @@tx_isolation;
+SELECT @@transaction_isolation;
DELETE FROM bug_53756 WHERE pk=1;
--connect (con2,localhost,root,,)
START TRANSACTION;
-SELECT @@tx_isolation;
+SELECT @@transaction_isolation;
DELETE FROM bug_53756 WHERE pk=2;
--connect (con3,localhost,root,,)
START TRANSACTION;
-SELECT @@tx_isolation;
+SELECT @@transaction_isolation;
UPDATE bug_53756 SET c1=77 WHERE pk=3;
--connect (con4,localhost,root,,)
START TRANSACTION;
-SELECT @@tx_isolation;
+SELECT @@transaction_isolation;
UPDATE bug_53756 SET c1=88 WHERE pk=4;
--connect (con5,localhost,root,,)
START TRANSACTION;
-SELECT @@tx_isolation;
+SELECT @@transaction_isolation;
INSERT INTO bug_53756 VALUES(5, 55);
--connect (con6,localhost,root,,)
START TRANSACTION;
-SELECT @@tx_isolation;
+SELECT @@transaction_isolation;
INSERT INTO bug_53756 VALUES(6, 66);
--connection con1
diff --git a/mysql-test/suite/innodb/t/innodb_bug56947.test b/mysql-test/suite/innodb/t/innodb_bug56947.test
index ce64f1a8..3e85e614 100644
--- a/mysql-test/suite/innodb/t/innodb_bug56947.test
+++ b/mysql-test/suite/innodb/t/innodb_bug56947.test
@@ -4,7 +4,8 @@
-- source include/have_innodb.inc
-- source include/have_debug.inc
-SET GLOBAL innodb_file_per_table=0;
+SET @save_fpt=@@GLOBAL.innodb_file_per_table;
+SET GLOBAL innodb_file_per_table=OFF;
create table bug56947(a int not null) engine = innodb;
SET @saved_dbug = @@SESSION.debug_dbug;
@@ -15,5 +16,5 @@ alter table bug56947 add unique index (a);
check table bug56947;
drop table bug56947;
-SET @@global.innodb_file_per_table=DEFAULT;
+SET GLOBAL innodb_file_per_table=@save_fpt;
SET debug_dbug= @saved_dbug;
diff --git a/mysql-test/suite/innodb/t/innodb_bug59733.test b/mysql-test/suite/innodb/t/innodb_bug59733.test
deleted file mode 100644
index 0b1bff51..00000000
--- a/mysql-test/suite/innodb/t/innodb_bug59733.test
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# Bug #59733 Possible deadlock when buffered changes are to be discarded
-# in buf_page_create
-#
--- source include/have_innodb.inc
-
--- disable_query_log
-# The flag innodb_change_buffering_debug is only available in debug builds.
-# It instructs InnoDB to try to evict pages from the buffer pool when
-# change buffering is possible, so that the change buffer will be used
-# whenever possible.
--- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
-SET @innodb_change_buffering_debug_orig = @@innodb_change_buffering_debug;
--- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
-SET GLOBAL innodb_change_buffering_debug = 1;
--- enable_query_log
-
-CREATE TABLE bug59733(a INT AUTO_INCREMENT PRIMARY KEY,b CHAR(1))ENGINE=InnoDB;
-
-# Create enough rows for the table, so that the insert buffer will be
-# used. There must be multiple index pages, because changes to the
-# root page are never buffered.
-
-INSERT INTO bug59733 VALUES(0,'x');
-INSERT INTO bug59733 SELECT 0,b FROM bug59733;
-INSERT INTO bug59733 SELECT 0,b FROM bug59733;
-INSERT INTO bug59733 SELECT 0,b FROM bug59733;
-INSERT INTO bug59733 SELECT 0,b FROM bug59733;
-INSERT INTO bug59733 SELECT 0,b FROM bug59733;
-INSERT INTO bug59733 SELECT 0,b FROM bug59733;
-INSERT INTO bug59733 SELECT 0,b FROM bug59733;
-INSERT INTO bug59733 SELECT 0,b FROM bug59733;
-INSERT INTO bug59733 SELECT 0,b FROM bug59733;
-INSERT INTO bug59733 SELECT 0,b FROM bug59733;
-INSERT INTO bug59733 SELECT 0,b FROM bug59733;
-
-# Create the secondary index for which changes will be buffered.
-CREATE INDEX b ON bug59733 (b);
-
-# This should be buffered, if innodb_change_buffering_debug = 1 is in effect.
-DELETE FROM bug59733 WHERE (a%100)=0;
-
-# Drop the index in order to get free pages with orphaned buffered changes.
-DROP INDEX b ON bug59733;
-
-# Create the index and attempt to reuse pages for which buffered changes exist.
-CREATE INDEX b ON bug59733 (b);
-
-DROP TABLE bug59733;
-
--- disable_query_log
--- error 0, ER_UNKNOWN_SYSTEM_VARIABLE
-SET GLOBAL innodb_change_buffering_debug = @innodb_change_buffering_debug_orig;
diff --git a/mysql-test/suite/innodb/t/innodb_bug68148.test b/mysql-test/suite/innodb/t/innodb_bug68148.test
index ab4e0311..432e8fbf 100644
--- a/mysql-test/suite/innodb/t/innodb_bug68148.test
+++ b/mysql-test/suite/innodb/t/innodb_bug68148.test
@@ -6,8 +6,6 @@
# MDEV-8845: Table disappear after modifying FK
#
-set global innodb_file_per_table=1;
-
CREATE TABLE ref_table1 (id int(11) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB;
CREATE TABLE ref_table2 (id int(11) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB;
diff --git a/mysql-test/suite/innodb/t/innodb_bulk_create_index_small.test b/mysql-test/suite/innodb/t/innodb_bulk_create_index_small.test
index d04dd59f..75e011a5 100644
--- a/mysql-test/suite/innodb/t/innodb_bulk_create_index_small.test
+++ b/mysql-test/suite/innodb/t/innodb_bulk_create_index_small.test
@@ -80,11 +80,6 @@ SELECT CHAR_LENGTH(b) FROM t1 WHERE a=4975;
DROP TABLE t1;
-SET GLOBAL innodb_file_per_table=default;
-
-# Test Compressed Table
-SET GLOBAL innodb_file_per_table=1;
-
CREATE TABLE t1(
class INT,
id INT,
@@ -143,6 +138,4 @@ SELECT CHAR_LENGTH(b) FROM t1 WHERE a=4975;
DROP TABLE t1;
-SET GLOBAL innodb_file_per_table=default;
-
DROP PROCEDURE populate_t1;
diff --git a/mysql-test/suite/innodb/t/innodb_defrag_binlog.opt b/mysql-test/suite/innodb/t/innodb_defrag_binlog.opt
deleted file mode 100644
index 8a432b8c..00000000
--- a/mysql-test/suite/innodb/t/innodb_defrag_binlog.opt
+++ /dev/null
@@ -1,5 +0,0 @@
---loose-innodb-buffer-pool-stats
---loose-innodb-buffer-page
---loose-innodb-buffer-page-lru
---binlog-format=row
---innodb-defragment=1 \ No newline at end of file
diff --git a/mysql-test/suite/innodb/t/innodb_defrag_binlog.test b/mysql-test/suite/innodb/t/innodb_defrag_binlog.test
deleted file mode 100644
index db6849f8..00000000
--- a/mysql-test/suite/innodb/t/innodb_defrag_binlog.test
+++ /dev/null
@@ -1,21 +0,0 @@
---source include/have_innodb.inc
---source include/master-slave.inc
---source include/big_test.inc
---source include/not_valgrind.inc
---source include/not_embedded.inc
-
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
-create table t1(a int not null primary key auto_increment, b varchar(256), key second(b)) engine=innodb;
-
-insert into t1 values (1, REPEAT("a", 256));
-insert into t1 values (2, REPEAT("a", 256));
-optimize table t1;
-
-drop table t1;
-
---source include/show_binlog_events.inc
-
---source include/rpl_end.inc
diff --git a/mysql-test/suite/innodb/t/innodb_defrag_concurrent.opt b/mysql-test/suite/innodb/t/innodb_defrag_concurrent.opt
deleted file mode 100644
index 3242c6cf..00000000
--- a/mysql-test/suite/innodb/t/innodb_defrag_concurrent.opt
+++ /dev/null
@@ -1,5 +0,0 @@
---loose-innodb-buffer-pool-stats
---loose-innodb-buffer-page
---loose-innodb-buffer-page-lru
---innodb-log-buffer-size=3m
---innodb-defragment=1 \ No newline at end of file
diff --git a/mysql-test/suite/innodb/t/innodb_defrag_concurrent.test b/mysql-test/suite/innodb/t/innodb_defrag_concurrent.test
deleted file mode 100644
index 1e4e14eb..00000000
--- a/mysql-test/suite/innodb/t/innodb_defrag_concurrent.test
+++ /dev/null
@@ -1,143 +0,0 @@
---source include/have_innodb.inc
---source include/big_test.inc
---source include/not_valgrind.inc
---source include/not_embedded.inc
---source include/have_sequence.inc
-
-SET @n_pages= @@GLOBAL.innodb_defragment_n_pages;
-SET @accuracy= @@GLOBAL.innodb_defragment_stats_accuracy;
-SET @sp= @@GLOBAL.innodb_stats_persistent;
-
-SET GLOBAL innodb_stats_persistent = 0;
-set global innodb_defragment_stats_accuracy = 80;
-
-# Create table.
-#
-# TODO: Currently we do not defragment spatial indexes,
-# because doing it properly would require
-# appropriate logic around the SSN (split
-# sequence number).
-#
-# Also do not defragment auxiliary tables related to FULLTEXT INDEX.
-#
-# Both types added to this test to make sure they do not cause
-# problems.
-#
-CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
-b VARCHAR(256),
-c INT,
-g GEOMETRY NOT NULL,
-t VARCHAR(256),
-KEY second(a, b),
-KEY third(c),
-SPATIAL gk(g),
-FULLTEXT INDEX fti(t)) ENGINE=INNODB;
-
-connect (con1,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
-connect (con2,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
-connect (con3,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
-connect (con4,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
-
-connection default;
-
-SET @@global.innodb_defragment_n_pages = 20;
-
-CREATE TEMPORARY TABLE tt (a INT, KEY(a)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
-INSERT INTO tt SELECT 0 FROM seq_1_to_180;
-INSERT INTO tt SELECT 5 FROM seq_1_to_160;
-INSERT INTO tt SELECT 1 FROM seq_1_to_1000;
-OPTIMIZE TABLE tt;
-
-let $data_size = 20000;
-let $delete_size = 2000;
-
-# Populate table.
-let $i = $data_size;
---disable_query_log
-while ($i)
-{
- eval
- INSERT INTO t1 VALUES ($data_size + 1 - $i, REPEAT('A', 256), $i, Point($i,$i), 'This is a test message.');
- dec $i;
-}
---enable_query_log
-
-select count(*) from t1;
-select count(*) from t1 force index (second);
-select count(*) from t1 force index (third);
-
-# Delete some data
---disable_query_log
-let $size = $delete_size;
-while ($size)
-{
- let $j = 100 * $size;
- eval delete from t1 where a between $j - 20 and $j;
- dec $size;
-}
---enable_query_log
-
-select count(*) from t1;
-select count(*) from t1 force index (second);
-select count(*) from t1 force index (third);
-
-# Above delete will free some pages and insert causes page split and these could cause defrag
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-
-connection con1;
---send optimize table t1;
-
-connection default;
---send INSERT INTO t1 VALUES (400000, REPEAT('A', 256),300000, Point(1,1),'More like a test but different.');
-
-connection con2;
---send INSERT INTO t1 VALUES (500000, REPEAT('A', 256),400000, Point(1,1),'Totally different text book.');
-
-connection con3;
---send DELETE FROM t1 where a between 1 and 100;
-
-connection con4;
---send UPDATE t1 SET c = c + 1 where c between 2000 and 8000;
-
-connection con1;
---disable_result_log
---reap
---enable_result_log
-
-connection con2;
---reap
-
-connection con3;
---reap
-
-connection con4;
---reap
-
-connection default;
---reap
-
-disconnect con1;
-disconnect con2;
-disconnect con3;
-disconnect con4;
-
-optimize table t1;
-check table t1 extended;
-
-select count(*) from t1;
-select count(*) from t1 force index (second);
-select count(*) from t1 force index (third);
-
-# Now pages are freed
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-
-drop table t1;
-
-# reset system
-SET GLOBAL innodb_defragment_n_pages = @n_pages;
-SET GLOBAL innodb_defragment_stats_accuracy = @accuracy;
-SET GLOBAL innodb_stats_persistent = @sp;
diff --git a/mysql-test/suite/innodb/t/innodb_defrag_stats.opt b/mysql-test/suite/innodb/t/innodb_defrag_stats.opt
deleted file mode 100644
index d3525162..00000000
--- a/mysql-test/suite/innodb/t/innodb_defrag_stats.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb-defragment=1
diff --git a/mysql-test/suite/innodb/t/innodb_defrag_stats.test b/mysql-test/suite/innodb/t/innodb_defrag_stats.test
deleted file mode 100644
index 3730eb65..00000000
--- a/mysql-test/suite/innodb/t/innodb_defrag_stats.test
+++ /dev/null
@@ -1,88 +0,0 @@
---source include/have_innodb.inc
---source include/not_valgrind.inc
---source include/not_embedded.inc
---source include/have_sequence.inc
-
-SET GLOBAL innodb_defragment_stats_accuracy = 20;
-
-DELETE FROM mysql.innodb_index_stats;
-
---echo # Create table.
-CREATE TABLE t1 (a INT PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256),
- KEY SECOND(a, b)) ENGINE=INNODB STATS_PERSISTENT=0;
-
-INSERT INTO t1 SELECT 100*FLOOR(seq/70)+seq%70, REPEAT('A', 256)
-FROM seq_1_to_1024;
-
---echo # Not enough page splits to trigger persistent stats write yet.
-SELECT * FROM mysql.innodb_index_stats;
-
-INSERT INTO t1 SELECT 100*FLOOR(seq/70)+seq%70, REPEAT('A', 256)
-FROM seq_1025_to_1433;
-
-BEGIN;
-let $num_delete = 20;
-while ($num_delete)
-{
- eval INSERT INTO t1 SELECT 100*$num_delete+seq, REPEAT('A', 256)
- FROM seq_70_to_99;
- dec $num_delete;
-}
-ROLLBACK;
-
-SELECT @@GLOBAL.innodb_force_recovery<2 "have background defragmentation";
-
-# Wait for defrag_pool to be processed.
-
-let $wait_timeout=30;
-let $wait_condition = SELECT COUNT(*)>5 FROM mysql.innodb_index_stats;
---source include/wait_condition.inc
-
---sorted_result
-SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
-
-optimize table t1;
-
---sorted_result
-SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
-
-set global innodb_defragment_stats_accuracy = 40;
-
-INSERT INTO t1 (b) SELECT b from t1;
-
---sorted_result
-SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
-
-INSERT INTO t1 (b) SELECT b from t1;
-
---sorted_result
-SELECT stat_name FROM mysql.innodb_index_stats WHERE table_name='t1';
-
---echo # Table rename should cause stats rename.
-rename table t1 to t2;
-
---sorted_result
-SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
-
-drop index SECOND on t2;
-
---echo #
---echo # MDEV-26636: Statistics must not be written for temporary tables
---echo #
-SET GLOBAL innodb_defragment_stats_accuracy = 1;
-CREATE TEMPORARY TABLE t (a INT PRIMARY KEY, c CHAR(255) NOT NULL)
-ENGINE=InnoDB;
-INSERT INTO t SELECT seq, '' FROM seq_1_to_100;
-
---source include/restart_mysqld.inc
-
---sorted_result
-SELECT table_name, index_name, stat_name FROM mysql.innodb_index_stats;
-
---echo # Clean up
-# Starting with 10.6, DROP TABLE will not touch persistent statistics
-# (not defragmentation statistics either) if the table has none!
-ALTER TABLE t2 STATS_PERSISTENT=1;
-DROP TABLE t2;
-
-SELECT * FROM mysql.innodb_index_stats;
diff --git a/mysql-test/suite/innodb/t/innodb_defrag_stats_many_tables.opt b/mysql-test/suite/innodb/t/innodb_defrag_stats_many_tables.opt
deleted file mode 100644
index d3525162..00000000
--- a/mysql-test/suite/innodb/t/innodb_defrag_stats_many_tables.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb-defragment=1
diff --git a/mysql-test/suite/innodb/t/innodb_defrag_stats_many_tables.test b/mysql-test/suite/innodb/t/innodb_defrag_stats_many_tables.test
deleted file mode 100644
index a0f43fa6..00000000
--- a/mysql-test/suite/innodb/t/innodb_defrag_stats_many_tables.test
+++ /dev/null
@@ -1,77 +0,0 @@
---source include/have_innodb.inc
---source include/big_test.inc
---source include/not_valgrind.inc
---source include/not_embedded.inc
-
---disable_warnings
-DROP TABLE if exists t1;
---enable_warnings
-
-let $num_tables = 505;
-
-SET @start_table_definition_cache = @@global.table_definition_cache;
-SET @@global.table_definition_cache = 400;
-
-SET @start_flush_log_at_trx_commit = @@global.innodb_flush_log_at_trx_commit;
-SET @@global.innodb_flush_log_at_trx_commit=2;
-
-# set stats accuracy to be pretty high so stats sync is easily triggered.
-SET @start_innodb_defragment_stats_accuracy = @@global.innodb_defragment_stats_accuracy;
-SET @@global.innodb_defragment_stats_accuracy = 80;
-
-# Create table.
-CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), KEY SECOND(a, b)) ENGINE=INNODB;
-
-# Populate data
-INSERT INTO t1 VALUES(1, REPEAT('A', 256));
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-INSERT INTO t1 (b) SELECT b from t1;
-
-select stat_value > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name = 'n_page_split';
-
-# Create many tables to over flow the table definition cache
-
---echo Create $num_tables table to overflow the table cache.
---disable_query_log
-let $count = $num_tables;
-while ($count)
-{
- EVAL CREATE TABLE t_$count (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT) ENGINE=INNODB;
- EVAL INSERT INTO t_$count VALUES (1), (2);
- dec $count;
-}
---enable_query_log
---echo Sleep for a while to make sure t1 is evicted.
-select sleep(15);
-
---echo Reload t1 to get defrag stats from persistent storage
-INSERT INTO t1 (b) SELECT b from t1;
-
---echo make sure the stats thread will wake up and do the write even if there's a race condition between set and reset.
-select sleep(15);
-
-select stat_value > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name = 'n_page_split';
-
-
-# Clean up
-SET @@global.innodb_defragment_stats_accuracy = @start_innodb_defragment_stats_accuracy;
-SET @@global.table_definition_cache = @start_table_definition_cache;
---disable_query_log
-let $count = $num_tables;
-while ($count)
-{
- EVAL DROP TABLE t_$count;
- dec $count;
-}
-set @@global.innodb_flush_log_at_trx_commit = @start_flush_log_at_trx_commit;
---enable_query_log
-DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb_defragment.opt b/mysql-test/suite/innodb/t/innodb_defragment.opt
deleted file mode 100644
index aea3d480..00000000
--- a/mysql-test/suite/innodb/t/innodb_defragment.opt
+++ /dev/null
@@ -1,5 +0,0 @@
---loose-innodb-buffer-pool-stats
---loose-innodb-buffer-page
---loose-innodb-buffer-page-lru
---innodb-file-per-table
---innodb-defragment=1 \ No newline at end of file
diff --git a/mysql-test/suite/innodb/t/innodb_defragment.test b/mysql-test/suite/innodb/t/innodb_defragment.test
deleted file mode 100644
index 51ef7837..00000000
--- a/mysql-test/suite/innodb/t/innodb_defragment.test
+++ /dev/null
@@ -1,157 +0,0 @@
---source include/have_innodb.inc
---source include/big_test.inc
---source include/not_embedded.inc
-# Valgrind is to slow for this test
---source include/not_valgrind.inc
-
-set global innodb_defragment_stats_accuracy = 80;
-
-# Create table.
-CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), KEY SECOND(a, b)) ENGINE=INNODB;
-
-## Test-1 defragment an empty table
-optimize table t1;
-
-## Test-2 defragment a single page table
-INSERT INTO t1 VALUES (100000, REPEAT('A', 256));
-INSERT INTO t1 VALUES (200000, REPEAT('A', 256));
-INSERT INTO t1 VALUES (300000, REPEAT('A', 256));
-INSERT INTO t1 VALUES (400000, REPEAT('A', 256));
-
-optimize table t1;
-
-## Test-3 defragment (somewhat) in parallel with delete queries
-let $data_size = 10000;
-let $delete_size = 100;
-
-delimiter //;
-create procedure defragment()
-begin
- set @i = 0;
- repeat
- set @i = @i + 1;
- optimize table t1;
- until @i = 3 end repeat;
-end //
-delimiter ;//
-
-
-# Populate table.
-let $i = $data_size;
---disable_query_log
-BEGIN;
-while ($i)
-{
- eval
- INSERT INTO t1 VALUES ($data_size + 1 - $i, REPEAT('A', 256));
- dec $i;
-}
-COMMIT;
---enable_query_log
-
-select count(stat_value) from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-select count(stat_value) from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-select count(stat_value) from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-
-select count(*) from t1;
-
-connect (con1,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
-
-connection con1;
---send call defragment()
-
-connection default;
-
---disable_query_log
-let $size = $delete_size;
-while ($size)
-{
- let $j = 100 * $size;
- eval delete from t1 where a between $j - 20 and $j;
- dec $size;
-}
---enable_query_log
-
-connection con1;
---disable_result_log
---reap
---enable_result_log
-
-connection default;
-disconnect con1;
-
-optimize table t1;
-
---source include/restart_mysqld.inc
-select count(*) from t1;
-
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-
-select count(*) from t1 force index (second);
-
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_pages_freed');
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_page_split');
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_leaf_pages_defrag');
-
-## Test-4 defragment with larger n_pages
-
-# delete some more records
---disable_query_log
-let $size = $delete_size;
-while ($size)
-{
- let $j = 100 * $size;
- eval delete from t1 where a between $j - 30 and $j - 20;
- dec $size;
-}
---enable_query_log
-
-SET @@global.innodb_defragment_n_pages = 3;
-
-# This will not reduce number of pages by a lot
-optimize table t1;
-
---source include/restart_mysqld.inc
-
-select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-
-select count(*) from t1;
-
-# We didn't create large wholes with the previous deletion, so if innodb_defragment_n_pages = 3, we won't be able to free up many pages.
-
-select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-
-
-select count(*) from t1 force index (second);
-
-# Same holds for secondary index, not many pages are released.
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_pages_freed');
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_page_split');
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_leaf_pages_defrag');
-
-SET @@global.innodb_defragment_n_pages = 10;
-
-optimize table t1;
-
---source include/restart_mysqld.inc
-
-select count(stat_value) > 1 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
-select count(stat_value) > 1 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
-select count(stat_value) > 1 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
-
-
-select count(*) from t1 force index (second);
-
-# Same holds for secondary index, not many pages are released.
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_pages_freed');
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_page_split');
-select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_leaf_pages_defrag');
-
-DROP PROCEDURE defragment;
-DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb_defragment_small.test b/mysql-test/suite/innodb/t/innodb_defragment_small.test
deleted file mode 100644
index 6259dac4..00000000
--- a/mysql-test/suite/innodb/t/innodb_defragment_small.test
+++ /dev/null
@@ -1,41 +0,0 @@
---source include/have_innodb.inc
-
-SET @innodb_defragment_orig=@@GLOBAL.innodb_defragment;
-SET @innodb_optimize_fulltext_orig=@@GLOBAL.innodb_optimize_fulltext_only;
-SET GLOBAL innodb_defragment = 1;
-SET GLOBAL innodb_optimize_fulltext_only = 0;
-
---echo #
---echo # MDEV-12198 innodb_defragment=1 crashes server on
---echo # OPTIMIZE TABLE when FULLTEXT index exists
---echo #
-
-CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(256),
- KEY(a, b), FULLTEXT KEY(b)) ENGINE=INNODB;
-OPTIMIZE TABLE t1;
-
-INSERT INTO t1 VALUES (100000, REPEAT('A', 256));
-INSERT INTO t1 VALUES (200000, REPEAT('A', 256));
-INSERT INTO t1 VALUES (300000, REPEAT('A', 256));
-INSERT INTO t1 VALUES (400000, REPEAT('A', 256));
-
-OPTIMIZE TABLE t1;
-
---echo #
---echo # MDEV-15824 innodb_defragment=ON trumps
---echo # innodb_optimize_fulltext_only=ON in OPTIMIZE TABLE
---echo #
-
-SET GLOBAL innodb_optimize_fulltext_only = 1;
-OPTIMIZE TABLE t1;
-SET GLOBAL innodb_defragment = 0;
-OPTIMIZE TABLE t1;
-
-DROP TABLE t1;
-
-CREATE TABLE t1 (c POINT PRIMARY KEY, SPATIAL INDEX(c)) ENGINE=InnoDB;
-OPTIMIZE TABLE t1;
-DROP TABLE t1;
-
-SET GLOBAL innodb_defragment = @innodb_defragment_orig;
-SET GLOBAL innodb_optimize_fulltext_only = @innodb_optimize_fulltext_orig;
diff --git a/mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1.test b/mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1.test
index ea31d4a1..56a86a2c 100644
--- a/mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1.test
+++ b/mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1.test
@@ -108,9 +108,9 @@ drop table t1, t2;
--echo # handler::unlock_row() in InnoDB does nothing.
--echo # Thus in order to reproduce the condition that led to the
--echo # warning, one needs to relax isolation by either
---echo # setting a weaker tx_isolation value, or by turning on
+--echo # setting a weaker transaction_isolation value, or by turning on
--echo # the unsafe replication switch.
-set @@session.tx_isolation="read-committed";
+set @@session.transaction_isolation="read-committed";
--echo # Prepare data. We need a table with a unique index,
--echo # for join_read_key to be used. The other column
@@ -236,7 +236,7 @@ connection default;
commit;
disconnect con1;
-set @@session.tx_isolation=default;
+set @@session.transaction_isolation=default;
drop table t1;
--echo #
diff --git a/mysql-test/suite/innodb/t/innodb_mysql.test b/mysql-test/suite/innodb/t/innodb_mysql.test
index d495186d..c4453302 100644
--- a/mysql-test/suite/innodb/t/innodb_mysql.test
+++ b/mysql-test/suite/innodb/t/innodb_mysql.test
@@ -41,7 +41,7 @@ drop table t1, t2;
SET SESSION BINLOG_FORMAT=STATEMENT;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-query_vertical select @@session.sql_log_bin, @@session.binlog_format, @@session.tx_isolation;
+query_vertical select @@session.sql_log_bin, @@session.binlog_format, @@session.transaction_isolation;
CREATE TABLE t1 ( a INT ) ENGINE=InnoDB;
INSERT INTO t1 VALUES(1);
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb_stats_fetch.test b/mysql-test/suite/innodb/t/innodb_stats_fetch.test
index d02cd3b8..11b8926a 100644
--- a/mysql-test/suite/innodb/t/innodb_stats_fetch.test
+++ b/mysql-test/suite/innodb/t/innodb_stats_fetch.test
@@ -101,6 +101,6 @@ DROP TABLE t1;
--echo # MDEV-33462 Disallow LOCK=NONE operation on statistics table
--echo #
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-ALTER TABLE mysql.innodb_table_stats FORCE, LOCK=NONE;
+ALTER TABLE mysql.innodb_table_stats FORCE, LOCK=NONE, ALGORITHM=INPLACE;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-ALTER TABLE mysql.innodb_index_stats FORCE, LOCK=NONE;
+ALTER TABLE mysql.innodb_index_stats FORCE, LOCK=NONE, ALGORITHM=INPLACE;
diff --git a/mysql-test/suite/innodb/t/insert_debug.test b/mysql-test/suite/innodb/t/insert_debug.test
index c370c402..7fe584a8 100644
--- a/mysql-test/suite/innodb/t/insert_debug.test
+++ b/mysql-test/suite/innodb/t/insert_debug.test
@@ -7,13 +7,11 @@
--echo # CAUSES INFINITE PAGE SPLIT
--echo #
-SET GLOBAL innodb_change_buffering_debug=1;
SET GLOBAL innodb_limit_optimistic_insert_debug=1;
CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=InnoDB
PARTITION BY HASH (c1) PARTITIONS 15;
DROP TABLE t1;
-SET GLOBAL innodb_change_buffering_debug=0;
SET GLOBAL innodb_limit_optimistic_insert_debug=0;
--echo #
diff --git a/mysql-test/suite/innodb/t/insert_into_empty.test b/mysql-test/suite/innodb/t/insert_into_empty.test
index cc631bca..e22ed11d 100644
--- a/mysql-test/suite/innodb/t/insert_into_empty.test
+++ b/mysql-test/suite/innodb/t/insert_into_empty.test
@@ -47,7 +47,7 @@ SET GLOBAL innodb_adaptive_hash_index = @save_ahi;
CREATE TEMPORARY TABLE t (c INT) ENGINE=InnoDB;
CREATE TEMPORARY TABLE t2 (c INT) ENGINE=InnoDB;
-SET tx_read_only=1;
+SET transaction_read_only=1;
BEGIN;
INSERT INTO t2 VALUES(0);
INSERT INTO t VALUES(0);
@@ -60,7 +60,7 @@ INSERT INTO t VALUES(0);
--error ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION
DROP TEMPORARY TABLE t,t2;
-SET tx_read_only=0;
+SET transaction_read_only=0;
DROP TEMPORARY TABLE t,t2;
--echo #
diff --git a/mysql-test/suite/innodb/t/instant_alter_debug.test b/mysql-test/suite/innodb/t/instant_alter_debug.test
index 953f7663..a20f2102 100644
--- a/mysql-test/suite/innodb/t/instant_alter_debug.test
+++ b/mysql-test/suite/innodb/t/instant_alter_debug.test
@@ -325,11 +325,6 @@ SET GLOBAL innodb_limit_optimistic_insert_debug = @old_limit;
ALTER TABLE t1 ADD COLUMN b INT, ALGORITHM=INSTANT;
-SET @old_defragment = @@innodb_defragment;
-SET GLOBAL innodb_defragment = 1;
-OPTIMIZE TABLE t1;
-SET GLOBAL innodb_defragment = @old_defragment;
-
# Exploit MDEV-17468 to force the table definition to be reloaded
ALTER TABLE t1 ADD vb INT AS (b) VIRTUAL;
CHECK TABLE t1;
diff --git a/mysql-test/suite/innodb/t/log_corruption.test b/mysql-test/suite/innodb/t/log_corruption.test
index b4466c5e..7c39ce02 100644
--- a/mysql-test/suite/innodb/t/log_corruption.test
+++ b/mysql-test/suite/innodb/t/log_corruption.test
@@ -57,16 +57,24 @@ my $head = pack("Nx[18]", 0);
my $body = pack("x[8]Nx[10]Nx[16312]", 768, 97937874);
my $ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
-# Dummy pages 1..6.
-$body = pack("x[16338]");
-for (my($page) = 1; $page < 7; $page++)
-{
- ## FIL_PAGE_OFFSET
- $head = pack("Nx[18]", $page);
- $ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
- print OUT pack("N",$ck).$head.pack("x[16350]Nx[4]",$ck);
-}
+
+# Dummy change buffer header page (page 3).
+die unless seek(OUT, 3 * 16384, 0);
+## FIL_PAGE_OFFSET, FIL_PAGE_PREV, FIL_PAGE_NEXT, FIL_PAGE_TYPE
+my $head = pack("NNNx[8]n", 3, 0xffffffff, 0xffffffff, 6);
+my $body = pack("x[62]nnx[16272]", 2, 50);
+my $ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
+print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
+
+# Dummy change buffer root page (page 4).
+## FIL_PAGE_OFFSET, FIL_PAGE_PREV, FIL_PAGE_NEXT
+my $head = pack("NNNx[10]", 4, 0xffffffff, 0xffffffff);
+my $body = chr(0) x 16338;
+my $ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
+print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
+
# Dictionary header page (page 7).
+die unless seek(OUT, 7 * 16384, 0);
## FIL_PAGE_OFFSET
$head = pack("Nx[18]", 7);
## DICT_HDR_TABLES,DICT_HDR_INDEXES
diff --git a/mysql-test/suite/innodb/t/log_data_file_size.opt b/mysql-test/suite/innodb/t/log_data_file_size.opt
index d9a364a3..20e2cf0d 100644
--- a/mysql-test/suite/innodb/t/log_data_file_size.opt
+++ b/mysql-test/suite/innodb/t/log_data_file_size.opt
@@ -1,2 +1,3 @@
--loose-innodb-sys-indexes
--innodb-data-file-path=ibdata1:1M:autoextend
+--innodb-undo-tablespaces=0
diff --git a/mysql-test/suite/innodb/t/log_file_name.test b/mysql-test/suite/innodb/t/log_file_name.test
index 371d10c9..33b1e37e 100644
--- a/mysql-test/suite/innodb/t/log_file_name.test
+++ b/mysql-test/suite/innodb/t/log_file_name.test
@@ -8,8 +8,6 @@
--source include/not_embedded.inc
call mtr.add_suppression("InnoDB: Header page consists of zero bytes in datafile:");
-
-SET GLOBAL innodb_file_per_table=ON;
FLUSH TABLES;
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
diff --git a/mysql-test/suite/innodb/t/log_file_size.test b/mysql-test/suite/innodb/t/log_file_size.test
index 261b024f..ea186965 100644
--- a/mysql-test/suite/innodb/t/log_file_size.test
+++ b/mysql-test/suite/innodb/t/log_file_size.test
@@ -107,7 +107,7 @@ SELECT * FROM t1;
let SEARCH_PATTERN= syntax error in innodb_log_group_home_dir;
--source include/search_pattern_in_file.inc
---let $restart_parameters= --debug=d,innodb_log_abort_1
+--let $restart_parameters= --debug-dbug=d,innodb_log_abort_1
--source include/restart_mysqld.inc
--error ER_UNKNOWN_STORAGE_ENGINE
SELECT * FROM t1;
@@ -122,7 +122,7 @@ SELECT * FROM t1;
let SEARCH_PATTERN= InnoDB: innodb_read_only prevents crash recovery;
--source include/search_pattern_in_file.inc
---let $restart_parameters= --debug=d,innodb_log_abort_5
+--let $restart_parameters= --debug-dbug=d,innodb_log_abort_5
--source include/restart_mysqld.inc
--error ER_UNKNOWN_STORAGE_ENGINE
SELECT * FROM t1;
diff --git a/mysql-test/suite/innodb/t/log_upgrade.test b/mysql-test/suite/innodb/t/log_upgrade.test
index faf88c41..a3d23787 100644
--- a/mysql-test/suite/innodb/t/log_upgrade.test
+++ b/mysql-test/suite/innodb/t/log_upgrade.test
@@ -45,9 +45,24 @@ my $head = pack("Nx[18]", 0);
my $body = pack("x[8]Nx[10]Nx[16312]", 768, 97937874);
my $ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
-# Dummy pages 1..6.
-print OUT chr(0) x (6 * 16384);
+
+# Dummy change buffer header page (page 3).
+die unless seek(OUT, 3 * 16384, 0);
+## FIL_PAGE_OFFSET, FIL_PAGE_PREV, FIL_PAGE_NEXT, FIL_PAGE_TYPE
+my $head = pack("NNNx[8]n", 3, 0xffffffff, 0xffffffff, 6);
+my $body = pack("x[62]nnx[16272]", 2, 50);
+my $ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
+print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
+
+# Dummy change buffer root page (page 4).
+## FIL_PAGE_OFFSET, FIL_PAGE_PREV, FIL_PAGE_NEXT
+my $head = pack("NNNx[10]", 4, 0xffffffff, 0xffffffff);
+my $body = chr(0) x 16338;
+my $ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
+print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
+
# Dictionary header page (page 7).
+die unless seek(OUT, 7 * 16384, 0);
## FIL_PAGE_OFFSET
$head = pack("Nx[18]", 7);
## DICT_HDR_TABLES,DICT_HDR_INDEXES
diff --git a/mysql-test/suite/innodb/t/log_upgrade_101_flags.test b/mysql-test/suite/innodb/t/log_upgrade_101_flags.test
index 4358ccfa..7b54e3ae 100644
--- a/mysql-test/suite/innodb/t/log_upgrade_101_flags.test
+++ b/mysql-test/suite/innodb/t/log_upgrade_101_flags.test
@@ -8,7 +8,7 @@ call mtr.add_suppression("InnoDB: adjusting FSP_SPACE_FLAGS of file");
let bugdir= $MYSQLTEST_VARDIR/tmp/log_upgrade;
--mkdir $bugdir
--let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err
---let $dirs= --innodb-data-home-dir=$bugdir --innodb-log-group-home-dir=$bugdir
+--let $dirs= --innodb-data-home-dir=$bugdir --innodb-log-group-home-dir=$bugdir --innodb-undo-directory=$bugdir
# Test case similar to log_upgrade.test
perl;
@@ -23,9 +23,25 @@ my $head = pack("Nx[18]", 0);
my $body = pack("x[8]Nx[4]Nx[2]Nx[32696]", 768, 49152, 97937874);
my $ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
-# Dummy pages 1..6.
-print OUT chr(0) x (6 * 32768);
+
+# Dummy change buffer header page (page 3).
+die unless seek(OUT, 3 * 32768, 0);
+## FIL_PAGE_OFFSET, FIL_PAGE_PREV, FIL_PAGE_NEXT, FIL_PAGE_TYPE
+my $head = pack("NNNx[8]n", 3, 0xffffffff, 0xffffffff, 6);
+my $body = pack("x[62]nnx[32656]", 2, 50);
+my $ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
+print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
+
+# Dummy change buffer root page (page 4).
+## FIL_PAGE_OFFSET, FIL_PAGE_PREV, FIL_PAGE_NEXT
+my $head = pack("NNNx[10]", 4, 0xffffffff, 0xffffffff);
+my $body = chr(0) x 32722;
+my $ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
+print OUT pack("N",$ck).$head.pack("x[12]").$body.pack("Nx[4]",$ck);
+
+
# Dictionary header page (page 7).
+die unless seek(OUT, 7 * 32768, 0);
$head = pack("Nx[18]", 7);
$body = pack("x[32]Nx[8]Nx[32674]", 8, 9);
$ck = mycrc32($head, 0, $polynomial) ^ mycrc32($body, 0, $polynomial);
diff --git a/mysql-test/suite/innodb/t/mdev-14846.test b/mysql-test/suite/innodb/t/mdev-14846.test
index e9698cc0..5c101eaa 100644
--- a/mysql-test/suite/innodb/t/mdev-14846.test
+++ b/mysql-test/suite/innodb/t/mdev-14846.test
@@ -41,7 +41,9 @@ SET DEBUG_SYNC='now SIGNAL con2_dml';
--connection default
SET DEBUG_SYNC='now WAIT_FOR default_dml';
---send UPDATE t3 AS alias1 LEFT JOIN t3 AS alias2 ON ( alias1.f1 <> alias1.f2 ) SET alias1.f3 = 59 WHERE ( EXISTS ( SELECT t1.f3 FROM t1 WHERE t1.f1 = alias1.f1 ) ) OR alias2.f1 = 'h'
+--replace_column 9 #
+explain UPDATE t3 AS alias1 LEFT JOIN t3 AS alias2 ON ( alias1.f1 <> alias1.f2 ) SET alias1.f3 = 59 WHERE ( EXISTS ( SELECT t1.f3 FROM t1 IGNORE INDEX (f1) WHERE t1.f1 = alias1.f1 ) ) OR alias2.f1 = 'h';
+--send UPDATE t3 AS alias1 LEFT JOIN t3 AS alias2 ON ( alias1.f1 <> alias1.f2 ) SET alias1.f3 = 59 WHERE ( EXISTS ( SELECT t1.f3 FROM t1 IGNORE INDEX (f1) WHERE t1.f1 = alias1.f1 ) ) OR alias2.f1 = 'h'
# It holds the lock of all record in t3 and tries to acquire record lock for the table t1.
--connect (con2,localhost,root,,test)
@@ -55,6 +57,8 @@ disconnect con2;
# Cleanup
--connection con1
SET DEBUG_SYNC='now WAIT_FOR con1_dml2';
+--replace_column 9 #
+explain UPDATE v4, t1 SET t1.pk = 76 WHERE t1.f2 IN ( SELECT t2.f FROM t2 INNER JOIN t3 );
UPDATE v4, t1 SET t1.pk = 76 WHERE t1.f2 IN ( SELECT t2.f FROM t2 INNER JOIN t3 );
# It holds the record lock on table t1 and tries to acquire record lock on t3.
# leads to deadlock (con1 trx is waiting for default trx and vice versa)
diff --git a/mysql-test/suite/innodb/t/mdev-15707.opt b/mysql-test/suite/innodb/t/mdev-15707.opt
deleted file mode 100644
index fec3463c..00000000
--- a/mysql-test/suite/innodb/t/mdev-15707.opt
+++ /dev/null
@@ -1 +0,0 @@
---innodb --innodb-buffer-pool-size=5MB --innodb-read-io-threads=1 --innodb-doublewrite=0 --innodb-flush-log-at-trx-commit=0 \ No newline at end of file
diff --git a/mysql-test/suite/innodb/t/mdev-15707.test b/mysql-test/suite/innodb/t/mdev-15707.test
deleted file mode 100644
index a0446ef4..00000000
--- a/mysql-test/suite/innodb/t/mdev-15707.test
+++ /dev/null
@@ -1,30 +0,0 @@
---source include/windows.inc
-# This test is slow on buildbot.
---source include/big_test.inc
-
-# Deadlock in conjunction with the innodb change buffering.
-
-# When innodb change buffering kicks in, i.e secondary non-unique index
-# does not fit into the bufferpool, then, on Windows, innodb
-# background threads could deadlock whenever index page is
-# read, and the page needs load/merge change buffer.
-# The test tries to reproduce this situation, by creating index
-# that does not fit into bufferpool, and doing a large update.
-
-CREATE TABLE t1(
-a INT AUTO_INCREMENT PRIMARY KEY,
-b CHAR(255),
-INDEX(b))
-ENGINE=InnoDB;
-
-INSERT INTO t1(b) SELECT UUID();
-BEGIN;
-let $i=`select cast(log2(@@innodb_buffer_pool_size/255) as int)`;
-while ($i)
-{
- INSERT INTO t1(b) SELECT UUID() FROM t1;
- dec $i;
-}
-COMMIT;
-UPDATE t1 SET b=UUID();
-DROP TABLE t1; \ No newline at end of file
diff --git a/mysql-test/suite/innodb/t/monitor.test b/mysql-test/suite/innodb/t/monitor.test
index 69545c9c..11da213b 100644
--- a/mysql-test/suite/innodb/t/monitor.test
+++ b/mysql-test/suite/innodb/t/monitor.test
@@ -260,7 +260,7 @@ drop table monitor_test;
set global innodb_monitor_enable = file_num_open_files;
-# Counters are unpredictable when innodb-file-per-table is on
+# Counters are unpredictable
--replace_column 2 # 3 # 4 # 5 # 6 # 7 #
select name, max_count, min_count, count,
max_count_reset, min_count_reset, count_reset,
diff --git a/mysql-test/suite/innodb/t/mvcc.test b/mysql-test/suite/innodb/t/mvcc.test
index 7c37718c..e0baf7f8 100644
--- a/mysql-test/suite/innodb/t/mvcc.test
+++ b/mysql-test/suite/innodb/t/mvcc.test
@@ -1,9 +1,6 @@
--source include/have_innodb.inc
--source include/have_sequence.inc
-SET @save_per_table= @@GLOBAL.innodb_file_per_table;
-SET GLOBAL innodb_file_per_table= 1;
-
let MYSQLD_DATADIR =`SELECT @@datadir`;
--echo #
@@ -68,5 +65,3 @@ DELIMITER ;$$
INSERT INTO t1 SET id=1,c294=1;
REPLACE t1 SET id=1,c294=1;
DROP TABLE t1;
-
-SET GLOBAL innodb_file_per_table= @save_per_table;
diff --git a/mysql-test/suite/innodb/t/page_reorganize.test b/mysql-test/suite/innodb/t/page_reorganize.test
index c4e0160c..f90da5c5 100644
--- a/mysql-test/suite/innodb/t/page_reorganize.test
+++ b/mysql-test/suite/innodb/t/page_reorganize.test
@@ -43,7 +43,7 @@ let $wait_condition=
SET @save_dbug = @@debug_dbug;
SET DEBUG_DBUG = '+d,do_page_reorganize,do_lock_reverse_page_reorganize';
insert into t1(f2) values (repeat('+', 100));
-SET DEBUG = @save_dbug;
+SET DEBUG_DBUG = @save_dbug;
commit;
connection con1;
diff --git a/mysql-test/suite/innodb/t/partition_locking.test b/mysql-test/suite/innodb/t/partition_locking.test
index 13457c1d..c4e6bff9 100644
--- a/mysql-test/suite/innodb/t/partition_locking.test
+++ b/mysql-test/suite/innodb/t/partition_locking.test
@@ -104,7 +104,7 @@ SELECT * FROM t1 LOCK IN SHARE MODE;
--error ER_LOCK_WAIT_TIMEOUT
SELECT * FROM t1 LOCK IN SHARE MODE NOWAIT;
SELECT * FROM t1 ORDER BY d LOCK IN SHARE MODE SKIP LOCKED;
-SELECT a,count(b) FROM t1 GROUP BY a ORDER BY a LOCK IN SHARE MODE SKIP LOCKED;
+SELECT a,count(b) FROM t1 force index (a) GROUP BY a ORDER BY a LOCK IN SHARE MODE SKIP LOCKED;
SELECT d,a,b,c FROM t1 partition (p1,p9,p11,p17) ORDER BY d
LOCK IN SHARE MODE SKIP LOCKED;
SELECT d,a,b,c FROM t1 ORDER BY d LOCK IN SHARE MODE SKIP LOCKED;
diff --git a/mysql-test/suite/innodb/t/read_only_recovery.test b/mysql-test/suite/innodb/t/read_only_recovery.test
index d011b3aa..75e9c530 100644
--- a/mysql-test/suite/innodb/t/read_only_recovery.test
+++ b/mysql-test/suite/innodb/t/read_only_recovery.test
@@ -35,12 +35,15 @@ UPDATE t SET a=3 WHERE a=1;
--echo # Starting with MariaDB 10.2, innodb_read_only implies READ UNCOMMITTED.
--echo # In earlier versions, this would return the last committed version
--echo # (empty table)!
+SHOW VARIABLES LIKE "innodb_read_only";
SELECT * FROM t;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT * FROM t;
SET GLOBAL innodb_max_purge_lag_wait=0;
INSERT INTO mysql.innodb_index_stats
SELECT * FROM mysql.innodb_index_stats LIMIT 0;
+--echo Test Temp tablespace truncate in read only mode
+SET GLOBAL innodb_truncate_temporary_tablespace_now=1;
--let $restart_parameters=
--source include/restart_mysqld.inc
SELECT * FROM t;
diff --git a/mysql-test/suite/innodb/t/row_format_redundant.opt b/mysql-test/suite/innodb/t/row_format_redundant.opt
index d1d93da0..349b00fe 100644
--- a/mysql-test/suite/innodb/t/row_format_redundant.opt
+++ b/mysql-test/suite/innodb/t/row_format_redundant.opt
@@ -1,3 +1,4 @@
--innodb-checksum-algorithm=crc32
+--innodb-undo-tablespaces=0
--skip-innodb-fast-shutdown
--skip-innodb-buffer-pool-dump-at-shutdown
diff --git a/mysql-test/suite/innodb/t/row_format_redundant.test b/mysql-test/suite/innodb/t/row_format_redundant.test
index fa3a104a..9f85c454 100644
--- a/mysql-test/suite/innodb/t/row_format_redundant.test
+++ b/mysql-test/suite/innodb/t/row_format_redundant.test
@@ -16,24 +16,24 @@ let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
let bugdir= $MYSQLTEST_VARDIR/tmp/row_format_redundant;
--mkdir $bugdir
+let undodir= $MYSQLTEST_VARDIR/tmp/undo_dir;
+--mkdir $undodir
+
--let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err
--let $d=--innodb-data-home-dir=$bugdir --innodb-log-group-home-dir=$bugdir
--let $d=$d --innodb-data-file-path=ibdata1:1M:autoextend
---let $d=$d --innodb-undo-tablespaces=0 --innodb-stats-persistent=0
+--let $d=$d --innodb_undo_directory=$undodir --innodb-undo-tablespaces=0 --innodb-stats-persistent=0
--let $restart_parameters= $d
# Ensure that any DDL records from previous tests have been purged.
SET GLOBAL innodb_fast_shutdown=0;
--source include/restart_mysqld.inc
-SET GLOBAL innodb_file_per_table=1;
-
--echo #
--echo # Bug#21644827 - FTS, ASSERT !SRV_READ_ONLY_MODE || M_IMPL.M_LOG_MODE ==
--echo # MTR_LOG_NO_REDO
--echo #
-SET GLOBAL innodb_file_per_table=ON;
create table t1 (a int not null, d varchar(15) not null, b
varchar(198) not null, c char(156)) engine=InnoDB
row_format=redundant;
@@ -61,9 +61,6 @@ row_format=redundant;
insert into t3 values(444, 'dddd', 'bbbbb', 'aaaaa');
insert into t3 values(555, 'eeee', 'ccccc', 'aaaaa');
-# read-only restart requires the change buffer to be empty; therefore we
-# do a slow shutdown.
-SET GLOBAL innodb_fast_shutdown=0;
--let $restart_parameters= $d --innodb-read-only
--source include/restart_mysqld.inc
@@ -150,7 +147,7 @@ RENAME TABLE t1 TO tee_one;
DROP TABLE t1;
DROP TABLE t2,t3;
---let SEARCH_PATTERN= \[ERROR\] InnoDB: Table test/t1 in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=1 SYS_TABLES\.MIX_LEN=511\b
+--let SEARCH_PATTERN= \[ERROR\] InnoDB: Table test/t1 in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=1 SYS_TABLES\.MIX_LEN=511\b.*
--source include/search_pattern_in_file.inc
--let $restart_parameters=
@@ -159,6 +156,7 @@ DROP TABLE t2,t3;
--list_files $bugdir
--remove_files_wildcard $bugdir
--rmdir $bugdir
+--rmdir $undodir
# Remove the data file, because DROP TABLE skipped it for the "corrupted" table
--let MYSQLD_DATADIR=`select @@datadir`
diff --git a/mysql-test/suite/innodb/t/sys_truncate.opt b/mysql-test/suite/innodb/t/sys_truncate.opt
new file mode 100644
index 00000000..f940dadf
--- /dev/null
+++ b/mysql-test/suite/innodb/t/sys_truncate.opt
@@ -0,0 +1,2 @@
+--innodb_data_file_path=ibdata1:10M:autoextend:autoshrink
+--innodb_sys_tablespaces
diff --git a/mysql-test/suite/innodb/t/sys_truncate.test b/mysql-test/suite/innodb/t/sys_truncate.test
new file mode 100644
index 00000000..d5e05dea
--- /dev/null
+++ b/mysql-test/suite/innodb/t/sys_truncate.test
@@ -0,0 +1,17 @@
+--source include/have_innodb.inc
+--source include/have_sequence.inc
+SET GLOBAL INNODB_FILE_PER_TABLE= 0;
+SET UNIQUE_CHECKS=0, FOREIGN_KEY_CHECKS=0;
+CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL,
+ f3 INT NOT NULL, INDEX(f1),
+ INDEX(f2), INDEX(f3))ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+COMMIT;
+DROP TABLE t1;
+--source include/wait_all_purged.inc
+SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
+--source include/restart_mysqld.inc
+SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
diff --git a/mysql-test/suite/innodb/t/sys_truncate_debug.opt b/mysql-test/suite/innodb/t/sys_truncate_debug.opt
new file mode 100644
index 00000000..b8a0ed24
--- /dev/null
+++ b/mysql-test/suite/innodb/t/sys_truncate_debug.opt
@@ -0,0 +1,3 @@
+--innodb_data_file_path=ibdata1:1M:autoextend:autoshrink
+--innodb_sys_tablespaces
+--innodb_page_size=4k
diff --git a/mysql-test/suite/innodb/t/sys_truncate_debug.test b/mysql-test/suite/innodb/t/sys_truncate_debug.test
new file mode 100644
index 00000000..b3363f10
--- /dev/null
+++ b/mysql-test/suite/innodb/t/sys_truncate_debug.test
@@ -0,0 +1,62 @@
+--source include/have_innodb.inc
+--source include/have_sequence.inc
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/not_windows.inc
+
+call mtr.add_suppression("InnoDB: Cannot shrink the system tablespace");
+call mtr.add_suppression("InnoDB: Plugin initialization aborted");
+call mtr.add_suppression("Plugin 'InnoDB' init function returned error");
+call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
+
+SET GLOBAL INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=2;
+SET GLOBAL INNODB_FILE_PER_TABLE= 0;
+SET UNIQUE_CHECKS=0, FOREIGN_KEY_CHECKS=0;
+CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL,
+ f3 INT NOT NULL, INDEX(f1),
+ INDEX(f2), INDEX(f3))ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+COMMIT;
+DROP TABLE t1;
+--source include/wait_all_purged.inc
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE = 0;
+
+# Ran out of buffer pool
+let $restart_parameters=--debug_dbug=+d,shrink_buffer_pool_full;
+--source include/restart_mysqld.inc
+
+--let SEARCH_PATTERN= \[Warning\] InnoDB: Cannot shrink the system tablespace
+let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
+--source include/search_pattern_in_file.inc
+
+SELECT * FROM INFORMATION_SCHEMA.ENGINES
+WHERE engine = 'innodb'
+AND support IN ('YES', 'DEFAULT', 'ENABLED');
+
+# Ran out of mtr log size
+let $restart_parameters=--debug_dbug=+d,mtr_log_max_size;
+--source include/restart_mysqld.inc
+
+--let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot shrink the system tablespace
+let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
+--source include/search_pattern_in_file.inc
+
+SELECT * FROM INFORMATION_SCHEMA.ENGINES
+WHERE engine = 'innodb'
+AND support IN ('YES', 'DEFAULT', 'ENABLED');
+
+# Crash after shrinking the system tablespace
+let $restart_parameters=--debug_dbug=+d,crash_after_sys_truncate;
+--source include/restart_mysqld.inc
+SELECT * FROM INFORMATION_SCHEMA.ENGINES
+WHERE engine = 'innodb'
+AND support IN ('YES', 'DEFAULT', 'ENABLED');
+
+let $restart_parameters=--innodb_buffer_pool_size=5M;
+--source include/restart_mysqld.inc
+SELECT * FROM INFORMATION_SCHEMA.ENGINES
+WHERE engine = 'innodb'
+AND support IN ('YES', 'DEFAULT', 'ENABLED');
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE=0;
diff --git a/mysql-test/suite/innodb/t/sys_truncate_large.opt b/mysql-test/suite/innodb/t/sys_truncate_large.opt
new file mode 100644
index 00000000..b85dcae8
--- /dev/null
+++ b/mysql-test/suite/innodb/t/sys_truncate_large.opt
@@ -0,0 +1,2 @@
+--innodb_data_file_path=ibdata1:1M:autoextend:autoshrink
+--innodb_page_size=4k
diff --git a/mysql-test/suite/innodb/t/sys_truncate_large.test b/mysql-test/suite/innodb/t/sys_truncate_large.test
new file mode 100644
index 00000000..8499ce0b
--- /dev/null
+++ b/mysql-test/suite/innodb/t/sys_truncate_large.test
@@ -0,0 +1,31 @@
+--source include/big_test.inc
+--source include/have_innodb.inc
+--source include/have_sequence.inc
+--source include/not_valgrind.inc
+--source include/have_debug.inc
+
+set global innodb_file_per_table=0;
+set global innodb_limit_optimistic_insert_debug=2;
+set unique_checks=0, foreign_key_checks=0;
+
+create table t1(f1 int not null)engine=innodb;
+begin;
+insert into t1 select * from seq_1_to_8192;
+insert into t1 select * from seq_1_to_8192;
+insert into t1 select * from seq_1_to_65536;
+commit;
+
+create table t2(f1 int not null)engine=innodb;
+insert into t2 select * from seq_1_to_65536;
+
+create table t3(f1 int not null)engine=innodb;
+insert into t3 select * from seq_1_to_65536;
+
+CREATE TABLE t4(f1 int not null)engine=innodb;
+insert into t4 select * from seq_1_to_65536;
+
+drop table t2;
+drop table t4;
+--source include/wait_all_purged.inc
+--source include/restart_mysqld.inc
+drop table t3, t1;
diff --git a/mysql-test/suite/innodb/t/sys_truncate_shutdown.opt b/mysql-test/suite/innodb/t/sys_truncate_shutdown.opt
new file mode 100644
index 00000000..001feac3
--- /dev/null
+++ b/mysql-test/suite/innodb/t/sys_truncate_shutdown.opt
@@ -0,0 +1,3 @@
+--innodb_data_file_path=ibdata1:1M:autoextend
+--innodb_sys_tablespaces
+--innodb_page_size=4k
diff --git a/mysql-test/suite/innodb/t/sys_truncate_shutdown.test b/mysql-test/suite/innodb/t/sys_truncate_shutdown.test
new file mode 100644
index 00000000..0f61049b
--- /dev/null
+++ b/mysql-test/suite/innodb/t/sys_truncate_shutdown.test
@@ -0,0 +1,20 @@
+--source include/have_innodb.inc
+--source include/have_sequence.inc
+SET GLOBAL innodb_fast_shutdown=0;
+--source include/restart_mysqld.inc
+SET GLOBAL INNODB_FILE_PER_TABLE= 0;
+SET UNIQUE_CHECKS=0, FOREIGN_KEY_CHECKS=0;
+CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL,
+ f3 INT NOT NULL, INDEX(f1),
+ INDEX(f2), INDEX(f3))ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+COMMIT;
+DROP TABLE t1;
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE = 0;
+
+SET GLOBAL innodb_fast_shutdown=0;
+--source include/restart_mysqld.inc
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE = 0;
diff --git a/mysql-test/suite/innodb/t/sys_truncate_shutdown_debug.opt b/mysql-test/suite/innodb/t/sys_truncate_shutdown_debug.opt
new file mode 100644
index 00000000..001feac3
--- /dev/null
+++ b/mysql-test/suite/innodb/t/sys_truncate_shutdown_debug.opt
@@ -0,0 +1,3 @@
+--innodb_data_file_path=ibdata1:1M:autoextend
+--innodb_sys_tablespaces
+--innodb_page_size=4k
diff --git a/mysql-test/suite/innodb/t/sys_truncate_shutdown_debug.test b/mysql-test/suite/innodb/t/sys_truncate_shutdown_debug.test
new file mode 100644
index 00000000..8e8c91e7
--- /dev/null
+++ b/mysql-test/suite/innodb/t/sys_truncate_shutdown_debug.test
@@ -0,0 +1,51 @@
+--source include/have_innodb.inc
+--source include/have_sequence.inc
+--source include/not_embedded.inc
+--source include/have_debug.inc
+
+call mtr.add_suppression("InnoDB: Cannot shrink the system tablespace");
+call mtr.add_suppression("InnoDB: Plugin initialization aborted");
+call mtr.add_suppression("Plugin 'InnoDB' init function returned error");
+call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
+
+SET GLOBAL innodb_fast_shutdown=0;
+--source include/restart_mysqld.inc
+SET GLOBAL INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=2;
+SET GLOBAL INNODB_FILE_PER_TABLE= 0;
+SET UNIQUE_CHECKS=0, FOREIGN_KEY_CHECKS=0;
+CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL,
+ f3 INT NOT NULL, INDEX(f1),
+ INDEX(f2), INDEX(f3))ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+COMMIT;
+DROP TABLE t1;
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE = 0;
+
+SET GLOBAL INNODB_FAST_SHUTDOWN=0;
+SET GLOBAL DEBUG_DBUG="+d,shrink_buffer_pool_full";
+--source include/restart_mysqld.inc
+
+--let SEARCH_PATTERN= \\[Warning\\] InnoDB: Cannot shrink the system tablespace
+let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
+--source include/search_pattern_in_file.inc
+
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE = 0;
+
+SET GLOBAL INNODB_FAST_SHUTDOWN=0;
+SET GLOBAL DEBUG_DBUG="+d,mtr_log_max_size";
+--source include/restart_mysqld.inc
+
+--let SEARCH_PATTERN= \\[ERROR\\] InnoDB: Cannot shrink the system tablespace
+let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
+--source include/search_pattern_in_file.inc
+
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE = 0;
+
+SET GLOBAL INNODB_FAST_SHUTDOWN=0;
+# Crash after shrinking the system tablespace
+let $restart_parameters=--debug_dbug="+d,crash_after_sys_truncate";
+--source include/restart_mysqld.inc
+
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE = 0;
diff --git a/mysql-test/suite/innodb/t/table_flags.opt b/mysql-test/suite/innodb/t/table_flags.opt
index 8f6c7db5..22cc6489 100644
--- a/mysql-test/suite/innodb/t/table_flags.opt
+++ b/mysql-test/suite/innodb/t/table_flags.opt
@@ -1,3 +1,3 @@
--innodb-checksum-algorithm=crc32
---skip-innodb-read-only-compressed
+--innodb-undo-tablespaces=0
--skip-innodb-buffer-pool-dump-at-shutdown
diff --git a/mysql-test/suite/innodb/t/table_flags.test b/mysql-test/suite/innodb/t/table_flags.test
index 511d3c24..e88499a4 100644
--- a/mysql-test/suite/innodb/t/table_flags.test
+++ b/mysql-test/suite/innodb/t/table_flags.test
@@ -29,17 +29,19 @@ let MYSQLD_DATADIR=`select @@datadir`;
let bugdir= $MYSQLTEST_VARDIR/tmp/table_flags;
--mkdir $bugdir
+let undodir= $MYSQLTEST_VARDIR/tmp/undo_dir;
+--mkdir $undodir
+
--let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err
--let $d=--innodb-data-home-dir=$bugdir --innodb-log-group-home-dir=$bugdir
--let $d=$d --innodb-data-file-path=ibdata1:1M:autoextend
--let $d=$d --innodb-undo-tablespaces=0
---let $d=$d --skip-innodb-fast-shutdown
+--let $d=$d --skip-innodb-fast-shutdown --innodb_undo_directory=$undodir
--let $restart_noprint=1
--let $restart_parameters=$d --innodb-stats-persistent=0
--source include/restart_mysqld.inc
-SET GLOBAL innodb_file_per_table=1;
CREATE TABLE tr(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
CREATE TABLE tc(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPACT;
CREATE TABLE td(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
@@ -234,6 +236,7 @@ DROP TABLE tr,tc,td,tz,tp;
--list_files $bugdir
--remove_files_wildcard $bugdir
--rmdir $bugdir
+--rmdir $undodir
call mtr.add_suppression("ERROR HY000: Can't create table `test`.`t1`");
--error ER_CANT_CREATE_TABLE
diff --git a/mysql-test/suite/innodb/t/temp_truncate.opt b/mysql-test/suite/innodb/t/temp_truncate.opt
new file mode 100644
index 00000000..70b8eaf5
--- /dev/null
+++ b/mysql-test/suite/innodb/t/temp_truncate.opt
@@ -0,0 +1,2 @@
+--innodb_temp_data_file_path=ibtmp1:5M:autoextend
+--innodb_sys_tablespaces
diff --git a/mysql-test/suite/innodb/t/temp_truncate.test b/mysql-test/suite/innodb/t/temp_truncate.test
new file mode 100644
index 00000000..aca17156
--- /dev/null
+++ b/mysql-test/suite/innodb/t/temp_truncate.test
@@ -0,0 +1,44 @@
+--source include/have_innodb.inc
+--source include/have_sequence.inc
+
+--echo # MDEV-33101 Server crashes when starting the server with
+--echo # innodb-force-recovery=6 and enabling the
+--echo # innodb_truncate_temporary_tablespace_now variable
+
+--let $restart_parameters=--innodb-force-recovery=6
+--source include/restart_mysqld.inc
+SHOW VARIABLES LIKE "innodb_read_only";
+SET GLOBAL innodb_truncate_temporary_tablespace_now=1;
+
+--let $restart_parameters=
+--source include/restart_mysqld.inc
+CREATE TEMPORARY TABLE t1(f1 INT NOT NULL,
+ f2 INT NOT NULL)ENGINE=InnoDB;
+INSERT INTO t1 SELECT seq, seq FROM seq_1_to_65536;
+DROP TABLE t1;
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE=4294967294;
+SET GLOBAL INNODB_TRUNCATE_TEMPORARY_TABLESPACE_NOW= 0;
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE=4294967294;
+SET GLOBAL INNODB_TRUNCATE_TEMPORARY_TABLESPACE_NOW= 1;
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE= 4294967294;
+
+# Concurrent session has open transaction for temporary tables
+CREATE TEMPORARY TABLE t1(f1 INT NOT NULL,
+ f2 INT NOT NULL)ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t1 SELECT seq, seq FROM seq_1_to_65536;
+
+# Concurrent session has open transaction for temporary tables
+connect(con1,localhost,root,,,);
+CREATE TEMPORARY TABLE t2(f1 INT NOT NULL,
+ f2 INT NOT NULL)ENGINE=InnoDB;
+INSERT INTO t2 SELECT seq, seq FROM seq_1_to_65536;
+DROP TABLE t2;
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE=4294967294;
+SET GLOBAL INNODB_TRUNCATE_TEMPORARY_TABLESPACE_NOW= 1;
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE= 4294967294;
+
+connection default;
+COMMIT;
+SELECT COUNT(*) FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/temp_truncate_debug.opt b/mysql-test/suite/innodb/t/temp_truncate_debug.opt
new file mode 100644
index 00000000..70b8eaf5
--- /dev/null
+++ b/mysql-test/suite/innodb/t/temp_truncate_debug.opt
@@ -0,0 +1,2 @@
+--innodb_temp_data_file_path=ibtmp1:5M:autoextend
+--innodb_sys_tablespaces
diff --git a/mysql-test/suite/innodb/t/temp_truncate_debug.test b/mysql-test/suite/innodb/t/temp_truncate_debug.test
new file mode 100644
index 00000000..b33ad713
--- /dev/null
+++ b/mysql-test/suite/innodb/t/temp_truncate_debug.test
@@ -0,0 +1,22 @@
+--source include/have_innodb.inc
+--source include/have_sequence.inc
+--source include/have_debug.inc
+
+call mtr.add_suppression("InnoDB: Cannot shrink the temporary tablespace");
+--source include/restart_mysqld.inc
+SET GLOBAL INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=2;
+CREATE TEMPORARY TABLE t1(f1 INT NOT NULL,
+ f2 INT NOT NULL)ENGINE=InnoDB;
+INSERT INTO t1 SELECT seq, seq FROM seq_1_to_65536;
+DROP TABLE t1;
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE= 4294967294;
+
+SET @saved_debug_dbug = @@SESSION.debug_dbug;
+SET DEBUG_DBUG="+d,fail_temp_truncate";
+SET GLOBAL INNODB_TRUNCATE_TEMPORARY_TABLESPACE_NOW= 1;
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE= 4294967294;
+SET DEBUG_DBUG=@saved_debug_dbug;
+
+SET GLOBAL INNODB_TRUNCATE_TEMPORARY_TABLESPACE_NOW= 1;
+SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE= 4294967294;
+SET GLOBAL INNODB_LIMIT_OPTIMISTIC_INSERT_DEBUG=default;
diff --git a/mysql-test/suite/innodb/t/temporary_table.test b/mysql-test/suite/innodb/t/temporary_table.test
index ee1474bb..9c742ce7 100644
--- a/mysql-test/suite/innodb/t/temporary_table.test
+++ b/mysql-test/suite/innodb/t/temporary_table.test
@@ -541,11 +541,11 @@ COMMIT;
DROP TABLE t1;
CREATE TEMPORARY TABLE t(c INT) ENGINE=InnoDB;
-SET SESSION tx_read_only=TRUE;
+SET SESSION TRANSACTION_READ_ONLY=TRUE;
LOCK TABLE test.t READ;
SELECT * FROM t;
INSERT INTO t VALUES(0xADC3);
-SET SESSION tx_read_only=FALSE;
+SET SESSION TRANSACTION_READ_ONLY=FALSE;
DROP TABLE t;
CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
@@ -585,27 +585,27 @@ DROP TABLE t1;
CREATE TEMPORARY TABLE tmp (a INT) ENGINE=InnoDB;
INSERT INTO tmp () VALUES (),();
-SET TX_READ_ONLY= 1;
+SET TRANSACTION_READ_ONLY= 1;
INSERT INTO tmp SELECT * FROM tmp;
-SET TX_READ_ONLY= 0;
+SET TRANSACTION_READ_ONLY= 0;
DROP TABLE tmp;
SET sql_mode='';
-SET GLOBAL tx_read_only=TRUE;
+SET GLOBAL TRANSACTION_READ_ONLY=TRUE;
CREATE TEMPORARY TABLE t (c INT);
-SET SESSION tx_read_only=DEFAULT;
+SET SESSION TRANSACTION_READ_ONLY=DEFAULT;
INSERT INTO t VALUES(1);
INSERT INTO t SELECT * FROM t;
-SET SESSION tx_read_only=FALSE;
-SET GLOBAL tx_read_only=OFF;
+SET SESSION TRANSACTION_READ_ONLY=FALSE;
+SET GLOBAL TRANSACTION_READ_ONLY=OFF;
DROP TABLE t;
CREATE TEMPORARY TABLE t(a INT);
-SET SESSION tx_read_only=ON;
+SET SESSION TRANSACTION_READ_ONLY=ON;
LOCK TABLE t READ;
SELECT COUNT(*)FROM t;
INSERT INTO t VALUES (0);
-SET SESSION tx_read_only=OFF;
+SET SESSION TRANSACTION_READ_ONLY=OFF;
DROP TABLE t;
CREATE TEMPORARY TABLE t (a INT) ENGINE=InnoDB;
diff --git a/mysql-test/suite/innodb/t/undo_upgrade.test b/mysql-test/suite/innodb/t/undo_upgrade.test
index 9c0da017..f27eae33 100644
--- a/mysql-test/suite/innodb/t/undo_upgrade.test
+++ b/mysql-test/suite/innodb/t/undo_upgrade.test
@@ -76,3 +76,46 @@ SELECT @@global.innodb_undo_tablespaces;
--echo # Should list 2 undo log tablespaces, not 4
list_files $MYSQLD_DATADIR undo*;
+
+--echo #
+--echo # MDEV-34200 InnoDB tries to write to read-only
+--echo # system tablespace in buf_dblwr_t::init_or_load_pages()
+--echo #
+
+SET GLOBAL innodb_fast_shutdown=0;
+let $restart_parameters=--innodb_undo_tablespaces=4;
+--source include/restart_mysqld.inc
+--echo # Should list 4 undo log tablespaces
+list_files $MYSQLD_DATADIR undo*;
+
+set global innodb_fast_shutdown=0;
+let $restart_parameters=--innodb_read_only=1;
+--source include/restart_mysqld.inc
+
+set global innodb_fast_shutdown=0;
+let bugdir= $MYSQLTEST_VARDIR/tmp/bugdir;
+mkdir $bugdir;
+let undodir= $MYSQLTEST_VARDIR/tmp/undo_dir;
+mkdir $undodir;
+let $d= --innodb-data-file-path=ibdata1:1M:autoextend;
+let $d=$d --innodb_undo_directory=$undodir;
+let $restart_parameters= $d --innodb-data-home-dir=$bugdir --innodb-log-group-home-dir=$bugdir --innodb_undo_tablespaces=3;
+--source include/restart_mysqld.inc
+--echo # Should list 3 undo log tablespaces
+list_files $undodir undo*;
+
+let bugdir_1= $MYSQLTEST_VARDIR/tmp/bugdir_1;
+mkdir $bugdir_1;
+
+set global innodb_fast_shutdown=0;
+let $restart_parameters= $d --innodb-data-home-dir=$bugdir_1 --innodb-log-group-home-dir=$bugdir_1 --innodb_undo_tablespaces=0;
+--source include/restart_mysqld.inc
+--echo # Shouldn't list 0 undo log tablespaces
+list_files $undodir undo*;
+
+set global innodb_fast_shutdown=0;
+let $restart_parameters=;
+--source include/restart_mysqld.inc
+rmdir $bugdir;
+rmdir $bugdir_1;
+rmdir $undodir;
diff --git a/mysql-test/suite/innodb_fts/r/crash_recovery.result b/mysql-test/suite/innodb_fts/r/crash_recovery.result
index b6319014..d7a8ef85 100644
--- a/mysql-test/suite/innodb_fts/r/crash_recovery.result
+++ b/mysql-test/suite/innodb_fts/r/crash_recovery.result
@@ -158,6 +158,8 @@ DROP TABLE mdev19073, mdev19073_2;
# MDEV-28706 Redundant InnoDB table fails during alter
#
SET @@global.innodb_file_per_table = 0;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
CREATE TABLE t1 (
col_int INTEGER, col_text TEXT,
col_text_1 TEXT
diff --git a/mysql-test/suite/innodb_fts/r/ft_result_cache_limit.result b/mysql-test/suite/innodb_fts/r/ft_result_cache_limit.result
index 74d60410..a42b08ae 100644
--- a/mysql-test/suite/innodb_fts/r/ft_result_cache_limit.result
+++ b/mysql-test/suite/innodb_fts/r/ft_result_cache_limit.result
@@ -19,7 +19,7 @@ END WHILE;
END//
CALL populate_t1;
SET autocommit=1;
-SET SESSION debug="+d,fts_instrument_result_cache_limit";
+SET SESSION debug_dbug="+d,fts_instrument_result_cache_limit";
ALTER TABLE t1 ADD FULLTEXT INDEX `text_content_idx` (`text_content`);
SELECT FTS_DOC_ID, text_content
FROM t1
diff --git a/mysql-test/suite/innodb_fts/r/fulltext.result b/mysql-test/suite/innodb_fts/r/fulltext.result
index 32dc87da..2a6fb81f 100644
--- a/mysql-test/suite/innodb_fts/r/fulltext.result
+++ b/mysql-test/suite/innodb_fts/r/fulltext.result
@@ -537,6 +537,9 @@ CREATE TABLE t2 (a int, b2 char(10), FULLTEXT KEY b2 (b2)) ENGINE = InnoDB;
INSERT INTO t2 VALUES (1,'Scargill');
CREATE TABLE t3 (a int, b int) ENGINE = InnoDB;
INSERT INTO t3 VALUES (1,1), (2,1);
+SELECT * FROM t2 where MATCH(b2) AGAINST('scargill' IN BOOLEAN MODE);
+a b2
+1 Scargill
# t2 should use full text index
EXPLAIN
SELECT count(*) FROM t1 WHERE
@@ -546,8 +549,8 @@ WHERE t3.a=t1.a AND MATCH(b2) AGAINST('scargill' IN BOOLEAN MODE)
);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
-2 MATERIALIZED t2 fulltext b2 b2 0 1 Using where
-2 MATERIALIZED t3 ALL NULL NULL NULL NULL 2 Using where
+2 DEPENDENT SUBQUERY t2 fulltext b2 b2 0 1 Using where
+2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where
# should return 0
SELECT count(*) FROM t1 WHERE
not exists(
@@ -721,6 +724,8 @@ DROP TABLE t1;
#
SET @save = @@global.innodb_file_per_table;
SET @@global.innodb_file_per_table = 0;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
CREATE TABLE t1 (
col_int INTEGER, col_text TEXT,
col_int_g INTEGER GENERATED ALWAYS AS (col_int)
@@ -730,6 +735,8 @@ ALTER TABLE t1 DROP KEY `ftidx` ;
INSERT INTO t1 (col_int, col_text) VALUES ( 1255, NULL);
DROP TABLE t1;
SET @@global.innodb_file_per_table = @save;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
#
# MDEV-20797 FULLTEXT search with apostrophe,
# and mandatory words
diff --git a/mysql-test/suite/innodb_fts/r/fulltext_misc.result b/mysql-test/suite/innodb_fts/r/fulltext_misc.result
index 69812ff8..3aa72dd5 100644
--- a/mysql-test/suite/innodb_fts/r/fulltext_misc.result
+++ b/mysql-test/suite/innodb_fts/r/fulltext_misc.result
@@ -8,9 +8,9 @@ EXPLAIN SELECT 1 FROM t1
WHERE 1 > ALL((SELECT 1 FROM t1 JOIN t1 a ON (MATCH(t1.f1) AGAINST (""))
WHERE t1.f1 GROUP BY t1.f1));
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 index NULL f1_2 8 NULL 1 Using index
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1
2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where
-2 SUBQUERY a index NULL f1_2 8 NULL 1 Using index
+2 SUBQUERY a ALL NULL NULL NULL NULL 1
PREPARE stmt FROM
'EXPLAIN SELECT 1 FROM t1
WHERE 1 > ALL((SELECT 1 FROM t1 RIGHT OUTER JOIN t1 a
@@ -18,14 +18,14 @@ PREPARE stmt FROM
WHERE t1.f1 GROUP BY t1.f1))';
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 index NULL f1_2 8 NULL 1 Using index
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1
2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where
-2 SUBQUERY a index NULL f1_2 8 NULL 1 Using index
+2 SUBQUERY a ALL NULL NULL NULL NULL 1
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 index NULL f1_2 8 NULL 1 Using index
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1
2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where
-2 SUBQUERY a index NULL f1_2 8 NULL 1 Using index
+2 SUBQUERY a ALL NULL NULL NULL NULL 1
DEALLOCATE PREPARE stmt;
PREPARE stmt FROM
'EXPLAIN SELECT 1 FROM t1
@@ -34,14 +34,14 @@ PREPARE stmt FROM
WHERE t1.f1 GROUP BY t1.f1))';
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 index NULL f1_2 8 NULL 1 Using index
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1
2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where
-2 SUBQUERY a index NULL f1_2 8 NULL 1 Using index
+2 SUBQUERY a ALL NULL NULL NULL NULL 1
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 index NULL f1_2 8 NULL 1 Using index
+1 PRIMARY t1 ALL NULL NULL NULL NULL 1
2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where
-2 SUBQUERY a index NULL f1_2 8 NULL 1 Using index
+2 SUBQUERY a ALL NULL NULL NULL NULL 1
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
drop table if exists t1;
diff --git a/mysql-test/suite/innodb_fts/r/innodb-fts-ddl,vers.rdiff b/mysql-test/suite/innodb_fts/r/innodb-fts-ddl,vers.rdiff
index d46275ff..d0967243 100644
--- a/mysql-test/suite/innodb_fts/r/innodb-fts-ddl,vers.rdiff
+++ b/mysql-test/suite/innodb_fts/r/innodb-fts-ddl,vers.rdiff
@@ -1,5 +1,5 @@
---- innodb-fts-ddl.result
-+++ innodb-fts-ddl.reject
+--- innodb-fts-ddl.result 2023-11-23 13:40:18.932463721 +0100
++++ innodb-fts-ddl,vers.result 2024-04-09 11:34:42.968505497 +0200
@@ -11,8 +11,10 @@
('MySQL vs. YourSQL','In the following database comparison ...'),
('MySQL Security','When configured properly, MySQL ...');
@@ -27,14 +27,14 @@
@@ -76,8 +80,10 @@
('MySQL vs. YourSQL','In the following database comparison ...'),
('MySQL Security','When configured properly, MySQL ...');
- CREATE FULLTEXT INDEX idx on fts_test (title, body) LOCK=NONE;
+ ALTER TABLE fts_test ADD FULLTEXT `idx` (title, body), ALGORITHM=NOCOPY, LOCK=NONE;
-ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
-ALTER TABLE fts_test ADD FULLTEXT `idx` (title, body), ALGORITHM=NOCOPY;
-+ERROR 0A000: LOCK=NONE is not supported. Reason: Not implemented for system-versioned operations. Try LOCK=SHARED
++ERROR 0A000: ALGORITHM=NOCOPY is not supported. Reason: Not implemented for system-versioned operations. Try ALGORITHM=COPY
+ALTER TABLE fts_test ADD FULLTEXT `idx` (title, body);
+affected rows: 6
+info: Records: 6 Duplicates: 0 Warnings: 0
- ALTER TABLE fts_test ROW_FORMAT=REDUNDANT, LOCK=NONE;
+ ALTER TABLE fts_test ROW_FORMAT=REDUNDANT, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
ALTER TABLE fts_test ROW_FORMAT=REDUNDANT;
@@ -162,7 +168,7 @@
diff --git a/mysql-test/suite/innodb_fts/r/innodb-fts-ddl,vers_trx.rdiff b/mysql-test/suite/innodb_fts/r/innodb-fts-ddl,vers_trx.rdiff
index d46275ff..515c1c22 100644
--- a/mysql-test/suite/innodb_fts/r/innodb-fts-ddl,vers_trx.rdiff
+++ b/mysql-test/suite/innodb_fts/r/innodb-fts-ddl,vers_trx.rdiff
@@ -1,5 +1,5 @@
---- innodb-fts-ddl.result
-+++ innodb-fts-ddl.reject
+--- innodb-fts-ddl.result 2023-11-23 13:40:18.932463721 +0100
++++ innodb-fts-ddl,vers_trx.result 2024-04-09 11:45:57.097484346 +0200
@@ -11,8 +11,10 @@
('MySQL vs. YourSQL','In the following database comparison ...'),
('MySQL Security','When configured properly, MySQL ...');
@@ -27,14 +27,14 @@
@@ -76,8 +80,10 @@
('MySQL vs. YourSQL','In the following database comparison ...'),
('MySQL Security','When configured properly, MySQL ...');
- CREATE FULLTEXT INDEX idx on fts_test (title, body) LOCK=NONE;
+ ALTER TABLE fts_test ADD FULLTEXT `idx` (title, body), ALGORITHM=NOCOPY, LOCK=NONE;
-ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
-ALTER TABLE fts_test ADD FULLTEXT `idx` (title, body), ALGORITHM=NOCOPY;
-+ERROR 0A000: LOCK=NONE is not supported. Reason: Not implemented for system-versioned operations. Try LOCK=SHARED
++ERROR 0A000: ALGORITHM=NOCOPY is not supported. Reason: Not implemented for system-versioned operations. Try ALGORITHM=COPY
+ALTER TABLE fts_test ADD FULLTEXT `idx` (title, body);
+affected rows: 6
+info: Records: 6 Duplicates: 0 Warnings: 0
- ALTER TABLE fts_test ROW_FORMAT=REDUNDANT, LOCK=NONE;
+ ALTER TABLE fts_test ROW_FORMAT=REDUNDANT, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
ALTER TABLE fts_test ROW_FORMAT=REDUNDANT;
@@ -162,7 +168,7 @@
diff --git a/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result b/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result
index 15f5b295..05b9fa40 100644
--- a/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result
+++ b/mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result
@@ -75,10 +75,10 @@ INSERT INTO fts_test (title,body) VALUES
('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
('MySQL vs. YourSQL','In the following database comparison ...'),
('MySQL Security','When configured properly, MySQL ...');
-CREATE FULLTEXT INDEX idx on fts_test (title, body) LOCK=NONE;
+ALTER TABLE fts_test ADD FULLTEXT `idx` (title, body), ALGORITHM=NOCOPY, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
ALTER TABLE fts_test ADD FULLTEXT `idx` (title, body), ALGORITHM=NOCOPY;
-ALTER TABLE fts_test ROW_FORMAT=REDUNDANT, LOCK=NONE;
+ALTER TABLE fts_test ROW_FORMAT=REDUNDANT, ALGORITHM=INPLACE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Fulltext index creation requires a lock. Try LOCK=SHARED
ALTER TABLE fts_test ROW_FORMAT=REDUNDANT;
SELECT * FROM fts_test WHERE MATCH (title, body)
diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result b/mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result
index 52cbede7..6d7a5647 100644
--- a/mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result
+++ b/mysql-test/suite/innodb_fts/r/innodb_fts_misc_1.result
@@ -466,7 +466,8 @@ ROLLBACK;
SELECT * FROM t2 WHERE MATCH(s2) AGAINST ('Lollipops');
s1 s2
DROP TABLE t2 , t1;
-set global innodb_file_per_table=1;
+SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
+SET GLOBAL innodb_read_only_compressed=OFF;
CREATE TABLE t1 (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
a VARCHAR(200),
@@ -649,7 +650,7 @@ id a b
6 MYSQL SECURITY when configured properly, mysql ...
7 TEST QUERY EXPANSION for database ...
DROP TABLE t1;
-SET GLOBAL innodb_file_per_table=1;
+SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
CREATE TABLE t1 (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
a VARCHAR(200),
diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_proximity.result b/mysql-test/suite/innodb_fts/r/innodb_fts_proximity.result
index a53fca51..32bb1c80 100644
--- a/mysql-test/suite/innodb_fts/r/innodb_fts_proximity.result
+++ b/mysql-test/suite/innodb_fts/r/innodb_fts_proximity.result
@@ -1,4 +1,3 @@
-drop table if exists t1;
CREATE TABLE t1 (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
a VARCHAR(200),
@@ -133,7 +132,6 @@ AGAINST ('"xyz blob"@3' IN BOOLEAN MODE);
count(*)
2
DROP TABLE t1;
-set global innodb_file_per_table=1;
set names utf8;
CREATE TABLE t1 (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
@@ -215,4 +213,3 @@ AGAINST ('"very blob"@3' IN BOOLEAN MODE);
count(*)
1
DROP TABLE t1;
-SET GLOBAL innodb_file_per_table=1;
diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_transaction.result b/mysql-test/suite/innodb_fts/r/innodb_fts_transaction.result
index fc6a1d1a..f372652c 100644
--- a/mysql-test/suite/innodb_fts/r/innodb_fts_transaction.result
+++ b/mysql-test/suite/innodb_fts/r/innodb_fts_transaction.result
@@ -534,8 +534,8 @@ INSERT INTO t1 (a,b) VALUES
('Sævör grét', 'áðan því úlpan var ónýt');
connect con2,localhost,root,,;
SET NAMES UTF8;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
CREATE FULLTEXT INDEX idx on t1 (a,b);
INSERT INTO t1 (a,b) VALUES
@@ -649,8 +649,8 @@ INSERT INTO t1 (a,b) VALUES
('Я могу еÑÑ‚ÑŒ Ñтекло', 'оно мне Mне вредит');
connect con2,localhost,root,,;
SET NAMES UTF8;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
CREATE FULLTEXT INDEX idx on t1 (a,b);
INSERT INTO t1 (a,b) VALUES
@@ -794,8 +794,8 @@ INSERT INTO t1 (a,b) VALUES
('Sævör grét', 'áðan því úlpan var ónýt');
connect con2,localhost,root,,;
SET NAMES UTF8;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
CREATE FULLTEXT INDEX idx on t1 (a,b);
INSERT INTO t1 (a,b) VALUES
@@ -914,8 +914,8 @@ INSERT INTO t1 (a,b) VALUES
('Я могу еÑÑ‚ÑŒ Ñтекло', 'оно мне Mне вредит');
connect con2,localhost,root,,;
SET NAMES UTF8;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
CREATE FULLTEXT INDEX idx on t1 (a,b);
INSERT INTO t1 (a,b) VALUES
diff --git a/mysql-test/suite/innodb_fts/r/misc_1.result b/mysql-test/suite/innodb_fts/r/misc_1.result
index 69a234fb..1087f25b 100644
--- a/mysql-test/suite/innodb_fts/r/misc_1.result
+++ b/mysql-test/suite/innodb_fts/r/misc_1.result
@@ -466,7 +466,6 @@ ROLLBACK;
SELECT * FROM t2 WHERE MATCH(s2) AGAINST ('Lollipops');
s1 s2
DROP TABLE t2 , t1;
-set global innodb_file_per_table=1;
CREATE TABLE t1 (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
a VARCHAR(200),
@@ -649,7 +648,6 @@ id a b
6 MYSQL SECURITY when configured properly, mysql ...
7 TEST QUERY EXPANSION for database ...
DROP TABLE t1;
-SET GLOBAL innodb_file_per_table=1;
CREATE TABLE t1 (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
a VARCHAR(200),
diff --git a/mysql-test/suite/innodb_fts/r/opt.result b/mysql-test/suite/innodb_fts/r/opt.result
index 57375495..c050a4da 100644
--- a/mysql-test/suite/innodb_fts/r/opt.result
+++ b/mysql-test/suite/innodb_fts/r/opt.result
@@ -1372,7 +1372,7 @@ MATCH(b.title, b.text) AGAINST ('+mysql' IN BOOLEAN MODE) and
a.FTS_DOC_ID = b.FTS_DOC_ID;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE a fulltext PRIMARY,FTS_DOC_ID_INDEX,ft_idx ft_idx 0 1 Using where
-1 SIMPLE b eq_ref PRIMARY,FTS_DOC_ID_INDEX,ft_idx PRIMARY 8 test.a.FTS_DOC_ID 1 Using where
+1 SIMPLE b fulltext PRIMARY,FTS_DOC_ID_INDEX,ft_idx ft_idx 0 1 Using where
SELECT a.FTS_DOC_ID, MATCH(a.title, a.text) AGAINST ('+database' IN BOOLEAN MODE),
b.FTS_DOC_ID, MATCH(b.title, b.text) AGAINST ('+database' IN BOOLEAN MODE)
FROM t1 a, t1 b
@@ -1558,6 +1558,7 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": 0.00009287,
"nested_loop": [
{
"table": {
@@ -1567,7 +1568,9 @@ EXPLAIN
"key": "f1",
"key_length": "0",
"used_key_parts": ["f1"],
+ "loops": 1,
"rows": 1,
+ "cost": 0.00009287,
"filtered": 100,
"attached_condition": "1.238585e+308 <= (match t1.f1 against ('1' in boolean mode))"
}
diff --git a/mysql-test/suite/innodb_fts/t/ft_result_cache_limit.test b/mysql-test/suite/innodb_fts/t/ft_result_cache_limit.test
index 84254a18..bf20c939 100644
--- a/mysql-test/suite/innodb_fts/t/ft_result_cache_limit.test
+++ b/mysql-test/suite/innodb_fts/t/ft_result_cache_limit.test
@@ -32,7 +32,7 @@ DELIMITER ;//
CALL populate_t1;
SET autocommit=1;
-SET SESSION debug="+d,fts_instrument_result_cache_limit";
+SET SESSION debug_dbug="+d,fts_instrument_result_cache_limit";
ALTER TABLE t1 ADD FULLTEXT INDEX `text_content_idx` (`text_content`);
diff --git a/mysql-test/suite/innodb_fts/t/fulltext.test b/mysql-test/suite/innodb_fts/t/fulltext.test
index 3ddc1856..d9bf14cb 100644
--- a/mysql-test/suite/innodb_fts/t/fulltext.test
+++ b/mysql-test/suite/innodb_fts/t/fulltext.test
@@ -570,6 +570,8 @@ INSERT INTO t2 VALUES (1,'Scargill');
CREATE TABLE t3 (a int, b int) ENGINE = InnoDB;
INSERT INTO t3 VALUES (1,1), (2,1);
+SELECT * FROM t2 where MATCH(b2) AGAINST('scargill' IN BOOLEAN MODE);
+
--echo # t2 should use full text index
EXPLAIN
SELECT count(*) FROM t1 WHERE
diff --git a/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test b/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test
index 11d2d493..17f319c9 100644
--- a/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test
+++ b/mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test
@@ -127,7 +127,7 @@ INSERT INTO fts_test (title,body) VALUES
# We could support online fulltext index creation when a FTS_DOC_ID
# column already exists. This has not been implemented yet.
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-CREATE FULLTEXT INDEX idx on fts_test (title, body) LOCK=NONE;
+ALTER TABLE fts_test ADD FULLTEXT `idx` (title, body), ALGORITHM=NOCOPY, LOCK=NONE;
if ($MTR_COMBINATION_ORIG) {
ALTER TABLE fts_test ADD FULLTEXT `idx` (title, body), ALGORITHM=NOCOPY;
}
@@ -138,7 +138,7 @@ ALTER TABLE fts_test ADD FULLTEXT `idx` (title, body);
}
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-ALTER TABLE fts_test ROW_FORMAT=REDUNDANT, LOCK=NONE;
+ALTER TABLE fts_test ROW_FORMAT=REDUNDANT, ALGORITHM=INPLACE, LOCK=NONE;
ALTER TABLE fts_test ROW_FORMAT=REDUNDANT;
SELECT * FROM fts_test WHERE MATCH (title, body)
diff --git a/mysql-test/suite/innodb_fts/t/innodb_fts_misc_1.test b/mysql-test/suite/innodb_fts/t/innodb_fts_misc_1.test
index 4eaf5b2e..c0836372 100644
--- a/mysql-test/suite/innodb_fts/t/innodb_fts_misc_1.test
+++ b/mysql-test/suite/innodb_fts/t/innodb_fts_misc_1.test
@@ -427,15 +427,9 @@ DROP TABLE t2 , t1;
# FTS index with compressed row format
#------------------------------------------------------------------------------
-# Save innodb variables
-let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
-
-set global innodb_file_per_table=1;
-
---disable_query_log
SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
SET GLOBAL innodb_read_only_compressed=OFF;
---enable_query_log
+
# Create FTS table
CREATE TABLE t1 (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
@@ -583,10 +577,7 @@ SELECT * FROM t1 WHERE MATCH (a,b)
SELECT * FROM t1 ORDER BY id;
DROP TABLE t1;
---disable_query_log
SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
---enable_query_log
-eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
#------------------------------------------------------------------------------
# FTS index with utf8 character testcase
diff --git a/mysql-test/suite/innodb_fts/t/innodb_fts_proximity.test b/mysql-test/suite/innodb_fts/t/innodb_fts_proximity.test
index edf7ab21..ca8b80ca 100644
--- a/mysql-test/suite/innodb_fts/t/innodb_fts_proximity.test
+++ b/mysql-test/suite/innodb_fts/t/innodb_fts_proximity.test
@@ -5,14 +5,6 @@
# Functional testing with FTS proximity search using '@'
# and try search default words
---disable_warnings
-drop table if exists t1;
---enable_warnings
-
---disable_query_log
-let $innodb_file_per_table_orig = `select @@innodb_file_per_table`;
---enable_query_log
-
# Create FTS table
CREATE TABLE t1 (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
@@ -161,10 +153,9 @@ SELECT count(*) FROM t1
DROP TABLE t1;
-set global innodb_file_per_table=1;
-
set names utf8;
--character_set utf8
+
# Test fts with externally stored long column
CREATE TABLE t1 (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
@@ -259,5 +250,3 @@ SELECT count(*) FROM t1
AGAINST ('"very blob"@3' IN BOOLEAN MODE);
DROP TABLE t1;
-
-eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
diff --git a/mysql-test/suite/innodb_fts/t/innodb_fts_transaction.test b/mysql-test/suite/innodb_fts/t/innodb_fts_transaction.test
index 026aeb63..463de63c 100644
--- a/mysql-test/suite/innodb_fts/t/innodb_fts_transaction.test
+++ b/mysql-test/suite/innodb_fts/t/innodb_fts_transaction.test
@@ -608,7 +608,7 @@ INSERT INTO t1 (a,b) VALUES
--connect (con2,localhost,root,,)
SET NAMES UTF8;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
# Create the FTS index again
CREATE FULLTEXT INDEX idx on t1 (a,b);
@@ -704,7 +704,7 @@ INSERT INTO t1 (a,b) VALUES
--connect (con2,localhost,root,,)
SET NAMES UTF8;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
# Create the FTS index again
CREATE FULLTEXT INDEX idx on t1 (a,b);
@@ -823,7 +823,7 @@ INSERT INTO t1 (a,b) VALUES
--connect (con2,localhost,root,,)
SET NAMES UTF8;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
# Create the FTS index again
CREATE FULLTEXT INDEX idx on t1 (a,b);
@@ -919,7 +919,7 @@ INSERT INTO t1 (a,b) VALUES
--connect (con2,localhost,root,,)
SET NAMES UTF8;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
# Create the FTS index again
CREATE FULLTEXT INDEX idx on t1 (a,b);
diff --git a/mysql-test/suite/innodb_fts/t/misc_1.test b/mysql-test/suite/innodb_fts/t/misc_1.test
index 45eaf447..21f25054 100644
--- a/mysql-test/suite/innodb_fts/t/misc_1.test
+++ b/mysql-test/suite/innodb_fts/t/misc_1.test
@@ -429,11 +429,6 @@ DROP TABLE t2 , t1;
# FTS index with compressed row format
#------------------------------------------------------------------------------
-# Save innodb variables
-let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
-
-set global innodb_file_per_table=1;
-
# Create FTS table
CREATE TABLE t1 (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
@@ -581,7 +576,6 @@ SELECT * FROM t1 WHERE MATCH (a,b)
SELECT * FROM t1 ORDER BY id;
DROP TABLE t1;
-eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
#------------------------------------------------------------------------------
# FTS index with utf8 character testcase
diff --git a/mysql-test/suite/innodb_gis/r/alter_spatial_index.result b/mysql-test/suite/innodb_gis/r/alter_spatial_index.result
index 5365e7d0..100a5e94 100644
--- a/mysql-test/suite/innodb_gis/r/alter_spatial_index.result
+++ b/mysql-test/suite/innodb_gis/r/alter_spatial_index.result
@@ -759,17 +759,6 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
alter table t1 add b geometry not null default st_geomfromtext('POINT(0 0)'),
add spatial index(b), algorithm=copy;
DROP table t1;
-#
-# BUG#20111575 ALTER TABLE...ADD SPATIAL INDEX...LOCK NONE IS REFUSED
-# WITHOUT STATING A REASON
-#
-CREATE TABLE t1(p point NOT NULL) ENGINE=innodb;
-ALTER TABLE t1 ADD SPATIAL INDEX(p), LOCK=NONE;
-ERROR 0A000: LOCK=NONE is not supported. Reason: Do not support online operation on table with GIS index. Try LOCK=SHARED
-ALTER TABLE t1 ADD SPATIAL INDEX(p);
-ALTER TABLE t1 FORCE, LOCK=NONE;
-ERROR 0A000: LOCK=NONE is not supported. Reason: Do not support online operation on table with GIS index. Try LOCK=SHARED
-DROP TABLE t1;
create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),LineString(Point(0,0),Point(1,1)))) ENGINE=innodb;
set timestamp=10;
insert into t1 values(default);
diff --git a/mysql-test/suite/innodb_gis/r/check_rtree.result b/mysql-test/suite/innodb_gis/r/check_rtree.result
index 0d7b25b6..10155fb5 100644
--- a/mysql-test/suite/innodb_gis/r/check_rtree.result
+++ b/mysql-test/suite/innodb_gis/r/check_rtree.result
@@ -1,5 +1,5 @@
create table t1 (i int, g geometry not null, spatial index (g))engine=innodb;
-SET SESSION debug="+d,rtree_test_check_count";
+SET SESSION debug_dbug="+d,rtree_test_check_count";
insert into t1 values (1, POINT(1,1));
insert into t1 values (1, POINT(1.5,1.5));
insert into t1 values (1, POINT(3,3));
diff --git a/mysql-test/suite/innodb_gis/r/create_spatial_index.result b/mysql-test/suite/innodb_gis/r/create_spatial_index.result
index d3c69294..30b41b41 100644
--- a/mysql-test/suite/innodb_gis/r/create_spatial_index.result
+++ b/mysql-test/suite/innodb_gis/r/create_spatial_index.result
@@ -57,10 +57,14 @@ ANALYZE TABLE tab;
Table Op Msg_type Msg_text
test.tab analyze status Engine-independent statistics collected
test.tab analyze status OK
+# Test the MBRContains
SET @g1 = ST_GeomFromText( 'POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))');
-EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
+EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1+0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
3 POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))
@@ -74,7 +78,7 @@ id select_type table type possible_keys key key_len ref rows Extra
SET @g1 = ST_GeomFromText('LINESTRING( 300 300,400 400)');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
4 POLYGON((300 300,400 400,500 500,300 500,300 400,300 300))
@@ -85,10 +89,11 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBRContains(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the MBRWithin
SET @g1 = ST_GeomFromText( 'POLYGON((30 30,40 40,50 50,30 50,30 40,30 30)) ');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRWithin(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRWithin(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
1 POLYGON((30 30,40 40,50 50,30 50,30 40,30 30))
@@ -99,10 +104,11 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBRWithin(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the ST_Crosses
SET @g1 = ST_GeomFromText('POLYGON((100 200,200 300,400 500,500 300,300 200,100 300,100 200))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE ST_Crosses(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE ST_Crosses(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
4 POLYGON((300 300,400 400,500 500,300 500,300 400,300 300))
@@ -116,7 +122,7 @@ id select_type table type possible_keys key key_len ref rows Extra
SET @g1 = ST_GeomFromText('LINESTRING( 10 10,30 30,40 40)');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE ST_CRosses(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE ST_Crosses(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
1 POLYGON((30 30,40 40,50 50,30 50,30 40,30 30))
@@ -127,6 +133,7 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE ST_Crosses(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the MBRDisjoint
SET @g1 = ST_GeomFromText('POLYGON((4 -2,5 -4,6 -5,7 -4,7 2,4 -2))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRDisjoint(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
@@ -145,14 +152,15 @@ c1 ST_Astext(c4)
EXPLAIN UPDATE tab SET C2 = ST_GeomFromText('POINT(0 0)')
WHERE MBRDisjoint(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
+1 SIMPLE tab range idx3 idx3 34 NULL 9 Using where
EXPLAIN DELETE FROM tab WHERE MBRDisjoint(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab ALL idx3 NULL NULL NULL 10 Using where
+1 SIMPLE tab range idx3 idx3 34 NULL 9 Using where
+# Test the MBREquals
SET @g1 = ST_GeomFromText('POLYGON((5010 5010,5020 5020,5030 5030,5040 5030,5020 5010,5010 5010))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBREquals(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBREquals(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
10 POLYGON((5010 5010,5020 5020,5030 5030,5040 5030,5020 5010,5010 5010))
@@ -166,7 +174,7 @@ id select_type table type possible_keys key key_len ref rows Extra
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 2 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
1 POLYGON((30 30,40 40,50 50,30 50,30 40,30 30))
@@ -182,7 +190,7 @@ id select_type table type possible_keys key key_len ref rows Extra
SET @g1 = ST_GeomFromText('LINESTRING( 30 30,40 40,50 50)');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
1 POLYGON((30 30,40 40,50 50,30 50,30 40,30 30))
@@ -194,10 +202,11 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBRintersects(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the Overelaps
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 2,4 5,5 5,7 1,0 0 ))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBROverlaps(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBROverlaps(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
3 POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))
@@ -218,14 +227,15 @@ c1 ST_Astext(c4)
EXPLAIN UPDATE tab SET C2 = ST_GeomFromText('POINT(0 0)')
WHERE MBROverlaps(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
+1 SIMPLE tab range idx3 idx3 34 NULL 8 Using where
EXPLAIN DELETE FROM tab WHERE MBROverlaps(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab ALL idx3 NULL NULL NULL 10 Using where
+1 SIMPLE tab range idx3 idx3 34 NULL 8 Using where
+# Test the ST_Touches
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE ST_Touches(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 2 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE ST_Touches(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
2 POLYGON((40 50,40 70,50 100,70 100,80 80,70 50,40 50))
@@ -239,7 +249,7 @@ id select_type table type possible_keys key key_len ref rows Extra
SET @g1 = ST_GeomFromText('LINESTRING( 100 100,200 200,300 300)');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE ST_Touches(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE ST_Touches(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
4 POLYGON((300 300,400 400,500 500,300 500,300 400,300 300))
@@ -250,10 +260,11 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE ST_Touches(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the MBRContains
SET @g1 = ST_GeomFromText( 'POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
3 POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))
@@ -267,7 +278,7 @@ id select_type table type possible_keys key key_len ref rows Extra
SET @g1 = ST_GeomFromText( 'POLYGON((30 30,40 40,50 50,30 50,30 40,30 30)) ');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRWithin(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRWithin(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
1 POLYGON((30 30,40 40,50 50,30 50,30 40,30 30))
@@ -278,6 +289,7 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBRWithin(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the MBRDisjoint
SET @g1 = ST_GeomFromText('POLYGON((4 -2,5 -4,6 -5,7 -4,7 2,4 -2))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRDisjoint(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
@@ -296,14 +308,15 @@ c1 ST_Astext(c4)
EXPLAIN UPDATE tab SET C2 = ST_GeomFromText('POINT(0 0)')
WHERE MBRDisjoint(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
+1 SIMPLE tab range idx3 idx3 34 NULL 9 Using where
EXPLAIN DELETE FROM tab WHERE MBRDisjoint(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab ALL idx3 NULL NULL NULL 10 Using where
+1 SIMPLE tab range idx3 idx3 34 NULL 9 Using where
+# Test the MBREquals
SET @g1 = ST_GeomFromText('POLYGON((5010 5010,5020 5020,5030 5030,5040 5030,5020 5010,5010 5010))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBREquals(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBREquals(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
10 POLYGON((5010 5010,5020 5020,5030 5030,5040 5030,5020 5010,5010 5010))
@@ -314,10 +327,11 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBREquals(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the MBRintersects
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 2 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
1 POLYGON((30 30,40 40,50 50,30 50,30 40,30 30))
@@ -333,7 +347,7 @@ id select_type table type possible_keys key key_len ref rows Extra
SET @g1 = ST_GeomFromText('LINESTRING( 30 30,40 40,50 50)');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
1 POLYGON((30 30,40 40,50 50,30 50,30 40,30 30))
@@ -345,10 +359,11 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBRintersects(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the MBROverelaps
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 2,4 5,5 5,7 1,0 0 ))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBROverlaps(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBROverlaps(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
3 POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))
@@ -359,10 +374,11 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBROverlaps(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the MBRTouches
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRTouches(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 2 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRTouches(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
2 POLYGON((40 50,40 70,50 100,70 100,80 80,70 50,40 50))
@@ -373,6 +389,7 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBRTouches(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 2 Using where
+# Test with Procedure
CREATE PROCEDURE proc_wl6968()
BEGIN
SET @g1 = ST_GeomFromText( 'POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))');
@@ -383,11 +400,12 @@ EXPLAIN DELETE FROM tab WHERE MBRContains(tab.c4, @g1);
END |
CALL proc_wl6968();
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the Delete & Update
SET @g1 = ST_GeomFromText( 'POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))');
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
@@ -486,6 +504,7 @@ ANALYZE TABLE tab;
Table Op Msg_type Msg_text
test.tab analyze status Engine-independent statistics collected
test.tab analyze status OK
+# Test the MBRContains
SET @g1 = ST_GeomFromText( 'POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
@@ -514,6 +533,7 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBRContains(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the MBRWithin
SET @g1 = ST_GeomFromText( 'POLYGON((30 30,40 40,50 50,30 50,30 40,30 30)) ');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRWithin(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
@@ -528,6 +548,7 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBRWithin(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the ST_Crosses
SET @g1 = ST_GeomFromText('POLYGON((100 200,200 300,400 500,500 300,300 200,100 300,100 200))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE ST_Crosses(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
@@ -556,10 +577,11 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE ST_Crosses(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the MBRDisjoint
SET @g1 = ST_GeomFromText('POLYGON((4 -2,5 -4,6 -5,7 -4,7 2,4 -2))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRDisjoint(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab ALL idx3 NULL NULL NULL 10 Using where; Using filesort
+1 SIMPLE tab range idx3 idx3 34 NULL 9 Using where; Using filesort
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRDisjoint(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
1 POLYGON((30 30,40 40,50 50,30 50,30 40,30 30))
@@ -574,10 +596,11 @@ c1 ST_Astext(c4)
EXPLAIN UPDATE tab SET C2 = ST_GeomFromText('POINT(0 0)')
WHERE MBRDisjoint(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab ALL idx3 NULL NULL NULL 10 Using where
+1 SIMPLE tab range idx3 idx3 34 NULL 9 Using where
EXPLAIN DELETE FROM tab WHERE MBRDisjoint(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab ALL idx3 NULL NULL NULL 10 Using where
+1 SIMPLE tab range idx3 idx3 34 NULL 9 Using where
+# Test the MBREquals
SET @g1 = ST_GeomFromText('POLYGON((5010 5010,5020 5020,5030 5030,5040 5030,5020 5010,5010 5010))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBREquals(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
@@ -592,6 +615,7 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBREquals(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the MBRintersects
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
@@ -623,6 +647,7 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBRintersects(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the Overelaps
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 2,4 5,5 5,7 1,0 0 ))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBROverlaps(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
@@ -640,17 +665,18 @@ id select_type table type possible_keys key key_len ref rows Extra
SET @g1 = ST_GeomFromText('LINESTRING(7 1,30 30,1010 3010,1010 2010,3010 3010,4010 4010,5010 5010 )');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBROverlaps(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab ALL idx3 NULL NULL NULL 10 Using where; Using filesort
+1 SIMPLE tab range idx3 idx3 34 NULL 8 Using where; Using filesort
SELECT c1,ST_Astext(c4) FROM tab WHERE MBROverlaps(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
3 POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))
EXPLAIN UPDATE tab SET C2 = ST_GeomFromText('POINT(0 0)')
WHERE MBROverlaps(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab ALL idx3 NULL NULL NULL 10 Using where
+1 SIMPLE tab range idx3 idx3 34 NULL 8 Using where
EXPLAIN DELETE FROM tab WHERE MBROverlaps(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab ALL idx3 NULL NULL NULL 10 Using where
+1 SIMPLE tab range idx3 idx3 34 NULL 8 Using where
+# Test the ST_Touches
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE ST_Touches(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
@@ -679,6 +705,7 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE ST_Touches(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the MBRContains
SET @g1 = ST_GeomFromText( 'POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
@@ -707,10 +734,11 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBRWithin(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the MBRDisjoint
SET @g1 = ST_GeomFromText('POLYGON((4 -2,5 -4,6 -5,7 -4,7 2,4 -2))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRDisjoint(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab ALL idx3 NULL NULL NULL 10 Using where; Using filesort
+1 SIMPLE tab range idx3 idx3 34 NULL 9 Using where; Using filesort
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRDisjoint(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
1 POLYGON((30 30,40 40,50 50,30 50,30 40,30 30))
@@ -725,10 +753,11 @@ c1 ST_Astext(c4)
EXPLAIN UPDATE tab SET C2 = ST_GeomFromText('POINT(0 0)')
WHERE MBRDisjoint(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab ALL idx3 NULL NULL NULL 10 Using where
+1 SIMPLE tab range idx3 idx3 34 NULL 9 Using where
EXPLAIN DELETE FROM tab WHERE MBRDisjoint(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab ALL idx3 NULL NULL NULL 10 Using where
+1 SIMPLE tab range idx3 idx3 34 NULL 9 Using where
+# Test the MBREquals
SET @g1 = ST_GeomFromText('POLYGON((5010 5010,5020 5020,5030 5030,5040 5030,5020 5010,5010 5010))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBREquals(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
@@ -743,6 +772,7 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBREquals(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the MBRintersects
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
@@ -774,6 +804,7 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBRintersects(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the MBROverelaps
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 2,4 5,5 5,7 1,0 0 ))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBROverlaps(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
@@ -788,6 +819,7 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBROverlaps(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the MBRTouches
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRTouches(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
@@ -802,6 +834,7 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBRTouches(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 2 Using where
+# Test with Procedure
CREATE PROCEDURE proc_wl6968()
BEGIN
SET @g1 = ST_GeomFromText('POLYGON((5010 5010,5020 5020,5030 5030,5040 5030,5020 5010,5010 5010))');
@@ -817,6 +850,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the Delete & Update
SET @g1 = ST_GeomFromText( 'POLYGON((30 30,40 40,50 50,30 50,30 40,30 30)) ');
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRWithin(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
@@ -904,10 +938,11 @@ ANALYZE TABLE tab;
Table Op Msg_type Msg_text
test.tab analyze status Engine-independent statistics collected
test.tab analyze status OK
+# Test the MBRContains
SET @g1 = ST_GeomFromText( 'POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
3 POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))
@@ -921,7 +956,7 @@ id select_type table type possible_keys key key_len ref rows Extra
SET @g1 = ST_GeomFromText('LINESTRING( 300 300,400 400)');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
4 POLYGON((300 300,400 400,500 500,300 500,300 400,300 300))
@@ -932,10 +967,11 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBRContains(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the MBRWithin
SET @g1 = ST_GeomFromText( 'POLYGON((30 30,40 40,50 50,30 50,30 40,30 30)) ');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRWithin(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRWithin(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
1 POLYGON((30 30,40 40,50 50,30 50,30 40,30 30))
@@ -946,10 +982,11 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBRWithin(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the ST_Crosses
SET @g1 = ST_GeomFromText('POLYGON((100 200,200 300,400 500,500 300,300 200,100 300,100 200))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE ST_Crosses(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE ST_Crosses(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
4 POLYGON((300 300,400 400,500 500,300 500,300 400,300 300))
@@ -963,7 +1000,7 @@ id select_type table type possible_keys key key_len ref rows Extra
SET @g1 = ST_GeomFromText('LINESTRING( 10 10,30 30,40 40)');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE ST_CRosses(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE ST_Crosses(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
1 POLYGON((30 30,40 40,50 50,30 50,30 40,30 30))
@@ -974,6 +1011,7 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE ST_Crosses(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the MBRDisjoint
SET @g1 = ST_GeomFromText('POLYGON((4 -2,5 -4,6 -5,7 -4,7 2,4 -2))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRDisjoint(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
@@ -992,14 +1030,15 @@ c1 ST_Astext(c4)
EXPLAIN UPDATE tab SET C2 = ST_GeomFromText('POINT(0 0)')
WHERE MBRDisjoint(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
+1 SIMPLE tab range idx3 idx3 34 NULL 9 Using where
EXPLAIN DELETE FROM tab WHERE MBRDisjoint(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab ALL idx3 NULL NULL NULL 10 Using where
+1 SIMPLE tab range idx3 idx3 34 NULL 9 Using where
+# Test the MBREquals
SET @g1 = ST_GeomFromText('POLYGON((5010 5010,5020 5020,5030 5030,5040 5030,5020 5010,5010 5010))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBREquals(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBREquals(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
10 POLYGON((5010 5010,5020 5020,5030 5030,5040 5030,5020 5010,5010 5010))
@@ -1010,10 +1049,11 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBREquals(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the MBRintersects
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 2 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
1 POLYGON((30 30,40 40,50 50,30 50,30 40,30 30))
@@ -1029,7 +1069,7 @@ id select_type table type possible_keys key key_len ref rows Extra
SET @g1 = ST_GeomFromText('LINESTRING( 30 30,40 40,50 50)');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
1 POLYGON((30 30,40 40,50 50,30 50,30 40,30 30))
@@ -1041,10 +1081,11 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBRintersects(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the Overelaps
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 2,4 5,5 5,7 1,0 0 ))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBROverlaps(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBROverlaps(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
3 POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))
@@ -1065,14 +1106,15 @@ c1 ST_Astext(c4)
EXPLAIN UPDATE tab SET C2 = ST_GeomFromText('POINT(0 0)')
WHERE MBROverlaps(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
+1 SIMPLE tab range idx3 idx3 34 NULL 8 Using where
EXPLAIN DELETE FROM tab WHERE MBROverlaps(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab ALL idx3 NULL NULL NULL 10 Using where
+1 SIMPLE tab range idx3 idx3 34 NULL 8 Using where
+# Test the ST_Touches
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE ST_Touches(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 2 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE ST_Touches(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
2 POLYGON((40 50,40 70,50 100,70 100,80 80,70 50,40 50))
@@ -1086,7 +1128,7 @@ id select_type table type possible_keys key key_len ref rows Extra
SET @g1 = ST_GeomFromText('LINESTRING( 100 100,200 200,300 300)');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE ST_Touches(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE ST_Touches(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
4 POLYGON((300 300,400 400,500 500,300 500,300 400,300 300))
@@ -1097,10 +1139,11 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE ST_Touches(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the MBRContains
SET @g1 = ST_GeomFromText( 'POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
3 POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))
@@ -1114,7 +1157,7 @@ id select_type table type possible_keys key key_len ref rows Extra
SET @g1 = ST_GeomFromText( 'POLYGON((30 30,40 40,50 50,30 50,30 40,30 30)) ');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRWithin(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRWithin(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
1 POLYGON((30 30,40 40,50 50,30 50,30 40,30 30))
@@ -1125,6 +1168,7 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBRWithin(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the MBRDisjoint
SET @g1 = ST_GeomFromText('POLYGON((4 -2,5 -4,6 -5,7 -4,7 2,4 -2))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRDisjoint(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
@@ -1143,14 +1187,15 @@ c1 ST_Astext(c4)
EXPLAIN UPDATE tab SET C2 = ST_GeomFromText('POINT(0 0)')
WHERE MBRDisjoint(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
+1 SIMPLE tab range idx3 idx3 34 NULL 9 Using where
EXPLAIN DELETE FROM tab WHERE MBRDisjoint(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab ALL idx3 NULL NULL NULL 10 Using where
+1 SIMPLE tab range idx3 idx3 34 NULL 9 Using where
+# Test the MBREquals
SET @g1 = ST_GeomFromText('POLYGON((5010 5010,5020 5020,5030 5030,5040 5030,5020 5010,5010 5010))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBREquals(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBREquals(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
10 POLYGON((5010 5010,5020 5020,5030 5030,5040 5030,5020 5010,5010 5010))
@@ -1161,10 +1206,11 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBREquals(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the MBRintersects
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 2 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
1 POLYGON((30 30,40 40,50 50,30 50,30 40,30 30))
@@ -1180,7 +1226,7 @@ id select_type table type possible_keys key key_len ref rows Extra
SET @g1 = ST_GeomFromText('LINESTRING( 30 30,40 40,50 50)');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
1 POLYGON((30 30,40 40,50 50,30 50,30 40,30 30))
@@ -1192,10 +1238,11 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBRintersects(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the MBROverelaps
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 2,4 5,5 5,7 1,0 0 ))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBROverlaps(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBROverlaps(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
3 POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))
@@ -1206,10 +1253,11 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBROverlaps(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 1 Using where
+# Test the MBRTouches
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRTouches(tab.c4, @g1) ORDER BY c1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE tab range idx3 idx3 34 NULL 2 Using where; Using filesort
+1 SIMPLE tab index idx3 PRIMARY 4 NULL 10 Using where
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRTouches(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
2 POLYGON((40 50,40 70,50 100,70 100,80 80,70 50,40 50))
@@ -1220,6 +1268,7 @@ id select_type table type possible_keys key key_len ref rows Extra
EXPLAIN DELETE FROM tab WHERE MBRTouches(tab.c4, @g1);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tab range idx3 idx3 34 NULL 2 Using where
+# Test the Delete & Update
SET @g1 = ST_GeomFromText('POLYGON((5010 5010,5020 5020,5030 5030,5040 5030,5020 5010,5010 5010))');
SELECT c1,ST_Astext(c4) FROM tab WHERE MBREquals(tab.c4, @g1) ORDER BY c1;
c1 ST_Astext(c4)
@@ -1243,6 +1292,7 @@ CHECK TABLE tab;
Table Op Msg_type Msg_text
test.tab check status OK
DROP TABLE tab;
+# Test check constraint on spatial column
CREATE TABLE tab(c1 POINT NOT NULL,CONSTRAINT tab_const check(c1 > 0) ) ENGINE=InnoDB;
ERROR HY000: Illegal parameter data types point and int for operation '>'
CREATE TABLE tab(c1 POINT NOT NULL,CONSTRAINT tab_const check(CAST(c1 AS BINARY) > 0) ) ENGINE=InnoDB;
diff --git a/mysql-test/suite/innodb_gis/r/geometry.result b/mysql-test/suite/innodb_gis/r/geometry.result
index c38e9e28..d4d4abe0 100644
--- a/mysql-test/suite/innodb_gis/r/geometry.result
+++ b/mysql-test/suite/innodb_gis/r/geometry.result
@@ -1093,7 +1093,7 @@ PARTITION pNorth VALUES IN (10,20,30) ,
PARTITION pEast VALUES IN (40,50,60) ,
PARTITION pWest VALUES IN (70,80,100)
);
-ERROR 42000: The storage engine for the table doesn't support GEOMETRY
+ERROR HY000: A BLOB field is not allowed in partition function
#check start transaction commit & Rollback
START TRANSACTION;
DELETE FROM tab3;
diff --git a/mysql-test/suite/innodb_gis/r/repeatable_spatial.result b/mysql-test/suite/innodb_gis/r/repeatable_spatial.result
index 065312f6..561b1f77 100644
--- a/mysql-test/suite/innodb_gis/r/repeatable_spatial.result
+++ b/mysql-test/suite/innodb_gis/r/repeatable_spatial.result
@@ -19,8 +19,8 @@ COUNT(*)
connect con1,localhost,root,,;
connection con1;
SET GLOBAL TRANSACTION ISOLATION LEVEL REPEATABLE READ;
-SELECT @@tx_isolation;
-@@tx_isolation
+SELECT @@transaction_isolation;
+@@transaction_isolation
REPEATABLE-READ
SELECT COUNT(*) FROM tab;
COUNT(*)
@@ -32,8 +32,8 @@ c1 ST_AsText(c2) ST_AsText(c3) ST_AsText(c4) ST_AsText(c5)
connect con2,localhost,root,,;
connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-SELECT @@tx_isolation;
-@@tx_isolation
+SELECT @@transaction_isolation;
+@@transaction_isolation
READ-COMMITTED
START TRANSACTION;
INSERT INTO tab(c1,c2,c3,c4,c5)
@@ -106,8 +106,8 @@ COUNT(*)
connect con1,localhost,root,,;
connection con1;
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
-SELECT @@tx_isolation;
-@@tx_isolation
+SELECT @@transaction_isolation;
+@@transaction_isolation
REPEATABLE-READ
SELECT COUNT(*) FROM tab;
COUNT(*)
@@ -119,8 +119,8 @@ c1 ST_AsText(c2) ST_AsText(c3) ST_AsText(c4) ST_AsText(c5)
connect con2,localhost,root,,;
connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-SELECT @@tx_isolation;
-@@tx_isolation
+SELECT @@transaction_isolation;
+@@transaction_isolation
READ-COMMITTED
START TRANSACTION;
INSERT INTO tab(c1,c2,c3,c4,c5)
diff --git a/mysql-test/suite/innodb_gis/r/rollback.result b/mysql-test/suite/innodb_gis/r/rollback.result
index 1efe5d28..1f10dc00 100644
--- a/mysql-test/suite/innodb_gis/r/rollback.result
+++ b/mysql-test/suite/innodb_gis/r/rollback.result
@@ -407,7 +407,7 @@ start transaction;
update t1 set a=point(5,5), b=point(5,5), c=5 where i < 3;
ERROR 23000: Duplicate entry '5' for key 'c'
rollback;
-set session debug="+d,row_mysql_crash_if_error";
+set session debug_dbug="+d,row_mysql_crash_if_error";
update t1 set a=point(5,5), b=point(5,5), c=5 where i < 3;
ERROR HY000: Lost connection to server during query
insert into t1 values(5, point(5,5), point(5,5), 5);
diff --git a/mysql-test/suite/innodb_gis/r/rtree.result b/mysql-test/suite/innodb_gis/r/rtree.result
index 2fd39f9c..9ddcb841 100644
--- a/mysql-test/suite/innodb_gis/r/rtree.result
+++ b/mysql-test/suite/innodb_gis/r/rtree.result
@@ -11,11 +11,11 @@ test.t1 analyze status OK
set @g1 = ST_GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0))');
explain select ST_astext(t1.g) from t1 where MBRWithin(t1.g, @g1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL g NULL NULL NULL 5 Using where
+1 SIMPLE t1 range g g 34 NULL 5 Using where
select ST_astext(t1.g) from t1 where MBRWithin(t1.g, @g1);
ST_astext(t1.g)
-POINT(1 1)
POINT(1.5 1.5)
+POINT(1 1)
set @g1 = ST_GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0))');
delete from t1 where MBRWithin(t1.g, @g1);
check table t1;
@@ -157,11 +157,11 @@ test.t1 analyze status OK
set @g1 = ST_GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0))');
explain select ST_astext(t1.g) from t1 where MBRWithin(t1.g, @g1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL g NULL NULL NULL 5 Using where
+1 SIMPLE t1 range g g 34 NULL 5 Using where
select ST_astext(t1.g) from t1 where MBRWithin(t1.g, @g1);
ST_astext(t1.g)
-POINT(1 1)
POINT(1.5 1.5)
+POINT(1 1)
set @g1 = ST_GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0))');
delete from t1 where MBRWithin(t1.g, @g1);
check table t1;
diff --git a/mysql-test/suite/innodb_gis/r/rtree_compress.result b/mysql-test/suite/innodb_gis/r/rtree_compress.result
index 9b646985..5f210ca1 100644
--- a/mysql-test/suite/innodb_gis/r/rtree_compress.result
+++ b/mysql-test/suite/innodb_gis/r/rtree_compress.result
@@ -43,7 +43,7 @@ select count(*) from t1 where MBRWithin(t1.c2, @g1);
count(*)
0
SET @saved_dbug = @@SESSION.debug_dbug;
-SET DEBUG='+d,page_copy_rec_list_start_compress_fail';
+SET DEBUG_DBUG='+d,page_copy_rec_list_start_compress_fail';
delete from t1;
select count(*) from t1 where MBRWithin(t1.c2, @g1);
count(*)
diff --git a/mysql-test/suite/innodb_gis/r/rtree_concurrent_srch.result b/mysql-test/suite/innodb_gis/r/rtree_concurrent_srch.result
index 81b82691..9d25d0e9 100644
--- a/mysql-test/suite/innodb_gis/r/rtree_concurrent_srch.result
+++ b/mysql-test/suite/innodb_gis/r/rtree_concurrent_srch.result
@@ -58,8 +58,8 @@ insert into t1 select * from t1;
insert into t1 select * from t1;
connection a;
set session transaction isolation level serializable;
-select @@tx_isolation;
-@@tx_isolation
+select @@transaction_isolation;
+@@transaction_isolation
SERIALIZABLE
start transaction;
set @g1 = ST_GeomFromText('Polygon((100 100, 100 110, 110 110, 110 100, 100 100))');
@@ -69,8 +69,8 @@ count(*)
connect b,localhost,root,,;
set session transaction isolation level serializable;
set session innodb_lock_wait_timeout = 1;
-select @@tx_isolation;
-@@tx_isolation
+select @@transaction_isolation;
+@@transaction_isolation
SERIALIZABLE
insert into t1 select * from t1;
insert into t1 select * from t1;
@@ -92,8 +92,8 @@ connection b;
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
1
-select @@tx_isolation;
-@@tx_isolation
+select @@transaction_isolation;
+@@transaction_isolation
SERIALIZABLE
insert into t1 select * from t1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
@@ -120,8 +120,8 @@ insert into t1 select * from t1;
insert into t1 select * from t1;
connection a;
set session transaction isolation level serializable;
-select @@tx_isolation;
-@@tx_isolation
+select @@transaction_isolation;
+@@transaction_isolation
SERIALIZABLE
start transaction;
set @g1 = ST_GeomFromText('Polygon((100 100, 100 110, 110 110, 110 100, 100 100))');
@@ -131,8 +131,8 @@ count(*)
connection b;
set session transaction isolation level serializable;
set session innodb_lock_wait_timeout = 1;
-select @@tx_isolation;
-@@tx_isolation
+select @@transaction_isolation;
+@@transaction_isolation
SERIALIZABLE
insert into t1 select * from t1;
insert into t1 select * from t1;
@@ -158,8 +158,8 @@ connection b;
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
1
-select @@tx_isolation;
-@@tx_isolation
+select @@transaction_isolation;
+@@transaction_isolation
SERIALIZABLE
INSERT INTO t1 VALUES (1, ST_GeomFromText('LineString(8 105, 200 105)'));
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
@@ -227,8 +227,8 @@ end|
CALL insert_t1(0, 1000);
connection a;
set session transaction isolation level serializable;
-select @@tx_isolation;
-@@tx_isolation
+select @@transaction_isolation;
+@@transaction_isolation
SERIALIZABLE
start transaction;
set @g1 = ST_GeomFromText('Polygon((800 800, 800 1000, 1000 1000, 1000 800, 800 800))');
diff --git a/mysql-test/suite/innodb_gis/r/rtree_create_inplace.result b/mysql-test/suite/innodb_gis/r/rtree_create_inplace.result
index 2016ce1b..9e0a3271 100644
--- a/mysql-test/suite/innodb_gis/r/rtree_create_inplace.result
+++ b/mysql-test/suite/innodb_gis/r/rtree_create_inplace.result
@@ -25,7 +25,7 @@ SELECT COUNT(*) FROM t1 WHERE MBRWithin(t1.c2, @g1);
COUNT(*)
0
ALTER TABLE t1 DROP INDEX idx, ADD SPATIAL INDEX idx3(c2);
-SET debug_dbug='+d,row_merge_instrument_log_check_flush';
+SET SESSION debug_dbug="+d,row_merge_instrument_log_check_flush";
ALTER TABLE t1 DROP INDEX idx3, ADD SPATIAL INDEX idx4(c2), ADD SPATIAL INDEX idx5(c3);
ALTER TABLE t1 FORCE;
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb_gis/r/rtree_multi_pk.result b/mysql-test/suite/innodb_gis/r/rtree_multi_pk.result
index 3e6464df..bab710a5 100644
--- a/mysql-test/suite/innodb_gis/r/rtree_multi_pk.result
+++ b/mysql-test/suite/innodb_gis/r/rtree_multi_pk.result
@@ -11,11 +11,11 @@ test.t1 analyze status OK
set @g1 = ST_GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0))');
explain select ST_astext(t1.g) from t1 where MBRWithin(t1.g, @g1);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL g NULL NULL NULL 5 Using where
+1 SIMPLE t1 range g g 34 NULL 5 Using where
select ST_astext(t1.g) from t1 where MBRWithin(t1.g, @g1);
ST_astext(t1.g)
-POINT(1 1)
POINT(1.5 1.5)
+POINT(1 1)
set @g1 = ST_GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0))');
delete from t1 where MBRWithin(t1.g, @g1);
check table t1;
@@ -63,10 +63,10 @@ name ST_AsText(square)
small POLYGON((0 0,0 1,1 1,1 0,0 0))
SELECT name, ST_AsText(square) from t1 where MBRDisjoint(@p, square);
name ST_AsText(square)
-up3 POLYGON((0 3,0 5,2 5,2 3,0 3))
down3 POLYGON((0 -3,0 -1,2 -1,2 -3,0 -3))
-right3 POLYGON((3 0,3 2,5 2,5 0,3 0))
left3 POLYGON((-3 0,-3 2,-1 2,-1 0,-3 0))
+right3 POLYGON((3 0,3 2,5 2,5 0,3 0))
+up3 POLYGON((0 3,0 5,2 5,2 3,0 3))
SELECT name, ST_AsText(square) from t1 where MBREquals(@p, square);
name ST_AsText(square)
SELECT name, ST_AsText(square) from t1 where MBRIntersects(@p, square);
diff --git a/mysql-test/suite/innodb_gis/r/rtree_optimize.result b/mysql-test/suite/innodb_gis/r/rtree_optimize.result
new file mode 100644
index 00000000..4abdb5f2
--- /dev/null
+++ b/mysql-test/suite/innodb_gis/r/rtree_optimize.result
@@ -0,0 +1,44 @@
+CREATE TABLE t (
+id INT AUTO_INCREMENT,
+c BINARY(226) DEFAULT '',
+s POINT NOT NULL,
+PRIMARY KEY(id,c)
+) ENGINE=InnoDB;
+INSERT INTO t (s) VALUES
+(POINTFromText('POINT(0.78 0.72)')),(POINTFromText('POINT(0.44 0.21)')),
+(POINTFromText('POINT(0.93 0.56)')),(POINTFromText('POINT(0.57 0.21)')),
+(POINTFromText('POINT(0.12 0.65)')),(POINTFromText('POINT(0.20 0.96)')),
+(POINTFromText('POINT(0.99 0.71)')),(POINTFromText('POINT(0.27 0.23)')),
+(POINTFromText('POINT(0.68 0.14)')),(POINTFromText('POINT(0.20 0.05)')),
+(POINTFromText('POINT(0.47 0.57)')),(POINTFromText('POINT(0.89 0.79)')),
+(POINTFromText('POINT(0.09 0.57)')),(POINTFromText('POINT(0.58 0.52)')),
+(POINTFromText('POINT(0.73 0.32)')),(POINTFromText('POINT(0.87 0.35)')),
+(POINTFromText('POINT(0.60 0.12)')),(POINTFromText('POINT(0.14 0.17)')),
+(POINTFromText('POINT(0.76 0.29)')),(POINTFromText('POINT(0.60 0.35)')),
+(POINTFromText('POINT(0.48 0.69)')),(POINTFromText('POINT(0.79 0.45)')),
+(POINTFromText('POINT(0.85 0.11)')),(POINTFromText('POINT(0.59 0.99)')),
+(POINTFromText('POINT(0.95 0.18)')),(POINTFromText('POINT(0.78 0.49)')),
+(POINTFromText('POINT(0.11 0.22)')),(POINTFromText('POINT(0.26 0.85)')),
+(POINTFromText('POINT(0.28 0.10)')),(POINTFromText('POINT(0.45 0.25)')),
+(POINTFromText('POINT(0.70 0.40)')),(POINTFromText('POINT(0.65 0.86)')),
+(POINTFromText('POINT(0.69 0.98)')),(POINTFromText('POINT(0.56 0.11)')),
+(POINTFromText('POINT(0.94 0.59)')),(POINTFromText('POINT(0.19 0.94)')),
+(POINTFromText('POINT(0.82 0.85)')),(POINTFromText('POINT(0.74 0.07)')),
+(POINTFromText('POINT(0.33 0.48)')),(POINTFromText('POINT(0.37 0.37)')),
+(POINTFromText('POINT(0.40 0.08)')),(POINTFromText('POINT(0.45 0.74)')),
+(POINTFromText('POINT(0.57 0.07)')),(POINTFromText('POINT(0.36 0.11)')),
+(POINTFromText('POINT(0.94 0.60)')),(POINTFromText('POINT(0.75 0.76)')),
+(POINTFromText('POINT(0.92 0.56)')),(POINTFromText('POINT(0.88 0.52)')),
+(POINTFromText('POINT(0.49 0.24)')),(POINTFromText('POINT(0.96 0.08)')),
+(POINTFromText('POINT(0.93 0.99)')),(POINTFromText('POINT(0.88 0.31)')),
+(POINTFromText('POINT(0.93 0.78)')),(POINTFromText('POINT(0.62 0.50)')),
+(POINTFromText('POINT(0.54 0.53)')),(POINTFromText('POINT(0.66 0.83)')),
+(POINTFromText('POINT(0.21 0.87)')),(POINTFromText('POINT(0.42 0.28)')),
+(POINTFromText('POINT(0.80 0.84)')),(POINTFromText('POINT(0.39 0.68)')),
+(POINTFromText('POINT(0.05 0.24)')),(POINTFromText('POINT(0.05 0.58)'));
+ALTER TABLE t ADD SPATIAL INDEX(s);
+OPTIMIZE TABLE t;
+Table Op Msg_type Msg_text
+test.t optimize note Table does not support optimize, doing recreate + analyze instead
+test.t optimize status OK
+DROP TABLE t;
diff --git a/mysql-test/suite/innodb_gis/t/alter_spatial_index.test b/mysql-test/suite/innodb_gis/t/alter_spatial_index.test
index 6f30b38b..50364b97 100644
--- a/mysql-test/suite/innodb_gis/t/alter_spatial_index.test
+++ b/mysql-test/suite/innodb_gis/t/alter_spatial_index.test
@@ -747,18 +747,6 @@ alter table t1 add b geometry not null default st_geomfromtext('POINT(0 0)'),
add spatial index(b), algorithm=copy;
DROP table t1;
---echo #
---echo # BUG#20111575 ALTER TABLE...ADD SPATIAL INDEX...LOCK NONE IS REFUSED
---echo # WITHOUT STATING A REASON
---echo #
-CREATE TABLE t1(p point NOT NULL) ENGINE=innodb;
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-ALTER TABLE t1 ADD SPATIAL INDEX(p), LOCK=NONE;
-ALTER TABLE t1 ADD SPATIAL INDEX(p);
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-ALTER TABLE t1 FORCE, LOCK=NONE;
-DROP TABLE t1;
-
create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),LineString(Point(0,0),Point(1,1)))) ENGINE=innodb;
set timestamp=10;
--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
diff --git a/mysql-test/suite/innodb_gis/t/check_rtree.test b/mysql-test/suite/innodb_gis/t/check_rtree.test
index 09bba50d..a52c6d0b 100644
--- a/mysql-test/suite/innodb_gis/t/check_rtree.test
+++ b/mysql-test/suite/innodb_gis/t/check_rtree.test
@@ -9,7 +9,7 @@
create table t1 (i int, g geometry not null, spatial index (g))engine=innodb;
# Turn on the geometry data print.
-SET SESSION debug="+d,rtree_test_check_count";
+SET SESSION debug_dbug="+d,rtree_test_check_count";
# Insert values.
insert into t1 values (1, POINT(1,1));
diff --git a/mysql-test/suite/innodb_gis/t/create_spatial_index.test b/mysql-test/suite/innodb_gis/t/create_spatial_index.test
index 5278292b..178041d0 100644
--- a/mysql-test/suite/innodb_gis/t/create_spatial_index.test
+++ b/mysql-test/suite/innodb_gis/t/create_spatial_index.test
@@ -94,9 +94,11 @@ ANALYZE TABLE tab;
# Check the spatial relationship between 2 GIS shapes
-# Test the MBRContains
+--echo # Test the MBRContains
SET @g1 = ST_GeomFromText( 'POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))');
+# Show plan if we cannot use index order
+EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1+0;
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
@@ -117,7 +119,7 @@ WHERE MBRContains(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRContains(tab.c4, @g1);
-# Test the MBRWithin
+--echo # Test the MBRWithin
SET @g1 = ST_GeomFromText( 'POLYGON((30 30,40 40,50 50,30 50,30 40,30 30)) ');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRWithin(tab.c4, @g1) ORDER BY c1;
@@ -129,7 +131,7 @@ WHERE MBRWithin(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRWithin(tab.c4, @g1);
-# Test the ST_Crosses
+--echo # Test the ST_Crosses
SET @g1 = ST_GeomFromText('POLYGON((100 200,200 300,400 500,500 300,300 200,100 300,100 200))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE ST_Crosses(tab.c4, @g1) ORDER BY c1;
@@ -152,7 +154,7 @@ WHERE ST_Crosses(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE ST_Crosses(tab.c4, @g1);
-# Test the MBRDisjoint
+--echo # Test the MBRDisjoint
SET @g1 = ST_GeomFromText('POLYGON((4 -2,5 -4,6 -5,7 -4,7 2,4 -2))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRDisjoint(tab.c4, @g1) ORDER BY c1;
@@ -164,7 +166,7 @@ WHERE MBRDisjoint(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRDisjoint(tab.c4, @g1);
-# Test the MBREquals
+--echo # Test the MBREquals
SET @g1 = ST_GeomFromText('POLYGON((5010 5010,5020 5020,5030 5030,5040 5030,5020 5010,5010 5010))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBREquals(tab.c4, @g1) ORDER BY c1;
@@ -176,7 +178,6 @@ WHERE MBREquals(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBREquals(tab.c4, @g1);
-# Test the MBRintersects
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
@@ -199,7 +200,7 @@ WHERE MBRintersects(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRintersects(tab.c4, @g1);
-# Test the Overelaps
+--echo # Test the Overelaps
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 2,4 5,5 5,7 1,0 0 ))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBROverlaps(tab.c4, @g1) ORDER BY c1;
@@ -222,7 +223,7 @@ WHERE MBROverlaps(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBROverlaps(tab.c4, @g1);
-# Test the ST_Touches
+--echo # Test the ST_Touches
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE ST_Touches(tab.c4, @g1) ORDER BY c1;
@@ -245,7 +246,7 @@ WHERE ST_Touches(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE ST_Touches(tab.c4, @g1);
-# Test the MBRContains
+--echo # Test the MBRContains
SET @g1 = ST_GeomFromText( 'POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
@@ -268,7 +269,7 @@ WHERE MBRWithin(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRWithin(tab.c4, @g1);
-# Test the MBRDisjoint
+--echo # Test the MBRDisjoint
SET @g1 = ST_GeomFromText('POLYGON((4 -2,5 -4,6 -5,7 -4,7 2,4 -2))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRDisjoint(tab.c4, @g1) ORDER BY c1;
@@ -280,7 +281,7 @@ WHERE MBRDisjoint(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRDisjoint(tab.c4, @g1);
-# Test the MBREquals
+--echo # Test the MBREquals
SET @g1 = ST_GeomFromText('POLYGON((5010 5010,5020 5020,5030 5030,5040 5030,5020 5010,5010 5010))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBREquals(tab.c4, @g1) ORDER BY c1;
@@ -292,7 +293,7 @@ WHERE MBREquals(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBREquals(tab.c4, @g1);
-# Test the MBRintersects
+--echo # Test the MBRintersects
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
@@ -315,7 +316,7 @@ WHERE MBRintersects(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRintersects(tab.c4, @g1);
-# Test the MBROverelaps
+--echo # Test the MBROverelaps
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 2,4 5,5 5,7 1,0 0 ))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBROverlaps(tab.c4, @g1) ORDER BY c1;
@@ -327,7 +328,7 @@ WHERE MBROverlaps(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBROverlaps(tab.c4, @g1);
-# Test the MBRTouches
+--echo # Test the MBRTouches
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRTouches(tab.c4, @g1) ORDER BY c1;
@@ -339,7 +340,7 @@ WHERE MBRTouches(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRTouches(tab.c4, @g1);
-# Test with Procedure
+--echo # Test with Procedure
delimiter |;
CREATE PROCEDURE proc_wl6968()
@@ -357,7 +358,7 @@ delimiter ;|
CALL proc_wl6968();
-# Test the Delete & Update
+--echo # Test the Delete & Update
SET @g1 = ST_GeomFromText( 'POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))');
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
@@ -478,7 +479,7 @@ ANALYZE TABLE tab;
# Check the spatial relationship between 2 GIS shapes
-# Test the MBRContains
+--echo # Test the MBRContains
SET @g1 = ST_GeomFromText( 'POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
@@ -501,7 +502,7 @@ WHERE MBRContains(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRContains(tab.c4, @g1);
-# Test the MBRWithin
+--echo # Test the MBRWithin
SET @g1 = ST_GeomFromText( 'POLYGON((30 30,40 40,50 50,30 50,30 40,30 30)) ');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRWithin(tab.c4, @g1) ORDER BY c1;
@@ -513,7 +514,7 @@ WHERE MBRWithin(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRWithin(tab.c4, @g1);
-# Test the ST_Crosses
+--echo # Test the ST_Crosses
SET @g1 = ST_GeomFromText('POLYGON((100 200,200 300,400 500,500 300,300 200,100 300,100 200))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE ST_Crosses(tab.c4, @g1) ORDER BY c1;
@@ -536,7 +537,7 @@ WHERE ST_Crosses(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE ST_Crosses(tab.c4, @g1);
-# Test the MBRDisjoint
+--echo # Test the MBRDisjoint
SET @g1 = ST_GeomFromText('POLYGON((4 -2,5 -4,6 -5,7 -4,7 2,4 -2))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRDisjoint(tab.c4, @g1) ORDER BY c1;
@@ -548,7 +549,7 @@ WHERE MBRDisjoint(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRDisjoint(tab.c4, @g1);
-# Test the MBREquals
+--echo # Test the MBREquals
SET @g1 = ST_GeomFromText('POLYGON((5010 5010,5020 5020,5030 5030,5040 5030,5020 5010,5010 5010))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBREquals(tab.c4, @g1) ORDER BY c1;
@@ -560,7 +561,7 @@ WHERE MBREquals(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBREquals(tab.c4, @g1);
-# Test the MBRintersects
+--echo # Test the MBRintersects
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
@@ -583,7 +584,7 @@ WHERE MBRintersects(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRintersects(tab.c4, @g1);
-# Test the Overelaps
+--echo # Test the Overelaps
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 2,4 5,5 5,7 1,0 0 ))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBROverlaps(tab.c4, @g1) ORDER BY c1;
@@ -606,7 +607,7 @@ WHERE MBROverlaps(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBROverlaps(tab.c4, @g1);
-# Test the ST_Touches
+--echo # Test the ST_Touches
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE ST_Touches(tab.c4, @g1) ORDER BY c1;
@@ -629,7 +630,7 @@ WHERE ST_Touches(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE ST_Touches(tab.c4, @g1);
-# Test the MBRContains
+--echo # Test the MBRContains
SET @g1 = ST_GeomFromText( 'POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
@@ -652,7 +653,7 @@ WHERE MBRWithin(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRWithin(tab.c4, @g1);
-# Test the MBRDisjoint
+--echo # Test the MBRDisjoint
SET @g1 = ST_GeomFromText('POLYGON((4 -2,5 -4,6 -5,7 -4,7 2,4 -2))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRDisjoint(tab.c4, @g1) ORDER BY c1;
@@ -664,7 +665,7 @@ WHERE MBRDisjoint(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRDisjoint(tab.c4, @g1);
-# Test the MBREquals
+--echo # Test the MBREquals
SET @g1 = ST_GeomFromText('POLYGON((5010 5010,5020 5020,5030 5030,5040 5030,5020 5010,5010 5010))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBREquals(tab.c4, @g1) ORDER BY c1;
@@ -676,7 +677,7 @@ WHERE MBREquals(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBREquals(tab.c4, @g1);
-# Test the MBRintersects
+--echo # Test the MBRintersects
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
@@ -699,7 +700,7 @@ WHERE MBRintersects(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRintersects(tab.c4, @g1);
-# Test the MBROverelaps
+--echo # Test the MBROverelaps
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 2,4 5,5 5,7 1,0 0 ))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBROverlaps(tab.c4, @g1) ORDER BY c1;
@@ -711,7 +712,7 @@ WHERE MBROverlaps(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBROverlaps(tab.c4, @g1);
-# Test the MBRTouches
+--echo # Test the MBRTouches
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRTouches(tab.c4, @g1) ORDER BY c1;
@@ -723,7 +724,7 @@ WHERE MBRTouches(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRTouches(tab.c4, @g1);
-# Test with Procedure
+--echo # Test with Procedure
delimiter |;
CREATE PROCEDURE proc_wl6968()
@@ -741,7 +742,7 @@ delimiter ;|
CALL proc_wl6968();
-# Test the Delete & Update
+--echo # Test the Delete & Update
SET @g1 = ST_GeomFromText( 'POLYGON((30 30,40 40,50 50,30 50,30 40,30 30)) ');
SELECT c1,ST_Astext(c4) FROM tab WHERE MBRWithin(tab.c4, @g1) ORDER BY c1;
@@ -850,7 +851,7 @@ ANALYZE TABLE tab;
# Check the spatial relationship between 2 GIS shapes
-# Test the MBRContains
+--echo # Test the MBRContains
SET @g1 = ST_GeomFromText( 'POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
@@ -873,7 +874,7 @@ WHERE MBRContains(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRContains(tab.c4, @g1);
-# Test the MBRWithin
+--echo # Test the MBRWithin
SET @g1 = ST_GeomFromText( 'POLYGON((30 30,40 40,50 50,30 50,30 40,30 30)) ');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRWithin(tab.c4, @g1) ORDER BY c1;
@@ -885,7 +886,7 @@ WHERE MBRWithin(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRWithin(tab.c4, @g1);
-# Test the ST_Crosses
+--echo # Test the ST_Crosses
SET @g1 = ST_GeomFromText('POLYGON((100 200,200 300,400 500,500 300,300 200,100 300,100 200))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE ST_Crosses(tab.c4, @g1) ORDER BY c1;
@@ -908,7 +909,7 @@ WHERE ST_Crosses(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE ST_Crosses(tab.c4, @g1);
-# Test the MBRDisjoint
+--echo # Test the MBRDisjoint
SET @g1 = ST_GeomFromText('POLYGON((4 -2,5 -4,6 -5,7 -4,7 2,4 -2))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRDisjoint(tab.c4, @g1) ORDER BY c1;
@@ -920,7 +921,7 @@ WHERE MBRDisjoint(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRDisjoint(tab.c4, @g1);
-# Test the MBREquals
+--echo # Test the MBREquals
SET @g1 = ST_GeomFromText('POLYGON((5010 5010,5020 5020,5030 5030,5040 5030,5020 5010,5010 5010))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBREquals(tab.c4, @g1) ORDER BY c1;
@@ -932,7 +933,7 @@ WHERE MBREquals(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBREquals(tab.c4, @g1);
-# Test the MBRintersects
+--echo # Test the MBRintersects
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
@@ -955,7 +956,7 @@ WHERE MBRintersects(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRintersects(tab.c4, @g1);
-# Test the Overelaps
+--echo # Test the Overelaps
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 2,4 5,5 5,7 1,0 0 ))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBROverlaps(tab.c4, @g1) ORDER BY c1;
@@ -978,7 +979,7 @@ WHERE MBROverlaps(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBROverlaps(tab.c4, @g1);
-# Test the ST_Touches
+--echo # Test the ST_Touches
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE ST_Touches(tab.c4, @g1) ORDER BY c1;
@@ -1001,7 +1002,7 @@ WHERE ST_Touches(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE ST_Touches(tab.c4, @g1);
-# Test the MBRContains
+--echo # Test the MBRContains
SET @g1 = ST_GeomFromText( 'POLYGON((7 1,6 2,6 3,10 3,10 1,7 1))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRContains(tab.c4, @g1) ORDER BY c1;
@@ -1024,7 +1025,7 @@ WHERE MBRWithin(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRWithin(tab.c4, @g1);
-# Test the MBRDisjoint
+--echo # Test the MBRDisjoint
SET @g1 = ST_GeomFromText('POLYGON((4 -2,5 -4,6 -5,7 -4,7 2,4 -2))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRDisjoint(tab.c4, @g1) ORDER BY c1;
@@ -1036,7 +1037,7 @@ WHERE MBRDisjoint(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRDisjoint(tab.c4, @g1);
-# Test the MBREquals
+--echo # Test the MBREquals
SET @g1 = ST_GeomFromText('POLYGON((5010 5010,5020 5020,5030 5030,5040 5030,5020 5010,5010 5010))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBREquals(tab.c4, @g1) ORDER BY c1;
@@ -1048,7 +1049,7 @@ WHERE MBREquals(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBREquals(tab.c4, @g1);
-# Test the MBRintersects
+--echo # Test the MBRintersects
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRIntersects(tab.c4, @g1) ORDER BY c1;
@@ -1071,7 +1072,7 @@ WHERE MBRintersects(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRintersects(tab.c4, @g1);
-# Test the MBROverelaps
+--echo # Test the MBROverelaps
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 2,4 5,5 5,7 1,0 0 ))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBROverlaps(tab.c4, @g1) ORDER BY c1;
@@ -1083,7 +1084,7 @@ WHERE MBROverlaps(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBROverlaps(tab.c4, @g1);
-# Test the MBRTouches
+--echo # Test the MBRTouches
SET @g1 = ST_GeomFromText( 'POLYGON((0 0,0 30,30 40,40 50,50 30,0 0))');
EXPLAIN SELECT c1,ST_Astext(c4) FROM tab WHERE MBRTouches(tab.c4, @g1) ORDER BY c1;
@@ -1095,7 +1096,7 @@ WHERE MBRTouches(tab.c4, @g1);
EXPLAIN DELETE FROM tab WHERE MBRTouches(tab.c4, @g1);
-# Test the Delete & Update
+--echo # Test the Delete & Update
SET @g1 = ST_GeomFromText('POLYGON((5010 5010,5020 5020,5030 5030,5040 5030,5020 5010,5010 5010))');
SELECT c1,ST_Astext(c4) FROM tab WHERE MBREquals(tab.c4, @g1) ORDER BY c1;
@@ -1124,7 +1125,7 @@ DROP TABLE tab;
# End of Testcase compress table with Auto_increment
-# Test check constraint on spatial column
+--echo # Test check constraint on spatial column
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
CREATE TABLE tab(c1 POINT NOT NULL,CONSTRAINT tab_const check(c1 > 0) ) ENGINE=InnoDB;
CREATE TABLE tab(c1 POINT NOT NULL,CONSTRAINT tab_const check(CAST(c1 AS BINARY) > 0) ) ENGINE=InnoDB;
diff --git a/mysql-test/suite/innodb_gis/t/geometry.test b/mysql-test/suite/innodb_gis/t/geometry.test
index 4e8f0f72..fe19deb3 100644
--- a/mysql-test/suite/innodb_gis/t/geometry.test
+++ b/mysql-test/suite/innodb_gis/t/geometry.test
@@ -648,7 +648,7 @@ CREATE TABLE child (id GEOMETRY, parent_id GEOMETRY,
) ENGINE=INNODB;
--echo #check partition table support
---error 1178
+--error ER_BLOB_FIELD_IN_PART_FUNC_ERROR
CREATE TABLE emp2(
id GEOMETRY NOT NULL,
store_name VARCHAR(30),
diff --git a/mysql-test/suite/innodb_gis/t/repeatable_spatial.test b/mysql-test/suite/innodb_gis/t/repeatable_spatial.test
index 3152911b..16372dc1 100644
--- a/mysql-test/suite/innodb_gis/t/repeatable_spatial.test
+++ b/mysql-test/suite/innodb_gis/t/repeatable_spatial.test
@@ -40,7 +40,7 @@ connection con1;
SET GLOBAL TRANSACTION ISOLATION LEVEL REPEATABLE READ;
-SELECT @@tx_isolation;
+SELECT @@transaction_isolation;
# Record count should be 1
SELECT COUNT(*) FROM tab;
@@ -54,7 +54,7 @@ connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-SELECT @@tx_isolation;
+SELECT @@transaction_isolation;
START TRANSACTION;
@@ -155,7 +155,7 @@ connection con1;
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
-SELECT @@tx_isolation;
+SELECT @@transaction_isolation;
# Record count should be 1
SELECT COUNT(*) FROM tab;
@@ -169,7 +169,7 @@ connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-SELECT @@tx_isolation;
+SELECT @@transaction_isolation;
START TRANSACTION;
diff --git a/mysql-test/suite/innodb_gis/t/rollback.test b/mysql-test/suite/innodb_gis/t/rollback.test
index a0998669..8483b356 100644
--- a/mysql-test/suite/innodb_gis/t/rollback.test
+++ b/mysql-test/suite/innodb_gis/t/rollback.test
@@ -463,8 +463,8 @@ rollback;
# Test partial update rollback after recovered.
# Crash the server in partial update.
---write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
-set session debug="+d,row_mysql_crash_if_error";
+--write_line restart $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+set session debug_dbug="+d,row_mysql_crash_if_error";
--error 2013
update t1 set a=point(5,5), b=point(5,5), c=5 where i < 3;
diff --git a/mysql-test/suite/innodb_gis/t/rtree_compress.test b/mysql-test/suite/innodb_gis/t/rtree_compress.test
index 56690b88..cd6cf903 100644
--- a/mysql-test/suite/innodb_gis/t/rtree_compress.test
+++ b/mysql-test/suite/innodb_gis/t/rtree_compress.test
@@ -53,7 +53,7 @@ set @g1 = ST_GeomFromText('Polygon((10 10,10 800,800 800,800 10,10 10))');
select count(*) from t1 where MBRWithin(t1.c2, @g1);
SET @saved_dbug = @@SESSION.debug_dbug;
-SET DEBUG='+d,page_copy_rec_list_start_compress_fail';
+SET DEBUG_DBUG='+d,page_copy_rec_list_start_compress_fail';
delete from t1;
select count(*) from t1 where MBRWithin(t1.c2, @g1);
SET debug_dbug = @saved_dbug;
diff --git a/mysql-test/suite/innodb_gis/t/rtree_concurrent_srch.test b/mysql-test/suite/innodb_gis/t/rtree_concurrent_srch.test
index c4a6448f..017c650f 100644
--- a/mysql-test/suite/innodb_gis/t/rtree_concurrent_srch.test
+++ b/mysql-test/suite/innodb_gis/t/rtree_concurrent_srch.test
@@ -79,7 +79,7 @@ insert into t1 select * from t1;
# Connection 'a' will place predicate lock on almost all pages
connection a;
set session transaction isolation level serializable;
-select @@tx_isolation;
+select @@transaction_isolation;
start transaction;
set @g1 = ST_GeomFromText('Polygon((100 100, 100 110, 110 110, 110 100, 100 100))');
select count(*) from t1 where MBRwithin(t1.c2, @g1);
@@ -89,7 +89,7 @@ connect (b,localhost,root,,);
set session transaction isolation level serializable;
set session innodb_lock_wait_timeout = 1;
-select @@tx_isolation;
+select @@transaction_isolation;
insert into t1 select * from t1;
insert into t1 select * from t1;
@@ -115,7 +115,7 @@ select count(*) from t1 where MBRwithin(t1.c2, @g1);
connection b;
select @@innodb_lock_wait_timeout;
-select @@tx_isolation;
+select @@transaction_isolation;
--error ER_LOCK_WAIT_TIMEOUT
insert into t1 select * from t1;
@@ -146,7 +146,7 @@ insert into t1 select * from t1;
# Connection 'a' will place predicate lock on almost all pages
connection a;
set session transaction isolation level serializable;
-select @@tx_isolation;
+select @@transaction_isolation;
start transaction;
set @g1 = ST_GeomFromText('Polygon((100 100, 100 110, 110 110, 110 100, 100 100))');
select count(*) from t1 where MBRwithin(t1.c2, @g1);
@@ -156,7 +156,7 @@ connection b;
set session transaction isolation level serializable;
set session innodb_lock_wait_timeout = 1;
-select @@tx_isolation;
+select @@transaction_isolation;
insert into t1 select * from t1;
insert into t1 select * from t1;
@@ -181,7 +181,7 @@ select count(*) from t1 where MBRIntersects(t1.c2, @g1);
connection b;
select @@innodb_lock_wait_timeout;
-select @@tx_isolation;
+select @@transaction_isolation;
# this should conflict with the "MBRIntersects" predicate lock in session "a"
--error ER_LOCK_WAIT_TIMEOUT
@@ -264,7 +264,7 @@ CALL insert_t1(0, 1000);
# Connection 'a' will place predicate lock on root and last leaf page
connection a;
set session transaction isolation level serializable;
-select @@tx_isolation;
+select @@transaction_isolation;
start transaction;
set @g1 = ST_GeomFromText('Polygon((800 800, 800 1000, 1000 1000, 1000 800, 800 800))');
select count(*) from t1 where MBRwithin(t1.c2, @g1);
diff --git a/mysql-test/suite/innodb_gis/t/rtree_create_inplace.test b/mysql-test/suite/innodb_gis/t/rtree_create_inplace.test
index 73469368..2626c576 100644
--- a/mysql-test/suite/innodb_gis/t/rtree_create_inplace.test
+++ b/mysql-test/suite/innodb_gis/t/rtree_create_inplace.test
@@ -37,7 +37,7 @@ SELECT COUNT(*) FROM t1 WHERE MBRWithin(t1.c2, @g1);
ALTER TABLE t1 DROP INDEX idx, ADD SPATIAL INDEX idx3(c2);
-SET debug_dbug='+d,row_merge_instrument_log_check_flush';
+SET SESSION debug_dbug="+d,row_merge_instrument_log_check_flush";
ALTER TABLE t1 DROP INDEX idx3, ADD SPATIAL INDEX idx4(c2), ADD SPATIAL INDEX idx5(c3);
ALTER TABLE t1 FORCE;
diff --git a/mysql-test/suite/innodb_gis/t/rtree_multi_pk.test b/mysql-test/suite/innodb_gis/t/rtree_multi_pk.test
index f606e569..567e1694 100644
--- a/mysql-test/suite/innodb_gis/t/rtree_multi_pk.test
+++ b/mysql-test/suite/innodb_gis/t/rtree_multi_pk.test
@@ -66,6 +66,7 @@ INSERT INTO t1 VALUES("left3", ST_GeomFromText('POLYGON (( -3 0, -3 2, -1 2, -1
SET @p = ST_GeomFromText('POLYGON (( 0 0, 0 2, 2 2, 2 0, 0 0))');
SELECT name, ST_AsText(square) from t1 where MBRContains(@p, square);
+--sorted_result
SELECT name, ST_AsText(square) from t1 where MBRDisjoint(@p, square);
SELECT name, ST_AsText(square) from t1 where MBREquals(@p, square);
SELECT name, ST_AsText(square) from t1 where MBRIntersects(@p, square);
diff --git a/mysql-test/suite/innodb_gis/t/rtree_optimize.test b/mysql-test/suite/innodb_gis/t/rtree_optimize.test
new file mode 100644
index 00000000..c3de282d
--- /dev/null
+++ b/mysql-test/suite/innodb_gis/t/rtree_optimize.test
@@ -0,0 +1,44 @@
+--source include/have_innodb.inc
+
+CREATE TABLE t (
+ id INT AUTO_INCREMENT,
+ c BINARY(226) DEFAULT '',
+ s POINT NOT NULL,
+ PRIMARY KEY(id,c)
+) ENGINE=InnoDB;
+INSERT INTO t (s) VALUES
+ (POINTFromText('POINT(0.78 0.72)')),(POINTFromText('POINT(0.44 0.21)')),
+ (POINTFromText('POINT(0.93 0.56)')),(POINTFromText('POINT(0.57 0.21)')),
+ (POINTFromText('POINT(0.12 0.65)')),(POINTFromText('POINT(0.20 0.96)')),
+ (POINTFromText('POINT(0.99 0.71)')),(POINTFromText('POINT(0.27 0.23)')),
+ (POINTFromText('POINT(0.68 0.14)')),(POINTFromText('POINT(0.20 0.05)')),
+ (POINTFromText('POINT(0.47 0.57)')),(POINTFromText('POINT(0.89 0.79)')),
+ (POINTFromText('POINT(0.09 0.57)')),(POINTFromText('POINT(0.58 0.52)')),
+ (POINTFromText('POINT(0.73 0.32)')),(POINTFromText('POINT(0.87 0.35)')),
+ (POINTFromText('POINT(0.60 0.12)')),(POINTFromText('POINT(0.14 0.17)')),
+ (POINTFromText('POINT(0.76 0.29)')),(POINTFromText('POINT(0.60 0.35)')),
+ (POINTFromText('POINT(0.48 0.69)')),(POINTFromText('POINT(0.79 0.45)')),
+ (POINTFromText('POINT(0.85 0.11)')),(POINTFromText('POINT(0.59 0.99)')),
+ (POINTFromText('POINT(0.95 0.18)')),(POINTFromText('POINT(0.78 0.49)')),
+ (POINTFromText('POINT(0.11 0.22)')),(POINTFromText('POINT(0.26 0.85)')),
+ (POINTFromText('POINT(0.28 0.10)')),(POINTFromText('POINT(0.45 0.25)')),
+ (POINTFromText('POINT(0.70 0.40)')),(POINTFromText('POINT(0.65 0.86)')),
+ (POINTFromText('POINT(0.69 0.98)')),(POINTFromText('POINT(0.56 0.11)')),
+ (POINTFromText('POINT(0.94 0.59)')),(POINTFromText('POINT(0.19 0.94)')),
+ (POINTFromText('POINT(0.82 0.85)')),(POINTFromText('POINT(0.74 0.07)')),
+ (POINTFromText('POINT(0.33 0.48)')),(POINTFromText('POINT(0.37 0.37)')),
+ (POINTFromText('POINT(0.40 0.08)')),(POINTFromText('POINT(0.45 0.74)')),
+ (POINTFromText('POINT(0.57 0.07)')),(POINTFromText('POINT(0.36 0.11)')),
+ (POINTFromText('POINT(0.94 0.60)')),(POINTFromText('POINT(0.75 0.76)')),
+ (POINTFromText('POINT(0.92 0.56)')),(POINTFromText('POINT(0.88 0.52)')),
+ (POINTFromText('POINT(0.49 0.24)')),(POINTFromText('POINT(0.96 0.08)')),
+ (POINTFromText('POINT(0.93 0.99)')),(POINTFromText('POINT(0.88 0.31)')),
+ (POINTFromText('POINT(0.93 0.78)')),(POINTFromText('POINT(0.62 0.50)')),
+ (POINTFromText('POINT(0.54 0.53)')),(POINTFromText('POINT(0.66 0.83)')),
+ (POINTFromText('POINT(0.21 0.87)')),(POINTFromText('POINT(0.42 0.28)')),
+ (POINTFromText('POINT(0.80 0.84)')),(POINTFromText('POINT(0.39 0.68)')),
+ (POINTFromText('POINT(0.05 0.24)')),(POINTFromText('POINT(0.05 0.58)'));
+ALTER TABLE t ADD SPATIAL INDEX(s);
+OPTIMIZE TABLE t;
+# Cleanup
+DROP TABLE t;
diff --git a/mysql-test/suite/innodb_zip/r/bug36169.result b/mysql-test/suite/innodb_zip/r/bug36169.result
index 7e165e0f..c7e234b5 100644
--- a/mysql-test/suite/innodb_zip/r/bug36169.result
+++ b/mysql-test/suite/innodb_zip/r/bug36169.result
@@ -1 +1 @@
-SET GLOBAL innodb_file_per_table=ON;
+DROP TABLE IF EXISTS table6;
diff --git a/mysql-test/suite/innodb_zip/r/bug53591.result b/mysql-test/suite/innodb_zip/r/bug53591.result
index 779064d0..0c6386df 100644
--- a/mysql-test/suite/innodb_zip/r/bug53591.result
+++ b/mysql-test/suite/innodb_zip/r/bug53591.result
@@ -1,9 +1,4 @@
call mtr.add_suppression('InnoDB: Cannot add field.*because after adding it, the row size is');
-SET GLOBAL innodb_file_per_table=on;
-SET GLOBAL innodb_strict_mode=on;
-set old_alter_table=0;
-Warnings:
-Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
CREATE TABLE bug53591(a text charset utf8 not null)
ENGINE=InnoDB KEY_BLOCK_SIZE=1;
ALTER TABLE bug53591 ADD PRIMARY KEY(a(220));
@@ -12,5 +7,3 @@ SHOW WARNINGS;
Level Code Message
Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is {checked_valid}. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
DROP TABLE bug53591;
-SET GLOBAL innodb_file_per_table=1;
-SET GLOBAL innodb_strict_mode=DEFAULT;
diff --git a/mysql-test/suite/innodb_zip/r/bug56680.result b/mysql-test/suite/innodb_zip/r/bug56680.result
index 1a1a5b40..45c768ee 100644
--- a/mysql-test/suite/innodb_zip/r/bug56680.result
+++ b/mysql-test/suite/innodb_zip/r/bug56680.result
@@ -1,5 +1,4 @@
-SET GLOBAL tx_isolation='REPEATABLE-READ';
-SET GLOBAL innodb_file_per_table=on;
+SET GLOBAL transaction_isolation='REPEATABLE-READ';
CREATE TABLE bug56680(
a INT AUTO_INCREMENT PRIMARY KEY,
b CHAR(1),
@@ -29,7 +28,7 @@ connection default;
SELECT b FROM bug56680;
b
x
-SET GLOBAL tx_isolation='READ-UNCOMMITTED';
+SET GLOBAL transaction_isolation='READ-UNCOMMITTED';
INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
INSERT INTO bug56680 SELECT 0,b,c FROM bug56680;
diff --git a/mysql-test/suite/innodb_zip/r/cmp_drop_table.result b/mysql-test/suite/innodb_zip/r/cmp_drop_table.result
index e1f63268..530932e9 100644
--- a/mysql-test/suite/innodb_zip/r/cmp_drop_table.result
+++ b/mysql-test/suite/innodb_zip/r/cmp_drop_table.result
@@ -1,4 +1,3 @@
-set global innodb_file_per_table=on;
create table t1(a text) engine=innodb key_block_size=4;
SELECT page_size FROM information_schema.innodb_cmpmem WHERE pages_used > 0;
page_size
diff --git a/mysql-test/suite/innodb_zip/r/create_options.result b/mysql-test/suite/innodb_zip/r/create_options.result
index a678d7a8..0f4c1239 100644
--- a/mysql-test/suite/innodb_zip/r/create_options.result
+++ b/mysql-test/suite/innodb_zip/r/create_options.result
@@ -1,5 +1,4 @@
SET default_storage_engine=InnoDB;
-SET GLOBAL innodb_file_per_table=ON;
SET SESSION innodb_strict_mode = ON;
# Test 1) StrictMode=ON, CREATE and ALTER with each ROW_FORMAT & KEY_BLOCK_SIZE=0
# KEY_BLOCK_SIZE=0 means 'no KEY_BLOCK_SIZE is specified'
@@ -280,6 +279,8 @@ Level Code Message
# innodb_file_per_table=OFF and that they can be set to default
# values during strict mode.
SET GLOBAL innodb_file_per_table=OFF;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=1;
Got one of the listed errors
@@ -354,9 +355,13 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic
SET GLOBAL innodb_file_per_table=ON;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
DROP TABLE t1;
CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
SET GLOBAL innodb_file_per_table=OFF;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
ALTER TABLE t1 ADD COLUMN f1 INT;
SHOW WARNINGS;
Level Code Message
@@ -367,6 +372,8 @@ ALTER TABLE t1 ADD COLUMN f2 INT;
SHOW WARNINGS;
Level Code Message
SET GLOBAL innodb_file_per_table=ON;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
##################################################
SET SESSION innodb_strict_mode = OFF;
# Test 9) StrictMode=OFF, CREATE and ALTER with each ROW_FORMAT & KEY_BLOCK_SIZE=0
@@ -722,6 +729,8 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed row_format=COMPRESSED key_block_size=2
SET GLOBAL innodb_file_per_table=OFF;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
ALTER TABLE t1 ADD COLUMN f1 INT;
SHOW WARNINGS;
Level Code Message
@@ -729,6 +738,8 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Compressed row_format=COMPRESSED key_block_size=2
SET GLOBAL innodb_file_per_table=ON;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
ALTER TABLE t1 ADD COLUMN f2 INT;
SHOW WARNINGS;
Level Code Message
@@ -743,6 +754,8 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=DYNAMIC
SET GLOBAL innodb_file_per_table=OFF;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
ALTER TABLE t1 ADD COLUMN f1 INT;
SHOW WARNINGS;
Level Code Message
@@ -750,6 +763,8 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE
TABLE_NAME ROW_FORMAT CREATE_OPTIONS
t1 Dynamic row_format=DYNAMIC
SET GLOBAL innodb_file_per_table=ON;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
ALTER TABLE t1 ADD COLUMN f2 INT;
SHOW WARNINGS;
Level Code Message
diff --git a/mysql-test/suite/innodb_zip/r/index_large_prefix.result b/mysql-test/suite/innodb_zip/r/index_large_prefix.result
index ce302327..0c6a9104 100644
--- a/mysql-test/suite/innodb_zip/r/index_large_prefix.result
+++ b/mysql-test/suite/innodb_zip/r/index_large_prefix.result
@@ -1,5 +1,4 @@
SET default_storage_engine=InnoDB;
-set global innodb_file_per_table=1;
### Test 1 ###
create table worklog5743(a TEXT not null, primary key (a(1000))) ROW_FORMAT=DYNAMIC;
show warnings;
@@ -11,8 +10,8 @@ show warnings;
Level Code Message
begin;
update worklog5743 set a = (repeat("x", 17000));
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
connect con1,localhost,root,,;
select a = repeat("x", 17000) from worklog5743;
@@ -23,8 +22,8 @@ a = repeat("b", 16000)
1
connect con2,localhost,root,,;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
READ-UNCOMMITTED
select a = repeat("x", 17000) from worklog5743;
a = repeat("x", 17000)
@@ -43,8 +42,8 @@ insert into worklog5743 values(9, repeat("a", 10000));
begin;
update worklog5743 set a1 = 1000;
connection con1;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
id select_type table type possible_keys key key_len ref rows Extra
@@ -54,8 +53,8 @@ a1 a2 = repeat("a", 10000)
9 1
connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
READ-UNCOMMITTED
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
a1 a2 = repeat("a", 10000)
@@ -69,8 +68,8 @@ insert into worklog5743 values(9, repeat("a", 10000));
begin;
update worklog5743 set a1 = 1000;
connection con1;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
id select_type table type possible_keys key key_len ref rows Extra
@@ -80,8 +79,8 @@ a1 a2 = repeat("a", 10000)
9 1
connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
READ-UNCOMMITTED
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
a1 a2 = repeat("a", 10000)
@@ -259,8 +258,8 @@ select a1, left(a2, 20) from worklog5743_16;
a1 left(a2, 20)
1000 aaaaaaaaaaaaaaaaaaaa
connection con1;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
explain select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
id select_type table type possible_keys key key_len ref rows Extra
@@ -294,8 +293,8 @@ a1 left(a2, 20)
9 aaaaaaaaaaaaaaaaaaaa
connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
READ-UNCOMMITTED
select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
a1 left(a2, 20)
@@ -368,8 +367,8 @@ repeat("a", 3068));
begin;
update worklog5743 set a1 = 1000;
connection con1;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
explain select a1 from worklog5743 where a1 = 9;
id select_type table type possible_keys key key_len ref rows Extra
@@ -379,8 +378,8 @@ a1
9
connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
READ-UNCOMMITTED
select a1 from worklog5743 where a1 = 9;
a1
@@ -400,8 +399,8 @@ insert into worklog5743 values(repeat("a", 20000));
begin;
insert into worklog5743 values(repeat("b", 20000));
update worklog5743 set a = (repeat("x", 25000));
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
connection con1;
select a = repeat("a", 20000) from worklog5743;
@@ -410,8 +409,8 @@ a = repeat("a", 20000)
disconnect con1;
connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
READ-UNCOMMITTED
select a = repeat("x", 25000) from worklog5743;
a = repeat("x", 25000)
@@ -449,4 +448,3 @@ create index idx on worklog5743(a(768));
ERROR HY000: Index column size too large. The maximum column size is 767 bytes
create index idx2 on worklog5743(a(767));
drop table worklog5743;
-SET GLOBAL innodb_file_per_table=1;
diff --git a/mysql-test/suite/innodb_zip/r/index_large_prefix_4k.result b/mysql-test/suite/innodb_zip/r/index_large_prefix_4k.result
index 9d4db6a2..fb17b0b4 100644
--- a/mysql-test/suite/innodb_zip/r/index_large_prefix_4k.result
+++ b/mysql-test/suite/innodb_zip/r/index_large_prefix_4k.result
@@ -1,5 +1,4 @@
SET default_storage_engine=InnoDB;
-set global innodb_file_per_table=1;
### Test 1 ###
create table worklog5743(a TEXT not null, primary key (a(768))) ROW_FORMAT=DYNAMIC;
show warnings;
@@ -13,8 +12,8 @@ Level Code Message
SET sql_mode= default;
begin;
update worklog5743 set a = (repeat("x", 17000));
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
connect con1,localhost,root,,;
select a = repeat("x", 17000) from worklog5743;
@@ -25,8 +24,8 @@ a = repeat("b", 16000)
1
connect con2,localhost,root,,;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
READ-UNCOMMITTED
select a = repeat("x", 17000) from worklog5743;
a = repeat("x", 17000)
@@ -45,8 +44,8 @@ insert into worklog5743 values(9, repeat("a", 10000));
begin;
update worklog5743 set a1 = 1111;
connection con1;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
id select_type table type possible_keys key key_len ref rows Extra
@@ -56,8 +55,8 @@ a1 a2 = repeat("a", 10000)
9 1
connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
READ-UNCOMMITTED
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
a1 a2 = repeat("a", 10000)
@@ -71,8 +70,8 @@ insert into worklog5743 values(9, repeat("a", 10000));
begin;
update worklog5743 set a1 = 2222;
connection con1;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
id select_type table type possible_keys key key_len ref rows Extra
@@ -82,8 +81,8 @@ a1 a2 = repeat("a", 10000)
9 1
connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
READ-UNCOMMITTED
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
a1 a2 = repeat("a", 10000)
@@ -195,8 +194,8 @@ select a1, left(a2, 20) from worklog5743_4;
a1 left(a2, 20)
1000 aaaaaaaaaaaaaaaaaaaa
connection con1;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
explain select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
id select_type table type possible_keys key key_len ref rows Extra
@@ -218,8 +217,8 @@ a1 left(a2, 20)
9 aaaaaaaaaaaaaaaaaaaa
connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
READ-UNCOMMITTED
select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
a1 left(a2, 20)
@@ -273,8 +272,8 @@ insert into worklog5743 values(9, repeat("a", 764));
begin;
update worklog5743 set a1 = 4444;
connection con1;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
explain select a1 from worklog5743 where a1 = 9;
id select_type table type possible_keys key key_len ref rows Extra
@@ -284,8 +283,8 @@ a1
9
connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
READ-UNCOMMITTED
select a1 from worklog5743 where a1 = 9;
a1
@@ -303,8 +302,8 @@ insert into worklog5743 values(repeat("a", 20000));
begin;
insert into worklog5743 values(repeat("b", 20000));
update worklog5743 set a = (repeat("x", 25000));
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
connection con1;
select a = repeat("a", 20000) from worklog5743;
@@ -313,8 +312,8 @@ a = repeat("a", 20000)
disconnect con1;
connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
READ-UNCOMMITTED
select a = repeat("x", 25000) from worklog5743;
a = repeat("x", 25000)
@@ -353,4 +352,3 @@ create index idx on worklog5743(a(768));
ERROR HY000: Index column size too large. The maximum column size is 767 bytes
create index idx2 on worklog5743(a(767));
drop table worklog5743;
-SET GLOBAL innodb_file_per_table=1;
diff --git a/mysql-test/suite/innodb_zip/r/index_large_prefix_8k.result b/mysql-test/suite/innodb_zip/r/index_large_prefix_8k.result
index 925bd3f8..0e4f98a4 100644
--- a/mysql-test/suite/innodb_zip/r/index_large_prefix_8k.result
+++ b/mysql-test/suite/innodb_zip/r/index_large_prefix_8k.result
@@ -1,5 +1,4 @@
SET default_storage_engine=InnoDB;
-set global innodb_file_per_table=1;
### Test 1 ###
create table worklog5743(a TEXT not null, primary key (a(1000))) ROW_FORMAT=DYNAMIC;
show warnings;
@@ -16,8 +15,8 @@ Note 1071 Specified key was too long; max key length is 1536 bytes
SET sql_mode= default;
begin;
update worklog5743 set a = (repeat("x", 17000));
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
connect con1,localhost,root,,;
select a = repeat("x", 17000) from worklog5743;
@@ -28,8 +27,8 @@ a = repeat("b", 16000)
1
connect con2,localhost,root,,;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
READ-UNCOMMITTED
select a = repeat("x", 17000) from worklog5743;
a = repeat("x", 17000)
@@ -48,8 +47,8 @@ insert into worklog5743 values(9, repeat("a", 10000));
begin;
update worklog5743 set a1 = 1000;
connection con1;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
id select_type table type possible_keys key key_len ref rows Extra
@@ -59,8 +58,8 @@ a1 a2 = repeat("a", 10000)
9 1
connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
READ-UNCOMMITTED
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
a1 a2 = repeat("a", 10000)
@@ -74,8 +73,8 @@ insert into worklog5743 values(9, repeat("a", 10000));
begin;
update worklog5743 set a1 = 1000;
connection con1;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
id select_type table type possible_keys key key_len ref rows Extra
@@ -85,8 +84,8 @@ a1 a2 = repeat("a", 10000)
9 1
connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
READ-UNCOMMITTED
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
a1 a2 = repeat("a", 10000)
@@ -217,8 +216,8 @@ select a1, left(a2, 20) from worklog5743_8;
a1 left(a2, 20)
1000 aaaaaaaaaaaaaaaaaaaa
connection con1;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
explain select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
id select_type table type possible_keys key key_len ref rows Extra
@@ -246,8 +245,8 @@ a1 left(a2, 20)
9 aaaaaaaaaaaaaaaaaaaa
connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
READ-UNCOMMITTED
select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
a1 left(a2, 20)
@@ -295,8 +294,8 @@ update worklog5743 set a1 = 1000;
begin;
update worklog5743 set a1 = 1000;
connection con1;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
explain select a1 from worklog5743 where a1 = 9;
id select_type table type possible_keys key key_len ref rows Extra
@@ -305,8 +304,8 @@ select a1 from worklog5743 where a1 = 9;
a1
connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
READ-UNCOMMITTED
select a1 from worklog5743 where a1 = 9;
a1
@@ -325,8 +324,8 @@ insert into worklog5743 values(repeat("a", 20000));
begin;
insert into worklog5743 values(repeat("b", 20000));
update worklog5743 set a = (repeat("x", 25000));
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
connection con1;
select a = repeat("a", 20000) from worklog5743;
@@ -335,8 +334,8 @@ a = repeat("a", 20000)
disconnect con1;
connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
READ-UNCOMMITTED
select a = repeat("x", 25000) from worklog5743;
a = repeat("x", 25000)
@@ -374,4 +373,3 @@ create index idx on worklog5743(a(768));
ERROR HY000: Index column size too large. The maximum column size is 767 bytes
create index idx2 on worklog5743(a(767));
drop table worklog5743;
-SET GLOBAL innodb_file_per_table=1;
diff --git a/mysql-test/suite/innodb_zip/r/innochecksum_2.result b/mysql-test/suite/innodb_zip/r/innochecksum_2.result
index 681d8e1f..33d80b02 100644
--- a/mysql-test/suite/innodb_zip/r/innochecksum_2.result
+++ b/mysql-test/suite/innodb_zip/r/innochecksum_2.result
@@ -88,5 +88,6 @@ merge 0
Number of pages:#
Number of pages:#
[4]:# Print the version of innochecksum and exit
-innochecksum Ver #.#.## Restart the DB server
+innochecksum from #.#.#-MariaDB, client #.# for OS (ARCH)
+# Restart the DB server
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb_zip/r/innodb-zip.result b/mysql-test/suite/innodb_zip/r/innodb-zip.result
index 0a3119f4..c44eefcb 100644
--- a/mysql-test/suite/innodb_zip/r/innodb-zip.result
+++ b/mysql-test/suite/innodb_zip/r/innodb-zip.result
@@ -6,7 +6,10 @@ WHERE table_schema='mysqltest_innodb_zip';
table_name row_format data_length index_length
SET @save_innodb_stats_on_metadata=@@global.innodb_stats_on_metadata;
set session innodb_strict_mode=0;
+SET @save_fpt=@@GLOBAL.innodb_file_per_table;
set global innodb_file_per_table=off;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
SET @@global.innodb_stats_on_metadata=ON;
create table t0(a int primary key) engine=innodb row_format=compressed;
Warnings:
@@ -32,6 +35,8 @@ Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1.
set global innodb_file_per_table=on;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
create table t6(a int primary key) engine=innodb
key_block_size=1 row_format=redundant;
Warnings:
@@ -153,7 +158,6 @@ count(*)
1
update t1 set c3 = repeat('E', 20000) where c1 = 1;
drop table t1;
-set global innodb_file_per_table = on;
set innodb_strict_mode = off;
create table t1 (id int primary key) engine = innodb key_block_size = 0;
drop table t1;
@@ -247,6 +251,8 @@ Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql' and table_schema != 'sys' order by table_name;
table_schema table_name row_format data_length index_length
set global innodb_file_per_table = off;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
create table t1 (id int primary key) engine = innodb key_block_size = 1;
ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t1` (errno: 140 "Wrong create options")
show warnings;
@@ -286,4 +292,8 @@ mysqltest_innodb_zip t7 Dynamic {valid} 0
mysqltest_innodb_zip t8 Compact {valid} 0
mysqltest_innodb_zip t9 Redundant {valid} 0
drop table t7, t8, t9;
+SET GLOBAL innodb_file_per_table=@save_fpt;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
+SET @@global.innodb_stats_on_metadata=@save_innodb_stats_on_metadata;
DROP DATABASE mysqltest_innodb_zip;
diff --git a/mysql-test/suite/innodb_zip/r/large_blob.result b/mysql-test/suite/innodb_zip/r/large_blob.result
index 7070d610..55bb90aa 100644
--- a/mysql-test/suite/innodb_zip/r/large_blob.result
+++ b/mysql-test/suite/innodb_zip/r/large_blob.result
@@ -1,8 +1,9 @@
#
# This tests the use of large blobs in InnoDB.
#
-call mtr.add_suppression("InnoDB: Warning: a long semaphore wait");
SET GLOBAL innodb_file_per_table = OFF;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
#
# System tablespace, Row Format = Redundant
#
@@ -26,6 +27,8 @@ INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
SET GLOBAL innodb_file_per_table = ON;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
#
# Separate tablespace, Row Format = Redundant
#
diff --git a/mysql-test/suite/innodb_zip/r/page_size,4k.rdiff b/mysql-test/suite/innodb_zip/r/page_size,4k.rdiff
index afc2e9d5..c901bf6d 100644
--- a/mysql-test/suite/innodb_zip/r/page_size,4k.rdiff
+++ b/mysql-test/suite/innodb_zip/r/page_size,4k.rdiff
@@ -7,7 +7,7 @@
# Test 3) Query some information_shema tables that are dependent upon
# the page size.
SELECT t.name table_name, t.n_cols, t.flag table_flags,
-@@ -36,13 +36,13 @@
+@@ -36,7 +36,7 @@
table_name n_cols table_flags index_name root_page type n_fields merge_threshold
test/t1 5 0 PRIMARY 3 3 1 50
test/t2 5 1 PRIMARY 3 3 1 50
@@ -16,6 +16,8 @@
test/t4 5 33 PRIMARY 3 3 1 50
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Page_Size Zip_Size Path
+@@ -45,7 +45,7 @@
+ innodb_undo003 DEFAULT DEFAULT MYSQLD_DATADIR//undo003
test/t1 DEFAULT DEFAULT MYSQLD_DATADIR/test/t1.ibd
test/t2 DEFAULT DEFAULT MYSQLD_DATADIR/test/t2.ibd
-test/t3 DEFAULT 8192 MYSQLD_DATADIR/test/t3.ibd
@@ -23,7 +25,7 @@
test/t4 DEFAULT DEFAULT MYSQLD_DATADIR/test/t4.ibd
innodb_temporary DEFAULT DEFAULT MYSQLD_DATADIR/ibtmp1
DROP TABLE t1, t2, t3, t4;
-@@ -52,141 +52,90 @@
+@@ -55,141 +55,90 @@
SET SESSION innodb_strict_mode = ON;
CREATE TABLE t1 (
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
@@ -211,7 +213,7 @@
ALTER TABLE t1 KEY_BLOCK_SIZE=4;
SHOW WARNINGS;
Level Code Message
-@@ -218,15 +167,21 @@
+@@ -221,15 +170,21 @@
DROP TABLE t1;
SET SESSION innodb_strict_mode = OFF;
CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
@@ -233,7 +235,7 @@
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
-@@ -270,6 +225,7 @@
+@@ -275,6 +230,7 @@
ERROR HY000: Can't create table `test`.`t4` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
@@ -241,7 +243,7 @@
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table `test`.`t4` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
-@@ -277,105 +233,11 @@
+@@ -282,107 +238,13 @@
ERROR HY000: Can't create table `test`.`t5` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
@@ -250,6 +252,8 @@
Error 1005 Can't create table `test`.`t5` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
SET GLOBAL innodb_file_per_table = ON;
+ Warnings:
+ Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
-# Test 7) This series of tests were moved from innodb-index to here
-# because the second alter table t1 assumes a 16k page size.
-# Moving the test allows the rest of innodb-index to be run on all
@@ -348,7 +352,7 @@
# Test 8) Test creating a table that could lead to undo log overflow.
CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
h blob,i blob,j blob,k blob,l blob,m blob,n blob,
-@@ -390,10 +252,6 @@
+@@ -397,10 +259,6 @@
UPDATE t1 SET a=@b,b=@b,c=@b,d=@b,e=@b,f=@b,g=@b,h=@b,i=@b,j=@b,
k=@b,l=@b,m=@b,n=@b,o=@b,p=@b,q=@b,r=@b,s=@b,t=@b,u=@b;
CREATE INDEX t1a ON t1 (a(767));
@@ -359,7 +363,7 @@
UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c;
CREATE INDEX t1f ON t1 (f(767));
-@@ -408,37 +266,15 @@
+@@ -415,37 +273,15 @@
COMMIT;
CREATE INDEX t1g ON t1 (g(767));
UPDATE t1 SET g=@e;
@@ -401,7 +405,7 @@
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
-@@ -464,28 +300,12 @@
+@@ -471,28 +307,12 @@
`t` blob DEFAULT NULL,
`u` blob DEFAULT NULL,
KEY `t1a` (`a`(767)),
@@ -432,7 +436,7 @@
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC
DROP TABLE t1;
# Bug#12547647 UPDATE LOGGING COULD EXCEED LOG PAGE SIZE
-@@ -570,27 +390,25 @@
+@@ -577,27 +397,25 @@
DROP TABLE t1;
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
diff --git a/mysql-test/suite/innodb_zip/r/page_size,8k.rdiff b/mysql-test/suite/innodb_zip/r/page_size,8k.rdiff
index 11b22081..90b2a1f7 100644
--- a/mysql-test/suite/innodb_zip/r/page_size,8k.rdiff
+++ b/mysql-test/suite/innodb_zip/r/page_size,8k.rdiff
@@ -7,7 +7,7 @@
# Test 3) Query some information_shema tables that are dependent upon
# the page size.
SELECT t.name table_name, t.n_cols, t.flag table_flags,
-@@ -36,13 +36,13 @@
+@@ -36,7 +36,7 @@
table_name n_cols table_flags index_name root_page type n_fields merge_threshold
test/t1 5 0 PRIMARY 3 3 1 50
test/t2 5 1 PRIMARY 3 3 1 50
@@ -16,6 +16,8 @@
test/t4 5 33 PRIMARY 3 3 1 50
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Page_Size Zip_Size Path
+@@ -45,7 +45,7 @@
+ innodb_undo003 DEFAULT DEFAULT MYSQLD_DATADIR//undo003
test/t1 DEFAULT DEFAULT MYSQLD_DATADIR/test/t1.ibd
test/t2 DEFAULT DEFAULT MYSQLD_DATADIR/test/t2.ibd
-test/t3 DEFAULT 8192 MYSQLD_DATADIR/test/t3.ibd
@@ -23,7 +25,7 @@
test/t4 DEFAULT DEFAULT MYSQLD_DATADIR/test/t4.ibd
innodb_temporary DEFAULT DEFAULT MYSQLD_DATADIR/ibtmp1
DROP TABLE t1, t2, t3, t4;
-@@ -54,133 +54,97 @@
+@@ -57,133 +57,97 @@
c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200),
c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200),
c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200),
@@ -199,7 +201,7 @@
SHOW WARNINGS;
Level Code Message
SELECT table_name, row_format, create_options
-@@ -218,8 +182,11 @@
+@@ -221,8 +185,11 @@
DROP TABLE t1;
SET SESSION innodb_strict_mode = OFF;
CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
@@ -211,7 +213,7 @@
SELECT table_name, row_format, create_options
FROM information_schema.tables WHERE table_name = 't1';
table_name row_format create_options
-@@ -277,105 +244,11 @@
+@@ -282,107 +249,13 @@
ERROR HY000: Can't create table `test`.`t5` (errno: 140 "Wrong create options")
SHOW WARNINGS;
Level Code Message
@@ -220,6 +222,8 @@
Error 1005 Can't create table `test`.`t5` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
SET GLOBAL innodb_file_per_table = ON;
+ Warnings:
+ Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
-# Test 7) This series of tests were moved from innodb-index to here
-# because the second alter table t1 assumes a 16k page size.
-# Moving the test allows the rest of innodb-index to be run on all
@@ -318,7 +322,7 @@
# Test 8) Test creating a table that could lead to undo log overflow.
CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
h blob,i blob,j blob,k blob,l blob,m blob,n blob,
-@@ -390,10 +263,6 @@
+@@ -397,10 +270,6 @@
UPDATE t1 SET a=@b,b=@b,c=@b,d=@b,e=@b,f=@b,g=@b,h=@b,i=@b,j=@b,
k=@b,l=@b,m=@b,n=@b,o=@b,p=@b,q=@b,r=@b,s=@b,t=@b,u=@b;
CREATE INDEX t1a ON t1 (a(767));
@@ -329,7 +333,7 @@
UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c,
k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c;
CREATE INDEX t1f ON t1 (f(767));
-@@ -408,30 +277,6 @@
+@@ -415,30 +284,6 @@
COMMIT;
CREATE INDEX t1g ON t1 (g(767));
UPDATE t1 SET g=@e;
@@ -360,7 +364,7 @@
CREATE INDEX t1t ON t1 (t(767));
BEGIN;
UPDATE t1 SET t=@e;
-@@ -464,24 +309,8 @@
+@@ -471,24 +316,8 @@
`t` blob DEFAULT NULL,
`u` blob DEFAULT NULL,
KEY `t1a` (`a`(767)),
@@ -385,7 +389,7 @@
KEY `t1t` (`t`(767)),
KEY `t1u` (`u`(767)),
KEY `t1ut` (`u`(767),`t`(767)),
-@@ -573,14 +402,14 @@
+@@ -580,14 +409,14 @@
PRIMARY KEY (c(767),d(767)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
Warnings:
@@ -402,7 +406,7 @@
DROP TABLE t1;
CREATE TABLE t1(
c text NOT NULL, d text NOT NULL,
-@@ -590,7 +419,7 @@
+@@ -597,7 +426,7 @@
CREATE TABLE t1(c text, PRIMARY KEY (c(440)))
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII;
Warnings:
diff --git a/mysql-test/suite/innodb_zip/r/page_size.result b/mysql-test/suite/innodb_zip/r/page_size.result
index 48b954c9..93d5559f 100644
--- a/mysql-test/suite/innodb_zip/r/page_size.result
+++ b/mysql-test/suite/innodb_zip/r/page_size.result
@@ -40,6 +40,9 @@ test/t3 5 41 PRIMARY 3 3 1 50
test/t4 5 33 PRIMARY 3 3 1 50
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Page_Size Zip_Size Path
+innodb_undo001 DEFAULT DEFAULT MYSQLD_DATADIR//undo001
+innodb_undo002 DEFAULT DEFAULT MYSQLD_DATADIR//undo002
+innodb_undo003 DEFAULT DEFAULT MYSQLD_DATADIR//undo003
test/t1 DEFAULT DEFAULT MYSQLD_DATADIR/test/t1.ibd
test/t2 DEFAULT DEFAULT MYSQLD_DATADIR/test/t2.ibd
test/t3 DEFAULT 8192 MYSQLD_DATADIR/test/t3.ibd
@@ -263,6 +266,8 @@ DROP TABLE t1;
# Test 6) KEY_BLOCK_SIZE with innodb_file_per_table=OFF
SET SESSION innodb_strict_mode = ON;
SET GLOBAL innodb_file_per_table = OFF;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
SHOW VARIABLES LIKE 'innodb_file_per_table';
Variable_name Value
innodb_file_per_table OFF
@@ -281,6 +286,8 @@ Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Error 1005 Can't create table `test`.`t5` (errno: 140 "Wrong create options")
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
SET GLOBAL innodb_file_per_table = ON;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
# Test 7) This series of tests were moved from innodb-index to here
# because the second alter table t1 assumes a 16k page size.
# Moving the test allows the rest of innodb-index to be run on all
diff --git a/mysql-test/suite/innodb_zip/r/prefix_index_liftedlimit.result b/mysql-test/suite/innodb_zip/r/prefix_index_liftedlimit.result
index 43a63a29..d29082ad 100644
--- a/mysql-test/suite/innodb_zip/r/prefix_index_liftedlimit.result
+++ b/mysql-test/suite/innodb_zip/r/prefix_index_liftedlimit.result
@@ -793,16 +793,16 @@ col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
1 1
0 1
connection con1;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
REPEATABLE-READ
SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
col_1_text = REPEAT("b", 200) col_2_text = REPEAT("o", 200)
0 1
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
READ-UNCOMMITTED
SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
@@ -864,8 +864,8 @@ col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
COMMIT;
connection con1;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
-@@session.tx_isolation
+select @@session.transaction_isolation;
+@@session.transaction_isolation
READ-UNCOMMITTED
SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
diff --git a/mysql-test/suite/innodb_zip/r/restart.result b/mysql-test/suite/innodb_zip/r/restart.result
index 8bd3f73f..27316d6c 100644
--- a/mysql-test/suite/innodb_zip/r/restart.result
+++ b/mysql-test/suite/innodb_zip/r/restart.result
@@ -3,7 +3,6 @@ SET default_storage_engine=InnoDB;
# A series of tests to make sure tables are opened after restart.
# Bug#13357607 Compressed file-per-table tablespaces fail to open
#
-set global innodb_file_per_table=on;
#
# Create and insert records into a REDUNDANT row formatted table.
#
@@ -211,6 +210,9 @@ test/t7_restart#p#p1#sp#s2 test/t7_restart#p#p1#sp#s2 97 8 Dynamic 0
test/t7_restart#p#p1#sp#s3 test/t7_restart#p#p1#sp#s3 97 8 Dynamic 0
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Page_Size Zip_Size Path
+innodb_undo001 DEFAULT DEFAULT MYSQLD_DATADIR//undo001
+innodb_undo002 DEFAULT DEFAULT MYSQLD_DATADIR//undo002
+innodb_undo003 DEFAULT DEFAULT MYSQLD_DATADIR//undo003
test/t1_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t1_restart.ibd
test/t2_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t2_restart.ibd
test/t3_restart DEFAULT 2048 MYSQLD_DATADIR/test/t3_restart.ibd
@@ -265,9 +267,6 @@ t7_restart#p#p1#sp#s3.ibd
# Start the server and show that tables are still visible and accessible.
#
# restart
-SHOW VARIABLES LIKE 'innodb_file_per_table';
-Variable_name Value
-innodb_file_per_table ON
SHOW CREATE TABLE t1_restart;
Table Create Table
t1_restart CREATE TABLE `t1_restart` (
@@ -397,6 +396,9 @@ test/t7_restart#p#p1#sp#s2 test/t7_restart#p#p1#sp#s2 97 8 Dynamic 0
test/t7_restart#p#p1#sp#s3 test/t7_restart#p#p1#sp#s3 97 8 Dynamic 0
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Page_Size Zip_Size Path
+innodb_undo001 DEFAULT DEFAULT MYSQLD_DATADIR//undo001
+innodb_undo002 DEFAULT DEFAULT MYSQLD_DATADIR//undo002
+innodb_undo003 DEFAULT DEFAULT MYSQLD_DATADIR//undo003
test/t1_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t1_restart.ibd
test/t2_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t2_restart.ibd
test/t3_restart DEFAULT 2048 MYSQLD_DATADIR/test/t3_restart.ibd
@@ -421,6 +423,9 @@ ALTER TABLE t6_restart TRUNCATE PARTITION p2;
ALTER TABLE t7_restart TRUNCATE PARTITION p1;
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Page_Size Zip_Size Path
+innodb_undo001 DEFAULT DEFAULT MYSQLD_DATADIR//undo001
+innodb_undo002 DEFAULT DEFAULT MYSQLD_DATADIR//undo002
+innodb_undo003 DEFAULT DEFAULT MYSQLD_DATADIR//undo003
test/t4_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t4_restart.ibd
test/t6_restart#p#p0 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p0.ibd
test/t6_restart#p#p1 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p1.ibd
@@ -522,11 +527,11 @@ t7_restart#p#p1#sp#s3.ibd
# Start the server and show the tablespaces.
#
# restart
-SHOW VARIABLES LIKE 'innodb_file_per_table';
-Variable_name Value
-innodb_file_per_table ON
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Page_Size Zip_Size Path
+innodb_undo001 DEFAULT DEFAULT MYSQLD_DATADIR//undo001
+innodb_undo002 DEFAULT DEFAULT MYSQLD_DATADIR//undo002
+innodb_undo003 DEFAULT DEFAULT MYSQLD_DATADIR//undo003
innodb_temporary DEFAULT DEFAULT MYSQLD_DATADIR/ibtmp1
SELECT count(*) FROM t5_restart;
count(*)
@@ -620,6 +625,9 @@ RENAME TABLE t6_restart TO t66_restart;
RENAME TABLE t7_restart TO t77_restart;
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Page_Size Zip_Size Path
+innodb_undo001 DEFAULT DEFAULT MYSQLD_DATADIR//undo001
+innodb_undo002 DEFAULT DEFAULT MYSQLD_DATADIR//undo002
+innodb_undo003 DEFAULT DEFAULT MYSQLD_DATADIR//undo003
test/t66_restart#p#p0 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p0.ibd
test/t66_restart#p#p1 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p1.ibd
test/t77_restart#p#p0#sp#s0 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p0#sp#s0.ibd
@@ -713,11 +721,11 @@ t77_restart#p#p1#sp#s3.ibd
# Restart the server
#
# restart
-SHOW VARIABLES LIKE 'innodb_file_per_table';
-Variable_name Value
-innodb_file_per_table ON
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Page_Size Zip_Size Path
+innodb_undo001 DEFAULT DEFAULT MYSQLD_DATADIR//undo001
+innodb_undo002 DEFAULT DEFAULT MYSQLD_DATADIR//undo002
+innodb_undo003 DEFAULT DEFAULT MYSQLD_DATADIR//undo003
innodb_temporary DEFAULT DEFAULT MYSQLD_DATADIR/ibtmp1
INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart);
SELECT count(*) FROM t55_restart;
@@ -844,6 +852,9 @@ t77_restart#p#p1#sp#s3.ibd
# restart
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Page_Size Zip_Size Path
+innodb_undo001 DEFAULT DEFAULT MYSQLD_DATADIR//undo001
+innodb_undo002 DEFAULT DEFAULT MYSQLD_DATADIR//undo002
+innodb_undo003 DEFAULT DEFAULT MYSQLD_DATADIR//undo003
innodb_temporary DEFAULT DEFAULT MYSQLD_DATADIR/ibtmp1
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
SELECT count(*) FROM t4_restart;
@@ -974,6 +985,9 @@ t77_restart.par
# restart
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
Space_Name Page_Size Zip_Size Path
+innodb_undo001 DEFAULT DEFAULT MYSQLD_DATADIR//undo001
+innodb_undo002 DEFAULT DEFAULT MYSQLD_DATADIR//undo002
+innodb_undo003 DEFAULT DEFAULT MYSQLD_DATADIR//undo003
innodb_temporary DEFAULT DEFAULT MYSQLD_DATADIR/ibtmp1
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
SELECT count(*) FROM t4_restart;
diff --git a/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result b/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result
index 62a28a98..f4419068 100644
--- a/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result
+++ b/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result
@@ -94,11 +94,6 @@ ALTER TABLE t1 IMPORT TABLESPACE;
ERROR HY000: Got error 42 'Tablespace not found' from ./test/t1.ibd
SET SESSION debug_dbug=@saved_debug_dbug;
restore: t1 .ibd and .cfg files
-SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure";
-ALTER TABLE t1 IMPORT TABLESPACE;
-ERROR HY000: Index for table 't1' is corrupt; try to repair it
-SET SESSION debug_dbug=@saved_debug_dbug;
-restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_cluster_root_adjust_failure";
ALTER TABLE t1 IMPORT TABLESPACE;
ERROR HY000: Index for table 't1' is corrupt; try to repair it
diff --git a/mysql-test/suite/innodb_zip/r/wl5522_zip.result b/mysql-test/suite/innodb_zip/r/wl5522_zip.result
index 1b044d68..a7cc00cb 100644
--- a/mysql-test/suite/innodb_zip/r/wl5522_zip.result
+++ b/mysql-test/suite/innodb_zip/r/wl5522_zip.result
@@ -263,6 +263,8 @@ c1 c2
unlink: t1.cfg
DROP TABLE t1;
SET GLOBAL innodb_file_per_table = 0;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB;
@@ -280,6 +282,8 @@ Warning 1809 Table `test`.`t1` in system tablespace
UNLOCK TABLES;
DROP TABLE t1;
SET GLOBAL innodb_file_per_table = 1;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX idx(c2)) ENGINE=InnoDB
diff --git a/mysql-test/suite/innodb_zip/r/wl6347_comp_indx_stat.result b/mysql-test/suite/innodb_zip/r/wl6347_comp_indx_stat.result
index 05b4793e..f4667834 100644
--- a/mysql-test/suite/innodb_zip/r/wl6347_comp_indx_stat.result
+++ b/mysql-test/suite/innodb_zip/r/wl6347_comp_indx_stat.result
@@ -8,7 +8,6 @@
# check the size and compression stats of the table tab5
#******************************************************************
# set the flags
-SET GLOBAL innodb_file_per_table=on;
SET GLOBAL innodb_cmp_per_index_enabled=ON;
SET GLOBAL innodb_compression_level=0;
#******************************************************************
@@ -318,7 +317,6 @@ The size of the tab5.ibd file: 5242880
# set the flag on (default off)
SET GLOBAL innodb_cmp_per_index_enabled=ON;
# set the flags
-SET GLOBAL innodb_file_per_table=on;
SET GLOBAL innodb_compression_level=0;
# fetch the compressed page and check the stats
# The stats figure may be different/same for each restart.
@@ -655,7 +653,6 @@ The size of the tab5.ibd file: 2097152
# set the flag on (default off)
SET GLOBAL innodb_cmp_per_index_enabled=ON;
# set the flags
-SET GLOBAL innodb_file_per_table=on;
SET GLOBAL innodb_compression_level=0;
# fetch the compressed page and check the stats
# The stats figure may be different/same for each restart.
@@ -1615,7 +1612,6 @@ DROP TABLE tab5;
SET GLOBAL innodb_cmp_per_index_enabled=0;
SET GLOBAL innodb_cmp_per_index_enabled=1;
# set the flags
-SET GLOBAL innodb_file_per_table=on;
SET GLOBAL innodb_compression_level=9;
#******************************************************************
# Test 2-1K: innodb_cmp_per_index_enabled=ON and innodb_compression_level=9 with page size 1K
@@ -1926,7 +1922,6 @@ The size of the tab5.ibd file: 65536
# set the flag on (default off)
SET GLOBAL innodb_cmp_per_index_enabled=ON;
# set the flags
-SET GLOBAL innodb_file_per_table=on;
SET GLOBAL innodb_compression_level=9;
# fetch the compressed page and check the stats
# The stats figure may be different/same for each restart.
@@ -2265,7 +2260,6 @@ The size of the tab5.ibd file: 65536
# set the flag on (default off)
SET GLOBAL innodb_cmp_per_index_enabled=ON;
# set the flags
-SET GLOBAL innodb_file_per_table=on;
SET GLOBAL innodb_compression_level=9;
# fetch the compressed page and check the stats
# The stats figure may be different/same for each restart.
@@ -4710,8 +4704,6 @@ SELECT @@innodb_cmp_per_index_enabled;
@@innodb_cmp_per_index_enabled 1
SELECT @@innodb_compression_failure_threshold_pct;
@@innodb_compression_failure_threshold_pct 0
-SELECT @@innodb_file_per_table;
-@@innodb_file_per_table 1
SELECT @@innodb_compression_level;
@@innodb_compression_level 6
#******************************************************************
@@ -5022,7 +5014,6 @@ The size of the tab5.ibd file: 65536
SET GLOBAL innodb_cmp_per_index_enabled=ON;
# set the flags
SET GLOBAL innodb_compression_failure_threshold_pct=0;
-SET GLOBAL innodb_file_per_table=on;
# fetch the compressed page and check the stats
# The stats figure may be different/same for each restart.
===============
@@ -6289,7 +6280,6 @@ DROP TABLE tab5;
SET GLOBAL innodb_cmp_per_index_enabled=OFF;
SET GLOBAL innodb_cmp_per_index_enabled=ON;
# set the flags
-SET GLOBAL innodb_file_per_table=on;
SET GLOBAL innodb_cmp_per_index_enabled=ON;
SET GLOBAL innodb_compression_failure_threshold_pct=10;
SET GLOBAL innodb_compression_level=Default;
@@ -6298,8 +6288,6 @@ SELECT @@innodb_cmp_per_index_enabled;
@@innodb_cmp_per_index_enabled 1
SELECT @@innodb_compression_failure_threshold_pct;
@@innodb_compression_failure_threshold_pct 10
-SELECT @@innodb_file_per_table;
-@@innodb_file_per_table 1
SELECT @@innodb_compression_level;
@@innodb_compression_level 6
#******************************************************************
@@ -6610,8 +6598,6 @@ The size of the tab5.ibd file: 65536
SET GLOBAL innodb_cmp_per_index_enabled=ON;
# set the flags
SET GLOBAL innodb_compression_failure_threshold_pct=10;
-SET GLOBAL innodb_file_per_table=on;
-SET GLOBAL innodb_compression_failure_threshold_pct=10;
# fetch the compressed page and check the stats
# The stats figure may be different/same for each restart.
===============
@@ -7874,7 +7860,6 @@ DROP TABLE tab5;
# reset the stat table before starting next testcase
SET GLOBAL innodb_cmp_per_index_enabled=0;
SET GLOBAL innodb_cmp_per_index_enabled=1;
-SET GLOBAL innodb_file_per_table=ON;
SET GLOBAL innodb_compression_level=default;
SET GLOBAL innodb_compression_failure_threshold_pct=default;
# create a table page size=1K
@@ -7923,6 +7908,5 @@ compress_ops_ok 1
DROP TABLE tab5, test.tab5;
DROP DATABASE sb;
# reset the flags
-SET GLOBAL innodb_file_per_table=default;
SET GLOBAL innodb_cmp_per_index_enabled=default;
SET GLOBAL innodb_compression_failure_threshold_pct=default;
diff --git a/mysql-test/suite/innodb_zip/t/bug36169.test b/mysql-test/suite/innodb_zip/t/bug36169.test
index 07566b20..8ab970f6 100644
--- a/mysql-test/suite/innodb_zip/t/bug36169.test
+++ b/mysql-test/suite/innodb_zip/t/bug36169.test
@@ -5,9 +5,6 @@
-- source include/innodb_page_size_small.inc
-let $file_per_table=`select @@innodb_file_per_table`;
-SET GLOBAL innodb_file_per_table=ON;
-
#
# The following is copied from http://bugs.mysql.com/36169
# (http://bugs.mysql.com/file.php?id=9121)
@@ -1155,7 +1152,5 @@ DROP TABLE IF EXISTS table2;
DROP TABLE IF EXISTS table3;
DROP TABLE IF EXISTS table4;
DROP TABLE IF EXISTS table5;
+-- enable_query_log
DROP TABLE IF EXISTS table6;
-
-EVAL SET GLOBAL innodb_file_per_table=$file_per_table;
-SET sql_mode = default;
diff --git a/mysql-test/suite/innodb_zip/t/bug53591.test b/mysql-test/suite/innodb_zip/t/bug53591.test
index 17c79e0f..ef4d12ad 100644
--- a/mysql-test/suite/innodb_zip/t/bug53591.test
+++ b/mysql-test/suite/innodb_zip/t/bug53591.test
@@ -2,13 +2,6 @@
call mtr.add_suppression('InnoDB: Cannot add field.*because after adding it, the row size is');
-let $file_per_table=`select @@innodb_file_per_table`;
-
-SET GLOBAL innodb_file_per_table=on;
-SET GLOBAL innodb_strict_mode=on;
-
-set old_alter_table=0;
-
CREATE TABLE bug53591(a text charset utf8 not null)
ENGINE=InnoDB KEY_BLOCK_SIZE=1;
-- replace_result 8126 {checked_valid} 4030 {checked_valid} 1982 {checked_valid}
@@ -18,6 +11,3 @@ ALTER TABLE bug53591 ADD PRIMARY KEY(a(220));
SHOW WARNINGS;
DROP TABLE bug53591;
-
-EVAL SET GLOBAL innodb_file_per_table=$file_per_table;
-SET GLOBAL innodb_strict_mode=DEFAULT;
diff --git a/mysql-test/suite/innodb_zip/t/bug56680.test b/mysql-test/suite/innodb_zip/t/bug56680.test
index 54cbc7ca..adb632af 100644
--- a/mysql-test/suite/innodb_zip/t/bug56680.test
+++ b/mysql-test/suite/innodb_zip/t/bug56680.test
@@ -15,8 +15,7 @@
-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
SET GLOBAL innodb_change_buffering_debug = 1;
-- enable_query_log
-SET GLOBAL tx_isolation='REPEATABLE-READ';
-SET GLOBAL innodb_file_per_table=on;
+SET GLOBAL transaction_isolation='REPEATABLE-READ';
CREATE TABLE bug56680(
a INT AUTO_INCREMENT PRIMARY KEY,
@@ -51,7 +50,7 @@ SELECT b FROM bug56680;
# For the rest of this test, use the READ UNCOMMITTED isolation level
# to see what exists in the secondary index.
-SET GLOBAL tx_isolation='READ-UNCOMMITTED';
+SET GLOBAL transaction_isolation='READ-UNCOMMITTED';
# Create enough rows for the table, so that the insert buffer will be
# used for modifying the secondary index page. There must be multiple
diff --git a/mysql-test/suite/innodb_zip/t/cmp_drop_table.test b/mysql-test/suite/innodb_zip/t/cmp_drop_table.test
index ae6bfd9f..e64514fc 100644
--- a/mysql-test/suite/innodb_zip/t/cmp_drop_table.test
+++ b/mysql-test/suite/innodb_zip/t/cmp_drop_table.test
@@ -3,12 +3,8 @@
# scans through pages
-- source include/not_encrypted.inc
-let $per_table=`select @@innodb_file_per_table`;
-
-- let $query_i_s = SELECT page_size FROM information_schema.innodb_cmpmem WHERE pages_used > 0
-set global innodb_file_per_table=on;
-
create table t1(a text) engine=innodb key_block_size=4;
-- disable_query_log
@@ -50,10 +46,3 @@ while ($i)
-- eval $query_i_s
drop table t2;
-
-#
-# restore environment to the state it was before this test execution
-#
-
--- disable_query_log
-eval set global innodb_file_per_table=$per_table;
diff --git a/mysql-test/suite/innodb_zip/t/create_options.test b/mysql-test/suite/innodb_zip/t/create_options.test
index fce64060..9840a28a 100644
--- a/mysql-test/suite/innodb_zip/t/create_options.test
+++ b/mysql-test/suite/innodb_zip/t/create_options.test
@@ -59,11 +59,6 @@
--source include/innodb_page_size_small.inc
SET default_storage_engine=InnoDB;
-# These values can change during the test
-LET $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
-
-SET GLOBAL innodb_file_per_table=ON;
-
# The first half of these tests are with strict mode ON.
SET SESSION innodb_strict_mode = ON;
@@ -481,7 +476,3 @@ SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE
--echo # Cleanup
DROP TABLE t1;
-
---disable_query_log
-EVAL SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
---enable_query_log
diff --git a/mysql-test/suite/innodb_zip/t/index_large_prefix.test b/mysql-test/suite/innodb_zip/t/index_large_prefix.test
index a254c4e6..65634542 100644
--- a/mysql-test/suite/innodb_zip/t/index_large_prefix.test
+++ b/mysql-test/suite/innodb_zip/t/index_large_prefix.test
@@ -10,10 +10,6 @@ SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed;
SET GLOBAL innodb_read_only_compressed=OFF;
--enable_query_log
-let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
-
-set global innodb_file_per_table=1;
-
-- echo ### Test 1 ###
# Create a table of DYNAMIC format, with a primary index of 1000 bytes in
# size
@@ -44,7 +40,7 @@ update worklog5743 set a = (repeat("x", 17000));
# Start a new session to select the column to force it build
# an earlier version of the clustered index through undo log. So it should
# just see the result of repeat("b", 16000)
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
--connect (con1,localhost,root,,)
select a = repeat("x", 17000) from worklog5743;
select a = repeat("b", 16000) from worklog5743;
@@ -53,7 +49,7 @@ select a = repeat("b", 16000) from worklog5743;
# should see the uncommitted update
--connect (con2,localhost,root,,)
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
select a = repeat("x", 17000) from worklog5743;
# Roll back the transaction
@@ -77,7 +73,7 @@ update worklog5743 set a1 = 1000;
# Do a select from another connection that would use the secondary index
--connection con1
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
@@ -85,7 +81,7 @@ select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
# row with a1 = 9
--connection con2
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
--connection default
@@ -107,7 +103,7 @@ update worklog5743 set a1 = 1000;
# Do a select from another connection that would use the secondary index
--connection con1
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
@@ -115,7 +111,7 @@ select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
# row with a1 = 9
--connection con2
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
--connection default
@@ -251,7 +247,7 @@ select a1, left(a2, 20) from worklog5743_16;
# Do a select from another connection that would use the secondary index
--connection con1
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
explain select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
explain select a1, left(a2, 20) from worklog5743_2 where a1 = 9;
explain select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
@@ -267,7 +263,7 @@ select a1, left(a2, 20) from worklog5743_16 where a1 = 9;
# row with a1 = 9
--connection con2
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
select a1, left(a2, 20) from worklog5743_2 where a1 = 9;
select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
@@ -322,14 +318,14 @@ update worklog5743 set a1 = 1000;
# Do a select from another connection that would use the secondary index
--connection con1
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
explain select a1 from worklog5743 where a1 = 9;
select a1 from worklog5743 where a1 = 9;
# Do read uncommitted, it would show there is no row with a1 = 9
--connection con2
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
select a1 from worklog5743 where a1 = 9;
--connection default
@@ -362,14 +358,14 @@ update worklog5743 set a = (repeat("x", 25000));
# Start a new session to select the table to force it build
# an earlier version of the cluster index through undo log
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
--connection con1
select a = repeat("a", 20000) from worklog5743;
--disconnect con1
--connection con2
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
select a = repeat("x", 25000) from worklog5743;
--disconnect con2
@@ -408,5 +404,3 @@ create index idx2 on worklog5743(a(767));
SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed;
--enable_query_log
drop table worklog5743;
-
-eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
diff --git a/mysql-test/suite/innodb_zip/t/index_large_prefix_4k.test b/mysql-test/suite/innodb_zip/t/index_large_prefix_4k.test
index c1c8f49c..8b3a2af9 100644
--- a/mysql-test/suite/innodb_zip/t/index_large_prefix_4k.test
+++ b/mysql-test/suite/innodb_zip/t/index_large_prefix_4k.test
@@ -8,10 +8,6 @@ SET default_storage_engine=InnoDB;
call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is");
--enable_query_log
-let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
-
-set global innodb_file_per_table=1;
-
-- echo ### Test 1 ###
# Create a table of DYNAMIC format, with a primary index of 768 bytes in
# size
@@ -43,7 +39,7 @@ update worklog5743 set a = (repeat("x", 17000));
# Start a new session to select the column to force it build
# an earlier version of the clustered index through undo log. So it should
# just see the result of repeat("b", 16000)
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
--connect (con1,localhost,root,,)
select a = repeat("x", 17000) from worklog5743;
select a = repeat("b", 16000) from worklog5743;
@@ -52,7 +48,7 @@ select a = repeat("b", 16000) from worklog5743;
# should see the uncommitted update
--connect (con2,localhost,root,,)
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
select a = repeat("x", 17000) from worklog5743;
# Roll back the transaction
@@ -76,7 +72,7 @@ update worklog5743 set a1 = 1111;
# Do a select from another connection that would use the secondary index
--connection con1
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
@@ -84,7 +80,7 @@ select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
# row with a1 = 9
--connection con2
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
--connection default
@@ -106,7 +102,7 @@ update worklog5743 set a1 = 2222;
# Do a select from another connection that would use the secondary index
--connection con1
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
@@ -114,7 +110,7 @@ select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
# row with a1 = 9
--connection con2
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
--connection default
@@ -199,7 +195,7 @@ select a1, left(a2, 20) from worklog5743_4;
# Do a select from another connection that would use the secondary index
--connection con1
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
explain select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
explain select a1, left(a2, 20) from worklog5743_2 where a1 = 9;
explain select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
@@ -211,7 +207,7 @@ select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
# row with a1 = 9
--connection con2
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
select a1, left(a2, 20) from worklog5743_2 where a1 = 9;
select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
@@ -297,14 +293,14 @@ update worklog5743 set a1 = 4444;
# Do a select from another connection that would use the secondary index
--connection con1
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
explain select a1 from worklog5743 where a1 = 9;
select a1 from worklog5743 where a1 = 9;
# Do read uncommitted, it would show there is no row with a1 = 9
--connection con2
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
select a1 from worklog5743 where a1 = 9;
--connection default
@@ -334,14 +330,14 @@ update worklog5743 set a = (repeat("x", 25000));
# Start a new session to select the table to force it build
# an earlier version of the cluster index through undo log
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
--connection con1
select a = repeat("a", 20000) from worklog5743;
--disconnect con1
--connection con2
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
select a = repeat("x", 25000) from worklog5743;
--disconnect con2
@@ -380,6 +376,3 @@ create table worklog5743(a TEXT not null) ROW_FORMAT=COMPACT;
create index idx on worklog5743(a(768));
create index idx2 on worklog5743(a(767));
drop table worklog5743;
-
-
-eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
diff --git a/mysql-test/suite/innodb_zip/t/index_large_prefix_8k.test b/mysql-test/suite/innodb_zip/t/index_large_prefix_8k.test
index bacde564..cc41b13d 100644
--- a/mysql-test/suite/innodb_zip/t/index_large_prefix_8k.test
+++ b/mysql-test/suite/innodb_zip/t/index_large_prefix_8k.test
@@ -8,10 +8,6 @@ SET default_storage_engine=InnoDB;
call mtr.add_suppression("Cannot add field .* in table .* because after adding it, the row size is");
--enable_query_log
-let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
-
-set global innodb_file_per_table=1;
-
-- echo ### Test 1 ###
# Create a table of DYNAMIC format, with a primary index of 1000 bytes in
# size
@@ -44,7 +40,7 @@ update worklog5743 set a = (repeat("x", 17000));
# Start a new session to select the column to force it build
# an earlier version of the clustered index through undo log. So it should
# just see the result of repeat("b", 16000)
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
--connect (con1,localhost,root,,)
select a = repeat("x", 17000) from worklog5743;
select a = repeat("b", 16000) from worklog5743;
@@ -53,7 +49,7 @@ select a = repeat("b", 16000) from worklog5743;
# should see the uncommitted update
--connect (con2,localhost,root,,)
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
select a = repeat("x", 17000) from worklog5743;
# Roll back the transaction
@@ -77,7 +73,7 @@ update worklog5743 set a1 = 1000;
# Do a select from another connection that would use the secondary index
--connection con1
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
@@ -85,7 +81,7 @@ select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
# row with a1 = 9
--connection con2
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
--connection default
@@ -107,7 +103,7 @@ update worklog5743 set a1 = 1000;
# Do a select from another connection that would use the secondary index
--connection con1
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
@@ -115,7 +111,7 @@ select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
# row with a1 = 9
--connection con2
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
--connection default
@@ -219,7 +215,7 @@ select a1, left(a2, 20) from worklog5743_8;
# Do a select from another connection that would use the secondary index
--connection con1
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
explain select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
explain select a1, left(a2, 20) from worklog5743_2 where a1 = 9;
explain select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
@@ -233,7 +229,7 @@ select a1, left(a2, 20) from worklog5743_8 where a1 = 9;
# row with a1 = 9
--connection con2
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
select a1, left(a2, 20) from worklog5743_1 where a1 = 9;
select a1, left(a2, 20) from worklog5743_2 where a1 = 9;
select a1, left(a2, 20) from worklog5743_4 where a1 = 9;
@@ -316,14 +312,14 @@ update worklog5743 set a1 = 1000;
# Do a select from another connection that would use the secondary index
--connection con1
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
explain select a1 from worklog5743 where a1 = 9;
select a1 from worklog5743 where a1 = 9;
# Do read uncommitted, it would show there is no row with a1 = 9
--connection con2
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
select a1 from worklog5743 where a1 = 9;
--connection default
@@ -355,14 +351,14 @@ update worklog5743 set a = (repeat("x", 25000));
# Start a new session to select the table to force it build
# an earlier version of the cluster index through undo log
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
--connection con1
select a = repeat("a", 20000) from worklog5743;
--disconnect con1
--connection con2
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
select a = repeat("x", 25000) from worklog5743;
--disconnect con2
@@ -397,6 +393,3 @@ create table worklog5743(a TEXT not null) ROW_FORMAT=COMPACT;
create index idx on worklog5743(a(768));
create index idx2 on worklog5743(a(767));
drop table worklog5743;
-
-
-eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
diff --git a/mysql-test/suite/innodb_zip/t/innochecksum_2.test b/mysql-test/suite/innodb_zip/t/innochecksum_2.test
index 57926d92..f6b0e5de 100644
--- a/mysql-test/suite/innodb_zip/t/innochecksum_2.test
+++ b/mysql-test/suite/innodb_zip/t/innochecksum_2.test
@@ -57,7 +57,7 @@ open IN_FILE,"<", "$dir/tmp/$file" or die $!;
open OUT_FILE, ">", "$dir/tmp/tmpfile" or die $!;
while(<IN_FILE>) {
unless ($_=~ /^debug.*$/ || $_=~ /\-#, \-\-debug.*$/ || $_=~ /http:.*html/) {
- $_=~ s/^\S*innochecksum.+Ver.+[0-9]*\.[0-9]*\.[0-9]*.+$/innochecksum Ver #.#.#/g;
+ $_=~ s/^\S*innochecksum.* from .+$/innochecksum Ver #.#.#/g;
$_=~ s/(Copyright\s\(c\))\s([0-9]*),\s([0-9]*)(.*)/$1 YEAR, YEAR $4/g;
$_=~ s/Usage:.*\[-c/Usage: innochecksum [-c/g;
print OUT_FILE $_;
@@ -80,7 +80,7 @@ EOF
--exec $INNOCHECKSUM -c $MYSQLD_DATADIR/test/t1.ibd
--echo [4]:# Print the version of innochecksum and exit
---replace_regex /.*innochecksum.*Ver.*[0-9]*.[0-9]*.[0-9]*.*/innochecksum Ver #.#.#/
+--replace_regex /for \S+/for OS/ /\d+/#/ /#[-_A-Za-z0-9]*-MariaDB,/#-MariaDB,/ /\(.*\)/(ARCH)/ /^.*innochecksum(\.exe)?/innochecksum/
--exec $INNOCHECKSUM -V $MYSQLD_DATADIR/test/t1.ibd
--echo # Restart the DB server
diff --git a/mysql-test/suite/innodb_zip/t/innodb-zip.test b/mysql-test/suite/innodb_zip/t/innodb-zip.test
index 507900aa..47867f3f 100644
--- a/mysql-test/suite/innodb_zip/t/innodb-zip.test
+++ b/mysql-test/suite/innodb_zip/t/innodb-zip.test
@@ -6,12 +6,12 @@ SELECT table_name, row_format, data_length, index_length
FROM information_schema.tables
WHERE table_schema='mysqltest_innodb_zip';
-let $per_table=`select @@innodb_file_per_table`;
SET @save_innodb_stats_on_metadata=@@global.innodb_stats_on_metadata;
--let $query_i_s = SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql' and table_schema != 'sys' order by table_name
set session innodb_strict_mode=0;
+SET @save_fpt=@@GLOBAL.innodb_file_per_table;
set global innodb_file_per_table=off;
SET @@global.innodb_stats_on_metadata=ON;
@@ -123,8 +123,6 @@ select count(*) from t1 where c4 = repeat('C', 20000);
update t1 set c3 = repeat('E', 20000) where c1 = 1;
drop table t1;
-set global innodb_file_per_table = on;
-
set innodb_strict_mode = off;
create table t1 (id int primary key) engine = innodb key_block_size = 0;
drop table t1;
@@ -254,9 +252,7 @@ drop table t7, t8, t9;
# restore environment to the state it was before this test execution
#
--- disable_query_log
-eval set global innodb_file_per_table=$per_table;
+SET GLOBAL innodb_file_per_table=@save_fpt;
SET @@global.innodb_stats_on_metadata=@save_innodb_stats_on_metadata;
---enable_query_log
DROP DATABASE mysqltest_innodb_zip;
diff --git a/mysql-test/suite/innodb_zip/t/large_blob.test b/mysql-test/suite/innodb_zip/t/large_blob.test
index dd208129..d8163737 100644
--- a/mysql-test/suite/innodb_zip/t/large_blob.test
+++ b/mysql-test/suite/innodb_zip/t/large_blob.test
@@ -7,9 +7,6 @@
--source include/big_test.inc
--disable_query_log
-# These values can change during the test
-let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
-
# Create a 20MB blob that does not compress easily.
# 1000 Random characters is enough to keep compression low.
set @alphabet="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
@@ -27,8 +24,6 @@ while ($1 > 1)
set @longblob=repeat(@blob,200000);
--enable_query_log
-call mtr.add_suppression("InnoDB: Warning: a long semaphore wait");
-
SET GLOBAL innodb_file_per_table = OFF;
--echo #
@@ -123,7 +118,3 @@ CREATE TABLE t1 (
INSERT INTO t1 VALUES (1, '');
UPDATE t1 SET c2=@longblob;
DROP TABLE t1;
-
---disable_query_log
-EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
---enable_query_log
diff --git a/mysql-test/suite/innodb_zip/t/page_size.test b/mysql-test/suite/innodb_zip/t/page_size.test
index 3455ef8e..ef8f8693 100644
--- a/mysql-test/suite/innodb_zip/t/page_size.test
+++ b/mysql-test/suite/innodb_zip/t/page_size.test
@@ -728,29 +728,6 @@ SHOW WARNINGS;
ROLLBACK;
DROP TABLE bug12547647;
-#
-# Bug #13336585 - INNODB: CHANGE BUFFERING WITH 4K PAGES CAN ASSERT
-# IF SECONDARY KEY IS NEAR MAX
-# If the secondary index tuple is close to half the page size,
-# ibuf_insert_low() could return DB_TOO_BIG_RECORD, which is not expected
-# in ibuf_insert(). In order to insure this does not happen, WL5756
-# imposes a maximum key length of 768 for 4k pages and 1536 for 8k pages.
-# The existing max key Size for 16k pages is 3072.
-#
-
-#-- disable_query_log
-# The flag innodb_change_buffering_debug is only available in debug builds.
-# It instructs InnoDB to try to evict pages from the buffer pool when
-# change buffering is possible, so that the change buffer will be used
-# whenever possible.
-# This flag is not used currently since it exposes valgrind error in ibuf
-# code with the following SQL
-#-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
-#SET @innodb_change_buffering_debug_orig = @@innodb_change_buffering_debug;
-#-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
-#SET GLOBAL innodb_change_buffering_debug = 1;
-#-- enable_query_log
-
# make sure the largest possible key entry can be added to the insert buffer.
# Make enough records so that the root page is not a leaf page.
SET SESSION innodb_strict_mode = OFF;
@@ -823,11 +800,6 @@ INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,
DELETE from t1;
DROP TABLE t1;
-#-- disable_query_log
-#-- error 0,ER_UNKNOWN_SYSTEM_VARIABLE
-#SET GLOBAL innodb_change_buffering_debug = 0;
-#-- enable_query_log
-
# The following should fail in non-strict mode too.
# (The fix of Bug #50945 only affects REDUNDANT and COMPACT tables.)
if ($INNODB_PAGE_SIZE == 4096)
diff --git a/mysql-test/suite/innodb_zip/t/prefix_index_liftedlimit.test b/mysql-test/suite/innodb_zip/t/prefix_index_liftedlimit.test
index 32d7eacd..de27ddce 100644
--- a/mysql-test/suite/innodb_zip/t/prefix_index_liftedlimit.test
+++ b/mysql-test/suite/innodb_zip/t/prefix_index_liftedlimit.test
@@ -722,11 +722,11 @@ SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
--connection con1
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
@@ -789,7 +789,7 @@ WHERE info='COMMIT';
--connection con1
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-select @@session.tx_isolation;
+select @@session.transaction_isolation;
SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
diff --git a/mysql-test/suite/innodb_zip/t/restart.test b/mysql-test/suite/innodb_zip/t/restart.test
index 0c8073b8..18c90eff 100644
--- a/mysql-test/suite/innodb_zip/t/restart.test
+++ b/mysql-test/suite/innodb_zip/t/restart.test
@@ -34,12 +34,8 @@ call mtr.add_suppression("\\[ERROR\\] InnoDB: The error means the system cannot
--disable_query_log
let $MYSQL_DATA_DIR= `select @@datadir`;
let $data_directory = DATA DIRECTORY='$MYSQL_TMP_DIR/alt_dir';
-
-let $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
--enable_query_log
-set global innodb_file_per_table=on;
-
--echo #
--echo # Create and insert records into a REDUNDANT row formatted table.
--echo #
@@ -181,7 +177,6 @@ SELECT count(*) FROM t7_restart;
--echo #
--source include/start_mysqld.inc
-SHOW VARIABLES LIKE 'innodb_file_per_table';
SHOW CREATE TABLE t1_restart;
SHOW CREATE TABLE t2_restart;
SHOW CREATE TABLE t3_restart;
@@ -274,8 +269,6 @@ SHOW CREATE TABLE t7_restart;
--echo #
--source include/start_mysqld.inc
-SHOW VARIABLES LIKE 'innodb_file_per_table';
-
--source suite/innodb/include/show_i_s_tablespaces.inc
SELECT count(*) FROM t5_restart;
@@ -364,7 +357,6 @@ SHOW CREATE TABLE t77_restart;
--echo # Restart the server
--echo #
--source include/restart_mysqld.inc
-SHOW VARIABLES LIKE 'innodb_file_per_table';
--source suite/innodb/include/show_i_s_tablespaces.inc
@@ -599,8 +591,3 @@ DROP TABLE t77_restart;
--rmdir $MYSQL_TMP_DIR/alt_dir
--rmdir $MYSQL_TMP_DIR/new_dir/test
--rmdir $MYSQL_TMP_DIR/new_dir
-
--- disable_query_log
-eval set global innodb_file_per_table=$innodb_file_per_table_orig;
--- enable_query_log
-
diff --git a/mysql-test/suite/innodb_zip/t/wl5522_debug_zip.test b/mysql-test/suite/innodb_zip/t/wl5522_debug_zip.test
index 47b53b71..97a1909a 100644
--- a/mysql-test/suite/innodb_zip/t/wl5522_debug_zip.test
+++ b/mysql-test/suite/innodb_zip/t/wl5522_debug_zip.test
@@ -226,21 +226,6 @@ do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test", "t1");
EOF
-# Test failure after ibuf check
-SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure";
-
-# Need proper mapping of error codes :-(
---error ER_NOT_KEYFILE
-ALTER TABLE t1 IMPORT TABLESPACE;
-
-SET SESSION debug_dbug=@saved_debug_dbug;
-
-# Restore files
-perl;
-do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
-ib_restore_tablespaces("test", "t1");
-EOF
-
# Test failure after adjusting the cluster index root page
SET SESSION debug_dbug="+d,ib_import_cluster_root_adjust_failure";
diff --git a/mysql-test/suite/innodb_zip/t/wl5522_zip.test b/mysql-test/suite/innodb_zip/t/wl5522_zip.test
index dbb698cc..f223d36a 100644
--- a/mysql-test/suite/innodb_zip/t/wl5522_zip.test
+++ b/mysql-test/suite/innodb_zip/t/wl5522_zip.test
@@ -83,7 +83,7 @@ ALTER TABLE t1 IMPORT TABLESPACE;
SELECT * FROM t1;
DROP TABLE t1;
-# Export/import on the same instance, with --innodb-file-per-table=1
+# Export/import on the same instance
CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
@@ -127,7 +127,7 @@ SELECT COUNT(*) FROM t1;
DROP TABLE t1;
-# Export/import on the same instance, with --innodb-file-per-table=1
+# Export/import on the same instance
# Insert some more records to move the LSN forward and then drop the
# table and restore
CREATE TABLE t1(
@@ -174,7 +174,7 @@ SELECT COUNT(*) FROM t1;
DROP TABLE t1;
-# Export/import on the same instance, with --innodb-file-per-table=1
+# Export/import on the same instance
# Insert some more records to move the LSN forward and then drop the
# table and restore, this time the table has a secondary index too.
CREATE TABLE t1(
@@ -217,7 +217,7 @@ SELECT COUNT(*) FROM t1 WHERE c2 = 1;
DROP TABLE t1;
-# Export/import on the same instance, with --innodb-file-per-table=1
+# Export/import on the same instance
# Insert some more records to move the LSN forward and then drop the
# table and restore, this time the table has a secondary index too.
# Rename the index on the create so that the IMPORT fails, drop index
diff --git a/mysql-test/suite/innodb_zip/t/wl6347_comp_indx_stat.test b/mysql-test/suite/innodb_zip/t/wl6347_comp_indx_stat.test
index be9a05b3..ae32b03a 100644
--- a/mysql-test/suite/innodb_zip/t/wl6347_comp_indx_stat.test
+++ b/mysql-test/suite/innodb_zip/t/wl6347_comp_indx_stat.test
@@ -20,7 +20,6 @@ let MYSQLD_DATADIR=`SELECT @@datadir`;
let $innodb_compression_level = `SELECT @@global.innodb_compression_level`;
--echo # set the flags
-SET GLOBAL innodb_file_per_table=on;
SET GLOBAL innodb_cmp_per_index_enabled=ON;
SET GLOBAL innodb_compression_level=0;
--disable_query_log
@@ -73,7 +72,6 @@ SET GLOBAL innodb_read_only_compressed=OFF;
--enable_query_log
--echo # set the flags
-SET GLOBAL innodb_file_per_table=on;
SET GLOBAL innodb_compression_level=0;
--echo # fetch the compressed page and check the stats
@@ -135,7 +133,6 @@ SET @inl_val=2;
SET GLOBAL innodb_cmp_per_index_enabled=ON;
--echo # set the flags
-SET GLOBAL innodb_file_per_table=on;
SET GLOBAL innodb_compression_level=0;
--echo # fetch the compressed page and check the stats
@@ -296,7 +293,6 @@ SET GLOBAL innodb_cmp_per_index_enabled=0;
SET GLOBAL innodb_cmp_per_index_enabled=1;
--echo # set the flags
-SET GLOBAL innodb_file_per_table=on;
SET GLOBAL innodb_compression_level=9;
@@ -345,7 +341,6 @@ SET @inl_val=2;
SET GLOBAL innodb_cmp_per_index_enabled=ON;
--echo # set the flags
-SET GLOBAL innodb_file_per_table=on;
SET GLOBAL innodb_compression_level=9;
@@ -413,7 +408,6 @@ SET @inl_val=2;
SET GLOBAL innodb_cmp_per_index_enabled=ON;
--echo # set the flags
-SET GLOBAL innodb_file_per_table=on;
SET GLOBAL innodb_compression_level=9;
@@ -801,7 +795,6 @@ SET GLOBAL innodb_cmp_per_index_enabled=ON;
--echo # check the flags
SELECT @@innodb_cmp_per_index_enabled;
SELECT @@innodb_compression_failure_threshold_pct;
-SELECT @@innodb_file_per_table;
SELECT @@innodb_compression_level;
--echo #******************************************************************
@@ -848,8 +841,6 @@ SET GLOBAL innodb_cmp_per_index_enabled=ON;
--echo # set the flags
SET GLOBAL innodb_compression_failure_threshold_pct=0;
-SET GLOBAL innodb_file_per_table=on;
-
--echo # fetch the compressed page and check the stats
--echo # The stats figure may be different/same for each restart.
@@ -1053,7 +1044,6 @@ SET GLOBAL innodb_cmp_per_index_enabled=OFF;
SET GLOBAL innodb_cmp_per_index_enabled=ON;
--echo # set the flags
-SET GLOBAL innodb_file_per_table=on;
SET GLOBAL innodb_cmp_per_index_enabled=ON;
SET GLOBAL innodb_compression_failure_threshold_pct=10;
SET GLOBAL innodb_compression_level=Default;
@@ -1062,7 +1052,6 @@ SET GLOBAL innodb_compression_level=Default;
--echo # check the flags
SELECT @@innodb_cmp_per_index_enabled;
SELECT @@innodb_compression_failure_threshold_pct;
-SELECT @@innodb_file_per_table;
SELECT @@innodb_compression_level;
--echo #******************************************************************
@@ -1109,9 +1098,6 @@ SET GLOBAL innodb_cmp_per_index_enabled=ON;
--echo # set the flags
SET GLOBAL innodb_compression_failure_threshold_pct=10;
-SET GLOBAL innodb_file_per_table=on;
-SET GLOBAL innodb_compression_failure_threshold_pct=10;
-
--echo # fetch the compressed page and check the stats
--echo # The stats figure may be different/same for each restart.
@@ -1312,7 +1298,6 @@ DROP TABLE tab5;
SET GLOBAL innodb_cmp_per_index_enabled=0;
SET GLOBAL innodb_cmp_per_index_enabled=1;
-SET GLOBAL innodb_file_per_table=ON;
SET GLOBAL innodb_compression_level=default;
SET GLOBAL innodb_compression_failure_threshold_pct=default;
@@ -1351,7 +1336,6 @@ DROP TABLE tab5, test.tab5;
DROP DATABASE sb;
--echo # reset the flags
-eval SET GLOBAL innodb_file_per_table=default;
eval SET GLOBAL innodb_cmp_per_index_enabled=default;
--disable_query_log
eval SET GLOBAL innodb_compression_level=$innodb_compression_level;
diff --git a/mysql-test/suite/json/r/json_table.result b/mysql-test/suite/json/r/json_table.result
index 44957352..ed385f86 100644
--- a/mysql-test/suite/json/r/json_table.result
+++ b/mysql-test/suite/json/r/json_table.result
@@ -211,12 +211,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "tt",
"access_type": "ALL",
+ "loops": 1,
"rows": 40,
+ "cost": "COST_REPLACED",
"filtered": 100,
"table_function": "json_table"
}
@@ -1143,3 +1146,104 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
#
# End of 10.9 tests
#
+#
+# MDEV-29390: Improve coverage for UPDATE and DELETE statements in MTR test suites
+#
+# Multi-update with JSON_TABLE
+create table t1 ( name varchar(10),
+color varchar(10),
+price decimal(8,2),
+instock BOOLEAN);
+insert into t1 values ("Laptop", "black", 20000, 1);
+insert into t1 values ("Jacket", "brown", 5000, 1);
+insert into t1 values ("Jeans", "blue", 5000, 1);
+select * from t1;
+name color price instock
+Laptop black 20000.00 1
+Jacket brown 5000.00 1
+Jeans blue 5000.00 1
+set @json='
+[
+ {"name":"Laptop", "color":"black", "price":"1000", "ordered":"3"},
+ {"name":"Jeans", "color":"blue", "ordered":"0"},
+ {"name":"Phone", "color":"red", "ordered":"0"}
+]';
+select * from json_table(@json, '$[*]'
+columns(
+name varchar(10) path '$.name',
+color varchar(10) path '$.color',
+price decimal(8,2) path '$.price',
+ordered boolean path '$.ordered' )
+) as jt;
+name color price ordered
+Laptop black 1000.00 3
+Jeans blue NULL 0
+Phone red NULL 0
+explain update t1, JSON_TABLE(@json,'$[*]'
+COLUMNS (
+name varchar(10) path '$.name',
+color varchar(10) path '$.color',
+price decimal(8,2) path '$.price',
+ordered boolean path '$.ordered'
+ )) AS jt1
+SET t1.instock=0 where t1.name=jt1.name and jt1.ordered=3;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3
+1 SIMPLE jt1 ALL NULL NULL NULL NULL 40 Table function: json_table; Using where
+update t1, JSON_TABLE(@json,'$[*]'
+COLUMNS (
+name varchar(10) path '$.name',
+color varchar(10) path '$.color',
+price decimal(8,2) path '$.price',
+ordered boolean path '$.ordered'
+ )) AS jt1
+SET t1.instock=0 where t1.name=jt1.name and jt1.ordered=2;
+select * from t1;
+name color price instock
+Laptop black 20000.00 1
+Jacket brown 5000.00 1
+Jeans blue 5000.00 1
+explain update t1
+SET t1.instock=2 where t1.name in (
+select jt1.name from json_table(@json, '$[*]'
+columns(
+name varchar(10) path '$.name',
+color varchar(10) path '$.color',
+price decimal(8,2) path '$.price',
+ordered boolean path '$.ordered' )
+) as jt1);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 3
+1 PRIMARY jt1 ALL NULL NULL NULL NULL 40 Table function: json_table; Using where; FirstMatch(t1)
+update t1
+SET t1.instock=2 where t1.name in (
+select jt1.name from json_table(@json, '$[*]'
+columns(
+name varchar(10) path '$.name',
+color varchar(10) path '$.color',
+price decimal(8,2) path '$.price',
+ordered boolean path '$.ordered' )
+) as jt1);
+select * from t1;
+name color price instock
+Laptop black 20000.00 2
+Jacket brown 5000.00 1
+Jeans blue 5000.00 2
+update t1, JSON_TABLE(@json,'$[*]'
+COLUMNS (
+name varchar(10) path '$.name',
+color varchar(10) path '$.color',
+price decimal(8,2) path '$.price',
+ordered boolean path '$.ordered'
+ )) AS jt1
+SET t1.instock=0, jt1.ordered=1 where t1.name=jt1.name;
+ERROR HY000: The target table jt1 of the UPDATE is not updatable
+select * from t1;
+name color price instock
+Laptop black 20000.00 2
+Jacket brown 5000.00 1
+Jeans blue 5000.00 2
+drop table t1;
+#
+# End of 11.0 tests
+#
diff --git a/mysql-test/suite/json/r/json_table_mysql.result b/mysql-test/suite/json/r/json_table_mysql.result
index 2357d9d3..0be40a8a 100644
--- a/mysql-test/suite/json/r/json_table_mysql.result
+++ b/mysql-test/suite/json/r/json_table_mysql.result
@@ -189,12 +189,15 @@ EXPLAIN
{
"query_block": {
"select_id": 1,
+ "cost": "COST_REPLACED",
"nested_loop": [
{
"table": {
"table_name": "tt",
"access_type": "ALL",
+ "loops": 1,
"rows": 40,
+ "cost": "COST_REPLACED",
"filtered": 100,
"table_function": "json_table"
}
@@ -530,8 +533,7 @@ EXPLAIN SELECT * FROM t1 WHERE id IN
(id INT PATH '$')) AS jt);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
-1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
-2 MATERIALIZED jt ALL NULL NULL NULL NULL 40 Table function: json_table
+1 PRIMARY jt ALL NULL NULL NULL NULL 40 Table function: json_table; Using where; FirstMatch(t1); Using join buffer (flat, BNL join)
DROP TABLE t1;
SELECT * FROM JSON_TABLE('"asdf"', '$' COLUMNS(
tm TIME PATH '$',
diff --git a/mysql-test/suite/json/t/json_table.test b/mysql-test/suite/json/t/json_table.test
index 05db8f66..5a8fe984 100644
--- a/mysql-test/suite/json/t/json_table.test
+++ b/mysql-test/suite/json/t/json_table.test
@@ -69,6 +69,7 @@ insert into t1 select * from t1;
set @save_optimizer_switch=@@optimizer_switch;
set optimizer_switch='firstmatch=off';
+--sorted_result
select * from
json_table('[{"color": "blue", "price": 50},
{"color": "red", "price": 100}]',
@@ -144,6 +145,7 @@ create view v2 as select * from json_table('[{"co\\\\lor": "blue", "price": 50
select * from v2;
drop view v2;
+--source include/explain-no-costs.inc
explain format=json select * from
json_table('[{"a": 1, "b": [11,111]}, {"a": 2, "b": [22,222]}]', '$[*]' COLUMNS( a INT PATH '$.a')) as tt;
explain select * from
@@ -995,3 +997,97 @@ COLUMNS
--echo #
--echo # End of 10.9 tests
--echo #
+
+--echo #
+--echo # MDEV-29390: Improve coverage for UPDATE and DELETE statements in MTR test suites
+--echo #
+
+--echo # Multi-update with JSON_TABLE
+
+create table t1 ( name varchar(10),
+ color varchar(10),
+ price decimal(8,2),
+ instock BOOLEAN);
+
+insert into t1 values ("Laptop", "black", 20000, 1);
+insert into t1 values ("Jacket", "brown", 5000, 1);
+insert into t1 values ("Jeans", "blue", 5000, 1);
+
+select * from t1;
+
+set @json='
+[
+ {"name":"Laptop", "color":"black", "price":"1000", "ordered":"3"},
+ {"name":"Jeans", "color":"blue", "ordered":"0"},
+ {"name":"Phone", "color":"red", "ordered":"0"}
+]';
+
+select * from json_table(@json, '$[*]'
+ columns(
+ name varchar(10) path '$.name',
+ color varchar(10) path '$.color',
+ price decimal(8,2) path '$.price',
+ ordered boolean path '$.ordered' )
+) as jt;
+
+explain update t1, JSON_TABLE(@json,'$[*]'
+ COLUMNS (
+ name varchar(10) path '$.name',
+ color varchar(10) path '$.color',
+ price decimal(8,2) path '$.price',
+ ordered boolean path '$.ordered'
+ )) AS jt1
+ SET t1.instock=0 where t1.name=jt1.name and jt1.ordered=3;
+
+update t1, JSON_TABLE(@json,'$[*]'
+ COLUMNS (
+ name varchar(10) path '$.name',
+ color varchar(10) path '$.color',
+ price decimal(8,2) path '$.price',
+ ordered boolean path '$.ordered'
+ )) AS jt1
+ SET t1.instock=0 where t1.name=jt1.name and jt1.ordered=2;
+
+select * from t1;
+
+explain update t1
+ SET t1.instock=2 where t1.name in (
+ select jt1.name from json_table(@json, '$[*]'
+ columns(
+ name varchar(10) path '$.name',
+ color varchar(10) path '$.color',
+ price decimal(8,2) path '$.price',
+ ordered boolean path '$.ordered' )
+ ) as jt1);
+
+
+update t1
+ SET t1.instock=2 where t1.name in (
+ select jt1.name from json_table(@json, '$[*]'
+ columns(
+ name varchar(10) path '$.name',
+ color varchar(10) path '$.color',
+ price decimal(8,2) path '$.price',
+ ordered boolean path '$.ordered' )
+ ) as jt1);
+
+select * from t1;
+
+
+-- error ER_NON_UPDATABLE_TABLE
+update t1, JSON_TABLE(@json,'$[*]'
+ COLUMNS (
+ name varchar(10) path '$.name',
+ color varchar(10) path '$.color',
+ price decimal(8,2) path '$.price',
+ ordered boolean path '$.ordered'
+ )) AS jt1
+ SET t1.instock=0, jt1.ordered=1 where t1.name=jt1.name;
+
+select * from t1;
+
+drop table t1;
+
+--echo #
+--echo # End of 11.0 tests
+--echo #
diff --git a/mysql-test/suite/json/t/json_table_mysql.test b/mysql-test/suite/json/t/json_table_mysql.test
index 9f77ad96..3b0fb556 100644
--- a/mysql-test/suite/json/t/json_table_mysql.test
+++ b/mysql-test/suite/json/t/json_table_mysql.test
@@ -167,6 +167,7 @@ select * from
#eval $query;
#eval explain $query;
+--source include/explain-no-costs.inc
explain format=json
select * from
json_table(
diff --git a/mysql-test/suite/maria/crash-recursive.result b/mysql-test/suite/maria/crash-recursive.result
new file mode 100644
index 00000000..998bb9e5
--- /dev/null
+++ b/mysql-test/suite/maria/crash-recursive.result
@@ -0,0 +1,53 @@
+set @save_big_tables=@@big_tables;
+set big_tables=1;
+Warnings:
+Warning 1287 '@@big_tables' is deprecated and will be removed in a future release
+create table folks(id int, name char(32), dob date, father int, mother int);
+insert into folks values
+(100, 'Me', '2000-01-01', 20, 30),
+(20, 'Dad', '1970-02-02', 10, 9),
+(30, 'Mom', '1975-03-03', 8, 7),
+(10, 'Grandpa Bill', '1940-04-05', null, null),
+(9, 'Grandma Ann', '1941-10-15', null, null),
+(25, 'Uncle Jim', '1968-11-18', 8, 7),
+(98, 'Sister Amy', '2001-06-20', 20, 30),
+(7, 'Grandma Sally', '1943-08-23', null, 6),
+(8, 'Grandpa Ben', '1940-10-21', null, null),
+(6, 'Grandgrandma Martha', '1923-05-17', null, null),
+(67, 'Cousin Eddie', '1992-02-28', 25, 27),
+(27, 'Auntie Melinda', '1971-03-29', null, null);
+call mtr.add_suppression(".*marked as crashed.*");
+SET @saved_dbug= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,ha_rnd_next_error";
+SET @ha_rnd_next_error_counter=110;
+with recursive
+ancestor_couples(h_id, h_name, h_dob, h_father, h_mother,
+w_id, w_name, w_dob, w_father, w_mother)
+as
+(
+select h.*, w.*
+from folks h, folks w, coupled_ancestors a
+where a.father = h.id AND a.mother = w.id
+union
+select h.*, w.*
+from folks v, folks h, folks w
+where v.name = 'Me' and
+(v.father = h.id AND v.mother= w.id)
+),
+coupled_ancestors (id, name, dob, father, mother)
+as
+(
+select h_id, h_name, h_dob, h_father, h_mother
+from ancestor_couples
+union
+select w_id, w_name, w_dob, w_father, w_mother
+from ancestor_couples
+)
+select h_name, h_dob, w_name, w_dob
+from ancestor_couples;
+ERROR HY000: Table '(temporary)' is marked as crashed and should be repaired
+drop table folks;
+set big_tables=@save_big_tables;
+Warnings:
+Warning 1287 '@@big_tables' is deprecated and will be removed in a future release
+SET @@SESSION.debug_dbug=@saved_dbug;
diff --git a/mysql-test/suite/maria/crash-recursive.test b/mysql-test/suite/maria/crash-recursive.test
new file mode 100644
index 00000000..1fa18ce8
--- /dev/null
+++ b/mysql-test/suite/maria/crash-recursive.test
@@ -0,0 +1,67 @@
+#
+# This test simulates an error in an aria file discovered during a recursive SQL call.
+# The error handling causes used join structures to be deleted, which caused crashes in
+# upper levels when trying to access structures that does not exist anymore
+#
+
+--source include/have_debug_sync.inc
+--source include/not_embedded.inc
+
+set @save_big_tables=@@big_tables;
+set big_tables=1;
+
+create table folks(id int, name char(32), dob date, father int, mother int);
+
+insert into folks values
+(100, 'Me', '2000-01-01', 20, 30),
+(20, 'Dad', '1970-02-02', 10, 9),
+(30, 'Mom', '1975-03-03', 8, 7),
+(10, 'Grandpa Bill', '1940-04-05', null, null),
+(9, 'Grandma Ann', '1941-10-15', null, null),
+(25, 'Uncle Jim', '1968-11-18', 8, 7),
+(98, 'Sister Amy', '2001-06-20', 20, 30),
+(7, 'Grandma Sally', '1943-08-23', null, 6),
+(8, 'Grandpa Ben', '1940-10-21', null, null),
+(6, 'Grandgrandma Martha', '1923-05-17', null, null),
+(67, 'Cousin Eddie', '1992-02-28', 25, 27),
+(27, 'Auntie Melinda', '1971-03-29', null, null);
+
+
+call mtr.add_suppression(".*marked as crashed.*");
+SET @saved_dbug= @@SESSION.debug_dbug;
+SET SESSION debug_dbug="+d,ha_rnd_next_error";
+SET @ha_rnd_next_error_counter=110;
+
+let q=
+with recursive
+ancestor_couples(h_id, h_name, h_dob, h_father, h_mother,
+ w_id, w_name, w_dob, w_father, w_mother)
+as
+(
+ select h.*, w.*
+ from folks h, folks w, coupled_ancestors a
+ where a.father = h.id AND a.mother = w.id
+ union
+ select h.*, w.*
+ from folks v, folks h, folks w
+ where v.name = 'Me' and
+ (v.father = h.id AND v.mother= w.id)
+),
+coupled_ancestors (id, name, dob, father, mother)
+as
+(
+ select h_id, h_name, h_dob, h_father, h_mother
+ from ancestor_couples
+ union
+ select w_id, w_name, w_dob, w_father, w_mother
+ from ancestor_couples
+)
+select h_name, h_dob, w_name, w_dob
+ from ancestor_couples;
+
+--error ER_CRASHED_ON_USAGE
+eval $q;
+drop table folks;
+
+set big_tables=@save_big_tables;
+SET @@SESSION.debug_dbug=@saved_dbug; \ No newline at end of file
diff --git a/mysql-test/suite/maria/icp.result b/mysql-test/suite/maria/icp.result
index d65cadf7..ea546b5c 100644
--- a/mysql-test/suite/maria/icp.result
+++ b/mysql-test/suite/maria/icp.result
@@ -409,7 +409,7 @@ WHERE (pk BETWEEN 4 AND 5 OR pk < 2) AND c1 < 240
ORDER BY c1
LIMIT 1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range PRIMARY,k1 PRIMARY 4 NULL 3 Using index condition; Using where; Rowid-ordered scan; Using filesort
+1 SIMPLE t1 range PRIMARY,k1 k1 5 NULL 4 Using index condition; Using where
DROP TABLE t1;
#
#
@@ -456,9 +456,10 @@ c1 INT NOT NULL,
PRIMARY KEY (pk)
);
INSERT INTO t1 VALUES (1,9),(2,7),(3,6),(4,3),(5,1);
+insert into t1 select seq,seq from seq_100_to_110;
EXPLAIN SELECT pk, c1 FROM t1 WHERE (pk<3 or pk>3);
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 5 Using where
+1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 16 Using index condition; Rowid-ordered scan
SET SESSION optimizer_switch='index_condition_pushdown=off';
SELECT pk, c1 FROM t1 WHERE (pk<3 or pk>3);
pk c1
@@ -466,6 +467,17 @@ pk c1
2 7
4 3
5 1
+100 100
+101 101
+102 102
+103 103
+104 104
+105 105
+106 106
+107 107
+108 108
+109 109
+110 110
DROP TABLE t1;
set optimizer_switch= @save_optimizer_switch;
#
@@ -683,7 +695,6 @@ DROP TABLE t1;
#
CREATE TABLE t1 (b int NOT NULL, c int, a varchar(1024), PRIMARY KEY (b));
INSERT INTO t1 VALUES (1,4,'Ill');
-insert into t1 select seq+100,5,seq from seq_1_to_100;
CREATE TABLE t2 (a varchar(1024), KEY (a(512)));
INSERT INTO t2 VALUES
('Ill'), ('eckqzsflbzaffti'), ('w'), ('she'), ('gxbwypqtjzwywwer'), ('w');
@@ -699,8 +710,8 @@ EXPLAIN
SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0)
HAVING t1.c != 5 ORDER BY t1.c;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL # Using where; Using filesort
-1 SIMPLE t2 ref a a 515 test.t1.a # Using where
+1 SIMPLE t1 system PRIMARY NULL NULL NULL #
+1 SIMPLE t2 ref a a 515 const # Using where
SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0)
HAVING t1.c != 5 ORDER BY t1.c;
b c
@@ -710,8 +721,8 @@ EXPLAIN
SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0)
HAVING t1.c != 5 ORDER BY t1.c;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL PRIMARY NULL NULL NULL # Using where; Using filesort
-1 SIMPLE t2 ref a a 515 test.t1.a # Using where
+1 SIMPLE t1 system PRIMARY NULL NULL NULL #
+1 SIMPLE t2 ref a a 515 const # Using where
SELECT t1.b, t1.c FROM t1, t2 WHERE t1.a = t2.a AND (t1.b<0 OR t1.b>0)
HAVING t1.c != 5 ORDER BY t1.c;
b c
@@ -823,6 +834,8 @@ test.t2 analyze status Engine-independent statistics collected
test.t2 analyze status Table is already up to date
SET @save_optimize_switch=@@optimizer_switch;
SET optimizer_switch='materialization=on';
+set @save_optimizer_where_cost=@@optimizer_where_cost;
+set @@optimizer_where_cost=1;
EXPLAIN
SELECT COUNT(*) FROM t1 AS t, t2
WHERE c = g
@@ -846,6 +859,7 @@ OR a = 0 AND h < 'z' );
COUNT(*)
1478
SET optimizer_switch=@save_optimizer_switch;
+set @@optimizer_where_cost=@save_optimizer_where_cost;
DROP TABLE t1,t2;
# check "Handler_pushed" status varuiables
CREATE TABLE t1 (
diff --git a/mysql-test/suite/maria/mrr.result b/mysql-test/suite/maria/mrr.result
index 066f1a50..de468512 100644
--- a/mysql-test/suite/maria/mrr.result
+++ b/mysql-test/suite/maria/mrr.result
@@ -365,8 +365,8 @@ SELECT COUNT(t1.v) FROM t1, t2 IGNORE INDEX (idx), t3 IGNORE INDEX (idx)
WHERE t3.v = t2.v AND t3.i < t2.i AND t3.pk > 0 AND t2.pk > 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL idx 7 NULL 15 Using index
-1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 16 Using where; Using join buffer (flat, BNL join)
-1 SIMPLE t3 ALL PRIMARY NULL NULL NULL 25 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 16 Using index condition; Using where; Rowid-ordered scan; Using join buffer (flat, BNL join)
+1 SIMPLE t3 range PRIMARY PRIMARY 4 NULL 25 Using index condition; Using where; Rowid-ordered scan; Using join buffer (flat, BNL join)
SELECT COUNT(t1.v) FROM t1, t2, t3
WHERE t3.v = t2.v AND t3.i < t2.i AND t3.pk > 0 AND t2.pk > 0;
COUNT(t1.v)
@@ -375,9 +375,9 @@ EXPLAIN
SELECT COUNT(t1.v) FROM t1, t2, t3
WHERE t3.v = t2.v AND t3.i < t2.i AND t3.pk > 0 AND t2.pk > 0;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL idx 7 NULL 15 Using index
-1 SIMPLE t2 ALL PRIMARY,idx NULL NULL NULL 16 Using where; Using join buffer (flat, BNL join)
+1 SIMPLE t2 range PRIMARY,idx PRIMARY 4 NULL 16 Using index condition; Rowid-ordered scan
1 SIMPLE t3 ref PRIMARY,idx idx 3 test.t2.v 2 Using index condition; Using where
+1 SIMPLE t1 index NULL idx 7 NULL 15 Using index; Using join buffer (flat, BNL join)
set join_cache_level=@save_join_cache_level;
DROP TABLE t1,t2,t3;
#
@@ -405,7 +405,7 @@ WHERE
table1.col_varchar_1024_latin1_key = table2.col_varchar_10_latin1 AND table1.pk<>0 ;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE table2 ALL NULL NULL NULL NULL 2 Using where
-1 SIMPLE table1 ref PRIMARY,col_varchar_1024_latin1_key col_varchar_1024_latin1_key 1027 test.table2.col_varchar_10_latin1 2 Using index condition(BKA); Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
+1 SIMPLE table1 ref PRIMARY,col_varchar_1024_latin1_key col_varchar_1024_latin1_key 1027 test.table2.col_varchar_10_latin1 1 Using index condition(BKA); Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan
SELECT count(*)
FROM t1 AS table1, t2 AS table2
WHERE
diff --git a/mysql-test/suite/mariabackup/backup_ssl.result b/mysql-test/suite/mariabackup/backup_ssl.result
index 099b8d42..3598c27b 100644
--- a/mysql-test/suite/mariabackup/backup_ssl.result
+++ b/mysql-test/suite/mariabackup/backup_ssl.result
@@ -7,3 +7,11 @@ FLUSH PRIVILEGES;
# xtrabackup move back
# restart
DROP USER backup_user;
+#
+# MDEV-31855 validate ssl certificates using client password in the internal client
+#
+# tcp ssl ssl-verify-server-cert
+#
+# MDEV-32473 --disable-ssl doesn't disable it
+#
+# tcp skip-ssl
diff --git a/mysql-test/suite/mariabackup/backup_ssl.test b/mysql-test/suite/mariabackup/backup_ssl.test
index b38073cf..c38efc88 100644
--- a/mysql-test/suite/mariabackup/backup_ssl.test
+++ b/mysql-test/suite/mariabackup/backup_ssl.test
@@ -14,3 +14,18 @@ exec $XTRABACKUP --prepare --target-dir=$targetdir;
DROP USER backup_user;
rmdir $targetdir;
+echo #;
+echo # MDEV-31855 validate ssl certificates using client password in the internal client;
+echo #;
+# fails to connect, passwordless root
+echo # tcp ssl ssl-verify-server-cert;
+error 1;
+exec $XTRABACKUP --protocol=tcp --user=root --port=$MASTER_MYPORT --backup --target-dir=$targetdir;
+
+--echo #
+--echo # MDEV-32473 --disable-ssl doesn't disable it
+--echo #
+# connects fine
+echo # tcp skip-ssl;
+exec $XTRABACKUP --protocol=tcp --user=root --skip-ssl --port=$MASTER_MYPORT --backup --target-dir=$targetdir;
+rmdir $targetdir;
diff --git a/mysql-test/suite/mariabackup/backup_ssl_not_win.result b/mysql-test/suite/mariabackup/backup_ssl_not_win.result
new file mode 100644
index 00000000..42376fce
--- /dev/null
+++ b/mysql-test/suite/mariabackup/backup_ssl_not_win.result
@@ -0,0 +1,4 @@
+#
+# MDEV-31855 validate ssl certificates using client password in the internal client
+#
+# socket ssl ssl-verify-server-cert
diff --git a/mysql-test/suite/mariabackup/backup_ssl_not_win.test b/mysql-test/suite/mariabackup/backup_ssl_not_win.test
new file mode 100644
index 00000000..933d434f
--- /dev/null
+++ b/mysql-test/suite/mariabackup/backup_ssl_not_win.test
@@ -0,0 +1,10 @@
+source include/not_windows.inc;
+let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+
+echo #;
+echo # MDEV-31855 validate ssl certificates using client password in the internal client;
+echo #;
+# connects fine, unix socket is a secure transport
+echo # socket ssl ssl-verify-server-cert;
+exec $XTRABACKUP --protocol=socket --user=root --socket=$MASTER_MYSOCK --backup --target-dir=$targetdir;
+rmdir $targetdir;
diff --git a/mysql-test/suite/mariabackup/compat_xtrabackup.result b/mysql-test/suite/mariabackup/compat_xtrabackup.result
new file mode 100644
index 00000000..484dc0d7
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compat_xtrabackup.result
@@ -0,0 +1,21 @@
+call mtr.add_suppression("InnoDB: New log files created");
+#
+# Start of 10.11 tests
+#
+#
+# MDEV-18931 Rename Mariabackup's xtrabackup_* files to mariadb_backup_*
+#
+CREATE TABLE t1(i INT PRIMARY KEY) ENGINE MYISAM;
+INSERT INTO t1 VALUES (1);
+# Prepare full backup, apply incremental one
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart
+SELECT * FROM test.t1;
+i
+1
+DROP TABLE t1;
+#
+# End of 10.11 tests
+#
diff --git a/mysql-test/suite/mariabackup/compat_xtrabackup.test b/mysql-test/suite/mariabackup/compat_xtrabackup.test
new file mode 100644
index 00000000..67d043fd
--- /dev/null
+++ b/mysql-test/suite/mariabackup/compat_xtrabackup.test
@@ -0,0 +1,62 @@
+call mtr.add_suppression("InnoDB: New log files created");
+
+--echo #
+--echo # Start of 10.11 tests
+--echo #
+
+--echo #
+--echo # MDEV-18931 Rename Mariabackup's xtrabackup_* files to mariadb_backup_*
+--echo #
+
+--let $basedir=$MYSQLTEST_VARDIR/tmp/backup
+--let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1
+
+CREATE TABLE t1(i INT PRIMARY KEY) ENGINE MYISAM;
+INSERT INTO t1 VALUES (1);
+
+--disable_result_log
+--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir
+--enable_result_log
+
+--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir
+
+#
+# Emulate a backup created by an older version:
+# Rename mariadb_backup_checkpoints
+#
+
+--move_file $basedir/mariadb_backup_checkpoints $basedir/xtrabackup_checkpoints
+--move_file $incremental_dir/mariadb_backup_checkpoints $incremental_dir/xtrabackup_checkpoints
+
+#
+# Emulate a backup created by an older version:
+# Rename mariadb_backup_info
+# Note, mariadb_backup_info is not currently used during --prepare or --restore
+# But it's still good to rename it:
+# - we can start using it during --prepare or --restore
+# - to provide full emulation
+#
+
+--move_file $basedir/mariadb_backup_info $basedir/mariadb_backup_info
+--move_file $incremental_dir/mariadb_backup_info $incremental_dir/mariadb_backup_info
+
+
+--disable_result_log
+--echo # Prepare full backup, apply incremental one
+--exec $XTRABACKUP --prepare --target-dir=$basedir
+--exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir
+--enable_result_log
+
+--let $targetdir=$basedir
+--source include/restart_and_restore.inc
+--enable_result_log
+
+SELECT * FROM test.t1;
+
+DROP TABLE t1;
+--rmdir $basedir
+--rmdir $incremental_dir
+
+--echo #
+--echo # End of 10.11 tests
+--echo #
diff --git a/mysql-test/suite/mariabackup/extra_lsndir.result b/mysql-test/suite/mariabackup/extra_lsndir.result
index a25c45a1..58e395eb 100644
--- a/mysql-test/suite/mariabackup/extra_lsndir.result
+++ b/mysql-test/suite/mariabackup/extra_lsndir.result
@@ -1,2 +1,2 @@
-xtrabackup_checkpoints
-xtrabackup_info
+mariadb_backup_checkpoints
+mariadb_backup_info
diff --git a/mysql-test/suite/mariabackup/extra_lsndir_stream.result b/mysql-test/suite/mariabackup/extra_lsndir_stream.result
index a25c45a1..58e395eb 100644
--- a/mysql-test/suite/mariabackup/extra_lsndir_stream.result
+++ b/mysql-test/suite/mariabackup/extra_lsndir_stream.result
@@ -1,2 +1,2 @@
-xtrabackup_checkpoints
-xtrabackup_info
+mariadb_backup_checkpoints
+mariadb_backup_info
diff --git a/mysql-test/suite/mariabackup/include/show_xtrabackup_slave_info.inc b/mysql-test/suite/mariabackup/include/show_xtrabackup_slave_info.inc
index 4a83c9c3..ba0116a8 100644
--- a/mysql-test/suite/mariabackup/include/show_xtrabackup_slave_info.inc
+++ b/mysql-test/suite/mariabackup/include/show_xtrabackup_slave_info.inc
@@ -1,8 +1,8 @@
--disable_query_log
---file_exists $targetdir/xtrabackup_slave_info
+--file_exists $targetdir/mariadb_backup_slave_info
CREATE TEMPORARY TABLE tmp_slave_info(lineno SERIAL, line TEXT);
--replace_result $targetdir TARGETDIR
---eval LOAD DATA LOCAL INFILE '$targetdir/xtrabackup_slave_info' INTO TABLE tmp_slave_info (line);
+--eval LOAD DATA LOCAL INFILE '$targetdir/mariadb_backup_slave_info' INTO TABLE tmp_slave_info (line);
SELECT
lineno,
regexp_replace(
diff --git a/mysql-test/suite/mariabackup/incremental_compressed.test b/mysql-test/suite/mariabackup/incremental_compressed.test
index 15aff909..ebb1fada 100644
--- a/mysql-test/suite/mariabackup/incremental_compressed.test
+++ b/mysql-test/suite/mariabackup/incremental_compressed.test
@@ -12,11 +12,11 @@ let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1;
CREATE TABLE t (pk INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
---exec $XTRABACKUP --backup --target-dir=$basedir --protocol=tcp --port=$MASTER_MYPORT --user=root
+--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$basedir --protocol=tcp --port=$MASTER_MYPORT --user=root
ALTER TABLE t PARTITION BY KEY(pk);
---exec $XTRABACKUP --backup --target-dir=$incremental_dir --incremental-basedir=$basedir --protocol=tcp --port=$MASTER_MYPORT --user=root > $incremental_dir.log 2>&1
+--exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$incremental_dir --incremental-basedir=$basedir --protocol=tcp --port=$MASTER_MYPORT --user=root > $incremental_dir.log 2>&1
--exec $XTRABACKUP --prepare --target-dir=$basedir --user=root > $MYSQL_TMP_DIR/backup_prepare_0.log 2>&1
--exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir --user=root > $MYSQL_TMP_DIR/backup_prepare_1.log
--cat_file $MYSQL_TMP_DIR/backup_prepare_1.log
diff --git a/mysql-test/suite/mariabackup/innodb_force_recovery.result b/mysql-test/suite/mariabackup/innodb_force_recovery.result
index 6626bb0b..8e785f3a 100644
--- a/mysql-test/suite/mariabackup/innodb_force_recovery.result
+++ b/mysql-test/suite/mariabackup/innodb_force_recovery.result
@@ -8,6 +8,14 @@ FOUND 1 /should only be used with "--apply-log"/ in backup.log
FOUND 1 /innodb_force_recovery = 1/ in backup.log
# "innodb_force_recovery" should be limited to "SRV_FORCE_IGNORE_CORRUPT" (innobackupex)
FOUND 1 /innodb_force_recovery = 1/ in backup.log
+#
+# This fragment was added for MDEV-31505 Deprecate mariabackup --innobackupex mode
+#
+NOT FOUND /Deprecated program name/ in backup.log
+FOUND 1 /[-][-]innobackupex.*is deprecated and will be removed in a future release/ in backup.log
+#
+# End of the MDEV-31505 fragment
+#
# "innodb_force_recovery" should be read from "backup-my.cnf" (mariabackup)
FOUND 1 /innodb_force_recovery = 1/ in backup.log
# "innodb_force_recovery=1" should be read from "backup-my.cnf" (innobackupex)
diff --git a/mysql-test/suite/mariabackup/innodb_force_recovery.test b/mysql-test/suite/mariabackup/innodb_force_recovery.test
index 3a7b3c61..91b916a2 100644
--- a/mysql-test/suite/mariabackup/innodb_force_recovery.test
+++ b/mysql-test/suite/mariabackup/innodb_force_recovery.test
@@ -52,6 +52,16 @@ exec $XTRABACKUP --innobackupex --apply-log --innodb-force-recovery=2 $targetdir
--let SEARCH_PATTERN=innodb_force_recovery = 1
--let SEARCH_FILE=$backuplog
--source include/search_pattern_in_file.inc
+--echo #
+--echo # This fragment was added for MDEV-31505 Deprecate mariabackup --innobackupex mode
+--echo #
+--let SEARCH_PATTERN=Deprecated program name
+--source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=[-][-]innobackupex.*is deprecated and will be removed in a future release
+--source include/search_pattern_in_file.inc
+--echo #
+--echo # End of the MDEV-31505 fragment
+--echo #
rmdir $targetdir;
# Check for default file ("backup-my.cnf").
diff --git a/mysql-test/suite/mariabackup/mdev-14447.result b/mysql-test/suite/mariabackup/mdev-14447.result
index 16d3ab56..5db4693d 100644
--- a/mysql-test/suite/mariabackup/mdev-14447.result
+++ b/mysql-test/suite/mariabackup/mdev-14447.result
@@ -1,5 +1,7 @@
call mtr.add_suppression("InnoDB: New log files created");
SET GLOBAL innodb_file_per_table=0;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
CREATE TABLE t(a varchar(40) PRIMARY KEY, b varchar(40), c varchar(40), d varchar(40), index(b,c,d)) ENGINE INNODB;
# Create full backup , modify table, then create incremental/differential backup
SET debug_dbug='+d,skip_page_checksum',foreign_key_checks=0,unique_checks=0;
diff --git a/mysql-test/suite/mariabackup/rpl_clone_slave.result b/mysql-test/suite/mariabackup/rpl_clone_slave.result
index 2e6c2701..fc6390eb 100644
--- a/mysql-test/suite/mariabackup/rpl_clone_slave.result
+++ b/mysql-test/suite/mariabackup/rpl_clone_slave.result
@@ -45,13 +45,13 @@ connection master;
connection slave;
##############################################################
### Running `mariadb-backup --backup,--prepare` and checking
-### that xtrabackup_slave_info and xtrabackup_binlog_info are OK
+### that mariadb_backup_slave_info and mariadb_backup_binlog_info are OK
### Slave: Create a backup
### Slave: Prepare the backup
### Slave: xtrabackup files:
-############################ xtrabackup_slave_info
+############################ mariadb_backup_slave_info
CHANGE MASTER TO MASTER_LOG_FILE='master_after_tr01_show_master_status_file', MASTER_LOG_POS=master_after_tr01_show_master_status_position;
-############################ xtrabackup_binlog_info
+############################ mariadb_backup_binlog_info
slave_after_tr01_show_master_status_file slave_after_tr01_show_master_status_position slave_after_tr01_gtid_binlog_pos
############################
##############################################################
@@ -135,8 +135,8 @@ tr#01:stmt#00 - slave run#0, before backup
tr#01:stmt#01 - slave run#0, before backup
tr#01:stmt#02 - slave run#0, before backup
### Slave: Execute the CHANGE MASTER statement to set up the host and port
-CHANGE MASTER '' TO MASTER_USER='root', MASTER_HOST='127.0.0.1', MASTER_PORT=###, MASTER_CONNECT_RETRY=1;
-### Slave: Execute the CHANGE MASTER statement from xtrabackup_slave_info
+CHANGE MASTER '' TO MASTER_USER='root', MASTER_HOST='127.0.0.1', MASTER_PORT=###, MASTER_CONNECT_RETRY=1, MASTER_SSL_VERIFY_SERVER_CERT=0;
+### Slave: Execute the CHANGE MASTER statement from mariadb_backup_slave_info
CHANGE MASTER TO MASTER_LOG_FILE='master_after_tr01_show_master_status_file', MASTER_LOG_POS=master_after_tr01_show_master_status_position;
Warnings:
Note 4190 CHANGE MASTER TO is implicitly changing the value of 'Using_Gtid' from 'Slave_Pos' to 'No'
diff --git a/mysql-test/suite/mariabackup/rpl_slave_info.result b/mysql-test/suite/mariabackup/rpl_slave_info.result
index ec27166e..2b9b6223 100644
--- a/mysql-test/suite/mariabackup/rpl_slave_info.result
+++ b/mysql-test/suite/mariabackup/rpl_slave_info.result
@@ -11,8 +11,8 @@ connection master;
CREATE TABLE t(i INT);
connection slave;
"using_gtid: Slave_Pos"
-FOUND 1 /gtid_slave_pos/ in xtrabackup_slave_info
-NOT FOUND /MASTER_LOG_FILE/ in xtrabackup_slave_info
+FOUND 1 /gtid_slave_pos/ in mariadb_backup_slave_info
+NOT FOUND /MASTER_LOG_FILE/ in mariadb_backup_slave_info
lineno line
1 SET GLOBAL gtid_slave_pos = '<NUM-NUM-NUM>';
2 CHANGE MASTER TO master_use_gtid = slave_pos;
@@ -21,8 +21,8 @@ lineno line
########################
include/stop_slave.inc
SET GLOBAL gtid_slave_pos="";
-NOT FOUND /gtid_slave_pos/ in xtrabackup_slave_info
-FOUND 1 /MASTER_LOG_FILE/ in xtrabackup_slave_info
+NOT FOUND /gtid_slave_pos/ in mariadb_backup_slave_info
+FOUND 1 /MASTER_LOG_FILE/ in mariadb_backup_slave_info
lineno line
1 CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=<NUM>;
###############
@@ -34,8 +34,8 @@ connection master;
INSERT INTO t VALUES(1);
connection slave;
"using_gtid: No"
-NOT FOUND /gtid_slave_pos/ in xtrabackup_slave_info
-FOUND 1 /MASTER_LOG_FILE/ in xtrabackup_slave_info
+NOT FOUND /gtid_slave_pos/ in mariadb_backup_slave_info
+FOUND 1 /MASTER_LOG_FILE/ in mariadb_backup_slave_info
lineno line
1 CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=<NUM>;
connection master;
diff --git a/mysql-test/suite/mariabackup/rpl_slave_info.test b/mysql-test/suite/mariabackup/rpl_slave_info.test
index 1c5dd89a..73ad00f1 100644
--- a/mysql-test/suite/mariabackup/rpl_slave_info.test
+++ b/mysql-test/suite/mariabackup/rpl_slave_info.test
@@ -22,7 +22,7 @@ CREATE TABLE t(i INT);
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group-suffix=.2 --slave-info --backup --target-dir=$targetdir;
--enable_result_log
---let SEARCH_FILE=$targetdir/xtrabackup_slave_info
+--let SEARCH_FILE=$targetdir/mariadb_backup_slave_info
--let SEARCH_PATTERN=gtid_slave_pos
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN=MASTER_LOG_FILE
@@ -45,7 +45,7 @@ SET GLOBAL gtid_slave_pos="";
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group-suffix=.2 --slave-info --backup --target-dir=$targetdir;
--enable_result_log
---let SEARCH_FILE=$targetdir/xtrabackup_slave_info
+--let SEARCH_FILE=$targetdir/mariadb_backup_slave_info
--let SEARCH_PATTERN=gtid_slave_pos
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN=MASTER_LOG_FILE
@@ -73,7 +73,7 @@ INSERT INTO t VALUES(1);
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group-suffix=.2 --slave-info --backup --target-dir=$targetdir;
--enable_result_log
---let SEARCH_FILE=$targetdir/xtrabackup_slave_info
+--let SEARCH_FILE=$targetdir/mariadb_backup_slave_info
--let SEARCH_PATTERN=gtid_slave_pos
--source include/search_pattern_in_file.inc
--let SEARCH_PATTERN=MASTER_LOG_FILE
diff --git a/mysql-test/suite/mariabackup/slave_info_norpl.result b/mysql-test/suite/mariabackup/slave_info_norpl.result
index 04ca2fb2..18cda940 100644
--- a/mysql-test/suite/mariabackup/slave_info_norpl.result
+++ b/mysql-test/suite/mariabackup/slave_info_norpl.result
@@ -8,7 +8,7 @@ SELECT @@global.gtid_slave_pos;
@@global.gtid_slave_pos
-# Without any masters the file xtrabackup_slave_info is not created
+# Without any masters the file mariadb_backup_slave_info is not created
line
[00] YYYY-MM-DD hh:mm:ss Failed to get master binlog coordinates from SHOW SLAVE STATUS.This means that the server is not a replication slave. Ignoring the --slave-info option
diff --git a/mysql-test/suite/mariabackup/slave_info_norpl.test b/mysql-test/suite/mariabackup/slave_info_norpl.test
index 0d2d2ed4..298aaa2d 100644
--- a/mysql-test/suite/mariabackup/slave_info_norpl.test
+++ b/mysql-test/suite/mariabackup/slave_info_norpl.test
@@ -19,13 +19,13 @@
SELECT @@global.gtid_slave_pos;
--echo
---echo # Without any masters the file xtrabackup_slave_info is not created
+--echo # Without any masters the file mariadb_backup_slave_info is not created
--disable_result_log
exec $XTRABACKUP $XTRABACKUP_ARGS >$XTRABACKUP_OUT;
--enable_result_log
--error 1
---file_exists $targetdir/xtrabackup_slave_info
+--file_exists $targetdir/mariadb_backup_slave_info
--source include/show_xtrabackup_slave_info_out.inc
--remove_file $XTRABACKUP_OUT
rmdir $targetdir;
diff --git a/mysql-test/suite/mariabackup/slave_provision_nolock.cnf b/mysql-test/suite/mariabackup/slave_provision_nolock.cnf
index 0e0bbd63..d8326a5c 100644
--- a/mysql-test/suite/mariabackup/slave_provision_nolock.cnf
+++ b/mysql-test/suite/mariabackup/slave_provision_nolock.cnf
@@ -1,3 +1,5 @@
+!include include/default_my.cnf
+
[mysqld.1]
log-slave-updates
loose-innodb
diff --git a/mysql-test/suite/mariabackup/slave_provision_nolock.result b/mysql-test/suite/mariabackup/slave_provision_nolock.result
index 445a9801..66e0a079 100644
--- a/mysql-test/suite/mariabackup/slave_provision_nolock.result
+++ b/mysql-test/suite/mariabackup/slave_provision_nolock.result
@@ -28,6 +28,7 @@ CREATE TABLE t3 (file VARCHAR(255), pos INT) ENGINE=InnoDB;
LOAD DATA LOCAL INFILE "BASEDIR/xtrabackup_binlog_pos_innodb"
INTO TABLE t3 FIELDS ESCAPED BY '' (file, pos);
CHANGE MASTER TO
+master_ssl_verify_server_cert=0,
master_port=PORT, master_host='127.0.0.1', master_user='root',
master_log_file= "MASTER_FILE",
master_log_pos= MASTER_POS;
diff --git a/mysql-test/suite/mariabackup/slave_provision_nolock.test b/mysql-test/suite/mariabackup/slave_provision_nolock.test
index 618f3132..874a32d6 100644
--- a/mysql-test/suite/mariabackup/slave_provision_nolock.test
+++ b/mysql-test/suite/mariabackup/slave_provision_nolock.test
@@ -139,6 +139,7 @@ eval LOAD DATA LOCAL INFILE "$basedir/xtrabackup_binlog_pos_innodb"
--replace_result $SERVER_MYPORT_1 PORT $provision_master_file MASTER_FILE $provision_master_pos MASTER_POS
eval CHANGE MASTER TO
+ master_ssl_verify_server_cert=0,
master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root',
master_log_file= "$provision_master_file",
master_log_pos= $provision_master_pos;
diff --git a/mysql-test/suite/mariabackup/sys_truncate.opt b/mysql-test/suite/mariabackup/sys_truncate.opt
new file mode 100644
index 00000000..006127ed
--- /dev/null
+++ b/mysql-test/suite/mariabackup/sys_truncate.opt
@@ -0,0 +1,2 @@
+--innodb_data_file_path=ibdata1:1M:autoextend:autoshrink
+--innodb_sys_tablespaces
diff --git a/mysql-test/suite/mariabackup/sys_truncate.result b/mysql-test/suite/mariabackup/sys_truncate.result
new file mode 100644
index 00000000..f1932a3d
--- /dev/null
+++ b/mysql-test/suite/mariabackup/sys_truncate.result
@@ -0,0 +1,28 @@
+SET GLOBAL INNODB_FILE_PER_TABLE= 0;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
+CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL,
+f3 INT NOT NULL, INDEX(f1),
+INDEX(f2), INDEX(f3))ENGINE=InnoDB;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+DROP TABLE t1;
+InnoDB 0 transactions not purged
+SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
+NAME FILE_SIZE
+innodb_system 70254592
+# restart
+SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
+NAME FILE_SIZE
+innodb_system 3145728
+# Incremental backup
+# Prepare full backup, apply incremental one
+# Restore and check results
+# shutdown server
+# remove datadir
+# xtrabackup move back
+# restart
+SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
+NAME FILE_SIZE
+innodb_system 3145728
diff --git a/mysql-test/suite/mariabackup/sys_truncate.test b/mysql-test/suite/mariabackup/sys_truncate.test
new file mode 100644
index 00000000..4f4ea510
--- /dev/null
+++ b/mysql-test/suite/mariabackup/sys_truncate.test
@@ -0,0 +1,36 @@
+--source include/have_innodb.inc
+--source include/have_sequence.inc
+let basedir=$MYSQLTEST_VARDIR/tmp/backup;
+let incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1;
+SET GLOBAL INNODB_FILE_PER_TABLE= 0;
+CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL,
+ f3 INT NOT NULL, INDEX(f1),
+ INDEX(f2), INDEX(f3))ENGINE=InnoDB;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+INSERT INTO t1 SELECT seq, seq, seq FROM seq_1_to_16384;
+DROP TABLE t1;
+--source ../innodb/include/wait_all_purged.inc
+SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$basedir --throttle=1000;
+--enable_result_log
+--source include/restart_mysqld.inc
+SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
+
+--echo # Incremental backup
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=2 --ftwrl-wait-timeout=5 --ftwrl-wait-threshold=300 --ftwrl-wait-query-type=all --target-dir=$incremental_dir --incremental-basedir=$basedir;
+
+--disable_result_log
+echo # Prepare full backup, apply incremental one;
+exec $XTRABACKUP --prepare --target-dir=$basedir;
+exec $XTRABACKUP --prepare --target-dir=$basedir --incremental-dir=$incremental_dir;
+
+echo # Restore and check results;
+let $targetdir=$basedir;
+-- source include/restart_and_restore.inc
+--enable_result_log
+SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
+# Cleanup
+rmdir $basedir;
+rmdir $incremental_dir;
diff --git a/mysql-test/suite/mariabackup/undo_space_id.opt b/mysql-test/suite/mariabackup/undo_space_id.opt
index 006e17a2..cc31e3dc 100644
--- a/mysql-test/suite/mariabackup/undo_space_id.opt
+++ b/mysql-test/suite/mariabackup/undo_space_id.opt
@@ -1,3 +1,3 @@
---debug=d,innodb_undo_upgrade,force_rebootstrap
+--debug-dbug=d,innodb_undo_upgrade,force_rebootstrap
--innodb_data_file_path=ib_mysql:10M
--innodb_undo_tablespaces=2
diff --git a/mysql-test/suite/mariabackup/xb_compressed_encrypted.opt b/mysql-test/suite/mariabackup/xb_compressed_encrypted.opt
index 4105fecf..52ef47f3 100644
--- a/mysql-test/suite/mariabackup/xb_compressed_encrypted.opt
+++ b/mysql-test/suite/mariabackup/xb_compressed_encrypted.opt
@@ -5,4 +5,3 @@
--loose-file-key-management
--loose-file-key-management-filename=$MYSQL_TEST_DIR/std_data/logkey.txt
--innodb_strict_mode
---innodb_file_per_table
diff --git a/mysql-test/suite/mariabackup/xb_fulltext_encrypted.opt b/mysql-test/suite/mariabackup/xb_fulltext_encrypted.opt
index b3ef3663..e3a9e5a4 100644
--- a/mysql-test/suite/mariabackup/xb_fulltext_encrypted.opt
+++ b/mysql-test/suite/mariabackup/xb_fulltext_encrypted.opt
@@ -1,6 +1,5 @@
--plugin-load-add=$FILE_KEY_MANAGEMENT_SO
--innodb_strict_mode
---innodb_file_per_table
--innodb-encryption-rotate-key-age=2
--innodb-encryption-threads=4
--innodb-tablespaces-encryption
diff --git a/mysql-test/suite/merge/alter_table.result b/mysql-test/suite/merge/alter_table.result
new file mode 100644
index 00000000..5adf610e
--- /dev/null
+++ b/mysql-test/suite/merge/alter_table.result
@@ -0,0 +1,22 @@
+#
+# BUG#6236 - ALTER TABLE MODIFY should set implicit NOT NULL on PK columns
+#
+create table t1 ( a varchar(10) not null primary key ) engine=myisam;
+create table t2 ( a varchar(10) not null primary key ) engine=merge union=(t1);
+flush tables;
+alter table t1 modify a varchar(10);
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` varchar(10) NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci UNION=(`t1`)
+flush tables;
+alter table t1 modify a varchar(10) not null;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `a` varchar(10) NOT NULL,
+ PRIMARY KEY (`a`)
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci UNION=(`t1`)
+drop table if exists t1, t2;
diff --git a/mysql-test/suite/merge/alter_table.test b/mysql-test/suite/merge/alter_table.test
new file mode 100644
index 00000000..da56772b
--- /dev/null
+++ b/mysql-test/suite/merge/alter_table.test
@@ -0,0 +1,12 @@
+--echo #
+--echo # BUG#6236 - ALTER TABLE MODIFY should set implicit NOT NULL on PK columns
+--echo #
+create table t1 ( a varchar(10) not null primary key ) engine=myisam;
+create table t2 ( a varchar(10) not null primary key ) engine=merge union=(t1);
+flush tables;
+alter table t1 modify a varchar(10);
+show create table t2;
+flush tables;
+alter table t1 modify a varchar(10) not null;
+show create table t2;
+drop table if exists t1, t2;
diff --git a/mysql-test/main/merge.result b/mysql-test/suite/merge/merge.result
index e7330b7e..b33031b8 100644
--- a/mysql-test/main/merge.result
+++ b/mysql-test/suite/merge/merge.result
@@ -2804,8 +2804,6 @@ CREATE TABLE tm1 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1)
INSERT_METHOD=LAST;
CREATE TRIGGER tm1_ai AFTER INSERT ON tm1
FOR EACH ROW SELECT max(c1) FROM t1 INTO @var;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
LOCK TABLE tm1 WRITE, t1 WRITE;
INSERT INTO tm1 VALUES (1);
SELECT * FROM tm1;
@@ -2830,8 +2828,6 @@ CREATE TABLE tm1 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1,t2,t3,t4,t5)
INSERT_METHOD=LAST;
CREATE TRIGGER t2_au AFTER UPDATE ON t2
FOR EACH ROW SELECT MAX(c1) FROM t1 INTO @var;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CREATE FUNCTION f1() RETURNS INT
RETURN (SELECT MAX(c1) FROM t4);
LOCK TABLE tm1 WRITE, t1 WRITE, t2 WRITE, t3 WRITE, t4 WRITE, t5 WRITE;
@@ -3941,3 +3937,68 @@ drop table tm, t;
#
# End of 10.8 tests
#
+#
+# MDEV-30088 Assertion `cond_selectivity <= 1.0' failed in get_range_limit_read_cost
+#
+CREATE TABLE t1 (a TIMESTAMP, KEY(a)) ENGINE=MRG_MyISAM;
+explain SELECT a, COUNT(*) FROM t1 WHERE a >= '2000-01-01 00:00:00' GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+SELECT a, COUNT(*) FROM t1 WHERE a >= '2000-01-01 00:00:00' GROUP BY a;
+a COUNT(*)
+DROP TABLE t1;
+#
+# MDEV-30525: Assertion `ranges > 0' fails in IO_AND_CPU_COST handler::keyread_time
+#
+CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM;
+CREATE TABLE t2 (a INT, KEY(a)) ENGINE=MyISAM;
+CREATE TABLE tm (a INT, KEY(a)) ENGINE=MRG_MyISAM UNION=(t1,t2);
+SELECT DISTINCT a FROM tm WHERE a > 50;
+a
+DROP TABLE tm, t1, t2;
+# Testcase 2:
+CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM;
+CREATE TABLE t2 (a INT, KEY(a)) ENGINE=MyISAM;
+CREATE TABLE tm (a INT, KEY(a)) ENGINE=MERGE UNION = (t1, t2) INSERT_METHOD=FIRST;
+ANALYZE TABLE tm PERSISTENT FOR ALL;
+Table Op Msg_type Msg_text
+test.tm analyze status Engine-independent statistics collected
+test.tm analyze note The storage engine for the table doesn't support analyze
+SELECT DISTINCT a FROM (SELECT * FROM tm WHERE a iS NOT NULL) AS sq;
+a
+DROP TABLE tm, t1, t2;
+#
+# MDEV-30568 Assertion `cond_selectivity <= 1.000000001' failed in get_range_limit_read_cost
+#
+CREATE TABLE t1 (f INT, KEY(f)) ENGINE=MyISAM;
+CREATE TABLE t2 (f INT, KEY(f)) ENGINE=MyISAM;
+CREATE TABLE tm (f INT, KEY(f)) ENGINE=MERGE UNION = (t1, t2);
+SELECT DISTINCT f FROM tm WHERE f IN (47, 126, 97, 48, 73, 0);
+f
+DROP TABLE tm, t1, t2;
+#
+# MDEV-30786 SIGFPE in cost_group_min_max on EXP
+#
+SET use_stat_tables='preferably';
+CREATE TABLE t1 (a INT,b INT,KEY i1 (a),KEY i2 (b)) ENGINE=MRG_MyISAM;
+ANALYZE LOCAL TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Engine-independent statistics collected
+test.t1 analyze note The storage engine for the table doesn't support analyze
+EXPLAIN SELECT DISTINCT a FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL i1 5 NULL 1 Using index for group-by
+drop table t1;
+set use_stat_tables=default;
+#
+# End of 11.0 tests
+#
+#
+# MDEV-29174: UPDATE of view that uses MERGE table
+#
+CREATE TABLE t1 (a int) ENGINE=MERGE;
+CREATE VIEW v1 AS SELECT a FROM t1;
+UPDATE v1 SET a=0;
+DROP VIEW v1;
+DROP TABLE t1;
+# End of 11.1 tests
diff --git a/mysql-test/main/merge.test b/mysql-test/suite/merge/merge.test
index aacfdd68..5d38023a 100644
--- a/mysql-test/main/merge.test
+++ b/mysql-test/suite/merge/merge.test
@@ -2900,3 +2900,63 @@ drop table tm, t;
--echo #
--echo # End of 10.8 tests
--echo #
+
+--echo #
+--echo # MDEV-30088 Assertion `cond_selectivity <= 1.0' failed in get_range_limit_read_cost
+--echo #
+
+CREATE TABLE t1 (a TIMESTAMP, KEY(a)) ENGINE=MRG_MyISAM;
+explain SELECT a, COUNT(*) FROM t1 WHERE a >= '2000-01-01 00:00:00' GROUP BY a;
+SELECT a, COUNT(*) FROM t1 WHERE a >= '2000-01-01 00:00:00' GROUP BY a;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-30525: Assertion `ranges > 0' fails in IO_AND_CPU_COST handler::keyread_time
+--echo #
+CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM;
+CREATE TABLE t2 (a INT, KEY(a)) ENGINE=MyISAM;
+CREATE TABLE tm (a INT, KEY(a)) ENGINE=MRG_MyISAM UNION=(t1,t2);
+SELECT DISTINCT a FROM tm WHERE a > 50;
+DROP TABLE tm, t1, t2;
+
+--echo # Testcase 2:
+CREATE TABLE t1 (a INT, KEY(a)) ENGINE=MyISAM;
+CREATE TABLE t2 (a INT, KEY(a)) ENGINE=MyISAM;
+CREATE TABLE tm (a INT, KEY(a)) ENGINE=MERGE UNION = (t1, t2) INSERT_METHOD=FIRST;
+ANALYZE TABLE tm PERSISTENT FOR ALL;
+SELECT DISTINCT a FROM (SELECT * FROM tm WHERE a iS NOT NULL) AS sq;
+DROP TABLE tm, t1, t2;
+
+--echo #
+--echo # MDEV-30568 Assertion `cond_selectivity <= 1.000000001' failed in get_range_limit_read_cost
+--echo #
+CREATE TABLE t1 (f INT, KEY(f)) ENGINE=MyISAM;
+CREATE TABLE t2 (f INT, KEY(f)) ENGINE=MyISAM;
+CREATE TABLE tm (f INT, KEY(f)) ENGINE=MERGE UNION = (t1, t2);
+SELECT DISTINCT f FROM tm WHERE f IN (47, 126, 97, 48, 73, 0);
+DROP TABLE tm, t1, t2;
+
+--echo #
+--echo # MDEV-30786 SIGFPE in cost_group_min_max on EXP
+--echo #
+SET use_stat_tables='preferably';
+CREATE TABLE t1 (a INT,b INT,KEY i1 (a),KEY i2 (b)) ENGINE=MRG_MyISAM;
+ANALYZE LOCAL TABLE t1;
+EXPLAIN SELECT DISTINCT a FROM t1;
+drop table t1;
+set use_stat_tables=default;
+
+--echo #
+--echo # End of 11.0 tests
+--echo #
+--echo #
+--echo # MDEV-29174: UPDATE of view that uses MERGE table
+--echo #
+
+CREATE TABLE t1 (a int) ENGINE=MERGE;
+CREATE VIEW v1 AS SELECT a FROM t1;
+UPDATE v1 SET a=0;
+DROP VIEW v1;
+DROP TABLE t1;
+
+--echo # End of 11.1 tests
diff --git a/mysql-test/main/merge_debug.result b/mysql-test/suite/merge/merge_debug.result
index 36cf254f..36cf254f 100644
--- a/mysql-test/main/merge_debug.result
+++ b/mysql-test/suite/merge/merge_debug.result
diff --git a/mysql-test/main/merge_debug.test b/mysql-test/suite/merge/merge_debug.test
index 4141042c..4141042c 100644
--- a/mysql-test/main/merge_debug.test
+++ b/mysql-test/suite/merge/merge_debug.test
diff --git a/mysql-test/main/merge_innodb.result b/mysql-test/suite/merge/merge_innodb.result
index 5aa344a9..5aa344a9 100644
--- a/mysql-test/main/merge_innodb.result
+++ b/mysql-test/suite/merge/merge_innodb.result
diff --git a/mysql-test/main/merge_innodb.test b/mysql-test/suite/merge/merge_innodb.test
index 9f87f241..9f87f241 100644
--- a/mysql-test/main/merge_innodb.test
+++ b/mysql-test/suite/merge/merge_innodb.test
diff --git a/mysql-test/main/merge_mmap-master.opt b/mysql-test/suite/merge/merge_mmap-master.opt
index 9606fb57..9606fb57 100644
--- a/mysql-test/main/merge_mmap-master.opt
+++ b/mysql-test/suite/merge/merge_mmap-master.opt
diff --git a/mysql-test/main/merge_mmap.result b/mysql-test/suite/merge/merge_mmap.result
index 8e655a04..8e655a04 100644
--- a/mysql-test/main/merge_mmap.result
+++ b/mysql-test/suite/merge/merge_mmap.result
diff --git a/mysql-test/main/merge_mmap.test b/mysql-test/suite/merge/merge_mmap.test
index 01c3896b..01c3896b 100644
--- a/mysql-test/main/merge_mmap.test
+++ b/mysql-test/suite/merge/merge_mmap.test
diff --git a/mysql-test/suite/mtr/t/simple,c2,s1.rdiff b/mysql-test/suite/mtr/t/simple,c2,s1.rdiff
index 3023756a..91f800a6 100644
--- a/mysql-test/suite/mtr/t/simple,c2,s1.rdiff
+++ b/mysql-test/suite/mtr/t/simple,c2,s1.rdiff
@@ -1,5 +1,5 @@
---- suite/mtr/t/simple.result 2012-02-04 12:13:41.000000000 +0100
-+++ suite/mtr/t/simple,infile,verbose.reject 2012-02-04 12:16:10.000000000 +0100
+--- suite/mtr/t/simple.result
++++ suite/mtr/t/simple,infile,verbose.reject
@@ -3,7 +3,7 @@
proxy
select @@local_infile;
diff --git a/mysql-test/suite/mtr/t/simple,s2,c2.rdiff b/mysql-test/suite/mtr/t/simple,s2,c2.rdiff
index a9b9b56e..a4c9ab96 100644
--- a/mysql-test/suite/mtr/t/simple,s2,c2.rdiff
+++ b/mysql-test/suite/mtr/t/simple,s2,c2.rdiff
@@ -1,5 +1,5 @@
---- suite/mtr/t/simple,old.result 2012-02-04 12:13:25.000000000 +0100
-+++ suite/mtr/t/simple,old,infile.reject 2012-02-04 12:13:59.000000000 +0100
+--- suite/mtr/t/simple,old.result
++++ suite/mtr/t/simple,old,infile.reject
@@ -3,7 +3,7 @@
proxy
select @@local_infile;
diff --git a/mysql-test/suite/multi_source/gtid.result b/mysql-test/suite/multi_source/gtid.result
index 6530bb74..8f792f98 100644
--- a/mysql-test/suite/multi_source/gtid.result
+++ b/mysql-test/suite/multi_source/gtid.result
@@ -3,8 +3,8 @@ connect slave2,127.0.0.1,root,,,$SERVER_MYPORT_4;
connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
connection slave1;
-CHANGE MASTER 'slave1' TO master_port=MYPORT_1, master_host='127.0.0.1', master_user='root';
-CHANGE MASTER 'slave2' TO master_port=MYPORT_2, master_host='127.0.0.1', master_user='root';
+CHANGE MASTER 'slave1' TO master_port=MYPORT_1, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0;
+CHANGE MASTER 'slave2' TO master_port=MYPORT_2, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0;
set default_master_connection = 'slave1';
START SLAVE;
include/wait_for_slave_to_start.inc
@@ -13,7 +13,7 @@ START SLAVE;
include/wait_for_slave_to_start.inc
set default_master_connection = '';
connection slave2;
-CHANGE MASTER TO master_port=MYPORT_3, master_host='127.0.0.1', master_user='root';
+CHANGE MASTER TO master_port=MYPORT_3, master_host='127.0.0.1', master_ssl_verify_server_cert=0, master_user='root';
start all slaves;
Warnings:
Note 1937 SLAVE '' started
@@ -47,8 +47,8 @@ connection master2;
INSERT INTO t2 VALUES (2, "switch1");
INSERT INTO t3 VALUES (202, "switch1 b");
connection slave2;
-CHANGE MASTER 'slave1' TO master_port=MYPORT_1, master_host='127.0.0.1', master_user='root';
-CHANGE MASTER 'slave2' TO master_port=MYPORT_2, master_host='127.0.0.1', master_user='root';
+CHANGE MASTER 'slave1' TO master_port=MYPORT_1, master_host='127.0.0.1', master_ssl_verify_server_cert=0, master_user='root';
+CHANGE MASTER 'slave2' TO master_port=MYPORT_2, master_host='127.0.0.1', master_ssl_verify_server_cert=0, master_user='root';
SET default_master_connection = 'slave1';
START SLAVE;
include/wait_for_slave_to_start.inc
@@ -75,7 +75,7 @@ INSERT INTO t3 VALUES (204, "switch 3 b");
connection slave2;
include/sync_with_master_gtid.inc
connection slave1;
-CHANGE MASTER TO master_port=MYPORT_4, master_host='127.0.0.1', master_user='root';
+CHANGE MASTER TO master_port=MYPORT_4, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0;
START SLAVE;
SELECT * FROM t1 ORDER BY a;
a b
diff --git a/mysql-test/suite/multi_source/gtid.test b/mysql-test/suite/multi_source/gtid.test
index 9fc7a668..2d6d1280 100644
--- a/mysql-test/suite/multi_source/gtid.test
+++ b/mysql-test/suite/multi_source/gtid.test
@@ -12,9 +12,9 @@
--connection slave1
--replace_result $SERVER_MYPORT_1 MYPORT_1
-eval CHANGE MASTER 'slave1' TO master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root';
+eval CHANGE MASTER 'slave1' TO master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0;
--replace_result $SERVER_MYPORT_2 MYPORT_2
-eval CHANGE MASTER 'slave2' TO master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root';
+eval CHANGE MASTER 'slave2' TO master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0;
set default_master_connection = 'slave1';
START SLAVE;
--source include/wait_for_slave_to_start.inc
@@ -25,7 +25,7 @@ set default_master_connection = '';
--connection slave2
--replace_result $SERVER_MYPORT_3 MYPORT_3
-eval CHANGE MASTER TO master_port=$SERVER_MYPORT_3, master_host='127.0.0.1', master_user='root';
+eval CHANGE MASTER TO master_port=$SERVER_MYPORT_3, master_host='127.0.0.1', master_ssl_verify_server_cert=0, master_user='root';
start all slaves;
--source include/wait_for_slave_to_start.inc
@@ -73,9 +73,9 @@ INSERT INTO t3 VALUES (202, "switch1 b");
--connection slave2
--replace_result $SERVER_MYPORT_1 MYPORT_1
-eval CHANGE MASTER 'slave1' TO master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root';
+eval CHANGE MASTER 'slave1' TO master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_ssl_verify_server_cert=0, master_user='root';
--replace_result $SERVER_MYPORT_2 MYPORT_2
-eval CHANGE MASTER 'slave2' TO master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root';
+eval CHANGE MASTER 'slave2' TO master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_ssl_verify_server_cert=0, master_user='root';
SET default_master_connection = 'slave1';
START SLAVE;
--source include/wait_for_slave_to_start.inc
@@ -125,7 +125,7 @@ INSERT INTO t3 VALUES (204, "switch 3 b");
--connection slave1
--replace_result $SERVER_MYPORT_4 MYPORT_4
-eval CHANGE MASTER TO master_port=$SERVER_MYPORT_4, master_host='127.0.0.1', master_user='root';
+eval CHANGE MASTER TO master_port=$SERVER_MYPORT_4, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0;
START SLAVE;
--let $wait_condition= SELECT (SELECT COUNT(*) FROM t1)=3 AND (SELECT COUNT(*) FROM t2)=4 AND (SELECT COUNT(*) FROM t3)=7
--source include/wait_condition.inc
diff --git a/mysql-test/suite/multi_source/gtid_ignore_duplicates.result b/mysql-test/suite/multi_source/gtid_ignore_duplicates.result
index 88b525e2..b5ef07be 100644
--- a/mysql-test/suite/multi_source/gtid_ignore_duplicates.result
+++ b/mysql-test/suite/multi_source/gtid_ignore_duplicates.result
@@ -10,8 +10,8 @@ SET @old_ignore_duplicates= @@GLOBAL.gtid_ignore_duplicates;
SET GLOBAL gtid_ignore_duplicates=1;
SET GLOBAL gtid_domain_id= 1;
SET SESSION gtid_domain_id= 1;
-CHANGE MASTER 'b2a' TO master_port=MYPORT_2, master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
-CHANGE MASTER 'c2a' TO master_port=MYPORT_3, master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+CHANGE MASTER 'b2a' TO master_port=MYPORT_2, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
+CHANGE MASTER 'c2a' TO master_port=MYPORT_3, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
set default_master_connection = 'b2a';
START SLAVE;
include/wait_for_slave_to_start.inc
@@ -26,8 +26,8 @@ SET @old_ignore_duplicates= @@GLOBAL.gtid_ignore_duplicates;
SET GLOBAL gtid_ignore_duplicates=1;
SET GLOBAL gtid_domain_id= 2;
SET SESSION gtid_domain_id= 2;
-CHANGE MASTER 'a2b' TO master_port=MYPORT_1, master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
-CHANGE MASTER 'c2b' TO master_port=MYPORT_3, master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+CHANGE MASTER 'a2b' TO master_port=MYPORT_1, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
+CHANGE MASTER 'c2b' TO master_port=MYPORT_3, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
set default_master_connection = 'a2b';
START SLAVE;
include/wait_for_slave_to_start.inc
@@ -42,8 +42,8 @@ SET @old_ignore_duplicates= @@GLOBAL.gtid_ignore_duplicates;
SET GLOBAL gtid_ignore_duplicates=1;
SET GLOBAL gtid_domain_id= 3;
SET SESSION gtid_domain_id= 3;
-CHANGE MASTER 'a2c' TO master_port=MYPORT_1, master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
-CHANGE MASTER 'b2c' TO master_port=MYPORT_2, master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+CHANGE MASTER 'a2c' TO master_port=MYPORT_1, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
+CHANGE MASTER 'b2c' TO master_port=MYPORT_2, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
set default_master_connection = 'a2c';
START SLAVE;
include/wait_for_slave_to_start.inc
@@ -58,7 +58,7 @@ SET @old_ignore_duplicates= @@GLOBAL.gtid_ignore_duplicates;
SET GLOBAL gtid_ignore_duplicates=1;
SET GLOBAL gtid_domain_id= 1;
SET SESSION gtid_domain_id= 1;
-CHANGE MASTER 'a2d' TO master_port=MYPORT_1, master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+CHANGE MASTER 'a2d' TO master_port=MYPORT_1, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
set default_master_connection = 'a2d';
START SLAVE;
include/wait_for_slave_to_start.inc
diff --git a/mysql-test/suite/multi_source/gtid_ignore_duplicates.test b/mysql-test/suite/multi_source/gtid_ignore_duplicates.test
index cbc06920..75c56877 100644
--- a/mysql-test/suite/multi_source/gtid_ignore_duplicates.test
+++ b/mysql-test/suite/multi_source/gtid_ignore_duplicates.test
@@ -20,9 +20,9 @@ SET GLOBAL gtid_ignore_duplicates=1;
SET GLOBAL gtid_domain_id= 1;
SET SESSION gtid_domain_id= 1;
--replace_result $SERVER_MYPORT_2 MYPORT_2
-eval CHANGE MASTER 'b2a' TO master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+eval CHANGE MASTER 'b2a' TO master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
--replace_result $SERVER_MYPORT_3 MYPORT_3
-eval CHANGE MASTER 'c2a' TO master_port=$SERVER_MYPORT_3, master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+eval CHANGE MASTER 'c2a' TO master_port=$SERVER_MYPORT_3, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
set default_master_connection = 'b2a';
START SLAVE;
--source include/wait_for_slave_to_start.inc
@@ -39,9 +39,9 @@ SET GLOBAL gtid_ignore_duplicates=1;
SET GLOBAL gtid_domain_id= 2;
SET SESSION gtid_domain_id= 2;
--replace_result $SERVER_MYPORT_1 MYPORT_1
-eval CHANGE MASTER 'a2b' TO master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+eval CHANGE MASTER 'a2b' TO master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
--replace_result $SERVER_MYPORT_3 MYPORT_3
-eval CHANGE MASTER 'c2b' TO master_port=$SERVER_MYPORT_3, master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+eval CHANGE MASTER 'c2b' TO master_port=$SERVER_MYPORT_3, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
set default_master_connection = 'a2b';
START SLAVE;
--source include/wait_for_slave_to_start.inc
@@ -58,9 +58,9 @@ SET GLOBAL gtid_ignore_duplicates=1;
SET GLOBAL gtid_domain_id= 3;
SET SESSION gtid_domain_id= 3;
--replace_result $SERVER_MYPORT_1 MYPORT_1
-eval CHANGE MASTER 'a2c' TO master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+eval CHANGE MASTER 'a2c' TO master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
--replace_result $SERVER_MYPORT_2 MYPORT_2
-eval CHANGE MASTER 'b2c' TO master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+eval CHANGE MASTER 'b2c' TO master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
set default_master_connection = 'a2c';
START SLAVE;
--source include/wait_for_slave_to_start.inc
@@ -77,7 +77,7 @@ SET GLOBAL gtid_ignore_duplicates=1;
SET GLOBAL gtid_domain_id= 1;
SET SESSION gtid_domain_id= 1;
--replace_result $SERVER_MYPORT_1 MYPORT_1
-eval CHANGE MASTER 'a2d' TO master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+eval CHANGE MASTER 'a2d' TO master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
set default_master_connection = 'a2d';
START SLAVE;
--source include/wait_for_slave_to_start.inc
diff --git a/mysql-test/suite/multi_source/gtid_slave_pos.result b/mysql-test/suite/multi_source/gtid_slave_pos.result
index 44eb4823..00c9404f 100644
--- a/mysql-test/suite/multi_source/gtid_slave_pos.result
+++ b/mysql-test/suite/multi_source/gtid_slave_pos.result
@@ -2,8 +2,8 @@ connect slave1,127.0.0.1,root,,,$SERVER_MYPORT_3;
connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
connection slave1;
-CHANGE MASTER 'slave1' TO master_port=MYPORT_1, master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
-CHANGE MASTER 'slave2' TO master_port=MYPORT_2, master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+CHANGE MASTER 'slave1' TO master_port=MYPORT_1, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
+CHANGE MASTER 'slave2' TO master_port=MYPORT_2, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
set default_master_connection = 'slave1';
START SLAVE;
include/wait_for_slave_to_start.inc
diff --git a/mysql-test/suite/multi_source/gtid_slave_pos.test b/mysql-test/suite/multi_source/gtid_slave_pos.test
index cc418d76..d5356ca6 100644
--- a/mysql-test/suite/multi_source/gtid_slave_pos.test
+++ b/mysql-test/suite/multi_source/gtid_slave_pos.test
@@ -11,9 +11,9 @@
--connection slave1
--replace_result $SERVER_MYPORT_1 MYPORT_1
-eval CHANGE MASTER 'slave1' TO master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+eval CHANGE MASTER 'slave1' TO master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
--replace_result $SERVER_MYPORT_2 MYPORT_2
-eval CHANGE MASTER 'slave2' TO master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+eval CHANGE MASTER 'slave2' TO master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
set default_master_connection = 'slave1';
START SLAVE;
--source include/wait_for_slave_to_start.inc
diff --git a/mysql-test/suite/multi_source/info_logs.result b/mysql-test/suite/multi_source/info_logs.result
index 6f3fd7e7..36065116 100644
--- a/mysql-test/suite/multi_source/info_logs.result
+++ b/mysql-test/suite/multi_source/info_logs.result
@@ -10,7 +10,7 @@ multi-master.info
change master 'master1' to
master_port=MYPORT_1,
master_host='127.0.0.1',
-master_user='root',
+master_user='root', master_ssl_verify_server_cert=0,
master_use_gtid=no;
start slave 'master1';
set default_master_connection = 'master1';
@@ -29,7 +29,7 @@ master1
change master 'MASTER 2.2' to
master_port=MYPORT_2,
master_host='127.0.0.1',
-master_user='root',
+master_user='root', master_ssl_verify_server_cert=0,
master_use_gtid=no;
start slave 'MASTER 2.2';
set default_master_connection = 'MASTER 2.2';
@@ -73,7 +73,7 @@ set default_master_connection = '';
change master to
master_port=MYPORT_1,
master_host='127.0.0.1',
-master_user='root',
+master_user='root', master_ssl_verify_server_cert=0,
master_use_gtid=no;
start slave;
include/wait_for_slave_to_start.inc
@@ -95,16 +95,16 @@ MASTER 2.2
#
show all slaves status;
Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups Replicate_Rewrite_DB Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
- Slave has read all relay log; waiting for more updates Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 <read_master_log_pos> relay.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 No 0 No 0 0 1 No optimistic 0 NULL Slave has read all relay log; waiting for more updates 0 0 0 0 1073741824 7 0 60.000
-MASTER 2.2 Slave has read all relay log; waiting for more updates Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> relay-master@00202@002e2.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space2> None 0 No 0 No 0 0 2 No optimistic 0 NULL Slave has read all relay log; waiting for more updates 0 0 0 0 1073741824 7 0 60.000
+ Slave has read all relay log; waiting for more updates Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 <read_master_log_pos> relay.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 Yes 0 No 0 0 1 No optimistic 0 NULL Slave has read all relay log; waiting for more updates 0 0 0 0 1073741824 7 0 60.000
+MASTER 2.2 Slave has read all relay log; waiting for more updates Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> relay-master@00202@002e2.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space2> None 0 Yes 0 No 0 0 2 No optimistic 0 NULL Slave has read all relay log; waiting for more updates 0 0 0 0 1073741824 7 0 60.000
include/wait_for_slave_to_start.inc
set default_master_connection = 'MASTER 2.2';
include/wait_for_slave_to_start.inc
set default_master_connection = '';
show all slaves status;
Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups Replicate_Rewrite_DB Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
- Slave has read all relay log; waiting for more updates Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 <read_master_log_pos> relay.000004 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 No 0 No 0 0 1 No optimistic 0 NULL Slave has read all relay log; waiting for more updates 0 0 0 0 1073741824 6 0 60.000
-MASTER 2.2 Slave has read all relay log; waiting for more updates Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> relay-master@00202@002e2.000004 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space2> None 0 No 0 No 0 0 2 No optimistic 0 NULL Slave has read all relay log; waiting for more updates 0 0 0 0 1073741824 6 0 60.000
+ Slave has read all relay log; waiting for more updates Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 <read_master_log_pos> relay.000004 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 Yes 0 No 0 0 1 No optimistic 0 NULL Slave has read all relay log; waiting for more updates 0 0 0 0 1073741824 6 0 60.000
+MASTER 2.2 Slave has read all relay log; waiting for more updates Waiting for master to send event 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> relay-master@00202@002e2.000004 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space2> None 0 Yes 0 No 0 0 2 No optimistic 0 NULL Slave has read all relay log; waiting for more updates 0 0 0 0 1073741824 6 0 60.000
#
# List of files matching '*info*' pattern
# after slave server restart
diff --git a/mysql-test/suite/multi_source/info_logs.test b/mysql-test/suite/multi_source/info_logs.test
index f8352978..5511a04a 100644
--- a/mysql-test/suite/multi_source/info_logs.test
+++ b/mysql-test/suite/multi_source/info_logs.test
@@ -30,7 +30,7 @@
eval change master 'master1' to
master_port=$SERVER_MYPORT_1,
master_host='127.0.0.1',
-master_user='root',
+master_user='root', master_ssl_verify_server_cert=0,
master_use_gtid=no;
start slave 'master1';
@@ -55,7 +55,7 @@ set default_master_connection = 'master1';
eval change master 'MASTER 2.2' to
master_port=$SERVER_MYPORT_2,
master_host='127.0.0.1',
-master_user='root',
+master_user='root', master_ssl_verify_server_cert=0,
master_use_gtid=no;
start slave 'MASTER 2.2';
@@ -109,7 +109,7 @@ set default_master_connection = '';
eval change master to
master_port=$SERVER_MYPORT_1,
master_host='127.0.0.1',
-master_user='root',
+master_user='root', master_ssl_verify_server_cert=0,
master_use_gtid=no;
start slave;
diff --git a/mysql-test/suite/multi_source/load_data.result b/mysql-test/suite/multi_source/load_data.result
index 21b1bfff..a3d77414 100644
--- a/mysql-test/suite/multi_source/load_data.result
+++ b/mysql-test/suite/multi_source/load_data.result
@@ -2,8 +2,8 @@ connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
connection slave;
-change master '' to master_port=MYPORT_1, master_host='127.0.0.1', master_user='root';
-change master 'master2' to master_port=MYPORT_2, master_host='127.0.0.1', master_user='root';
+change master '' to master_port=MYPORT_1, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0;
+change master 'master2' to master_port=MYPORT_2, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0;
start all slaves;
Warnings:
Note 1937 SLAVE 'master2' started
diff --git a/mysql-test/suite/multi_source/load_data.test b/mysql-test/suite/multi_source/load_data.test
index 94b328d5..8927b818 100644
--- a/mysql-test/suite/multi_source/load_data.test
+++ b/mysql-test/suite/multi_source/load_data.test
@@ -11,9 +11,9 @@
--connection slave
--replace_result $SERVER_MYPORT_1 MYPORT_1
-eval change master '' to master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root';
+eval change master '' to master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0;
--replace_result $SERVER_MYPORT_2 MYPORT_2
-eval change master 'master2' to master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root';
+eval change master 'master2' to master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0;
start all slaves;
set default_master_connection = '';
diff --git a/mysql-test/suite/multi_source/mdev-8874.result b/mysql-test/suite/multi_source/mdev-8874.result
index 12bc251f..4ab3feea 100644
--- a/mysql-test/suite/multi_source/mdev-8874.result
+++ b/mysql-test/suite/multi_source/mdev-8874.result
@@ -24,9 +24,9 @@ insert into t1 values(1);
create table t2(a int);
insert into t2 values(1);
connection server_4;
-change master 'm1' to master_port=MYPORT_1 , master_host='127.0.0.1', master_user='root', master_use_gtid=no;
-change master 'm2' to master_port=MYPORT_2 , master_host='127.0.0.1', master_user='root', master_use_gtid=no;
-change master to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=no;
+change master 'm1' to master_port=MYPORT_1 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=no;
+change master 'm2' to master_port=MYPORT_2 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=no;
+change master to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=no;
start all slaves;
set default_master_connection = 'm1';
include/wait_for_slave_to_start.inc
@@ -76,9 +76,9 @@ Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No'
drop database a;
drop database b;
drop database c;
-change master 'm1' to master_port=MYPORT_1 , master_host='127.0.0.1', master_user='root', master_use_gtid=no;
-change master 'm2' to master_port=MYPORT_2 , master_host='127.0.0.1', master_user='root', master_use_gtid=no;
-change master to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=no;
+change master 'm1' to master_port=MYPORT_1 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=no;
+change master 'm2' to master_port=MYPORT_2 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=no;
+change master to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=no;
start all slaves;
Warnings:
Note 1937 SLAVE 'm2' started
diff --git a/mysql-test/suite/multi_source/mdev-8874.test b/mysql-test/suite/multi_source/mdev-8874.test
index 1a99ae73..b581af91 100644
--- a/mysql-test/suite/multi_source/mdev-8874.test
+++ b/mysql-test/suite/multi_source/mdev-8874.test
@@ -40,11 +40,11 @@ insert into t2 values(1);
--connection server_4
--disable_warnings
--replace_result $SERVER_MYPORT_1 MYPORT_1
-eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root', master_use_gtid=no;
+eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=no;
--replace_result $SERVER_MYPORT_2 MYPORT_2
-eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root', master_use_gtid=no;
+eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=no;
--replace_result $SERVER_MYPORT_3 MYPORT_3
-eval change master to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=no;
+eval change master to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=no;
start all slaves;
set default_master_connection = 'm1';
--source include/wait_for_slave_to_start.inc
@@ -78,11 +78,11 @@ drop database a;
drop database b;
drop database c;
--replace_result $SERVER_MYPORT_1 MYPORT_1
-eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root', master_use_gtid=no;
+eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=no;
--replace_result $SERVER_MYPORT_2 MYPORT_2
-eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root', master_use_gtid=no;
+eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=no;
--replace_result $SERVER_MYPORT_3 MYPORT_3
-eval change master to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=no;
+eval change master to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=no;
start all slaves;
set default_master_connection = 'm1';
--source include/wait_for_slave_to_start.inc
diff --git a/mysql-test/suite/multi_source/mdev-9544.result b/mysql-test/suite/multi_source/mdev-9544.result
index 452964fd..4468d9c1 100644
--- a/mysql-test/suite/multi_source/mdev-9544.result
+++ b/mysql-test/suite/multi_source/mdev-9544.result
@@ -24,9 +24,9 @@ insert into t1 values(1);
create table t2(a int);
insert into t2 values(1);
connection server_4;
-change master 'm1' to master_port=MYPORT_1 , master_host='127.0.0.1', master_user='root', master_use_gtid=no;
-change master 'm2' to master_port=MYPORT_2 , master_host='127.0.0.1', master_user='root', master_use_gtid=no;
-change master to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=no;
+change master 'm1' to master_port=MYPORT_1 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=no;
+change master 'm2' to master_port=MYPORT_2 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=no;
+change master to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=no;
start all slaves;
set default_master_connection = 'm1';
include/wait_for_slave_to_start.inc
diff --git a/mysql-test/suite/multi_source/mdev-9544.test b/mysql-test/suite/multi_source/mdev-9544.test
index c2626dc7..28a5cb11 100644
--- a/mysql-test/suite/multi_source/mdev-9544.test
+++ b/mysql-test/suite/multi_source/mdev-9544.test
@@ -38,11 +38,11 @@ insert into t2 values(1);
--connection server_4
--disable_warnings
--replace_result $SERVER_MYPORT_1 MYPORT_1
-eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root', master_use_gtid=no;
+eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=no;
--replace_result $SERVER_MYPORT_2 MYPORT_2
-eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root', master_use_gtid=no;
+eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=no;
--replace_result $SERVER_MYPORT_3 MYPORT_3
-eval change master to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=no;
+eval change master to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=no;
start all slaves;
set default_master_connection = 'm1';
--source include/wait_for_slave_to_start.inc
diff --git a/mysql-test/suite/multi_source/multi_parallel.result b/mysql-test/suite/multi_source/multi_parallel.result
index bca01d57..9553a627 100644
--- a/mysql-test/suite/multi_source/multi_parallel.result
+++ b/mysql-test/suite/multi_source/multi_parallel.result
@@ -5,11 +5,11 @@ set global slave_parallel_threads=10;
change master 'master1' to
master_port=MYPORT_1,
master_host='127.0.0.1',
-master_user='root';
+master_user='root', master_ssl_verify_server_cert=0;
change master 'master2' to
master_port=MYPORT_2,
master_host='127.0.0.1',
-master_user='root';
+master_user='root', master_ssl_verify_server_cert=0;
start all slaves;
set default_master_connection = 'master1';
include/wait_for_slave_to_start.inc
diff --git a/mysql-test/suite/multi_source/multi_parallel.test b/mysql-test/suite/multi_source/multi_parallel.test
index 2bbb3443..586e9106 100644
--- a/mysql-test/suite/multi_source/multi_parallel.test
+++ b/mysql-test/suite/multi_source/multi_parallel.test
@@ -18,13 +18,13 @@ set global slave_parallel_threads=10;
eval change master 'master1' to
master_port=$SERVER_MYPORT_1,
master_host='127.0.0.1',
-master_user='root';
+master_user='root', master_ssl_verify_server_cert=0;
--replace_result $SERVER_MYPORT_2 MYPORT_2
eval change master 'master2' to
master_port=$SERVER_MYPORT_2,
master_host='127.0.0.1',
-master_user='root';
+master_user='root', master_ssl_verify_server_cert=0;
#start all slaves
diff --git a/mysql-test/suite/multi_source/multi_source_slave_alias_replica.result b/mysql-test/suite/multi_source/multi_source_slave_alias_replica.result
index ce6efc26..4c721a17 100644
--- a/mysql-test/suite/multi_source/multi_source_slave_alias_replica.result
+++ b/mysql-test/suite/multi_source/multi_source_slave_alias_replica.result
@@ -2,8 +2,8 @@ connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
connection slave;
-CHANGE MASTER 'slave1' TO MASTER_PORT=MYPORT_1, MASTER_HOST='127.0.0.1', MASTER_USER='root';
-CHANGE MASTER 'slave2' TO MASTER_PORT=MYPORT_2, MASTER_HOST='127.0.0.1', MASTER_USER='root';
+CHANGE MASTER 'slave1' TO MASTER_PORT=MYPORT_1, MASTER_HOST='127.0.0.1', MASTER_USER='root', master_ssl_verify_server_cert=0;
+CHANGE MASTER 'slave2' TO MASTER_PORT=MYPORT_2, MASTER_HOST='127.0.0.1', MASTER_USER='root', master_ssl_verify_server_cert=0;
START REPLICA 'slave1';
SET default_master_connection = 'slave1';
include/wait_for_slave_to_start.inc
@@ -48,7 +48,7 @@ Relay_Log_Space <relay_log_space1>
Until_Condition None
Until_Log_File
Until_Log_Pos 0
-Master_SSL_Allowed No
+Master_SSL_Allowed Yes
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
@@ -110,7 +110,7 @@ Relay_Log_Space <relay_log_space1>
Until_Condition None
Until_Log_File
Until_Log_Pos 0
-Master_SSL_Allowed No
+Master_SSL_Allowed Yes
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
diff --git a/mysql-test/suite/multi_source/multi_source_slave_alias_replica.test b/mysql-test/suite/multi_source/multi_source_slave_alias_replica.test
index 409718dd..0e93d989 100644
--- a/mysql-test/suite/multi_source/multi_source_slave_alias_replica.test
+++ b/mysql-test/suite/multi_source/multi_source_slave_alias_replica.test
@@ -26,9 +26,9 @@
--connection slave
--replace_result $SERVER_MYPORT_1 MYPORT_1
-eval CHANGE MASTER 'slave1' TO MASTER_PORT=$SERVER_MYPORT_1, MASTER_HOST='127.0.0.1', MASTER_USER='root';
+eval CHANGE MASTER 'slave1' TO MASTER_PORT=$SERVER_MYPORT_1, MASTER_HOST='127.0.0.1', MASTER_USER='root', master_ssl_verify_server_cert=0;
--replace_result $SERVER_MYPORT_2 MYPORT_2
-eval CHANGE MASTER 'slave2' TO MASTER_PORT=$SERVER_MYPORT_2, MASTER_HOST='127.0.0.1', MASTER_USER='root';
+eval CHANGE MASTER 'slave2' TO MASTER_PORT=$SERVER_MYPORT_2, MASTER_HOST='127.0.0.1', MASTER_USER='root', master_ssl_verify_server_cert=0;
START REPLICA 'slave1';
SET default_master_connection = 'slave1';
--source include/wait_for_slave_to_start.inc
diff --git a/mysql-test/suite/multi_source/multisource.result b/mysql-test/suite/multi_source/multisource.result
index 4b53b465..ca420f9a 100644
--- a/mysql-test/suite/multi_source/multisource.result
+++ b/mysql-test/suite/multi_source/multisource.result
@@ -6,7 +6,8 @@ ERROR HY000: Incorrect arguments to MASTER_HOST
change master 'master1' to
master_port=MYPORT_1,
master_host='127.0.0.1',
-master_user='root';
+master_user='root',
+master_ssl_verify_server_cert=0;
start slave 'master1';
set default_master_connection = 'master1';
include/wait_for_slave_to_start.inc
@@ -100,6 +101,7 @@ change master to
master_port=MYPORT_2,
master_host='127.0.0.1',
master_user='root',
+master_ssl_verify_server_cert=0,
master_use_gtid=no;
start slave;
include/wait_for_slave_to_start.inc
diff --git a/mysql-test/suite/multi_source/multisource_for_channel.result b/mysql-test/suite/multi_source/multisource_for_channel.result
index 9b4efae0..44b6e33c 100644
--- a/mysql-test/suite/multi_source/multisource_for_channel.result
+++ b/mysql-test/suite/multi_source/multisource_for_channel.result
@@ -7,7 +7,7 @@ ERROR HY000: Incorrect arguments to MASTER_HOST
change master to
master_port=MYPORT_1,
master_host='127.0.0.1',
-master_user='root',
+master_user='root', master_ssl_verify_server_cert=0,
master_use_gtid=no
for channel 'master1';
start slave for channel 'master1';
@@ -103,7 +103,7 @@ set default_master_connection = '';
change master to
master_port=MYPORT_2,
master_host='127.0.0.1',
-master_user='root',
+master_user='root', master_ssl_verify_server_cert=0,
master_use_gtid=no;
start slave;
include/wait_for_slave_to_start.inc
diff --git a/mysql-test/suite/multi_source/multisource_for_channel.test b/mysql-test/suite/multi_source/multisource_for_channel.test
index b3feb4b9..0538abb5 100644
--- a/mysql-test/suite/multi_source/multisource_for_channel.test
+++ b/mysql-test/suite/multi_source/multisource_for_channel.test
@@ -29,7 +29,7 @@ change master to master_host='' for channel 'abc2';
eval change master to
master_port=$SERVER_MYPORT_1,
master_host='127.0.0.1',
-master_user='root',
+master_user='root', master_ssl_verify_server_cert=0,
master_use_gtid=no
for channel 'master1';
@@ -155,7 +155,7 @@ set default_master_connection = '';
eval change master to
master_port=$SERVER_MYPORT_2,
master_host='127.0.0.1',
-master_user='root',
+master_user='root', master_ssl_verify_server_cert=0,
master_use_gtid=no;
start slave;
diff --git a/mysql-test/suite/multi_source/my.cnf b/mysql-test/suite/multi_source/my.cnf
index d98e6b62..c4268848 100644
--- a/mysql-test/suite/multi_source/my.cnf
+++ b/mysql-test/suite/multi_source/my.cnf
@@ -1,6 +1,5 @@
# cat t/multisource1.cnf
-!include include/default_mysqld.cnf
-!include include/default_client.cnf
+!include include/default_my.cnf
[mysqld.1]
server-id=1
diff --git a/mysql-test/suite/multi_source/relaylog_events.result b/mysql-test/suite/multi_source/relaylog_events.result
index 5a4f480b..30c85727 100644
--- a/mysql-test/suite/multi_source/relaylog_events.result
+++ b/mysql-test/suite/multi_source/relaylog_events.result
@@ -2,7 +2,7 @@ connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
change master 'master1' to
master_port=MYPORT_1,
master_host='127.0.0.1',
-master_user='root';
+master_user='root', master_ssl_verify_server_cert=0;
start slave 'master1';
set default_master_connection = 'master1';
include/wait_for_slave_to_start.inc
diff --git a/mysql-test/suite/multi_source/relaylog_events.test b/mysql-test/suite/multi_source/relaylog_events.test
index 7e5257af..a88f8258 100644
--- a/mysql-test/suite/multi_source/relaylog_events.test
+++ b/mysql-test/suite/multi_source/relaylog_events.test
@@ -12,7 +12,7 @@
eval change master 'master1' to
master_port=$SERVER_MYPORT_1,
master_host='127.0.0.1',
-master_user='root';
+master_user='root', master_ssl_verify_server_cert=0;
start slave 'master1';
set default_master_connection = 'master1';
diff --git a/mysql-test/suite/multi_source/replicate_rewrite_db_dynamic.result b/mysql-test/suite/multi_source/replicate_rewrite_db_dynamic.result
index 3be8b364..6af9801d 100644
--- a/mysql-test/suite/multi_source/replicate_rewrite_db_dynamic.result
+++ b/mysql-test/suite/multi_source/replicate_rewrite_db_dynamic.result
@@ -3,8 +3,8 @@ connect server_2,127.0.0.1,root,,,$SERVER_MYPORT_2;
connect server_3,127.0.0.1,root,,,$SERVER_MYPORT_3;
# Connect the slave (server_3) to two masters (server_1 and server_2)
connection server_3;
-CHANGE MASTER 'm1' TO master_port=MYPORT_1, master_host='127.0.0.1', master_user='root';
-CHANGE MASTER 'm2' TO master_port=MYPORT_2, master_host='127.0.0.1', master_user='root';
+CHANGE MASTER 'm1' TO master_port=MYPORT_1, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0;
+CHANGE MASTER 'm2' TO master_port=MYPORT_2, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0;
# Apply events from server_1 (m1) into m1_test
create database m1_test;
SET @@global.'m1'.replicate_rewrite_db='test->m1_test';
diff --git a/mysql-test/suite/multi_source/replicate_rewrite_db_dynamic.test b/mysql-test/suite/multi_source/replicate_rewrite_db_dynamic.test
index e1bbfabe..b7ee8861 100644
--- a/mysql-test/suite/multi_source/replicate_rewrite_db_dynamic.test
+++ b/mysql-test/suite/multi_source/replicate_rewrite_db_dynamic.test
@@ -22,9 +22,9 @@
--echo # Connect the slave (server_3) to two masters (server_1 and server_2)
--connection server_3
--replace_result $SERVER_MYPORT_1 MYPORT_1
-eval CHANGE MASTER 'm1' TO master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root';
+eval CHANGE MASTER 'm1' TO master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0;
--replace_result $SERVER_MYPORT_2 MYPORT_2
-eval CHANGE MASTER 'm2' TO master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root';
+eval CHANGE MASTER 'm2' TO master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0;
--echo # Apply events from server_1 (m1) into m1_test
create database m1_test;
diff --git a/mysql-test/suite/multi_source/reset_slave.result b/mysql-test/suite/multi_source/reset_slave.result
index 6ff1f5a9..c859c5d7 100644
--- a/mysql-test/suite/multi_source/reset_slave.result
+++ b/mysql-test/suite/multi_source/reset_slave.result
@@ -1,7 +1,7 @@
connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
change master 'master1' to
master_port=MYPORT_1,
-master_host='127.0.0.1',
+master_host='127.0.0.1', master_ssl_verify_server_cert=0,
master_user='root';
start slave 'master1';
set default_master_connection = 'master1';
@@ -14,14 +14,14 @@ connection slave;
stop slave 'master1';
show slave 'master1' status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups Replicate_Rewrite_DB
- 127.0.0.1 root MYPORT_1 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-master1.000002 <relay_log_pos> master-bin.000001 No No 0 0 <read_master_log_pos> <relay_log_space> None 0 No NULL No 0 0 1 Slave_Pos 0-1-3 optimistic 0 NULL 2 1 0
+ 127.0.0.1 root MYPORT_1 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-master1.000002 <relay_log_pos> master-bin.000001 No No 0 0 <read_master_log_pos> <relay_log_space> None 0 Yes NULL No 0 0 1 Slave_Pos 0-1-3 optimistic 0 NULL 2 1 0
mysqld-relay-bin-master1.000001
mysqld-relay-bin-master1.000002
mysqld-relay-bin-master1.index
reset slave 'master1';
show slave 'master1' status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode SQL_Delay SQL_Remaining_Delay Slave_SQL_Running_State Slave_DDL_Groups Slave_Non_Transactional_Groups Slave_Transactional_Groups Replicate_Rewrite_DB
- 127.0.0.1 root MYPORT_1 60 4 <relay_log_pos> No No 0 0 0 <relay_log_space> None 0 No NULL No 0 0 1 Slave_Pos optimistic 0 NULL 2 1 0
+ 127.0.0.1 root MYPORT_1 60 4 <relay_log_pos> No No 0 0 0 <relay_log_space> None 0 Yes NULL No 0 0 1 Slave_Pos optimistic 0 NULL 2 1 0
reset slave 'master1' all;
show slave 'master1' status;
ERROR HY000: There is no master connection 'master1'
diff --git a/mysql-test/suite/multi_source/reset_slave.test b/mysql-test/suite/multi_source/reset_slave.test
index 34b42ae6..073fd6cc 100644
--- a/mysql-test/suite/multi_source/reset_slave.test
+++ b/mysql-test/suite/multi_source/reset_slave.test
@@ -11,7 +11,7 @@
--replace_result $SERVER_MYPORT_1 MYPORT_1
eval change master 'master1' to
master_port=$SERVER_MYPORT_1,
-master_host='127.0.0.1',
+master_host='127.0.0.1', master_ssl_verify_server_cert=0,
master_user='root';
start slave 'master1';
diff --git a/mysql-test/suite/multi_source/simple.result b/mysql-test/suite/multi_source/simple.result
index 61932184..f9f43d44 100644
--- a/mysql-test/suite/multi_source/simple.result
+++ b/mysql-test/suite/multi_source/simple.result
@@ -2,8 +2,8 @@ connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
connection slave;
-change master 'slave1' to master_port=MYPORT_1, master_host='127.0.0.1', master_user='root';
-change master 'slave2' to master_port=MYPORT_2, master_host='127.0.0.1', master_user='root';
+change master 'slave1' to master_port=MYPORT_1, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0;
+change master 'slave2' to master_port=MYPORT_2, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0;
start slave 'slave1';
set default_master_connection = 'slave1';
include/wait_for_slave_to_start.inc
@@ -46,7 +46,7 @@ Relay_Log_Space <relay_log_space1>
Until_Condition None
Until_Log_File
Until_Log_Pos 0
-Master_SSL_Allowed No
+Master_SSL_Allowed Yes
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
@@ -108,7 +108,7 @@ Relay_Log_Space <relay_log_space1>
Until_Condition None
Until_Log_File
Until_Log_Pos 0
-Master_SSL_Allowed No
+Master_SSL_Allowed Yes
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
@@ -151,7 +151,7 @@ HOST 127.0.0.1
PORT #
USER root
USING_GTID SLAVE_POS
-SSL_ALLOWED NO
+SSL_ALLOWED YES
SSL_CA_FILE
SSL_CA_PATH
SSL_CERTIFICATE
@@ -171,7 +171,7 @@ HOST 127.0.0.1
PORT #
USER root
USING_GTID SLAVE_POS
-SSL_ALLOWED NO
+SSL_ALLOWED YES
SSL_CA_FILE
SSL_CA_PATH
SSL_CERTIFICATE
@@ -235,7 +235,7 @@ Relay_Log_Space <relay_log_space1>
Until_Condition None
Until_Log_File
Until_Log_Pos 0
-Master_SSL_Allowed No
+Master_SSL_Allowed Yes
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
@@ -293,7 +293,7 @@ Relay_Log_Space <relay_log_space1>
Until_Condition None
Until_Log_File
Until_Log_Pos 0
-Master_SSL_Allowed No
+Master_SSL_Allowed Yes
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
@@ -355,7 +355,7 @@ Relay_Log_Space <relay_log_space1>
Until_Condition None
Until_Log_File
Until_Log_Pos 0
-Master_SSL_Allowed No
+Master_SSL_Allowed Yes
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
@@ -419,7 +419,7 @@ Relay_Log_Space <relay_log_space1>
Until_Condition None
Until_Log_File
Until_Log_Pos 0
-Master_SSL_Allowed No
+Master_SSL_Allowed Yes
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
@@ -485,7 +485,7 @@ Relay_Log_Space <relay_log_space1>
Until_Condition None
Until_Log_File
Until_Log_Pos 0
-Master_SSL_Allowed No
+Master_SSL_Allowed Yes
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
diff --git a/mysql-test/suite/multi_source/simple.test b/mysql-test/suite/multi_source/simple.test
index 070d4745..ac5e8458 100644
--- a/mysql-test/suite/multi_source/simple.test
+++ b/mysql-test/suite/multi_source/simple.test
@@ -13,9 +13,9 @@
--connection slave
--replace_result $SERVER_MYPORT_1 MYPORT_1
-eval change master 'slave1' to master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root';
+eval change master 'slave1' to master_port=$SERVER_MYPORT_1, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0;
--replace_result $SERVER_MYPORT_2 MYPORT_2
-eval change master 'slave2' to master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root';
+eval change master 'slave2' to master_port=$SERVER_MYPORT_2, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0;
start slave 'slave1';
set default_master_connection = 'slave1';
--source include/wait_for_slave_to_start.inc
diff --git a/mysql-test/suite/multi_source/skip_counter.result b/mysql-test/suite/multi_source/skip_counter.result
index 4573d54c..6473ee63 100644
--- a/mysql-test/suite/multi_source/skip_counter.result
+++ b/mysql-test/suite/multi_source/skip_counter.result
@@ -12,7 +12,7 @@ connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
change master 'master1' to
master_port=MYPORT_1,
master_host='127.0.0.1',
-master_user='root',
+master_user='root', master_ssl_verify_server_cert=0,
master_use_gtid=no;
start slave 'master1';
set default_master_connection = 'master1';
@@ -21,7 +21,7 @@ set default_master_connection = 'master2';
change master 'master2' to
master_port=MYPORT_2,
master_host='127.0.0.1',
-master_user='root',
+master_user='root', master_ssl_verify_server_cert=0,
master_use_gtid=no;
set global sql_slave_skip_counter = 2;
select @@global.sql_slave_skip_counter;
diff --git a/mysql-test/suite/multi_source/skip_counter.test b/mysql-test/suite/multi_source/skip_counter.test
index e89480f5..04aaf657 100644
--- a/mysql-test/suite/multi_source/skip_counter.test
+++ b/mysql-test/suite/multi_source/skip_counter.test
@@ -38,7 +38,7 @@ create table db.t3 (i int) engine=MyISAM;
eval change master 'master1' to
master_port=$SERVER_MYPORT_1,
master_host='127.0.0.1',
-master_user='root',
+master_user='root', master_ssl_verify_server_cert=0,
master_use_gtid=no;
start slave 'master1';
@@ -54,7 +54,7 @@ set default_master_connection = 'master2';
eval change master 'master2' to
master_port=$SERVER_MYPORT_2,
master_host='127.0.0.1',
-master_user='root',
+master_user='root', master_ssl_verify_server_cert=0,
master_use_gtid=no;
# the schema creation will be replicated from the 1st master,
diff --git a/mysql-test/suite/multi_source/status_vars.result b/mysql-test/suite/multi_source/status_vars.result
index 35a58e0f..7e91829a 100644
--- a/mysql-test/suite/multi_source/status_vars.result
+++ b/mysql-test/suite/multi_source/status_vars.result
@@ -3,7 +3,7 @@ call mtr.add_suppression("Connection 'master1' already exists");
change master 'master1' to
master_port=MYPORT_1,
master_host='127.0.0.1',
-master_user='root',
+master_user='root', master_ssl_verify_server_cert=0,
master_heartbeat_period = 25;
start slave 'master1';
set default_master_connection = 'master1';
@@ -12,7 +12,7 @@ set default_master_connection = '';
change master to
master_port=MYPORT_2,
master_host='127.0.0.1',
-master_user='root',
+master_user='root', master_ssl_verify_server_cert=0,
master_heartbeat_period=35;
start slave;
include/wait_for_slave_to_start.inc
diff --git a/mysql-test/suite/multi_source/status_vars.test b/mysql-test/suite/multi_source/status_vars.test
index e76a403d..eecf129e 100644
--- a/mysql-test/suite/multi_source/status_vars.test
+++ b/mysql-test/suite/multi_source/status_vars.test
@@ -15,7 +15,7 @@ call mtr.add_suppression("Connection 'master1' already exists");
eval change master 'master1' to
master_port=$SERVER_MYPORT_1,
master_host='127.0.0.1',
-master_user='root',
+master_user='root', master_ssl_verify_server_cert=0,
master_heartbeat_period = 25;
start slave 'master1';
@@ -31,7 +31,7 @@ set default_master_connection = '';
eval change master to
master_port=$SERVER_MYPORT_2,
master_host='127.0.0.1',
-master_user='root',
+master_user='root', master_ssl_verify_server_cert=0,
master_heartbeat_period=35;
start slave;
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/r/bug41029.result b/mysql-test/suite/optimizer_unfixed_bugs/r/bug41029.result
index eaad67de..b04b7551 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/r/bug41029.result
+++ b/mysql-test/suite/optimizer_unfixed_bugs/r/bug41029.result
@@ -15,8 +15,8 @@ create table t1 (dummy int primary key, a int unique, b int) engine=innodb;
insert into t1 values(1,1,1),(3,3,3),(5,5,5);
commit;
set session transaction isolation level repeatable read;
-select @@tx_isolation;
-@@tx_isolation
+select @@transaction_isolation;
+@@transaction_isolation
REPEATABLE-READ
start transaction;
select * from t1 where a > 2 for update;
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/r/bug42991.result b/mysql-test/suite/optimizer_unfixed_bugs/r/bug42991.result
index 40f505d8..b91883b1 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/r/bug42991.result
+++ b/mysql-test/suite/optimizer_unfixed_bugs/r/bug42991.result
@@ -9,8 +9,9 @@ set session debug_dbug="+d,optimizer_innodb_icp";
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
DROP TABLE IF EXISTS `table5`;
+Warnings:
+Note 1051 Unknown table 'test.table5'
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
CREATE TABLE `table5` (
@@ -207,6 +208,8 @@ KEY `idx11` (`col126`)
SET character_set_client = @saved_cs_client;
LOCK TABLES `table5` WRITE;
/*!40000 ALTER TABLE `table5` DISABLE KEYS */;
+Warnings:
+Note 1031 Storage engine InnoDB of the table `test`.`table5` doesn't have this option
INSERT INTO `table5` VALUES ('referenda','hermaphroditism','superable','00:00:00',-128,NULL,-128,'0000-00-00 00:00:00',NULL,-128,1901,NULL,'blandly',NULL,6541,'unsuspectingly',NULL,'7250','',NULL,-31358,26248,'Kilmarnock\'s',127,'-27305',28987,NULL,NULL,'-30388','utilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitariansutilitarians','0000-00-00','Agincourt','0000-00-00',-28063,27242,'readies',NULL,'00:00:00',NULL,-128,'',NULL,NULL,18719,NULL,NULL,14038,17275,NULL,'gait\'s','honeymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'shoneymoon\'sho',8860,NULL,'demigod','outpulling',NULL,'1904-01-17 09:51:06','test1','-18008','grotesqueness\'sgrotesqueness\'sgrotesqueness\'sgrotesqueness\'sgrotesqueness\'sgrotesqueness\'sgrotesqueness\'s','Oakleil\'s','Shostakovich','indiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscretionsindiscre','2076-10-05 02:05:43','29914',-18885,'2088-05-25 13:36:33','25',-128,'Bob','-14559','ammeter','0000-00-00','00:00:00',-29756,NULL,'digressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigressiondigression',-23894,1963,1915,'SadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadyeSadye',NULL,NULL,'','17512','','anaphylaxis\'s','chiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schiseler\'schise','50:11:25','test1','-13685',-18328,'2020-01-19 22:04:54',NULL,'1988-05-10 10:30:56','0000-00-00 00:00:00','Birdie\'s',-27746,NULL,'179:19:25',-128,24141,'radiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparentradiotransparen','ingroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'singroup\'sing',18950,'Beaulieu','0000-00-00 00:00:00',-23421,'-2865',NULL,NULL,NULL,NULL,'vandalizes',-24683,'interop','Apis\'s','0000-00-00',19745,'Volgograd\'s',-15194,NULL,'Binni','4540','phylumphylumphylumphylum','-25781',NULL,-128,'406:37:03','posthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthasteposthastepos','manneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristmanneristman','0000-00-00',19774,'shariah',NULL,'aquarelle','homographic',NULL,-18959,'thoroughfarethoroughfarethoroughfarethoroughfarethoroughfarethoroughfare','2000-09-05 03:33:50','Baptlsta','Witt\'sWitt\'sWitt\'sWitt\'sWitt\'sWitt\'sWitt\'sWitt\'s',4727,NULL,'posting',2119,'32416',NULL,'charredcharredcharredcharredcharredcharredcharredcharredcharredcharred',-128,NULL,'Rollin\'s',NULL,NULL,127,'waviness\'s',11164,'424:28:18','FaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucherFaucher','stalactite\'sstalactite\'sstalactite\'sstalactite\'sstalactite\'sstalactite\'sstalactite\'sstalactite\'sstalactite\'sstalactite\'sstalactite\'s','1901-01-29 13:48:34',-31988,'Dyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'sDyan\'s','','2022-01-01 21:14:30','0000-00-00','conventionalistconventionalistconventionalistconventionalistconventionalistconventionalistconventionalistconventionalist','mirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnessesmirthlessnesses','tessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stessellation\'stes','2028-05-21 04:56:16',NULL,'Hasid','Hardecanute','00:00:00',-3782);
Warnings:
Warning 1265 Data truncated for column 'col83' at row 1
@@ -236,6 +239,8 @@ INSERT INTO `table5` VALUES ('Frasquito\'s','unsatisfactory','jetted','00:00:00'
Warnings:
Warning 1265 Data truncated for column 'col57' at row 1
/*!40000 ALTER TABLE `table5` ENABLE KEYS */;
+Warnings:
+Note 1031 Storage engine InnoDB of the table `test`.`table5` doesn't have this option
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -244,7 +249,6 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
select * from `table5` where (col2 <= '6566-06-15' AND (col24 < 'd' or col24 > 'd')) group by `col83` order by `col83` desc ;
col0 col1 col2 col3 col4 col5 col6 col7 col8 col9 col10 col11 col12 col13 col14 col15 col16 col17 col18 col19 col20 col21 col22 col23 col24 col25 col26 col27 col28 col29 col30 col31 col32 col33 col34 col35 col36 col37 col38 col39 col40 col41 col42 col43 col44 col45 col46 col47 col48 col49 col50 col51 col52 col53 col54 col55 col56 col57 col58 col59 col60 col61 col62 col63 col64 col65 col66 col67 col68 col69 col70 col71 col72 col73 col74 col75 col76 col77 col78 col79 col80 col81 col82 col83 col84 col85 col86 col87 col88 col89 col90 col91 col92 col93 col94 col95 col96 col97 col98 col99 col100 col101 col102 col103 col104 col105 col106 col107 col108 col109 col110 col111 col112 col113 col114 col115 col116 col117 col118 col119 col120 col121 col122 col123 col124 col125 col126 col127 col128 col129 col130 col131 col132 col133 col134 col135 col136 col137 col138 col139 col140 col141 col142 col143 col144 col145 col146 col147 col148 col149 col150 col151 col152 col153 col154 col155 col156 col157 col158 col159 col160 col161 col162 col163 col164 col165 col166 col167 col168 col169 col170 col171 col172 col173 col174 col175
Warnings:
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/t/bug41029.test b/mysql-test/suite/optimizer_unfixed_bugs/t/bug41029.test
index b7c0dc53..ba5eea05 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/t/bug41029.test
+++ b/mysql-test/suite/optimizer_unfixed_bugs/t/bug41029.test
@@ -22,7 +22,7 @@ create table t1 (dummy int primary key, a int unique, b int) engine=innodb;
insert into t1 values(1,1,1),(3,3,3),(5,5,5);
commit;
set session transaction isolation level repeatable read;
-select @@tx_isolation;
+select @@transaction_isolation;
start transaction;
select * from t1 where a > 2 for update;
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/t/bug42991.test b/mysql-test/suite/optimizer_unfixed_bugs/t/bug42991.test
index 9e8e5c4b..1feddeea 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/t/bug42991.test
+++ b/mysql-test/suite/optimizer_unfixed_bugs/t/bug42991.test
@@ -10,7 +10,6 @@ SET @saved_dbug = @@SESSION.debug_dbug;
# Valgrind errors happen only with this:
set session debug_dbug="+d,optimizer_innodb_icp";
-
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
@@ -20,8 +19,6 @@ set session debug_dbug="+d,optimizer_innodb_icp";
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
-
DROP TABLE IF EXISTS `table5`;
SET @saved_cs_client = @@character_set_client;
@@ -239,8 +236,6 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-
#explain select * from `table5` where (col2 <= '6566-06-15' AND (col24 < 'd' or col24 > 'd') group by `col83` order by `col83` desc ;
diff --git a/mysql-test/suite/parts/inc/partition_decimal.inc b/mysql-test/suite/parts/inc/partition_decimal.inc
index 93e9e48c..4ad2a000 100644
--- a/mysql-test/suite/parts/inc/partition_decimal.inc
+++ b/mysql-test/suite/parts/inc/partition_decimal.inc
@@ -6,9 +6,11 @@ partition pa3 max_rows=30 min_rows=4,
partition pa4 max_rows=40 min_rows=2);
show create table t1;
insert into t1 values (999999.9999), (-999999.9999), (123456.7899), (-123456.7899), (-1.5), (1), (0), (-1), (1.5), (1234.567), (-1234.567);
+--sorted_result
select * from t1;
select * from t1 where a=1234.567;
delete from t1 where a=1234.567;
+--sorted_result
select * from t1;
drop table t1;
@@ -16,9 +18,11 @@ eval create table t2 (a decimal(18,9) not null, primary key(a)) engine=$engine
partition by key (a) partitions 10;
show create table t2;
insert into t2 values (999999999.999999999), (-999999999.999999999), (-1.5), (-1), (0), (1.5), (1234.567), (-1234.567);
+--sorted_result
select * from t2;
select * from t2 where a=1234.567;
delete from t2 where a=1234.567;
+--sorted_result
select * from t2;
delete from t2;
let $count=$maxrows;
diff --git a/mysql-test/suite/parts/inc/partition_double.inc b/mysql-test/suite/parts/inc/partition_double.inc
index 9e43887b..dd2fd100 100644
--- a/mysql-test/suite/parts/inc/partition_double.inc
+++ b/mysql-test/suite/parts/inc/partition_double.inc
@@ -6,9 +6,11 @@ partition pa3 max_rows=30 min_rows=4,
partition pa4 max_rows=40 min_rows=2);
show create table t1;
insert into t1 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208);
+--sorted_result
select * from t1;
select * from t1 where a=1.5;
delete from t1 where a=1.5;
+--sorted_result
select * from t1;
drop table t1;
@@ -16,9 +18,11 @@ eval create table t2 (a double not null, primary key(a)) engine=$engine
partition by key (a) partitions 10;
show create table t2;
insert into t2 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208);
+--sorted_result
select * from t2;
select * from t2 where a=1234.567;
delete from t2 where a=1234.567;
+--sorted_result
select * from t2;
delete from t2;
let $count=$maxrows;
diff --git a/mysql-test/suite/parts/inc/partition_key_16col.inc b/mysql-test/suite/parts/inc/partition_key_16col.inc
index 988dc455..e7917451 100644
--- a/mysql-test/suite/parts/inc/partition_key_16col.inc
+++ b/mysql-test/suite/parts/inc/partition_key_16col.inc
@@ -10,6 +10,7 @@ insert into t1 values
('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127,'1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'),
('1980-10-14', 'fgbbd', 'dtzndtz', 'w', 67856, 5463354.67, 3567845333, 124,'1980-10-14', 'fgbbd', 'dtzndtz', 'w', 67856, 5463354.67, 3567845333, 124, 'd,f söierugsig msireg siug ei5ggth lrutluitgzeöjrtnb.rkjthuekuhzrkuthgjdnffjmbr'),
('2000-06-15', 'jukg','zikhuk','m', 45675, 6465754.13, 435242623462, 18, '2000-06-15', 'jukg','zikhuk','m', 45675, 6465754.13, 435242623462, 18, 'pib mdotkbm.m');
+--sorted_result
select * from t1;
select * from t1 where a<19851231;
drop table t1;
diff --git a/mysql-test/suite/parts/inc/partition_key_32col.inc b/mysql-test/suite/parts/inc/partition_key_32col.inc
index 0acedefa..880751db 100644
--- a/mysql-test/suite/parts/inc/partition_key_32col.inc
+++ b/mysql-test/suite/parts/inc/partition_key_32col.inc
@@ -28,6 +28,7 @@ insert into t1 values
('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127,'1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, '1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, '1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'),
('1980-10-14', 'fgbbd', 'dtzndtz', 'w', 67856, 5463354.67, 3567845333, 124, '1980-10-14', 'fgbbd', 'dtzndtz', 'w', 67856, 5463354.67, 3567845333, 124, '1980-10-14', 'fgbbd', 'dtzndtz', 'w', 67856, 5463354.67, 3567845333, 124, '1980-10-14', 'fgbbd', 'dtzndtz', 'w', 67856, 5463354.67, 3567845333, 124, 'd,f söierugsig msireg siug ei5ggth lrutluitgzeöjrtnb.rkjthuekuhzrkuthgjdnffjmbr'),
('2000-06-15', 'jukg','zikhuk','m', 45675, 6465754.13, 435242623462, 18, '2000-06-15', 'jukg','zikhuk','m', 45675, 6465754.13, 435242623462, 18, '2000-06-15', 'jukg','zikhuk','m', 45675, 6465754.13, 435242623462, 18, '2000-06-15', 'jukg','zikhuk','m', 45675, 6465754.13, 435242623462, 18, 'pib mdotkbm.m');
+--sorted_result
select * from t1;
select * from t1 where a<19851231;
drop table t1;
diff --git a/mysql-test/suite/parts/inc/partition_key_4col.inc b/mysql-test/suite/parts/inc/partition_key_4col.inc
index a94ab581..706c8add 100644
--- a/mysql-test/suite/parts/inc/partition_key_4col.inc
+++ b/mysql-test/suite/parts/inc/partition_key_4col.inc
@@ -10,6 +10,7 @@ insert into t1 values
('1983-12-31', 'cdef', 'srtbvsr', 'w'),
('1980-10-14', 'fgbbd', 'dtzndtz', 'w'),
('2000-06-15', 'jukg','zikhuk','m');
+--sorted_result
select * from t1;
select * from t1 where a<19851231;
drop table t1;
diff --git a/mysql-test/suite/parts/inc/partition_key_8col.inc b/mysql-test/suite/parts/inc/partition_key_8col.inc
index fcbab7c3..1e49ee0b 100644
--- a/mysql-test/suite/parts/inc/partition_key_8col.inc
+++ b/mysql-test/suite/parts/inc/partition_key_8col.inc
@@ -10,6 +10,7 @@ insert into t1 values
('1983-12-31', 'cdef', 'srtbvsr', 'w', 45634, 13452.56, 3452346456, 127, 'liuugbzvdmrlti b itiortudirtfgtibm dfi'),
('1980-10-14', 'fgbbd', 'dtzndtz', 'w', 67856, 5463354.67, 3567845333, 124, 'd,f söierugsig msireg siug ei5ggth lrutluitgzeöjrtnb.rkjthuekuhzrkuthgjdnffjmbr'),
('2000-06-15', 'jukg','zikhuk','m', 45675, 6465754.13, 435242623462, 18, 'pib mdotkbm.m' );
+--sorted_result
select * from t1;
select * from t1 where a<19851231;
drop table t1;
diff --git a/mysql-test/suite/parts/inc/partition_time.inc b/mysql-test/suite/parts/inc/partition_time.inc
index 674fe546..5f9466ba 100644
--- a/mysql-test/suite/parts/inc/partition_time.inc
+++ b/mysql-test/suite/parts/inc/partition_time.inc
@@ -57,7 +57,7 @@ dec $count;
commit;
--enable_query_log
select count(*) from t3;
-select * from t3;
+select a, second(a), if(second(a)<16,1,if(second(a)<31,2,if(second(a)<45,3,4))) from t3;
drop table t3;
eval create table t4 (a time not null, primary key(a)) engine=$engine
diff --git a/mysql-test/suite/parts/inc/partition_timestamp.inc b/mysql-test/suite/parts/inc/partition_timestamp.inc
index fb1bf391..53334c13 100644
--- a/mysql-test/suite/parts/inc/partition_timestamp.inc
+++ b/mysql-test/suite/parts/inc/partition_timestamp.inc
@@ -6,9 +6,11 @@ partition pa3 max_rows=30 min_rows=4,
partition pa4 max_rows=40 min_rows=2);
show create table t1;
insert into t1 values ('1975-01-01 21:21:21'), ('2020-12-31 12:10:30'), ('1980-10-14 03:03'), ('2000-06-15 23:59');
+--sorted_result
select * from t1;
select * from t1 where a=19801014030300;
delete from t1 where a=19801014030300;
+--sorted_result
select * from t1;
drop table t1;
@@ -16,9 +18,11 @@ eval create table t2 (a timestamp not null DEFAULT CURRENT_TIMESTAMP ON UPDATE C
partition by key (a) partitions 12;
show create table t2;
insert into t2 values ('1975-01-01 0:1:1'), ('2020-12-31 10:11:12'), ('1980-10-14 13:14:15'), ('2000-06-15 14:15:16');
+--sorted_result
select * from t2;
select * from t2 where a='1980-10-14 13:14:15';
delete from t2 where a='1980-10-14 13:14:15';
+--sorted_result
select * from t2;
delete from t2;
let $count=59;
@@ -33,6 +37,7 @@ dec $count;
commit;
--enable_query_log
select count(*) from t2;
+--sorted_result
select * from t2;
drop table t2;
diff --git a/mysql-test/suite/parts/r/alter_data_directory_innodb.result b/mysql-test/suite/parts/r/alter_data_directory_innodb.result
index 8c07093f..e8f97637 100644
--- a/mysql-test/suite/parts/r/alter_data_directory_innodb.result
+++ b/mysql-test/suite/parts/r/alter_data_directory_innodb.result
@@ -40,6 +40,8 @@ t CREATE TABLE `t` (
PARTITION `p2` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB)
SET @TMP = @@GLOBAL.INNODB_FILE_PER_TABLE;
SET GLOBAL INNODB_FILE_PER_TABLE=OFF;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
ALTER TABLE t ADD PRIMARY KEY pk(a), ALGORITHM=INPLACE;
Warnings:
Warning 1280 Name 'pk' ignored for PRIMARY key.
@@ -53,6 +55,8 @@ t CREATE TABLE `t` (
(PARTITION `p1` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB,
PARTITION `p2` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB)
SET GLOBAL INNODB_FILE_PER_TABLE=@TMP;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
ALTER TABLE t REORGANIZE PARTITION p1,p2 INTO (
PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_somewhere_else/' ENGINE = INNODB,
PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_somewhere_else/' ENGINE = INNODB
diff --git a/mysql-test/suite/parts/r/alter_table.result b/mysql-test/suite/parts/r/alter_table.result
index 8f633370..0a78be2b 100644
--- a/mysql-test/suite/parts/r/alter_table.result
+++ b/mysql-test/suite/parts/r/alter_table.result
@@ -370,3 +370,185 @@ connection default;
drop user u@localhost;
drop database db;
# End of 10.11 tests
+#
+# MDEV-22164 without validation for exchange partition/convert in
+#
+call mtr.add_suppression('was altered WITHOUT');
+create table validation(x int);
+drop table validation;
+create table t (a int primary key);
+create table tp (a int primary key) partition by range (a) (
+partition p0 values less than (100),
+p1 values less than (300));
+insert into t values (1), (99);
+insert into tp values (2), (200);
+select * from t order by a;
+a
+1
+99
+select * from tp partition (p0) order by a;
+a
+2
+select * from tp partition (p1) order by a;
+a
+200
+alter table tp exchange partition p0 with table t;
+select * from t order by a;
+a
+2
+select * from tp partition (p0) order by a;
+a
+1
+99
+select * from tp partition (p1) order by a;
+a
+200
+alter table tp exchange partition p0 with table t;
+select * from t order by a;
+a
+1
+99
+select * from tp partition (p0) order by a;
+a
+2
+select * from tp partition (p1) order by a;
+a
+200
+alter table tp exchange partition p1 with table t;
+ERROR HY000: Found a row that does not match the partition
+alter table tp exchange partition p1 with table t with validation;
+ERROR HY000: Found a row that does not match the partition
+alter table tp exchange partition p1 with table t without validation;
+FOUND 1 /Table `test`.`tp` was altered WITHOUT VALIDATION: the table might be corrupted/ in mysqld.1.err
+select * from t order by a;
+a
+200
+select * from tp partition (p1) order by a;
+a
+1
+99
+alter table tp check partition p0;
+Table Op Msg_type Msg_text
+test.tp check status OK
+alter table tp check partition p1;
+Table Op Msg_type Msg_text
+test.tp check error Found a misplaced row
+test.tp check error Partition p1 returned error
+test.tp check error Upgrade required. Please do "REPAIR TABLE `tp`" or dump/reload to fix it!
+alter table tp exchange partition p1 with table t with validation;
+alter table tp exchange partition p1 with table t with validation;
+ERROR HY000: Found a row that does not match the partition
+select * from t order by a;
+a
+1
+99
+select * from tp partition (p1) order by a;
+a
+200
+create or replace procedure validation()
+alter table tp exchange partition p1 with table t with validation;
+create or replace procedure without_validation()
+alter table tp exchange partition p1 with table t without validation;
+call validation;
+ERROR HY000: Found a row that does not match the partition
+call without_validation;
+FOUND 2 /Table `test`.`tp` was altered WITHOUT VALIDATION: the table might be corrupted/ in mysqld.1.err
+call validation;
+call validation;
+ERROR HY000: Found a row that does not match the partition
+call without_validation;
+FOUND 3 /Table `test`.`tp` was altered WITHOUT VALIDATION: the table might be corrupted/ in mysqld.1.err
+select * from t order by a;
+a
+200
+select * from tp partition (p1) order by a;
+a
+1
+99
+call validation;
+select * from t order by a;
+a
+1
+99
+select * from tp partition (p1) order by a;
+a
+200
+drop procedure validation;
+drop procedure without_validation;
+prepare validation from "alter table tp exchange partition p1 with table t with validation";
+prepare without_validation from "alter table tp exchange partition p1 with table t without validation";
+execute validation;
+ERROR HY000: Found a row that does not match the partition
+execute without_validation;
+FOUND 4 /Table `test`.`tp` was altered WITHOUT VALIDATION: the table might be corrupted/ in mysqld.1.err
+execute validation;
+execute validation;
+ERROR HY000: Found a row that does not match the partition
+execute without_validation;
+FOUND 5 /Table `test`.`tp` was altered WITHOUT VALIDATION: the table might be corrupted/ in mysqld.1.err
+select * from t order by a;
+a
+200
+select * from tp partition (p1) order by a;
+a
+1
+99
+execute validation;
+select * from t order by a;
+a
+1
+99
+select * from tp partition (p1) order by a;
+a
+200
+drop prepare validation;
+drop prepare without_validation;
+alter table tp convert table t to partition p2 values less than (maxvalue);
+ERROR HY000: Found a row that does not match the partition
+alter table tp convert table t to partition p2 values less than (maxvalue) with validation;
+ERROR HY000: Found a row that does not match the partition
+alter table tp convert table t to partition p2 values less than (maxvalue) without validation;
+FOUND 6 /Table `test`.`tp` was altered WITHOUT VALIDATION: the table might be corrupted/ in mysqld.1.err
+select * from tp partition (p0) order by a;
+a
+2
+select * from tp partition (p1) order by a;
+a
+200
+select * from tp partition (p2) order by a;
+a
+1
+99
+create table t (a int primary key);
+insert t values (1), (2);
+create or replace table tp (a int primary key)
+partition by hash(a) partitions 2;
+insert tp values (1), (2), (3), (4);
+alter table tp exchange partition p0 with table t;
+ERROR HY000: Found a row that does not match the partition
+alter table tp exchange partition p0 with table t without validation;
+FOUND 7 /Table `test`.`tp` was altered WITHOUT VALIDATION: the table might be corrupted/ in mysqld.1.err
+select * from t;
+a
+2
+4
+alter table tp exchange partition p0 with table t;
+drop table tp;
+create or replace table tp (a int primary key)
+partition by list(a) (
+partition p0 values in (2, 3, 4),
+partition p1 values in (12, 13, 14),
+partition p2 values in (52, 53, 54));
+insert tp values (12), (2), (3), (4);
+alter table tp exchange partition p0 with table t;
+ERROR HY000: Table has no partition for value 0
+alter table tp exchange partition p0 with table t without validation;
+FOUND 8 /Table `test`.`tp` was altered WITHOUT VALIDATION: the table might be corrupted/ in mysqld.1.err
+select * from t;
+a
+2
+3
+4
+alter table tp exchange partition p0 with table t;
+drop tables tp, t;
+# End of 11.4 tests
diff --git a/mysql-test/suite/parts/r/longname.result b/mysql-test/suite/parts/r/longname.result
index eb850d6f..8524eb84 100644
--- a/mysql-test/suite/parts/r/longname.result
+++ b/mysql-test/suite/parts/r/longname.result
@@ -31,6 +31,8 @@ PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB);
ERROR HY000: The path specified for @0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@... is too long
SET @file_per_table=@@GLOBAL.innodb_file_per_table;
SET GLOBAL innodb_file_per_table=0;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
CREATE TABLE mysqltest1.t1 (a INT) ENGINE=INNODB
PARTITION BY RANGE (a) SUBPARTITION BY HASH(a)
(PARTITION `$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$`
@@ -41,6 +43,8 @@ SUBPARTITION
`0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef`)
);
SET GLOBAL innodb_file_per_table=@file_per_table;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
SHOW CREATE TABLE mysqltest1.t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/suite/parts/r/optimizer.result b/mysql-test/suite/parts/r/optimizer.result
index 42d85dbb..95f0e561 100644
--- a/mysql-test/suite/parts/r/optimizer.result
+++ b/mysql-test/suite/parts/r/optimizer.result
@@ -22,10 +22,10 @@ INSERT INTO t2 SELECT * FROM t1;
# plans should be identical
EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10,100) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range a a 5 NULL 2 Using where; Using index
+1 SIMPLE t1 range a a 5 NULL 2 Using where; Using index for group-by
EXPLAIN SELECT a, MAX(b) FROM t2 WHERE a IN (10,100) GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t2 range a a 5 NULL 2 Using where; Using index
+1 SIMPLE t2 range a a 5 NULL 2 Using where; Using index for group-by
FLUSH status;
SELECT a, MAX(b) FROM t1 WHERE a IN (10, 100) GROUP BY a;
a MAX(b)
@@ -33,7 +33,7 @@ a MAX(b)
# Should be no more than 4 reads.
SHOW status LIKE 'handler_read_key';
Variable_name Value
-Handler_read_key 2
+Handler_read_key 4
FLUSH status;
SELECT a, MAX(b) FROM t2 WHERE a IN (10, 100) GROUP BY a;
a MAX(b)
@@ -41,5 +41,5 @@ a MAX(b)
# Should be no more than 4 reads.
SHOW status LIKE 'handler_read_key';
Variable_name Value
-Handler_read_key 2
+Handler_read_key 4
DROP TABLE t1, t2;
diff --git a/mysql-test/suite/parts/r/partition_basic_symlink_innodb.result b/mysql-test/suite/parts/r/partition_basic_symlink_innodb.result
index 9d05d04c..6d361bb1 100644
--- a/mysql-test/suite/parts/r/partition_basic_symlink_innodb.result
+++ b/mysql-test/suite/parts/r/partition_basic_symlink_innodb.result
@@ -8,6 +8,8 @@ SET SESSION innodb_strict_mode = ON;
# InnoDB only supports DATA DIRECTORY with innodb_file_per_table=ON
#
SET GLOBAL innodb_file_per_table = OFF;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
CREATE TABLE t1 (c1 INT) ENGINE = InnoDB
PARTITION BY HASH (c1) (
PARTITION p0
@@ -36,6 +38,8 @@ Error 6 Error on delete of 'MYSQLD_DATADIR/test/t1.par' (Errcode: 2 "No such fil
#
SET SESSION innodb_strict_mode = OFF;
SET GLOBAL innodb_file_per_table = ON;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
CREATE TABLE t1 (c1 INT) ENGINE = InnoDB
PARTITION BY HASH (c1)
(PARTITION p0
@@ -134,6 +138,8 @@ DROP TABLE t1;
# properly when used with DATA DIRECTORY
#
SET GLOBAL innodb_file_per_table = ON;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
CREATE TABLE t1
(
myid INT(11) NOT NULL,
@@ -326,4 +332,6 @@ DROP TABLE t1, t2;
# Cleanup
#
SET GLOBAL innodb_file_per_table=@file_per_table;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
SET SESSION innodb_strict_mode=@strict_mode;
diff --git a/mysql-test/suite/parts/r/partition_char_innodb.result b/mysql-test/suite/parts/r/partition_char_innodb.result
index 3131ba58..da6f9bb6 100644
--- a/mysql-test/suite/parts/r/partition_char_innodb.result
+++ b/mysql-test/suite/parts/r/partition_char_innodb.result
Binary files differ
diff --git a/mysql-test/suite/parts/r/partition_datetime_innodb.result b/mysql-test/suite/parts/r/partition_datetime_innodb.result
index 8779bfea..f00b7a3e 100644
--- a/mysql-test/suite/parts/r/partition_datetime_innodb.result
+++ b/mysql-test/suite/parts/r/partition_datetime_innodb.result
@@ -145,19 +145,19 @@ t1 CREATE TABLE `t1` (
insert into t1 values ('1975-01-01'), ('2020-12-31'), ('1980-10-14'), ('2000-06-15');
select * from t1;
a
-1975-01-01
1980-10-14
-2000-06-15
2020-12-31
+1975-01-01
+2000-06-15
select * from t1 where a=19801014;
a
1980-10-14
delete from t1 where a=19801014;
select * from t1;
a
+2020-12-31
1975-01-01
2000-06-15
-2020-12-31
drop table t1;
create table t2 (a date not null, primary key(a)) engine='InnoDB'
partition by key (a) partitions 12;
@@ -174,8 +174,8 @@ select * from t2;
a
1975-01-01
1980-10-14
-2000-06-15
2020-12-31
+2000-06-15
select * from t2 where a='1980-10-14';
a
1980-10-14
@@ -183,8 +183,8 @@ delete from t2 where a='1980-10-14';
select * from t2;
a
1975-01-01
-2000-06-15
2020-12-31
+2000-06-15
delete from t2;
28 inserts;
select count(*) from t2;
@@ -192,90 +192,90 @@ count(*)
84
select * from t2;
a
-1970-01-01
-1970-01-02
-1970-01-03
1970-01-04
-1970-01-05
-1970-01-06
-1970-01-07
-1970-01-08
-1970-01-09
-1970-01-10
-1970-01-11
1970-01-12
-1970-01-13
1970-01-14
-1970-01-15
-1970-01-16
-1970-01-17
-1970-01-18
-1970-01-19
-1970-01-20
-1970-01-21
-1970-01-22
-1970-01-23
1970-01-24
-1970-01-25
-1970-01-26
-1970-01-27
1970-01-28
-1970-02-01
1970-02-02
-1970-02-03
1970-02-04
-1970-02-05
-1970-02-06
-1970-02-07
-1970-02-08
-1970-02-09
1970-02-10
-1970-02-11
-1970-02-12
-1970-02-13
1970-02-14
-1970-02-15
1970-02-16
-1970-02-17
-1970-02-18
-1970-02-19
-1970-02-20
-1970-02-21
-1970-02-22
-1970-02-23
-1970-02-24
-1970-02-25
-1970-02-26
-1970-02-27
-1970-02-28
-1970-03-01
-1970-03-02
-1970-03-03
1970-03-04
-1970-03-05
1970-03-06
+1970-03-12
+1970-01-13
+1970-01-27
+1970-02-03
+1970-02-09
+1970-02-13
+1970-02-21
+1970-03-05
1970-03-07
-1970-03-08
1970-03-09
-1970-03-10
-1970-03-11
-1970-03-12
-1970-03-13
-1970-03-14
1970-03-15
+1970-03-23
+1970-01-06
+1970-01-08
+1970-01-16
+1970-01-18
+1970-01-22
+1970-02-06
+1970-02-12
+1970-02-20
+1970-02-22
+1970-02-28
+1970-03-02
+1970-03-08
1970-03-16
-1970-03-17
-1970-03-18
-1970-03-19
1970-03-20
-1970-03-21
1970-03-22
-1970-03-23
1970-03-24
+1970-01-05
+1970-01-07
+1970-01-11
+1970-01-15
+1970-01-21
+1970-02-01
+1970-02-11
+1970-02-15
+1970-02-19
+1970-03-03
+1970-03-11
+1970-03-13
+1970-03-17
+1970-03-19
1970-03-25
-1970-03-26
1970-03-27
+1970-01-02
+1970-01-10
+1970-01-20
+1970-01-26
+1970-02-08
+1970-02-18
+1970-02-24
+1970-02-26
+1970-03-10
+1970-03-14
+1970-03-18
+1970-03-26
1970-03-28
+1970-01-01
+1970-01-03
+1970-01-09
+1970-01-17
+1970-01-19
+1970-01-23
+1970-01-25
+1970-02-05
+1970-02-07
+1970-02-17
+1970-02-23
+1970-02-25
+1970-02-27
+1970-03-01
+1970-03-21
drop table t2;
create table t3 (a date not null, primary key(a)) engine='InnoDB'
partition by range (month(a)) subpartition by key (a)
@@ -304,18 +304,18 @@ count(*)
12
select * from t3;
a
-1970-01-01
1970-02-01
+1970-01-01
1970-03-01
1970-04-01
1970-05-01
1970-06-01
+1970-09-01
1970-07-01
1970-08-01
-1970-09-01
+1970-12-01
1970-10-01
1970-11-01
-1970-12-01
drop table t3;
create table t4 (a date not null, primary key(a)) engine='InnoDB'
partition by list (month(a)) subpartition by key (a)
@@ -344,18 +344,18 @@ count(*)
12
select * from t4;
a
-1970-01-01
1970-02-01
+1970-01-01
1970-03-01
1970-04-01
1970-05-01
1970-06-01
+1970-09-01
1970-07-01
1970-08-01
-1970-09-01
+1970-12-01
1970-10-01
1970-11-01
-1970-12-01
drop table t4;
create table t1 (a time not null, primary key(a)) engine='InnoDB'
partition by key (a) (
@@ -378,18 +378,18 @@ insert into t1 values ('21:21:21'), ('12:10:30'), ('03:03:03'), ('23:59');
select * from t1;
a
03:03:03
-12:10:30
21:21:21
23:59:00
+12:10:30
select * from t1 where a=030303;
a
03:03:03
delete from t1 where a=030303;
select * from t1;
a
-12:10:30
21:21:21
23:59:00
+12:10:30
drop table t1;
create table t2 (a time not null, primary key(a)) engine='InnoDB'
partition by key (a) partitions 12;
@@ -404,19 +404,19 @@ PARTITIONS 12
insert into t2 values ('0:1:1'), ('10:11:12'), ('13:14:15'), ('14:15:16');
select * from t2;
a
-00:01:01
10:11:12
13:14:15
14:15:16
+00:01:01
select * from t2 where a='13:14:15';
a
13:14:15
delete from t2 where a='13:14:15';
select * from t2;
a
-00:01:01
10:11:12
14:15:16
+00:01:01
delete from t2;
59 inserts;
select count(*) from t2;
@@ -424,65 +424,65 @@ count(*)
59
select * from t2;
a
-00:01:01
-00:01:02
-00:01:03
-00:01:04
+00:01:15
+00:01:23
+00:01:39
+00:01:47
+00:01:59
+00:01:16
+00:01:24
+00:01:40
+00:01:48
00:01:05
-00:01:06
-00:01:07
-00:01:08
-00:01:09
-00:01:10
-00:01:11
-00:01:12
00:01:13
+00:01:21
+00:01:37
+00:01:45
+00:01:57
00:01:14
-00:01:15
-00:01:16
-00:01:17
-00:01:18
+00:01:22
+00:01:38
+00:01:46
+00:01:58
+00:01:03
+00:01:11
00:01:19
+00:01:35
+00:01:43
+00:01:55
+00:01:04
+00:01:12
00:01:20
-00:01:21
-00:01:22
-00:01:23
-00:01:24
-00:01:25
-00:01:26
-00:01:27
-00:01:28
+00:01:36
+00:01:44
+00:01:56
+00:01:01
+00:01:09
00:01:29
-00:01:30
-00:01:31
-00:01:32
00:01:33
-00:01:34
-00:01:35
-00:01:36
-00:01:37
-00:01:38
-00:01:39
-00:01:40
00:01:41
+00:01:53
+00:01:02
+00:01:10
+00:01:18
+00:01:34
00:01:42
-00:01:43
-00:01:44
-00:01:45
-00:01:46
-00:01:47
-00:01:48
-00:01:49
-00:01:50
+00:01:54
+00:01:07
+00:01:27
+00:01:31
00:01:51
+00:01:08
+00:01:28
+00:01:32
00:01:52
-00:01:53
-00:01:54
-00:01:55
-00:01:56
-00:01:57
-00:01:58
-00:01:59
+00:01:17
+00:01:25
+00:01:49
+00:01:06
+00:01:26
+00:01:30
+00:01:50
drop table t2;
create table t3 (a time not null, primary key(a)) engine='InnoDB'
partition by range (second(a)) subpartition by key (a)
@@ -509,67 +509,67 @@ SUBPARTITIONS 3
select count(*) from t3;
count(*)
59
-select * from t3;
-a
-10:00:01
-10:00:02
-10:00:03
-10:00:04
-10:00:05
-10:00:06
-10:00:07
-10:00:08
-10:00:09
-10:00:10
-10:00:11
-10:00:12
-10:00:13
-10:00:14
-10:00:15
-10:00:16
-10:00:17
-10:00:18
-10:00:19
-10:00:20
-10:00:21
-10:00:22
-10:00:23
-10:00:24
-10:00:25
-10:00:26
-10:00:27
-10:00:28
-10:00:29
-10:00:30
-10:00:31
-10:00:32
-10:00:33
-10:00:34
-10:00:35
-10:00:36
-10:00:37
-10:00:38
-10:00:39
-10:00:40
-10:00:41
-10:00:42
-10:00:43
-10:00:44
-10:00:45
-10:00:46
-10:00:47
-10:00:48
-10:00:49
-10:00:50
-10:00:51
-10:00:52
-10:00:53
-10:00:54
-10:00:55
-10:00:56
-10:00:57
-10:00:58
-10:00:59
+select a, second(a), if(second(a)<16,1,if(second(a)<31,2,if(second(a)<45,3,4))) from t3;
+a second(a) if(second(a)<16,1,if(second(a)<31,2,if(second(a)<45,3,4)))
+10:00:01 1 1
+10:00:06 6 1
+10:00:07 7 1
+10:00:14 14 1
+10:00:15 15 1
+10:00:02 2 1
+10:00:03 3 1
+10:00:08 8 1
+10:00:09 9 1
+10:00:04 4 1
+10:00:05 5 1
+10:00:10 10 1
+10:00:11 11 1
+10:00:12 12 1
+10:00:13 13 1
+10:00:20 20 2
+10:00:21 21 2
+10:00:26 26 2
+10:00:27 27 2
+10:00:16 16 2
+10:00:17 17 2
+10:00:22 22 2
+10:00:23 23 2
+10:00:28 28 2
+10:00:29 29 2
+10:00:18 18 2
+10:00:19 19 2
+10:00:24 24 2
+10:00:25 25 2
+10:00:30 30 2
+10:00:32 32 3
+10:00:33 33 3
+10:00:35 35 3
+10:00:40 40 3
+10:00:41 41 3
+10:00:34 34 3
+10:00:36 36 3
+10:00:37 37 3
+10:00:42 42 3
+10:00:43 43 3
+10:00:31 31 3
+10:00:38 38 3
+10:00:39 39 3
+10:00:44 44 3
+10:00:45 45 4
+10:00:46 46 4
+10:00:48 48 4
+10:00:49 49 4
+10:00:54 54 4
+10:00:55 55 4
+10:00:50 50 4
+10:00:51 51 4
+10:00:56 56 4
+10:00:57 57 4
+10:00:59 59 4
+10:00:47 47 4
+10:00:52 52 4
+10:00:53 53 4
+10:00:58 58 4
drop table t3;
create table t4 (a time not null, primary key(a)) engine='InnoDB'
partition by list (second(a)) subpartition by key (a)
@@ -599,64 +599,64 @@ count(*)
select * from t4;
a
10:00:01
-10:00:02
-10:00:03
-10:00:04
-10:00:05
10:00:06
10:00:07
+10:00:14
+10:00:15
+10:00:02
+10:00:03
10:00:08
10:00:09
+10:00:04
+10:00:05
10:00:10
10:00:11
10:00:12
10:00:13
-10:00:14
-10:00:15
-10:00:16
-10:00:17
-10:00:18
-10:00:19
10:00:20
10:00:21
-10:00:22
-10:00:23
-10:00:24
-10:00:25
10:00:26
10:00:27
+10:00:16
+10:00:17
+10:00:22
+10:00:23
10:00:28
10:00:29
+10:00:18
+10:00:19
+10:00:24
+10:00:25
10:00:30
-10:00:31
10:00:32
10:00:33
-10:00:34
10:00:35
-10:00:36
-10:00:37
-10:00:38
-10:00:39
10:00:40
10:00:41
+10:00:34
+10:00:36
+10:00:37
10:00:42
10:00:43
+10:00:31
+10:00:38
+10:00:39
10:00:44
10:00:45
10:00:46
-10:00:47
10:00:48
10:00:49
-10:00:50
-10:00:51
-10:00:52
-10:00:53
10:00:54
10:00:55
+10:00:50
+10:00:51
10:00:56
10:00:57
-10:00:58
10:00:59
+10:00:47
+10:00:52
+10:00:53
+10:00:58
drop table t4;
create table t1 (a datetime not null, primary key(a)) engine='InnoDB'
partition by key (a) (
@@ -679,9 +679,9 @@ insert into t1 values ('1975-01-01 21:21:21'), ('2020-12-31 12:10:30'), ('1980-1
select * from t1;
a
1975-01-01 21:21:21
-1980-10-14 03:03:00
2000-06-15 23:59:00
2020-12-31 12:10:30
+1980-10-14 03:03:00
select * from t1 where a=19801014030300;
a
1980-10-14 03:03:00
@@ -705,19 +705,19 @@ PARTITIONS 12
insert into t2 values ('1975-01-01 0:1:1'), ('2020-12-31 10:11:12'), ('1980-10-14 13:14:15'), ('2000-06-15 14:15:16');
select * from t2;
a
-1975-01-01 00:01:01
-1980-10-14 13:14:15
-2000-06-15 14:15:16
2020-12-31 10:11:12
+2000-06-15 14:15:16
+1980-10-14 13:14:15
+1975-01-01 00:01:01
select * from t2 where a='1980-10-14 13:14:15';
a
1980-10-14 13:14:15
delete from t2 where a='1980-10-14 13:14:15';
select * from t2;
a
-1975-01-01 00:01:01
-2000-06-15 14:15:16
2020-12-31 10:11:12
+2000-06-15 14:15:16
+1975-01-01 00:01:01
delete from t2;
59 inserts;
select count(*) from t2;
@@ -725,65 +725,65 @@ count(*)
59
select * from t2;
a
-1970-01-01 00:00:01
-1970-01-01 00:00:02
-1970-01-01 00:00:03
-1970-01-01 00:00:04
-1970-01-01 00:00:05
-1970-01-01 00:00:06
-1970-01-01 00:00:07
-1970-01-01 00:00:08
1970-01-01 00:00:09
-1970-01-01 00:00:10
-1970-01-01 00:00:11
-1970-01-01 00:00:12
1970-01-01 00:00:13
-1970-01-01 00:00:14
-1970-01-01 00:00:15
-1970-01-01 00:00:16
-1970-01-01 00:00:17
-1970-01-01 00:00:18
1970-01-01 00:00:19
-1970-01-01 00:00:20
-1970-01-01 00:00:21
-1970-01-01 00:00:22
1970-01-01 00:00:23
+1970-01-01 00:00:33
+1970-01-01 00:00:37
+1970-01-01 00:00:51
+1970-01-01 00:00:59
+1970-01-01 00:00:04
+1970-01-01 00:00:10
+1970-01-01 00:00:14
1970-01-01 00:00:24
-1970-01-01 00:00:25
-1970-01-01 00:00:26
-1970-01-01 00:00:27
1970-01-01 00:00:28
-1970-01-01 00:00:29
-1970-01-01 00:00:30
-1970-01-01 00:00:31
-1970-01-01 00:00:32
-1970-01-01 00:00:33
1970-01-01 00:00:34
-1970-01-01 00:00:35
-1970-01-01 00:00:36
-1970-01-01 00:00:37
1970-01-01 00:00:38
+1970-01-01 00:00:48
+1970-01-01 00:00:52
+1970-01-01 00:00:56
+1970-01-01 00:00:03
+1970-01-01 00:00:07
+1970-01-01 00:00:17
+1970-01-01 00:00:21
+1970-01-01 00:00:27
+1970-01-01 00:00:31
+1970-01-01 00:00:35
1970-01-01 00:00:39
-1970-01-01 00:00:40
1970-01-01 00:00:41
-1970-01-01 00:00:42
-1970-01-01 00:00:43
-1970-01-01 00:00:44
1970-01-01 00:00:45
+1970-01-01 00:00:08
+1970-01-01 00:00:12
+1970-01-01 00:00:18
+1970-01-01 00:00:22
+1970-01-01 00:00:32
+1970-01-01 00:00:36
+1970-01-01 00:00:42
1970-01-01 00:00:46
+1970-01-01 00:00:01
+1970-01-01 00:00:05
+1970-01-01 00:00:11
+1970-01-01 00:00:15
+1970-01-01 00:00:25
+1970-01-01 00:00:29
+1970-01-01 00:00:43
1970-01-01 00:00:47
-1970-01-01 00:00:48
1970-01-01 00:00:49
-1970-01-01 00:00:50
-1970-01-01 00:00:51
-1970-01-01 00:00:52
1970-01-01 00:00:53
-1970-01-01 00:00:54
1970-01-01 00:00:55
-1970-01-01 00:00:56
1970-01-01 00:00:57
+1970-01-01 00:00:02
+1970-01-01 00:00:06
+1970-01-01 00:00:16
+1970-01-01 00:00:20
+1970-01-01 00:00:26
+1970-01-01 00:00:30
+1970-01-01 00:00:40
+1970-01-01 00:00:44
+1970-01-01 00:00:50
+1970-01-01 00:00:54
1970-01-01 00:00:58
-1970-01-01 00:00:59
drop table t2;
create table t3 (a datetime not null, primary key(a)) engine='InnoDB'
partition by range (month(a)) subpartition by key (a)
@@ -812,15 +812,15 @@ count(*)
12
select * from t3;
a
-1970-01-01 00:00:00
1970-02-01 00:00:00
+1970-01-01 00:00:00
1970-03-01 00:00:00
1970-04-01 00:00:00
1970-05-01 00:00:00
1970-06-01 00:00:00
-1970-07-01 00:00:00
1970-08-01 00:00:00
1970-09-01 00:00:00
+1970-07-01 00:00:00
1970-10-01 00:00:00
1970-11-01 00:00:00
1970-12-01 00:00:00
@@ -852,15 +852,15 @@ count(*)
12
select * from t4;
a
-1970-01-01 00:00:00
1970-02-01 00:00:00
+1970-01-01 00:00:00
1970-03-01 00:00:00
1970-04-01 00:00:00
1970-05-01 00:00:00
1970-06-01 00:00:00
-1970-07-01 00:00:00
1970-08-01 00:00:00
1970-09-01 00:00:00
+1970-07-01 00:00:00
1970-10-01 00:00:00
1970-11-01 00:00:00
1970-12-01 00:00:00
@@ -885,19 +885,19 @@ t1 CREATE TABLE `t1` (
insert into t1 values ('1975'), (2020), ('1980'), ('2000');
select * from t1;
a
-1975
1980
2000
2020
+1975
select * from t1 where a=1980;
a
1980
delete from t1 where a=1980;
select * from t1;
a
-1975
2000
2020
+1975
drop table t1;
create table t2 (a year not null, primary key(a)) engine='InnoDB'
partition by key (a) partitions 12;
@@ -912,19 +912,19 @@ PARTITIONS 12
insert into t2 values ('1975'), ('2020'), ('1980'), ('2000');
select * from t2;
a
+2020
1975
1980
2000
-2020
select * from t2 where a='1980';
a
1980
delete from t2 where a='1980';
select * from t2;
a
+2020
1975
2000
-2020
delete from t2;
255 inserts;
Warnings:
@@ -934,259 +934,259 @@ count(*)
255
select * from t2;
a
-0000
-1902
-1903
-1904
-1905
-1906
-1907
-1908
1909
-1910
-1911
-1912
-1913
-1914
-1915
-1916
-1917
-1918
-1919
-1920
1921
-1922
-1923
-1924
-1925
-1926
-1927
+1933
+1945
+1957
+1969
+1981
+1993
+2001
+2013
+2029
+2041
+2053
+2065
+2077
+2089
+2100
+2101
+2102
+2103
+2114
+2132
+2133
+2134
+2135
+2146
+1904
+1916
1928
-1929
-1930
-1931
1932
-1933
-1934
-1935
-1936
-1937
-1938
-1939
1940
-1941
-1942
-1943
-1944
-1945
-1946
-1947
-1948
-1949
-1950
-1951
1952
-1953
-1954
-1955
-1956
-1957
-1958
-1959
-1960
-1961
-1962
-1963
1964
-1965
-1966
-1967
-1968
-1969
-1970
-1971
-1972
-1973
-1974
-1975
1976
-1977
-1978
-1979
-1980
-1981
-1982
-1983
-1984
-1985
-1986
-1987
1988
-1989
-1990
+2008
+2020
+2024
+2036
+2048
+2060
+2072
+2084
+1907
+1919
+1931
+1943
+1955
+1967
+1979
1991
-1992
-1993
-1994
-1995
-1996
-1997
-1998
1999
-2000
-2001
-2002
-2003
-2004
-2005
-2006
-2007
-2008
-2009
-2010
2011
-2012
-2013
-2014
-2015
-2016
-2017
+2027
+2039
+2051
+2063
+2075
+2087
+2097
+2099
+2110
+2111
+2112
+2113
+2123
+2129
+2131
+2142
+2143
+2144
+2145
+2147
+1902
+1914
+1926
+1938
+1950
+1962
+1974
+1986
+2006
2018
-2019
-2020
+2034
+2046
+2058
+2070
+2082
+1905
+1917
+1929
+1941
+1953
+1965
+1977
+1989
+1997
+2009
2021
-2022
-2023
-2024
2025
-2026
-2027
-2028
-2029
-2030
-2031
-2032
-2033
-2034
-2035
-2036
2037
-2038
-2039
-2040
-2041
-2042
-2043
-2044
-2045
-2046
-2047
-2048
2049
-2050
-2051
-2052
-2053
-2054
-2055
-2056
-2057
-2058
-2059
-2060
2061
-2062
-2063
-2064
-2065
-2066
-2067
-2068
-2069
-2070
-2071
-2072
2073
-2074
-2075
-2076
-2077
-2078
-2079
-2080
-2081
-2082
-2083
-2084
2085
-2086
-2087
-2088
-2089
-2090
-2091
2092
2093
2094
2095
-2096
-2097
-2098
-2099
-2100
-2101
-2102
-2103
+2120
+2121
+2124
+2125
+2126
+2127
+2152
+2153
+0000
+1912
+1924
+1936
+1948
+1960
+1972
+1984
+1996
+2004
+2016
+2032
+2044
+2056
+2068
+2080
+2116
+2148
+1903
+1915
+1927
+1939
+1951
+1963
+1975
+1987
+2007
+2019
+2023
+2035
+2047
+2059
+2071
+2083
+2155
+1910
+1922
+1934
+1946
+1958
+1970
+1982
+1994
+2002
+2014
+2030
+2042
+2054
+2066
+2078
+2090
+1913
+1925
+1937
+1949
+1961
+1973
+1985
+2005
+2017
+2033
+2045
+2057
+2069
+2081
2104
2105
2106
2107
-2108
-2109
-2110
-2111
-2112
-2113
-2114
-2115
-2116
2117
2118
2119
-2120
-2121
-2122
-2123
-2124
-2125
-2126
-2127
-2128
-2129
-2130
-2131
-2132
-2133
-2134
-2135
2136
2137
2138
2139
-2140
-2141
-2142
-2143
-2144
-2145
-2146
-2147
-2148
2149
2150
2151
-2152
-2153
+1908
+1920
+1944
+1956
+1968
+1980
+1992
+2000
+2012
+2028
+2040
+2052
+2064
+2076
+2088
+2096
+2098
+2108
+2128
+2130
+2140
+1911
+1923
+1935
+1947
+1959
+1971
+1983
+1995
+2003
+2015
+2031
+2043
+2055
+2067
+2079
+2091
+2115
+1906
+1918
+1930
+1942
+1954
+1966
+1978
+1990
+1998
+2010
+2022
+2026
+2038
+2050
+2062
+2074
+2086
+2109
+2122
+2141
2154
-2155
drop table t2;
diff --git a/mysql-test/suite/parts/r/partition_datetime_myisam.result b/mysql-test/suite/parts/r/partition_datetime_myisam.result
index 0d1dcf3e..9d8acb09 100644
--- a/mysql-test/suite/parts/r/partition_datetime_myisam.result
+++ b/mysql-test/suite/parts/r/partition_datetime_myisam.result
@@ -509,67 +509,67 @@ SUBPARTITIONS 3
select count(*) from t3;
count(*)
59
-select * from t3;
-a
-10:00:01
-10:00:02
-10:00:03
-10:00:04
-10:00:05
-10:00:06
-10:00:07
-10:00:08
-10:00:09
-10:00:10
-10:00:11
-10:00:12
-10:00:13
-10:00:14
-10:00:15
-10:00:16
-10:00:17
-10:00:18
-10:00:19
-10:00:20
-10:00:21
-10:00:22
-10:00:23
-10:00:24
-10:00:25
-10:00:26
-10:00:27
-10:00:28
-10:00:29
-10:00:30
-10:00:31
-10:00:32
-10:00:33
-10:00:34
-10:00:35
-10:00:36
-10:00:37
-10:00:38
-10:00:39
-10:00:40
-10:00:41
-10:00:42
-10:00:43
-10:00:44
-10:00:45
-10:00:46
-10:00:47
-10:00:48
-10:00:49
-10:00:50
-10:00:51
-10:00:52
-10:00:53
-10:00:54
-10:00:55
-10:00:56
-10:00:57
-10:00:58
-10:00:59
+select a, second(a), if(second(a)<16,1,if(second(a)<31,2,if(second(a)<45,3,4))) from t3;
+a second(a) if(second(a)<16,1,if(second(a)<31,2,if(second(a)<45,3,4)))
+10:00:01 1 1
+10:00:02 2 1
+10:00:03 3 1
+10:00:04 4 1
+10:00:05 5 1
+10:00:06 6 1
+10:00:07 7 1
+10:00:08 8 1
+10:00:09 9 1
+10:00:10 10 1
+10:00:11 11 1
+10:00:12 12 1
+10:00:13 13 1
+10:00:14 14 1
+10:00:15 15 1
+10:00:16 16 2
+10:00:17 17 2
+10:00:18 18 2
+10:00:19 19 2
+10:00:20 20 2
+10:00:21 21 2
+10:00:22 22 2
+10:00:23 23 2
+10:00:24 24 2
+10:00:25 25 2
+10:00:26 26 2
+10:00:27 27 2
+10:00:28 28 2
+10:00:29 29 2
+10:00:30 30 2
+10:00:31 31 3
+10:00:32 32 3
+10:00:33 33 3
+10:00:34 34 3
+10:00:35 35 3
+10:00:36 36 3
+10:00:37 37 3
+10:00:38 38 3
+10:00:39 39 3
+10:00:40 40 3
+10:00:41 41 3
+10:00:42 42 3
+10:00:43 43 3
+10:00:44 44 3
+10:00:45 45 4
+10:00:46 46 4
+10:00:47 47 4
+10:00:48 48 4
+10:00:49 49 4
+10:00:50 50 4
+10:00:51 51 4
+10:00:52 52 4
+10:00:53 53 4
+10:00:54 54 4
+10:00:55 55 4
+10:00:56 56 4
+10:00:57 57 4
+10:00:58 58 4
+10:00:59 59 4
drop table t3;
create table t4 (a time not null, primary key(a)) engine='MyISAM'
partition by list (second(a)) subpartition by key (a)
diff --git a/mysql-test/suite/parts/r/partition_decimal_innodb.result b/mysql-test/suite/parts/r/partition_decimal_innodb.result
index c2f00a89..bce03461 100644
--- a/mysql-test/suite/parts/r/partition_decimal_innodb.result
+++ b/mysql-test/suite/parts/r/partition_decimal_innodb.result
@@ -18,11 +18,11 @@ t1 CREATE TABLE `t1` (
insert into t1 values (999999.9999), (-999999.9999), (123456.7899), (-123456.7899), (-1.5), (1), (0), (-1), (1.5), (1234.567), (-1234.567);
select * from t1;
a
--999999.9999
--123456.7899
--1234.5670
--1.5000
-1.0000
+-1.5000
+-1234.5670
+-123456.7899
+-999999.9999
0.0000
1.0000
1.5000
@@ -35,11 +35,11 @@ a
delete from t1 where a=1234.567;
select * from t1;
a
--999999.9999
--123456.7899
--1234.5670
--1.5000
-1.0000
+-1.5000
+-1234.5670
+-123456.7899
+-999999.9999
0.0000
1.0000
1.5000
@@ -59,10 +59,10 @@ PARTITIONS 10
insert into t2 values (999999999.999999999), (-999999999.999999999), (-1.5), (-1), (0), (1.5), (1234.567), (-1234.567);
select * from t2;
a
--999999999.999999999
--1234.567000000
--1.500000000
-1.000000000
+-1.500000000
+-1234.567000000
+-999999999.999999999
0.000000000
1.500000000
1234.567000000
@@ -73,10 +73,10 @@ a
delete from t2 where a=1234.567;
select * from t2;
a
--999999999.999999999
--1234.567000000
--1.500000000
-1.000000000
+-1.500000000
+-1234.567000000
+-999999999.999999999
0.000000000
1.500000000
999999999.999999999
diff --git a/mysql-test/suite/parts/r/partition_decimal_myisam.result b/mysql-test/suite/parts/r/partition_decimal_myisam.result
index a5175079..90ea5ea8 100644
--- a/mysql-test/suite/parts/r/partition_decimal_myisam.result
+++ b/mysql-test/suite/parts/r/partition_decimal_myisam.result
@@ -18,11 +18,11 @@ t1 CREATE TABLE `t1` (
insert into t1 values (999999.9999), (-999999.9999), (123456.7899), (-123456.7899), (-1.5), (1), (0), (-1), (1.5), (1234.567), (-1234.567);
select * from t1;
a
--999999.9999
--123456.7899
--1234.5670
--1.5000
-1.0000
+-1.5000
+-1234.5670
+-123456.7899
+-999999.9999
0.0000
1.0000
1.5000
@@ -35,11 +35,11 @@ a
delete from t1 where a=1234.567;
select * from t1;
a
--999999.9999
--123456.7899
--1234.5670
--1.5000
-1.0000
+-1.5000
+-1234.5670
+-123456.7899
+-999999.9999
0.0000
1.0000
1.5000
@@ -59,10 +59,10 @@ PARTITIONS 10
insert into t2 values (999999999.999999999), (-999999999.999999999), (-1.5), (-1), (0), (1.5), (1234.567), (-1234.567);
select * from t2;
a
--999999999.999999999
--1234.567000000
--1.500000000
-1.000000000
+-1.500000000
+-1234.567000000
+-999999999.999999999
0.000000000
1.500000000
1234.567000000
@@ -73,10 +73,10 @@ a
delete from t2 where a=1234.567;
select * from t2;
a
--999999999.999999999
--1234.567000000
--1.500000000
-1.000000000
+-1.500000000
+-1234.567000000
+-999999999.999999999
0.000000000
1.500000000
999999999.999999999
diff --git a/mysql-test/suite/parts/r/partition_double_innodb.result b/mysql-test/suite/parts/r/partition_double_innodb.result
index 7563109f..41834075 100644
--- a/mysql-test/suite/parts/r/partition_double_innodb.result
+++ b/mysql-test/suite/parts/r/partition_double_innodb.result
@@ -18,10 +18,10 @@ t1 CREATE TABLE `t1` (
insert into t1 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208);
select * from t1;
a
--2.2250738585072016e208
--1.5
-1
+-1.5
-2.2250738585072014e-208
+-2.2250738585072016e208
0
1.5
1234.567
@@ -32,10 +32,10 @@ a
delete from t1 where a=1.5;
select * from t1;
a
--2.2250738585072016e208
--1.5
-1
+-1.5
-2.2250738585072014e-208
+-2.2250738585072016e208
0
1234.567
2.2250738585072016e208
@@ -53,10 +53,10 @@ PARTITIONS 10
insert into t2 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208);
select * from t2;
a
--2.2250738585072016e208
--1.5
-1
+-1.5
-2.2250738585072014e-208
+-2.2250738585072016e208
0
1.5
1234.567
@@ -67,10 +67,10 @@ a
delete from t2 where a=1234.567;
select * from t2;
a
--2.2250738585072016e208
--1.5
-1
+-1.5
-2.2250738585072014e-208
+-2.2250738585072016e208
0
1.5
2.2250738585072016e208
diff --git a/mysql-test/suite/parts/r/partition_double_myisam.result b/mysql-test/suite/parts/r/partition_double_myisam.result
index e9cf25e6..f2161d42 100644
--- a/mysql-test/suite/parts/r/partition_double_myisam.result
+++ b/mysql-test/suite/parts/r/partition_double_myisam.result
@@ -18,10 +18,10 @@ t1 CREATE TABLE `t1` (
insert into t1 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208);
select * from t1;
a
--2.2250738585072016e208
--1.5
-1
+-1.5
-2.2250738585072014e-208
+-2.2250738585072016e208
0
1.5
1234.567
@@ -32,10 +32,10 @@ a
delete from t1 where a=1.5;
select * from t1;
a
--2.2250738585072016e208
--1.5
-1
+-1.5
-2.2250738585072014e-208
+-2.2250738585072016e208
0
1234.567
2.2250738585072016e208
@@ -53,10 +53,10 @@ PARTITIONS 10
insert into t2 values (-2.2250738585072014E+208), (-2.2250738585072014E-208), (-1.5), (-1), (0), (1.5), (1234.567), (2.2250738585072014E+208);
select * from t2;
a
--2.2250738585072016e208
--1.5
-1
+-1.5
-2.2250738585072014e-208
+-2.2250738585072016e208
0
1.5
1234.567
@@ -67,10 +67,10 @@ a
delete from t2 where a=1234.567;
select * from t2;
a
--2.2250738585072016e208
--1.5
-1
+-1.5
-2.2250738585072014e-208
+-2.2250738585072016e208
0
1.5
2.2250738585072016e208
diff --git a/mysql-test/suite/parts/r/partition_float_innodb.result b/mysql-test/suite/parts/r/partition_float_innodb.result
index 7cdccdb8..c82609b4 100644
--- a/mysql-test/suite/parts/r/partition_float_innodb.result
+++ b/mysql-test/suite/parts/r/partition_float_innodb.result
@@ -18,10 +18,10 @@ t1 CREATE TABLE `t1` (
insert into t1 values (-3.402823466E+38), (3.402823466E+38), (-1.5), (-1), (0), (1), (1.5);
select * from t1;
a
+0
-3.40282e38
-1.5
-1
-0
1
1.5
3.40282e38
@@ -31,10 +31,10 @@ a
delete from t1 where a=1.5;
select * from t1;
a
+0
-3.40282e38
-1.5
-1
-0
1
3.40282e38
drop table t1;
@@ -51,10 +51,10 @@ PARTITIONS 10
insert into t2 values (-3.402823466E+38), (-3.402823466E+37), (-123.456), (0), (1234546.789), (123.456), (1.5);
select * from t2;
a
+0
-3.40282e38
-3.40282e37
-123.456
-0
1.5
123.456
1234550
@@ -63,10 +63,10 @@ a
delete from t2 where a=123.456;
select * from t2;
a
+0
-3.40282e38
-3.40282e37
-123.456
-0
1.5
123.456
1234550
@@ -76,10 +76,10 @@ a
delete from t2 where a=1.5;
select * from t2;
a
+0
-3.40282e38
-3.40282e37
-123.456
-0
123.456
1234550
delete from t2;
diff --git a/mysql-test/suite/parts/r/partition_special_innodb.result b/mysql-test/suite/parts/r/partition_special_innodb.result
index 1d0c075d..504989e2 100644
--- a/mysql-test/suite/parts/r/partition_special_innodb.result
+++ b/mysql-test/suite/parts/r/partition_special_innodb.result
@@ -67,9 +67,9 @@ insert into t1 values
('2000-06-15', 'jukg','zikhuk','m', 45675, 6465754.13, 435242623462, 18, 'pib mdotkbm.m' );
select * from t1;
a b c d e f g h i
+1975-01-01 abcde abcde m 1234 123.45 32412341234 113 tbhth nrzh ztfghgfh fzh ftzhj fztjh
1980-10-14 fgbbd dtzndtz w 67856 5463354.67 3567845333 124 d,f söierugsig msireg siug ei5ggth lrutluitgzeöjrtnb.rkjthuekuhzrkuthgjdnffjmbr
1983-12-31 cdef srtbvsr w 45634 13452.56 3452346456 127 liuugbzvdmrlti b itiortudirtfgtibm dfi
-1975-01-01 abcde abcde m 1234 123.45 32412341234 113 tbhth nrzh ztfghgfh fzh ftzhj fztjh
2000-06-15 jukg zikhuk m 45675 6465754.13 435242623462 18 pib mdotkbm.m
select * from t1 where a<19851231;
a b c d e f g h i
@@ -117,9 +117,9 @@ insert into t1 values
('2000-06-15', 'jukg','zikhuk','m', 45675, 6465754.13, 435242623462, 18, '2000-06-15', 'jukg','zikhuk','m', 45675, 6465754.13, 435242623462, 18, 'pib mdotkbm.m');
select * from t1;
a b c d e f g h a1 b1 c1 d1 e1 f1 g1 h1 i
-1983-12-31 cdef srtbvsr w 45634 13452.56 3452346456 127 1983-12-31 cdef srtbvsr w 45634 13452.56 3452346456 127 liuugbzvdmrlti b itiortudirtfgtibm dfi
-1980-10-14 fgbbd dtzndtz w 67856 5463354.67 3567845333 124 1980-10-14 fgbbd dtzndtz w 67856 5463354.67 3567845333 124 d,f söierugsig msireg siug ei5ggth lrutluitgzeöjrtnb.rkjthuekuhzrkuthgjdnffjmbr
1975-01-01 abcde abcde m 1234 123.45 32412341234 113 1975-01-01 abcde abcde m 1234 123.45 32412341234 113 tbhth nrzh ztfghgfh fzh ftzhj fztjh
+1980-10-14 fgbbd dtzndtz w 67856 5463354.67 3567845333 124 1980-10-14 fgbbd dtzndtz w 67856 5463354.67 3567845333 124 d,f söierugsig msireg siug ei5ggth lrutluitgzeöjrtnb.rkjthuekuhzrkuthgjdnffjmbr
+1983-12-31 cdef srtbvsr w 45634 13452.56 3452346456 127 1983-12-31 cdef srtbvsr w 45634 13452.56 3452346456 127 liuugbzvdmrlti b itiortudirtfgtibm dfi
2000-06-15 jukg zikhuk m 45675 6465754.13 435242623462 18 2000-06-15 jukg zikhuk m 45675 6465754.13 435242623462 18 pib mdotkbm.m
select * from t1 where a<19851231;
a b c d e f g h a1 b1 c1 d1 e1 f1 g1 h1 i
@@ -197,9 +197,9 @@ insert into t1 values
('2000-06-15', 'jukg','zikhuk','m', 45675, 6465754.13, 435242623462, 18, '2000-06-15', 'jukg','zikhuk','m', 45675, 6465754.13, 435242623462, 18, '2000-06-15', 'jukg','zikhuk','m', 45675, 6465754.13, 435242623462, 18, '2000-06-15', 'jukg','zikhuk','m', 45675, 6465754.13, 435242623462, 18, 'pib mdotkbm.m');
select * from t1;
a b c d e f g h a1 b1 c1 d1 e1 f1 g1 h1 a2 b2 c2 d2 e2 f2 g2 h2 a3 b3 c3 d3 e3 f3 g3 h3 i
+1975-01-01 abcde abcde m 1234 123.45 32412341234 113 1975-01-01 abcde abcde m 1234 123.45 32412341234 113 1975-01-01 abcde abcde m 1234 123.45 32412341234 113 1975-01-01 abcde abcde m 1234 123.45 32412341234 113 tbhth nrzh ztfghgfh fzh ftzhj fztjh
1980-10-14 fgbbd dtzndtz w 67856 5463354.67 3567845333 124 1980-10-14 fgbbd dtzndtz w 67856 5463354.67 3567845333 124 1980-10-14 fgbbd dtzndtz w 67856 5463354.67 3567845333 124 1980-10-14 fgbbd dtzndtz w 67856 5463354.67 3567845333 124 d,f söierugsig msireg siug ei5ggth lrutluitgzeöjrtnb.rkjthuekuhzrkuthgjdnffjmbr
1983-12-31 cdef srtbvsr w 45634 13452.56 3452346456 127 1983-12-31 cdef srtbvsr w 45634 13452.56 3452346456 127 1983-12-31 cdef srtbvsr w 45634 13452.56 3452346456 127 1983-12-31 cdef srtbvsr w 45634 13452.56 3452346456 127 liuugbzvdmrlti b itiortudirtfgtibm dfi
-1975-01-01 abcde abcde m 1234 123.45 32412341234 113 1975-01-01 abcde abcde m 1234 123.45 32412341234 113 1975-01-01 abcde abcde m 1234 123.45 32412341234 113 1975-01-01 abcde abcde m 1234 123.45 32412341234 113 tbhth nrzh ztfghgfh fzh ftzhj fztjh
2000-06-15 jukg zikhuk m 45675 6465754.13 435242623462 18 2000-06-15 jukg zikhuk m 45675 6465754.13 435242623462 18 2000-06-15 jukg zikhuk m 45675 6465754.13 435242623462 18 2000-06-15 jukg zikhuk m 45675 6465754.13 435242623462 18 pib mdotkbm.m
select * from t1 where a<19851231;
a b c d e f g h a1 b1 c1 d1 e1 f1 g1 h1 a2 b2 c2 d2 e2 f2 g2 h2 a3 b3 c3 d3 e3 f3 g3 h3 i
diff --git a/mysql-test/suite/parts/r/partition_special_myisam.result b/mysql-test/suite/parts/r/partition_special_myisam.result
index f6ceef4f..ce30977c 100644
--- a/mysql-test/suite/parts/r/partition_special_myisam.result
+++ b/mysql-test/suite/parts/r/partition_special_myisam.result
@@ -67,9 +67,9 @@ insert into t1 values
('2000-06-15', 'jukg','zikhuk','m', 45675, 6465754.13, 435242623462, 18, 'pib mdotkbm.m' );
select * from t1;
a b c d e f g h i
+1975-01-01 abcde abcde m 1234 123.45 32412341234 113 tbhth nrzh ztfghgfh fzh ftzhj fztjh
1980-10-14 fgbbd dtzndtz w 67856 5463354.67 3567845333 124 d,f söierugsig msireg siug ei5ggth lrutluitgzeöjrtnb.rkjthuekuhzrkuthgjdnffjmbr
1983-12-31 cdef srtbvsr w 45634 13452.56 3452346456 127 liuugbzvdmrlti b itiortudirtfgtibm dfi
-1975-01-01 abcde abcde m 1234 123.45 32412341234 113 tbhth nrzh ztfghgfh fzh ftzhj fztjh
2000-06-15 jukg zikhuk m 45675 6465754.13 435242623462 18 pib mdotkbm.m
select * from t1 where a<19851231;
a b c d e f g h i
@@ -117,9 +117,9 @@ insert into t1 values
('2000-06-15', 'jukg','zikhuk','m', 45675, 6465754.13, 435242623462, 18, '2000-06-15', 'jukg','zikhuk','m', 45675, 6465754.13, 435242623462, 18, 'pib mdotkbm.m');
select * from t1;
a b c d e f g h a1 b1 c1 d1 e1 f1 g1 h1 i
-1983-12-31 cdef srtbvsr w 45634 13452.56 3452346456 127 1983-12-31 cdef srtbvsr w 45634 13452.56 3452346456 127 liuugbzvdmrlti b itiortudirtfgtibm dfi
-1980-10-14 fgbbd dtzndtz w 67856 5463354.67 3567845333 124 1980-10-14 fgbbd dtzndtz w 67856 5463354.67 3567845333 124 d,f söierugsig msireg siug ei5ggth lrutluitgzeöjrtnb.rkjthuekuhzrkuthgjdnffjmbr
1975-01-01 abcde abcde m 1234 123.45 32412341234 113 1975-01-01 abcde abcde m 1234 123.45 32412341234 113 tbhth nrzh ztfghgfh fzh ftzhj fztjh
+1980-10-14 fgbbd dtzndtz w 67856 5463354.67 3567845333 124 1980-10-14 fgbbd dtzndtz w 67856 5463354.67 3567845333 124 d,f söierugsig msireg siug ei5ggth lrutluitgzeöjrtnb.rkjthuekuhzrkuthgjdnffjmbr
+1983-12-31 cdef srtbvsr w 45634 13452.56 3452346456 127 1983-12-31 cdef srtbvsr w 45634 13452.56 3452346456 127 liuugbzvdmrlti b itiortudirtfgtibm dfi
2000-06-15 jukg zikhuk m 45675 6465754.13 435242623462 18 2000-06-15 jukg zikhuk m 45675 6465754.13 435242623462 18 pib mdotkbm.m
select * from t1 where a<19851231;
a b c d e f g h a1 b1 c1 d1 e1 f1 g1 h1 i
@@ -197,9 +197,9 @@ insert into t1 values
('2000-06-15', 'jukg','zikhuk','m', 45675, 6465754.13, 435242623462, 18, '2000-06-15', 'jukg','zikhuk','m', 45675, 6465754.13, 435242623462, 18, '2000-06-15', 'jukg','zikhuk','m', 45675, 6465754.13, 435242623462, 18, '2000-06-15', 'jukg','zikhuk','m', 45675, 6465754.13, 435242623462, 18, 'pib mdotkbm.m');
select * from t1;
a b c d e f g h a1 b1 c1 d1 e1 f1 g1 h1 a2 b2 c2 d2 e2 f2 g2 h2 a3 b3 c3 d3 e3 f3 g3 h3 i
+1975-01-01 abcde abcde m 1234 123.45 32412341234 113 1975-01-01 abcde abcde m 1234 123.45 32412341234 113 1975-01-01 abcde abcde m 1234 123.45 32412341234 113 1975-01-01 abcde abcde m 1234 123.45 32412341234 113 tbhth nrzh ztfghgfh fzh ftzhj fztjh
1980-10-14 fgbbd dtzndtz w 67856 5463354.67 3567845333 124 1980-10-14 fgbbd dtzndtz w 67856 5463354.67 3567845333 124 1980-10-14 fgbbd dtzndtz w 67856 5463354.67 3567845333 124 1980-10-14 fgbbd dtzndtz w 67856 5463354.67 3567845333 124 d,f söierugsig msireg siug ei5ggth lrutluitgzeöjrtnb.rkjthuekuhzrkuthgjdnffjmbr
1983-12-31 cdef srtbvsr w 45634 13452.56 3452346456 127 1983-12-31 cdef srtbvsr w 45634 13452.56 3452346456 127 1983-12-31 cdef srtbvsr w 45634 13452.56 3452346456 127 1983-12-31 cdef srtbvsr w 45634 13452.56 3452346456 127 liuugbzvdmrlti b itiortudirtfgtibm dfi
-1975-01-01 abcde abcde m 1234 123.45 32412341234 113 1975-01-01 abcde abcde m 1234 123.45 32412341234 113 1975-01-01 abcde abcde m 1234 123.45 32412341234 113 1975-01-01 abcde abcde m 1234 123.45 32412341234 113 tbhth nrzh ztfghgfh fzh ftzhj fztjh
2000-06-15 jukg zikhuk m 45675 6465754.13 435242623462 18 2000-06-15 jukg zikhuk m 45675 6465754.13 435242623462 18 2000-06-15 jukg zikhuk m 45675 6465754.13 435242623462 18 2000-06-15 jukg zikhuk m 45675 6465754.13 435242623462 18 pib mdotkbm.m
select * from t1 where a<19851231;
a b c d e f g h a1 b1 c1 d1 e1 f1 g1 h1 a2 b2 c2 d2 e2 f2 g2 h2 a3 b3 c3 d3 e3 f3 g3 h3 i
diff --git a/mysql-test/suite/parts/r/percona_nonflushing_analyze_debug.result b/mysql-test/suite/parts/r/percona_nonflushing_analyze_debug.result
index 070d5e8d..18afb41f 100644
--- a/mysql-test/suite/parts/r/percona_nonflushing_analyze_debug.result
+++ b/mysql-test/suite/parts/r/percona_nonflushing_analyze_debug.result
@@ -4,7 +4,7 @@ PARTITION p0 VALUES LESS THAN (3),
PARTITION p1 VALUES LESS THAN (10));
INSERT INTO t1 VALUES (1), (2), (3), (4);
connect con1,localhost,root;
-SET DEBUG_SYNC="handler_ha_index_next_end SIGNAL idx_scan_in_progress WAIT_FOR finish_scan";
+SET DEBUG_SYNC="handler_rnd_next_end SIGNAL idx_scan_in_progress WAIT_FOR finish_scan";
SELECT * FROM t1;
connection default;
SET DEBUG_SYNC="now WAIT_FOR idx_scan_in_progress";
@@ -39,7 +39,7 @@ PARTITION p0 VALUES LESS THAN (3),
PARTITION p1 VALUES LESS THAN (10));
INSERT INTO t2 VALUES (1), (2), (3), (4);
connect con1,localhost,root;
-SET DEBUG_SYNC="handler_ha_index_next_end SIGNAL idx_scan_in_progress WAIT_FOR finish_scan";
+SET DEBUG_SYNC="handler_rnd_next_end SIGNAL idx_scan_in_progress WAIT_FOR finish_scan";
SELECT * FROM t2;
connection default;
SET DEBUG_SYNC="now WAIT_FOR idx_scan_in_progress";
@@ -51,17 +51,17 @@ test.t2 analyze status OK
set use_stat_tables=@tmp;
SELECT * FROM t2;
a
-1
2
-3
+1
4
+3
SET DEBUG_SYNC="now SIGNAL finish_scan";
connection con1;
a
-1
2
-3
+1
4
+3
disconnect con1;
connection default;
SET DEBUG_SYNC='reset';
diff --git a/mysql-test/suite/parts/r/reorganize_partition_innodb.result b/mysql-test/suite/parts/r/reorganize_partition_innodb.result
index b56cb6bb..b2233781 100644
--- a/mysql-test/suite/parts/r/reorganize_partition_innodb.result
+++ b/mysql-test/suite/parts/r/reorganize_partition_innodb.result
@@ -40,6 +40,8 @@ t CREATE TABLE `t` (
PARTITION `p2` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB)
SET @TMP = @@GLOBAL.INNODB_FILE_PER_TABLE;
SET GLOBAL INNODB_FILE_PER_TABLE=OFF;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
ALTER TABLE t ADD PRIMARY KEY pk(a), ALGORITHM=INPLACE;
Warnings:
Warning 1280 Name 'pk' ignored for PRIMARY key.
@@ -53,6 +55,8 @@ t CREATE TABLE `t` (
(PARTITION `p1` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB,
PARTITION `p2` DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_here' ENGINE = InnoDB)
SET GLOBAL INNODB_FILE_PER_TABLE=@TMP;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
ALTER TABLE t REORGANIZE PARTITION p1,p2 INTO (
PARTITION p1 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_somewhere_else/' ENGINE = INNODB,
PARTITION p2 DATA DIRECTORY = 'MYSQLTEST_VARDIR/tmp/partitions_somewhere_else/' ENGINE = INNODB
diff --git a/mysql-test/suite/parts/t/alter_table.test b/mysql-test/suite/parts/t/alter_table.test
index 9c131c73..f1da7cc3 100644
--- a/mysql-test/suite/parts/t/alter_table.test
+++ b/mysql-test/suite/parts/t/alter_table.test
@@ -329,3 +329,142 @@ drop user u@localhost;
drop database db;
--echo # End of 10.11 tests
+
+--echo #
+--echo # MDEV-22164 without validation for exchange partition/convert in
+--echo #
+call mtr.add_suppression('was altered WITHOUT');
+let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
+let SEARCH_PATTERN=Table `test`.`tp` was altered WITHOUT VALIDATION: the table might be corrupted;
+
+create table validation(x int);
+drop table validation;
+
+create table t (a int primary key);
+
+create table tp (a int primary key) partition by range (a) (
+ partition p0 values less than (100),
+ p1 values less than (300));
+
+insert into t values (1), (99);
+insert into tp values (2), (200);
+
+select * from t order by a;
+select * from tp partition (p0) order by a;
+select * from tp partition (p1) order by a;
+
+alter table tp exchange partition p0 with table t;
+select * from t order by a;
+select * from tp partition (p0) order by a;
+select * from tp partition (p1) order by a;
+
+alter table tp exchange partition p0 with table t;
+select * from t order by a;
+select * from tp partition (p0) order by a;
+select * from tp partition (p1) order by a;
+
+--error ER_ROW_DOES_NOT_MATCH_PARTITION
+alter table tp exchange partition p1 with table t;
+--error ER_ROW_DOES_NOT_MATCH_PARTITION
+alter table tp exchange partition p1 with table t with validation;
+alter table tp exchange partition p1 with table t without validation;
+source include/search_pattern_in_file.inc;
+select * from t order by a;
+select * from tp partition (p1) order by a;
+alter table tp check partition p0;
+alter table tp check partition p1;
+
+alter table tp exchange partition p1 with table t with validation;
+--error ER_ROW_DOES_NOT_MATCH_PARTITION
+alter table tp exchange partition p1 with table t with validation;
+select * from t order by a;
+select * from tp partition (p1) order by a;
+
+# SP
+create or replace procedure validation()
+alter table tp exchange partition p1 with table t with validation;
+create or replace procedure without_validation()
+alter table tp exchange partition p1 with table t without validation;
+--error ER_ROW_DOES_NOT_MATCH_PARTITION
+call validation;
+call without_validation;
+source include/search_pattern_in_file.inc;
+call validation;
+--error ER_ROW_DOES_NOT_MATCH_PARTITION
+call validation;
+call without_validation;
+source include/search_pattern_in_file.inc;
+select * from t order by a;
+select * from tp partition (p1) order by a;
+call validation;
+select * from t order by a;
+select * from tp partition (p1) order by a;
+drop procedure validation;
+drop procedure without_validation;
+
+# PS
+prepare validation from "alter table tp exchange partition p1 with table t with validation";
+prepare without_validation from "alter table tp exchange partition p1 with table t without validation";
+--error ER_ROW_DOES_NOT_MATCH_PARTITION
+execute validation;
+execute without_validation;
+source include/search_pattern_in_file.inc;
+execute validation;
+--error ER_ROW_DOES_NOT_MATCH_PARTITION
+execute validation;
+execute without_validation;
+source include/search_pattern_in_file.inc;
+select * from t order by a;
+select * from tp partition (p1) order by a;
+execute validation;
+select * from t order by a;
+select * from tp partition (p1) order by a;
+drop prepare validation;
+drop prepare without_validation;
+
+# CONVERT IN
+--error ER_ROW_DOES_NOT_MATCH_PARTITION
+alter table tp convert table t to partition p2 values less than (maxvalue);
+--error ER_ROW_DOES_NOT_MATCH_PARTITION
+alter table tp convert table t to partition p2 values less than (maxvalue) with validation;
+alter table tp convert table t to partition p2 values less than (maxvalue) without validation;
+source include/search_pattern_in_file.inc;
+select * from tp partition (p0) order by a;
+select * from tp partition (p1) order by a;
+select * from tp partition (p2) order by a;
+
+# Hash
+create table t (a int primary key);
+insert t values (1), (2);
+
+create or replace table tp (a int primary key)
+partition by hash(a) partitions 2;
+
+insert tp values (1), (2), (3), (4);
+--error ER_ROW_DOES_NOT_MATCH_PARTITION
+alter table tp exchange partition p0 with table t;
+alter table tp exchange partition p0 with table t without validation;
+source include/search_pattern_in_file.inc;
+select * from t;
+alter table tp exchange partition p0 with table t;
+drop table tp;
+
+# List
+create or replace table tp (a int primary key)
+partition by list(a) (
+ partition p0 values in (2, 3, 4),
+ partition p1 values in (12, 13, 14),
+ partition p2 values in (52, 53, 54));
+
+
+insert tp values (12), (2), (3), (4);
+--error ER_NO_PARTITION_FOR_GIVEN_VALUE
+alter table tp exchange partition p0 with table t;
+alter table tp exchange partition p0 with table t without validation;
+source include/search_pattern_in_file.inc;
+select * from t;
+alter table tp exchange partition p0 with table t;
+
+drop tables tp, t;
+
+--echo # End of 11.4 tests
diff --git a/mysql-test/suite/parts/t/debug_innodb_crash-master.opt b/mysql-test/suite/parts/t/debug_innodb_crash-master.opt
index b7f94e14..d8813652 100644
--- a/mysql-test/suite/parts/t/debug_innodb_crash-master.opt
+++ b/mysql-test/suite/parts/t/debug_innodb_crash-master.opt
@@ -1 +1 @@
---loose-innodb-file-per-table=1 --loose-skip-stack-trace --skip-core-file --loose-innodb-buffer-pool-size=32M
+--loose-skip-stack-trace --skip-core-file --loose-innodb-buffer-pool-size=32M
diff --git a/mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt b/mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt
deleted file mode 100644
index 115a0ba2..00000000
--- a/mysql-test/suite/parts/t/partition_debug_sync_innodb-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---loose-innodb_file_per_table
diff --git a/mysql-test/suite/perfschema/include/hostcache_set_state.inc b/mysql-test/suite/perfschema/include/hostcache_set_state.inc
index 29f32123..995a1028 100644
--- a/mysql-test/suite/perfschema/include/hostcache_set_state.inc
+++ b/mysql-test/suite/perfschema/include/hostcache_set_state.inc
@@ -9,7 +9,7 @@ flush privileges;
# Print critical setup
-#select @@global.debug;
+#select @@global.debug_dbug;
#select @@global.max_connect_errors;
#select @@global.max_user_connections;
#select @@global.max_connections;
diff --git a/mysql-test/suite/perfschema/include/upgrade_check.inc b/mysql-test/suite/perfschema/include/upgrade_check.inc
index c16e90c7..30e33ebb 100644
--- a/mysql-test/suite/perfschema/include/upgrade_check.inc
+++ b/mysql-test/suite/perfschema/include/upgrade_check.inc
@@ -12,4 +12,4 @@
--cat_file $MYSQLTEST_VARDIR/tmp/err_file
--remove_file $MYSQLTEST_VARDIR/tmp/out_file
--remove_file $MYSQLTEST_VARDIR/tmp/err_file
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
diff --git a/mysql-test/suite/perfschema/r/alter_table_progress.result b/mysql-test/suite/perfschema/r/alter_table_progress.result
index caca7378..85262bf3 100644
--- a/mysql-test/suite/perfschema/r/alter_table_progress.result
+++ b/mysql-test/suite/perfschema/r/alter_table_progress.result
@@ -16,8 +16,6 @@ connection default;
SET DEBUG_SYNC='now WAIT_FOR found_row';
select event_id from performance_schema.events_statements_current
where thread_id = @con1_thread_id into @con1_stmt_id;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select EVENT_NAME, WORK_COMPLETED, WORK_ESTIMATED
from performance_schema.events_stages_current
where (thread_id = @con1_thread_id);
@@ -77,14 +75,14 @@ stage/sql/table lock NULL NULL
stage/sql/After create NULL NULL
stage/sql/copy to tmp table 5 5
stage/sql/Enabling keys NULL NULL
-stage/sql/Rename result table NULL NULL
stage/sql/Unlocking tables NULL NULL
+stage/sql/Enabling keys NULL NULL
+stage/sql/Apply log event NULL NULL
+stage/sql/After apply log event NULL NULL
stage/sql/Rename result table NULL NULL
stage/sql/End of update loop NULL NULL
stage/sql/Query end NULL NULL
stage/sql/closing tables NULL NULL
-stage/sql/Unlocking tables NULL NULL
-stage/sql/closing tables NULL NULL
stage/sql/Query end NULL NULL
stage/sql/Starting cleanup NULL NULL
stage/sql/Freeing items NULL NULL
diff --git a/mysql-test/suite/perfschema/r/batch_table_io_func.result b/mysql-test/suite/perfschema/r/batch_table_io_func.result
index 212c08c7..4336ebd3 100644
--- a/mysql-test/suite/perfschema/r/batch_table_io_func.result
+++ b/mysql-test/suite/perfschema/r/batch_table_io_func.result
@@ -154,8 +154,8 @@ alter table t3 add index(id2);
explain extended select t1.*, t2.*, t3.*
from t1 join t2 using (id1) join t3 using (id2);
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 ALL id1 NULL NULL NULL 10 100.00 Using where
-1 SIMPLE t2 ref id2,id1 id1 5 test.t1.id1 10 100.00 Using where
+1 SIMPLE t1 ALL id1 NULL NULL NULL 10 100.00
+1 SIMPLE t2 ALL id2,id1 NULL NULL NULL 100 10.00 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t3 ref id2 id2 5 test.t2.id2 10 100.00
Warnings:
Note 1003 select `test`.`t1`.`id1` AS `id1`,`test`.`t1`.`a` AS `a`,`test`.`t2`.`id1` AS `id1`,`test`.`t2`.`id2` AS `id2`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`id2` AS `id2`,`test`.`t3`.`id3` AS `id3`,`test`.`t3`.`c` AS `c` from `test`.`t1` join `test`.`t2` join `test`.`t3` where `test`.`t3`.`id2` = `test`.`t2`.`id2` and `test`.`t2`.`id1` = `test`.`t1`.`id1`
@@ -167,7 +167,7 @@ number_seen OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME INDEX_NAME OPERATION NUMBER_OF
11 TABLE test t1 NULL fetch 1
1 TABLE test t1 id1 read external NULL
1 TABLE test t1 id1 read normal NULL
-110 TABLE test t2 id1 fetch 1
+101 TABLE test t2 NULL fetch 1
1 TABLE test t2 id2 read external NULL
1 TABLE test t2 id2 read normal NULL
100 TABLE test t3 id2 fetch 10
@@ -177,14 +177,15 @@ OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME INDEX_NAME COUNT_STAR COUNT_READ COUNT_WRI
TABLE test t0 NULL 0 0 0
TABLE test t1 NULL 11 11 0
TABLE test t1 id1 0 0 0
-TABLE test t2 id1 110 110 0
+TABLE test t2 NULL 101 101 0
+TABLE test t2 id1 0 0 0
TABLE test t2 id2 0 0 0
TABLE test t3 id2 1000 1000 0
TABLE test t3 id3 0 0 0
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME COUNT_STAR COUNT_READ COUNT_WRITE
TABLE test t0 0 0 0
TABLE test t1 11 11 0
-TABLE test t2 110 110 0
+TABLE test t2 101 101 0
TABLE test t3 1000 1000 0
drop table t0;
drop table t1;
diff --git a/mysql-test/suite/perfschema/r/ddl_events_stages_current.result b/mysql-test/suite/perfschema/r/ddl_events_stages_current.result
index cb7202bd..f5a8acab 100644
--- a/mysql-test/suite/perfschema/r/ddl_events_stages_current.result
+++ b/mysql-test/suite/perfschema/r/ddl_events_stages_current.result
@@ -5,6 +5,6 @@ ALTER TABLE performance_schema.events_stages_current ADD INDEX test_index(EVENT_
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index ON performance_schema.events_stages_current(EVENT_ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
-def performance_schema events_stages_current WORK_COMPLETED 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units completed for the stage. NULL if the stage event progress is not instrumented. NEVER NULL
-def performance_schema events_stages_current WORK_ESTIMATED 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units expected for the stage. NULL if the stage event progress is not instrumented. NEVER NULL
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
+def performance_schema events_stages_current WORK_COMPLETED 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units completed for the stage. NULL if the stage event progress is not instrumented. NEVER NULL NO NO
+def performance_schema events_stages_current WORK_ESTIMATED 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units expected for the stage. NULL if the stage event progress is not instrumented. NEVER NULL NO NO
diff --git a/mysql-test/suite/perfschema/r/ddl_events_stages_history.result b/mysql-test/suite/perfschema/r/ddl_events_stages_history.result
index e12c8a1d..994a7cfb 100644
--- a/mysql-test/suite/perfschema/r/ddl_events_stages_history.result
+++ b/mysql-test/suite/perfschema/r/ddl_events_stages_history.result
@@ -5,6 +5,6 @@ ALTER TABLE performance_schema.events_stages_history ADD INDEX test_index(EVENT_
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index ON performance_schema.events_stages_history(EVENT_ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
-def performance_schema events_stages_history WORK_COMPLETED 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units completed for the stage. NULL if the stage event progress is not instrumented. NEVER NULL
-def performance_schema events_stages_history WORK_ESTIMATED 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units expected for the stage. NULL if the stage event progress is not instrumented. NEVER NULL
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
+def performance_schema events_stages_history WORK_COMPLETED 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units completed for the stage. NULL if the stage event progress is not instrumented. NEVER NULL NO NO
+def performance_schema events_stages_history WORK_ESTIMATED 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units expected for the stage. NULL if the stage event progress is not instrumented. NEVER NULL NO NO
diff --git a/mysql-test/suite/perfschema/r/ddl_events_stages_history_long.result b/mysql-test/suite/perfschema/r/ddl_events_stages_history_long.result
index db8f9b8c..8f594fae 100644
--- a/mysql-test/suite/perfschema/r/ddl_events_stages_history_long.result
+++ b/mysql-test/suite/perfschema/r/ddl_events_stages_history_long.result
@@ -5,6 +5,6 @@ ALTER TABLE performance_schema.events_stages_history_long ADD INDEX test_index(E
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
CREATE UNIQUE INDEX test_index ON performance_schema.events_stages_history_long(EVENT_ID);
ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
-def performance_schema events_stages_history_long WORK_COMPLETED 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units completed for the stage. NULL if the stage event progress is not instrumented. NEVER NULL
-def performance_schema events_stages_history_long WORK_ESTIMATED 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units expected for the stage. NULL if the stage event progress is not instrumented. NEVER NULL
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
+def performance_schema events_stages_history_long WORK_COMPLETED 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units completed for the stage. NULL if the stage event progress is not instrumented. NEVER NULL NO NO
+def performance_schema events_stages_history_long WORK_ESTIMATED 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units expected for the stage. NULL if the stage event progress is not instrumented. NEVER NULL NO NO
diff --git a/mysql-test/suite/perfschema/r/digest_view.result b/mysql-test/suite/perfschema/r/digest_view.result
index 1bc4a3c2..2bc6059c 100644
--- a/mysql-test/suite/perfschema/r/digest_view.result
+++ b/mysql-test/suite/perfschema/r/digest_view.result
@@ -187,21 +187,21 @@ b a
#
# DIGESTS SEEN ON TABLE
#
-SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR
+SELECT SCHEMA_NAME, check_digest(DIGEST), DIGEST_TEXT, COUNT_STAR
FROM performance_schema.events_statements_summary_by_digest
ORDER BY DIGEST_TEXT;
-SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR
-test b69a5ddd08657692e23aa72d37dc15e0 EXPLAIN SELECT * FROM `test` . `v1` 1
-test 8c76fc18fe1711607640be2906e38f58 EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 1
-test 9bedc57de65e2ac25d67fcb6ccadb427 EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 1
-test 0539bbfdb016341a22d32fecb12c9882 EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 1
-test 3368b44e9d8b8cfb13b58f97a255d77f EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 1
-test 2f619aeadc8bd993980ef9b4d12e4222 SELECT * FROM `test` . `v1` 1
-test b9a44c024c9d79de76f2ebcd2f208c4c SELECT * FROM `test` . `v1` WHERE `a` = ? 1
-test a3ccc4c3c79e853eaa17e3ceb7a24b30 SELECT * FROM `test` . `v1` WHERE `b` > ? 1
-test 9556566adc0953fccd8e2e35019287ed SELECT `a` , `b` FROM `test` . `v1` 1
-test fc937c99007b0976d19fb685b3bf9acc SELECT `b` , `a` FROM `test` . `v1` 1
-test a73dca7a09f45de04f1f4588f0a4e19f TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
+SCHEMA_NAME check_digest(DIGEST) DIGEST_TEXT COUNT_STAR
+test 1 EXPLAIN SELECT * FROM `test` . `v1` 1
+test 1 EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 1
+test 1 EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 1
+test 1 EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 1
+test 1 EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 1
+test 1 SELECT * FROM `test` . `v1` 1
+test 1 SELECT * FROM `test` . `v1` WHERE `a` = ? 1
+test 1 SELECT * FROM `test` . `v1` WHERE `b` > ? 1
+test 1 SELECT `a` , `b` FROM `test` . `v1` 1
+test 1 SELECT `b` , `a` FROM `test` . `v1` 1
+test 1 TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
DROP TABLE test.v1;
CREATE VIEW test.v1 AS SELECT * FROM test.t1;
EXPLAIN SELECT * from test.v1;
@@ -244,23 +244,25 @@ b a
#
# DIGESTS SEEN ON VIEW
#
-SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR
+call reset_digests;
+SELECT SCHEMA_NAME, check_digest(DIGEST), DIGEST_TEXT, COUNT_STAR
FROM performance_schema.events_statements_summary_by_digest
ORDER BY DIGEST_TEXT;
-SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR
-test 7f6c48fe072a231bc75d6d449978b9f5 CREATE VIEW `test` . `v1` AS SELECT * FROM `test` . `t1` 1
-test c24db45ea4beed6ba2537ca6ea2d0484 DROP TABLE `test` . `v1` 1
-test b69a5ddd08657692e23aa72d37dc15e0 EXPLAIN SELECT * FROM `test` . `v1` 2
-test 8c76fc18fe1711607640be2906e38f58 EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 2
-test 9bedc57de65e2ac25d67fcb6ccadb427 EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 2
-test 0539bbfdb016341a22d32fecb12c9882 EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 2
-test 3368b44e9d8b8cfb13b58f97a255d77f EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 2
-test 2f619aeadc8bd993980ef9b4d12e4222 SELECT * FROM `test` . `v1` 2
-test b9a44c024c9d79de76f2ebcd2f208c4c SELECT * FROM `test` . `v1` WHERE `a` = ? 2
-test a3ccc4c3c79e853eaa17e3ceb7a24b30 SELECT * FROM `test` . `v1` WHERE `b` > ? 2
-test 7b82ea9a7c1859f76abed712d2d4b14d SELECT SCHEMA_NAME , `DIGEST` , `DIGEST_TEXT` , `COUNT_STAR` FROM `performance_schema` . `events_statements_summary_by_digest` ORDER BY `DIGEST_TEXT` 1
-test 9556566adc0953fccd8e2e35019287ed SELECT `a` , `b` FROM `test` . `v1` 2
-test fc937c99007b0976d19fb685b3bf9acc SELECT `b` , `a` FROM `test` . `v1` 2
-test a73dca7a09f45de04f1f4588f0a4e19f TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
+SCHEMA_NAME check_digest(DIGEST) DIGEST_TEXT COUNT_STAR
+test 1 CALL `reset_digests` 1
+test 1 CREATE VIEW `test` . `v1` AS SELECT * FROM `test` . `t1` 1
+test 1 DROP TABLE `test` . `v1` 1
+test 1 EXPLAIN SELECT * FROM `test` . `v1` 2
+test 1 EXPLAIN SELECT * FROM `test` . `v1` WHERE `a` = ? 2
+test 1 EXPLAIN SELECT * FROM `test` . `v1` WHERE `b` > ? 2
+test 1 EXPLAIN SELECT `a` , `b` FROM `test` . `v1` 2
+test 1 EXPLAIN SELECT `b` , `a` FROM `test` . `v1` 2
+test 1 SELECT * FROM `test` . `v1` 2
+test 1 SELECT * FROM `test` . `v1` WHERE `a` = ? 2
+test 1 SELECT * FROM `test` . `v1` WHERE `b` > ? 2
+test 1 SELECT SCHEMA_NAME , `check_digest` ( `DIGEST` ) , `DIGEST_TEXT` , `COUNT_STAR` FROM `performance_schema` . `events_statements_summary_by_digest` ORDER BY `DIGEST_TEXT` 1
+test 1 SELECT `a` , `b` FROM `test` . `v1` 2
+test 1 SELECT `b` , `a` FROM `test` . `v1` 2
+test 1 TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
DROP VIEW test.v1;
DROP TABLE test.t1;
diff --git a/mysql-test/suite/perfschema/r/dml_handler.result b/mysql-test/suite/perfschema/r/dml_handler.result
index 61bbba31..1510adc7 100644
--- a/mysql-test/suite/perfschema/r/dml_handler.result
+++ b/mysql-test/suite/perfschema/r/dml_handler.result
@@ -6,8 +6,6 @@ SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA='performance_schema'
ORDER BY TABLE_NAME;
SELECT COUNT(*) FROM table_list INTO @table_count;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
#
# For each table in the performance schema, attempt HANDLER...OPEN,
# which should fail with an error 1031, ER_ILLEGAL_HA.
diff --git a/mysql-test/suite/perfschema/r/dml_setup_instruments.result b/mysql-test/suite/perfschema/r/dml_setup_instruments.result
index cdc52da5..ff000a09 100644
--- a/mysql-test/suite/perfschema/r/dml_setup_instruments.result
+++ b/mysql-test/suite/perfschema/r/dml_setup_instruments.result
@@ -8,12 +8,12 @@ wait/synch/mutex/sql/Ack_receiver::mutex YES YES
wait/synch/mutex/sql/Cversion_lock YES YES
wait/synch/mutex/sql/Delayed_insert::mutex YES YES
wait/synch/mutex/sql/Event_scheduler::LOCK_scheduler_state YES YES
+wait/synch/mutex/sql/Gtid_index_writer::gtid_index_mutex YES YES
wait/synch/mutex/sql/gtid_waiting::LOCK_gtid_waiting YES YES
wait/synch/mutex/sql/hash_filo::lock YES YES
wait/synch/mutex/sql/HA_DATA_PARTITION::LOCK_auto_inc YES YES
wait/synch/mutex/sql/LOCK_active_mi YES YES
wait/synch/mutex/sql/LOCK_after_binlog_sync YES YES
-wait/synch/mutex/sql/LOCK_audit_mask YES YES
select * from performance_schema.setup_instruments
where name like 'Wait/Synch/Rwlock/sql/%'
and name not in (
diff --git a/mysql-test/suite/perfschema/r/dml_setup_timers.result b/mysql-test/suite/perfschema/r/dml_setup_timers.result
index 6f5a1f5c..55ccfaf4 100644
--- a/mysql-test/suite/perfschema/r/dml_setup_timers.result
+++ b/mysql-test/suite/perfschema/r/dml_setup_timers.result
@@ -1,23 +1,23 @@
update performance_schema.setup_timers
set timer_name='CYCLE' where name="wait";
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
update performance_schema.setup_timers
set timer_name='NANOSECOND' where name="stage";
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
update performance_schema.setup_timers
set timer_name='NANOSECOND' where name="statement";
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
update performance_schema.setup_timers
set timer_name='MICROSECOND' where name="transaction";
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
update performance_schema.setup_timers
set timer_name='MICROSECOND' where name="idle";
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.setup_timers;
NAME TIMER_NAME
idle MICROSECOND
@@ -26,19 +26,19 @@ stage NANOSECOND
statement NANOSECOND
transaction MICROSECOND
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.setup_timers
where name='Wait';
NAME TIMER_NAME
wait CYCLE
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.setup_timers
where timer_name='CYCLE';
NAME TIMER_NAME
wait CYCLE
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
insert into performance_schema.setup_timers
set name='FOO', timer_name='CYCLE';
ERROR 42000: INSERT command denied to user 'root'@'localhost' for table `performance_schema`.`setup_timers`
@@ -48,7 +48,7 @@ ERROR HY000: Invalid performance_schema usage
update performance_schema.setup_timers
set timer_name='MILLISECOND';
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.setup_timers;
NAME TIMER_NAME
idle MILLISECOND
@@ -57,11 +57,11 @@ stage MILLISECOND
statement MILLISECOND
transaction MILLISECOND
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
update performance_schema.setup_timers
set timer_name='CYCLE';
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
delete from performance_schema.setup_timers;
ERROR 42000: DELETE command denied to user 'root'@'localhost' for table `performance_schema`.`setup_timers`
delete from performance_schema.setup_timers
@@ -74,23 +74,23 @@ UNLOCK TABLES;
update performance_schema.setup_timers
set timer_name='CYCLE' where name="wait";
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
update performance_schema.setup_timers
set timer_name='NANOSECOND' where name="stage";
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
update performance_schema.setup_timers
set timer_name='NANOSECOND' where name="statement";
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
update performance_schema.setup_timers
set timer_name='MICROSECOND' where name="transaction";
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
update performance_schema.setup_timers
set timer_name='MICROSECOND' where name="idle";
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.setup_timers;
NAME TIMER_NAME
idle MICROSECOND
@@ -99,7 +99,7 @@ stage NANOSECOND
statement NANOSECOND
transaction MICROSECOND
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
#
# MDEV-25325 column_comment for performance_schema tables
#
diff --git a/mysql-test/suite/perfschema/r/event_aggregate.result b/mysql-test/suite/perfschema/r/event_aggregate.result
index abc3b205..02d2c134 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate.result
@@ -248,37 +248,37 @@ wait/synch/rwlock/sql/LOCK_grant 1
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 4
-localhost stage/sql/closing tables 11
+localhost stage/sql/closing tables 12
localhost stage/sql/init 3
-localhost stage/sql/Opening tables 7
+localhost stage/sql/Opening tables 8
localhost stage/sql/starting 7
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_statements_account;
user host event_name count_star
@@ -315,19 +315,19 @@ statement/sql/insert 1
statement/sql/select 3
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
+user1 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
+user1 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 2
+localhost transaction 3
execute dump_transactions_global;
event_name count_star
-transaction 2
+transaction 3
execute dump_transactions_history;
event_name count(event_name)
-transaction 2
+transaction 3
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -380,9 +380,9 @@ wait/synch/rwlock/sql/LOCK_grant 1
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 0
user2 localhost stage/sql/closing tables 0
@@ -392,9 +392,9 @@ user2 localhost stage/sql/starting 0
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 0
user2 stage/sql/closing tables 0
@@ -404,23 +404,23 @@ user2 stage/sql/starting 0
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 4
-localhost stage/sql/closing tables 11
+localhost stage/sql/closing tables 12
localhost stage/sql/init 3
-localhost stage/sql/Opening tables 7
+localhost stage/sql/Opening tables 8
localhost stage/sql/starting 7
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_statements_account;
user host event_name count_star
@@ -467,21 +467,21 @@ statement/sql/insert 1
statement/sql/select 3
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
+user1 localhost transaction 3
user2 localhost transaction 0
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
+user1 transaction 3
user2 transaction 0
execute dump_transactions_host;
host event_name count_star
-localhost transaction 2
+localhost transaction 3
execute dump_transactions_global;
event_name count_star
-transaction 2
+transaction 3
execute dump_transactions_history;
event_name count(event_name)
-transaction 2
+transaction 3
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -548,47 +548,47 @@ wait/synch/rwlock/sql/LOCK_grant 2
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 8
-localhost stage/sql/closing tables 21
+localhost stage/sql/closing tables 23
localhost stage/sql/init 6
-localhost stage/sql/Opening tables 13
+localhost stage/sql/Opening tables 15
localhost stage/sql/starting 14
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_statements_account;
user host event_name count_star
@@ -635,21 +635,21 @@ statement/sql/insert 2
statement/sql/select 6
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
+user1 transaction 3
+user2 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 4
+localhost transaction 6
execute dump_transactions_global;
event_name count_star
-transaction 4
+transaction 6
execute dump_transactions_history;
event_name count(event_name)
-transaction 4
+transaction 6
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -709,14 +709,14 @@ wait/synch/rwlock/sql/LOCK_grant 2
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
user3 localhost stage/sql/checking permissions 0
user3 localhost stage/sql/closing tables 0
@@ -726,14 +726,14 @@ user3 localhost stage/sql/starting 0
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
user3 stage/sql/checking permissions 0
user3 stage/sql/closing tables 0
@@ -743,23 +743,23 @@ user3 stage/sql/starting 0
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 8
-localhost stage/sql/closing tables 21
+localhost stage/sql/closing tables 23
localhost stage/sql/init 6
-localhost stage/sql/Opening tables 13
+localhost stage/sql/Opening tables 15
localhost stage/sql/starting 14
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_statements_account;
user host event_name count_star
@@ -816,23 +816,23 @@ statement/sql/insert 2
statement/sql/select 6
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
user3 localhost transaction 0
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
+user1 transaction 3
+user2 transaction 3
user3 transaction 0
execute dump_transactions_host;
host event_name count_star
-localhost transaction 4
+localhost transaction 6
execute dump_transactions_global;
event_name count_star
-transaction 4
+transaction 6
execute dump_transactions_history;
event_name count(event_name)
-transaction 4
+transaction 6
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -906,57 +906,57 @@ wait/synch/rwlock/sql/LOCK_grant 3
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 31
+localhost stage/sql/closing tables 34
localhost stage/sql/init 9
-localhost stage/sql/Opening tables 19
+localhost stage/sql/Opening tables 22
localhost stage/sql/starting 21
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_statements_account;
user host event_name count_star
@@ -1013,23 +1013,23 @@ statement/sql/insert 3
statement/sql/select 9
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 6
+localhost transaction 9
execute dump_transactions_global;
event_name count_star
-transaction 6
+transaction 9
execute dump_transactions_history;
event_name count(event_name)
-transaction 6
+transaction 9
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -1096,19 +1096,19 @@ wait/synch/rwlock/sql/LOCK_grant 3
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 7
user4 localhost stage/sql/checking permissions 0
user4 localhost stage/sql/closing tables 0
@@ -1118,19 +1118,19 @@ user4 localhost stage/sql/starting 0
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 7
user4 stage/sql/checking permissions 0
user4 stage/sql/closing tables 0
@@ -1140,23 +1140,23 @@ user4 stage/sql/starting 0
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 31
+localhost stage/sql/closing tables 34
localhost stage/sql/init 9
-localhost stage/sql/Opening tables 19
+localhost stage/sql/Opening tables 22
localhost stage/sql/starting 21
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_statements_account;
user host event_name count_star
@@ -1223,25 +1223,25 @@ statement/sql/insert 3
statement/sql/select 9
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
user4 localhost transaction 0
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
user4 transaction 0
execute dump_transactions_host;
host event_name count_star
-localhost transaction 6
+localhost transaction 9
execute dump_transactions_global;
event_name count_star
-transaction 6
+transaction 9
execute dump_transactions_history;
event_name count(event_name)
-transaction 6
+transaction 9
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -1322,67 +1322,67 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 7
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 7
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 28
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 28
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 28
execute dump_statements_account;
user host event_name count_star
@@ -1449,25 +1449,25 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -1535,67 +1535,67 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 7
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 7
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 29
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 29
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 29
execute dump_statements_account;
user host event_name count_star
@@ -1663,25 +1663,25 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -1748,67 +1748,67 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 7
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 7
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 30
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 30
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 30
execute dump_statements_account;
user host event_name count_star
@@ -1876,25 +1876,25 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -1960,67 +1960,67 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 31
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 31
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 31
execute dump_statements_account;
user host event_name count_star
@@ -2088,25 +2088,25 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2171,67 +2171,67 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2299,25 +2299,25 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2383,67 +2383,67 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2511,25 +2511,25 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2594,67 +2594,67 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2722,25 +2722,25 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2805,67 +2805,67 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2933,25 +2933,25 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -3016,67 +3016,67 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3144,25 +3144,25 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -3227,67 +3227,67 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3355,25 +3355,25 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -3438,67 +3438,67 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3566,25 +3566,25 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -3671,45 +3671,45 @@ user4 localhost stage/sql/starting 0
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3777,25 +3777,25 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -3904,23 +3904,23 @@ user4 stage/sql/starting 0
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3988,25 +3988,25 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -4122,16 +4122,16 @@ localhost stage/sql/starting 0
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4199,25 +4199,25 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -4340,9 +4340,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4410,25 +4410,25 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -4551,9 +4551,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4621,25 +4621,25 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -4762,9 +4762,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4832,25 +4832,25 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -4973,9 +4973,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -5043,25 +5043,25 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -5184,9 +5184,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -5254,25 +5254,25 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -5395,9 +5395,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -5465,25 +5465,25 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -5606,9 +5606,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -5676,25 +5676,25 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -5817,9 +5817,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -5893,19 +5893,19 @@ user3 localhost transaction 0
user4 localhost transaction 0
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -6028,9 +6028,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -6110,13 +6110,13 @@ user3 transaction 0
user4 transaction 0
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -6239,9 +6239,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -6324,10 +6324,10 @@ host event_name count_star
localhost transaction 0
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -6450,9 +6450,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -6538,7 +6538,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -6633,9 +6633,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -6697,7 +6697,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -6760,9 +6760,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -6800,7 +6800,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -6859,9 +6859,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -6899,7 +6899,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a.result
index eb2ac32f..f53a54ec 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_a.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a.result
@@ -232,30 +232,30 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 4
-localhost stage/sql/closing tables 11
+localhost stage/sql/closing tables 12
localhost stage/sql/init 3
-localhost stage/sql/Opening tables 7
+localhost stage/sql/Opening tables 8
localhost stage/sql/starting 7
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_statements_account;
user host event_name count_star
@@ -289,16 +289,16 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
+user1 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 2
+localhost transaction 3
execute dump_transactions_global;
event_name count_star
-transaction 2
+transaction 3
execute dump_transactions_history;
event_name count(event_name)
-transaction 2
+transaction 3
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -347,9 +347,9 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 0
user2 stage/sql/closing tables 0
@@ -359,23 +359,23 @@ user2 stage/sql/starting 0
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 4
-localhost stage/sql/closing tables 11
+localhost stage/sql/closing tables 12
localhost stage/sql/init 3
-localhost stage/sql/Opening tables 7
+localhost stage/sql/Opening tables 8
localhost stage/sql/starting 7
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_statements_account;
user host event_name count_star
@@ -414,17 +414,17 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
+user1 transaction 3
user2 transaction 0
execute dump_transactions_host;
host event_name count_star
-localhost transaction 2
+localhost transaction 3
execute dump_transactions_global;
event_name count_star
-transaction 2
+transaction 3
execute dump_transactions_history;
event_name count(event_name)
-transaction 2
+transaction 3
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -486,35 +486,35 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 8
-localhost stage/sql/closing tables 21
+localhost stage/sql/closing tables 23
localhost stage/sql/init 6
-localhost stage/sql/Opening tables 13
+localhost stage/sql/Opening tables 15
localhost stage/sql/starting 14
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_statements_account;
user host event_name count_star
@@ -553,17 +553,17 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
+user1 transaction 3
+user2 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 4
+localhost transaction 6
execute dump_transactions_global;
event_name count_star
-transaction 4
+transaction 6
execute dump_transactions_history;
event_name count(event_name)
-transaction 4
+transaction 6
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -616,14 +616,14 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
user3 stage/sql/checking permissions 0
user3 stage/sql/closing tables 0
@@ -633,23 +633,23 @@ user3 stage/sql/starting 0
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 8
-localhost stage/sql/closing tables 21
+localhost stage/sql/closing tables 23
localhost stage/sql/init 6
-localhost stage/sql/Opening tables 13
+localhost stage/sql/Opening tables 15
localhost stage/sql/starting 14
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_statements_account;
user host event_name count_star
@@ -693,18 +693,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
+user1 transaction 3
+user2 transaction 3
user3 transaction 0
execute dump_transactions_host;
host event_name count_star
-localhost transaction 4
+localhost transaction 6
execute dump_transactions_global;
event_name count_star
-transaction 4
+transaction 6
execute dump_transactions_history;
event_name count(event_name)
-transaction 4
+transaction 6
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -770,40 +770,40 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 31
+localhost stage/sql/closing tables 34
localhost stage/sql/init 9
-localhost stage/sql/Opening tables 19
+localhost stage/sql/Opening tables 22
localhost stage/sql/starting 21
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_statements_account;
user host event_name count_star
@@ -847,18 +847,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 6
+localhost transaction 9
execute dump_transactions_global;
event_name count_star
-transaction 6
+transaction 9
execute dump_transactions_history;
event_name count(event_name)
-transaction 6
+transaction 9
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -915,19 +915,19 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 7
user4 stage/sql/checking permissions 0
user4 stage/sql/closing tables 0
@@ -937,23 +937,23 @@ user4 stage/sql/starting 0
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 31
+localhost stage/sql/closing tables 34
localhost stage/sql/init 9
-localhost stage/sql/Opening tables 19
+localhost stage/sql/Opening tables 22
localhost stage/sql/starting 21
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_statements_account;
user host event_name count_star
@@ -1002,19 +1002,19 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
user4 transaction 0
execute dump_transactions_host;
host event_name count_star
-localhost transaction 6
+localhost transaction 9
execute dump_transactions_global;
event_name count_star
-transaction 6
+transaction 9
execute dump_transactions_history;
event_name count(event_name)
-transaction 6
+transaction 9
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1084,45 +1084,45 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 7
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 28
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 28
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 28
execute dump_statements_account;
user host event_name count_star
@@ -1171,19 +1171,19 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1240,45 +1240,45 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 7
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 29
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 29
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 29
execute dump_statements_account;
user host event_name count_star
@@ -1328,19 +1328,19 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1396,45 +1396,45 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 7
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 30
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 30
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 30
execute dump_statements_account;
user host event_name count_star
@@ -1484,19 +1484,19 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1551,45 +1551,45 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 31
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 31
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 31
execute dump_statements_account;
user host event_name count_star
@@ -1639,19 +1639,19 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1705,45 +1705,45 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1793,19 +1793,19 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1860,45 +1860,45 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1948,19 +1948,19 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2014,45 +2014,45 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2102,19 +2102,19 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2168,45 +2168,45 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2256,19 +2256,19 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2322,45 +2322,45 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2410,19 +2410,19 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2476,45 +2476,45 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2564,19 +2564,19 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2630,45 +2630,45 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2718,19 +2718,19 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2784,45 +2784,45 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2872,19 +2872,19 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2960,23 +2960,23 @@ user4 stage/sql/starting 0
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3026,19 +3026,19 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -3121,16 +3121,16 @@ localhost stage/sql/starting 0
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3180,19 +3180,19 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -3282,9 +3282,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3334,19 +3334,19 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -3436,9 +3436,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3488,19 +3488,19 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -3590,9 +3590,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3642,19 +3642,19 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -3744,9 +3744,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3796,19 +3796,19 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -3898,9 +3898,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3950,19 +3950,19 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -4052,9 +4052,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4104,19 +4104,19 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -4206,9 +4206,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4258,19 +4258,19 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -4360,9 +4360,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4412,19 +4412,19 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -4514,9 +4514,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4572,13 +4572,13 @@ user3 transaction 0
user4 transaction 0
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -4668,9 +4668,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4729,10 +4729,10 @@ host event_name count_star
localhost transaction 0
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -4822,9 +4822,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4886,7 +4886,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -4976,9 +4976,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -5040,7 +5040,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -5102,9 +5102,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -5142,7 +5142,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -5200,9 +5200,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -5240,7 +5240,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result
index 8dbe393e..a4510e11 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result
@@ -202,25 +202,25 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_statements_account;
user host event_name count_star
@@ -249,15 +249,15 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
+user1 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 2
+transaction 3
execute dump_transactions_history;
event_name count(event_name)
-transaction 2
+transaction 3
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -303,9 +303,9 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 0
user2 stage/sql/closing tables 0
@@ -317,16 +317,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_statements_account;
user host event_name count_star
@@ -360,16 +360,16 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
+user1 transaction 3
user2 transaction 0
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 2
+transaction 3
execute dump_transactions_history;
event_name count(event_name)
-transaction 2
+transaction 3
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -428,30 +428,30 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_statements_account;
user host event_name count_star
@@ -485,16 +485,16 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
+user1 transaction 3
+user2 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 4
+transaction 6
execute dump_transactions_history;
event_name count(event_name)
-transaction 4
+transaction 6
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -544,14 +544,14 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
user3 stage/sql/checking permissions 0
user3 stage/sql/closing tables 0
@@ -563,16 +563,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_statements_account;
user host event_name count_star
@@ -611,17 +611,17 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
+user1 transaction 3
+user2 transaction 3
user3 transaction 0
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 4
+transaction 6
execute dump_transactions_history;
event_name count(event_name)
-transaction 4
+transaction 6
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -684,35 +684,35 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_statements_account;
user host event_name count_star
@@ -751,17 +751,17 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 6
+transaction 9
execute dump_transactions_history;
event_name count(event_name)
-transaction 6
+transaction 9
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -815,19 +815,19 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 7
user4 stage/sql/checking permissions 0
user4 stage/sql/closing tables 0
@@ -839,16 +839,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_statements_account;
user host event_name count_star
@@ -892,18 +892,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
user4 transaction 0
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 6
+transaction 9
execute dump_transactions_history;
event_name count(event_name)
-transaction 6
+transaction 9
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -970,40 +970,40 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 7
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 28
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 28
execute dump_statements_account;
user host event_name count_star
@@ -1047,18 +1047,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1112,40 +1112,40 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 7
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 29
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 29
execute dump_statements_account;
user host event_name count_star
@@ -1190,18 +1190,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1254,40 +1254,40 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 7
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 30
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 30
execute dump_statements_account;
user host event_name count_star
@@ -1332,18 +1332,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1395,40 +1395,40 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 31
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 31
execute dump_statements_account;
user host event_name count_star
@@ -1473,18 +1473,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1535,40 +1535,40 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1613,18 +1613,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1676,40 +1676,40 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1754,18 +1754,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1816,40 +1816,40 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1894,18 +1894,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1956,40 +1956,40 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2034,18 +2034,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2096,40 +2096,40 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2174,18 +2174,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2236,40 +2236,40 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2314,18 +2314,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2376,40 +2376,40 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2454,18 +2454,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2516,40 +2516,40 @@ user host event_name count_star
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2594,18 +2594,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2680,16 +2680,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2734,18 +2734,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2820,16 +2820,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2874,18 +2874,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2967,9 +2967,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3014,18 +3014,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -3107,9 +3107,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3154,18 +3154,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -3247,9 +3247,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3294,18 +3294,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -3387,9 +3387,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3434,18 +3434,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -3527,9 +3527,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3574,18 +3574,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -3667,9 +3667,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3714,18 +3714,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -3807,9 +3807,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3854,18 +3854,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -3947,9 +3947,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3994,18 +3994,18 @@ execute dump_transactions_account;
user host event_name count_star
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -4087,9 +4087,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4142,10 +4142,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -4227,9 +4227,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4282,10 +4282,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -4367,9 +4367,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4425,7 +4425,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -4507,9 +4507,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4565,7 +4565,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -4619,9 +4619,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4653,7 +4653,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -4703,9 +4703,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4737,7 +4737,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result
index f44c3bf9..0623f5b9 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result
@@ -216,23 +216,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 4
-localhost stage/sql/closing tables 11
+localhost stage/sql/closing tables 12
localhost stage/sql/init 3
-localhost stage/sql/Opening tables 7
+localhost stage/sql/Opening tables 8
localhost stage/sql/starting 7
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_statements_account;
user host event_name count_star
@@ -263,13 +263,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 2
+localhost transaction 3
execute dump_transactions_global;
event_name count_star
-transaction 2
+transaction 3
execute dump_transactions_history;
event_name count(event_name)
-transaction 2
+transaction 3
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -314,23 +314,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 4
-localhost stage/sql/closing tables 11
+localhost stage/sql/closing tables 12
localhost stage/sql/init 3
-localhost stage/sql/Opening tables 7
+localhost stage/sql/Opening tables 8
localhost stage/sql/starting 7
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_statements_account;
user host event_name count_star
@@ -361,13 +361,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 2
+localhost transaction 3
execute dump_transactions_global;
event_name count_star
-transaction 2
+transaction 3
execute dump_transactions_history;
event_name count(event_name)
-transaction 2
+transaction 3
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -424,23 +424,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 8
-localhost stage/sql/closing tables 21
+localhost stage/sql/closing tables 23
localhost stage/sql/init 6
-localhost stage/sql/Opening tables 13
+localhost stage/sql/Opening tables 15
localhost stage/sql/starting 14
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_statements_account;
user host event_name count_star
@@ -471,13 +471,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 4
+localhost transaction 6
execute dump_transactions_global;
event_name count_star
-transaction 4
+transaction 6
execute dump_transactions_history;
event_name count(event_name)
-transaction 4
+transaction 6
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -523,23 +523,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 8
-localhost stage/sql/closing tables 21
+localhost stage/sql/closing tables 23
localhost stage/sql/init 6
-localhost stage/sql/Opening tables 13
+localhost stage/sql/Opening tables 15
localhost stage/sql/starting 14
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_statements_account;
user host event_name count_star
@@ -570,13 +570,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 4
+localhost transaction 6
execute dump_transactions_global;
event_name count_star
-transaction 4
+transaction 6
execute dump_transactions_history;
event_name count(event_name)
-transaction 4
+transaction 6
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -634,23 +634,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 31
+localhost stage/sql/closing tables 34
localhost stage/sql/init 9
-localhost stage/sql/Opening tables 19
+localhost stage/sql/Opening tables 22
localhost stage/sql/starting 21
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_statements_account;
user host event_name count_star
@@ -681,13 +681,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 6
+localhost transaction 9
execute dump_transactions_global;
event_name count_star
-transaction 6
+transaction 9
execute dump_transactions_history;
event_name count(event_name)
-transaction 6
+transaction 9
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -734,23 +734,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 31
+localhost stage/sql/closing tables 34
localhost stage/sql/init 9
-localhost stage/sql/Opening tables 19
+localhost stage/sql/Opening tables 22
localhost stage/sql/starting 21
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_statements_account;
user host event_name count_star
@@ -781,13 +781,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 6
+localhost transaction 9
execute dump_transactions_global;
event_name count_star
-transaction 6
+transaction 9
execute dump_transactions_history;
event_name count(event_name)
-transaction 6
+transaction 9
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -846,23 +846,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 28
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 28
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 28
execute dump_statements_account;
user host event_name count_star
@@ -893,13 +893,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -945,23 +945,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 29
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 29
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 29
execute dump_statements_account;
user host event_name count_star
@@ -993,13 +993,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1044,23 +1044,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 30
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 30
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 30
execute dump_statements_account;
user host event_name count_star
@@ -1092,13 +1092,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1142,23 +1142,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 31
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 31
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 31
execute dump_statements_account;
user host event_name count_star
@@ -1190,13 +1190,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1239,23 +1239,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1287,13 +1287,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1337,23 +1337,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1385,13 +1385,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1434,23 +1434,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1482,13 +1482,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1531,23 +1531,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1579,13 +1579,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1628,23 +1628,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1676,13 +1676,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1725,23 +1725,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1773,13 +1773,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1822,23 +1822,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1870,13 +1870,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1919,23 +1919,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1967,13 +1967,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2016,23 +2016,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2064,13 +2064,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2120,16 +2120,16 @@ localhost stage/sql/starting 0
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2161,13 +2161,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2224,9 +2224,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2258,13 +2258,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2321,9 +2321,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2355,13 +2355,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2418,9 +2418,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2452,13 +2452,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2515,9 +2515,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2549,13 +2549,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2612,9 +2612,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2646,13 +2646,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2709,9 +2709,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2743,13 +2743,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2806,9 +2806,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2840,13 +2840,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2903,9 +2903,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2937,13 +2937,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -3000,9 +3000,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3034,13 +3034,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -3097,9 +3097,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3134,10 +3134,10 @@ host event_name count_star
localhost transaction 0
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -3194,9 +3194,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3234,7 +3234,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -3291,9 +3291,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3331,7 +3331,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -3388,9 +3388,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3428,7 +3428,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -3485,9 +3485,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3525,7 +3525,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result
index 887c74d3..d4161510 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result
@@ -188,16 +188,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_statements_account;
user host event_name count_star
@@ -225,10 +225,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 2
+transaction 3
execute dump_transactions_history;
event_name count(event_name)
-transaction 2
+transaction 3
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -272,16 +272,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_statements_account;
user host event_name count_star
@@ -309,10 +309,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 2
+transaction 3
execute dump_transactions_history;
event_name count(event_name)
-transaction 2
+transaction 3
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -368,16 +368,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_statements_account;
user host event_name count_star
@@ -405,10 +405,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 4
+transaction 6
execute dump_transactions_history;
event_name count(event_name)
-transaction 4
+transaction 6
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -453,16 +453,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_statements_account;
user host event_name count_star
@@ -490,10 +490,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 4
+transaction 6
execute dump_transactions_history;
event_name count(event_name)
-transaction 4
+transaction 6
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -550,16 +550,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_statements_account;
user host event_name count_star
@@ -587,10 +587,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 6
+transaction 9
execute dump_transactions_history;
event_name count(event_name)
-transaction 6
+transaction 9
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -636,16 +636,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_statements_account;
user host event_name count_star
@@ -673,10 +673,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 6
+transaction 9
execute dump_transactions_history;
event_name count(event_name)
-transaction 6
+transaction 9
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -734,16 +734,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 28
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 28
execute dump_statements_account;
user host event_name count_star
@@ -771,10 +771,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -819,16 +819,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 29
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 29
execute dump_statements_account;
user host event_name count_star
@@ -857,10 +857,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -904,16 +904,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 30
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 30
execute dump_statements_account;
user host event_name count_star
@@ -942,10 +942,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -988,16 +988,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 31
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 31
execute dump_statements_account;
user host event_name count_star
@@ -1026,10 +1026,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1071,16 +1071,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1109,10 +1109,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1155,16 +1155,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1193,10 +1193,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1238,16 +1238,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1276,10 +1276,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1321,16 +1321,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1359,10 +1359,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1404,16 +1404,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1442,10 +1442,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1487,16 +1487,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1525,10 +1525,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1570,16 +1570,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1608,10 +1608,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1653,16 +1653,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1691,10 +1691,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1736,16 +1736,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1774,10 +1774,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1819,16 +1819,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1857,10 +1857,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1909,9 +1909,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1940,10 +1940,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -1992,9 +1992,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2023,10 +2023,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2075,9 +2075,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2106,10 +2106,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2158,9 +2158,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2189,10 +2189,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2241,9 +2241,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2272,10 +2272,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2324,9 +2324,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2355,10 +2355,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2407,9 +2407,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2438,10 +2438,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2490,9 +2490,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2521,10 +2521,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2573,9 +2573,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2604,10 +2604,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2656,9 +2656,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2687,10 +2687,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2739,9 +2739,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2773,7 +2773,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2822,9 +2822,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2856,7 +2856,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2905,9 +2905,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2939,7 +2939,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
@@ -2988,9 +2988,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3022,7 +3022,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_users;
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_h.result
index b9a885f6..edd335e4 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_h.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_h.result
@@ -218,32 +218,32 @@ wait/synch/rwlock/sql/LOCK_grant 1
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_statements_account;
user host event_name count_star
@@ -275,18 +275,18 @@ statement/sql/insert 1
statement/sql/select 3
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
+user1 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
+user1 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 2
+transaction 3
execute dump_transactions_history;
event_name count(event_name)
-transaction 2
+transaction 3
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -336,9 +336,9 @@ wait/synch/rwlock/sql/LOCK_grant 1
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 0
user2 localhost stage/sql/closing tables 0
@@ -348,9 +348,9 @@ user2 localhost stage/sql/starting 0
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 0
user2 stage/sql/closing tables 0
@@ -362,16 +362,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_statements_account;
user host event_name count_star
@@ -413,20 +413,20 @@ statement/sql/insert 1
statement/sql/select 3
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
+user1 localhost transaction 3
user2 localhost transaction 0
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
+user1 transaction 3
user2 transaction 0
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 2
+transaction 3
execute dump_transactions_history;
event_name count(event_name)
-transaction 2
+transaction 3
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -490,42 +490,42 @@ wait/synch/rwlock/sql/LOCK_grant 2
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_statements_account;
user host event_name count_star
@@ -567,20 +567,20 @@ statement/sql/insert 2
statement/sql/select 6
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
+user1 transaction 3
+user2 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 4
+transaction 6
execute dump_transactions_history;
event_name count(event_name)
-transaction 4
+transaction 6
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -637,14 +637,14 @@ wait/synch/rwlock/sql/LOCK_grant 2
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
user3 localhost stage/sql/checking permissions 0
user3 localhost stage/sql/closing tables 0
@@ -654,14 +654,14 @@ user3 localhost stage/sql/starting 0
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
user3 stage/sql/checking permissions 0
user3 stage/sql/closing tables 0
@@ -673,16 +673,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_statements_account;
user host event_name count_star
@@ -734,22 +734,22 @@ statement/sql/insert 2
statement/sql/select 6
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
user3 localhost transaction 0
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
+user1 transaction 3
+user2 transaction 3
user3 transaction 0
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 4
+transaction 6
execute dump_transactions_history;
event_name count(event_name)
-transaction 4
+transaction 6
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -820,52 +820,52 @@ wait/synch/rwlock/sql/LOCK_grant 3
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_statements_account;
user host event_name count_star
@@ -917,22 +917,22 @@ statement/sql/insert 3
statement/sql/select 9
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 6
+transaction 9
execute dump_transactions_history;
event_name count(event_name)
-transaction 6
+transaction 9
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -996,19 +996,19 @@ wait/synch/rwlock/sql/LOCK_grant 3
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 7
user4 localhost stage/sql/checking permissions 0
user4 localhost stage/sql/closing tables 0
@@ -1018,19 +1018,19 @@ user4 localhost stage/sql/starting 0
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 7
user4 stage/sql/checking permissions 0
user4 stage/sql/closing tables 0
@@ -1042,16 +1042,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_statements_account;
user host event_name count_star
@@ -1113,24 +1113,24 @@ statement/sql/insert 3
statement/sql/select 9
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
user4 localhost transaction 0
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
user4 transaction 0
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 6
+transaction 9
execute dump_transactions_history;
event_name count(event_name)
-transaction 6
+transaction 9
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -1208,62 +1208,62 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 7
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 7
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 7
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 28
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 28
execute dump_statements_account;
user host event_name count_star
@@ -1325,24 +1325,24 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -1407,62 +1407,62 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 7
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 7
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 7
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 29
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 29
execute dump_statements_account;
user host event_name count_star
@@ -1525,24 +1525,24 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -1606,62 +1606,62 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 7
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 7
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 30
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 30
execute dump_statements_account;
user host event_name count_star
@@ -1724,24 +1724,24 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -1804,62 +1804,62 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 7
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 31
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 31
execute dump_statements_account;
user host event_name count_star
@@ -1922,24 +1922,24 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2001,62 +2001,62 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2119,24 +2119,24 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2199,62 +2199,62 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2317,24 +2317,24 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2396,62 +2396,62 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2514,24 +2514,24 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2593,62 +2593,62 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2711,24 +2711,24 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2790,62 +2790,62 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2908,24 +2908,24 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2987,62 +2987,62 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3105,24 +3105,24 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -3184,62 +3184,62 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3302,24 +3302,24 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -3403,40 +3403,40 @@ user4 localhost stage/sql/starting 0
execute dump_stages_user;
user event_name count_star
user1 stage/sql/checking permissions 4
-user1 stage/sql/closing tables 11
+user1 stage/sql/closing tables 12
user1 stage/sql/init 3
-user1 stage/sql/Opening tables 7
+user1 stage/sql/Opening tables 8
user1 stage/sql/starting 8
user2 stage/sql/checking permissions 4
-user2 stage/sql/closing tables 10
+user2 stage/sql/closing tables 11
user2 stage/sql/init 3
-user2 stage/sql/Opening tables 6
+user2 stage/sql/Opening tables 7
user2 stage/sql/starting 8
user3 stage/sql/checking permissions 4
-user3 stage/sql/closing tables 10
+user3 stage/sql/closing tables 11
user3 stage/sql/init 3
-user3 stage/sql/Opening tables 6
+user3 stage/sql/Opening tables 7
user3 stage/sql/starting 8
user4 stage/sql/checking permissions 4
-user4 stage/sql/closing tables 10
+user4 stage/sql/closing tables 11
user4 stage/sql/init 3
-user4 stage/sql/Opening tables 6
+user4 stage/sql/Opening tables 7
user4 stage/sql/starting 8
execute dump_stages_host;
host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3499,24 +3499,24 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -3624,16 +3624,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3696,24 +3696,24 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -3821,16 +3821,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3893,24 +3893,24 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -4025,9 +4025,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4090,24 +4090,24 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -4222,9 +4222,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4287,24 +4287,24 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -4419,9 +4419,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4484,24 +4484,24 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -4616,9 +4616,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4681,24 +4681,24 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -4813,9 +4813,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4878,24 +4878,24 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -5010,9 +5010,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -5075,24 +5075,24 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -5207,9 +5207,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -5272,24 +5272,24 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -5404,9 +5404,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -5475,18 +5475,18 @@ user3 localhost transaction 0
user4 localhost transaction 0
execute dump_transactions_user;
user event_name count_star
-user1 transaction 2
-user2 transaction 2
-user3 transaction 2
-user4 transaction 2
+user1 transaction 3
+user2 transaction 3
+user3 transaction 3
+user4 transaction 3
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -5601,9 +5601,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -5680,10 +5680,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -5798,9 +5798,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -5877,10 +5877,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -5995,9 +5995,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -6077,7 +6077,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -6164,9 +6164,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -6222,7 +6222,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -6277,9 +6277,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -6311,7 +6311,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -6362,9 +6362,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -6396,7 +6396,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_u.result b/mysql-test/suite/perfschema/r/event_aggregate_no_u.result
index da99aa54..69bf76ea 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_u.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_u.result
@@ -230,32 +230,32 @@ wait/synch/rwlock/sql/LOCK_grant 1
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 4
-localhost stage/sql/closing tables 11
+localhost stage/sql/closing tables 12
localhost stage/sql/init 3
-localhost stage/sql/Opening tables 7
+localhost stage/sql/Opening tables 8
localhost stage/sql/starting 7
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_statements_account;
user host event_name count_star
@@ -287,18 +287,18 @@ statement/sql/insert 1
statement/sql/select 3
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
+user1 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 2
+localhost transaction 3
execute dump_transactions_global;
event_name count_star
-transaction 2
+transaction 3
execute dump_transactions_history;
event_name count(event_name)
-transaction 2
+transaction 3
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -345,9 +345,9 @@ wait/synch/rwlock/sql/LOCK_grant 1
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 0
user2 localhost stage/sql/closing tables 0
@@ -359,23 +359,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 4
-localhost stage/sql/closing tables 11
+localhost stage/sql/closing tables 12
localhost stage/sql/init 3
-localhost stage/sql/Opening tables 7
+localhost stage/sql/Opening tables 8
localhost stage/sql/starting 7
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_statements_account;
user host event_name count_star
@@ -412,19 +412,19 @@ statement/sql/insert 1
statement/sql/select 3
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
+user1 localhost transaction 3
user2 localhost transaction 0
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 2
+localhost transaction 3
execute dump_transactions_global;
event_name count_star
-transaction 2
+transaction 3
execute dump_transactions_history;
event_name count(event_name)
-transaction 2
+transaction 3
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -484,37 +484,37 @@ wait/synch/rwlock/sql/LOCK_grant 2
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 8
-localhost stage/sql/closing tables 21
+localhost stage/sql/closing tables 23
localhost stage/sql/init 6
-localhost stage/sql/Opening tables 13
+localhost stage/sql/Opening tables 15
localhost stage/sql/starting 14
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_statements_account;
user host event_name count_star
@@ -551,19 +551,19 @@ statement/sql/insert 2
statement/sql/select 6
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 4
+localhost transaction 6
execute dump_transactions_global;
event_name count_star
-transaction 4
+transaction 6
execute dump_transactions_history;
event_name count(event_name)
-transaction 4
+transaction 6
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -614,14 +614,14 @@ wait/synch/rwlock/sql/LOCK_grant 2
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
user3 localhost stage/sql/checking permissions 0
user3 localhost stage/sql/closing tables 0
@@ -633,23 +633,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 8
-localhost stage/sql/closing tables 21
+localhost stage/sql/closing tables 23
localhost stage/sql/init 6
-localhost stage/sql/Opening tables 13
+localhost stage/sql/Opening tables 15
localhost stage/sql/starting 14
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_statements_account;
user host event_name count_star
@@ -691,20 +691,20 @@ statement/sql/insert 2
statement/sql/select 6
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
user3 localhost transaction 0
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 4
+localhost transaction 6
execute dump_transactions_global;
event_name count_star
-transaction 4
+transaction 6
execute dump_transactions_history;
event_name count(event_name)
-transaction 4
+transaction 6
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -768,42 +768,42 @@ wait/synch/rwlock/sql/LOCK_grant 3
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 31
+localhost stage/sql/closing tables 34
localhost stage/sql/init 9
-localhost stage/sql/Opening tables 19
+localhost stage/sql/Opening tables 22
localhost stage/sql/starting 21
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_statements_account;
user host event_name count_star
@@ -845,20 +845,20 @@ statement/sql/insert 3
statement/sql/select 9
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 6
+localhost transaction 9
execute dump_transactions_global;
event_name count_star
-transaction 6
+transaction 9
execute dump_transactions_history;
event_name count(event_name)
-transaction 6
+transaction 9
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -913,19 +913,19 @@ wait/synch/rwlock/sql/LOCK_grant 3
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 7
user4 localhost stage/sql/checking permissions 0
user4 localhost stage/sql/closing tables 0
@@ -937,23 +937,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 12
-localhost stage/sql/closing tables 31
+localhost stage/sql/closing tables 34
localhost stage/sql/init 9
-localhost stage/sql/Opening tables 19
+localhost stage/sql/Opening tables 22
localhost stage/sql/starting 21
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_statements_account;
user host event_name count_star
@@ -1000,21 +1000,21 @@ statement/sql/insert 3
statement/sql/select 9
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
user4 localhost transaction 0
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 6
+localhost transaction 9
execute dump_transactions_global;
event_name count_star
-transaction 6
+transaction 9
execute dump_transactions_history;
event_name count(event_name)
-transaction 6
+transaction 9
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -1082,47 +1082,47 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 7
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 28
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 28
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 28
execute dump_statements_account;
user host event_name count_star
@@ -1169,21 +1169,21 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -1238,47 +1238,47 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 7
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 29
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 29
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 29
execute dump_statements_account;
user host event_name count_star
@@ -1326,21 +1326,21 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -1394,47 +1394,47 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 7
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 30
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 30
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 30
execute dump_statements_account;
user host event_name count_star
@@ -1482,21 +1482,21 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -1549,47 +1549,47 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 31
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 31
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 31
execute dump_statements_account;
user host event_name count_star
@@ -1637,21 +1637,21 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -1703,47 +1703,47 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1791,21 +1791,21 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -1858,47 +1858,47 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1946,21 +1946,21 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2012,47 +2012,47 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2100,21 +2100,21 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2166,47 +2166,47 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2254,21 +2254,21 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2320,47 +2320,47 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2408,21 +2408,21 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2474,47 +2474,47 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2562,21 +2562,21 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2628,47 +2628,47 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2716,21 +2716,21 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2806,23 +2806,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2870,21 +2870,21 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2960,23 +2960,23 @@ user event_name count_star
execute dump_stages_host;
host event_name count_star
localhost stage/sql/checking permissions 16
-localhost stage/sql/closing tables 41
+localhost stage/sql/closing tables 45
localhost stage/sql/init 12
-localhost stage/sql/Opening tables 25
+localhost stage/sql/Opening tables 29
localhost stage/sql/starting 32
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3024,21 +3024,21 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -3121,16 +3121,16 @@ localhost stage/sql/starting 0
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3178,21 +3178,21 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -3282,9 +3282,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3332,21 +3332,21 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -3436,9 +3436,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3486,21 +3486,21 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -3590,9 +3590,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3640,21 +3640,21 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -3744,9 +3744,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3794,21 +3794,21 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -3898,9 +3898,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3948,21 +3948,21 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -4052,9 +4052,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4102,21 +4102,21 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -4206,9 +4206,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4256,21 +4256,21 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -4360,9 +4360,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4418,13 +4418,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -4514,9 +4514,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4572,13 +4572,13 @@ execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
-localhost transaction 8
+localhost transaction 12
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -4668,9 +4668,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4729,10 +4729,10 @@ host event_name count_star
localhost transaction 0
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -4822,9 +4822,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4886,7 +4886,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -4948,9 +4948,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4988,7 +4988,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -5046,9 +5046,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -5086,7 +5086,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -5144,9 +5144,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -5184,7 +5184,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result
index 064b6e45..bd3a44bd 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result
@@ -200,9 +200,9 @@ wait/synch/rwlock/sql/LOCK_grant 1
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
@@ -211,16 +211,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_statements_account;
user host event_name count_star
@@ -247,17 +247,17 @@ statement/sql/insert 1
statement/sql/select 3
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
+user1 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 2
+transaction 3
execute dump_transactions_history;
event_name count(event_name)
-transaction 2
+transaction 3
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -301,9 +301,9 @@ wait/synch/rwlock/sql/LOCK_grant 1
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 0
user2 localhost stage/sql/closing tables 0
@@ -317,16 +317,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 4
-stage/sql/closing tables 11
+stage/sql/closing tables 12
stage/sql/init 3
-stage/sql/Opening tables 7
+stage/sql/Opening tables 8
stage/sql/starting 7
execute dump_statements_account;
user host event_name count_star
@@ -358,7 +358,7 @@ statement/sql/insert 1
statement/sql/select 3
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
+user1 localhost transaction 3
user2 localhost transaction 0
execute dump_transactions_user;
user event_name count_star
@@ -366,10 +366,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 2
+transaction 3
execute dump_transactions_history;
event_name count(event_name)
-transaction 2
+transaction 3
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -426,14 +426,14 @@ wait/synch/rwlock/sql/LOCK_grant 2
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
@@ -442,16 +442,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_statements_account;
user host event_name count_star
@@ -483,18 +483,18 @@ statement/sql/insert 2
statement/sql/select 6
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 4
+transaction 6
execute dump_transactions_history;
event_name count(event_name)
-transaction 4
+transaction 6
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -542,14 +542,14 @@ wait/synch/rwlock/sql/LOCK_grant 2
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
user3 localhost stage/sql/checking permissions 0
user3 localhost stage/sql/closing tables 0
@@ -563,16 +563,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 8
-stage/sql/closing tables 21
+stage/sql/closing tables 23
stage/sql/init 6
-stage/sql/Opening tables 13
+stage/sql/Opening tables 15
stage/sql/starting 14
execute dump_statements_account;
user host event_name count_star
@@ -609,8 +609,8 @@ statement/sql/insert 2
statement/sql/select 6
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
user3 localhost transaction 0
execute dump_transactions_user;
user event_name count_star
@@ -618,10 +618,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 4
+transaction 6
execute dump_transactions_history;
event_name count(event_name)
-transaction 4
+transaction 6
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -682,19 +682,19 @@ wait/synch/rwlock/sql/LOCK_grant 3
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
@@ -703,16 +703,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_statements_account;
user host event_name count_star
@@ -749,19 +749,19 @@ statement/sql/insert 3
statement/sql/select 9
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 6
+transaction 9
execute dump_transactions_history;
event_name count(event_name)
-transaction 6
+transaction 9
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -813,19 +813,19 @@ wait/synch/rwlock/sql/LOCK_grant 3
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 7
user4 localhost stage/sql/checking permissions 0
user4 localhost stage/sql/closing tables 0
@@ -839,16 +839,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 12
-stage/sql/closing tables 31
+stage/sql/closing tables 34
stage/sql/init 9
-stage/sql/Opening tables 19
+stage/sql/Opening tables 22
stage/sql/starting 21
execute dump_statements_account;
user host event_name count_star
@@ -890,9 +890,9 @@ statement/sql/insert 3
statement/sql/select 9
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
user4 localhost transaction 0
execute dump_transactions_user;
user event_name count_star
@@ -900,10 +900,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 6
+transaction 9
execute dump_transactions_history;
event_name count(event_name)
-transaction 6
+transaction 9
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -968,24 +968,24 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 7
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 7
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
@@ -994,16 +994,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 28
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 28
execute dump_statements_account;
user host event_name count_star
@@ -1045,20 +1045,20 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -1110,24 +1110,24 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 7
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 7
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
@@ -1136,16 +1136,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 29
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 29
execute dump_statements_account;
user host event_name count_star
@@ -1188,20 +1188,20 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -1252,24 +1252,24 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 7
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
@@ -1278,16 +1278,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 30
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 30
execute dump_statements_account;
user host event_name count_star
@@ -1330,20 +1330,20 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -1393,24 +1393,24 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 7
execute dump_stages_user;
user event_name count_star
@@ -1419,16 +1419,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 31
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 31
execute dump_statements_account;
user host event_name count_star
@@ -1471,20 +1471,20 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -1533,24 +1533,24 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
@@ -1559,16 +1559,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1611,20 +1611,20 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -1674,24 +1674,24 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
@@ -1700,16 +1700,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1752,20 +1752,20 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -1814,24 +1814,24 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
@@ -1840,16 +1840,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -1892,20 +1892,20 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -1954,24 +1954,24 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
@@ -1980,16 +1980,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2032,20 +2032,20 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2094,24 +2094,24 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
@@ -2120,16 +2120,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2172,20 +2172,20 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2234,24 +2234,24 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
@@ -2260,16 +2260,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2312,20 +2312,20 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2374,24 +2374,24 @@ wait/synch/rwlock/sql/LOCK_grant 4
execute dump_stages_account;
user host event_name count_star
user1 localhost stage/sql/checking permissions 4
-user1 localhost stage/sql/closing tables 11
+user1 localhost stage/sql/closing tables 12
user1 localhost stage/sql/init 3
-user1 localhost stage/sql/Opening tables 7
+user1 localhost stage/sql/Opening tables 8
user1 localhost stage/sql/starting 8
user2 localhost stage/sql/checking permissions 4
-user2 localhost stage/sql/closing tables 10
+user2 localhost stage/sql/closing tables 11
user2 localhost stage/sql/init 3
-user2 localhost stage/sql/Opening tables 6
+user2 localhost stage/sql/Opening tables 7
user2 localhost stage/sql/starting 8
user3 localhost stage/sql/checking permissions 4
-user3 localhost stage/sql/closing tables 10
+user3 localhost stage/sql/closing tables 11
user3 localhost stage/sql/init 3
-user3 localhost stage/sql/Opening tables 6
+user3 localhost stage/sql/Opening tables 7
user3 localhost stage/sql/starting 8
user4 localhost stage/sql/checking permissions 4
-user4 localhost stage/sql/closing tables 10
+user4 localhost stage/sql/closing tables 11
user4 localhost stage/sql/init 3
-user4 localhost stage/sql/Opening tables 6
+user4 localhost stage/sql/Opening tables 7
user4 localhost stage/sql/starting 8
execute dump_stages_user;
user event_name count_star
@@ -2400,16 +2400,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2452,20 +2452,20 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2540,16 +2540,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2592,20 +2592,20 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2680,16 +2680,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2732,20 +2732,20 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2820,16 +2820,16 @@ host event_name count_star
execute dump_stages_global;
event_name count_star
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -2872,20 +2872,20 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -2967,9 +2967,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3012,20 +3012,20 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -3107,9 +3107,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3152,20 +3152,20 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -3247,9 +3247,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3292,20 +3292,20 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -3387,9 +3387,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3432,20 +3432,20 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -3527,9 +3527,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3572,20 +3572,20 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -3667,9 +3667,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3712,20 +3712,20 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -3807,9 +3807,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -3852,20 +3852,20 @@ statement/sql/insert 4
statement/sql/select 12
execute dump_transactions_account;
user host event_name count_star
-user1 localhost transaction 2
-user2 localhost transaction 2
-user3 localhost transaction 2
-user4 localhost transaction 2
+user1 localhost transaction 3
+user2 localhost transaction 3
+user3 localhost transaction 3
+user4 localhost transaction 3
execute dump_transactions_user;
user event_name count_star
execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -3947,9 +3947,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4002,10 +4002,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -4087,9 +4087,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4142,10 +4142,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -4227,9 +4227,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4282,10 +4282,10 @@ execute dump_transactions_host;
host event_name count_star
execute dump_transactions_global;
event_name count_star
-transaction 8
+transaction 12
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -4367,9 +4367,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4425,7 +4425,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -4479,9 +4479,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4513,7 +4513,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -4563,9 +4563,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4597,7 +4597,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
@@ -4647,9 +4647,9 @@ stage/sql/starting 0
execute dump_stages_history;
event_name count(event_name)
stage/sql/checking permissions 16
-stage/sql/closing tables 41
+stage/sql/closing tables 45
stage/sql/init 12
-stage/sql/Opening tables 25
+stage/sql/Opening tables 29
stage/sql/starting 32
execute dump_statements_account;
user host event_name count_star
@@ -4681,7 +4681,7 @@ event_name count_star
transaction 0
execute dump_transactions_history;
event_name count(event_name)
-transaction 8
+transaction 12
execute dump_accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root localhost 1 1
diff --git a/mysql-test/suite/perfschema/r/max_program_zero.result b/mysql-test/suite/perfschema/r/max_program_zero.result
index 0e2928bd..543cc6d3 100644
--- a/mysql-test/suite/perfschema/r/max_program_zero.result
+++ b/mysql-test/suite/perfschema/r/max_program_zero.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/ortho_iter.result b/mysql-test/suite/perfschema/r/ortho_iter.result
index 4eee0622..de47b49d 100644
--- a/mysql-test/suite/perfschema/r/ortho_iter.result
+++ b/mysql-test/suite/perfschema/r/ortho_iter.result
@@ -28,7 +28,7 @@ declare msg_detail varchar(512);
declare cmd_1 varchar(512);
declare cmd_2 varchar(512);
declare done integer default 0;
-declare debug integer default 0;
+declare dbg integer default 0;
declare pfs_cursor CURSOR FOR
select table_name from information_schema.tables
where table_schema= 'performance_schema'
@@ -106,7 +106,7 @@ set count_expected = save_count_expected - count_global_expected;
end if;
select concat("Checking table ", pfs_table_name, " ...") as status;
select concat(cmd_1, pfs_table_name, cmd_2) into @cmd;
-if debug = 1
+if dbg = 1
then
select @cmd;
end if;
@@ -218,10 +218,6 @@ close pfs_cursor;
signal sqlstate '01000' set message_text='Done', mysql_errno=12000;
end
$
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
show global variables like "performance_schema%";
Variable_name Value
performance_schema ON
diff --git a/mysql-test/suite/perfschema/r/privilege.result b/mysql-test/suite/perfschema/r/privilege.result
index 75b01842..b4dd42a6 100644
--- a/mysql-test/suite/perfschema/r/privilege.result
+++ b/mysql-test/suite/perfschema/r/privilege.result
@@ -585,7 +585,7 @@ WHERE name LIKE 'wait/synch/mutex/%'
UPDATE performance_schema.setup_consumers SET enabled = 'YES';
UPDATE performance_schema.setup_timers SET timer_name = 'TICK' WHERE name <> "wait";
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
TRUNCATE TABLE performance_schema.events_waits_history_long;
TRUNCATE TABLE performance_schema.events_waits_history;
TRUNCATE TABLE performance_schema.events_waits_current;
@@ -599,13 +599,13 @@ UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
UPDATE performance_schema.setup_consumers SET enabled = 'YES';
UPDATE performance_schema.setup_timers SET timer_name = 'MICROSECOND' where name="idle";
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
UPDATE performance_schema.setup_timers SET timer_name = 'NANOSECOND' where name="stage";
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
UPDATE performance_schema.setup_timers SET timer_name = 'NANOSECOND' where name="statement";
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
#
# WL#2284: Increase the length of a user name
#
diff --git a/mysql-test/suite/perfschema/r/query_cache.result b/mysql-test/suite/perfschema/r/query_cache.result
index a84fff60..41d7d483 100644
--- a/mysql-test/suite/perfschema/r/query_cache.result
+++ b/mysql-test/suite/perfschema/r/query_cache.result
@@ -41,7 +41,7 @@ select * from performance_schema.setup_timers where name='wait';
NAME TIMER_NAME
wait {CYCLE_OR_NANOSECOND}
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
show global status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
@@ -58,7 +58,7 @@ select * from performance_schema.setup_timers where name='wait';
NAME TIMER_NAME
wait {CYCLE_OR_NANOSECOND}
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
show global status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
diff --git a/mysql-test/suite/perfschema/r/relaylog.result b/mysql-test/suite/perfschema/r/relaylog.result
index ce3e9c04..7cc87530 100644
--- a/mysql-test/suite/perfschema/r/relaylog.result
+++ b/mysql-test/suite/perfschema/r/relaylog.result
@@ -23,6 +23,7 @@ from performance_schema.file_summary_by_instance
where file_name like "%master-%" order by file_name;
FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
master-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY
+master-bin.000001.idx wait/io/file/sql/gtid_index NONE MANY NONE MANY
master-bin.index wait/io/file/sql/binlog_index MANY MANY MANY MANY
select * from performance_schema.file_summary_by_instance
where file_name like "%slave-%" order by file_name;
@@ -112,6 +113,7 @@ where file_name like "%slave-%"
order by file_name;
FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE
slave-bin.000001 wait/io/file/sql/binlog MANY MANY MANY MANY
+slave-bin.000001.idx wait/io/file/sql/gtid_index NONE MANY NONE MANY
slave-bin.index wait/io/file/sql/binlog_index MANY MANY MANY MANY
slave-relay-bin.000001 wait/io/file/sql/relaylog MANY MANY MANY MANY
slave-relay-bin.000002 wait/io/file/sql/relaylog MANY MANY MANY MANY
diff --git a/mysql-test/suite/perfschema/r/rpl_threads.result b/mysql-test/suite/perfschema/r/rpl_threads.result
index 3e9cf22f..51b49cc8 100644
--- a/mysql-test/suite/perfschema/r/rpl_threads.result
+++ b/mysql-test/suite/perfschema/r/rpl_threads.result
@@ -16,8 +16,6 @@ connection master;
select ID from INFORMATION_SCHEMA.PROCESSLIST
where COMMAND = "Binlog Dump"
into @master_dump_pid;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select COMMAND, STATE
from INFORMATION_SCHEMA.PROCESSLIST
where ID = @master_dump_pid;
@@ -33,8 +31,6 @@ connection slave;
select ID from INFORMATION_SCHEMA.PROCESSLIST
where STATE like "Waiting for master to send event%"
into @slave_io_pid;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select COMMAND, STATE
from INFORMATION_SCHEMA.PROCESSLIST
where ID = @slave_io_pid;
@@ -47,8 +43,6 @@ NAME TYPE PROCESSLIST_COMMAND PROCESSLIST_STATE
select ID from INFORMATION_SCHEMA.PROCESSLIST
where STATE like "Slave has read all relay log%"
into @slave_sql_pid;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select COMMAND, STATE
from INFORMATION_SCHEMA.PROCESSLIST
where ID = @slave_sql_pid;
diff --git a/mysql-test/suite/perfschema/r/selects.result b/mysql-test/suite/perfschema/r/selects.result
index d623d45a..c14d1528 100644
--- a/mysql-test/suite/perfschema/r/selects.result
+++ b/mysql-test/suite/perfschema/r/selects.result
@@ -93,8 +93,6 @@ SELECT thread_id FROM performance_schema.threads
WHERE PROCESSLIST_ID = conid INTO pid;
END;
|
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL t_ps_proc(connection_id(), @p_id);
DROP FUNCTION IF EXISTS t_ps_proc;
CREATE FUNCTION t_ps_func(conid INT) RETURNS int
diff --git a/mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result b/mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result
index a70ff614..52ac4c95 100644
--- a/mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result
+++ b/mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result
@@ -8,7 +8,7 @@
#
# 0. Check, build or set prequisites
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
UPDATE performance_schema.threads
SET INSTRUMENTED='NO' WHERE PROCESSLIST_ID = CONNECTION_ID();
# 1. Basic checks
@@ -222,5 +222,5 @@ connection default;
TRUNCATE TABLE performance_schema.socket_summary_by_instance;
# 6. Cleanup
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
connection default;
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_idle.result b/mysql-test/suite/perfschema/r/start_server_disable_idle.result
index dcd8feb3..8c9650cb 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_idle.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_idle.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_stages.result b/mysql-test/suite/perfschema/r/start_server_disable_stages.result
index d2a1d3e2..0f5a34ba 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_stages.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_stages.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_statements.result b/mysql-test/suite/perfschema/r/start_server_disable_statements.result
index fc50aecd..0ab9f958 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_statements.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_statements.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_transactions.result b/mysql-test/suite/perfschema/r/start_server_disable_transactions.result
index 4cd5aad2..dcb0c1c5 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_transactions.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_transactions.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_waits.result b/mysql-test/suite/perfschema/r/start_server_disable_waits.result
index 4665083f..08155259 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_waits.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_waits.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_innodb.result b/mysql-test/suite/perfschema/r/start_server_innodb.result
index 0101b370..64cef77b 100644
--- a/mysql-test/suite/perfschema/r/start_server_innodb.result
+++ b/mysql-test/suite/perfschema/r/start_server_innodb.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_low_digest_sql_length.result b/mysql-test/suite/perfschema/r/start_server_low_digest_sql_length.result
index 482c4cd5..2ceeb714 100644
--- a/mysql-test/suite/perfschema/r/start_server_low_digest_sql_length.result
+++ b/mysql-test/suite/perfschema/r/start_server_low_digest_sql_length.result
@@ -6,7 +6,9 @@ SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
####################################
# QUERYING PS STATEMENT DIGEST
####################################
-SELECT event_name, digest, digest_text, sql_text FROM events_statements_history_long;
-event_name digest digest_text sql_text
-statement/sql/select 142569e3e23dff2a0170a603ed79020a SELECT ? + ? + SELECT ...
-statement/sql/truncate 5947880b8ba439f0ed3ff0bfbb04eebf TRUNCATE TABLE truncat...
+create table test.events_long select * from events_statements_history_long;
+SELECT event_name, test.check_digest(digest), digest_text, sql_text FROM test.events_long;
+event_name test.check_digest(digest) digest_text sql_text
+statement/sql/select 1 SELECT ? + ? + SELECT ...
+statement/sql/truncate 1 TRUNCATE TABLE truncat...
+drop table test.events_long;
diff --git a/mysql-test/suite/perfschema/r/start_server_low_index.result b/mysql-test/suite/perfschema/r/start_server_low_index.result
index a8706c47..da7bf4ad 100644
--- a/mysql-test/suite/perfschema/r/start_server_low_index.result
+++ b/mysql-test/suite/perfschema/r/start_server_low_index.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_low_table_lock.result b/mysql-test/suite/perfschema/r/start_server_low_table_lock.result
index 37db1bb6..820b30de 100644
--- a/mysql-test/suite/perfschema/r/start_server_low_table_lock.result
+++ b/mysql-test/suite/perfschema/r/start_server_low_table_lock.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_account.result b/mysql-test/suite/perfschema/r/start_server_no_account.result
index a05cb9c5..8447a803 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_account.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_account.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result
index d2e2bc9d..2407e5c4 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
index d2a84d67..bcca782e 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_class.result b/mysql-test/suite/perfschema/r/start_server_no_file_class.result
index bf0e7bfc..fce0eb19 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_file_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_file_class.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result
index b0c690ca..5cb5cb24 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_host.result b/mysql-test/suite/perfschema/r/start_server_no_host.result
index 10c882cc..f246ef96 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_host.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_host.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_index.result b/mysql-test/suite/perfschema/r/start_server_no_index.result
index 4ac8fbaf..6574a8c6 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_index.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_index.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_mdl.result b/mysql-test/suite/perfschema/r/start_server_no_mdl.result
index 25f9ea1d..1bfbc0d1 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_mdl.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_mdl.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_memory_class.result b/mysql-test/suite/perfschema/r/start_server_no_memory_class.result
index 7283733d..01c6ffe2 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_memory_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_memory_class.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
index 2904bc21..b7f6ff4b 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
index 17acca63..0ae8874c 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result b/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result
index e559d72e..8ce0396c 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_prepared_stmts_instances.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
index 3c1da2a1..b07046bd 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
index 6da9ed12..1e4e5110 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
index 20385607..bd312802 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
index ad9e2ebe..a8b2923a 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_class.result b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result
index e7b1235e..f8dc24a8 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_socket_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
index 0ca5fe86..596e8957 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result
index 75c9fb95..ae2b10fc 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result
index 160188e7..6c303b41 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
index 07b31f49..b259f902 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_statement_class.result b/mysql-test/suite/perfschema/r/start_server_no_statement_class.result
index 61609361..ea02b9f7 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_statement_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_statement_class.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result
index 1eb8e625..23ca6657 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
index 94996587..c55338fd 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
index 17d0b2c0..53d09af2 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result
index c72093c1..234813fb 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_lock.result b/mysql-test/suite/perfschema/r/start_server_no_table_lock.result
index b093b796..bc87ec4f 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_table_lock.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_table_lock.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result
index b13140ac..52a5e746 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
index a4d17b27..70353975 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result b/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result
index ffe68605..d295c15b 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_transactions_history.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result
index 78570f98..90c0ea54 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_transactions_history_long.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_user.result b/mysql-test/suite/perfschema/r/start_server_no_user.result
index 7971e8dd..1f2099c7 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_user.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_user.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result
index 0fa5c751..fc0a265a 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
index cc90ffb4..02d562a7 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_nothing.result b/mysql-test/suite/perfschema/r/start_server_nothing.result
index 985282c0..edbe7bbc 100644
--- a/mysql-test/suite/perfschema/r/start_server_nothing.result
+++ b/mysql-test/suite/perfschema/r/start_server_nothing.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
@@ -302,7 +302,7 @@ stage
statement
transaction
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
USER HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
select * from performance_schema.cond_instances;
diff --git a/mysql-test/suite/perfschema/r/start_server_off.result b/mysql-test/suite/perfschema/r/start_server_off.result
index b409d7ff..40740510 100644
--- a/mysql-test/suite/perfschema/r/start_server_off.result
+++ b/mysql-test/suite/perfschema/r/start_server_off.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
0
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
@@ -198,7 +198,7 @@ OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
select * from performance_schema.setup_timers;
NAME TIMER_NAME
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
insert into performance_schema.setup_objects values ('TABLE', 'myschema', 'myobject', 'YES', 'YES');
ERROR HY000: Invalid performance_schema usage
insert into performance_schema.setup_actors values ('myhost', 'mysuser', 'myrole', 'YES', 'YES');
diff --git a/mysql-test/suite/perfschema/r/start_server_on.result b/mysql-test/suite/perfschema/r/start_server_on.result
index 0101b370..64cef77b 100644
--- a/mysql-test/suite/perfschema/r/start_server_on.result
+++ b/mysql-test/suite/perfschema/r/start_server_on.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/start_server_variables.result b/mysql-test/suite/perfschema/r/start_server_variables.result
index 2adfc99b..e1c7b23a 100644
--- a/mysql-test/suite/perfschema/r/start_server_variables.result
+++ b/mysql-test/suite/perfschema/r/start_server_variables.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/statement_program_lost_inst.result b/mysql-test/suite/perfschema/r/statement_program_lost_inst.result
index 44ab0998..41ac7419 100644
--- a/mysql-test/suite/perfschema/r/statement_program_lost_inst.result
+++ b/mysql-test/suite/perfschema/r/statement_program_lost_inst.result
@@ -19,7 +19,7 @@ select count(*) from performance_schema.setup_timers;
count(*)
5
Warnings:
-Warning 1681 'performance_schema.setup_timers' is deprecated and will be removed in a future release
+Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
select * from performance_schema.accounts;
select * from performance_schema.cond_instances;
select * from performance_schema.events_stages_current;
diff --git a/mysql-test/suite/perfschema/r/table_schema.result b/mysql-test/suite/perfschema/r/table_schema.result
index 50334091..96d2dfbe 100644
--- a/mysql-test/suite/perfschema/r/table_schema.result
+++ b/mysql-test/suite/perfschema/r/table_schema.result
@@ -1,1180 +1,1180 @@
select * from information_schema.columns where table_schema="performance_schema"
order by table_name, ordinal_position;
-TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION
-def performance_schema accounts USER 1 NULL YES char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references The connection's client user name for the connection, or NULL if an internal thread. NEVER NULL
-def performance_schema accounts HOST 2 NULL YES char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) select,insert,update,references The connection client's host name, or NULL if an internal thread. NEVER NULL
-def performance_schema accounts CURRENT_CONNECTIONS 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Current connections for the account. NEVER NULL
-def performance_schema accounts TOTAL_CONNECTIONS 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Total connections for the account. NEVER NULL
-def performance_schema cond_instances NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Client user name for the connection, or NULL if an internal thread. NEVER NULL
-def performance_schema cond_instances OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the instrumented condition. NEVER NULL
-def performance_schema events_stages_current THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL
-def performance_schema events_stages_current EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL
-def performance_schema events_stages_current END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL
-def performance_schema events_stages_current EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL
-def performance_schema events_stages_current SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL
-def performance_schema events_stages_current TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL
-def performance_schema events_stages_current TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL
-def performance_schema events_stages_current TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL
-def performance_schema events_stages_current WORK_COMPLETED 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units completed for the stage. NULL if the stage event progress is not instrumented. NEVER NULL
-def performance_schema events_stages_current WORK_ESTIMATED 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units expected for the stage. NULL if the stage event progress is not instrumented. NEVER NULL
-def performance_schema events_stages_current NESTING_EVENT_ID 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references EVENT_ID of event within which this event nests. NEVER NULL
-def performance_schema events_stages_current NESTING_EVENT_TYPE 12 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references Nesting event type. Either transaction, statement, stage or wait. NEVER NULL
-def performance_schema events_stages_history THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL
-def performance_schema events_stages_history EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL
-def performance_schema events_stages_history END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL
-def performance_schema events_stages_history EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL
-def performance_schema events_stages_history SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL
-def performance_schema events_stages_history TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL
-def performance_schema events_stages_history TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL
-def performance_schema events_stages_history TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL
-def performance_schema events_stages_history WORK_COMPLETED 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units completed for the stage. NULL if the stage event progress is not instrumented. NEVER NULL
-def performance_schema events_stages_history WORK_ESTIMATED 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units expected for the stage. NULL if the stage event progress is not instrumented. NEVER NULL
-def performance_schema events_stages_history NESTING_EVENT_ID 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references EVENT_ID of event within which this event nests. NEVER NULL
-def performance_schema events_stages_history NESTING_EVENT_TYPE 12 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references Nesting event type. Either transaction, statement, stage or wait. NEVER NULL
-def performance_schema events_stages_history_long THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL
-def performance_schema events_stages_history_long EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL
-def performance_schema events_stages_history_long END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL
-def performance_schema events_stages_history_long EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL
-def performance_schema events_stages_history_long SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL
-def performance_schema events_stages_history_long TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL
-def performance_schema events_stages_history_long TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL
-def performance_schema events_stages_history_long TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL
-def performance_schema events_stages_history_long WORK_COMPLETED 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units completed for the stage. NULL if the stage event progress is not instrumented. NEVER NULL
-def performance_schema events_stages_history_long WORK_ESTIMATED 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units expected for the stage. NULL if the stage event progress is not instrumented. NEVER NULL
-def performance_schema events_stages_history_long NESTING_EVENT_ID 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references EVENT_ID of event within which this event nests. NEVER NULL
-def performance_schema events_stages_history_long NESTING_EVENT_TYPE 12 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references Nesting event type. Either transaction, statement, stage or wait. NEVER NULL
-def performance_schema events_stages_summary_by_account_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references User. Used together with HOST and EVENT_NAME for grouping events. NEVER NULL
-def performance_schema events_stages_summary_by_account_by_event_name HOST 2 NULL YES char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) select,insert,update,references Host. Used together with USER and EVENT_NAME for grouping events. NEVER NULL
-def performance_schema events_stages_summary_by_account_by_event_name EVENT_NAME 3 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with USER and HOST for grouping events. NEVER NULL
-def performance_schema events_stages_summary_by_account_by_event_name COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events, which includes all timed and untimed events. NEVER NULL
-def performance_schema events_stages_summary_by_account_by_event_name SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the timed summarized events. NEVER NULL
-def performance_schema events_stages_summary_by_account_by_event_name MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the timed summarized events. NEVER NULL
-def performance_schema events_stages_summary_by_account_by_event_name AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the timed summarized events. NEVER NULL
-def performance_schema events_stages_summary_by_account_by_event_name MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the timed summarized events. NEVER NULL
-def performance_schema events_stages_summary_by_host_by_event_name HOST 1 NULL YES char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) select,insert,update,references Host. Used together with EVENT_NAME for grouping events. NEVER NULL
-def performance_schema events_stages_summary_by_host_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with HOST for grouping events. NEVER NULL
-def performance_schema events_stages_summary_by_host_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events, which includes all timed and untimed events. NEVER NULL
-def performance_schema events_stages_summary_by_host_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the timed summarized events. NEVER NULL
-def performance_schema events_stages_summary_by_host_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the timed summarized events. NEVER NULL
-def performance_schema events_stages_summary_by_host_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the timed summarized events. NEVER NULL
-def performance_schema events_stages_summary_by_host_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the timed summarized events. NEVER NULL
-def performance_schema events_stages_summary_by_thread_by_event_name THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_NAME uniquely identifies the row. NEVER NULL
-def performance_schema events_stages_summary_by_thread_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with THREAD_ID for grouping events. NEVER NULL
-def performance_schema events_stages_summary_by_thread_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events, which includes all timed and untimed events. NEVER NULL
-def performance_schema events_stages_summary_by_thread_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the timed summarized events. NEVER NULL
-def performance_schema events_stages_summary_by_thread_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the timed summarized events. NEVER NULL
-def performance_schema events_stages_summary_by_thread_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the timed summarized events. NEVER NULL
-def performance_schema events_stages_summary_by_thread_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the timed summarized events. NEVER NULL
-def performance_schema events_stages_summary_by_user_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references User. Used together with EVENT_NAME for grouping events. NEVER NULL
-def performance_schema events_stages_summary_by_user_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with USER for grouping events. NEVER NULL
-def performance_schema events_stages_summary_by_user_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events, which includes all timed and untimed events. NEVER NULL
-def performance_schema events_stages_summary_by_user_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the timed summarized events. NEVER NULL
-def performance_schema events_stages_summary_by_user_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the timed summarized events. NEVER NULL
-def performance_schema events_stages_summary_by_user_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the timed summarized events. NEVER NULL
-def performance_schema events_stages_summary_by_user_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the timed summarized events. NEVER NULL
-def performance_schema events_stages_summary_global_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL
-def performance_schema events_stages_summary_global_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events, which includes all timed and untimed events. NEVER NULL
-def performance_schema events_stages_summary_global_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the timed summarized events. NEVER NULL
-def performance_schema events_stages_summary_global_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the timed summarized events. NEVER NULL
-def performance_schema events_stages_summary_global_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the timed summarized events. NEVER NULL
-def performance_schema events_stages_summary_global_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the timed summarized events. NEVER NULL
-def performance_schema events_statements_current THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL
-def performance_schema events_statements_current EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL
-def performance_schema events_statements_current END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL
-def performance_schema events_statements_current EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL
-def performance_schema events_statements_current SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL
-def performance_schema events_statements_current TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL
-def performance_schema events_statements_current TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL
-def performance_schema events_statements_current TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL
-def performance_schema events_statements_current LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Time in picoseconds spent waiting for locks. The time is calculated in microseconds but stored in picoseconds for compatibility with other timings. NEVER NULL
-def performance_schema events_statements_current SQL_TEXT 10 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references The SQL statement, or NULL if the command is not associated with an SQL statement. NEVER NULL
-def performance_schema events_statements_current DIGEST 11 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select,insert,update,references Statement digest. NEVER NULL
-def performance_schema events_statements_current DIGEST_TEXT 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references Statement digest text. NEVER NULL
-def performance_schema events_statements_current CURRENT_SCHEMA 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Statement's default database for the statement, or NULL if there was none. NEVER NULL
-def performance_schema events_statements_current OBJECT_TYPE 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NULL for top level statements. The parent statement object type for nested statements (stored programs). NEVER NULL
-def performance_schema events_statements_current OBJECT_SCHEMA 15 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NULL for top level statements. The parent statement object schema for nested statements (stored programs). NEVER NULL
-def performance_schema events_statements_current OBJECT_NAME 16 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NULL for top level statements. The parent statement object name for nested statements (stored programs). NEVER NULL
-def performance_schema events_statements_current OBJECT_INSTANCE_BEGIN 17 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the statement object. NEVER NULL
-def performance_schema events_statements_current MYSQL_ERRNO 18 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Error code. See MariaDB Error Codes for a full list. NEVER NULL
-def performance_schema events_statements_current RETURNED_SQLSTATE 19 NULL YES varchar 5 15 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(5) select,insert,update,references The SQLSTATE value. NEVER NULL
-def performance_schema events_statements_current MESSAGE_TEXT 20 NULL YES varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Statement error message. See MariaDB Error Codes. NEVER NULL
-def performance_schema events_statements_current ERRORS 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if SQLSTATE signifies completion (starting with 00) or warning (01), otherwise 1. NEVER NULL
-def performance_schema events_statements_current WARNINGS 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of warnings from the diagnostics area. NEVER NULL
-def performance_schema events_statements_current ROWS_AFFECTED 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows affected the statement affected. NEVER NULL
-def performance_schema events_statements_current ROWS_SENT 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows returned. NEVER NULL
-def performance_schema events_statements_current ROWS_EXAMINED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows read during the statement's execution. NEVER NULL
-def performance_schema events_statements_current CREATED_TMP_DISK_TABLES 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of on-disk temp tables created by the statement. NEVER NULL
-def performance_schema events_statements_current CREATED_TMP_TABLES 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of temp tables created by the statement. NEVER NULL
-def performance_schema events_statements_current SELECT_FULL_JOIN 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which did not use an index. NEVER NULL
-def performance_schema events_statements_current SELECT_FULL_RANGE_JOIN 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a range search of the first table. NEVER NULL
-def performance_schema events_statements_current SELECT_RANGE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a range of the first table. NEVER NULL
-def performance_schema events_statements_current SELECT_RANGE_CHECK 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins without keys performed by the statement that check for key usage after each row. NEVER NULL
-def performance_schema events_statements_current SELECT_SCAN 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a full scan of the first table. NEVER NULL
-def performance_schema events_statements_current SORT_MERGE_PASSES 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of merge passes by the sort algorithm performed by the statement. If too high, you may need to increase the sort_buffer_size. NEVER NULL
-def performance_schema events_statements_current SORT_RANGE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of sorts performed by the statement which used a range. NEVER NULL
-def performance_schema events_statements_current SORT_ROWS 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows sorted by the statement. NEVER NULL
-def performance_schema events_statements_current SORT_SCAN 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of sorts performed by the statement which used a full table scan. NEVER NULL
-def performance_schema events_statements_current NO_INDEX_USED 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if the statement performed a table scan with an index, 1 if without an index. NEVER NULL
-def performance_schema events_statements_current NO_GOOD_INDEX_USED 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if a good index was found for the statement, 1 if no good index was found. See the Range checked for each record description in the EXPLAIN article. NEVER NULL
-def performance_schema events_statements_current NESTING_EVENT_ID 39 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL for top level statements. The parent statement event id for nested statements (stored programs). NEVER NULL
-def performance_schema events_statements_current NESTING_EVENT_TYPE 40 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references NULL for top level statements. The parent statement event type for nested statements (stored programs). NEVER NULL
-def performance_schema events_statements_current NESTING_EVENT_LEVEL 41 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references 0 for top level statements. The parent statement level plus 1 for nested statements (stored programs). NEVER NULL
-def performance_schema events_statements_history THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL
-def performance_schema events_statements_history EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL
-def performance_schema events_statements_history END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL
-def performance_schema events_statements_history EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL
-def performance_schema events_statements_history SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL
-def performance_schema events_statements_history TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL
-def performance_schema events_statements_history TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL
-def performance_schema events_statements_history TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL
-def performance_schema events_statements_history LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Time in picoseconds spent waiting for locks. The time is calculated in microseconds but stored in picoseconds for compatibility with other timings. NEVER NULL
-def performance_schema events_statements_history SQL_TEXT 10 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references The SQL statement, or NULL if the command is not associated with an SQL statement. NEVER NULL
-def performance_schema events_statements_history DIGEST 11 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select,insert,update,references Statement digest. NEVER NULL
-def performance_schema events_statements_history DIGEST_TEXT 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references Statement digest text. NEVER NULL
-def performance_schema events_statements_history CURRENT_SCHEMA 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Statement's default database for the statement, or NULL if there was none. NEVER NULL
-def performance_schema events_statements_history OBJECT_TYPE 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NULL for top level statements. The parent statement object type for nested statements (stored programs). NEVER NULL
-def performance_schema events_statements_history OBJECT_SCHEMA 15 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NULL for top level statements. The parent statement object schema for nested statements (stored programs). NEVER NULL
-def performance_schema events_statements_history OBJECT_NAME 16 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NULL for top level statements. The parent statement object name for nested statements (stored programs). NEVER NULL
-def performance_schema events_statements_history OBJECT_INSTANCE_BEGIN 17 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the statement object. NEVER NULL
-def performance_schema events_statements_history MYSQL_ERRNO 18 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Error code. See MariaDB Error Codes for a full list. NEVER NULL
-def performance_schema events_statements_history RETURNED_SQLSTATE 19 NULL YES varchar 5 15 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(5) select,insert,update,references The SQLSTATE value. NEVER NULL
-def performance_schema events_statements_history MESSAGE_TEXT 20 NULL YES varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Statement error message. See MariaDB Error Codes. NEVER NULL
-def performance_schema events_statements_history ERRORS 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if SQLSTATE signifies completion (starting with 00) or warning (01), otherwise 1. NEVER NULL
-def performance_schema events_statements_history WARNINGS 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of warnings from the diagnostics area. NEVER NULL
-def performance_schema events_statements_history ROWS_AFFECTED 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows affected the statement affected. NEVER NULL
-def performance_schema events_statements_history ROWS_SENT 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows returned. NEVER NULL
-def performance_schema events_statements_history ROWS_EXAMINED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows read during the statement's execution. NEVER NULL
-def performance_schema events_statements_history CREATED_TMP_DISK_TABLES 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of on-disk temp tables created by the statement. NEVER NULL
-def performance_schema events_statements_history CREATED_TMP_TABLES 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of temp tables created by the statement. NEVER NULL
-def performance_schema events_statements_history SELECT_FULL_JOIN 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which did not use an index. NEVER NULL
-def performance_schema events_statements_history SELECT_FULL_RANGE_JOIN 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a range search of the first table. NEVER NULL
-def performance_schema events_statements_history SELECT_RANGE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a range of the first table. NEVER NULL
-def performance_schema events_statements_history SELECT_RANGE_CHECK 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins without keys performed by the statement that check for key usage after each row. NEVER NULL
-def performance_schema events_statements_history SELECT_SCAN 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a full scan of the first table. NEVER NULL
-def performance_schema events_statements_history SORT_MERGE_PASSES 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of merge passes by the sort algorithm performed by the statement. If too high, you may need to increase the sort_buffer_size. NEVER NULL
-def performance_schema events_statements_history SORT_RANGE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of sorts performed by the statement which used a range. NEVER NULL
-def performance_schema events_statements_history SORT_ROWS 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows sorted by the statement. NEVER NULL
-def performance_schema events_statements_history SORT_SCAN 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of sorts performed by the statement which used a full table scan. NEVER NULL
-def performance_schema events_statements_history NO_INDEX_USED 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if the statement performed a table scan with an index, 1 if without an index. NEVER NULL
-def performance_schema events_statements_history NO_GOOD_INDEX_USED 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if a good index was found for the statement, 1 if no good index was found. See the Range checked for each record description in the EXPLAIN article. NEVER NULL
-def performance_schema events_statements_history NESTING_EVENT_ID 39 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL for top level statements. The parent statement event id for nested statements (stored programs). NEVER NULL
-def performance_schema events_statements_history NESTING_EVENT_TYPE 40 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references NULL for top level statements. The parent statement event type for nested statements (stored programs). NEVER NULL
-def performance_schema events_statements_history NESTING_EVENT_LEVEL 41 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references 0 for top level statements. The parent statement level plus 1 for nested statements (stored programs). NEVER NULL
-def performance_schema events_statements_history_long THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL
-def performance_schema events_statements_history_long EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL
-def performance_schema events_statements_history_long END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL
-def performance_schema events_statements_history_long EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL
-def performance_schema events_statements_history_long SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL
-def performance_schema events_statements_history_long TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL
-def performance_schema events_statements_history_long TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL
-def performance_schema events_statements_history_long TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL
-def performance_schema events_statements_history_long LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Time in picoseconds spent waiting for locks. The time is calculated in microseconds but stored in picoseconds for compatibility with other timings. NEVER NULL
-def performance_schema events_statements_history_long SQL_TEXT 10 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references The SQL statement, or NULL if the command is not associated with an SQL statement. NEVER NULL
-def performance_schema events_statements_history_long DIGEST 11 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select,insert,update,references Statement digest. NEVER NULL
-def performance_schema events_statements_history_long DIGEST_TEXT 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references Statement digest text. NEVER NULL
-def performance_schema events_statements_history_long CURRENT_SCHEMA 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Statement's default database for the statement, or NULL if there was none. NEVER NULL
-def performance_schema events_statements_history_long OBJECT_TYPE 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NULL for top level statements. The parent statement object type for nested statements (stored programs). NEVER NULL
-def performance_schema events_statements_history_long OBJECT_SCHEMA 15 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NULL for top level statements. The parent statement object schema for nested statements (stored programs). NEVER NULL
-def performance_schema events_statements_history_long OBJECT_NAME 16 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NULL for top level statements. The parent statement object name for nested statements (stored programs). NEVER NULL
-def performance_schema events_statements_history_long OBJECT_INSTANCE_BEGIN 17 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the statement object. NEVER NULL
-def performance_schema events_statements_history_long MYSQL_ERRNO 18 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Error code. See MariaDB Error Codes for a full list. NEVER NULL
-def performance_schema events_statements_history_long RETURNED_SQLSTATE 19 NULL YES varchar 5 15 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(5) select,insert,update,references The SQLSTATE value. NEVER NULL
-def performance_schema events_statements_history_long MESSAGE_TEXT 20 NULL YES varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Statement error message. See MariaDB Error Codes. NEVER NULL
-def performance_schema events_statements_history_long ERRORS 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if SQLSTATE signifies completion (starting with 00) or warning (01), otherwise 1. NEVER NULL
-def performance_schema events_statements_history_long WARNINGS 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of warnings from the diagnostics area. NEVER NULL
-def performance_schema events_statements_history_long ROWS_AFFECTED 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows affected the statement affected. NEVER NULL
-def performance_schema events_statements_history_long ROWS_SENT 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows returned. NEVER NULL
-def performance_schema events_statements_history_long ROWS_EXAMINED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows read during the statement's execution. NEVER NULL
-def performance_schema events_statements_history_long CREATED_TMP_DISK_TABLES 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of on-disk temp tables created by the statement. NEVER NULL
-def performance_schema events_statements_history_long CREATED_TMP_TABLES 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of temp tables created by the statement. NEVER NULL
-def performance_schema events_statements_history_long SELECT_FULL_JOIN 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which did not use an index. NEVER NULL
-def performance_schema events_statements_history_long SELECT_FULL_RANGE_JOIN 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a range search of the first table. NEVER NULL
-def performance_schema events_statements_history_long SELECT_RANGE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a range of the first table. NEVER NULL
-def performance_schema events_statements_history_long SELECT_RANGE_CHECK 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins without keys performed by the statement that check for key usage after each row. NEVER NULL
-def performance_schema events_statements_history_long SELECT_SCAN 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a full scan of the first table. NEVER NULL
-def performance_schema events_statements_history_long SORT_MERGE_PASSES 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of merge passes by the sort algorithm performed by the statement. If too high, you may need to increase the sort_buffer_size. NEVER NULL
-def performance_schema events_statements_history_long SORT_RANGE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of sorts performed by the statement which used a range. NEVER NULL
-def performance_schema events_statements_history_long SORT_ROWS 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows sorted by the statement. NEVER NULL
-def performance_schema events_statements_history_long SORT_SCAN 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of sorts performed by the statement which used a full table scan. NEVER NULL
-def performance_schema events_statements_history_long NO_INDEX_USED 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if the statement performed a table scan with an index, 1 if without an index. NEVER NULL
-def performance_schema events_statements_history_long NO_GOOD_INDEX_USED 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if a good index was found for the statement, 1 if no good index was found. See the Range checked for each record description in the EXPLAIN article. NEVER NULL
-def performance_schema events_statements_history_long NESTING_EVENT_ID 39 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL for top level statements. The parent statement event id for nested statements (stored programs). NEVER NULL
-def performance_schema events_statements_history_long NESTING_EVENT_TYPE 40 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references NULL for top level statements. The parent statement event type for nested statements (stored programs). NEVER NULL
-def performance_schema events_statements_history_long NESTING_EVENT_LEVEL 41 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references 0 for top level statements. The parent statement level plus 1 for nested statements (stored programs). NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references User. Used together with HOST and EVENT_NAME for grouping events. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name HOST 2 NULL YES char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) select,insert,update,references Host. Used together with USER and EVENT_NAME for grouping events. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name EVENT_NAME 3 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with USER and HOST for grouping events. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the LOCK_TIME column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_ERRORS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ERRORS column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_WARNINGS 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the WARNINGS column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_ROWS_AFFECTED 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_AFFECTED column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_ROWS_SENT 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_SENT column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_ROWS_EXAMINED 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_EXAMINED column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_CREATED_TMP_DISK_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_CREATED_TMP_TABLES 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_TABLES column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_FULL_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_JOIN column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_FULL_RANGE_JOIN 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_RANGE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_RANGE_CHECK 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE_CHECK column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_SCAN 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_SCAN column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_SORT_MERGE_PASSES 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_MERGE_PASSES column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_SORT_RANGE 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_RANGE column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_SORT_ROWS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_ROWS column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_SORT_SCAN 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_SCAN column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_NO_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_INDEX_USED column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_account_by_event_name SUM_NO_GOOD_INDEX_USED 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_digest SCHEMA_NAME 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Database name. Records are summarised together with DIGEST. NEVER NULL
-def performance_schema events_statements_summary_by_digest DIGEST 2 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select,insert,update,references Performance Schema digest. Records are summarised together with SCHEMA NAME. NEVER NULL
-def performance_schema events_statements_summary_by_digest DIGEST_TEXT 3 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references The unhashed form of the digest. NEVER NULL
-def performance_schema events_statements_summary_by_digest COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_by_digest MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_by_digest AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_by_digest MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the LOCK_TIME column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_ERRORS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ERRORS column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_WARNINGS 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the WARNINGS column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_ROWS_AFFECTED 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_AFFECTED column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_ROWS_SENT 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_SENT column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_ROWS_EXAMINED 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_EXAMINED column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_CREATED_TMP_DISK_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_CREATED_TMP_TABLES 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_TABLES column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_SELECT_FULL_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_JOIN column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_SELECT_FULL_RANGE_JOIN 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_SELECT_RANGE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_SELECT_RANGE_CHECK 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE_CHECK column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_SELECT_SCAN 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_SCAN column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_SORT_MERGE_PASSES 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_MERGE_PASSES column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_SORT_RANGE 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_RANGE column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_SORT_ROWS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_ROWS column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_SORT_SCAN 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_SCAN column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_NO_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_INDEX_USED column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_digest SUM_NO_GOOD_INDEX_USED 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_digest FIRST_SEEN 28 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references Time at which the digest was first seen. NEVER NULL
-def performance_schema events_statements_summary_by_digest LAST_SEEN 29 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references Time at which the digest was most recently seen. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name HOST 1 NULL YES char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) select,insert,update,references Host. Used together with EVENT_NAME for grouping events. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with HOST for grouping events. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_LOCK_TIME 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the LOCK_TIME column in the events_statements_currentd table. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_ERRORS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ERRORS column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_WARNINGS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the WARNINGS column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_ROWS_AFFECTED 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_AFFECTED column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_ROWS_SENT 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_SENT column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_ROWS_EXAMINED 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_EXAMINED column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_CREATED_TMP_DISK_TABLES 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_CREATED_TMP_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_TABLES column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_FULL_JOIN 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_JOIN column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_FULL_RANGE_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_RANGE_JOINW column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_RANGE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_RANGE_CHECK 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE_CHECK column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_SCAN 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_SCAN column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_SORT_MERGE_PASSES 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_MERGE_PASSES column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_SORT_RANGE 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_RANGE column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_SORT_ROWS 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_ROWS column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_SORT_SCAN 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_SCAN column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_NO_INDEX_USED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_INDEX_USED column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_host_by_event_name SUM_NO_GOOD_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_program OBJECT_TYPE 1 NULL YES enum 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('EVENT','FUNCTION','PROCEDURE','TABLE','TRIGGER') select,insert,update,references Object type for which the summary is generated. NEVER NULL
-def performance_schema events_statements_summary_by_program OBJECT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The schema of the object for which the summary is generated. NEVER NULL
-def performance_schema events_statements_summary_by_program OBJECT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The name of the object for which the summary is generated. NEVER NULL
-def performance_schema events_statements_summary_by_program COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of summarized events (from events_statements_current). This value includes all events, whether timed or nontimed. NEVER NULL
-def performance_schema events_statements_summary_by_program SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of the summarized timed events. This value is calculated only for timed events because nontimed events have a wait time of NULL. The same is true for the other xxx_TIMER_WAIT values. NEVER NULL
-def performance_schema events_statements_summary_by_program MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of the summarized timed events. NEVER NULL
-def performance_schema events_statements_summary_by_program AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of the summarized timed events. NEVER NULL
-def performance_schema events_statements_summary_by_program MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of the summarized timed events. NEVER NULL
-def performance_schema events_statements_summary_by_program COUNT_STATEMENTS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of nested statements invoked during stored program execution. NEVER NULL
-def performance_schema events_statements_summary_by_program SUM_STATEMENTS_WAIT 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of the summarized timed statements. This value is calculated only for timed statements because nontimed statements have a wait time of NULL. The same is true for the other xxx_STATEMENT_WAIT values. NEVER NULL
-def performance_schema events_statements_summary_by_program MIN_STATEMENTS_WAIT 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of the summarized timed statements. NEVER NULL
-def performance_schema events_statements_summary_by_program AVG_STATEMENTS_WAIT 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of the summarized timed statements. NEVER NULL
-def performance_schema events_statements_summary_by_program MAX_STATEMENTS_WAIT 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of the summarized timed statements. NEVER NULL
-def performance_schema events_statements_summary_by_program SUM_LOCK_TIME 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total time spent (in picoseconds) waiting for table locks for the summarized statements. NEVER NULL
-def performance_schema events_statements_summary_by_program SUM_ERRORS 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of errors that occurend for the summarized statements. NEVER NULL
-def performance_schema events_statements_summary_by_program SUM_WARNINGS 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of warnings that occurend for the summarized statements. NEVER NULL
-def performance_schema events_statements_summary_by_program SUM_ROWS_AFFECTED 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of affected rows by the summarized statements. NEVER NULL
-def performance_schema events_statements_summary_by_program SUM_ROWS_SENT 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of rows returned by the summarized statements. NEVER NULL
-def performance_schema events_statements_summary_by_program SUM_ROWS_EXAMINED 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of rows examined by the summarized statements. NEVER NULL
-def performance_schema events_statements_summary_by_program SUM_CREATED_TMP_DISK_TABLES 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of on-disk temporary tables created by the summarized statements. NEVER NULL
-def performance_schema events_statements_summary_by_program SUM_CREATED_TMP_TABLES 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of in-memory temporary tables created by the summarized statements. NEVER NULL
-def performance_schema events_statements_summary_by_program SUM_SELECT_FULL_JOIN 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of full joins executed by the summarized statements. NEVER NULL
-def performance_schema events_statements_summary_by_program SUM_SELECT_FULL_RANGE_JOIN 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of range search joins executed by the summarized statements. NEVER NULL
-def performance_schema events_statements_summary_by_program SUM_SELECT_RANGE 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of joins that used ranges on the first table executed by the summarized statements. NEVER NULL
-def performance_schema events_statements_summary_by_program SUM_SELECT_RANGE_CHECK 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of joins that check for key usage after each row executed by the summarized statements. NEVER NULL
-def performance_schema events_statements_summary_by_program SUM_SELECT_SCAN 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of joins that did a full scan of the first table executed by the summarized statements. NEVER NULL
-def performance_schema events_statements_summary_by_program SUM_SORT_MERGE_PASSES 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of merge passes that the sort algorithm has had to do for the summarized statements. NEVER NULL
-def performance_schema events_statements_summary_by_program SUM_SORT_RANGE 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of sorts that were done using ranges for the summarized statements. NEVER NULL
-def performance_schema events_statements_summary_by_program SUM_SORT_ROWS 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of sorted rows that were sorted by the summarized statements. NEVER NULL
-def performance_schema events_statements_summary_by_program SUM_SORT_SCAN 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of sorts that were done by scanning the table by the summarized statements. NEVER NULL
-def performance_schema events_statements_summary_by_program SUM_NO_INDEX_USED 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of statements that performed a table scan without using an index. NEVER NULL
-def performance_schema events_statements_summary_by_program SUM_NO_GOOD_INDEX_USED 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of statements where no good index was found. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_NAME uniquely identifies the row. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with THREAD_ID for grouping events. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_LOCK_TIME 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the LOCK_TIME column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_ERRORS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ERRORS column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_WARNINGS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the WARNINGS column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_ROWS_AFFECTED 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_AFFECTED column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_ROWS_SENT 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_SENT column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_ROWS_EXAMINED 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_EXAMINED column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_CREATED_TMP_DISK_TABLES 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_CREATED_TMP_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_TABLES column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_FULL_JOIN 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_JOIN column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_FULL_RANGE_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_RANGE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_RANGE_CHECK 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE_CHECK column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_SCAN 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_SCAN column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_SORT_MERGE_PASSES 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_MERGE_PASSES column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_SORT_RANGE 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_RANGE column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_SORT_ROWS 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_ROWS column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_SORT_SCAN 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_SCAN column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_NO_INDEX_USED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_INDEX_USED column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_thread_by_event_name SUM_NO_GOOD_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references User. Used together with EVENT_NAME for grouping events. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with USER for grouping events. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_LOCK_TIME 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the LOCK_TIME column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_ERRORS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ERRORS column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_WARNINGS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the WARNINGS column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_ROWS_AFFECTED 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_AFFECTED column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_ROWS_SENT 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_SENT column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_ROWS_EXAMINED 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_EXAMINED column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_CREATED_TMP_DISK_TABLES 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_CREATED_TMP_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_TABLES column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_FULL_JOIN 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_JOIN column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_FULL_RANGE_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_RANGE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_RANGE_CHECK 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE_CHECK column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_SCAN 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_SCAN column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_SORT_MERGE_PASSES 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_MERGE_PASSES column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_SORT_RANGE 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_RANGE column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_SORT_ROWS 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_ROWS column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_SORT_SCAN 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_SCAN column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_NO_INDEX_USED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_INDEX_USED column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_by_user_by_event_name SUM_NO_GOOD_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_LOCK_TIME 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the LOCK_TIME column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_ERRORS 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ERRORS column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_WARNINGS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the WARNINGS column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_ROWS_AFFECTED 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_AFFECTED column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_ROWS_SENT 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_SENT column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_ROWS_EXAMINED 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_EXAMINED column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_CREATED_TMP_DISK_TABLES 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_CREATED_TMP_TABLES 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_TABLES column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_FULL_JOIN 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_JOIN column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_FULL_RANGE_JOIN 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_RANGE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_RANGE_CHECK 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE_CHECK column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_SCAN 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_SCAN column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_SORT_MERGE_PASSES 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_MERGE_PASSES column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_SORT_RANGE 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_RANGE column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_SORT_ROWS 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_ROWS column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_SORT_SCAN 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_SCAN column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_NO_INDEX_USED 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_INDEX_USED column in the events_statements_current table. NEVER NULL
-def performance_schema events_statements_summary_global_by_event_name SUM_NO_GOOD_INDEX_USED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table. NEVER NULL
-def performance_schema events_transactions_current THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The thread associated with the event. NEVER NULL
-def performance_schema events_transactions_current EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The event id associated with the event. NEVER NULL
-def performance_schema events_transactions_current END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references This column is set to NULL when the event starts and updated to the thread current event number when the event ends. NEVER NULL
-def performance_schema events_transactions_current EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references The name of the instrument from which the event was collected. This is a NAME value from the setup_instruments table. NEVER NULL
-def performance_schema events_transactions_current STATE 5 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('ACTIVE','COMMITTED','ROLLED BACK') select,insert,update,references The current transaction state. The value is ACTIVE (after START TRANSACTION or BEGIN), COMMITTED (after COMMIT), or ROLLED BACK (after ROLLBACK). NEVER NULL
-def performance_schema events_transactions_current TRX_ID 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Unused. NEVER NULL
-def performance_schema events_transactions_current GTID 7 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Transaction GTID, using the format DOMAIN-SERVER_ID-SEQUENCE_NO. NEVER NULL
-def performance_schema events_transactions_current XID_FORMAT_ID 8 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references XA transaction format ID for GTRID and BQUAL values. NEVER NULL
-def performance_schema events_transactions_current XID_GTRID 9 NULL YES varchar 130 390 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(130) select,insert,update,references XA global transaction ID. NEVER NULL
-def performance_schema events_transactions_current XID_BQUAL 10 NULL YES varchar 130 390 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(130) select,insert,update,references XA transaction branch qualifier. NEVER NULL
-def performance_schema events_transactions_current XA_STATE 11 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The state of the XA transaction. The value is ACTIVE (after XA START), IDLE (after XA END), PREPARED (after XA PREPARE), ROLLED BACK (after XA ROLLBACK), or COMMITTED (after XA COMMIT). NEVER NULL
-def performance_schema events_transactions_current SOURCE 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The name of the source file containing the instrumented code that produced the event and the line number in the file at which the instrumentation occurs. NEVER NULL
-def performance_schema events_transactions_current TIMER_START 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The unit is picoseconds. When event timing started. NULL if event has no timing information. NEVER NULL
-def performance_schema events_transactions_current TIMER_END 14 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The unit is picoseconds. When event timing ended. NULL if event has no timing information. NEVER NULL
-def performance_schema events_transactions_current TIMER_WAIT 15 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The unit is picoseconds. Event duration. NULL if event has not timing information. NEVER NULL
-def performance_schema events_transactions_current ACCESS_MODE 16 NULL YES enum 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('READ ONLY','READ WRITE') select,insert,update,references Transaction access mode. NEVER NULL
-def performance_schema events_transactions_current ISOLATION_LEVEL 17 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Transaction isolation level. One of: REPEATABLE READ, READ COMMITTED, READ UNCOMMITTED, or SERIALIZABLE. NEVER NULL
-def performance_schema events_transactions_current AUTOCOMMIT 18 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references Whether autcommit mode was enabled when the transaction started. NEVER NULL
-def performance_schema events_transactions_current NUMBER_OF_SAVEPOINTS 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of SAVEPOINT statements issued during the transaction. NEVER NULL
-def performance_schema events_transactions_current NUMBER_OF_ROLLBACK_TO_SAVEPOINT 20 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of ROLLBACK_TO_SAVEPOINT statements issued during the transaction. NEVER NULL
-def performance_schema events_transactions_current NUMBER_OF_RELEASE_SAVEPOINT 21 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of RELEASE_SAVEPOINT statements issued during the transaction. NEVER NULL
-def performance_schema events_transactions_current OBJECT_INSTANCE_BEGIN 22 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Unused. NEVER NULL
-def performance_schema events_transactions_current NESTING_EVENT_ID 23 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The EVENT_ID value of the event within which this event is nested. NEVER NULL
-def performance_schema events_transactions_current NESTING_EVENT_TYPE 24 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references The nesting event type. NEVER NULL
-def performance_schema events_transactions_history THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The thread associated with the event. NEVER NULL
-def performance_schema events_transactions_history EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The event id associated with the event. NEVER NULL
-def performance_schema events_transactions_history END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references This column is set to NULL when the event starts and updated to the thread current event number when the event ends. NEVER NULL
-def performance_schema events_transactions_history EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references The name of the instrument from which the event was collected. This is a NAME value from the setup_instruments table. NEVER NULL
-def performance_schema events_transactions_history STATE 5 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('ACTIVE','COMMITTED','ROLLED BACK') select,insert,update,references The current transaction state. The value is ACTIVE (after START TRANSACTION or BEGIN), COMMITTED (after COMMIT), or ROLLED BACK (after ROLLBACK). NEVER NULL
-def performance_schema events_transactions_history TRX_ID 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Unused. NEVER NULL
-def performance_schema events_transactions_history GTID 7 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Transaction GTID, using the format DOMAIN-SERVER_ID-SEQUENCE_NO. NEVER NULL
-def performance_schema events_transactions_history XID_FORMAT_ID 8 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references XA transaction format ID for GTRID and BQUAL values. NEVER NULL
-def performance_schema events_transactions_history XID_GTRID 9 NULL YES varchar 130 390 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(130) select,insert,update,references XA global transaction ID. NEVER NULL
-def performance_schema events_transactions_history XID_BQUAL 10 NULL YES varchar 130 390 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(130) select,insert,update,references XA transaction branch qualifier. NEVER NULL
-def performance_schema events_transactions_history XA_STATE 11 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The state of the XA transaction. The value is ACTIVE (after XA START), IDLE (after XA END), PREPARED (after XA PREPARE), ROLLED BACK (after XA ROLLBACK), or COMMITTED (after XA COMMIT). NEVER NULL
-def performance_schema events_transactions_history SOURCE 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The name of the source file containing the instrumented code that produced the event and the line number in the file at which the instrumentation occurs. NEVER NULL
-def performance_schema events_transactions_history TIMER_START 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The unit is picoseconds. When event timing started. NULL if event has no timing information. NEVER NULL
-def performance_schema events_transactions_history TIMER_END 14 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The unit is picoseconds. When event timing ended. NULL if event has no timing information. NEVER NULL
-def performance_schema events_transactions_history TIMER_WAIT 15 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The unit is picoseconds. Event duration. NULL if event has not timing information. NEVER NULL
-def performance_schema events_transactions_history ACCESS_MODE 16 NULL YES enum 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('READ ONLY','READ WRITE') select,insert,update,references Transaction access mode. NEVER NULL
-def performance_schema events_transactions_history ISOLATION_LEVEL 17 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Transaction isolation level. One of: REPEATABLE READ, READ COMMITTED, READ UNCOMMITTED, or SERIALIZABLE. NEVER NULL
-def performance_schema events_transactions_history AUTOCOMMIT 18 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references Whether autcommit mode was enabled when the transaction started. NEVER NULL
-def performance_schema events_transactions_history NUMBER_OF_SAVEPOINTS 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of SAVEPOINT statements issued during the transaction. NEVER NULL
-def performance_schema events_transactions_history NUMBER_OF_ROLLBACK_TO_SAVEPOINT 20 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of ROLLBACK_TO_SAVEPOINT statements issued during the transaction. NEVER NULL
-def performance_schema events_transactions_history NUMBER_OF_RELEASE_SAVEPOINT 21 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of RELEASE_SAVEPOINT statements issued during the transaction. NEVER NULL
-def performance_schema events_transactions_history OBJECT_INSTANCE_BEGIN 22 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Unused. NEVER NULL
-def performance_schema events_transactions_history NESTING_EVENT_ID 23 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The EVENT_ID value of the event within which this event is nested. NEVER NULL
-def performance_schema events_transactions_history NESTING_EVENT_TYPE 24 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references The nesting event type. NEVER NULL
-def performance_schema events_transactions_history_long THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The thread associated with the event. NEVER NULL
-def performance_schema events_transactions_history_long EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The event id associated with the event. NEVER NULL
-def performance_schema events_transactions_history_long END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references This column is set to NULL when the event starts and updated to the thread current event number when the event ends. NEVER NULL
-def performance_schema events_transactions_history_long EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references The name of the instrument from which the event was collected. This is a NAME value from the setup_instruments table. NEVER NULL
-def performance_schema events_transactions_history_long STATE 5 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('ACTIVE','COMMITTED','ROLLED BACK') select,insert,update,references The current transaction state. The value is ACTIVE (after START TRANSACTION or BEGIN), COMMITTED (after COMMIT), or ROLLED BACK (after ROLLBACK). NEVER NULL
-def performance_schema events_transactions_history_long TRX_ID 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Unused. NEVER NULL
-def performance_schema events_transactions_history_long GTID 7 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Transaction GTID, using the format DOMAIN-SERVER_ID-SEQUENCE_NO. NEVER NULL
-def performance_schema events_transactions_history_long XID_FORMAT_ID 8 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references XA transaction format ID for GTRID and BQUAL values. NEVER NULL
-def performance_schema events_transactions_history_long XID_GTRID 9 NULL YES varchar 130 390 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(130) select,insert,update,references XA global transaction ID. NEVER NULL
-def performance_schema events_transactions_history_long XID_BQUAL 10 NULL YES varchar 130 390 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(130) select,insert,update,references XA transaction branch qualifier. NEVER NULL
-def performance_schema events_transactions_history_long XA_STATE 11 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The state of the XA transaction. The value is ACTIVE (after XA START), IDLE (after XA END), PREPARED (after XA PREPARE), ROLLED BACK (after XA ROLLBACK), or COMMITTED (after XA COMMIT). NEVER NULL
-def performance_schema events_transactions_history_long SOURCE 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The name of the source file containing the instrumented code that produced the event and the line number in the file at which the instrumentation occurs. NEVER NULL
-def performance_schema events_transactions_history_long TIMER_START 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The unit is picoseconds. When event timing started. NULL if event has no timing information. NEVER NULL
-def performance_schema events_transactions_history_long TIMER_END 14 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The unit is picoseconds. When event timing ended. NULL if event has no timing information. NEVER NULL
-def performance_schema events_transactions_history_long TIMER_WAIT 15 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The unit is picoseconds. Event duration. NULL if event has not timing information. NEVER NULL
-def performance_schema events_transactions_history_long ACCESS_MODE 16 NULL YES enum 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('READ ONLY','READ WRITE') select,insert,update,references Transaction access mode. NEVER NULL
-def performance_schema events_transactions_history_long ISOLATION_LEVEL 17 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Transaction isolation level. One of: REPEATABLE READ, READ COMMITTED, READ UNCOMMITTED, or SERIALIZABLE. NEVER NULL
-def performance_schema events_transactions_history_long AUTOCOMMIT 18 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references Whether autcommit mode was enabled when the transaction started. NEVER NULL
-def performance_schema events_transactions_history_long NUMBER_OF_SAVEPOINTS 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of SAVEPOINT statements issued during the transaction. NEVER NULL
-def performance_schema events_transactions_history_long NUMBER_OF_ROLLBACK_TO_SAVEPOINT 20 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of ROLLBACK_TO_SAVEPOINT statements issued during the transaction. NEVER NULL
-def performance_schema events_transactions_history_long NUMBER_OF_RELEASE_SAVEPOINT 21 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of RELEASE_SAVEPOINT statements issued during the transaction. NEVER NULL
-def performance_schema events_transactions_history_long OBJECT_INSTANCE_BEGIN 22 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Unused. NEVER NULL
-def performance_schema events_transactions_history_long NESTING_EVENT_ID 23 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The EVENT_ID value of the event within which this event is nested. NEVER NULL
-def performance_schema events_transactions_history_long NESTING_EVENT_TYPE 24 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references The nesting event type. NEVER NULL
-def performance_schema events_transactions_summary_by_account_by_event_name USER 1 NULL YES char 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin char(32) select,insert,update,references User for which summary is generated. NEVER NULL
-def performance_schema events_transactions_summary_by_account_by_event_name HOST 2 NULL YES char 60 180 NULL NULL NULL utf8mb3 utf8mb3_bin char(60) select,insert,update,references Host for which summary is generated. NEVER NULL
-def performance_schema events_transactions_summary_by_account_by_event_name EVENT_NAME 3 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name for which summary is generated. NEVER NULL
-def performance_schema events_transactions_summary_by_account_by_event_name COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of summarized events. This value includes all events, whether timed or nontimed. NEVER NULL
-def performance_schema events_transactions_summary_by_account_by_event_name SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of the summarized timed events. This value is calculated only for timed events because nontimed events have a wait time of NULL. The same is true for the other xxx_TIMER_WAIT values. NEVER NULL
-def performance_schema events_transactions_summary_by_account_by_event_name MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of the summarized timed events. NEVER NULL
-def performance_schema events_transactions_summary_by_account_by_event_name AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of the summarized timed events. NEVER NULL
-def performance_schema events_transactions_summary_by_account_by_event_name MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of the summarized timed events. NEVER NULL
-def performance_schema events_transactions_summary_by_account_by_event_name COUNT_READ_WRITE 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_account_by_event_name SUM_TIMER_READ_WRITE 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_account_by_event_name MIN_TIMER_READ_WRITE 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_account_by_event_name AVG_TIMER_READ_WRITE 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_account_by_event_name MAX_TIMER_READ_WRITE 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_account_by_event_name COUNT_READ_ONLY 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_account_by_event_name SUM_TIMER_READ_ONLY 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_account_by_event_name MIN_TIMER_READ_ONLY 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_account_by_event_name AVG_TIMER_READ_ONLY 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_account_by_event_name MAX_TIMER_READ_ONLY 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_host_by_event_name HOST 1 NULL YES char 60 180 NULL NULL NULL utf8mb3 utf8mb3_bin char(60) select,insert,update,references Host for which summary is generated. NEVER NULL
-def performance_schema events_transactions_summary_by_host_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name for which summary is generated. NEVER NULL
-def performance_schema events_transactions_summary_by_host_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of summarized events. This value includes all events, whether timed or nontimed. NEVER NULL
-def performance_schema events_transactions_summary_by_host_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of the summarized timed events. This value is calculated only for timed events because nontimed events have a wait time of NULL. The same is true for the other xxx_TIMER_WAIT values. NEVER NULL
-def performance_schema events_transactions_summary_by_host_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of the summarized timed events. NEVER NULL
-def performance_schema events_transactions_summary_by_host_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of the summarized timed events. NEVER NULL
-def performance_schema events_transactions_summary_by_host_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of the summarized timed events. NEVER NULL
-def performance_schema events_transactions_summary_by_host_by_event_name COUNT_READ_WRITE 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_host_by_event_name SUM_TIMER_READ_WRITE 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_host_by_event_name MIN_TIMER_READ_WRITE 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_host_by_event_name AVG_TIMER_READ_WRITE 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_host_by_event_name MAX_TIMER_READ_WRITE 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_host_by_event_name COUNT_READ_ONLY 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_host_by_event_name SUM_TIMER_READ_ONLY 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_host_by_event_name MIN_TIMER_READ_ONLY 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_host_by_event_name AVG_TIMER_READ_ONLY 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_host_by_event_name MAX_TIMER_READ_ONLY 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_thread_by_event_name THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread for which summary is generated. NEVER NULL
-def performance_schema events_transactions_summary_by_thread_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name for which summary is generated. NEVER NULL
-def performance_schema events_transactions_summary_by_thread_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of summarized events. This value includes all events, whether timed or nontimed. NEVER NULL
-def performance_schema events_transactions_summary_by_thread_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of the summarized timed events. This value is calculated only for timed events because nontimed events have a wait time of NULL. The same is true for the other xxx_TIMER_WAIT values. NEVER NULL
-def performance_schema events_transactions_summary_by_thread_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of the summarized timed events. NEVER NULL
-def performance_schema events_transactions_summary_by_thread_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of the summarized timed events. NEVER NULL
-def performance_schema events_transactions_summary_by_thread_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of the summarized timed events. NEVER NULL
-def performance_schema events_transactions_summary_by_thread_by_event_name COUNT_READ_WRITE 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_thread_by_event_name SUM_TIMER_READ_WRITE 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_thread_by_event_name MIN_TIMER_READ_WRITE 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_thread_by_event_name AVG_TIMER_READ_WRITE 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_thread_by_event_name MAX_TIMER_READ_WRITE 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_thread_by_event_name COUNT_READ_ONLY 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_thread_by_event_name SUM_TIMER_READ_ONLY 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_thread_by_event_name MIN_TIMER_READ_ONLY 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_thread_by_event_name AVG_TIMER_READ_ONLY 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_thread_by_event_name MAX_TIMER_READ_ONLY 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_user_by_event_name USER 1 NULL YES char 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin char(32) select,insert,update,references User for which summary is generated. NEVER NULL
-def performance_schema events_transactions_summary_by_user_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name for which summary is generated. NEVER NULL
-def performance_schema events_transactions_summary_by_user_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of summarized events. This value includes all events, whether timed or nontimed. NEVER NULL
-def performance_schema events_transactions_summary_by_user_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of the summarized timed events. This value is calculated only for timed events because nontimed events have a wait time of NULL. The same is true for the other xxx_TIMER_WAIT values. NEVER NULL
-def performance_schema events_transactions_summary_by_user_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of the summarized timed events. NEVER NULL
-def performance_schema events_transactions_summary_by_user_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of the summarized timed events. NEVER NULL
-def performance_schema events_transactions_summary_by_user_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of the summarized timed events. NEVER NULL
-def performance_schema events_transactions_summary_by_user_by_event_name COUNT_READ_WRITE 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_user_by_event_name SUM_TIMER_READ_WRITE 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_user_by_event_name MIN_TIMER_READ_WRITE 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_user_by_event_name AVG_TIMER_READ_WRITE 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_user_by_event_name MAX_TIMER_READ_WRITE 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_user_by_event_name COUNT_READ_ONLY 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_user_by_event_name SUM_TIMER_READ_ONLY 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_user_by_event_name MIN_TIMER_READ_ONLY 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_user_by_event_name AVG_TIMER_READ_ONLY 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_by_user_by_event_name MAX_TIMER_READ_ONLY 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_global_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name for which summary is generated. NEVER NULL
-def performance_schema events_transactions_summary_global_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of summarized events. This value includes all events, whether timed or nontimed. NEVER NULL
-def performance_schema events_transactions_summary_global_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of the summarized timed events. This value is calculated only for timed events because nontimed events have a wait time of NULL. The same is true for the other xxx_TIMER_WAIT values. NEVER NULL
-def performance_schema events_transactions_summary_global_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of the summarized timed events. NEVER NULL
-def performance_schema events_transactions_summary_global_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of the summarized timed events. NEVER NULL
-def performance_schema events_transactions_summary_global_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of the summarized timed events. NEVER NULL
-def performance_schema events_transactions_summary_global_by_event_name COUNT_READ_WRITE 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_global_by_event_name SUM_TIMER_READ_WRITE 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_global_by_event_name MIN_TIMER_READ_WRITE 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_global_by_event_name AVG_TIMER_READ_WRITE 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_global_by_event_name MAX_TIMER_READ_WRITE 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of only READ/WRITE transaction events. NEVER NULL
-def performance_schema events_transactions_summary_global_by_event_name COUNT_READ_ONLY 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_global_by_event_name SUM_TIMER_READ_ONLY 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_global_by_event_name MIN_TIMER_READ_ONLY 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_global_by_event_name AVG_TIMER_READ_ONLY 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_transactions_summary_global_by_event_name MAX_TIMER_READ_ONLY 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of only READ ONLY transaction events. NEVER NULL
-def performance_schema events_waits_current THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL
-def performance_schema events_waits_current EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL
-def performance_schema events_waits_current END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL
-def performance_schema events_waits_current EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL
-def performance_schema events_waits_current SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL
-def performance_schema events_waits_current TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL
-def performance_schema events_waits_current TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL
-def performance_schema events_waits_current TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL
-def performance_schema events_waits_current SPINS 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Number of spin rounds for a mutex, or NULL if spin rounds are not used, or spinning is not instrumented. NEVER NULL
-def performance_schema events_waits_current OBJECT_SCHEMA 10 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name of the schema that contains the table for table I/O objects, otherwise NULL for file I/O and synchronization objects. NEVER NULL
-def performance_schema events_waits_current OBJECT_NAME 11 NULL YES varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references File name for file I/O objects, table name for table I/O objects, the socket's IP:PORT value for a socket object or NULL for a synchronization object. NEVER NULL
-def performance_schema events_waits_current INDEX_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name of the index, PRIMARY for the primary key, or NULL for no index used. NEVER NULL
-def performance_schema events_waits_current OBJECT_TYPE 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references FILE for a file object, TABLE or TEMPORARY TABLE for a table object, or NULL for a synchronization object. NEVER NULL
-def performance_schema events_waits_current OBJECT_INSTANCE_BEGIN 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the object. NEVER NULL
-def performance_schema events_waits_current NESTING_EVENT_ID 15 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references EVENT_ID of event within which this event nests. NEVER NULL
-def performance_schema events_waits_current NESTING_EVENT_TYPE 16 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references Nesting event type. Either statement, stage or wait. NEVER NULL
-def performance_schema events_waits_current OPERATION 17 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select,insert,update,references Operation type, for example read, write or lock NEVER NULL
-def performance_schema events_waits_current NUMBER_OF_BYTES 18 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of bytes that the operation read or wrote, or NULL for table I/O waits. NEVER NULL
-def performance_schema events_waits_current FLAGS 19 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Reserved for use in the future. NEVER NULL
-def performance_schema events_waits_history THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL
-def performance_schema events_waits_history EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL
-def performance_schema events_waits_history END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL
-def performance_schema events_waits_history EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL
-def performance_schema events_waits_history SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL
-def performance_schema events_waits_history TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL
-def performance_schema events_waits_history TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL
-def performance_schema events_waits_history TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL
-def performance_schema events_waits_history SPINS 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Number of spin rounds for a mutex, or NULL if spin rounds are not used, or spinning is not instrumented. NEVER NULL
-def performance_schema events_waits_history OBJECT_SCHEMA 10 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name of the schema that contains the table for table I/O objects, otherwise NULL for file I/O and synchronization objects. NEVER NULL
-def performance_schema events_waits_history OBJECT_NAME 11 NULL YES varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references File name for file I/O objects, table name for table I/O objects, the socket's IP:PORT value for a socket object or NULL for a synchronization object. NEVER NULL
-def performance_schema events_waits_history INDEX_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name of the index, PRIMARY for the primary key, or NULL for no index used. NEVER NULL
-def performance_schema events_waits_history OBJECT_TYPE 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references FILE for a file object, TABLE or TEMPORARY TABLE for a table object, or NULL for a synchronization object. NEVER NULL
-def performance_schema events_waits_history OBJECT_INSTANCE_BEGIN 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the object. NEVER NULL
-def performance_schema events_waits_history NESTING_EVENT_ID 15 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references EVENT_ID of event within which this event nests. NEVER NULL
-def performance_schema events_waits_history NESTING_EVENT_TYPE 16 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references Nesting event type. Either statement, stage or wait. NEVER NULL
-def performance_schema events_waits_history OPERATION 17 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select,insert,update,references Operation type, for example read, write or lock NEVER NULL
-def performance_schema events_waits_history NUMBER_OF_BYTES 18 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of bytes that the operation read or wrote, or NULL for table I/O waits. NEVER NULL
-def performance_schema events_waits_history FLAGS 19 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Reserved for use in the future. NEVER NULL
-def performance_schema events_waits_history_long THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL
-def performance_schema events_waits_history_long EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL
-def performance_schema events_waits_history_long END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL
-def performance_schema events_waits_history_long EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL
-def performance_schema events_waits_history_long SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL
-def performance_schema events_waits_history_long TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL
-def performance_schema events_waits_history_long TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL
-def performance_schema events_waits_history_long TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL
-def performance_schema events_waits_history_long SPINS 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Number of spin rounds for a mutex, or NULL if spin rounds are not used, or spinning is not instrumented. NEVER NULL
-def performance_schema events_waits_history_long OBJECT_SCHEMA 10 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name of the schema that contains the table for table I/O objects, otherwise NULL for file I/O and synchronization objects. NEVER NULL
-def performance_schema events_waits_history_long OBJECT_NAME 11 NULL YES varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references File name for file I/O objects, table name for table I/O objects, the socket's IP:PORT value for a socket object or NULL for a synchronization object. NEVER NULL
-def performance_schema events_waits_history_long INDEX_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name of the index, PRIMARY for the primary key, or NULL for no index used. NEVER NULL
-def performance_schema events_waits_history_long OBJECT_TYPE 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references FILE for a file object, TABLE or TEMPORARY TABLE for a table object, or NULL for a synchronization object. NEVER NULL
-def performance_schema events_waits_history_long OBJECT_INSTANCE_BEGIN 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the object. NEVER NULL
-def performance_schema events_waits_history_long NESTING_EVENT_ID 15 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references EVENT_ID of event within which this event nests. NEVER NULL
-def performance_schema events_waits_history_long NESTING_EVENT_TYPE 16 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references Nesting event type. Either statement, stage or wait. NEVER NULL
-def performance_schema events_waits_history_long OPERATION 17 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select,insert,update,references Operation type, for example read, write or lock NEVER NULL
-def performance_schema events_waits_history_long NUMBER_OF_BYTES 18 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of bytes that the operation read or wrote, or NULL for table I/O waits. NEVER NULL
-def performance_schema events_waits_history_long FLAGS 19 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Reserved for use in the future. NEVER NULL
-def performance_schema events_waits_summary_by_account_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references User. Used together with HOST and EVENT_NAME for grouping events. NEVER NULL
-def performance_schema events_waits_summary_by_account_by_event_name HOST 2 NULL YES char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) select,insert,update,references Host. Used together with USER and EVENT_NAME for grouping events. NEVER NULL
-def performance_schema events_waits_summary_by_account_by_event_name EVENT_NAME 3 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with USER and HOST for grouping events. NEVER NULL
-def performance_schema events_waits_summary_by_account_by_event_name COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
-def performance_schema events_waits_summary_by_account_by_event_name SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_waits_summary_by_account_by_event_name MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_waits_summary_by_account_by_event_name AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_waits_summary_by_account_by_event_name MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_waits_summary_by_host_by_event_name HOST 1 NULL YES char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) select,insert,update,references Host. Used together with EVENT_NAME for grouping events. NEVER NULL
-def performance_schema events_waits_summary_by_host_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with USER and HOST for grouping events. NEVER NULL
-def performance_schema events_waits_summary_by_host_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
-def performance_schema events_waits_summary_by_host_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_waits_summary_by_host_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_waits_summary_by_host_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_waits_summary_by_host_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_waits_summary_by_instance EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with OBJECT_INSTANCE_BEGIN for grouping events. NEVER NULL
-def performance_schema events_waits_summary_by_instance OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references If an instrument creates multiple instances, each instance has a unique OBJECT_INSTANCE_BEGIN value to allow for grouping by instance. NEVER NULL
-def performance_schema events_waits_summary_by_instance COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
-def performance_schema events_waits_summary_by_instance SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_waits_summary_by_instance MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_waits_summary_by_instance AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_waits_summary_by_instance MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_waits_summary_by_thread_by_event_name THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_NAME uniquely identifies the row. NEVER NULL
-def performance_schema events_waits_summary_by_thread_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with THREAD_ID for grouping events. NEVER NULL
-def performance_schema events_waits_summary_by_thread_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
-def performance_schema events_waits_summary_by_thread_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_waits_summary_by_thread_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_waits_summary_by_thread_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_waits_summary_by_thread_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_waits_summary_by_user_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references User. Used together with EVENT_NAME for grouping events. NEVER NULL
-def performance_schema events_waits_summary_by_user_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with USER for grouping events. NEVER NULL
-def performance_schema events_waits_summary_by_user_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
-def performance_schema events_waits_summary_by_user_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_waits_summary_by_user_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_waits_summary_by_user_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_waits_summary_by_user_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_waits_summary_global_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL
-def performance_schema events_waits_summary_global_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
-def performance_schema events_waits_summary_global_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_waits_summary_global_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_waits_summary_global_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
-def performance_schema events_waits_summary_global_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema file_instances FILE_NAME 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references File name. NEVER NULL
-def performance_schema file_instances EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Instrument name associated with the file. NEVER NULL
-def performance_schema file_instances OPEN_COUNT 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Open handles on the file. A value of greater than zero means that the file is currently open. NEVER NULL
-def performance_schema file_summary_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL
-def performance_schema file_summary_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
-def performance_schema file_summary_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
-def performance_schema file_summary_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema file_summary_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
-def performance_schema file_summary_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema file_summary_by_event_name COUNT_READ 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all read operations, including FGETS, FGETC, FREAD, and READ. NEVER NULL
-def performance_schema file_summary_by_event_name SUM_TIMER_READ 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all read operations that are timed. NEVER NULL
-def performance_schema file_summary_by_event_name MIN_TIMER_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all read operations that are timed. NEVER NULL
-def performance_schema file_summary_by_event_name AVG_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all read operations that are timed. NEVER NULL
-def performance_schema file_summary_by_event_name MAX_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all read operations that are timed. NEVER NULL
-def performance_schema file_summary_by_event_name SUM_NUMBER_OF_BYTES_READ 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Bytes read by read operations. NEVER NULL
-def performance_schema file_summary_by_event_name COUNT_WRITE 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all write operations, including FPUTS, FPUTC, FPRINTF, VFPRINTF, FWRITE, and PWRITE. NEVER NULL
-def performance_schema file_summary_by_event_name SUM_TIMER_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all write operations that are timed. NEVER NULL
-def performance_schema file_summary_by_event_name MIN_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all write operations that are timed. NEVER NULL
-def performance_schema file_summary_by_event_name AVG_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all write operations that are timed. NEVER NULL
-def performance_schema file_summary_by_event_name MAX_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all write operations that are timed. NEVER NULL
-def performance_schema file_summary_by_event_name SUM_NUMBER_OF_BYTES_WRITE 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Bytes written by write operations. NEVER NULL
-def performance_schema file_summary_by_event_name COUNT_MISC 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all miscellaneous operations not counted above, including CREATE, DELETE, OPEN, CLOSE, STREAM_OPEN, STREAM_CLOSE, SEEK, TELL, FLUSH, STAT, FSTAT, CHSIZE, RENAME, and SYNC. NEVER NULL
-def performance_schema file_summary_by_event_name SUM_TIMER_MISC 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all miscellaneous operations that are timed. NEVER NULL
-def performance_schema file_summary_by_event_name MIN_TIMER_MISC 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all miscellaneous operations that are timed. NEVER NULL
-def performance_schema file_summary_by_event_name AVG_TIMER_MISC 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all miscellaneous operations that are timed. NEVER NULL
-def performance_schema file_summary_by_event_name MAX_TIMER_MISC 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all miscellaneous operations that are timed. NEVER NULL
-def performance_schema file_summary_by_instance FILE_NAME 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references File name. NEVER NULL
-def performance_schema file_summary_by_instance EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL
-def performance_schema file_summary_by_instance OBJECT_INSTANCE_BEGIN 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory. Together with FILE_NAME and EVENT_NAME uniquely identifies a row. NEVER NULL
-def performance_schema file_summary_by_instance COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
-def performance_schema file_summary_by_instance SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
-def performance_schema file_summary_by_instance MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema file_summary_by_instance AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
-def performance_schema file_summary_by_instance MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema file_summary_by_instance COUNT_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all read operations, including FGETS, FGETC, FREAD, and READ. NEVER NULL
-def performance_schema file_summary_by_instance SUM_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all read operations that are timed. NEVER NULL
-def performance_schema file_summary_by_instance MIN_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all read operations that are timed. NEVER NULL
-def performance_schema file_summary_by_instance AVG_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all read operations that are timed. NEVER NULL
-def performance_schema file_summary_by_instance MAX_TIMER_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all read operations that are timed. NEVER NULL
-def performance_schema file_summary_by_instance SUM_NUMBER_OF_BYTES_READ 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Bytes read by read operations. NEVER NULL
-def performance_schema file_summary_by_instance COUNT_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all write operations, including FPUTS, FPUTC, FPRINTF, VFPRINTF, FWRITE, and PWRITE. NEVER NULL
-def performance_schema file_summary_by_instance SUM_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all write operations that are timed. NEVER NULL
-def performance_schema file_summary_by_instance MIN_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all write operations that are timed. NEVER NULL
-def performance_schema file_summary_by_instance AVG_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all write operations that are timed. NEVER NULL
-def performance_schema file_summary_by_instance MAX_TIMER_WRITE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all write operations that are timed. NEVER NULL
-def performance_schema file_summary_by_instance SUM_NUMBER_OF_BYTES_WRITE 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Bytes written by write operations. NEVER NULL
-def performance_schema file_summary_by_instance COUNT_MISC 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all miscellaneous operations not counted above, including CREATE, DELETE, OPEN, CLOSE, STREAM_OPEN, STREAM_CLOSE, SEEK, TELL, FLUSH, STAT, FSTAT, CHSIZE, RENAME, and SYNC. NEVER NULL
-def performance_schema file_summary_by_instance SUM_TIMER_MISC 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all miscellaneous operations that are timed. NEVER NULL
-def performance_schema file_summary_by_instance MIN_TIMER_MISC 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all miscellaneous operations that are timed. NEVER NULL
-def performance_schema file_summary_by_instance AVG_TIMER_MISC 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all miscellaneous operations that are timed. NEVER NULL
-def performance_schema file_summary_by_instance MAX_TIMER_MISC 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all miscellaneous operations that are timed. NEVER NULL
-def performance_schema global_status VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The global status variable name. NEVER NULL
-def performance_schema global_status VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select,insert,update,references The global status variable value. NEVER NULL
-def performance_schema hosts HOST 1 NULL YES char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) select,insert,update,references Host name used by the client to connect, NULL for internal threads or user sessions that failed to authenticate. NEVER NULL
-def performance_schema hosts CURRENT_CONNECTIONS 2 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Current number of the host's connections. NEVER NULL
-def performance_schema hosts TOTAL_CONNECTIONS 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Total number of the host's connections NEVER NULL
-def performance_schema host_cache IP 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Client IP address. NEVER NULL
-def performance_schema host_cache HOST 2 NULL YES varchar 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(255) select,insert,update,references IP's resolved DNS host name, or NULL if unknown. NEVER NULL
-def performance_schema host_cache HOST_VALIDATED 3 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references YES if the IP-to-host DNS lookup was successful, and the HOST column can be used to avoid DNS calls, or NO if unsuccessful, in which case DNS lookup is performed for each connect until either successful or a permanent error. NEVER NULL
-def performance_schema host_cache SUM_CONNECT_ERRORS 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of connection errors. Counts only protocol handshake errors for hosts that passed validation. These errors count towards max_connect_errors. NEVER NULL
-def performance_schema host_cache COUNT_HOST_BLOCKED_ERRORS 5 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of blocked connections because SUM_CONNECT_ERRORS exceeded the max_connect_errors system variable. NEVER NULL
-def performance_schema host_cache COUNT_NAMEINFO_TRANSIENT_ERRORS 6 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of transient errors during IP-to-host DNS lookups. NEVER NULL
-def performance_schema host_cache COUNT_NAMEINFO_PERMANENT_ERRORS 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of permanent errors during IP-to-host DNS lookups. NEVER NULL
-def performance_schema host_cache COUNT_FORMAT_ERRORS 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of host name format errors, for example a numeric host column. NEVER NULL
-def performance_schema host_cache COUNT_ADDRINFO_TRANSIENT_ERRORS 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of transient errors during host-to-IP reverse DNS lookups. NEVER NULL
-def performance_schema host_cache COUNT_ADDRINFO_PERMANENT_ERRORS 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of permanent errors during host-to-IP reverse DNS lookups. NEVER NULL
-def performance_schema host_cache COUNT_FCRDNS_ERRORS 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of forward-confirmed reverse DNS errors, which occur when IP-to-host DNS lookup does not match the originating IP address. NEVER NULL
-def performance_schema host_cache COUNT_HOST_ACL_ERRORS 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors occurring because no user from the host is permitted to log in. These attempts return error code 1130 ER_HOST_NOT_PRIVILEGED and do not proceed to username and password authentication. NEVER NULL
-def performance_schema host_cache COUNT_NO_AUTH_PLUGIN_ERRORS 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors due to requesting an authentication plugin that was not available. This can be due to the plugin never having been loaded, or the load attempt failing. NEVER NULL
-def performance_schema host_cache COUNT_AUTH_PLUGIN_ERRORS 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors reported by an authentication plugin. Plugins can increment COUNT_AUTHENTICATION_ERRORS or COUNT_HANDSHAKE_ERRORS instead, but, if specified or the error is unknown, this column is incremented. NEVER NULL
-def performance_schema host_cache COUNT_HANDSHAKE_ERRORS 15 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors detected at the wire protocol level. NEVER NULL
-def performance_schema host_cache COUNT_PROXY_USER_ERRORS 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors detected when a proxy user is proxied to a user that does not exist. NEVER NULL
-def performance_schema host_cache COUNT_PROXY_USER_ACL_ERRORS 17 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors detected when a proxy user is proxied to a user that exists, but the proxy user doesn't have the PROXY privilege. NEVER NULL
-def performance_schema host_cache COUNT_AUTHENTICATION_ERRORS 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors where authentication failed. NEVER NULL
-def performance_schema host_cache COUNT_SSL_ERRORS 19 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors due to TLS problems. NEVER NULL
-def performance_schema host_cache COUNT_MAX_USER_CONNECTIONS_ERRORS 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors due to the per-user quota being exceeded. NEVER NULL
-def performance_schema host_cache COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 21 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors due to the per-hour quota being exceeded. NEVER NULL
-def performance_schema host_cache COUNT_DEFAULT_DATABASE_ERRORS 22 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors due to the user not having permission to access the specified default database, or it not existing. NEVER NULL
-def performance_schema host_cache COUNT_INIT_CONNECT_ERRORS 23 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors due to statements in the init_connect system variable. NEVER NULL
-def performance_schema host_cache COUNT_LOCAL_ERRORS 24 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of local server errors, such as out-of-memory errors, unrelated to network, authentication, or authorization. NEVER NULL
-def performance_schema host_cache COUNT_UNKNOWN_ERRORS 25 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of unknown errors that cannot be allocated to another column. NEVER NULL
-def performance_schema host_cache FIRST_SEEN 26 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references Timestamp of the first connection attempt by the IP. NEVER NULL
-def performance_schema host_cache LAST_SEEN 27 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references Timestamp of the most recent connection attempt by the IP. NEVER NULL
-def performance_schema host_cache FIRST_ERROR_SEEN 28 '0000-00-00 00:00:00' YES timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references Timestamp of the first error seen from the IP. NEVER NULL
-def performance_schema host_cache LAST_ERROR_SEEN 29 '0000-00-00 00:00:00' YES timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references Timestamp of the most recent error seen from the IP. NEVER NULL
-def performance_schema memory_summary_by_account_by_event_name USER 1 NULL YES char 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin char(32) select,insert,update,references User portion of the account. NEVER NULL
-def performance_schema memory_summary_by_account_by_event_name HOST 2 NULL YES char 60 180 NULL NULL NULL utf8mb3 utf8mb3_bin char(60) select,insert,update,references Host portion of the account. NEVER NULL
-def performance_schema memory_summary_by_account_by_event_name EVENT_NAME 3 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL
-def performance_schema memory_summary_by_account_by_event_name COUNT_ALLOC 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of allocations to memory. NEVER NULL
-def performance_schema memory_summary_by_account_by_event_name COUNT_FREE 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of attempts to free the allocated memory. NEVER NULL
-def performance_schema memory_summary_by_account_by_event_name SUM_NUMBER_OF_BYTES_ALLOC 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of bytes allocated. NEVER NULL
-def performance_schema memory_summary_by_account_by_event_name SUM_NUMBER_OF_BYTES_FREE 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of bytes freed NEVER NULL
-def performance_schema memory_summary_by_account_by_event_name LOW_COUNT_USED 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Lowest number of allocated blocks (lowest value of CURRENT_COUNT_USED). NEVER NULL
-def performance_schema memory_summary_by_account_by_event_name CURRENT_COUNT_USED 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Currently allocated blocks that have not been freed (COUNT_ALLOC minus COUNT_FREE). NEVER NULL
-def performance_schema memory_summary_by_account_by_event_name HIGH_COUNT_USED 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Highest number of allocated blocks (highest value of CURRENT_COUNT_USED). NEVER NULL
-def performance_schema memory_summary_by_account_by_event_name LOW_NUMBER_OF_BYTES_USED 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Lowest number of bytes used. NEVER NULL
-def performance_schema memory_summary_by_account_by_event_name CURRENT_NUMBER_OF_BYTES_USED 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Current number of bytes used (total allocated minus total freed). NEVER NULL
-def performance_schema memory_summary_by_account_by_event_name HIGH_NUMBER_OF_BYTES_USED 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Highest number of bytes used. NEVER NULL
-def performance_schema memory_summary_by_host_by_event_name HOST 1 NULL YES char 60 180 NULL NULL NULL utf8mb3 utf8mb3_bin char(60) select,insert,update,references Host portion of the account. NEVER NULL
-def performance_schema memory_summary_by_host_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL
-def performance_schema memory_summary_by_host_by_event_name COUNT_ALLOC 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of allocations to memory. NEVER NULL
-def performance_schema memory_summary_by_host_by_event_name COUNT_FREE 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of attempts to free the allocated memory. NEVER NULL
-def performance_schema memory_summary_by_host_by_event_name SUM_NUMBER_OF_BYTES_ALLOC 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of bytes allocated. NEVER NULL
-def performance_schema memory_summary_by_host_by_event_name SUM_NUMBER_OF_BYTES_FREE 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of bytes freed NEVER NULL
-def performance_schema memory_summary_by_host_by_event_name LOW_COUNT_USED 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Lowest number of allocated blocks (lowest value of CURRENT_COUNT_USED). NEVER NULL
-def performance_schema memory_summary_by_host_by_event_name CURRENT_COUNT_USED 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Currently allocated blocks that have not been freed (COUNT_ALLOC minus COUNT_FREE). NEVER NULL
-def performance_schema memory_summary_by_host_by_event_name HIGH_COUNT_USED 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Highest number of allocated blocks (highest value of CURRENT_COUNT_USED). NEVER NULL
-def performance_schema memory_summary_by_host_by_event_name LOW_NUMBER_OF_BYTES_USED 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Lowest number of bytes used. NEVER NULL
-def performance_schema memory_summary_by_host_by_event_name CURRENT_NUMBER_OF_BYTES_USED 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Current number of bytes used (total allocated minus total freed). NEVER NULL
-def performance_schema memory_summary_by_host_by_event_name HIGH_NUMBER_OF_BYTES_USED 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Highest number of bytes used. NEVER NULL
-def performance_schema memory_summary_by_thread_by_event_name THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread id. NEVER NULL
-def performance_schema memory_summary_by_thread_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL
-def performance_schema memory_summary_by_thread_by_event_name COUNT_ALLOC 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of allocations to memory. NEVER NULL
-def performance_schema memory_summary_by_thread_by_event_name COUNT_FREE 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of attempts to free the allocated memory. NEVER NULL
-def performance_schema memory_summary_by_thread_by_event_name SUM_NUMBER_OF_BYTES_ALLOC 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of bytes allocated. NEVER NULL
-def performance_schema memory_summary_by_thread_by_event_name SUM_NUMBER_OF_BYTES_FREE 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of bytes freed NEVER NULL
-def performance_schema memory_summary_by_thread_by_event_name LOW_COUNT_USED 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Lowest number of allocated blocks (lowest value of CURRENT_COUNT_USED). NEVER NULL
-def performance_schema memory_summary_by_thread_by_event_name CURRENT_COUNT_USED 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Currently allocated blocks that have not been freed (COUNT_ALLOC minus COUNT_FREE). NEVER NULL
-def performance_schema memory_summary_by_thread_by_event_name HIGH_COUNT_USED 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Highest number of allocated blocks (highest value of CURRENT_COUNT_USED). NEVER NULL
-def performance_schema memory_summary_by_thread_by_event_name LOW_NUMBER_OF_BYTES_USED 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Lowest number of bytes used. NEVER NULL
-def performance_schema memory_summary_by_thread_by_event_name CURRENT_NUMBER_OF_BYTES_USED 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Current number of bytes used (total allocated minus total freed). NEVER NULL
-def performance_schema memory_summary_by_thread_by_event_name HIGH_NUMBER_OF_BYTES_USED 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Highest number of bytes used. NEVER NULL
-def performance_schema memory_summary_by_user_by_event_name USER 1 NULL YES char 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin char(32) select,insert,update,references User portion of the account. NEVER NULL
-def performance_schema memory_summary_by_user_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL
-def performance_schema memory_summary_by_user_by_event_name COUNT_ALLOC 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of allocations to memory. NEVER NULL
-def performance_schema memory_summary_by_user_by_event_name COUNT_FREE 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of attempts to free the allocated memory. NEVER NULL
-def performance_schema memory_summary_by_user_by_event_name SUM_NUMBER_OF_BYTES_ALLOC 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of bytes allocated. NEVER NULL
-def performance_schema memory_summary_by_user_by_event_name SUM_NUMBER_OF_BYTES_FREE 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of bytes freed NEVER NULL
-def performance_schema memory_summary_by_user_by_event_name LOW_COUNT_USED 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Lowest number of allocated blocks (lowest value of CURRENT_COUNT_USED). NEVER NULL
-def performance_schema memory_summary_by_user_by_event_name CURRENT_COUNT_USED 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Currently allocated blocks that have not been freed (COUNT_ALLOC minus COUNT_FREE). NEVER NULL
-def performance_schema memory_summary_by_user_by_event_name HIGH_COUNT_USED 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Highest number of allocated blocks (highest value of CURRENT_COUNT_USED). NEVER NULL
-def performance_schema memory_summary_by_user_by_event_name LOW_NUMBER_OF_BYTES_USED 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Lowest number of bytes used. NEVER NULL
-def performance_schema memory_summary_by_user_by_event_name CURRENT_NUMBER_OF_BYTES_USED 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Current number of bytes used (total allocated minus total freed). NEVER NULL
-def performance_schema memory_summary_by_user_by_event_name HIGH_NUMBER_OF_BYTES_USED 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Highest number of bytes used. NEVER NULL
-def performance_schema memory_summary_global_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL
-def performance_schema memory_summary_global_by_event_name COUNT_ALLOC 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of allocations to memory. NEVER NULL
-def performance_schema memory_summary_global_by_event_name COUNT_FREE 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of attempts to free the allocated memory. NEVER NULL
-def performance_schema memory_summary_global_by_event_name SUM_NUMBER_OF_BYTES_ALLOC 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of bytes allocated. NEVER NULL
-def performance_schema memory_summary_global_by_event_name SUM_NUMBER_OF_BYTES_FREE 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of bytes freed NEVER NULL
-def performance_schema memory_summary_global_by_event_name LOW_COUNT_USED 6 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Lowest number of allocated blocks (lowest value of CURRENT_COUNT_USED). NEVER NULL
-def performance_schema memory_summary_global_by_event_name CURRENT_COUNT_USED 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Currently allocated blocks that have not been freed (COUNT_ALLOC minus COUNT_FREE). NEVER NULL
-def performance_schema memory_summary_global_by_event_name HIGH_COUNT_USED 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Highest number of allocated blocks (highest value of CURRENT_COUNT_USED). NEVER NULL
-def performance_schema memory_summary_global_by_event_name LOW_NUMBER_OF_BYTES_USED 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Lowest number of bytes used. NEVER NULL
-def performance_schema memory_summary_global_by_event_name CURRENT_NUMBER_OF_BYTES_USED 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Current number of bytes used (total allocated minus total freed). NEVER NULL
-def performance_schema memory_summary_global_by_event_name HIGH_NUMBER_OF_BYTES_USED 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Highest number of bytes used. NEVER NULL
-def performance_schema metadata_locks OBJECT_TYPE 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Object type. One of BACKUP, COMMIT, EVENT, FUNCTION, GLOBAL, LOCKING SERVICE, PROCEDURE, SCHEMA, TABLE, TABLESPACE, TRIGGER (unused) or USER LEVEL LOCK. NEVER NULL
-def performance_schema metadata_locks OBJECT_SCHEMA 2 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Object schema. NEVER NULL
-def performance_schema metadata_locks OBJECT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Object name. NEVER NULL
-def performance_schema metadata_locks OBJECT_INSTANCE_BEGIN 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the instrumented object. NEVER NULL
-def performance_schema metadata_locks LOCK_TYPE 5 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select,insert,update,references Lock type. One of BACKUP_FTWRL1, BACKUP_START, BACKUP_TRANS_DML, EXCLUSIVE, INTENTION_EXCLUSIVE, SHARED, SHARED_HIGH_PRIO, SHARED_NO_READ_WRITE, SHARED_NO_WRITE, SHARED_READ, SHARED_UPGRADABLE or SHARED_WRITE. NEVER NULL
-def performance_schema metadata_locks LOCK_DURATION 6 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select,insert,update,references Lock duration. One of EXPLICIT (locks released by explicit action, for example a global lock acquired with FLUSH TABLES WITH READ LOCK) , STATEMENT (locks implicitly released at statement end) or TRANSACTION (locks implicitly released at transaction end). NEVER NULL
-def performance_schema metadata_locks LOCK_STATUS 7 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select,insert,update,references Lock status. One of GRANTED, KILLED, PENDING, POST_RELEASE_NOTIFY, PRE_ACQUIRE_NOTIFY, TIMEOUT or VICTIM. NEVER NULL
-def performance_schema metadata_locks SOURCE 8 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Source file containing the instrumented code that produced the event, as well as the line number where the instrumentation occurred. This allows one to examine the source code involved. NEVER NULL
-def performance_schema metadata_locks OWNER_THREAD_ID 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread that requested the lock. NEVER NULL
-def performance_schema metadata_locks OWNER_EVENT_ID 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Event that requested the lock. NEVER NULL
-def performance_schema mutex_instances NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Instrument name associated with the mutex. NEVER NULL
-def performance_schema mutex_instances OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Memory address of the instrumented mutex. NEVER NULL
-def performance_schema mutex_instances LOCKED_BY_THREAD_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The THREAD_ID of the locking thread if a thread has a mutex locked, otherwise NULL. NEVER NULL
-def performance_schema objects_summary_global_by_type OBJECT_TYPE 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Groups records together with OBJECT_SCHEMA and OBJECT_NAME. NEVER NULL
-def performance_schema objects_summary_global_by_type OBJECT_SCHEMA 2 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Groups records together with OBJECT_TYPE and OBJECT_NAME. NEVER NULL
-def performance_schema objects_summary_global_by_type OBJECT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Groups records together with OBJECT_SCHEMA and OBJECT_TYPE. NEVER NULL
-def performance_schema objects_summary_global_by_type COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
-def performance_schema objects_summary_global_by_type SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
-def performance_schema objects_summary_global_by_type MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema objects_summary_global_by_type AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
-def performance_schema objects_summary_global_by_type MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema performance_timers TIMER_NAME 1 NULL NO enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') select,insert,update,references Time name, used in the setup_timers table. NEVER NULL
-def performance_schema performance_timers TIMER_FREQUENCY 2 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of timer units per second. Dependent on the processor speed. NEVER NULL
-def performance_schema performance_timers TIMER_RESOLUTION 3 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of timer units by which timed values increase each time. NEVER NULL
-def performance_schema performance_timers TIMER_OVERHEAD 4 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Minimum timer overhead, determined during initialization by calling the timer 20 times and selecting the smallest value. Total overhead will be at least double this, as the timer is called at the beginning and end of each timed event. NEVER NULL
-def performance_schema prepared_statements_instances OBJECT_INSTANCE_BEGIN 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The address in memory of the instrumented prepared statement. NEVER NULL
-def performance_schema prepared_statements_instances STATEMENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The internal statement ID assigned by the server. NEVER NULL
-def performance_schema prepared_statements_instances STATEMENT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references For the binary protocol, this column is NULL. For the text protocol, this column is the external statement name assigned by the user. NEVER NULL
-def performance_schema prepared_statements_instances SQL_TEXT 4 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references The prepared statement text, with ? placeholder markers. NEVER NULL
-def performance_schema prepared_statements_instances OWNER_THREAD_ID 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Event thread id that created the prepared statement. NEVER NULL
-def performance_schema prepared_statements_instances OWNER_EVENT_ID 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Event id that created the prepared statement. NEVER NULL
-def performance_schema prepared_statements_instances OWNER_OBJECT_TYPE 7 NULL YES enum 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('EVENT','FUNCTION','PROCEDURE','TABLE','TRIGGER') select,insert,update,references NULL for a prepared statement created by a client session. Type of the stored program that created the prepared statement. NEVER NULL
-def performance_schema prepared_statements_instances OWNER_OBJECT_SCHEMA 8 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NULL for a prepared statement created by a client session. Schema of the stored program that created the prepared statement. NEVER NULL
-def performance_schema prepared_statements_instances OWNER_OBJECT_NAME 9 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NULL for a prepared statement created by a client session. Name of the stored program that created the prepared statement. NEVER NULL
-def performance_schema prepared_statements_instances TIMER_PREPARE 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The time spent executing the statement preparation itself. NEVER NULL
-def performance_schema prepared_statements_instances COUNT_REPREPARE 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of times the statement was reprepared internally. NEVER NULL
-def performance_schema prepared_statements_instances COUNT_EXECUTE 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total times the prepared statement was executed. NEVER NULL
-def performance_schema prepared_statements_instances SUM_TIMER_EXECUTE 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total time spent executing all prepared statements. NEVER NULL
-def performance_schema prepared_statements_instances MIN_TIMER_EXECUTE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum time spent executing any of the prepared statements. NEVER NULL
-def performance_schema prepared_statements_instances AVG_TIMER_EXECUTE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average time spent executing any of the prepared statements. NEVER NULL
-def performance_schema prepared_statements_instances MAX_TIMER_EXECUTE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum time spent executing any of the prepared statements. NEVER NULL
-def performance_schema prepared_statements_instances SUM_LOCK_TIME 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total time spent (in picoseconds) waiting for table locks for the prepared statements. NEVER NULL
-def performance_schema prepared_statements_instances SUM_ERRORS 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of errors that occurend for the prepared statements. NEVER NULL
-def performance_schema prepared_statements_instances SUM_WARNINGS 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of warnings that occurend for the prepared statements. NEVER NULL
-def performance_schema prepared_statements_instances SUM_ROWS_AFFECTED 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of affected rows by the prepared statements. NEVER NULL
-def performance_schema prepared_statements_instances SUM_ROWS_SENT 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of rows returned by the prepared statements. NEVER NULL
-def performance_schema prepared_statements_instances SUM_ROWS_EXAMINED 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of rows examined by the prepared statements. NEVER NULL
-def performance_schema prepared_statements_instances SUM_CREATED_TMP_DISK_TABLES 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of on-disk temporary tables created by the prepared statements. NEVER NULL
-def performance_schema prepared_statements_instances SUM_CREATED_TMP_TABLES 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of in-memory temporary tables created by the prepared statements. NEVER NULL
-def performance_schema prepared_statements_instances SUM_SELECT_FULL_JOIN 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of full joins executed by the prepared statements. NEVER NULL
-def performance_schema prepared_statements_instances SUM_SELECT_FULL_RANGE_JOIN 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of range search joins executed by the prepared statements. NEVER NULL
-def performance_schema prepared_statements_instances SUM_SELECT_RANGE 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of joins that used ranges on the first table executed by the prepared statements. NEVER NULL
-def performance_schema prepared_statements_instances SUM_SELECT_RANGE_CHECK 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of joins that check for key usage after each row executed by the prepared statements. NEVER NULL
-def performance_schema prepared_statements_instances SUM_SELECT_SCAN 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of joins that did a full scan of the first table executed by the prepared statements. NEVER NULL
-def performance_schema prepared_statements_instances SUM_SORT_MERGE_PASSES 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of merge passes that the sort algorithm has had to do for the prepared statements. NEVER NULL
-def performance_schema prepared_statements_instances SUM_SORT_RANGE 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of sorts that were done using ranges for the prepared statements. NEVER NULL
-def performance_schema prepared_statements_instances SUM_SORT_ROWS 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of sorted rows that were sorted by the prepared statements. NEVER NULL
-def performance_schema prepared_statements_instances SUM_SORT_SCAN 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of sorts that were done by scanning the table by the prepared statements. NEVER NULL
-def performance_schema prepared_statements_instances SUM_NO_INDEX_USED 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of statements that performed a table scan without using an index. NEVER NULL
-def performance_schema prepared_statements_instances SUM_NO_GOOD_INDEX_USED 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of statements where no good index was found. NEVER NULL
-def performance_schema replication_applier_configuration CHANNEL_NAME 1 NULL NO varchar 256 768 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(256) select,insert,update,references Replication channel name. NEVER NULL
-def performance_schema replication_applier_configuration DESIRED_DELAY 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Target number of seconds the replica should be delayed to the master. NEVER NULL
-def performance_schema replication_applier_status CHANNEL_NAME 1 NULL NO varchar 256 768 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(256) select,insert,update,references The replication channel name. NEVER NULL
-def performance_schema replication_applier_status SERVICE_STATE 2 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('ON','OFF') select,insert,update,references Shows ON when the replication channel's applier threads are active or idle, OFF means that the applier threads are not active. NEVER NULL
-def performance_schema replication_applier_status REMAINING_DELAY 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Seconds the replica needs to wait to reach the desired delay from master. NEVER NULL
-def performance_schema replication_applier_status COUNT_TRANSACTIONS_RETRIES 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of retries that were made because the replication SQL thread failed to apply a transaction. NEVER NULL
-def performance_schema replication_applier_status_by_coordinator CHANNEL_NAME 1 NULL NO varchar 256 768 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(256) select,insert,update,references Replication channel name. NEVER NULL
-def performance_schema replication_applier_status_by_coordinator THREAD_ID 2 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The SQL/coordinator thread ID. NEVER NULL
-def performance_schema replication_applier_status_by_coordinator SERVICE_STATE 3 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('ON','OFF') select,insert,update,references ON (thread exists and is active or idle) or OFF (thread no longer exists). NEVER NULL
-def performance_schema replication_applier_status_by_coordinator LAST_ERROR_NUMBER 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Last error number that caused the SQL/coordinator thread to stop. NEVER NULL
-def performance_schema replication_applier_status_by_coordinator LAST_ERROR_MESSAGE 5 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select,insert,update,references Last error message that caused the SQL/coordinator thread to stop. NEVER NULL
-def performance_schema replication_applier_status_by_coordinator LAST_ERROR_TIMESTAMP 6 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references Timestamp that shows when the most recent SQL/coordinator error occurred. NEVER NULL
-def performance_schema replication_applier_status_by_coordinator LAST_SEEN_TRANSACTION 7 NULL NO char 57 171 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(57) select,insert,update,references The transaction the worker has last seen. NEVER NULL
-def performance_schema replication_applier_status_by_coordinator LAST_TRANS_RETRY_COUNT 8 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Total number of retries attempted by last transaction. NEVER NULL
-def performance_schema replication_applier_status_by_worker CHANNEL_NAME 1 NULL NO varchar 256 768 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(256) select,insert,update,references Name of replication channel through which the transaction is received. NEVER NULL
-def performance_schema replication_applier_status_by_worker THREAD_ID 2 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread_Id as displayed in the performance_schema.threads table for thread with name 'thread/sql/rpl_parallel_thread'. THREAD_ID will be NULL when worker threads are stopped due to error/force stop. NEVER NULL
-def performance_schema replication_applier_status_by_worker SERVICE_STATE 3 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('ON','OFF') select,insert,update,references Whether or not the thread is running. NEVER NULL
-def performance_schema replication_applier_status_by_worker LAST_SEEN_TRANSACTION 4 NULL NO char 57 171 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(57) select,insert,update,references Last GTID executed by worker NEVER NULL
-def performance_schema replication_applier_status_by_worker LAST_ERROR_NUMBER 5 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Last Error that occurred on a particular worker. NEVER NULL
-def performance_schema replication_applier_status_by_worker LAST_ERROR_MESSAGE 6 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select,insert,update,references Last error specific message. NEVER NULL
-def performance_schema replication_applier_status_by_worker LAST_ERROR_TIMESTAMP 7 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references Time stamp of last error. NEVER NULL
-def performance_schema replication_applier_status_by_worker WORKER_IDLE_TIME 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total idle time in seconds that the worker thread has spent waiting for work from SQL thread. NEVER NULL
-def performance_schema replication_applier_status_by_worker LAST_TRANS_RETRY_COUNT 9 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Total number of retries attempted by last transaction. NEVER NULL
-def performance_schema replication_connection_configuration CHANNEL_NAME 1 NULL NO varchar 256 768 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(256) select,insert,update,references The replication channel used. NEVER NULL
-def performance_schema replication_connection_configuration HOST 2 NULL NO char 60 180 NULL NULL NULL utf8mb3 utf8mb3_bin char(60) select,insert,update,references The host name of the source that the replica is connected to. NEVER NULL
-def performance_schema replication_connection_configuration PORT 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references The port used to connect to the source. NEVER NULL
-def performance_schema replication_connection_configuration USER 4 NULL NO char 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin char(32) select,insert,update,references The user name of the replication user account used to connect to the source. NEVER NULL
-def performance_schema replication_connection_configuration USING_GTID 5 NULL NO enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('NO','CURRENT_POS','SLAVE_POS') select,insert,update,references Whether replication is using GTIDs or not NEVER NULL
-def performance_schema replication_connection_configuration SSL_ALLOWED 6 NULL NO enum 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO','IGNORED') select,insert,update,references Whether SSL is allowed for the replica connection. NEVER NULL
-def performance_schema replication_connection_configuration SSL_CA_FILE 7 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references Path to the file that contains one or more certificates for trusted Certificate Authorities (CA) to use for TLS. NEVER NULL
-def performance_schema replication_connection_configuration SSL_CA_PATH 8 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references Path to a directory that contains one or more PEM files that contain X509 certificates for a trusted Certificate Authority (CA) to use for TLS. NEVER NULL
-def performance_schema replication_connection_configuration SSL_CERTIFICATE 9 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references Path to the certificate used to authenticate the master. NEVER NULL
-def performance_schema replication_connection_configuration SSL_CIPHER 10 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references Which cipher is used for encription. NEVER NULL
-def performance_schema replication_connection_configuration SSL_KEY 11 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references Path to the private key used for TLS. NEVER NULL
-def performance_schema replication_connection_configuration SSL_VERIFY_SERVER_CERTIFICATE 12 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references Whether the server certificate is verified as part of the SSL connection NEVER NULL
-def performance_schema replication_connection_configuration SSL_CRL_FILE 13 NULL NO varchar 255 765 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(255) select,insert,update,references Path to the PEM file containing one or more revoked X.509 certificates. NEVER NULL
-def performance_schema replication_connection_configuration SSL_CRL_PATH 14 NULL NO varchar 255 765 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(255) select,insert,update,references PATH to a folder containing PEM files containing one or more revoked X.509 certificates. NEVER NULL
-def performance_schema replication_connection_configuration CONNECTION_RETRY_INTERVAL 15 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references The number of seconds between connect retries. NEVER NULL
-def performance_schema replication_connection_configuration CONNECTION_RETRY_COUNT 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of times the replica can attempt to reconnect to the source in the event of a lost connection. NEVER NULL
-def performance_schema replication_connection_configuration HEARTBEAT_INTERVAL 17 NULL NO double NULL NULL 10 3 NULL NULL NULL double(10,3) unsigned select,insert,update,references Number of seconds after which a heartbeat will be sent. NEVER NULL
-def performance_schema replication_connection_configuration IGNORE_SERVER_IDS 18 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references Binary log events from servers (ids) to ignore. NEVER NULL
-def performance_schema replication_connection_configuration REPL_DO_DOMAIN_IDS 19 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references Only apply binary logs from these domain ids. NEVER NULL
-def performance_schema replication_connection_configuration REPL_IGNORE_DOMAIN_IDS 20 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references Binary log events from domains to ignore. NEVER NULL
-def performance_schema rwlock_instances NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Instrument name associated with the read write lock NEVER NULL
-def performance_schema rwlock_instances OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the instrumented lock NEVER NULL
-def performance_schema rwlock_instances WRITE_LOCKED_BY_THREAD_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references THREAD_ID of the locking thread if locked in write (exclusive) mode, otherwise NULL. NEVER NULL
-def performance_schema rwlock_instances READ_LOCKED_BY_COUNT 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Count of current read locks held NEVER NULL
-def performance_schema session_account_connect_attrs PROCESSLIST_ID 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Session connection identifier. NEVER NULL
-def performance_schema session_account_connect_attrs ATTR_NAME 2 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(32) select,insert,update,references Attribute name. NEVER NULL
-def performance_schema session_account_connect_attrs ATTR_VALUE 3 NULL YES varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(1024) select,insert,update,references Attribute value. NEVER NULL
-def performance_schema session_account_connect_attrs ORDINAL_POSITION 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Order in which attribute was added to the connection attributes. NEVER NULL
-def performance_schema session_connect_attrs PROCESSLIST_ID 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Session connection identifier. NEVER NULL
-def performance_schema session_connect_attrs ATTR_NAME 2 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(32) select,insert,update,references Attribute name. NEVER NULL
-def performance_schema session_connect_attrs ATTR_VALUE 3 NULL YES varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(1024) select,insert,update,references Attribute value. NEVER NULL
-def performance_schema session_connect_attrs ORDINAL_POSITION 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Order in which attribute was added to the connection attributes. NEVER NULL
-def performance_schema session_status VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The session status variable name. NEVER NULL
-def performance_schema session_status VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select,insert,update,references The session status variable value. NEVER NULL
-def performance_schema setup_actors HOST 1 '%' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) select,insert,update,references Host name, either a literal, or the % wildcard representing any host. NEVER NULL
-def performance_schema setup_actors USER 2 '%' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references User name, either a literal or the % wildcard representing any name. NEVER NULL
-def performance_schema setup_actors ROLE 3 '%' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references Unused NEVER NULL
-def performance_schema setup_actors ENABLED 4 'YES' NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references Whether to enable instrumentation for foreground threads matched by the row. NEVER NULL
-def performance_schema setup_actors HISTORY 5 'YES' NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references Whether to log historical events for foreground threads matched by the row. NEVER NULL
-def performance_schema setup_consumers NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Consumer name NEVER NULL
-def performance_schema setup_consumers ENABLED 2 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references YES or NO for whether or not the consumer is enabled. You can modify this column to ensure that event information is added, or is not added. NEVER NULL
-def performance_schema setup_instruments NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Instrument name NEVER NULL
-def performance_schema setup_instruments ENABLED 2 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references Whether or not the instrument is enabled. It can be disabled, and the instrument will produce no events. NEVER NULL
-def performance_schema setup_instruments TIMED 3 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references Whether or not the instrument is timed. It can be set, but if disabled, events produced by the instrument will have NULL values for the corresponding TIMER_START, TIMER_END, and TIMER_WAIT values. NEVER NULL
-def performance_schema setup_objects OBJECT_TYPE 1 'TABLE' NO enum 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('EVENT','FUNCTION','PROCEDURE','TABLE','TRIGGER') select,insert,update,references Type of object to instrument. NEVER NULL
-def performance_schema setup_objects OBJECT_SCHEMA 2 '%' YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Schema containing the object, either the literal or % for any schema. NEVER NULL
-def performance_schema setup_objects OBJECT_NAME 3 '%' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name of the instrumented object, either the literal or % for any object. NEVER NULL
-def performance_schema setup_objects ENABLED 4 'YES' NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references Whether the object's events are instrumented or not. Can be disabled, in which case monitoring is not enabled for those objects. NEVER NULL
-def performance_schema setup_objects TIMED 5 'YES' NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references Whether the object's events are timed or not. Can be modified. NEVER NULL
-def performance_schema setup_timers NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Type of instrument the timer is used for. NEVER NULL
-def performance_schema setup_timers TIMER_NAME 2 NULL NO enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') select,insert,update,references Timer applying to the instrument type. Can be modified. NEVER NULL
-def performance_schema socket_instances EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references NAME from the setup_instruments table, and the name of the wait/io/socket/* instrument that produced the event. NEVER NULL
-def performance_schema socket_instances OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Memory address of the object. NEVER NULL
-def performance_schema socket_instances THREAD_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread identifier that the server assigns to each socket. NEVER NULL
-def performance_schema socket_instances SOCKET_ID 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references The socket's internal file handle. NEVER NULL
-def performance_schema socket_instances IP 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Client IP address. Blank for Unix socket file, otherwise an IPv4 or IPv6 address. Together with the PORT identifies the connection. NEVER NULL
-def performance_schema socket_instances PORT 6 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references TCP/IP port number, from 0 to 65535. Together with the IP identifies the connection. NEVER NULL
-def performance_schema socket_instances STATE 7 NULL NO enum 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('IDLE','ACTIVE') select,insert,update,references Socket status, either IDLE if waiting to receive a request from a client, or ACTIVE NEVER NULL
-def performance_schema socket_summary_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Socket instrument. NEVER NULL
-def performance_schema socket_summary_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
-def performance_schema socket_summary_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
-def performance_schema socket_summary_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema socket_summary_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
-def performance_schema socket_summary_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema socket_summary_by_event_name COUNT_READ 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all read operations, including RECV, RECVFROM, and RECVMSG. NEVER NULL
-def performance_schema socket_summary_by_event_name SUM_TIMER_READ 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all read operations that are timed. NEVER NULL
-def performance_schema socket_summary_by_event_name MIN_TIMER_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all read operations that are timed. NEVER NULL
-def performance_schema socket_summary_by_event_name AVG_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all read operations that are timed. NEVER NULL
-def performance_schema socket_summary_by_event_name MAX_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all read operations that are timed. NEVER NULL
-def performance_schema socket_summary_by_event_name SUM_NUMBER_OF_BYTES_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Bytes read by read operations. NEVER NULL
-def performance_schema socket_summary_by_event_name COUNT_WRITE 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all write operations, including SEND, SENDTO, and SENDMSG. NEVER NULL
-def performance_schema socket_summary_by_event_name SUM_TIMER_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all write operations that are timed. NEVER NULL
-def performance_schema socket_summary_by_event_name MIN_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all write operations that are timed. NEVER NULL
-def performance_schema socket_summary_by_event_name AVG_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all write operations that are timed. NEVER NULL
-def performance_schema socket_summary_by_event_name MAX_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all write operations that are timed. NEVER NULL
-def performance_schema socket_summary_by_event_name SUM_NUMBER_OF_BYTES_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Bytes written by write operations. NEVER NULL
-def performance_schema socket_summary_by_event_name COUNT_MISC 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all miscellaneous operations not counted above, including CONNECT, LISTEN, ACCEPT, CLOSE, and SHUTDOWN. NEVER NULL
-def performance_schema socket_summary_by_event_name SUM_TIMER_MISC 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all miscellaneous operations that are timed. NEVER NULL
-def performance_schema socket_summary_by_event_name MIN_TIMER_MISC 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all miscellaneous operations that are timed. NEVER NULL
-def performance_schema socket_summary_by_event_name AVG_TIMER_MISC 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all miscellaneous operations that are timed. NEVER NULL
-def performance_schema socket_summary_by_event_name MAX_TIMER_MISC 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all miscellaneous operations that are timed. NEVER NULL
-def performance_schema socket_summary_by_instance EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Socket instrument. NEVER NULL
-def performance_schema socket_summary_by_instance OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory. NEVER NULL
-def performance_schema socket_summary_by_instance COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL
-def performance_schema socket_summary_by_instance SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
-def performance_schema socket_summary_by_instance MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema socket_summary_by_instance AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
-def performance_schema socket_summary_by_instance MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema socket_summary_by_instance COUNT_READ 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all read operations, including RECV, RECVFROM, and RECVMSG. NEVER NULL
-def performance_schema socket_summary_by_instance SUM_TIMER_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all read operations that are timed. NEVER NULL
-def performance_schema socket_summary_by_instance MIN_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all read operations that are timed. NEVER NULL
-def performance_schema socket_summary_by_instance AVG_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all read operations that are timed. NEVER NULL
-def performance_schema socket_summary_by_instance MAX_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all read operations that are timed. NEVER NULL
-def performance_schema socket_summary_by_instance SUM_NUMBER_OF_BYTES_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Bytes read by read operations. NEVER NULL
-def performance_schema socket_summary_by_instance COUNT_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all write operations, including SEND, SENDTO, and SENDMSG. NEVER NULL
-def performance_schema socket_summary_by_instance SUM_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all write operations that are timed. NEVER NULL
-def performance_schema socket_summary_by_instance MIN_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all write operations that are timed. NEVER NULL
-def performance_schema socket_summary_by_instance AVG_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all write operations that are timed. NEVER NULL
-def performance_schema socket_summary_by_instance MAX_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all write operations that are timed. NEVER NULL
-def performance_schema socket_summary_by_instance SUM_NUMBER_OF_BYTES_WRITE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Bytes written by write operations. NEVER NULL
-def performance_schema socket_summary_by_instance COUNT_MISC 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all miscellaneous operations not counted above, including CONNECT, LISTEN, ACCEPT, CLOSE, and SHUTDOWN. NEVER NULL
-def performance_schema socket_summary_by_instance SUM_TIMER_MISC 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all miscellaneous operations that are timed. NEVER NULL
-def performance_schema socket_summary_by_instance MIN_TIMER_MISC 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all miscellaneous operations that are timed. NEVER NULL
-def performance_schema socket_summary_by_instance AVG_TIMER_MISC 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all miscellaneous operations that are timed. NEVER NULL
-def performance_schema socket_summary_by_instance MAX_TIMER_MISC 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all miscellaneous operations that are timed. NEVER NULL
-def performance_schema status_by_account USER 1 NULL YES char 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin char(32) select,insert,update,references User for which the status variable is reported. NEVER NULL
-def performance_schema status_by_account HOST 2 NULL YES char 60 180 NULL NULL NULL utf8mb3 utf8mb3_bin char(60) select,insert,update,references Host for which the status variable is reported. NEVER NULL
-def performance_schema status_by_account VARIABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Status variable name. NEVER NULL
-def performance_schema status_by_account VARIABLE_VALUE 4 NULL YES varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select,insert,update,references Aggregated status variable value. NEVER NULL
-def performance_schema status_by_host HOST 1 NULL YES char 60 180 NULL NULL NULL utf8mb3 utf8mb3_bin char(60) select,insert,update,references Host for which the status variable is reported. NEVER NULL
-def performance_schema status_by_host VARIABLE_NAME 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Status variable name. NEVER NULL
-def performance_schema status_by_host VARIABLE_VALUE 3 NULL YES varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select,insert,update,references Aggregated status variable value. NEVER NULL
-def performance_schema status_by_thread THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The thread identifier of the session in which the status variable is defined. NEVER NULL
-def performance_schema status_by_thread VARIABLE_NAME 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Status variable name. NEVER NULL
-def performance_schema status_by_thread VARIABLE_VALUE 3 NULL YES varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select,insert,update,references Aggregated status variable value. NEVER NULL
-def performance_schema status_by_user USER 1 NULL YES char 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin char(32) select,insert,update,references User for which the status variable is reported. NEVER NULL
-def performance_schema status_by_user VARIABLE_NAME 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Status variable name. NEVER NULL
-def performance_schema status_by_user VARIABLE_VALUE 3 NULL YES varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select,insert,update,references Aggregated status variable value. NEVER NULL
-def performance_schema table_handles OBJECT_TYPE 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The table opened by a table handle. NEVER NULL
-def performance_schema table_handles OBJECT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The schema that contains the object. NEVER NULL
-def performance_schema table_handles OBJECT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The name of the instrumented object. NEVER NULL
-def performance_schema table_handles OBJECT_INSTANCE_BEGIN 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The table handle address in memory. NEVER NULL
-def performance_schema table_handles OWNER_THREAD_ID 5 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The thread owning the table handle. NEVER NULL
-def performance_schema table_handles OWNER_EVENT_ID 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The event which caused the table handle to be opened. NEVER NULL
-def performance_schema table_handles INTERNAL_LOCK 7 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The table lock used at the SQL level. NEVER NULL
-def performance_schema table_handles EXTERNAL_LOCK 8 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The table lock used at the storage engine level. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage OBJECT_TYPE 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references TABLE in the case of all indexes. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage OBJECT_SCHEMA 2 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Schema name. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage OBJECT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Table name. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage INDEX_NAME 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Index name, or PRIMARY for the primary index, NULL for no index (inserts are counted in this case). NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage COUNT_STAR 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events and the sum of the x_READ and x_WRITE columns. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_WAIT 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage COUNT_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all read operations, and the sum of the equivalent x_FETCH columns. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all read operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all read operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all read operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_READ 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all read operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage COUNT_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all write operations, and the sum of the equivalent x_INSERT, x_UPDATE and x_DELETE columns. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all write operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all write operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all write operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_WRITE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all write operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage COUNT_FETCH 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all fetch operations. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_FETCH 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all fetch operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_FETCH 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all fetch operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_FETCH 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all fetch operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_FETCH 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all fetch operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage COUNT_INSERT 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all insert operations. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_INSERT 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all insert operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_INSERT 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all insert operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_INSERT 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all insert operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_INSERT 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all insert operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage COUNT_UPDATE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all update operations. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_UPDATE 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all update operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_UPDATE 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all update operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_UPDATE 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all update operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_UPDATE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all update operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage COUNT_DELETE 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all delete operations. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_DELETE 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all delete operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_DELETE 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all delete operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_DELETE 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all delete operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_DELETE 39 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all delete operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table OBJECT_TYPE 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Since this table records waits by table, always set to TABLE. NEVER NULL
-def performance_schema table_io_waits_summary_by_table OBJECT_SCHEMA 2 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Schema name. NEVER NULL
-def performance_schema table_io_waits_summary_by_table OBJECT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Table name. NEVER NULL
-def performance_schema table_io_waits_summary_by_table COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events and the sum of the x_READ and x_WRITE columns. NEVER NULL
-def performance_schema table_io_waits_summary_by_table SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table COUNT_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all read operations, and the sum of the equivalent x_FETCH columns. NEVER NULL
-def performance_schema table_io_waits_summary_by_table SUM_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all read operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table MIN_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all read operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table AVG_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all read operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table MAX_TIMER_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all read operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table COUNT_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all write operations, and the sum of the equivalent x_INSERT, x_UPDATE and x_DELETE columns. NEVER NULL
-def performance_schema table_io_waits_summary_by_table SUM_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all write operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table MIN_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all write operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table AVG_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all write operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table MAX_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all write operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table COUNT_FETCH 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all fetch operations. NEVER NULL
-def performance_schema table_io_waits_summary_by_table SUM_TIMER_FETCH 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all fetch operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table MIN_TIMER_FETCH 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all fetch operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table AVG_TIMER_FETCH 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all fetch operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table MAX_TIMER_FETCH 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all fetch operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table COUNT_INSERT 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all insert operations. NEVER NULL
-def performance_schema table_io_waits_summary_by_table SUM_TIMER_INSERT 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all insert operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table MIN_TIMER_INSERT 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all insert operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table AVG_TIMER_INSERT 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all insert operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table MAX_TIMER_INSERT 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all insert operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table COUNT_UPDATE 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all update operations. NEVER NULL
-def performance_schema table_io_waits_summary_by_table SUM_TIMER_UPDATE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all update operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table MIN_TIMER_UPDATE 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all update operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table AVG_TIMER_UPDATE 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all update operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table MAX_TIMER_UPDATE 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all update operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table COUNT_DELETE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all delete operations. NEVER NULL
-def performance_schema table_io_waits_summary_by_table SUM_TIMER_DELETE 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all delete operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table MIN_TIMER_DELETE 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all delete operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table AVG_TIMER_DELETE 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all delete operations that are timed. NEVER NULL
-def performance_schema table_io_waits_summary_by_table MAX_TIMER_DELETE 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all delete operations that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table OBJECT_TYPE 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Since this table records waits by table, always set to TABLE. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table OBJECT_SCHEMA 2 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Schema name. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table OBJECT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Table name. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events and the sum of the x_READ and x_WRITE columns. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all read operations, and the sum of the equivalent x_READ_NORMAL, x_READ_WITH_SHARED_LOCKS, x_READ_HIGH_PRIORITY and x_READ_NO_INSERT columns. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all read operations that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all read operations that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all read operations that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all read operations that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all write operations, and the sum of the equivalent x_WRITE_ALLOW_WRITE, x_WRITE_CONCURRENT_INSERT, x_WRITE_DELAYED, x_WRITE_LOW_PRIORITY and x_WRITE_NORMAL columns. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all write operations that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all write operations that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all write operations that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all write operations that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_READ_NORMAL 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal read normal locks. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_NORMAL 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal read normal locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_NORMAL 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal read normal locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_NORMAL 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal read normal locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_NORMAL 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal read normal locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_READ_WITH_SHARED_LOCKS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal read with shared locks. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_WITH_SHARED_LOCKS 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal read with shared locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_WITH_SHARED_LOCKS 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal read with shared locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_WITH_SHARED_LOCKS 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal read with shared locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_WITH_SHARED_LOCKS 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal read with shared locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_READ_HIGH_PRIORITY 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal read high priority locks. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_HIGH_PRIORITY 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal read high priority locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_HIGH_PRIORITY 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal read high priority locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_HIGH_PRIORITY 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal read high priority locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_HIGH_PRIORITY 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal read high priority locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_READ_NO_INSERT 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal read no insert locks. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_NO_INSERT 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal read no insert locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_NO_INSERT 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal read no insert locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_NO_INSERT 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal read no insert locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_NO_INSERT 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal read no insert locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_READ_EXTERNAL 39 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all external read locks. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_EXTERNAL 40 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all external read locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_EXTERNAL 41 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all external read locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_EXTERNAL 42 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all external read locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_EXTERNAL 43 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all external read locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_ALLOW_WRITE 44 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal read normal locks. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_ALLOW_WRITE 45 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal write allow write locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_ALLOW_WRITE 46 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal write allow write locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_ALLOW_WRITE 47 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal write allow write locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_ALLOW_WRITE 48 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal write allow write locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_CONCURRENT_INSERT 49 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal concurrent insert write locks. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_CONCURRENT_INSERT 50 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal concurrent insert write locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_CONCURRENT_INSERT 51 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal concurrent insert write locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_CONCURRENT_INSERT 52 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal concurrent insert write locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_CONCURRENT_INSERT 53 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal concurrent insert write locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_DELAYED 54 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal write delayed locks. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_DELAYED 55 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal write delayed locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_DELAYED 56 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal write delayed locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_DELAYED 57 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal write delayed locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_DELAYED 58 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal write delayed locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_LOW_PRIORITY 59 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal write low priority locks. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_LOW_PRIORITY 60 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal write low priority locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_LOW_PRIORITY 61 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal write low priority locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_LOW_PRIORITY 62 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal write low priority locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_LOW_PRIORITY 63 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal write low priority locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_NORMAL 64 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal write normal locks. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_NORMAL 65 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal write normal locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_NORMAL 66 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal write normal locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_NORMAL 67 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal write normal locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_NORMAL 68 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal write normal locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_EXTERNAL 69 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all external write locks. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_EXTERNAL 70 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all external write locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_EXTERNAL 71 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all external write locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_EXTERNAL 72 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all external write locks that are timed. NEVER NULL
-def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_EXTERNAL 73 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all external write locks that are timed. NEVER NULL
-def performance_schema threads THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references A unique thread identifier. NEVER NULL
-def performance_schema threads NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Name associated with the server's thread instrumentation code, for example thread/sql/main for the server's main() function, and thread/sql/one_connection for a user connection. NEVER NULL
-def performance_schema threads TYPE 3 NULL NO varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) select,insert,update,references FOREGROUND or BACKGROUND, depending on the thread type. User connection threads are FOREGROUND, internal server threads are BACKGROUND. NEVER NULL
-def performance_schema threads PROCESSLIST_ID 4 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The PROCESSLIST.ID value for threads displayed in the INFORMATION_SCHEMA.PROCESSLIST table, or 0 for background threads. Also corresponds with the CONNECTION_ID() return value for the thread. NEVER NULL
-def performance_schema threads PROCESSLIST_USER 5 NULL YES varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Foreground thread user, or NULL for a background thread. NEVER NULL
-def performance_schema threads PROCESSLIST_HOST 6 NULL YES varchar 255 765 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(255) select,insert,update,references Foreground thread host, or NULL for a background thread. NEVER NULL
-def performance_schema threads PROCESSLIST_DB 7 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Thread's default database, or NULL if none exists. NEVER NULL
-def performance_schema threads PROCESSLIST_COMMAND 8 NULL YES varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select,insert,update,references Type of command executed by the thread. These correspond to the the COM_xxx client/server protocol commands, and the Com_xxx status variables. See Thread Command Values. NEVER NULL
-def performance_schema threads PROCESSLIST_TIME 9 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Time in seconds the thread has been in its current state. NEVER NULL
-def performance_schema threads PROCESSLIST_STATE 10 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Action, event or state indicating what the thread is doing. NEVER NULL
-def performance_schema threads PROCESSLIST_INFO 11 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references Statement being executed by the thread, or NULL if a statement is not being executed. If a statement results in calling other statements, such as for a stored procedure, the innermost statement from the stored procedure is shown here. NEVER NULL
-def performance_schema threads PARENT_THREAD_ID 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references THREAD_ID of the parent thread, if any. Subthreads can for example be spawned as a result of INSERT DELAYED statements. NEVER NULL
-def performance_schema threads ROLE 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Unused. NEVER NULL
-def performance_schema threads INSTRUMENTED 14 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references YES or NO for Whether the thread is instrumented or not. For foreground threads, the initial value is determined by whether there's a user/host match in the setup_actors table. Subthreads are again matched, while for background threads, this will be set to YES by default. To monitor events that the thread executes, INSTRUMENTED must be YES and the thread_instrumentation consumer in the setup_consumers table must also be YES. NEVER NULL
-def performance_schema threads HISTORY 15 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references Whether to log historical events for the thread. NEVER NULL
-def performance_schema threads CONNECTION_TYPE 16 NULL YES varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select,insert,update,references The protocol used to establish the connection, or NULL for background threads. NEVER NULL
-def performance_schema threads THREAD_OS_ID 17 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The thread or task identifier as defined by the underlying operating system, if there is one. NEVER NULL
-def performance_schema users USER 1 NULL YES char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references The connection's client user name for the connection, or NULL if an internal thread. NEVER NULL
-def performance_schema users CURRENT_CONNECTIONS 2 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Current connections for the user. NEVER NULL
-def performance_schema users TOTAL_CONNECTIONS 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Total connections for the user. NEVER NULL
-def performance_schema user_variables_by_thread THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The thread identifier of the session in which the variable is defined. NEVER NULL
-def performance_schema user_variables_by_thread VARIABLE_NAME 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The variable name, without the leading @ character. NEVER NULL
-def performance_schema user_variables_by_thread VARIABLE_VALUE 3 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references The variable value NEVER NULL
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT IS_GENERATED GENERATION_EXPRESSION IS_SYSTEM_TIME_PERIOD_START IS_SYSTEM_TIME_PERIOD_END
+def performance_schema accounts USER 1 NULL YES char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references The connection's client user name for the connection, or NULL if an internal thread. NEVER NULL NO NO
+def performance_schema accounts HOST 2 NULL YES char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) select,insert,update,references The connection client's host name, or NULL if an internal thread. NEVER NULL NO NO
+def performance_schema accounts CURRENT_CONNECTIONS 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Current connections for the account. NEVER NULL NO NO
+def performance_schema accounts TOTAL_CONNECTIONS 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Total connections for the account. NEVER NULL NO NO
+def performance_schema cond_instances NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Client user name for the connection, or NULL if an internal thread. NEVER NULL NO NO
+def performance_schema cond_instances OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the instrumented condition. NEVER NULL NO NO
+def performance_schema events_stages_current THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL NO NO
+def performance_schema events_stages_current EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL NO NO
+def performance_schema events_stages_current END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL NO NO
+def performance_schema events_stages_current EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL NO NO
+def performance_schema events_stages_current SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL NO NO
+def performance_schema events_stages_current TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL NO NO
+def performance_schema events_stages_current TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL NO NO
+def performance_schema events_stages_current TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL NO NO
+def performance_schema events_stages_current WORK_COMPLETED 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units completed for the stage. NULL if the stage event progress is not instrumented. NEVER NULL NO NO
+def performance_schema events_stages_current WORK_ESTIMATED 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units expected for the stage. NULL if the stage event progress is not instrumented. NEVER NULL NO NO
+def performance_schema events_stages_current NESTING_EVENT_ID 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references EVENT_ID of event within which this event nests. NEVER NULL NO NO
+def performance_schema events_stages_current NESTING_EVENT_TYPE 12 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references Nesting event type. Either transaction, statement, stage or wait. NEVER NULL NO NO
+def performance_schema events_stages_history THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL NO NO
+def performance_schema events_stages_history EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL NO NO
+def performance_schema events_stages_history END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL NO NO
+def performance_schema events_stages_history EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL NO NO
+def performance_schema events_stages_history SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL NO NO
+def performance_schema events_stages_history TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL NO NO
+def performance_schema events_stages_history TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL NO NO
+def performance_schema events_stages_history TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL NO NO
+def performance_schema events_stages_history WORK_COMPLETED 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units completed for the stage. NULL if the stage event progress is not instrumented. NEVER NULL NO NO
+def performance_schema events_stages_history WORK_ESTIMATED 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units expected for the stage. NULL if the stage event progress is not instrumented. NEVER NULL NO NO
+def performance_schema events_stages_history NESTING_EVENT_ID 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references EVENT_ID of event within which this event nests. NEVER NULL NO NO
+def performance_schema events_stages_history NESTING_EVENT_TYPE 12 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references Nesting event type. Either transaction, statement, stage or wait. NEVER NULL NO NO
+def performance_schema events_stages_history_long THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL NO NO
+def performance_schema events_stages_history_long EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL NO NO
+def performance_schema events_stages_history_long END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL NO NO
+def performance_schema events_stages_history_long EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL NO NO
+def performance_schema events_stages_history_long SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL NO NO
+def performance_schema events_stages_history_long TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL NO NO
+def performance_schema events_stages_history_long TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL NO NO
+def performance_schema events_stages_history_long TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL NO NO
+def performance_schema events_stages_history_long WORK_COMPLETED 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units completed for the stage. NULL if the stage event progress is not instrumented. NEVER NULL NO NO
+def performance_schema events_stages_history_long WORK_ESTIMATED 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of work units expected for the stage. NULL if the stage event progress is not instrumented. NEVER NULL NO NO
+def performance_schema events_stages_history_long NESTING_EVENT_ID 11 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references EVENT_ID of event within which this event nests. NEVER NULL NO NO
+def performance_schema events_stages_history_long NESTING_EVENT_TYPE 12 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references Nesting event type. Either transaction, statement, stage or wait. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_account_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references User. Used together with HOST and EVENT_NAME for grouping events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_account_by_event_name HOST 2 NULL YES char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) select,insert,update,references Host. Used together with USER and EVENT_NAME for grouping events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_account_by_event_name EVENT_NAME 3 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with USER and HOST for grouping events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_account_by_event_name COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events, which includes all timed and untimed events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_account_by_event_name SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the timed summarized events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_account_by_event_name MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the timed summarized events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_account_by_event_name AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the timed summarized events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_account_by_event_name MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the timed summarized events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_host_by_event_name HOST 1 NULL YES char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) select,insert,update,references Host. Used together with EVENT_NAME for grouping events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_host_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with HOST for grouping events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_host_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events, which includes all timed and untimed events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_host_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the timed summarized events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_host_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the timed summarized events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_host_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the timed summarized events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_host_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the timed summarized events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_thread_by_event_name THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_NAME uniquely identifies the row. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_thread_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with THREAD_ID for grouping events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_thread_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events, which includes all timed and untimed events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_thread_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the timed summarized events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_thread_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the timed summarized events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_thread_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the timed summarized events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_thread_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the timed summarized events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_user_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references User. Used together with EVENT_NAME for grouping events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_user_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with USER for grouping events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_user_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events, which includes all timed and untimed events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_user_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the timed summarized events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_user_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the timed summarized events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_user_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the timed summarized events. NEVER NULL NO NO
+def performance_schema events_stages_summary_by_user_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the timed summarized events. NEVER NULL NO NO
+def performance_schema events_stages_summary_global_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL NO NO
+def performance_schema events_stages_summary_global_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events, which includes all timed and untimed events. NEVER NULL NO NO
+def performance_schema events_stages_summary_global_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the timed summarized events. NEVER NULL NO NO
+def performance_schema events_stages_summary_global_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the timed summarized events. NEVER NULL NO NO
+def performance_schema events_stages_summary_global_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the timed summarized events. NEVER NULL NO NO
+def performance_schema events_stages_summary_global_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the timed summarized events. NEVER NULL NO NO
+def performance_schema events_statements_current THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL NO NO
+def performance_schema events_statements_current EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL NO NO
+def performance_schema events_statements_current END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL NO NO
+def performance_schema events_statements_current EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL NO NO
+def performance_schema events_statements_current SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL NO NO
+def performance_schema events_statements_current TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL NO NO
+def performance_schema events_statements_current TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL NO NO
+def performance_schema events_statements_current TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL NO NO
+def performance_schema events_statements_current LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Time in picoseconds spent waiting for locks. The time is calculated in microseconds but stored in picoseconds for compatibility with other timings. NEVER NULL NO NO
+def performance_schema events_statements_current SQL_TEXT 10 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references The SQL statement, or NULL if the command is not associated with an SQL statement. NEVER NULL NO NO
+def performance_schema events_statements_current DIGEST 11 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select,insert,update,references Statement digest. NEVER NULL NO NO
+def performance_schema events_statements_current DIGEST_TEXT 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references Statement digest text. NEVER NULL NO NO
+def performance_schema events_statements_current CURRENT_SCHEMA 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Statement's default database for the statement, or NULL if there was none. NEVER NULL NO NO
+def performance_schema events_statements_current OBJECT_TYPE 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NULL for top level statements. The parent statement object type for nested statements (stored programs). NEVER NULL NO NO
+def performance_schema events_statements_current OBJECT_SCHEMA 15 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NULL for top level statements. The parent statement object schema for nested statements (stored programs). NEVER NULL NO NO
+def performance_schema events_statements_current OBJECT_NAME 16 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NULL for top level statements. The parent statement object name for nested statements (stored programs). NEVER NULL NO NO
+def performance_schema events_statements_current OBJECT_INSTANCE_BEGIN 17 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the statement object. NEVER NULL NO NO
+def performance_schema events_statements_current MYSQL_ERRNO 18 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Error code. See MariaDB Error Codes for a full list. NEVER NULL NO NO
+def performance_schema events_statements_current RETURNED_SQLSTATE 19 NULL YES varchar 5 15 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(5) select,insert,update,references The SQLSTATE value. NEVER NULL NO NO
+def performance_schema events_statements_current MESSAGE_TEXT 20 NULL YES varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Statement error message. See MariaDB Error Codes. NEVER NULL NO NO
+def performance_schema events_statements_current ERRORS 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if SQLSTATE signifies completion (starting with 00) or warning (01), otherwise 1. NEVER NULL NO NO
+def performance_schema events_statements_current WARNINGS 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of warnings from the diagnostics area. NEVER NULL NO NO
+def performance_schema events_statements_current ROWS_AFFECTED 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows affected the statement affected. NEVER NULL NO NO
+def performance_schema events_statements_current ROWS_SENT 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows returned. NEVER NULL NO NO
+def performance_schema events_statements_current ROWS_EXAMINED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows read during the statement's execution. NEVER NULL NO NO
+def performance_schema events_statements_current CREATED_TMP_DISK_TABLES 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of on-disk temp tables created by the statement. NEVER NULL NO NO
+def performance_schema events_statements_current CREATED_TMP_TABLES 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of temp tables created by the statement. NEVER NULL NO NO
+def performance_schema events_statements_current SELECT_FULL_JOIN 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which did not use an index. NEVER NULL NO NO
+def performance_schema events_statements_current SELECT_FULL_RANGE_JOIN 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a range search of the first table. NEVER NULL NO NO
+def performance_schema events_statements_current SELECT_RANGE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a range of the first table. NEVER NULL NO NO
+def performance_schema events_statements_current SELECT_RANGE_CHECK 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins without keys performed by the statement that check for key usage after each row. NEVER NULL NO NO
+def performance_schema events_statements_current SELECT_SCAN 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a full scan of the first table. NEVER NULL NO NO
+def performance_schema events_statements_current SORT_MERGE_PASSES 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of merge passes by the sort algorithm performed by the statement. If too high, you may need to increase the sort_buffer_size. NEVER NULL NO NO
+def performance_schema events_statements_current SORT_RANGE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of sorts performed by the statement which used a range. NEVER NULL NO NO
+def performance_schema events_statements_current SORT_ROWS 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows sorted by the statement. NEVER NULL NO NO
+def performance_schema events_statements_current SORT_SCAN 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of sorts performed by the statement which used a full table scan. NEVER NULL NO NO
+def performance_schema events_statements_current NO_INDEX_USED 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if the statement performed a table scan with an index, 1 if without an index. NEVER NULL NO NO
+def performance_schema events_statements_current NO_GOOD_INDEX_USED 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if a good index was found for the statement, 1 if no good index was found. See the Range checked for each record description in the EXPLAIN article. NEVER NULL NO NO
+def performance_schema events_statements_current NESTING_EVENT_ID 39 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL for top level statements. The parent statement event id for nested statements (stored programs). NEVER NULL NO NO
+def performance_schema events_statements_current NESTING_EVENT_TYPE 40 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references NULL for top level statements. The parent statement event type for nested statements (stored programs). NEVER NULL NO NO
+def performance_schema events_statements_current NESTING_EVENT_LEVEL 41 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references 0 for top level statements. The parent statement level plus 1 for nested statements (stored programs). NEVER NULL NO NO
+def performance_schema events_statements_history THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL NO NO
+def performance_schema events_statements_history EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL NO NO
+def performance_schema events_statements_history END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL NO NO
+def performance_schema events_statements_history EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL NO NO
+def performance_schema events_statements_history SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL NO NO
+def performance_schema events_statements_history TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL NO NO
+def performance_schema events_statements_history TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL NO NO
+def performance_schema events_statements_history TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL NO NO
+def performance_schema events_statements_history LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Time in picoseconds spent waiting for locks. The time is calculated in microseconds but stored in picoseconds for compatibility with other timings. NEVER NULL NO NO
+def performance_schema events_statements_history SQL_TEXT 10 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references The SQL statement, or NULL if the command is not associated with an SQL statement. NEVER NULL NO NO
+def performance_schema events_statements_history DIGEST 11 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select,insert,update,references Statement digest. NEVER NULL NO NO
+def performance_schema events_statements_history DIGEST_TEXT 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references Statement digest text. NEVER NULL NO NO
+def performance_schema events_statements_history CURRENT_SCHEMA 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Statement's default database for the statement, or NULL if there was none. NEVER NULL NO NO
+def performance_schema events_statements_history OBJECT_TYPE 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NULL for top level statements. The parent statement object type for nested statements (stored programs). NEVER NULL NO NO
+def performance_schema events_statements_history OBJECT_SCHEMA 15 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NULL for top level statements. The parent statement object schema for nested statements (stored programs). NEVER NULL NO NO
+def performance_schema events_statements_history OBJECT_NAME 16 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NULL for top level statements. The parent statement object name for nested statements (stored programs). NEVER NULL NO NO
+def performance_schema events_statements_history OBJECT_INSTANCE_BEGIN 17 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the statement object. NEVER NULL NO NO
+def performance_schema events_statements_history MYSQL_ERRNO 18 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Error code. See MariaDB Error Codes for a full list. NEVER NULL NO NO
+def performance_schema events_statements_history RETURNED_SQLSTATE 19 NULL YES varchar 5 15 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(5) select,insert,update,references The SQLSTATE value. NEVER NULL NO NO
+def performance_schema events_statements_history MESSAGE_TEXT 20 NULL YES varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Statement error message. See MariaDB Error Codes. NEVER NULL NO NO
+def performance_schema events_statements_history ERRORS 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if SQLSTATE signifies completion (starting with 00) or warning (01), otherwise 1. NEVER NULL NO NO
+def performance_schema events_statements_history WARNINGS 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of warnings from the diagnostics area. NEVER NULL NO NO
+def performance_schema events_statements_history ROWS_AFFECTED 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows affected the statement affected. NEVER NULL NO NO
+def performance_schema events_statements_history ROWS_SENT 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows returned. NEVER NULL NO NO
+def performance_schema events_statements_history ROWS_EXAMINED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows read during the statement's execution. NEVER NULL NO NO
+def performance_schema events_statements_history CREATED_TMP_DISK_TABLES 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of on-disk temp tables created by the statement. NEVER NULL NO NO
+def performance_schema events_statements_history CREATED_TMP_TABLES 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of temp tables created by the statement. NEVER NULL NO NO
+def performance_schema events_statements_history SELECT_FULL_JOIN 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which did not use an index. NEVER NULL NO NO
+def performance_schema events_statements_history SELECT_FULL_RANGE_JOIN 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a range search of the first table. NEVER NULL NO NO
+def performance_schema events_statements_history SELECT_RANGE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a range of the first table. NEVER NULL NO NO
+def performance_schema events_statements_history SELECT_RANGE_CHECK 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins without keys performed by the statement that check for key usage after each row. NEVER NULL NO NO
+def performance_schema events_statements_history SELECT_SCAN 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a full scan of the first table. NEVER NULL NO NO
+def performance_schema events_statements_history SORT_MERGE_PASSES 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of merge passes by the sort algorithm performed by the statement. If too high, you may need to increase the sort_buffer_size. NEVER NULL NO NO
+def performance_schema events_statements_history SORT_RANGE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of sorts performed by the statement which used a range. NEVER NULL NO NO
+def performance_schema events_statements_history SORT_ROWS 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows sorted by the statement. NEVER NULL NO NO
+def performance_schema events_statements_history SORT_SCAN 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of sorts performed by the statement which used a full table scan. NEVER NULL NO NO
+def performance_schema events_statements_history NO_INDEX_USED 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if the statement performed a table scan with an index, 1 if without an index. NEVER NULL NO NO
+def performance_schema events_statements_history NO_GOOD_INDEX_USED 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if a good index was found for the statement, 1 if no good index was found. See the Range checked for each record description in the EXPLAIN article. NEVER NULL NO NO
+def performance_schema events_statements_history NESTING_EVENT_ID 39 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL for top level statements. The parent statement event id for nested statements (stored programs). NEVER NULL NO NO
+def performance_schema events_statements_history NESTING_EVENT_TYPE 40 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references NULL for top level statements. The parent statement event type for nested statements (stored programs). NEVER NULL NO NO
+def performance_schema events_statements_history NESTING_EVENT_LEVEL 41 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references 0 for top level statements. The parent statement level plus 1 for nested statements (stored programs). NEVER NULL NO NO
+def performance_schema events_statements_history_long THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL NO NO
+def performance_schema events_statements_history_long EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL NO NO
+def performance_schema events_statements_history_long END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL NO NO
+def performance_schema events_statements_history_long EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL NO NO
+def performance_schema events_statements_history_long SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL NO NO
+def performance_schema events_statements_history_long TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL NO NO
+def performance_schema events_statements_history_long TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL NO NO
+def performance_schema events_statements_history_long TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL NO NO
+def performance_schema events_statements_history_long LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Time in picoseconds spent waiting for locks. The time is calculated in microseconds but stored in picoseconds for compatibility with other timings. NEVER NULL NO NO
+def performance_schema events_statements_history_long SQL_TEXT 10 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references The SQL statement, or NULL if the command is not associated with an SQL statement. NEVER NULL NO NO
+def performance_schema events_statements_history_long DIGEST 11 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select,insert,update,references Statement digest. NEVER NULL NO NO
+def performance_schema events_statements_history_long DIGEST_TEXT 12 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references Statement digest text. NEVER NULL NO NO
+def performance_schema events_statements_history_long CURRENT_SCHEMA 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Statement's default database for the statement, or NULL if there was none. NEVER NULL NO NO
+def performance_schema events_statements_history_long OBJECT_TYPE 14 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NULL for top level statements. The parent statement object type for nested statements (stored programs). NEVER NULL NO NO
+def performance_schema events_statements_history_long OBJECT_SCHEMA 15 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NULL for top level statements. The parent statement object schema for nested statements (stored programs). NEVER NULL NO NO
+def performance_schema events_statements_history_long OBJECT_NAME 16 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NULL for top level statements. The parent statement object name for nested statements (stored programs). NEVER NULL NO NO
+def performance_schema events_statements_history_long OBJECT_INSTANCE_BEGIN 17 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the statement object. NEVER NULL NO NO
+def performance_schema events_statements_history_long MYSQL_ERRNO 18 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Error code. See MariaDB Error Codes for a full list. NEVER NULL NO NO
+def performance_schema events_statements_history_long RETURNED_SQLSTATE 19 NULL YES varchar 5 15 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(5) select,insert,update,references The SQLSTATE value. NEVER NULL NO NO
+def performance_schema events_statements_history_long MESSAGE_TEXT 20 NULL YES varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Statement error message. See MariaDB Error Codes. NEVER NULL NO NO
+def performance_schema events_statements_history_long ERRORS 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if SQLSTATE signifies completion (starting with 00) or warning (01), otherwise 1. NEVER NULL NO NO
+def performance_schema events_statements_history_long WARNINGS 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of warnings from the diagnostics area. NEVER NULL NO NO
+def performance_schema events_statements_history_long ROWS_AFFECTED 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows affected the statement affected. NEVER NULL NO NO
+def performance_schema events_statements_history_long ROWS_SENT 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows returned. NEVER NULL NO NO
+def performance_schema events_statements_history_long ROWS_EXAMINED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows read during the statement's execution. NEVER NULL NO NO
+def performance_schema events_statements_history_long CREATED_TMP_DISK_TABLES 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of on-disk temp tables created by the statement. NEVER NULL NO NO
+def performance_schema events_statements_history_long CREATED_TMP_TABLES 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of temp tables created by the statement. NEVER NULL NO NO
+def performance_schema events_statements_history_long SELECT_FULL_JOIN 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which did not use an index. NEVER NULL NO NO
+def performance_schema events_statements_history_long SELECT_FULL_RANGE_JOIN 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a range search of the first table. NEVER NULL NO NO
+def performance_schema events_statements_history_long SELECT_RANGE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a range of the first table. NEVER NULL NO NO
+def performance_schema events_statements_history_long SELECT_RANGE_CHECK 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins without keys performed by the statement that check for key usage after each row. NEVER NULL NO NO
+def performance_schema events_statements_history_long SELECT_SCAN 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of joins performed by the statement which used a full scan of the first table. NEVER NULL NO NO
+def performance_schema events_statements_history_long SORT_MERGE_PASSES 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of merge passes by the sort algorithm performed by the statement. If too high, you may need to increase the sort_buffer_size. NEVER NULL NO NO
+def performance_schema events_statements_history_long SORT_RANGE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of sorts performed by the statement which used a range. NEVER NULL NO NO
+def performance_schema events_statements_history_long SORT_ROWS 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of rows sorted by the statement. NEVER NULL NO NO
+def performance_schema events_statements_history_long SORT_SCAN 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of sorts performed by the statement which used a full table scan. NEVER NULL NO NO
+def performance_schema events_statements_history_long NO_INDEX_USED 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if the statement performed a table scan with an index, 1 if without an index. NEVER NULL NO NO
+def performance_schema events_statements_history_long NO_GOOD_INDEX_USED 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references 0 if a good index was found for the statement, 1 if no good index was found. See the Range checked for each record description in the EXPLAIN article. NEVER NULL NO NO
+def performance_schema events_statements_history_long NESTING_EVENT_ID 39 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL for top level statements. The parent statement event id for nested statements (stored programs). NEVER NULL NO NO
+def performance_schema events_statements_history_long NESTING_EVENT_TYPE 40 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references NULL for top level statements. The parent statement event type for nested statements (stored programs). NEVER NULL NO NO
+def performance_schema events_statements_history_long NESTING_EVENT_LEVEL 41 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references 0 for top level statements. The parent statement level plus 1 for nested statements (stored programs). NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references User. Used together with HOST and EVENT_NAME for grouping events. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name HOST 2 NULL YES char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) select,insert,update,references Host. Used together with USER and EVENT_NAME for grouping events. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name EVENT_NAME 3 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with USER and HOST for grouping events. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name SUM_LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the LOCK_TIME column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name SUM_ERRORS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ERRORS column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name SUM_WARNINGS 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the WARNINGS column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name SUM_ROWS_AFFECTED 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_AFFECTED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name SUM_ROWS_SENT 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_SENT column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name SUM_ROWS_EXAMINED 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_EXAMINED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name SUM_CREATED_TMP_DISK_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name SUM_CREATED_TMP_TABLES 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_TABLES column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_FULL_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_JOIN column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_FULL_RANGE_JOIN 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_RANGE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_RANGE_CHECK 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE_CHECK column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SELECT_SCAN 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_SCAN column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SORT_MERGE_PASSES 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_MERGE_PASSES column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SORT_RANGE 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_RANGE column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SORT_ROWS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_ROWS column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name SUM_SORT_SCAN 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_SCAN column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name SUM_NO_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_INDEX_USED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_account_by_event_name SUM_NO_GOOD_INDEX_USED 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest SCHEMA_NAME 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Database name. Records are summarised together with DIGEST. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest DIGEST 2 NULL YES varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select,insert,update,references Performance Schema digest. Records are summarised together with SCHEMA NAME. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest DIGEST_TEXT 3 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references The unhashed form of the digest. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest SUM_LOCK_TIME 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the LOCK_TIME column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest SUM_ERRORS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ERRORS column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest SUM_WARNINGS 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the WARNINGS column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest SUM_ROWS_AFFECTED 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_AFFECTED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest SUM_ROWS_SENT 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_SENT column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest SUM_ROWS_EXAMINED 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_EXAMINED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest SUM_CREATED_TMP_DISK_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest SUM_CREATED_TMP_TABLES 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_TABLES column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest SUM_SELECT_FULL_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_JOIN column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest SUM_SELECT_FULL_RANGE_JOIN 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest SUM_SELECT_RANGE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest SUM_SELECT_RANGE_CHECK 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE_CHECK column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest SUM_SELECT_SCAN 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_SCAN column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest SUM_SORT_MERGE_PASSES 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_MERGE_PASSES column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest SUM_SORT_RANGE 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_RANGE column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest SUM_SORT_ROWS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_ROWS column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest SUM_SORT_SCAN 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_SCAN column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest SUM_NO_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_INDEX_USED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest SUM_NO_GOOD_INDEX_USED 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest FIRST_SEEN 28 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references Time at which the digest was first seen. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_digest LAST_SEEN 29 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references Time at which the digest was most recently seen. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name HOST 1 NULL YES char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) select,insert,update,references Host. Used together with EVENT_NAME for grouping events. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with HOST for grouping events. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name SUM_LOCK_TIME 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the LOCK_TIME column in the events_statements_currentd table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name SUM_ERRORS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ERRORS column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name SUM_WARNINGS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the WARNINGS column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name SUM_ROWS_AFFECTED 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_AFFECTED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name SUM_ROWS_SENT 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_SENT column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name SUM_ROWS_EXAMINED 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_EXAMINED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name SUM_CREATED_TMP_DISK_TABLES 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name SUM_CREATED_TMP_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_TABLES column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_FULL_JOIN 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_JOIN column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_FULL_RANGE_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_RANGE_JOINW column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_RANGE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_RANGE_CHECK 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE_CHECK column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SELECT_SCAN 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_SCAN column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SORT_MERGE_PASSES 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_MERGE_PASSES column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SORT_RANGE 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_RANGE column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SORT_ROWS 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_ROWS column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name SUM_SORT_SCAN 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_SCAN column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name SUM_NO_INDEX_USED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_INDEX_USED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_host_by_event_name SUM_NO_GOOD_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program OBJECT_TYPE 1 NULL YES enum 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('EVENT','FUNCTION','PROCEDURE','TABLE','TRIGGER') select,insert,update,references Object type for which the summary is generated. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program OBJECT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The schema of the object for which the summary is generated. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program OBJECT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The name of the object for which the summary is generated. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of summarized events (from events_statements_current). This value includes all events, whether timed or nontimed. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of the summarized timed events. This value is calculated only for timed events because nontimed events have a wait time of NULL. The same is true for the other xxx_TIMER_WAIT values. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of the summarized timed events. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of the summarized timed events. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of the summarized timed events. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program COUNT_STATEMENTS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of nested statements invoked during stored program execution. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program SUM_STATEMENTS_WAIT 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of the summarized timed statements. This value is calculated only for timed statements because nontimed statements have a wait time of NULL. The same is true for the other xxx_STATEMENT_WAIT values. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program MIN_STATEMENTS_WAIT 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of the summarized timed statements. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program AVG_STATEMENTS_WAIT 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of the summarized timed statements. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program MAX_STATEMENTS_WAIT 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of the summarized timed statements. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program SUM_LOCK_TIME 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total time spent (in picoseconds) waiting for table locks for the summarized statements. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program SUM_ERRORS 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of errors that occurend for the summarized statements. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program SUM_WARNINGS 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of warnings that occurend for the summarized statements. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program SUM_ROWS_AFFECTED 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of affected rows by the summarized statements. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program SUM_ROWS_SENT 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of rows returned by the summarized statements. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program SUM_ROWS_EXAMINED 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of rows examined by the summarized statements. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program SUM_CREATED_TMP_DISK_TABLES 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of on-disk temporary tables created by the summarized statements. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program SUM_CREATED_TMP_TABLES 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of in-memory temporary tables created by the summarized statements. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program SUM_SELECT_FULL_JOIN 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of full joins executed by the summarized statements. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program SUM_SELECT_FULL_RANGE_JOIN 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of range search joins executed by the summarized statements. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program SUM_SELECT_RANGE 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of joins that used ranges on the first table executed by the summarized statements. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program SUM_SELECT_RANGE_CHECK 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of joins that check for key usage after each row executed by the summarized statements. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program SUM_SELECT_SCAN 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of joins that did a full scan of the first table executed by the summarized statements. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program SUM_SORT_MERGE_PASSES 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of merge passes that the sort algorithm has had to do for the summarized statements. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program SUM_SORT_RANGE 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of sorts that were done using ranges for the summarized statements. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program SUM_SORT_ROWS 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of sorted rows that were sorted by the summarized statements. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program SUM_SORT_SCAN 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of sorts that were done by scanning the table by the summarized statements. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program SUM_NO_INDEX_USED 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of statements that performed a table scan without using an index. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_program SUM_NO_GOOD_INDEX_USED 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of statements where no good index was found. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_NAME uniquely identifies the row. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with THREAD_ID for grouping events. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_LOCK_TIME 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the LOCK_TIME column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_ERRORS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ERRORS column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_WARNINGS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the WARNINGS column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_ROWS_AFFECTED 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_AFFECTED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_ROWS_SENT 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_SENT column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_ROWS_EXAMINED 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_EXAMINED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_CREATED_TMP_DISK_TABLES 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_CREATED_TMP_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_TABLES column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_FULL_JOIN 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_JOIN column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_FULL_RANGE_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_RANGE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_RANGE_CHECK 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE_CHECK column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SELECT_SCAN 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_SCAN column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SORT_MERGE_PASSES 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_MERGE_PASSES column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SORT_RANGE 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_RANGE column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SORT_ROWS 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_ROWS column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_SORT_SCAN 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_SCAN column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_NO_INDEX_USED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_INDEX_USED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_thread_by_event_name SUM_NO_GOOD_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references User. Used together with EVENT_NAME for grouping events. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with USER for grouping events. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name SUM_LOCK_TIME 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the LOCK_TIME column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name SUM_ERRORS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ERRORS column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name SUM_WARNINGS 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the WARNINGS column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name SUM_ROWS_AFFECTED 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_AFFECTED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name SUM_ROWS_SENT 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_SENT column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name SUM_ROWS_EXAMINED 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_EXAMINED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name SUM_CREATED_TMP_DISK_TABLES 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name SUM_CREATED_TMP_TABLES 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_TABLES column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_FULL_JOIN 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_JOIN column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_FULL_RANGE_JOIN 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_RANGE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_RANGE_CHECK 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE_CHECK column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SELECT_SCAN 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_SCAN column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SORT_MERGE_PASSES 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_MERGE_PASSES column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SORT_RANGE 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_RANGE column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SORT_ROWS 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_ROWS column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name SUM_SORT_SCAN 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_SCAN column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name SUM_NO_INDEX_USED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_INDEX_USED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_by_user_by_event_name SUM_NO_GOOD_INDEX_USED 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name SUM_LOCK_TIME 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the LOCK_TIME column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name SUM_ERRORS 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ERRORS column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name SUM_WARNINGS 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the WARNINGS column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name SUM_ROWS_AFFECTED 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_AFFECTED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name SUM_ROWS_SENT 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_SENT column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name SUM_ROWS_EXAMINED 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the ROWS_EXAMINED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name SUM_CREATED_TMP_DISK_TABLES 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_DISK_TABLES column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name SUM_CREATED_TMP_TABLES 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the CREATED_TMP_TABLES column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_FULL_JOIN 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_JOIN column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_FULL_RANGE_JOIN 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_FULL_RANGE_JOIN column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_RANGE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_RANGE_CHECK 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_RANGE_CHECK column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name SUM_SELECT_SCAN 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SELECT_SCAN column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name SUM_SORT_MERGE_PASSES 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_MERGE_PASSES column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name SUM_SORT_RANGE 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_RANGE column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name SUM_SORT_ROWS 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_ROWS column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name SUM_SORT_SCAN 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the SORT_SCAN column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name SUM_NO_INDEX_USED 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_INDEX_USED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_statements_summary_global_by_event_name SUM_NO_GOOD_INDEX_USED 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Sum of the NO_GOOD_INDEX_USED column in the events_statements_current table. NEVER NULL NO NO
+def performance_schema events_transactions_current THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The thread associated with the event. NEVER NULL NO NO
+def performance_schema events_transactions_current EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The event id associated with the event. NEVER NULL NO NO
+def performance_schema events_transactions_current END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references This column is set to NULL when the event starts and updated to the thread current event number when the event ends. NEVER NULL NO NO
+def performance_schema events_transactions_current EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references The name of the instrument from which the event was collected. This is a NAME value from the setup_instruments table. NEVER NULL NO NO
+def performance_schema events_transactions_current STATE 5 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('ACTIVE','COMMITTED','ROLLED BACK') select,insert,update,references The current transaction state. The value is ACTIVE (after START TRANSACTION or BEGIN), COMMITTED (after COMMIT), or ROLLED BACK (after ROLLBACK). NEVER NULL NO NO
+def performance_schema events_transactions_current TRX_ID 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Unused. NEVER NULL NO NO
+def performance_schema events_transactions_current GTID 7 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Transaction GTID, using the format DOMAIN-SERVER_ID-SEQUENCE_NO. NEVER NULL NO NO
+def performance_schema events_transactions_current XID_FORMAT_ID 8 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references XA transaction format ID for GTRID and BQUAL values. NEVER NULL NO NO
+def performance_schema events_transactions_current XID_GTRID 9 NULL YES varchar 130 390 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(130) select,insert,update,references XA global transaction ID. NEVER NULL NO NO
+def performance_schema events_transactions_current XID_BQUAL 10 NULL YES varchar 130 390 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(130) select,insert,update,references XA transaction branch qualifier. NEVER NULL NO NO
+def performance_schema events_transactions_current XA_STATE 11 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The state of the XA transaction. The value is ACTIVE (after XA START), IDLE (after XA END), PREPARED (after XA PREPARE), ROLLED BACK (after XA ROLLBACK), or COMMITTED (after XA COMMIT). NEVER NULL NO NO
+def performance_schema events_transactions_current SOURCE 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The name of the source file containing the instrumented code that produced the event and the line number in the file at which the instrumentation occurs. NEVER NULL NO NO
+def performance_schema events_transactions_current TIMER_START 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The unit is picoseconds. When event timing started. NULL if event has no timing information. NEVER NULL NO NO
+def performance_schema events_transactions_current TIMER_END 14 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The unit is picoseconds. When event timing ended. NULL if event has no timing information. NEVER NULL NO NO
+def performance_schema events_transactions_current TIMER_WAIT 15 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The unit is picoseconds. Event duration. NULL if event has not timing information. NEVER NULL NO NO
+def performance_schema events_transactions_current ACCESS_MODE 16 NULL YES enum 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('READ ONLY','READ WRITE') select,insert,update,references Transaction access mode. NEVER NULL NO NO
+def performance_schema events_transactions_current ISOLATION_LEVEL 17 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Transaction isolation level. One of: REPEATABLE READ, READ COMMITTED, READ UNCOMMITTED, or SERIALIZABLE. NEVER NULL NO NO
+def performance_schema events_transactions_current AUTOCOMMIT 18 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references Whether autcommit mode was enabled when the transaction started. NEVER NULL NO NO
+def performance_schema events_transactions_current NUMBER_OF_SAVEPOINTS 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of SAVEPOINT statements issued during the transaction. NEVER NULL NO NO
+def performance_schema events_transactions_current NUMBER_OF_ROLLBACK_TO_SAVEPOINT 20 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of ROLLBACK_TO_SAVEPOINT statements issued during the transaction. NEVER NULL NO NO
+def performance_schema events_transactions_current NUMBER_OF_RELEASE_SAVEPOINT 21 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of RELEASE_SAVEPOINT statements issued during the transaction. NEVER NULL NO NO
+def performance_schema events_transactions_current OBJECT_INSTANCE_BEGIN 22 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Unused. NEVER NULL NO NO
+def performance_schema events_transactions_current NESTING_EVENT_ID 23 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The EVENT_ID value of the event within which this event is nested. NEVER NULL NO NO
+def performance_schema events_transactions_current NESTING_EVENT_TYPE 24 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references The nesting event type. NEVER NULL NO NO
+def performance_schema events_transactions_history THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The thread associated with the event. NEVER NULL NO NO
+def performance_schema events_transactions_history EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The event id associated with the event. NEVER NULL NO NO
+def performance_schema events_transactions_history END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references This column is set to NULL when the event starts and updated to the thread current event number when the event ends. NEVER NULL NO NO
+def performance_schema events_transactions_history EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references The name of the instrument from which the event was collected. This is a NAME value from the setup_instruments table. NEVER NULL NO NO
+def performance_schema events_transactions_history STATE 5 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('ACTIVE','COMMITTED','ROLLED BACK') select,insert,update,references The current transaction state. The value is ACTIVE (after START TRANSACTION or BEGIN), COMMITTED (after COMMIT), or ROLLED BACK (after ROLLBACK). NEVER NULL NO NO
+def performance_schema events_transactions_history TRX_ID 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Unused. NEVER NULL NO NO
+def performance_schema events_transactions_history GTID 7 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Transaction GTID, using the format DOMAIN-SERVER_ID-SEQUENCE_NO. NEVER NULL NO NO
+def performance_schema events_transactions_history XID_FORMAT_ID 8 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references XA transaction format ID for GTRID and BQUAL values. NEVER NULL NO NO
+def performance_schema events_transactions_history XID_GTRID 9 NULL YES varchar 130 390 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(130) select,insert,update,references XA global transaction ID. NEVER NULL NO NO
+def performance_schema events_transactions_history XID_BQUAL 10 NULL YES varchar 130 390 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(130) select,insert,update,references XA transaction branch qualifier. NEVER NULL NO NO
+def performance_schema events_transactions_history XA_STATE 11 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The state of the XA transaction. The value is ACTIVE (after XA START), IDLE (after XA END), PREPARED (after XA PREPARE), ROLLED BACK (after XA ROLLBACK), or COMMITTED (after XA COMMIT). NEVER NULL NO NO
+def performance_schema events_transactions_history SOURCE 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The name of the source file containing the instrumented code that produced the event and the line number in the file at which the instrumentation occurs. NEVER NULL NO NO
+def performance_schema events_transactions_history TIMER_START 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The unit is picoseconds. When event timing started. NULL if event has no timing information. NEVER NULL NO NO
+def performance_schema events_transactions_history TIMER_END 14 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The unit is picoseconds. When event timing ended. NULL if event has no timing information. NEVER NULL NO NO
+def performance_schema events_transactions_history TIMER_WAIT 15 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The unit is picoseconds. Event duration. NULL if event has not timing information. NEVER NULL NO NO
+def performance_schema events_transactions_history ACCESS_MODE 16 NULL YES enum 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('READ ONLY','READ WRITE') select,insert,update,references Transaction access mode. NEVER NULL NO NO
+def performance_schema events_transactions_history ISOLATION_LEVEL 17 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Transaction isolation level. One of: REPEATABLE READ, READ COMMITTED, READ UNCOMMITTED, or SERIALIZABLE. NEVER NULL NO NO
+def performance_schema events_transactions_history AUTOCOMMIT 18 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references Whether autcommit mode was enabled when the transaction started. NEVER NULL NO NO
+def performance_schema events_transactions_history NUMBER_OF_SAVEPOINTS 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of SAVEPOINT statements issued during the transaction. NEVER NULL NO NO
+def performance_schema events_transactions_history NUMBER_OF_ROLLBACK_TO_SAVEPOINT 20 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of ROLLBACK_TO_SAVEPOINT statements issued during the transaction. NEVER NULL NO NO
+def performance_schema events_transactions_history NUMBER_OF_RELEASE_SAVEPOINT 21 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of RELEASE_SAVEPOINT statements issued during the transaction. NEVER NULL NO NO
+def performance_schema events_transactions_history OBJECT_INSTANCE_BEGIN 22 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Unused. NEVER NULL NO NO
+def performance_schema events_transactions_history NESTING_EVENT_ID 23 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The EVENT_ID value of the event within which this event is nested. NEVER NULL NO NO
+def performance_schema events_transactions_history NESTING_EVENT_TYPE 24 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references The nesting event type. NEVER NULL NO NO
+def performance_schema events_transactions_history_long THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The thread associated with the event. NEVER NULL NO NO
+def performance_schema events_transactions_history_long EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The event id associated with the event. NEVER NULL NO NO
+def performance_schema events_transactions_history_long END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references This column is set to NULL when the event starts and updated to the thread current event number when the event ends. NEVER NULL NO NO
+def performance_schema events_transactions_history_long EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references The name of the instrument from which the event was collected. This is a NAME value from the setup_instruments table. NEVER NULL NO NO
+def performance_schema events_transactions_history_long STATE 5 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('ACTIVE','COMMITTED','ROLLED BACK') select,insert,update,references The current transaction state. The value is ACTIVE (after START TRANSACTION or BEGIN), COMMITTED (after COMMIT), or ROLLED BACK (after ROLLBACK). NEVER NULL NO NO
+def performance_schema events_transactions_history_long TRX_ID 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Unused. NEVER NULL NO NO
+def performance_schema events_transactions_history_long GTID 7 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Transaction GTID, using the format DOMAIN-SERVER_ID-SEQUENCE_NO. NEVER NULL NO NO
+def performance_schema events_transactions_history_long XID_FORMAT_ID 8 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references XA transaction format ID for GTRID and BQUAL values. NEVER NULL NO NO
+def performance_schema events_transactions_history_long XID_GTRID 9 NULL YES varchar 130 390 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(130) select,insert,update,references XA global transaction ID. NEVER NULL NO NO
+def performance_schema events_transactions_history_long XID_BQUAL 10 NULL YES varchar 130 390 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(130) select,insert,update,references XA transaction branch qualifier. NEVER NULL NO NO
+def performance_schema events_transactions_history_long XA_STATE 11 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The state of the XA transaction. The value is ACTIVE (after XA START), IDLE (after XA END), PREPARED (after XA PREPARE), ROLLED BACK (after XA ROLLBACK), or COMMITTED (after XA COMMIT). NEVER NULL NO NO
+def performance_schema events_transactions_history_long SOURCE 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The name of the source file containing the instrumented code that produced the event and the line number in the file at which the instrumentation occurs. NEVER NULL NO NO
+def performance_schema events_transactions_history_long TIMER_START 13 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The unit is picoseconds. When event timing started. NULL if event has no timing information. NEVER NULL NO NO
+def performance_schema events_transactions_history_long TIMER_END 14 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The unit is picoseconds. When event timing ended. NULL if event has no timing information. NEVER NULL NO NO
+def performance_schema events_transactions_history_long TIMER_WAIT 15 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The unit is picoseconds. Event duration. NULL if event has not timing information. NEVER NULL NO NO
+def performance_schema events_transactions_history_long ACCESS_MODE 16 NULL YES enum 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('READ ONLY','READ WRITE') select,insert,update,references Transaction access mode. NEVER NULL NO NO
+def performance_schema events_transactions_history_long ISOLATION_LEVEL 17 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Transaction isolation level. One of: REPEATABLE READ, READ COMMITTED, READ UNCOMMITTED, or SERIALIZABLE. NEVER NULL NO NO
+def performance_schema events_transactions_history_long AUTOCOMMIT 18 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references Whether autcommit mode was enabled when the transaction started. NEVER NULL NO NO
+def performance_schema events_transactions_history_long NUMBER_OF_SAVEPOINTS 19 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of SAVEPOINT statements issued during the transaction. NEVER NULL NO NO
+def performance_schema events_transactions_history_long NUMBER_OF_ROLLBACK_TO_SAVEPOINT 20 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of ROLLBACK_TO_SAVEPOINT statements issued during the transaction. NEVER NULL NO NO
+def performance_schema events_transactions_history_long NUMBER_OF_RELEASE_SAVEPOINT 21 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of RELEASE_SAVEPOINT statements issued during the transaction. NEVER NULL NO NO
+def performance_schema events_transactions_history_long OBJECT_INSTANCE_BEGIN 22 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Unused. NEVER NULL NO NO
+def performance_schema events_transactions_history_long NESTING_EVENT_ID 23 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The EVENT_ID value of the event within which this event is nested. NEVER NULL NO NO
+def performance_schema events_transactions_history_long NESTING_EVENT_TYPE 24 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references The nesting event type. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_account_by_event_name USER 1 NULL YES char 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin char(32) select,insert,update,references User for which summary is generated. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_account_by_event_name HOST 2 NULL YES char 60 180 NULL NULL NULL utf8mb3 utf8mb3_bin char(60) select,insert,update,references Host for which summary is generated. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_account_by_event_name EVENT_NAME 3 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name for which summary is generated. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_account_by_event_name COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of summarized events. This value includes all events, whether timed or nontimed. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_account_by_event_name SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of the summarized timed events. This value is calculated only for timed events because nontimed events have a wait time of NULL. The same is true for the other xxx_TIMER_WAIT values. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_account_by_event_name MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of the summarized timed events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_account_by_event_name AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of the summarized timed events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_account_by_event_name MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of the summarized timed events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_account_by_event_name COUNT_READ_WRITE 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_account_by_event_name SUM_TIMER_READ_WRITE 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_account_by_event_name MIN_TIMER_READ_WRITE 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_account_by_event_name AVG_TIMER_READ_WRITE 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_account_by_event_name MAX_TIMER_READ_WRITE 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_account_by_event_name COUNT_READ_ONLY 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_account_by_event_name SUM_TIMER_READ_ONLY 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_account_by_event_name MIN_TIMER_READ_ONLY 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_account_by_event_name AVG_TIMER_READ_ONLY 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_account_by_event_name MAX_TIMER_READ_ONLY 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_host_by_event_name HOST 1 NULL YES char 60 180 NULL NULL NULL utf8mb3 utf8mb3_bin char(60) select,insert,update,references Host for which summary is generated. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_host_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name for which summary is generated. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_host_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of summarized events. This value includes all events, whether timed or nontimed. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_host_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of the summarized timed events. This value is calculated only for timed events because nontimed events have a wait time of NULL. The same is true for the other xxx_TIMER_WAIT values. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_host_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of the summarized timed events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_host_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of the summarized timed events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_host_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of the summarized timed events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_host_by_event_name COUNT_READ_WRITE 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_host_by_event_name SUM_TIMER_READ_WRITE 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_host_by_event_name MIN_TIMER_READ_WRITE 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_host_by_event_name AVG_TIMER_READ_WRITE 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_host_by_event_name MAX_TIMER_READ_WRITE 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_host_by_event_name COUNT_READ_ONLY 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_host_by_event_name SUM_TIMER_READ_ONLY 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_host_by_event_name MIN_TIMER_READ_ONLY 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_host_by_event_name AVG_TIMER_READ_ONLY 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_host_by_event_name MAX_TIMER_READ_ONLY 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_thread_by_event_name THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread for which summary is generated. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_thread_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name for which summary is generated. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_thread_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of summarized events. This value includes all events, whether timed or nontimed. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_thread_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of the summarized timed events. This value is calculated only for timed events because nontimed events have a wait time of NULL. The same is true for the other xxx_TIMER_WAIT values. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_thread_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of the summarized timed events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_thread_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of the summarized timed events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_thread_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of the summarized timed events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_thread_by_event_name COUNT_READ_WRITE 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_thread_by_event_name SUM_TIMER_READ_WRITE 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_thread_by_event_name MIN_TIMER_READ_WRITE 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_thread_by_event_name AVG_TIMER_READ_WRITE 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_thread_by_event_name MAX_TIMER_READ_WRITE 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_thread_by_event_name COUNT_READ_ONLY 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_thread_by_event_name SUM_TIMER_READ_ONLY 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_thread_by_event_name MIN_TIMER_READ_ONLY 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_thread_by_event_name AVG_TIMER_READ_ONLY 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_thread_by_event_name MAX_TIMER_READ_ONLY 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_user_by_event_name USER 1 NULL YES char 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin char(32) select,insert,update,references User for which summary is generated. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_user_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name for which summary is generated. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_user_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of summarized events. This value includes all events, whether timed or nontimed. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_user_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of the summarized timed events. This value is calculated only for timed events because nontimed events have a wait time of NULL. The same is true for the other xxx_TIMER_WAIT values. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_user_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of the summarized timed events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_user_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of the summarized timed events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_user_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of the summarized timed events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_user_by_event_name COUNT_READ_WRITE 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_user_by_event_name SUM_TIMER_READ_WRITE 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_user_by_event_name MIN_TIMER_READ_WRITE 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_user_by_event_name AVG_TIMER_READ_WRITE 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_user_by_event_name MAX_TIMER_READ_WRITE 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_user_by_event_name COUNT_READ_ONLY 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_user_by_event_name SUM_TIMER_READ_ONLY 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_user_by_event_name MIN_TIMER_READ_ONLY 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_user_by_event_name AVG_TIMER_READ_ONLY 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_by_user_by_event_name MAX_TIMER_READ_ONLY 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_global_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name for which summary is generated. NEVER NULL NO NO
+def performance_schema events_transactions_summary_global_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of summarized events. This value includes all events, whether timed or nontimed. NEVER NULL NO NO
+def performance_schema events_transactions_summary_global_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of the summarized timed events. This value is calculated only for timed events because nontimed events have a wait time of NULL. The same is true for the other xxx_TIMER_WAIT values. NEVER NULL NO NO
+def performance_schema events_transactions_summary_global_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of the summarized timed events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_global_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of the summarized timed events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_global_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of the summarized timed events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_global_by_event_name COUNT_READ_WRITE 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_global_by_event_name SUM_TIMER_READ_WRITE 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_global_by_event_name MIN_TIMER_READ_WRITE 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_global_by_event_name AVG_TIMER_READ_WRITE 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_global_by_event_name MAX_TIMER_READ_WRITE 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of only READ/WRITE transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_global_by_event_name COUNT_READ_ONLY 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_global_by_event_name SUM_TIMER_READ_ONLY 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total wait time of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_global_by_event_name MIN_TIMER_READ_ONLY 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The minimum wait time of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_global_by_event_name AVG_TIMER_READ_ONLY 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The average wait time of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_transactions_summary_global_by_event_name MAX_TIMER_READ_ONLY 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The maximum wait time of only READ ONLY transaction events. NEVER NULL NO NO
+def performance_schema events_waits_current THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL NO NO
+def performance_schema events_waits_current EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL NO NO
+def performance_schema events_waits_current END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL NO NO
+def performance_schema events_waits_current EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL NO NO
+def performance_schema events_waits_current SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL NO NO
+def performance_schema events_waits_current TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL NO NO
+def performance_schema events_waits_current TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL NO NO
+def performance_schema events_waits_current TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL NO NO
+def performance_schema events_waits_current SPINS 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Number of spin rounds for a mutex, or NULL if spin rounds are not used, or spinning is not instrumented. NEVER NULL NO NO
+def performance_schema events_waits_current OBJECT_SCHEMA 10 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name of the schema that contains the table for table I/O objects, otherwise NULL for file I/O and synchronization objects. NEVER NULL NO NO
+def performance_schema events_waits_current OBJECT_NAME 11 NULL YES varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references File name for file I/O objects, table name for table I/O objects, the socket's IP:PORT value for a socket object or NULL for a synchronization object. NEVER NULL NO NO
+def performance_schema events_waits_current INDEX_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name of the index, PRIMARY for the primary key, or NULL for no index used. NEVER NULL NO NO
+def performance_schema events_waits_current OBJECT_TYPE 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references FILE for a file object, TABLE or TEMPORARY TABLE for a table object, or NULL for a synchronization object. NEVER NULL NO NO
+def performance_schema events_waits_current OBJECT_INSTANCE_BEGIN 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the object. NEVER NULL NO NO
+def performance_schema events_waits_current NESTING_EVENT_ID 15 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references EVENT_ID of event within which this event nests. NEVER NULL NO NO
+def performance_schema events_waits_current NESTING_EVENT_TYPE 16 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references Nesting event type. Either statement, stage or wait. NEVER NULL NO NO
+def performance_schema events_waits_current OPERATION 17 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select,insert,update,references Operation type, for example read, write or lock NEVER NULL NO NO
+def performance_schema events_waits_current NUMBER_OF_BYTES 18 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of bytes that the operation read or wrote, or NULL for table I/O waits. NEVER NULL NO NO
+def performance_schema events_waits_current FLAGS 19 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Reserved for use in the future. NEVER NULL NO NO
+def performance_schema events_waits_history THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL NO NO
+def performance_schema events_waits_history EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL NO NO
+def performance_schema events_waits_history END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL NO NO
+def performance_schema events_waits_history EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL NO NO
+def performance_schema events_waits_history SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL NO NO
+def performance_schema events_waits_history TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL NO NO
+def performance_schema events_waits_history TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL NO NO
+def performance_schema events_waits_history TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL NO NO
+def performance_schema events_waits_history SPINS 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Number of spin rounds for a mutex, or NULL if spin rounds are not used, or spinning is not instrumented. NEVER NULL NO NO
+def performance_schema events_waits_history OBJECT_SCHEMA 10 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name of the schema that contains the table for table I/O objects, otherwise NULL for file I/O and synchronization objects. NEVER NULL NO NO
+def performance_schema events_waits_history OBJECT_NAME 11 NULL YES varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references File name for file I/O objects, table name for table I/O objects, the socket's IP:PORT value for a socket object or NULL for a synchronization object. NEVER NULL NO NO
+def performance_schema events_waits_history INDEX_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name of the index, PRIMARY for the primary key, or NULL for no index used. NEVER NULL NO NO
+def performance_schema events_waits_history OBJECT_TYPE 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references FILE for a file object, TABLE or TEMPORARY TABLE for a table object, or NULL for a synchronization object. NEVER NULL NO NO
+def performance_schema events_waits_history OBJECT_INSTANCE_BEGIN 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the object. NEVER NULL NO NO
+def performance_schema events_waits_history NESTING_EVENT_ID 15 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references EVENT_ID of event within which this event nests. NEVER NULL NO NO
+def performance_schema events_waits_history NESTING_EVENT_TYPE 16 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references Nesting event type. Either statement, stage or wait. NEVER NULL NO NO
+def performance_schema events_waits_history OPERATION 17 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select,insert,update,references Operation type, for example read, write or lock NEVER NULL NO NO
+def performance_schema events_waits_history NUMBER_OF_BYTES 18 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of bytes that the operation read or wrote, or NULL for table I/O waits. NEVER NULL NO NO
+def performance_schema events_waits_history FLAGS 19 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Reserved for use in the future. NEVER NULL NO NO
+def performance_schema events_waits_history_long THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_ID uniquely identifies the row. NEVER NULL NO NO
+def performance_schema events_waits_history_long EVENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread's current event number at the start of the event. Together with THREAD_ID uniquely identifies the row. NEVER NULL NO NO
+def performance_schema events_waits_history_long END_EVENT_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references NULL when the event starts, set to the thread's current event number at the end of the event. NEVER NULL NO NO
+def performance_schema events_waits_history_long EVENT_NAME 4 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event instrument name and a NAME from the setup_instruments table NEVER NULL NO NO
+def performance_schema events_waits_history_long SOURCE 5 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name and line number of the source file containing the instrumented code that produced the event. NEVER NULL NO NO
+def performance_schema events_waits_history_long TIMER_START 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing started or NULL if timing is not collected. NEVER NULL NO NO
+def performance_schema events_waits_history_long TIMER_END 7 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds when the event timing ended, or NULL if the event has not ended or timing is not collected. NEVER NULL NO NO
+def performance_schema events_waits_history_long TIMER_WAIT 8 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Value in picoseconds of the event's duration or NULL if the event has not ended or timing is not collected. NEVER NULL NO NO
+def performance_schema events_waits_history_long SPINS 9 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Number of spin rounds for a mutex, or NULL if spin rounds are not used, or spinning is not instrumented. NEVER NULL NO NO
+def performance_schema events_waits_history_long OBJECT_SCHEMA 10 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name of the schema that contains the table for table I/O objects, otherwise NULL for file I/O and synchronization objects. NEVER NULL NO NO
+def performance_schema events_waits_history_long OBJECT_NAME 11 NULL YES varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references File name for file I/O objects, table name for table I/O objects, the socket's IP:PORT value for a socket object or NULL for a synchronization object. NEVER NULL NO NO
+def performance_schema events_waits_history_long INDEX_NAME 12 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name of the index, PRIMARY for the primary key, or NULL for no index used. NEVER NULL NO NO
+def performance_schema events_waits_history_long OBJECT_TYPE 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references FILE for a file object, TABLE or TEMPORARY TABLE for a table object, or NULL for a synchronization object. NEVER NULL NO NO
+def performance_schema events_waits_history_long OBJECT_INSTANCE_BEGIN 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the object. NEVER NULL NO NO
+def performance_schema events_waits_history_long NESTING_EVENT_ID 15 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references EVENT_ID of event within which this event nests. NEVER NULL NO NO
+def performance_schema events_waits_history_long NESTING_EVENT_TYPE 16 NULL YES enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('TRANSACTION','STATEMENT','STAGE','WAIT') select,insert,update,references Nesting event type. Either statement, stage or wait. NEVER NULL NO NO
+def performance_schema events_waits_history_long OPERATION 17 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select,insert,update,references Operation type, for example read, write or lock NEVER NULL NO NO
+def performance_schema events_waits_history_long NUMBER_OF_BYTES 18 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of bytes that the operation read or wrote, or NULL for table I/O waits. NEVER NULL NO NO
+def performance_schema events_waits_history_long FLAGS 19 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Reserved for use in the future. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_account_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references User. Used together with HOST and EVENT_NAME for grouping events. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_account_by_event_name HOST 2 NULL YES char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) select,insert,update,references Host. Used together with USER and EVENT_NAME for grouping events. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_account_by_event_name EVENT_NAME 3 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with USER and HOST for grouping events. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_account_by_event_name COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL NO NO
+def performance_schema events_waits_summary_by_account_by_event_name SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_account_by_event_name MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_account_by_event_name AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_account_by_event_name MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_host_by_event_name HOST 1 NULL YES char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) select,insert,update,references Host. Used together with EVENT_NAME for grouping events. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_host_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with USER and HOST for grouping events. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_host_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL NO NO
+def performance_schema events_waits_summary_by_host_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_host_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_host_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_host_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_instance EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with OBJECT_INSTANCE_BEGIN for grouping events. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_instance OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references If an instrument creates multiple instances, each instance has a unique OBJECT_INSTANCE_BEGIN value to allow for grouping by instance. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_instance COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL NO NO
+def performance_schema events_waits_summary_by_instance SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_instance MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_instance AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_instance MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_thread_by_event_name THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread associated with the event. Together with EVENT_NAME uniquely identifies the row. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_thread_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with THREAD_ID for grouping events. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_thread_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL NO NO
+def performance_schema events_waits_summary_by_thread_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_thread_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_thread_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_thread_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_user_by_event_name USER 1 NULL YES char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references User. Used together with EVENT_NAME for grouping events. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_user_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. Used together with USER for grouping events. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_user_by_event_name COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL NO NO
+def performance_schema events_waits_summary_by_user_by_event_name SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_user_by_event_name MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_user_by_event_name AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_waits_summary_by_user_by_event_name MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_waits_summary_global_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL NO NO
+def performance_schema events_waits_summary_global_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL NO NO
+def performance_schema events_waits_summary_global_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_waits_summary_global_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_waits_summary_global_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema events_waits_summary_global_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema file_instances FILE_NAME 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references File name. NEVER NULL NO NO
+def performance_schema file_instances EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Instrument name associated with the file. NEVER NULL NO NO
+def performance_schema file_instances OPEN_COUNT 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Open handles on the file. A value of greater than zero means that the file is currently open. NEVER NULL NO NO
+def performance_schema file_summary_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL NO NO
+def performance_schema file_summary_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL NO NO
+def performance_schema file_summary_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_event_name COUNT_READ 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all read operations, including FGETS, FGETC, FREAD, and READ. NEVER NULL NO NO
+def performance_schema file_summary_by_event_name SUM_TIMER_READ 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_event_name MIN_TIMER_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_event_name AVG_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_event_name MAX_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_event_name SUM_NUMBER_OF_BYTES_READ 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Bytes read by read operations. NEVER NULL NO NO
+def performance_schema file_summary_by_event_name COUNT_WRITE 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all write operations, including FPUTS, FPUTC, FPRINTF, VFPRINTF, FWRITE, and PWRITE. NEVER NULL NO NO
+def performance_schema file_summary_by_event_name SUM_TIMER_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_event_name MIN_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_event_name AVG_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_event_name MAX_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_event_name SUM_NUMBER_OF_BYTES_WRITE 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Bytes written by write operations. NEVER NULL NO NO
+def performance_schema file_summary_by_event_name COUNT_MISC 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all miscellaneous operations not counted above, including CREATE, DELETE, OPEN, CLOSE, STREAM_OPEN, STREAM_CLOSE, SEEK, TELL, FLUSH, STAT, FSTAT, CHSIZE, RENAME, and SYNC. NEVER NULL NO NO
+def performance_schema file_summary_by_event_name SUM_TIMER_MISC 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all miscellaneous operations that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_event_name MIN_TIMER_MISC 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all miscellaneous operations that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_event_name AVG_TIMER_MISC 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all miscellaneous operations that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_event_name MAX_TIMER_MISC 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all miscellaneous operations that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_instance FILE_NAME 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references File name. NEVER NULL NO NO
+def performance_schema file_summary_by_instance EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL NO NO
+def performance_schema file_summary_by_instance OBJECT_INSTANCE_BEGIN 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory. Together with FILE_NAME and EVENT_NAME uniquely identifies a row. NEVER NULL NO NO
+def performance_schema file_summary_by_instance COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL NO NO
+def performance_schema file_summary_by_instance SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_instance MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_instance AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_instance MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_instance COUNT_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all read operations, including FGETS, FGETC, FREAD, and READ. NEVER NULL NO NO
+def performance_schema file_summary_by_instance SUM_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_instance MIN_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_instance AVG_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_instance MAX_TIMER_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_instance SUM_NUMBER_OF_BYTES_READ 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Bytes read by read operations. NEVER NULL NO NO
+def performance_schema file_summary_by_instance COUNT_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all write operations, including FPUTS, FPUTC, FPRINTF, VFPRINTF, FWRITE, and PWRITE. NEVER NULL NO NO
+def performance_schema file_summary_by_instance SUM_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_instance MIN_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_instance AVG_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_instance MAX_TIMER_WRITE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_instance SUM_NUMBER_OF_BYTES_WRITE 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Bytes written by write operations. NEVER NULL NO NO
+def performance_schema file_summary_by_instance COUNT_MISC 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all miscellaneous operations not counted above, including CREATE, DELETE, OPEN, CLOSE, STREAM_OPEN, STREAM_CLOSE, SEEK, TELL, FLUSH, STAT, FSTAT, CHSIZE, RENAME, and SYNC. NEVER NULL NO NO
+def performance_schema file_summary_by_instance SUM_TIMER_MISC 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all miscellaneous operations that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_instance MIN_TIMER_MISC 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all miscellaneous operations that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_instance AVG_TIMER_MISC 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all miscellaneous operations that are timed. NEVER NULL NO NO
+def performance_schema file_summary_by_instance MAX_TIMER_MISC 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all miscellaneous operations that are timed. NEVER NULL NO NO
+def performance_schema global_status VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The global status variable name. NEVER NULL NO NO
+def performance_schema global_status VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select,insert,update,references The global status variable value. NEVER NULL NO NO
+def performance_schema hosts HOST 1 NULL YES char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) select,insert,update,references Host name used by the client to connect, NULL for internal threads or user sessions that failed to authenticate. NEVER NULL NO NO
+def performance_schema hosts CURRENT_CONNECTIONS 2 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Current number of the host's connections. NEVER NULL NO NO
+def performance_schema hosts TOTAL_CONNECTIONS 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Total number of the host's connections NEVER NULL NO NO
+def performance_schema host_cache IP 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Client IP address. NEVER NULL NO NO
+def performance_schema host_cache HOST 2 NULL YES varchar 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(255) select,insert,update,references IP's resolved DNS host name, or NULL if unknown. NEVER NULL NO NO
+def performance_schema host_cache HOST_VALIDATED 3 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references YES if the IP-to-host DNS lookup was successful, and the HOST column can be used to avoid DNS calls, or NO if unsuccessful, in which case DNS lookup is performed for each connect until either successful or a permanent error. NEVER NULL NO NO
+def performance_schema host_cache SUM_CONNECT_ERRORS 4 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of connection errors. Counts only protocol handshake errors for hosts that passed validation. These errors count towards max_connect_errors. NEVER NULL NO NO
+def performance_schema host_cache COUNT_HOST_BLOCKED_ERRORS 5 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of blocked connections because SUM_CONNECT_ERRORS exceeded the max_connect_errors system variable. NEVER NULL NO NO
+def performance_schema host_cache COUNT_NAMEINFO_TRANSIENT_ERRORS 6 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of transient errors during IP-to-host DNS lookups. NEVER NULL NO NO
+def performance_schema host_cache COUNT_NAMEINFO_PERMANENT_ERRORS 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of permanent errors during IP-to-host DNS lookups. NEVER NULL NO NO
+def performance_schema host_cache COUNT_FORMAT_ERRORS 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of host name format errors, for example a numeric host column. NEVER NULL NO NO
+def performance_schema host_cache COUNT_ADDRINFO_TRANSIENT_ERRORS 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of transient errors during host-to-IP reverse DNS lookups. NEVER NULL NO NO
+def performance_schema host_cache COUNT_ADDRINFO_PERMANENT_ERRORS 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of permanent errors during host-to-IP reverse DNS lookups. NEVER NULL NO NO
+def performance_schema host_cache COUNT_FCRDNS_ERRORS 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of forward-confirmed reverse DNS errors, which occur when IP-to-host DNS lookup does not match the originating IP address. NEVER NULL NO NO
+def performance_schema host_cache COUNT_HOST_ACL_ERRORS 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors occurring because no user from the host is permitted to log in. These attempts return error code 1130 ER_HOST_NOT_PRIVILEGED and do not proceed to username and password authentication. NEVER NULL NO NO
+def performance_schema host_cache COUNT_NO_AUTH_PLUGIN_ERRORS 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors due to requesting an authentication plugin that was not available. This can be due to the plugin never having been loaded, or the load attempt failing. NEVER NULL NO NO
+def performance_schema host_cache COUNT_AUTH_PLUGIN_ERRORS 14 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors reported by an authentication plugin. Plugins can increment COUNT_AUTHENTICATION_ERRORS or COUNT_HANDSHAKE_ERRORS instead, but, if specified or the error is unknown, this column is incremented. NEVER NULL NO NO
+def performance_schema host_cache COUNT_HANDSHAKE_ERRORS 15 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors detected at the wire protocol level. NEVER NULL NO NO
+def performance_schema host_cache COUNT_PROXY_USER_ERRORS 16 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors detected when a proxy user is proxied to a user that does not exist. NEVER NULL NO NO
+def performance_schema host_cache COUNT_PROXY_USER_ACL_ERRORS 17 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors detected when a proxy user is proxied to a user that exists, but the proxy user doesn't have the PROXY privilege. NEVER NULL NO NO
+def performance_schema host_cache COUNT_AUTHENTICATION_ERRORS 18 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors where authentication failed. NEVER NULL NO NO
+def performance_schema host_cache COUNT_SSL_ERRORS 19 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors due to TLS problems. NEVER NULL NO NO
+def performance_schema host_cache COUNT_MAX_USER_CONNECTIONS_ERRORS 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors due to the per-user quota being exceeded. NEVER NULL NO NO
+def performance_schema host_cache COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS 21 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors due to the per-hour quota being exceeded. NEVER NULL NO NO
+def performance_schema host_cache COUNT_DEFAULT_DATABASE_ERRORS 22 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors due to the user not having permission to access the specified default database, or it not existing. NEVER NULL NO NO
+def performance_schema host_cache COUNT_INIT_CONNECT_ERRORS 23 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of errors due to statements in the init_connect system variable. NEVER NULL NO NO
+def performance_schema host_cache COUNT_LOCAL_ERRORS 24 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of local server errors, such as out-of-memory errors, unrelated to network, authentication, or authorization. NEVER NULL NO NO
+def performance_schema host_cache COUNT_UNKNOWN_ERRORS 25 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of unknown errors that cannot be allocated to another column. NEVER NULL NO NO
+def performance_schema host_cache FIRST_SEEN 26 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references Timestamp of the first connection attempt by the IP. NEVER NULL NO NO
+def performance_schema host_cache LAST_SEEN 27 '0000-00-00 00:00:00' NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references Timestamp of the most recent connection attempt by the IP. NEVER NULL NO NO
+def performance_schema host_cache FIRST_ERROR_SEEN 28 '0000-00-00 00:00:00' YES timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references Timestamp of the first error seen from the IP. NEVER NULL NO NO
+def performance_schema host_cache LAST_ERROR_SEEN 29 '0000-00-00 00:00:00' YES timestamp NULL NULL NULL NULL 0 NULL NULL timestamp select,insert,update,references Timestamp of the most recent error seen from the IP. NEVER NULL NO NO
+def performance_schema memory_summary_by_account_by_event_name USER 1 NULL YES char 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin char(32) select,insert,update,references User portion of the account. NEVER NULL NO NO
+def performance_schema memory_summary_by_account_by_event_name HOST 2 NULL YES char 60 180 NULL NULL NULL utf8mb3 utf8mb3_bin char(60) select,insert,update,references Host portion of the account. NEVER NULL NO NO
+def performance_schema memory_summary_by_account_by_event_name EVENT_NAME 3 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL NO NO
+def performance_schema memory_summary_by_account_by_event_name COUNT_ALLOC 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of allocations to memory. NEVER NULL NO NO
+def performance_schema memory_summary_by_account_by_event_name COUNT_FREE 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of attempts to free the allocated memory. NEVER NULL NO NO
+def performance_schema memory_summary_by_account_by_event_name SUM_NUMBER_OF_BYTES_ALLOC 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of bytes allocated. NEVER NULL NO NO
+def performance_schema memory_summary_by_account_by_event_name SUM_NUMBER_OF_BYTES_FREE 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of bytes freed NEVER NULL NO NO
+def performance_schema memory_summary_by_account_by_event_name LOW_COUNT_USED 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Lowest number of allocated blocks (lowest value of CURRENT_COUNT_USED). NEVER NULL NO NO
+def performance_schema memory_summary_by_account_by_event_name CURRENT_COUNT_USED 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Currently allocated blocks that have not been freed (COUNT_ALLOC minus COUNT_FREE). NEVER NULL NO NO
+def performance_schema memory_summary_by_account_by_event_name HIGH_COUNT_USED 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Highest number of allocated blocks (highest value of CURRENT_COUNT_USED). NEVER NULL NO NO
+def performance_schema memory_summary_by_account_by_event_name LOW_NUMBER_OF_BYTES_USED 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Lowest number of bytes used. NEVER NULL NO NO
+def performance_schema memory_summary_by_account_by_event_name CURRENT_NUMBER_OF_BYTES_USED 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Current number of bytes used (total allocated minus total freed). NEVER NULL NO NO
+def performance_schema memory_summary_by_account_by_event_name HIGH_NUMBER_OF_BYTES_USED 13 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Highest number of bytes used. NEVER NULL NO NO
+def performance_schema memory_summary_by_host_by_event_name HOST 1 NULL YES char 60 180 NULL NULL NULL utf8mb3 utf8mb3_bin char(60) select,insert,update,references Host portion of the account. NEVER NULL NO NO
+def performance_schema memory_summary_by_host_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL NO NO
+def performance_schema memory_summary_by_host_by_event_name COUNT_ALLOC 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of allocations to memory. NEVER NULL NO NO
+def performance_schema memory_summary_by_host_by_event_name COUNT_FREE 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of attempts to free the allocated memory. NEVER NULL NO NO
+def performance_schema memory_summary_by_host_by_event_name SUM_NUMBER_OF_BYTES_ALLOC 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of bytes allocated. NEVER NULL NO NO
+def performance_schema memory_summary_by_host_by_event_name SUM_NUMBER_OF_BYTES_FREE 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of bytes freed NEVER NULL NO NO
+def performance_schema memory_summary_by_host_by_event_name LOW_COUNT_USED 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Lowest number of allocated blocks (lowest value of CURRENT_COUNT_USED). NEVER NULL NO NO
+def performance_schema memory_summary_by_host_by_event_name CURRENT_COUNT_USED 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Currently allocated blocks that have not been freed (COUNT_ALLOC minus COUNT_FREE). NEVER NULL NO NO
+def performance_schema memory_summary_by_host_by_event_name HIGH_COUNT_USED 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Highest number of allocated blocks (highest value of CURRENT_COUNT_USED). NEVER NULL NO NO
+def performance_schema memory_summary_by_host_by_event_name LOW_NUMBER_OF_BYTES_USED 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Lowest number of bytes used. NEVER NULL NO NO
+def performance_schema memory_summary_by_host_by_event_name CURRENT_NUMBER_OF_BYTES_USED 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Current number of bytes used (total allocated minus total freed). NEVER NULL NO NO
+def performance_schema memory_summary_by_host_by_event_name HIGH_NUMBER_OF_BYTES_USED 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Highest number of bytes used. NEVER NULL NO NO
+def performance_schema memory_summary_by_thread_by_event_name THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread id. NEVER NULL NO NO
+def performance_schema memory_summary_by_thread_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL NO NO
+def performance_schema memory_summary_by_thread_by_event_name COUNT_ALLOC 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of allocations to memory. NEVER NULL NO NO
+def performance_schema memory_summary_by_thread_by_event_name COUNT_FREE 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of attempts to free the allocated memory. NEVER NULL NO NO
+def performance_schema memory_summary_by_thread_by_event_name SUM_NUMBER_OF_BYTES_ALLOC 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of bytes allocated. NEVER NULL NO NO
+def performance_schema memory_summary_by_thread_by_event_name SUM_NUMBER_OF_BYTES_FREE 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of bytes freed NEVER NULL NO NO
+def performance_schema memory_summary_by_thread_by_event_name LOW_COUNT_USED 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Lowest number of allocated blocks (lowest value of CURRENT_COUNT_USED). NEVER NULL NO NO
+def performance_schema memory_summary_by_thread_by_event_name CURRENT_COUNT_USED 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Currently allocated blocks that have not been freed (COUNT_ALLOC minus COUNT_FREE). NEVER NULL NO NO
+def performance_schema memory_summary_by_thread_by_event_name HIGH_COUNT_USED 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Highest number of allocated blocks (highest value of CURRENT_COUNT_USED). NEVER NULL NO NO
+def performance_schema memory_summary_by_thread_by_event_name LOW_NUMBER_OF_BYTES_USED 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Lowest number of bytes used. NEVER NULL NO NO
+def performance_schema memory_summary_by_thread_by_event_name CURRENT_NUMBER_OF_BYTES_USED 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Current number of bytes used (total allocated minus total freed). NEVER NULL NO NO
+def performance_schema memory_summary_by_thread_by_event_name HIGH_NUMBER_OF_BYTES_USED 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Highest number of bytes used. NEVER NULL NO NO
+def performance_schema memory_summary_by_user_by_event_name USER 1 NULL YES char 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin char(32) select,insert,update,references User portion of the account. NEVER NULL NO NO
+def performance_schema memory_summary_by_user_by_event_name EVENT_NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL NO NO
+def performance_schema memory_summary_by_user_by_event_name COUNT_ALLOC 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of allocations to memory. NEVER NULL NO NO
+def performance_schema memory_summary_by_user_by_event_name COUNT_FREE 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of attempts to free the allocated memory. NEVER NULL NO NO
+def performance_schema memory_summary_by_user_by_event_name SUM_NUMBER_OF_BYTES_ALLOC 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of bytes allocated. NEVER NULL NO NO
+def performance_schema memory_summary_by_user_by_event_name SUM_NUMBER_OF_BYTES_FREE 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of bytes freed NEVER NULL NO NO
+def performance_schema memory_summary_by_user_by_event_name LOW_COUNT_USED 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Lowest number of allocated blocks (lowest value of CURRENT_COUNT_USED). NEVER NULL NO NO
+def performance_schema memory_summary_by_user_by_event_name CURRENT_COUNT_USED 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Currently allocated blocks that have not been freed (COUNT_ALLOC minus COUNT_FREE). NEVER NULL NO NO
+def performance_schema memory_summary_by_user_by_event_name HIGH_COUNT_USED 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Highest number of allocated blocks (highest value of CURRENT_COUNT_USED). NEVER NULL NO NO
+def performance_schema memory_summary_by_user_by_event_name LOW_NUMBER_OF_BYTES_USED 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Lowest number of bytes used. NEVER NULL NO NO
+def performance_schema memory_summary_by_user_by_event_name CURRENT_NUMBER_OF_BYTES_USED 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Current number of bytes used (total allocated minus total freed). NEVER NULL NO NO
+def performance_schema memory_summary_by_user_by_event_name HIGH_NUMBER_OF_BYTES_USED 12 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Highest number of bytes used. NEVER NULL NO NO
+def performance_schema memory_summary_global_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Event name. NEVER NULL NO NO
+def performance_schema memory_summary_global_by_event_name COUNT_ALLOC 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of allocations to memory. NEVER NULL NO NO
+def performance_schema memory_summary_global_by_event_name COUNT_FREE 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of attempts to free the allocated memory. NEVER NULL NO NO
+def performance_schema memory_summary_global_by_event_name SUM_NUMBER_OF_BYTES_ALLOC 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of bytes allocated. NEVER NULL NO NO
+def performance_schema memory_summary_global_by_event_name SUM_NUMBER_OF_BYTES_FREE 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total number of bytes freed NEVER NULL NO NO
+def performance_schema memory_summary_global_by_event_name LOW_COUNT_USED 6 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Lowest number of allocated blocks (lowest value of CURRENT_COUNT_USED). NEVER NULL NO NO
+def performance_schema memory_summary_global_by_event_name CURRENT_COUNT_USED 7 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Currently allocated blocks that have not been freed (COUNT_ALLOC minus COUNT_FREE). NEVER NULL NO NO
+def performance_schema memory_summary_global_by_event_name HIGH_COUNT_USED 8 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Highest number of allocated blocks (highest value of CURRENT_COUNT_USED). NEVER NULL NO NO
+def performance_schema memory_summary_global_by_event_name LOW_NUMBER_OF_BYTES_USED 9 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Lowest number of bytes used. NEVER NULL NO NO
+def performance_schema memory_summary_global_by_event_name CURRENT_NUMBER_OF_BYTES_USED 10 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Current number of bytes used (total allocated minus total freed). NEVER NULL NO NO
+def performance_schema memory_summary_global_by_event_name HIGH_NUMBER_OF_BYTES_USED 11 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Highest number of bytes used. NEVER NULL NO NO
+def performance_schema metadata_locks OBJECT_TYPE 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Object type. One of BACKUP, COMMIT, EVENT, FUNCTION, GLOBAL, LOCKING SERVICE, PROCEDURE, SCHEMA, TABLE, TABLESPACE, TRIGGER (unused) or USER LEVEL LOCK. NEVER NULL NO NO
+def performance_schema metadata_locks OBJECT_SCHEMA 2 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Object schema. NEVER NULL NO NO
+def performance_schema metadata_locks OBJECT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Object name. NEVER NULL NO NO
+def performance_schema metadata_locks OBJECT_INSTANCE_BEGIN 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the instrumented object. NEVER NULL NO NO
+def performance_schema metadata_locks LOCK_TYPE 5 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select,insert,update,references Lock type. One of BACKUP_FTWRL1, BACKUP_START, BACKUP_TRANS_DML, EXCLUSIVE, INTENTION_EXCLUSIVE, SHARED, SHARED_HIGH_PRIO, SHARED_NO_READ_WRITE, SHARED_NO_WRITE, SHARED_READ, SHARED_UPGRADABLE or SHARED_WRITE. NEVER NULL NO NO
+def performance_schema metadata_locks LOCK_DURATION 6 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select,insert,update,references Lock duration. One of EXPLICIT (locks released by explicit action, for example a global lock acquired with FLUSH TABLES WITH READ LOCK) , STATEMENT (locks implicitly released at statement end) or TRANSACTION (locks implicitly released at transaction end). NEVER NULL NO NO
+def performance_schema metadata_locks LOCK_STATUS 7 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(32) select,insert,update,references Lock status. One of GRANTED, KILLED, PENDING, POST_RELEASE_NOTIFY, PRE_ACQUIRE_NOTIFY, TIMEOUT or VICTIM. NEVER NULL NO NO
+def performance_schema metadata_locks SOURCE 8 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Source file containing the instrumented code that produced the event, as well as the line number where the instrumentation occurred. This allows one to examine the source code involved. NEVER NULL NO NO
+def performance_schema metadata_locks OWNER_THREAD_ID 9 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread that requested the lock. NEVER NULL NO NO
+def performance_schema metadata_locks OWNER_EVENT_ID 10 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Event that requested the lock. NEVER NULL NO NO
+def performance_schema mutex_instances NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Instrument name associated with the mutex. NEVER NULL NO NO
+def performance_schema mutex_instances OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Memory address of the instrumented mutex. NEVER NULL NO NO
+def performance_schema mutex_instances LOCKED_BY_THREAD_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The THREAD_ID of the locking thread if a thread has a mutex locked, otherwise NULL. NEVER NULL NO NO
+def performance_schema objects_summary_global_by_type OBJECT_TYPE 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Groups records together with OBJECT_SCHEMA and OBJECT_NAME. NEVER NULL NO NO
+def performance_schema objects_summary_global_by_type OBJECT_SCHEMA 2 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Groups records together with OBJECT_TYPE and OBJECT_NAME. NEVER NULL NO NO
+def performance_schema objects_summary_global_by_type OBJECT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Groups records together with OBJECT_SCHEMA and OBJECT_TYPE. NEVER NULL NO NO
+def performance_schema objects_summary_global_by_type COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL NO NO
+def performance_schema objects_summary_global_by_type SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema objects_summary_global_by_type MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema objects_summary_global_by_type AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema objects_summary_global_by_type MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema performance_timers TIMER_NAME 1 NULL NO enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') select,insert,update,references Time name, used in the setup_timers table. NEVER NULL NO NO
+def performance_schema performance_timers TIMER_FREQUENCY 2 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of timer units per second. Dependent on the processor speed. NEVER NULL NO NO
+def performance_schema performance_timers TIMER_RESOLUTION 3 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Number of timer units by which timed values increase each time. NEVER NULL NO NO
+def performance_schema performance_timers TIMER_OVERHEAD 4 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Minimum timer overhead, determined during initialization by calling the timer 20 times and selecting the smallest value. Total overhead will be at least double this, as the timer is called at the beginning and end of each timed event. NEVER NULL NO NO
+def performance_schema prepared_statements_instances OBJECT_INSTANCE_BEGIN 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The address in memory of the instrumented prepared statement. NEVER NULL NO NO
+def performance_schema prepared_statements_instances STATEMENT_ID 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The internal statement ID assigned by the server. NEVER NULL NO NO
+def performance_schema prepared_statements_instances STATEMENT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references For the binary protocol, this column is NULL. For the text protocol, this column is the external statement name assigned by the user. NEVER NULL NO NO
+def performance_schema prepared_statements_instances SQL_TEXT 4 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references The prepared statement text, with ? placeholder markers. NEVER NULL NO NO
+def performance_schema prepared_statements_instances OWNER_THREAD_ID 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Event thread id that created the prepared statement. NEVER NULL NO NO
+def performance_schema prepared_statements_instances OWNER_EVENT_ID 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Event id that created the prepared statement. NEVER NULL NO NO
+def performance_schema prepared_statements_instances OWNER_OBJECT_TYPE 7 NULL YES enum 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('EVENT','FUNCTION','PROCEDURE','TABLE','TRIGGER') select,insert,update,references NULL for a prepared statement created by a client session. Type of the stored program that created the prepared statement. NEVER NULL NO NO
+def performance_schema prepared_statements_instances OWNER_OBJECT_SCHEMA 8 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NULL for a prepared statement created by a client session. Schema of the stored program that created the prepared statement. NEVER NULL NO NO
+def performance_schema prepared_statements_instances OWNER_OBJECT_NAME 9 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references NULL for a prepared statement created by a client session. Name of the stored program that created the prepared statement. NEVER NULL NO NO
+def performance_schema prepared_statements_instances TIMER_PREPARE 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The time spent executing the statement preparation itself. NEVER NULL NO NO
+def performance_schema prepared_statements_instances COUNT_REPREPARE 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of times the statement was reprepared internally. NEVER NULL NO NO
+def performance_schema prepared_statements_instances COUNT_EXECUTE 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total times the prepared statement was executed. NEVER NULL NO NO
+def performance_schema prepared_statements_instances SUM_TIMER_EXECUTE 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total time spent executing all prepared statements. NEVER NULL NO NO
+def performance_schema prepared_statements_instances MIN_TIMER_EXECUTE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum time spent executing any of the prepared statements. NEVER NULL NO NO
+def performance_schema prepared_statements_instances AVG_TIMER_EXECUTE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average time spent executing any of the prepared statements. NEVER NULL NO NO
+def performance_schema prepared_statements_instances MAX_TIMER_EXECUTE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum time spent executing any of the prepared statements. NEVER NULL NO NO
+def performance_schema prepared_statements_instances SUM_LOCK_TIME 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total time spent (in picoseconds) waiting for table locks for the prepared statements. NEVER NULL NO NO
+def performance_schema prepared_statements_instances SUM_ERRORS 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of errors that occurend for the prepared statements. NEVER NULL NO NO
+def performance_schema prepared_statements_instances SUM_WARNINGS 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of warnings that occurend for the prepared statements. NEVER NULL NO NO
+def performance_schema prepared_statements_instances SUM_ROWS_AFFECTED 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of affected rows by the prepared statements. NEVER NULL NO NO
+def performance_schema prepared_statements_instances SUM_ROWS_SENT 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of rows returned by the prepared statements. NEVER NULL NO NO
+def performance_schema prepared_statements_instances SUM_ROWS_EXAMINED 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of rows examined by the prepared statements. NEVER NULL NO NO
+def performance_schema prepared_statements_instances SUM_CREATED_TMP_DISK_TABLES 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of on-disk temporary tables created by the prepared statements. NEVER NULL NO NO
+def performance_schema prepared_statements_instances SUM_CREATED_TMP_TABLES 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of in-memory temporary tables created by the prepared statements. NEVER NULL NO NO
+def performance_schema prepared_statements_instances SUM_SELECT_FULL_JOIN 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of full joins executed by the prepared statements. NEVER NULL NO NO
+def performance_schema prepared_statements_instances SUM_SELECT_FULL_RANGE_JOIN 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of range search joins executed by the prepared statements. NEVER NULL NO NO
+def performance_schema prepared_statements_instances SUM_SELECT_RANGE 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of joins that used ranges on the first table executed by the prepared statements. NEVER NULL NO NO
+def performance_schema prepared_statements_instances SUM_SELECT_RANGE_CHECK 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of joins that check for key usage after each row executed by the prepared statements. NEVER NULL NO NO
+def performance_schema prepared_statements_instances SUM_SELECT_SCAN 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of joins that did a full scan of the first table executed by the prepared statements. NEVER NULL NO NO
+def performance_schema prepared_statements_instances SUM_SORT_MERGE_PASSES 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of merge passes that the sort algorithm has had to do for the prepared statements. NEVER NULL NO NO
+def performance_schema prepared_statements_instances SUM_SORT_RANGE 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of sorts that were done using ranges for the prepared statements. NEVER NULL NO NO
+def performance_schema prepared_statements_instances SUM_SORT_ROWS 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of sorted rows that were sorted by the prepared statements. NEVER NULL NO NO
+def performance_schema prepared_statements_instances SUM_SORT_SCAN 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of sorts that were done by scanning the table by the prepared statements. NEVER NULL NO NO
+def performance_schema prepared_statements_instances SUM_NO_INDEX_USED 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of statements that performed a table scan without using an index. NEVER NULL NO NO
+def performance_schema prepared_statements_instances SUM_NO_GOOD_INDEX_USED 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The total number of statements where no good index was found. NEVER NULL NO NO
+def performance_schema replication_applier_configuration CHANNEL_NAME 1 NULL NO varchar 256 768 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(256) select,insert,update,references Replication channel name. NEVER NULL NO NO
+def performance_schema replication_applier_configuration DESIRED_DELAY 2 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Target number of seconds the replica should be delayed to the master. NEVER NULL NO NO
+def performance_schema replication_applier_status CHANNEL_NAME 1 NULL NO varchar 256 768 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(256) select,insert,update,references The replication channel name. NEVER NULL NO NO
+def performance_schema replication_applier_status SERVICE_STATE 2 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('ON','OFF') select,insert,update,references Shows ON when the replication channel's applier threads are active or idle, OFF means that the applier threads are not active. NEVER NULL NO NO
+def performance_schema replication_applier_status REMAINING_DELAY 3 NULL YES int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Seconds the replica needs to wait to reach the desired delay from master. NEVER NULL NO NO
+def performance_schema replication_applier_status COUNT_TRANSACTIONS_RETRIES 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of retries that were made because the replication SQL thread failed to apply a transaction. NEVER NULL NO NO
+def performance_schema replication_applier_status_by_coordinator CHANNEL_NAME 1 NULL NO varchar 256 768 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(256) select,insert,update,references Replication channel name. NEVER NULL NO NO
+def performance_schema replication_applier_status_by_coordinator THREAD_ID 2 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The SQL/coordinator thread ID. NEVER NULL NO NO
+def performance_schema replication_applier_status_by_coordinator SERVICE_STATE 3 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('ON','OFF') select,insert,update,references ON (thread exists and is active or idle) or OFF (thread no longer exists). NEVER NULL NO NO
+def performance_schema replication_applier_status_by_coordinator LAST_ERROR_NUMBER 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Last error number that caused the SQL/coordinator thread to stop. NEVER NULL NO NO
+def performance_schema replication_applier_status_by_coordinator LAST_ERROR_MESSAGE 5 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select,insert,update,references Last error message that caused the SQL/coordinator thread to stop. NEVER NULL NO NO
+def performance_schema replication_applier_status_by_coordinator LAST_ERROR_TIMESTAMP 6 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references Timestamp that shows when the most recent SQL/coordinator error occurred. NEVER NULL NO NO
+def performance_schema replication_applier_status_by_coordinator LAST_SEEN_TRANSACTION 7 NULL NO char 57 171 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(57) select,insert,update,references The transaction the worker has last seen. NEVER NULL NO NO
+def performance_schema replication_applier_status_by_coordinator LAST_TRANS_RETRY_COUNT 8 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Total number of retries attempted by last transaction. NEVER NULL NO NO
+def performance_schema replication_applier_status_by_worker CHANNEL_NAME 1 NULL NO varchar 256 768 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(256) select,insert,update,references Name of replication channel through which the transaction is received. NEVER NULL NO NO
+def performance_schema replication_applier_status_by_worker THREAD_ID 2 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread_Id as displayed in the performance_schema.threads table for thread with name 'thread/sql/rpl_parallel_thread'. THREAD_ID will be NULL when worker threads are stopped due to error/force stop. NEVER NULL NO NO
+def performance_schema replication_applier_status_by_worker SERVICE_STATE 3 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('ON','OFF') select,insert,update,references Whether or not the thread is running. NEVER NULL NO NO
+def performance_schema replication_applier_status_by_worker LAST_SEEN_TRANSACTION 4 NULL NO char 57 171 NULL NULL NULL utf8mb3 utf8mb3_general_ci char(57) select,insert,update,references Last GTID executed by worker NEVER NULL NO NO
+def performance_schema replication_applier_status_by_worker LAST_ERROR_NUMBER 5 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Last Error that occurred on a particular worker. NEVER NULL NO NO
+def performance_schema replication_applier_status_by_worker LAST_ERROR_MESSAGE 6 NULL NO varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select,insert,update,references Last error specific message. NEVER NULL NO NO
+def performance_schema replication_applier_status_by_worker LAST_ERROR_TIMESTAMP 7 current_timestamp() NO timestamp NULL NULL NULL NULL 0 NULL NULL timestamp on update current_timestamp() select,insert,update,references Time stamp of last error. NEVER NULL NO NO
+def performance_schema replication_applier_status_by_worker WORKER_IDLE_TIME 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total idle time in seconds that the worker thread has spent waiting for work from SQL thread. NEVER NULL NO NO
+def performance_schema replication_applier_status_by_worker LAST_TRANS_RETRY_COUNT 9 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Total number of retries attempted by last transaction. NEVER NULL NO NO
+def performance_schema replication_connection_configuration CHANNEL_NAME 1 NULL NO varchar 256 768 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(256) select,insert,update,references The replication channel used. NEVER NULL NO NO
+def performance_schema replication_connection_configuration HOST 2 NULL NO char 60 180 NULL NULL NULL utf8mb3 utf8mb3_bin char(60) select,insert,update,references The host name of the source that the replica is connected to. NEVER NULL NO NO
+def performance_schema replication_connection_configuration PORT 3 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references The port used to connect to the source. NEVER NULL NO NO
+def performance_schema replication_connection_configuration USER 4 NULL NO char 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin char(32) select,insert,update,references The user name of the replication user account used to connect to the source. NEVER NULL NO NO
+def performance_schema replication_connection_configuration USING_GTID 5 NULL NO enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('NO','CURRENT_POS','SLAVE_POS') select,insert,update,references Whether replication is using GTIDs or not NEVER NULL NO NO
+def performance_schema replication_connection_configuration SSL_ALLOWED 6 NULL NO enum 7 21 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO','IGNORED') select,insert,update,references Whether SSL is allowed for the replica connection. NEVER NULL NO NO
+def performance_schema replication_connection_configuration SSL_CA_FILE 7 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references Path to the file that contains one or more certificates for trusted Certificate Authorities (CA) to use for TLS. NEVER NULL NO NO
+def performance_schema replication_connection_configuration SSL_CA_PATH 8 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references Path to a directory that contains one or more PEM files that contain X509 certificates for a trusted Certificate Authority (CA) to use for TLS. NEVER NULL NO NO
+def performance_schema replication_connection_configuration SSL_CERTIFICATE 9 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references Path to the certificate used to authenticate the master. NEVER NULL NO NO
+def performance_schema replication_connection_configuration SSL_CIPHER 10 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references Which cipher is used for encription. NEVER NULL NO NO
+def performance_schema replication_connection_configuration SSL_KEY 11 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select,insert,update,references Path to the private key used for TLS. NEVER NULL NO NO
+def performance_schema replication_connection_configuration SSL_VERIFY_SERVER_CERTIFICATE 12 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references Whether the server certificate is verified as part of the SSL connection NEVER NULL NO NO
+def performance_schema replication_connection_configuration SSL_CRL_FILE 13 NULL NO varchar 255 765 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(255) select,insert,update,references Path to the PEM file containing one or more revoked X.509 certificates. NEVER NULL NO NO
+def performance_schema replication_connection_configuration SSL_CRL_PATH 14 NULL NO varchar 255 765 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(255) select,insert,update,references PATH to a folder containing PEM files containing one or more revoked X.509 certificates. NEVER NULL NO NO
+def performance_schema replication_connection_configuration CONNECTION_RETRY_INTERVAL 15 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references The number of seconds between connect retries. NEVER NULL NO NO
+def performance_schema replication_connection_configuration CONNECTION_RETRY_COUNT 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The number of times the replica can attempt to reconnect to the source in the event of a lost connection. NEVER NULL NO NO
+def performance_schema replication_connection_configuration HEARTBEAT_INTERVAL 17 NULL NO double NULL NULL 10 3 NULL NULL NULL double(10,3) unsigned select,insert,update,references Number of seconds after which a heartbeat will be sent. NEVER NULL NO NO
+def performance_schema replication_connection_configuration IGNORE_SERVER_IDS 18 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references Binary log events from servers (ids) to ignore. NEVER NULL NO NO
+def performance_schema replication_connection_configuration REPL_DO_DOMAIN_IDS 19 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references Only apply binary logs from these domain ids. NEVER NULL NO NO
+def performance_schema replication_connection_configuration REPL_IGNORE_DOMAIN_IDS 20 NULL NO longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references Binary log events from domains to ignore. NEVER NULL NO NO
+def performance_schema rwlock_instances NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Instrument name associated with the read write lock NEVER NULL NO NO
+def performance_schema rwlock_instances OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory of the instrumented lock NEVER NULL NO NO
+def performance_schema rwlock_instances WRITE_LOCKED_BY_THREAD_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references THREAD_ID of the locking thread if locked in write (exclusive) mode, otherwise NULL. NEVER NULL NO NO
+def performance_schema rwlock_instances READ_LOCKED_BY_COUNT 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(10) unsigned select,insert,update,references Count of current read locks held NEVER NULL NO NO
+def performance_schema session_account_connect_attrs PROCESSLIST_ID 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Session connection identifier. NEVER NULL NO NO
+def performance_schema session_account_connect_attrs ATTR_NAME 2 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(32) select,insert,update,references Attribute name. NEVER NULL NO NO
+def performance_schema session_account_connect_attrs ATTR_VALUE 3 NULL YES varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(1024) select,insert,update,references Attribute value. NEVER NULL NO NO
+def performance_schema session_account_connect_attrs ORDINAL_POSITION 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Order in which attribute was added to the connection attributes. NEVER NULL NO NO
+def performance_schema session_connect_attrs PROCESSLIST_ID 1 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Session connection identifier. NEVER NULL NO NO
+def performance_schema session_connect_attrs ATTR_NAME 2 NULL NO varchar 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(32) select,insert,update,references Attribute name. NEVER NULL NO NO
+def performance_schema session_connect_attrs ATTR_VALUE 3 NULL YES varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_bin varchar(1024) select,insert,update,references Attribute value. NEVER NULL NO NO
+def performance_schema session_connect_attrs ORDINAL_POSITION 4 NULL YES int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references Order in which attribute was added to the connection attributes. NEVER NULL NO NO
+def performance_schema session_status VARIABLE_NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The session status variable name. NEVER NULL NO NO
+def performance_schema session_status VARIABLE_VALUE 2 NULL YES varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select,insert,update,references The session status variable value. NEVER NULL NO NO
+def performance_schema setup_actors HOST 1 '%' NO char 255 765 NULL NULL NULL utf8mb3 utf8mb3_bin char(255) select,insert,update,references Host name, either a literal, or the % wildcard representing any host. NEVER NULL NO NO
+def performance_schema setup_actors USER 2 '%' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references User name, either a literal or the % wildcard representing any name. NEVER NULL NO NO
+def performance_schema setup_actors ROLE 3 '%' NO char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references Unused NEVER NULL NO NO
+def performance_schema setup_actors ENABLED 4 'YES' NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references Whether to enable instrumentation for foreground threads matched by the row. NEVER NULL NO NO
+def performance_schema setup_actors HISTORY 5 'YES' NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references Whether to log historical events for foreground threads matched by the row. NEVER NULL NO NO
+def performance_schema setup_consumers NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Consumer name NEVER NULL NO NO
+def performance_schema setup_consumers ENABLED 2 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references YES or NO for whether or not the consumer is enabled. You can modify this column to ensure that event information is added, or is not added. NEVER NULL NO NO
+def performance_schema setup_instruments NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Instrument name NEVER NULL NO NO
+def performance_schema setup_instruments ENABLED 2 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references Whether or not the instrument is enabled. It can be disabled, and the instrument will produce no events. NEVER NULL NO NO
+def performance_schema setup_instruments TIMED 3 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references Whether or not the instrument is timed. It can be set, but if disabled, events produced by the instrument will have NULL values for the corresponding TIMER_START, TIMER_END, and TIMER_WAIT values. NEVER NULL NO NO
+def performance_schema setup_objects OBJECT_TYPE 1 'TABLE' NO enum 9 27 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('EVENT','FUNCTION','PROCEDURE','TABLE','TRIGGER') select,insert,update,references Type of object to instrument. NEVER NULL NO NO
+def performance_schema setup_objects OBJECT_SCHEMA 2 '%' YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Schema containing the object, either the literal or % for any schema. NEVER NULL NO NO
+def performance_schema setup_objects OBJECT_NAME 3 '%' NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Name of the instrumented object, either the literal or % for any object. NEVER NULL NO NO
+def performance_schema setup_objects ENABLED 4 'YES' NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references Whether the object's events are instrumented or not. Can be disabled, in which case monitoring is not enabled for those objects. NEVER NULL NO NO
+def performance_schema setup_objects TIMED 5 'YES' NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references Whether the object's events are timed or not. Can be modified. NEVER NULL NO NO
+def performance_schema setup_timers NAME 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Type of instrument the timer is used for. NEVER NULL NO NO
+def performance_schema setup_timers TIMER_NAME 2 NULL NO enum 11 33 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') select,insert,update,references Timer applying to the instrument type. Can be modified. NEVER NULL NO NO
+def performance_schema socket_instances EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references NAME from the setup_instruments table, and the name of the wait/io/socket/* instrument that produced the event. NEVER NULL NO NO
+def performance_schema socket_instances OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Memory address of the object. NEVER NULL NO NO
+def performance_schema socket_instances THREAD_ID 3 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Thread identifier that the server assigns to each socket. NEVER NULL NO NO
+def performance_schema socket_instances SOCKET_ID 4 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references The socket's internal file handle. NEVER NULL NO NO
+def performance_schema socket_instances IP 5 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Client IP address. Blank for Unix socket file, otherwise an IPv4 or IPv6 address. Together with the PORT identifies the connection. NEVER NULL NO NO
+def performance_schema socket_instances PORT 6 NULL NO int NULL NULL 10 0 NULL NULL NULL int(11) select,insert,update,references TCP/IP port number, from 0 to 65535. Together with the IP identifies the connection. NEVER NULL NO NO
+def performance_schema socket_instances STATE 7 NULL NO enum 6 18 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('IDLE','ACTIVE') select,insert,update,references Socket status, either IDLE if waiting to receive a request from a client, or ACTIVE NEVER NULL NO NO
+def performance_schema socket_summary_by_event_name EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Socket instrument. NEVER NULL NO NO
+def performance_schema socket_summary_by_event_name COUNT_STAR 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL NO NO
+def performance_schema socket_summary_by_event_name SUM_TIMER_WAIT 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_event_name MIN_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_event_name AVG_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_event_name MAX_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_event_name COUNT_READ 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all read operations, including RECV, RECVFROM, and RECVMSG. NEVER NULL NO NO
+def performance_schema socket_summary_by_event_name SUM_TIMER_READ 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_event_name MIN_TIMER_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_event_name AVG_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_event_name MAX_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_event_name SUM_NUMBER_OF_BYTES_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Bytes read by read operations. NEVER NULL NO NO
+def performance_schema socket_summary_by_event_name COUNT_WRITE 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all write operations, including SEND, SENDTO, and SENDMSG. NEVER NULL NO NO
+def performance_schema socket_summary_by_event_name SUM_TIMER_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_event_name MIN_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_event_name AVG_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_event_name MAX_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_event_name SUM_NUMBER_OF_BYTES_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Bytes written by write operations. NEVER NULL NO NO
+def performance_schema socket_summary_by_event_name COUNT_MISC 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all miscellaneous operations not counted above, including CONNECT, LISTEN, ACCEPT, CLOSE, and SHUTDOWN. NEVER NULL NO NO
+def performance_schema socket_summary_by_event_name SUM_TIMER_MISC 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all miscellaneous operations that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_event_name MIN_TIMER_MISC 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all miscellaneous operations that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_event_name AVG_TIMER_MISC 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all miscellaneous operations that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_event_name MAX_TIMER_MISC 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all miscellaneous operations that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_instance EVENT_NAME 1 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Socket instrument. NEVER NULL NO NO
+def performance_schema socket_summary_by_instance OBJECT_INSTANCE_BEGIN 2 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Address in memory. NEVER NULL NO NO
+def performance_schema socket_summary_by_instance COUNT_STAR 3 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events NEVER NULL NO NO
+def performance_schema socket_summary_by_instance SUM_TIMER_WAIT 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_instance MIN_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_instance AVG_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_instance MAX_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_instance COUNT_READ 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all read operations, including RECV, RECVFROM, and RECVMSG. NEVER NULL NO NO
+def performance_schema socket_summary_by_instance SUM_TIMER_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_instance MIN_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_instance AVG_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_instance MAX_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_instance SUM_NUMBER_OF_BYTES_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Bytes read by read operations. NEVER NULL NO NO
+def performance_schema socket_summary_by_instance COUNT_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all write operations, including SEND, SENDTO, and SENDMSG. NEVER NULL NO NO
+def performance_schema socket_summary_by_instance SUM_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_instance MIN_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_instance AVG_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_instance MAX_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_instance SUM_NUMBER_OF_BYTES_WRITE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Bytes written by write operations. NEVER NULL NO NO
+def performance_schema socket_summary_by_instance COUNT_MISC 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all miscellaneous operations not counted above, including CONNECT, LISTEN, ACCEPT, CLOSE, and SHUTDOWN. NEVER NULL NO NO
+def performance_schema socket_summary_by_instance SUM_TIMER_MISC 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all miscellaneous operations that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_instance MIN_TIMER_MISC 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all miscellaneous operations that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_instance AVG_TIMER_MISC 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all miscellaneous operations that are timed. NEVER NULL NO NO
+def performance_schema socket_summary_by_instance MAX_TIMER_MISC 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all miscellaneous operations that are timed. NEVER NULL NO NO
+def performance_schema status_by_account USER 1 NULL YES char 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin char(32) select,insert,update,references User for which the status variable is reported. NEVER NULL NO NO
+def performance_schema status_by_account HOST 2 NULL YES char 60 180 NULL NULL NULL utf8mb3 utf8mb3_bin char(60) select,insert,update,references Host for which the status variable is reported. NEVER NULL NO NO
+def performance_schema status_by_account VARIABLE_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Status variable name. NEVER NULL NO NO
+def performance_schema status_by_account VARIABLE_VALUE 4 NULL YES varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select,insert,update,references Aggregated status variable value. NEVER NULL NO NO
+def performance_schema status_by_host HOST 1 NULL YES char 60 180 NULL NULL NULL utf8mb3 utf8mb3_bin char(60) select,insert,update,references Host for which the status variable is reported. NEVER NULL NO NO
+def performance_schema status_by_host VARIABLE_NAME 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Status variable name. NEVER NULL NO NO
+def performance_schema status_by_host VARIABLE_VALUE 3 NULL YES varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select,insert,update,references Aggregated status variable value. NEVER NULL NO NO
+def performance_schema status_by_thread THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The thread identifier of the session in which the status variable is defined. NEVER NULL NO NO
+def performance_schema status_by_thread VARIABLE_NAME 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Status variable name. NEVER NULL NO NO
+def performance_schema status_by_thread VARIABLE_VALUE 3 NULL YES varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select,insert,update,references Aggregated status variable value. NEVER NULL NO NO
+def performance_schema status_by_user USER 1 NULL YES char 32 96 NULL NULL NULL utf8mb3 utf8mb3_bin char(32) select,insert,update,references User for which the status variable is reported. NEVER NULL NO NO
+def performance_schema status_by_user VARIABLE_NAME 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Status variable name. NEVER NULL NO NO
+def performance_schema status_by_user VARIABLE_VALUE 3 NULL YES varchar 1024 3072 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(1024) select,insert,update,references Aggregated status variable value. NEVER NULL NO NO
+def performance_schema table_handles OBJECT_TYPE 1 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The table opened by a table handle. NEVER NULL NO NO
+def performance_schema table_handles OBJECT_SCHEMA 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The schema that contains the object. NEVER NULL NO NO
+def performance_schema table_handles OBJECT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The name of the instrumented object. NEVER NULL NO NO
+def performance_schema table_handles OBJECT_INSTANCE_BEGIN 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The table handle address in memory. NEVER NULL NO NO
+def performance_schema table_handles OWNER_THREAD_ID 5 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The thread owning the table handle. NEVER NULL NO NO
+def performance_schema table_handles OWNER_EVENT_ID 6 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The event which caused the table handle to be opened. NEVER NULL NO NO
+def performance_schema table_handles INTERNAL_LOCK 7 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The table lock used at the SQL level. NEVER NULL NO NO
+def performance_schema table_handles EXTERNAL_LOCK 8 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The table lock used at the storage engine level. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage OBJECT_TYPE 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references TABLE in the case of all indexes. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage OBJECT_SCHEMA 2 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Schema name. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage OBJECT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Table name. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage INDEX_NAME 4 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Index name, or PRIMARY for the primary index, NULL for no index (inserts are counted in this case). NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage COUNT_STAR 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events and the sum of the x_READ and x_WRITE columns. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_WAIT 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage COUNT_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all read operations, and the sum of the equivalent x_FETCH columns. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_READ 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage COUNT_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all write operations, and the sum of the equivalent x_INSERT, x_UPDATE and x_DELETE columns. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_WRITE 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage COUNT_FETCH 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all fetch operations. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_FETCH 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all fetch operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_FETCH 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all fetch operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_FETCH 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all fetch operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_FETCH 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all fetch operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage COUNT_INSERT 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all insert operations. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_INSERT 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all insert operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_INSERT 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all insert operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_INSERT 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all insert operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_INSERT 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all insert operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage COUNT_UPDATE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all update operations. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_UPDATE 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all update operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_UPDATE 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all update operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_UPDATE 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all update operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_UPDATE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all update operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage COUNT_DELETE 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all delete operations. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage SUM_TIMER_DELETE 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all delete operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage MIN_TIMER_DELETE 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all delete operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage AVG_TIMER_DELETE 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all delete operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_index_usage MAX_TIMER_DELETE 39 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all delete operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table OBJECT_TYPE 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Since this table records waits by table, always set to TABLE. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table OBJECT_SCHEMA 2 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Schema name. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table OBJECT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Table name. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events and the sum of the x_READ and x_WRITE columns. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table COUNT_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all read operations, and the sum of the equivalent x_FETCH columns. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table SUM_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table MIN_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table AVG_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table MAX_TIMER_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table COUNT_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all write operations, and the sum of the equivalent x_INSERT, x_UPDATE and x_DELETE columns. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table SUM_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table MIN_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table AVG_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table MAX_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table COUNT_FETCH 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all fetch operations. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table SUM_TIMER_FETCH 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all fetch operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table MIN_TIMER_FETCH 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all fetch operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table AVG_TIMER_FETCH 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all fetch operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table MAX_TIMER_FETCH 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all fetch operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table COUNT_INSERT 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all insert operations. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table SUM_TIMER_INSERT 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all insert operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table MIN_TIMER_INSERT 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all insert operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table AVG_TIMER_INSERT 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all insert operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table MAX_TIMER_INSERT 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all insert operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table COUNT_UPDATE 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all update operations. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table SUM_TIMER_UPDATE 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all update operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table MIN_TIMER_UPDATE 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all update operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table AVG_TIMER_UPDATE 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all update operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table MAX_TIMER_UPDATE 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all update operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table COUNT_DELETE 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all delete operations. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table SUM_TIMER_DELETE 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all delete operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table MIN_TIMER_DELETE 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all delete operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table AVG_TIMER_DELETE 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all delete operations that are timed. NEVER NULL NO NO
+def performance_schema table_io_waits_summary_by_table MAX_TIMER_DELETE 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all delete operations that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table OBJECT_TYPE 1 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Since this table records waits by table, always set to TABLE. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table OBJECT_SCHEMA 2 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Schema name. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table OBJECT_NAME 3 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Table name. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table COUNT_STAR 4 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of summarized events and the sum of the x_READ and x_WRITE columns. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WAIT 5 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WAIT 6 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WAIT 7 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WAIT 8 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of the summarized events that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table COUNT_READ 9 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all read operations, and the sum of the equivalent x_READ_NORMAL, x_READ_WITH_SHARED_LOCKS, x_READ_HIGH_PRIORITY and x_READ_NO_INSERT columns. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ 10 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ 11 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ 12 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ 13 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all read operations that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table COUNT_WRITE 14 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all write operations, and the sum of the equivalent x_WRITE_ALLOW_WRITE, x_WRITE_CONCURRENT_INSERT, x_WRITE_DELAYED, x_WRITE_LOW_PRIORITY and x_WRITE_NORMAL columns. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE 15 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE 16 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE 17 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE 18 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all write operations that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table COUNT_READ_NORMAL 19 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal read normal locks. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_NORMAL 20 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal read normal locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_NORMAL 21 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal read normal locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_NORMAL 22 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal read normal locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_NORMAL 23 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal read normal locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table COUNT_READ_WITH_SHARED_LOCKS 24 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal read with shared locks. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_WITH_SHARED_LOCKS 25 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal read with shared locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_WITH_SHARED_LOCKS 26 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal read with shared locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_WITH_SHARED_LOCKS 27 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal read with shared locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_WITH_SHARED_LOCKS 28 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal read with shared locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table COUNT_READ_HIGH_PRIORITY 29 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal read high priority locks. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_HIGH_PRIORITY 30 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal read high priority locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_HIGH_PRIORITY 31 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal read high priority locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_HIGH_PRIORITY 32 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal read high priority locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_HIGH_PRIORITY 33 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal read high priority locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table COUNT_READ_NO_INSERT 34 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal read no insert locks. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_NO_INSERT 35 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal read no insert locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_NO_INSERT 36 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal read no insert locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_NO_INSERT 37 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal read no insert locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_NO_INSERT 38 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal read no insert locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table COUNT_READ_EXTERNAL 39 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all external read locks. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_READ_EXTERNAL 40 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all external read locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_READ_EXTERNAL 41 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all external read locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_READ_EXTERNAL 42 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all external read locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_READ_EXTERNAL 43 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all external read locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_ALLOW_WRITE 44 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal read normal locks. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_ALLOW_WRITE 45 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal write allow write locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_ALLOW_WRITE 46 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal write allow write locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_ALLOW_WRITE 47 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal write allow write locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_ALLOW_WRITE 48 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal write allow write locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_CONCURRENT_INSERT 49 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal concurrent insert write locks. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_CONCURRENT_INSERT 50 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal concurrent insert write locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_CONCURRENT_INSERT 51 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal concurrent insert write locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_CONCURRENT_INSERT 52 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal concurrent insert write locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_CONCURRENT_INSERT 53 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal concurrent insert write locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_DELAYED 54 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal write delayed locks. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_DELAYED 55 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal write delayed locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_DELAYED 56 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal write delayed locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_DELAYED 57 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal write delayed locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_DELAYED 58 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal write delayed locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_LOW_PRIORITY 59 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal write low priority locks. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_LOW_PRIORITY 60 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal write low priority locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_LOW_PRIORITY 61 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal write low priority locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_LOW_PRIORITY 62 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal write low priority locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_LOW_PRIORITY 63 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal write low priority locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_NORMAL 64 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all internal write normal locks. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_NORMAL 65 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all internal write normal locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_NORMAL 66 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all internal write normal locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_NORMAL 67 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all internal write normal locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_NORMAL 68 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all internal write normal locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table COUNT_WRITE_EXTERNAL 69 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Number of all external write locks. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table SUM_TIMER_WRITE_EXTERNAL 70 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Total wait time of all external write locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MIN_TIMER_WRITE_EXTERNAL 71 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Minimum wait time of all external write locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table AVG_TIMER_WRITE_EXTERNAL 72 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Average wait time of all external write locks that are timed. NEVER NULL NO NO
+def performance_schema table_lock_waits_summary_by_table MAX_TIMER_WRITE_EXTERNAL 73 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references Maximum wait time of all external write locks that are timed. NEVER NULL NO NO
+def performance_schema threads THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references A unique thread identifier. NEVER NULL NO NO
+def performance_schema threads NAME 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Name associated with the server's thread instrumentation code, for example thread/sql/main for the server's main() function, and thread/sql/one_connection for a user connection. NEVER NULL NO NO
+def performance_schema threads TYPE 3 NULL NO varchar 10 30 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(10) select,insert,update,references FOREGROUND or BACKGROUND, depending on the thread type. User connection threads are FOREGROUND, internal server threads are BACKGROUND. NEVER NULL NO NO
+def performance_schema threads PROCESSLIST_ID 4 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The PROCESSLIST.ID value for threads displayed in the INFORMATION_SCHEMA.PROCESSLIST table, or 0 for background threads. Also corresponds with the CONNECTION_ID() return value for the thread. NEVER NULL NO NO
+def performance_schema threads PROCESSLIST_USER 5 NULL YES varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select,insert,update,references Foreground thread user, or NULL for a background thread. NEVER NULL NO NO
+def performance_schema threads PROCESSLIST_HOST 6 NULL YES varchar 255 765 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(255) select,insert,update,references Foreground thread host, or NULL for a background thread. NEVER NULL NO NO
+def performance_schema threads PROCESSLIST_DB 7 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Thread's default database, or NULL if none exists. NEVER NULL NO NO
+def performance_schema threads PROCESSLIST_COMMAND 8 NULL YES varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select,insert,update,references Type of command executed by the thread. These correspond to the the COM_xxx client/server protocol commands, and the Com_xxx status variables. See Thread Command Values. NEVER NULL NO NO
+def performance_schema threads PROCESSLIST_TIME 9 NULL YES bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Time in seconds the thread has been in its current state. NEVER NULL NO NO
+def performance_schema threads PROCESSLIST_STATE 10 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Action, event or state indicating what the thread is doing. NEVER NULL NO NO
+def performance_schema threads PROCESSLIST_INFO 11 NULL YES longtext 4294967295 4294967295 NULL NULL NULL utf8mb3 utf8mb3_general_ci longtext select,insert,update,references Statement being executed by the thread, or NULL if a statement is not being executed. If a statement results in calling other statements, such as for a stored procedure, the innermost statement from the stored procedure is shown here. NEVER NULL NO NO
+def performance_schema threads PARENT_THREAD_ID 12 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references THREAD_ID of the parent thread, if any. Subthreads can for example be spawned as a result of INSERT DELAYED statements. NEVER NULL NO NO
+def performance_schema threads ROLE 13 NULL YES varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references Unused. NEVER NULL NO NO
+def performance_schema threads INSTRUMENTED 14 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references YES or NO for Whether the thread is instrumented or not. For foreground threads, the initial value is determined by whether there's a user/host match in the setup_actors table. Subthreads are again matched, while for background threads, this will be set to YES by default. To monitor events that the thread executes, INSTRUMENTED must be YES and the thread_instrumentation consumer in the setup_consumers table must also be YES. NEVER NULL NO NO
+def performance_schema threads HISTORY 15 NULL NO enum 3 9 NULL NULL NULL utf8mb3 utf8mb3_general_ci enum('YES','NO') select,insert,update,references Whether to log historical events for the thread. NEVER NULL NO NO
+def performance_schema threads CONNECTION_TYPE 16 NULL YES varchar 16 48 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(16) select,insert,update,references The protocol used to establish the connection, or NULL for background threads. NEVER NULL NO NO
+def performance_schema threads THREAD_OS_ID 17 NULL YES bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The thread or task identifier as defined by the underlying operating system, if there is one. NEVER NULL NO NO
+def performance_schema users USER 1 NULL YES char 128 384 NULL NULL NULL utf8mb3 utf8mb3_bin char(128) select,insert,update,references The connection's client user name for the connection, or NULL if an internal thread. NEVER NULL NO NO
+def performance_schema users CURRENT_CONNECTIONS 2 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Current connections for the user. NEVER NULL NO NO
+def performance_schema users TOTAL_CONNECTIONS 3 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(20) select,insert,update,references Total connections for the user. NEVER NULL NO NO
+def performance_schema user_variables_by_thread THREAD_ID 1 NULL NO bigint NULL NULL 20 0 NULL NULL NULL bigint(20) unsigned select,insert,update,references The thread identifier of the session in which the variable is defined. NEVER NULL NO NO
+def performance_schema user_variables_by_thread VARIABLE_NAME 2 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select,insert,update,references The variable name, without the leading @ character. NEVER NULL NO NO
+def performance_schema user_variables_by_thread VARIABLE_VALUE 3 NULL YES longblob 4294967295 4294967295 NULL NULL NULL NULL NULL longblob select,insert,update,references The variable value NEVER NULL NO NO
select count(*) into @count_byte_columns from information_schema.columns
where table_schema="performance_schema" and data_type = "bigint"
and column_name like "%number_of_bytes";
diff --git a/mysql-test/suite/perfschema/r/transaction.result b/mysql-test/suite/perfschema/r/transaction.result
index 9a7eb5b3..c516a454 100644
--- a/mysql-test/suite/perfschema/r/transaction.result
+++ b/mysql-test/suite/perfschema/r/transaction.result
@@ -39,8 +39,8 @@ CALL clear_transaction_tables();
# ========================================================================
#
connection con1;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
+SELECT @@global.transaction_isolation;
+@@global.transaction_isolation
REPEATABLE-READ
SELECT @@global.autocommit;
@@global.autocommit
@@ -48,8 +48,8 @@ SELECT @@global.autocommit;
SELECT @@global.binlog_format;
@@global.binlog_format
ROW
-SELECT @@tx_isolation;
-@@tx_isolation
+SELECT @@transaction_isolation;
+@@transaction_isolation
REPEATABLE-READ
SELECT @@autocommit;
@@autocommit
diff --git a/mysql-test/suite/perfschema/t/cnf_option.cnf b/mysql-test/suite/perfschema/t/cnf_option.cnf
index d2459323..31bc901b 100644
--- a/mysql-test/suite/perfschema/t/cnf_option.cnf
+++ b/mysql-test/suite/perfschema/t/cnf_option.cnf
@@ -2,7 +2,7 @@
# Check server start options, read from a .cnf file
# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
+!include include/default_my.cnf
[mysqld.1]
loose-performance-schema-max-thread_instances=318
diff --git a/mysql-test/suite/perfschema/t/digest_view.test b/mysql-test/suite/perfschema/t/digest_view.test
index dd862aeb..747ac853 100644
--- a/mysql-test/suite/perfschema/t/digest_view.test
+++ b/mysql-test/suite/perfschema/t/digest_view.test
@@ -9,6 +9,7 @@
--source include/no_protocol.inc
--source include/not_embedded.inc
--source include/have_perfschema.inc
+--source include/check_digest.inc
CREATE TABLE test.v1 (a int, b int);
INSERT INTO test.v1 VALUES (1, 100), (2, 200), (3, 300);
@@ -116,7 +117,7 @@ SELECT b, a from test.v1;
--echo # DIGESTS SEEN ON TABLE
--echo #
-SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR
+SELECT SCHEMA_NAME, check_digest(DIGEST), DIGEST_TEXT, COUNT_STAR
FROM performance_schema.events_statements_summary_by_digest
ORDER BY DIGEST_TEXT;
@@ -144,10 +145,13 @@ SELECT b, a from test.v1;
--echo # DIGESTS SEEN ON VIEW
--echo #
-SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR
+call reset_digests;
+
+SELECT SCHEMA_NAME, check_digest(DIGEST), DIGEST_TEXT, COUNT_STAR
FROM performance_schema.events_statements_summary_by_digest
ORDER BY DIGEST_TEXT;
DROP VIEW test.v1;
DROP TABLE test.t1;
+--source include/check_digest_end.inc
diff --git a/mysql-test/suite/perfschema/t/ortho_iter.test b/mysql-test/suite/perfschema/t/ortho_iter.test
index d577b6db..53143715 100644
--- a/mysql-test/suite/perfschema/t/ortho_iter.test
+++ b/mysql-test/suite/perfschema/t/ortho_iter.test
@@ -55,7 +55,7 @@ begin
declare cmd_1 varchar(512);
declare cmd_2 varchar(512);
declare done integer default 0;
- declare debug integer default 0;
+ declare dbg integer default 0;
declare pfs_cursor CURSOR FOR
select table_name from information_schema.tables
@@ -146,7 +146,7 @@ begin
select concat("Checking table ", pfs_table_name, " ...") as status;
select concat(cmd_1, pfs_table_name, cmd_2) into @cmd;
- if debug = 1
+ if dbg = 1
then
select @cmd;
end if;
diff --git a/mysql-test/suite/perfschema/t/show_sanity.test b/mysql-test/suite/perfschema/t/show_sanity.test
index 3ca88b55..9e303c58 100644
--- a/mysql-test/suite/perfschema/t/show_sanity.test
+++ b/mysql-test/suite/perfschema/t/show_sanity.test
@@ -400,9 +400,6 @@ insert into test.sanity values
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_BUFFER_POOL_LOAD_NOW"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_BUFFER_POOL_SIZE"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_BUF_FLUSH_LIST_NOW"),
- ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_CHANGE_BUFFERING"),
- ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_CHANGE_BUFFERING_DEBUG"),
- ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_CHANGE_BUFFER_MAX_SIZE"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_CHECKSUM_ALGORITHM"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_CMP_PER_INDEX_ENABLED"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "INNODB_COMPRESS_DEBUG"),
@@ -536,6 +533,7 @@ insert into test.sanity values
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "MAX_BINLOG_CACHE_SIZE"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "MAX_BINLOG_SIZE"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "MAX_BINLOG_STMT_CACHE_SIZE"),
+ ("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "MAX_BINLOG_TOTAL_SIZE"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "MAX_CONNECTIONS"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "MAX_CONNECT_ERRORS"),
("JUNK: GLOBAL-ONLY", "I_S.SESSION_VARIABLES", "MAX_DIGEST_LENGTH"),
diff --git a/mysql-test/suite/perfschema/t/start_server_low_digest_sql_length.test b/mysql-test/suite/perfschema/t/start_server_low_digest_sql_length.test
index ce8233a9..5a57a3c6 100644
--- a/mysql-test/suite/perfschema/t/start_server_low_digest_sql_length.test
+++ b/mysql-test/suite/perfschema/t/start_server_low_digest_sql_length.test
@@ -5,6 +5,7 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
--source include/no_protocol.inc
+--source include/check_digest.inc
USE performance_schema;
truncate table events_statements_history_long;
@@ -19,5 +20,8 @@ SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
--echo ####################################
--echo # QUERYING PS STATEMENT DIGEST
--echo ####################################
+create table test.events_long select * from events_statements_history_long;
--sorted_result
-SELECT event_name, digest, digest_text, sql_text FROM events_statements_history_long;
+SELECT event_name, test.check_digest(digest), digest_text, sql_text FROM test.events_long;
+--source include/check_digest_end.inc
+drop table test.events_long;
diff --git a/mysql-test/suite/perfschema/t/transaction.test b/mysql-test/suite/perfschema/t/transaction.test
index b6164603..d950139f 100644
--- a/mysql-test/suite/perfschema/t/transaction.test
+++ b/mysql-test/suite/perfschema/t/transaction.test
@@ -90,10 +90,10 @@ CALL clear_transaction_tables();
--echo # ========================================================================
--echo #
--connection con1
-SELECT @@global.tx_isolation;
+SELECT @@global.transaction_isolation;
SELECT @@global.autocommit;
SELECT @@global.binlog_format;
-SELECT @@tx_isolation;
+SELECT @@transaction_isolation;
SELECT @@autocommit;
SELECT @@binlog_format;
diff --git a/mysql-test/suite/period/r/create.result b/mysql-test/suite/period/r/create.result
index ad9985d7..8ba5ce31 100644
--- a/mysql-test/suite/period/r/create.result
+++ b/mysql-test/suite/period/r/create.result
@@ -10,6 +10,21 @@ t CREATE TABLE `t` (
PERIOD FOR `mytime` (`s`, `e`),
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+create view v as select * from t;
+select * from information_schema.periods;
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PERIOD START_COLUMN_NAME END_COLUMN_NAME
+def test t mytime s e
+Warnings:
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
+select * from information_schema.key_period_usage;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PERIOD_NAME
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
+Warnings:
+drop view v;
create or replace table t (id int primary key, s timestamp(6), e timestamp(6),
period for mytime(s,e));
show create table t;
@@ -111,3 +126,40 @@ create table t2 (s date, e date, period for
`abcd123456789012345678901234567890123456789012345678901234567890`
(s,e));
drop table t2;
+# MDEV-32205 Server crashes in get_schema_key_period_usage_record on
+# server without InnoDB
+# Make sure innodb id disabled, but there's at least one innodb table
+select "yes" from information_schema.tables where engine="innodb" limit 1;
+yes
+yes
+select plugin_status from information_schema.all_plugins where plugin_name = "innodb";
+plugin_status
+DISABLED
+select * from information_schema.periods;
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PERIOD START_COLUMN_NAME END_COLUMN_NAME
+select * from information_schema.key_period_usage;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PERIOD_NAME
+# [DUPLICATE] MDEV-32204 Server crashes in
+# get_schema_key_period_usage_record
+create table t (a date) engine=myisam;
+create table t1 (a int) engine=merge union = (t) ;
+select 1 from information_schema.key_period_usage;
+1
+Warning 1168 Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
+Warnings:
+drop table t1;
+drop table t;
+create view v1 as select 1;
+create view v2 as select * from v1;
+drop view v1;
+select * from information_schema.key_period_usage;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PERIOD_NAME
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1356 View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+Warnings:
+drop view v2;
diff --git a/mysql-test/suite/period/r/delete,myisam.rdiff b/mysql-test/suite/period/r/delete,myisam.rdiff
index 78fb972b..179f399a 100644
--- a/mysql-test/suite/period/r/delete,myisam.rdiff
+++ b/mysql-test/suite/period/r/delete,myisam.rdiff
@@ -1,5 +1,5 @@
---- suite/period/r/delete.result 2019-02-16 11:14:23.511258191 +0100
-+++ suite/period/r/delete.reject 2019-02-16 11:14:32.869258690 +0100
+--- suite/period/r/delete.result
++++ suite/period/r/delete.reject
@@ -250,7 +250,6 @@
ERROR 22003: Out of range value for column 'id' at row 1
select * from t;
diff --git a/mysql-test/suite/period/r/i_s_notembedded,win.rdiff b/mysql-test/suite/period/r/i_s_notembedded,win.rdiff
new file mode 100644
index 00000000..eee35182
--- /dev/null
+++ b/mysql-test/suite/period/r/i_s_notembedded,win.rdiff
@@ -0,0 +1,20 @@
+--- suite/period/r/i_s_notembedded.result 2024-01-01 19:50:37.000000000 +0100
++++ suite/period/r/i_s_notembedded,win.reject 2024-01-01 19:57:18.888306500 +0100
+@@ -69,13 +69,17 @@
+ set names latin1 collate latin1_general_cs;
+ select table_name from information_schema.periods where table_schema = 'TEST';
+ table_name
++t
+ select table_name from information_schema.key_period_usage where table_schema = 'TEST';
+ table_name
++t
+ set names latin1 collate latin1_general_ci;
+ select table_name from information_schema.periods where table_schema = 'TEST';
+ table_name
++t
+ select table_name from information_schema.key_period_usage where table_schema = 'TEST';
+ table_name
++t
+ # [DUPLICATE] MDEV-32504 Search by I_S.KEY_PERIOD_USAGE.CONSTRAINT_NAME
+ # does not work
+ select constraint_name from information_schema.key_period_usage where table_name = 't';
diff --git a/mysql-test/suite/period/r/i_s_notembedded.result b/mysql-test/suite/period/r/i_s_notembedded.result
new file mode 100644
index 00000000..80070ef6
--- /dev/null
+++ b/mysql-test/suite/period/r/i_s_notembedded.result
@@ -0,0 +1,118 @@
+select * from information_schema.periods;
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PERIOD START_COLUMN_NAME END_COLUMN_NAME
+Warnings:
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
+Warning 1286 Unknown storage engine 'InnoDB'
+create or replace table t1 (id int primary key, s timestamp(6), e timestamp(6),
+period for mytime(s,e));
+create or replace table t2 (id int primary key, s timestamp(6), e timestamp(6),
+period for mytime(s,e),
+vs timestamp(6) as row start,
+ve timestamp(6) as row end,
+period for system_time(vs, ve))
+with system versioning;
+show columns from t1;
+Field Type Null Key Default Extra
+id int(11) NO PRI NULL
+s timestamp(6) NO NULL
+e timestamp(6) NO NULL
+select * from information_schema.periods where table_schema = 'test';
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PERIOD START_COLUMN_NAME END_COLUMN_NAME
+def test t1 mytime s e
+def test t2 SYSTEM_TIME vs ve
+def test t2 mytime s e
+create user periods_hidden@localhost;
+grant create on test.nonexist to periods_hidden@localhost;
+connect chopped,localhost,periods_hidden,,test;
+select * from information_schema.periods where table_schema = 'test';
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PERIOD START_COLUMN_NAME END_COLUMN_NAME
+connection default;
+grant select(id) on test.t1 to periods_hidden@localhost;
+connection chopped;
+connection default;
+revoke select(id) on test.t1 from periods_hidden@localhost;
+connection chopped;
+connection default;
+grant update(id) on test.t1 to periods_hidden@localhost;
+connection chopped;
+select * from information_schema.periods where table_schema = 'test';
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PERIOD START_COLUMN_NAME END_COLUMN_NAME
+def test t1 mytime NULL NULL
+connection default;
+grant select(s) on test.t1 to periods_hidden@localhost;
+connection chopped;
+select * from information_schema.periods where table_schema = 'test';
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PERIOD START_COLUMN_NAME END_COLUMN_NAME
+def test t1 mytime s NULL
+connection default;
+grant select(e) on test.t2 to periods_hidden@localhost;
+connection chopped;
+select * from information_schema.periods where table_schema = 'test';
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PERIOD START_COLUMN_NAME END_COLUMN_NAME
+def test t1 mytime s NULL
+def test t2 SYSTEM_TIME NULL NULL
+def test t2 mytime NULL e
+connection default;
+grant update on test.t2 to periods_hidden@localhost;
+connection chopped;
+select * from information_schema.periods where table_schema = 'test';
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PERIOD START_COLUMN_NAME END_COLUMN_NAME
+def test t1 mytime s NULL
+def test t2 SYSTEM_TIME vs ve
+def test t2 mytime s e
+connection default;
+drop tables t1, t2;
+# MDEV-32503 Queries from KEY_PERIOD_USAGE don't obey case-sensitivity
+create table t (a int, b date, c date, period for app(b,c),
+unique idx(a, app without overlaps));
+set names latin1 collate latin1_general_cs;
+select table_name from information_schema.periods where table_schema = 'TEST';
+table_name
+select table_name from information_schema.key_period_usage where table_schema = 'TEST';
+table_name
+set names latin1 collate latin1_general_ci;
+select table_name from information_schema.periods where table_schema = 'TEST';
+table_name
+select table_name from information_schema.key_period_usage where table_schema = 'TEST';
+table_name
+# [DUPLICATE] MDEV-32504 Search by I_S.KEY_PERIOD_USAGE.CONSTRAINT_NAME
+# does not work
+select constraint_name from information_schema.key_period_usage where table_name = 't';
+constraint_name
+idx
+select constraint_name from information_schema.key_period_usage where constraint_name = 'idx';
+constraint_name
+idx
+drop table t;
+# MDEV-32501 KEY_PERIOD_USAGE reveals information to unprivileged user
+create table t (a int, b date, c date, f int, period for app(b, c),
+primary key(a, app without overlaps));
+grant select (f) on t to periods_hidden@localhost;
+connection chopped;
+select period_name from information_schema.key_period_usage where table_name = 't';
+period_name
+connection default;
+grant update (f) on t to periods_hidden@localhost;
+connection chopped;
+select 'can be seen', constraint_name, period_name from information_schema.key_period_usage where table_name = 't';
+can be seen constraint_name period_name
+can be seen PRIMARY app
+connection default;
+revoke update (f) on t from periods_hidden@localhost;
+connection chopped;
+update t set f = 1;
+ERROR 42000: UPDATE command denied to user 'periods_hidden'@'localhost' for table `test`.`t`
+select period_name from information_schema.key_period_usage where table_name = 't';
+period_name
+connection default;
+grant alter on t to periods_hidden@localhost;
+connection chopped;
+select 'can be seen', constraint_name, period_name from information_schema.key_period_usage where table_name = 't';
+can be seen constraint_name period_name
+can be seen PRIMARY app
+connection default;
+drop table t;
+disconnect chopped;
+connection default;
+drop user periods_hidden@localhost;
diff --git a/mysql-test/suite/period/r/overlaps.result b/mysql-test/suite/period/r/overlaps.result
index 36a9086f..1b0f6799 100644
--- a/mysql-test/suite/period/r/overlaps.result
+++ b/mysql-test/suite/period/r/overlaps.result
@@ -12,6 +12,20 @@ t CREATE TABLE `t` (
PRIMARY KEY (`id`,`p` WITHOUT OVERLAPS)
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
PARTITION BY KEY (`id`)
+select * from information_schema.key_period_usage;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PERIOD_NAME
+def test PRIMARY def test t p
+create or replace table t_multi(id int, id2 int, s date, e date,
+period for very_interesting_period(s,e),
+primary key(id, very_interesting_period without overlaps),
+unique(id2, very_interesting_period without overlaps)
+);
+select * from information_schema.key_period_usage;
+CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PERIOD_NAME
+def test PRIMARY def test t p
+def test PRIMARY def test t_multi very_interesting_period
+def test id2 def test t_multi very_interesting_period
+drop table t_multi;
insert into t values (1, '2003-01-01', '2003-03-01'),
(1, '2003-05-01', '2003-07-01');
insert into t values (1, '2003-02-01', '2003-04-01');
diff --git a/mysql-test/suite/period/r/update.result b/mysql-test/suite/period/r/update.result
index f726b4c0..004b9976 100644
--- a/mysql-test/suite/period/r/update.result
+++ b/mysql-test/suite/period/r/update.result
@@ -229,8 +229,8 @@ update t for portion of apptime from @s to g() set t.id= t.id + 5;
ERROR HY000: Expression in FOR PORTION OF must be constant
# success
update t for portion of apptime from @s to h() set t.id= t.id + 5;
-# select value is cached
update t for portion of apptime from (select s from t2 limit 1) to h() set t.id= t.id + 5;
+ERROR HY000: Expression in FOR PORTION OF must be constant
# auto_inrement field is updated
create or replace table t (id int primary key auto_increment, x int,
s date, e date, period for apptime(s, e));
diff --git a/mysql-test/suite/period/t/create.test b/mysql-test/suite/period/t/create.test
index 0bca5b6d..537a1dc0 100644
--- a/mysql-test/suite/period/t/create.test
+++ b/mysql-test/suite/period/t/create.test
@@ -2,6 +2,12 @@ create table t (id int primary key, s date, e date, period for mytime(s,e));
--echo # CONSTRAINT CHECK (s < e) is added implicitly, and shouldn't be shown
--echo # this is important for correct command-based replication
show create table t;
+create view v as select * from t;
+select * from information_schema.periods;
+--sorted_result
+select * from information_schema.key_period_usage;
+drop view v;
+
create or replace table t (id int primary key, s timestamp(6), e timestamp(6),
period for mytime(s,e));
show create table t;
@@ -99,3 +105,33 @@ create table t2 (s date, e date, period for
`abcd123456789012345678901234567890123456789012345678901234567890`
(s,e));
drop table t2;
+
+
+--echo # MDEV-32205 Server crashes in get_schema_key_period_usage_record on
+--echo # server without InnoDB
+
+--echo # Make sure innodb id disabled, but there's at least one innodb table
+--disable_warnings
+select "yes" from information_schema.tables where engine="innodb" limit 1;
+select plugin_status from information_schema.all_plugins where plugin_name = "innodb";
+select * from information_schema.periods;
+select * from information_schema.key_period_usage;
+--enable_warnings
+
+--echo # [DUPLICATE] MDEV-32204 Server crashes in
+--echo # get_schema_key_period_usage_record
+
+create table t (a date) engine=myisam;
+create table t1 (a int) engine=merge union = (t) ;
+
+--sorted_result
+select 1 from information_schema.key_period_usage;
+drop table t1;
+drop table t;
+
+create view v1 as select 1;
+create view v2 as select * from v1;
+drop view v1;
+--sorted_result
+select * from information_schema.key_period_usage;
+drop view v2;
diff --git a/mysql-test/suite/period/t/i_s_notembedded.test b/mysql-test/suite/period/t/i_s_notembedded.test
new file mode 100644
index 00000000..5bfb4e14
--- /dev/null
+++ b/mysql-test/suite/period/t/i_s_notembedded.test
@@ -0,0 +1,119 @@
+--source include/not_embedded.inc
+--source include/platform.inc
+
+select * from information_schema.periods;
+
+create or replace table t1 (id int primary key, s timestamp(6), e timestamp(6),
+ period for mytime(s,e));
+
+create or replace table t2 (id int primary key, s timestamp(6), e timestamp(6),
+ period for mytime(s,e),
+ vs timestamp(6) as row start,
+ ve timestamp(6) as row end,
+ period for system_time(vs, ve))
+ with system versioning;
+
+show columns from t1;
+
+--sorted_result
+select * from information_schema.periods where table_schema = 'test';
+
+create user periods_hidden@localhost;
+# Give it a privilege to connect
+grant create on test.nonexist to periods_hidden@localhost;
+
+--connect (chopped,localhost,periods_hidden,,test)
+--sorted_result
+select * from information_schema.periods where table_schema = 'test';
+--connection default
+grant select(id) on test.t1 to periods_hidden@localhost;
+--connection chopped
+--sorted_result
+--connection default
+revoke select(id) on test.t1 from periods_hidden@localhost;
+--connection chopped
+--sorted_result
+--connection default
+grant update(id) on test.t1 to periods_hidden@localhost;
+--connection chopped
+--sorted_result
+select * from information_schema.periods where table_schema = 'test';
+--connection default
+grant select(s) on test.t1 to periods_hidden@localhost;
+--connection chopped
+--sorted_result
+select * from information_schema.periods where table_schema = 'test';
+--connection default
+grant select(e) on test.t2 to periods_hidden@localhost;
+--connection chopped
+--sorted_result
+select * from information_schema.periods where table_schema = 'test';
+--connection default
+grant update on test.t2 to periods_hidden@localhost;
+--connection chopped
+--sorted_result
+select * from information_schema.periods where table_schema = 'test';
+--connection default
+drop tables t1, t2;
+
+--echo # MDEV-32503 Queries from KEY_PERIOD_USAGE don't obey case-sensitivity
+
+create table t (a int, b date, c date, period for app(b,c),
+ unique idx(a, app without overlaps));
+
+
+set names latin1 collate latin1_general_cs;
+
+select table_name from information_schema.periods where table_schema = 'TEST';
+select table_name from information_schema.key_period_usage where table_schema = 'TEST';
+set names latin1 collate latin1_general_ci;
+
+select table_name from information_schema.periods where table_schema = 'TEST';
+select table_name from information_schema.key_period_usage where table_schema = 'TEST';
+
+--echo # [DUPLICATE] MDEV-32504 Search by I_S.KEY_PERIOD_USAGE.CONSTRAINT_NAME
+--echo # does not work
+disable_warnings; # storage engine 'Innodb' is not found
+select constraint_name from information_schema.key_period_usage where table_name = 't';
+select constraint_name from information_schema.key_period_usage where constraint_name = 'idx';
+enable_warnings;
+
+drop table t;
+
+--echo # MDEV-32501 KEY_PERIOD_USAGE reveals information to unprivileged user
+create table t (a int, b date, c date, f int, period for app(b, c),
+ primary key(a, app without overlaps));
+
+grant select (f) on t to periods_hidden@localhost;
+
+--connection chopped
+select period_name from information_schema.key_period_usage where table_name = 't';
+
+--connection default
+grant update (f) on t to periods_hidden@localhost;
+--connection chopped
+select 'can be seen', constraint_name, period_name from information_schema.key_period_usage where table_name = 't';
+
+--connection default
+revoke update (f) on t from periods_hidden@localhost;
+--connection chopped
+--error ER_TABLEACCESS_DENIED_ERROR
+update t set f = 1;
+select period_name from information_schema.key_period_usage where table_name = 't';
+
+--connection default
+grant alter on t to periods_hidden@localhost;
+--connection chopped
+select 'can be seen', constraint_name, period_name from information_schema.key_period_usage where table_name = 't';
+
+--connection default
+drop table t;
+
+#
+# End of 11.4 tests
+#
+
+# Global cleanup
+--disconnect chopped
+--connection default
+drop user periods_hidden@localhost;
diff --git a/mysql-test/suite/period/t/overlaps.test b/mysql-test/suite/period/t/overlaps.test
index b762743b..e20811c6 100644
--- a/mysql-test/suite/period/t/overlaps.test
+++ b/mysql-test/suite/period/t/overlaps.test
@@ -13,6 +13,17 @@ create or replace table t(id int, s date, e date,
--replace_result $default_engine DEFAULT_ENGINE
show create table t;
+--sorted_result
+select * from information_schema.key_period_usage;
+create or replace table t_multi(id int, id2 int, s date, e date,
+ period for very_interesting_period(s,e),
+ primary key(id, very_interesting_period without overlaps),
+ unique(id2, very_interesting_period without overlaps)
+);
+--sorted_result
+select * from information_schema.key_period_usage;
+drop table t_multi;
+
insert into t values (1, '2003-01-01', '2003-03-01'),
(1, '2003-05-01', '2003-07-01');
diff --git a/mysql-test/suite/period/t/update.test b/mysql-test/suite/period/t/update.test
index 3f4dd2bd..fd67dc32 100644
--- a/mysql-test/suite/period/t/update.test
+++ b/mysql-test/suite/period/t/update.test
@@ -123,7 +123,7 @@ update t for portion of apptime from @s to g() set t.id= t.id + 5;
--echo # success
update t for portion of apptime from @s to h() set t.id= t.id + 5;
---echo # select value is cached
+--error ER_NOT_CONSTANT_EXPRESSION
update t for portion of apptime from (select s from t2 limit 1) to h() set t.id= t.id + 5;
--echo # auto_inrement field is updated
diff --git a/mysql-test/suite/plugins/r/locales.result b/mysql-test/suite/plugins/r/locales.result
index de71d954..e91a1a9a 100644
--- a/mysql-test/suite/plugins/r/locales.result
+++ b/mysql-test/suite/plugins/r/locales.result
@@ -113,6 +113,7 @@ ID NAME DESCRIPTION MAX_MONTH_NAME_LENGTH MAX_DAY_NAME_LENGTH DECIMAL_POINT THOU
109 el_GR Greek - Greece 11 9 , . greek
110 rm_CH Romansh - Switzerland 9 9 , ' english
111 ka_GE Georgian - Georgia 10 9 , georgian
+112 sw_KE Swahili - Kenya 8 8 . , swahili
show locales;
Id Name Description Error_Message_Language
0 en_US English - United States english
@@ -227,6 +228,7 @@ Id Name Description Error_Message_Language
109 el_GR Greek - Greece greek
110 rm_CH Romansh - Switzerland english
111 ka_GE Georgian - Georgia georgian
+112 sw_KE Swahili - Kenya swahili
show locales like '%spanish%';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'like '%spanish%'' at line 1
show locales where description like '%spanish%';
diff --git a/mysql-test/suite/roles/admin.result b/mysql-test/suite/roles/admin.result
index 2ecbfae4..4e8fa965 100644
--- a/mysql-test/suite/roles/admin.result
+++ b/mysql-test/suite/roles/admin.result
@@ -8,9 +8,9 @@ create role role3 with admin role1;
create role role4 with admin root@localhost;
connect c1, localhost, foo,,;
create role role5 with admin root@localhost;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, SET USER privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the SET USER privilege(s) for this operation
create role role5 with admin role3;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, SET USER privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the SET USER privilege(s) for this operation
create role role5 with admin foo@localhost;
connection default;
call mtr.add_suppression("Invalid roles_mapping table entry user:'foo@bar', rolename:'role6'");
diff --git a/mysql-test/suite/roles/create_and_drop_role_invalid_user_table.test b/mysql-test/suite/roles/create_and_drop_role_invalid_user_table.test
index dac6eab2..e397989b 100644
--- a/mysql-test/suite/roles/create_and_drop_role_invalid_user_table.test
+++ b/mysql-test/suite/roles/create_and_drop_role_invalid_user_table.test
@@ -17,7 +17,7 @@ alter table user drop column max_statement_time;
flush privileges;
---replace_regex /10\d\d\d\d/MYSQL_VERSION_ID/
+--replace_regex /11\d\d\d\d/MYSQL_VERSION_ID/
--error ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE
create role test_role;
--error ER_CANNOT_USER
@@ -30,8 +30,6 @@ after password_expired;
create role test_role;
create user test_user@localhost;
grant test_role to test_user@localhost;
-#--replace_regex /10\d\d\d\d/MYSQL_VERSION_ID/
-#--error ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE
set default role test_role for root@localhost;
drop role test_role;
drop user test_user@localhost;
diff --git a/mysql-test/suite/roles/definer.result b/mysql-test/suite/roles/definer.result
index 38242c81..08e72193 100644
--- a/mysql-test/suite/roles/definer.result
+++ b/mysql-test/suite/roles/definer.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression('Event Scheduler:');
create database mysqltest1;
use mysqltest1;
create table t1 (a int, b int, c int);
@@ -670,7 +671,7 @@ CREATE DEFINER='r1' PROCEDURE user1_proc2() SQL SECURITY INVOKER
BEGIN
SELECT NOW(), VERSION();
END;//
-ERROR 42000: Access denied; you need (at least one of) the SUPER, SET USER privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the SET USER privilege(s) for this operation
set role r1;
CREATE DEFINER='r1' PROCEDURE user1_proc2() SQL SECURITY INVOKER
BEGIN
diff --git a/mysql-test/suite/roles/definer.test b/mysql-test/suite/roles/definer.test
index 4cd42d59..c08df87a 100644
--- a/mysql-test/suite/roles/definer.test
+++ b/mysql-test/suite/roles/definer.test
@@ -7,6 +7,8 @@
--source include/not_embedded.inc
--source include/default_charset.inc
+call mtr.add_suppression('Event Scheduler:');
+
let MYSQLD_DATADIR=`select @@datadir`;
create database mysqltest1;
diff --git a/mysql-test/suite/rpl/include/multisource.inc b/mysql-test/suite/rpl/include/multisource.inc
index 96c4a9aa..8d9fa1f4 100644
--- a/mysql-test/suite/rpl/include/multisource.inc
+++ b/mysql-test/suite/rpl/include/multisource.inc
@@ -38,7 +38,8 @@ change master 'abc2' to master_host='';
eval change master 'master1' to
master_port=$SERVER_MYPORT_1,
master_host='127.0.0.1',
-master_user='root';
+master_user='root',
+master_ssl_verify_server_cert=0;
start slave 'master1';
set default_master_connection = 'master1';
@@ -160,6 +161,7 @@ eval change master to
master_port=$SERVER_MYPORT_2,
master_host='127.0.0.1',
master_user='root',
+master_ssl_verify_server_cert=0,
master_use_gtid=no;
start slave;
diff --git a/mysql-test/suite/rpl/include/rpl_change_master_demote.inc b/mysql-test/suite/rpl/include/rpl_change_master_demote.inc
index 932a2b87..d14f0a2b 100644
--- a/mysql-test/suite/rpl/include/rpl_change_master_demote.inc
+++ b/mysql-test/suite/rpl/include/rpl_change_master_demote.inc
@@ -29,7 +29,7 @@ if (`SELECT strcmp("$ignore_domain_ids","") != 0`)
--echo # gtid_current_pos calculation
--let $current_pos= `SELECT @@gtid_current_pos`
--replace_result $SLAVE_MYPORT SLAVE_PORT
---eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SLAVE_MYPORT, master_user='root', master_use_gtid=slave_pos, master_demote_to_slave=1 $extra_cm_args
+--eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SLAVE_MYPORT, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos, master_demote_to_slave=1 $extra_cm_args
SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC;
--let $slave_pos= `SELECT @@gtid_slave_pos`
--echo # Validating gtid_slave_pos == gtid_binlog_pos..
diff --git a/mysql-test/suite/rpl/include/rpl_extra_col_slave.test b/mysql-test/suite/rpl/include/rpl_extra_col_slave.test
index 680d5724..028c833a 100644
--- a/mysql-test/suite/rpl/include/rpl_extra_col_slave.test
+++ b/mysql-test/suite/rpl/include/rpl_extra_col_slave.test
@@ -397,8 +397,7 @@ sync_slave_with_master;
STOP SLAVE;
--source include/reset_slave.inc
eval CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
- d TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
- ON UPDATE CURRENT_TIMESTAMP,
+ d TIMESTAMP NOT NULL DEFAULT 0,
e INT NOT NULL,
f text not null,
g text,
diff --git a/mysql-test/suite/rpl/include/rpl_get_master_version_and_clock.test b/mysql-test/suite/rpl/include/rpl_get_master_version_and_clock.test
index 18175928..f87ea01f 100644
--- a/mysql-test/suite/rpl/include/rpl_get_master_version_and_clock.test
+++ b/mysql-test/suite/rpl/include/rpl_get_master_version_and_clock.test
@@ -24,7 +24,7 @@
#
# let $debug_sync_action= 'now signal signal_name';
#
-# The $dbug_sync_point becomes the value of @@global.debug generating
+# The $dbug_sync_point becomes the value of @@global.debug_dbug generating
# a newly started IO-slave thread's session value.
# Notice incremental operations to add and remove dbug_execute_if_name
# from the global variable allows propagation more dbug arguments
@@ -68,7 +68,7 @@ source include/wait_for_slave_io_error.inc;
# deactivate the sync point of get_master_version_and_clock()
# now to avoid restarting IO-thread to re-enter it.
-# There will be a new IO thread forked out with its @@session.debug
+# There will be a new IO thread forked out with its @@session.debug_dbug
# unset.
set @@global.debug_dbug= @old_dbug;
diff --git a/mysql-test/suite/rpl/include/rpl_gtid_index.inc b/mysql-test/suite/rpl/include/rpl_gtid_index.inc
new file mode 100644
index 00000000..262d43d0
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_gtid_index.inc
@@ -0,0 +1,187 @@
+# Include file for main test rpl.rpl_gtid_index.
+# Test GTID indexes with given parameters.
+#
+# Parameters:
+# $NUM_POS Number of GTIDs/binlog positions to create
+# $NUM_DOMAIN Number of different domains to use
+# $NUM_SERVER Number of different server_id to use
+# $NUM_SLAVE_CONNECTS How many GTID slave connect positions to test
+# $RND_SEED Random seed
+
+
+--echo *** Testing $NUM_POS GTIDs with $NUM_SLAVE_CONNECTS test connects
+
+--connection master
+DELETE FROM t1 WHERE a >= 1000;
+# Rotate binlogs to make new GTID index settings take effect.
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+
+# Prepare some random values, but deterministic between test runs.
+CREATE TABLE rand_data(idx INT PRIMARY KEY, domain_id INT, server_id INT)
+ ENGINE=InnoDB;
+INSERT INTO rand_data(idx, domain_id, server_id) VALUES (0, 0, 1);
+eval
+INSERT INTO rand_data(idx, domain_id, server_id)
+SELECT seq,
+ @tmp:=floor($NUM_DOMAIN*POW(rand($RND_SEED),2)),
+ 100 + $NUM_SERVER*@tmp + floor($NUM_SERVER*rand($RND_SEED))
+ FROM seq_1_to_$NUM_POS;
+# Let's check that the test data is deterministic.
+# If this changes due to some server changes, it's fine, the .result can just
+# be updated. But we want it to be identical between test runs on same code,
+# to facilitate debugging test failures.
+SELECT COUNT(*), SUM(domain_id), SUM(server_id) FROM rand_data;
+
+# Create some data for the binlog (and GTID index), recording the correct
+# binlog positions and GTIDs.
+CREATE TABLE gtid_data(
+ idx INT PRIMARY KEY,
+ gtid VARCHAR(44),
+ gtid_pos VARCHAR(255),
+ file VARCHAR(100),
+ pos INT,
+ row_count INT,
+ KEY(file, pos)) ENGINE=InnoDB;
+--let $gtid= `SELECT @@last_gtid`
+
+--source include/save_master_gtid.inc
+
+--connection slave
+--source include/sync_with_master_gtid.inc
+--source include/stop_slave.inc
+
+--connection master
+SET @orig_domain_id= @@gtid_domain_id;
+SET @orig_server_id= @@server_id;
+--let $i= 0
+--let $rotate_point= `SELECT floor($NUM_POS/2)`
+--let $base_count= `SELECT COUNT(*) FROM t1`
+--disable_query_log
+while ($i < $NUM_POS) {
+ --let $file= query_get_value(SHOW MASTER STATUS, File, 1)
+ --let $pos= query_get_value(SHOW MASTER STATUS, Position, 1)
+ --let $gtid_pos= `SELECT @@gtid_binlog_pos`
+ --let $row_count= `SELECT $base_count + $i`
+ eval SET gtid_domain_id= (SELECT domain_id FROM rand_data WHERE idx=$i+1);
+ eval SET server_id= (SELECT server_id FROM rand_data WHERE idx=$i+1);
+ BEGIN;
+ eval INSERT INTO gtid_data(idx, gtid, gtid_pos, file, pos, row_count)
+ VALUES ($i, '$gtid', '$gtid_pos', '$file', $pos, $row_count);
+ eval INSERT INTO t1 VALUES ($i + 1000, 0);
+ COMMIT;
+--let $gtid= `SELECT @@last_gtid`
+ inc $i;
+ if ($i==$rotate_point) {
+ FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+ }
+}
+--enable_query_log
+SET gtid_domain_id= @orig_domain_id;
+SET server_id= @orig_server_id;
+
+SELECT COUNT(*) FROM gtid_data;
+
+# Test that BINLOG_GTID_POS returns correct positions for every GTID position.
+--echo *** The result should be empty, otherwise some result is wrong:
+SELECT idx, gtid_pos, BINLOG_GTID_POS(file, pos)
+ FROM gtid_data
+ WHERE NOT gtid_eq(CONVERT(gtid_pos USING utf8),BINLOG_GTID_POS(file, pos))
+ ORDER BY idx;
+
+# Prepare to rewind the slave to this point to test again on same binlog.
+--connection slave
+SET @orig_pos= @@GLOBAL.gtid_slave_pos;
+SET @orig_t1_limit= (SELECT MAX(a) FROM t1);
+
+--echo *** Now connect the slave to each position in turn, and test that
+--echo *** the right amount of data is replicated at each point.
+--let $old_silent= $keep_include_silent
+--let $keep_include_silent= 1
+--let $i= 0
+--disable_query_log
+while ($i < $NUM_POS) {
+ --connection master
+ --let $gtid_pos= `SELECT gtid_pos FROM gtid_data WHERE idx=$i`
+ --let $master_count= `SELECT row_count FROM gtid_data WHERE idx=$i`
+ --connection slave
+ --disable_result_log
+ eval START SLAVE UNTIL master_gtid_pos='$gtid_pos';
+ --enable_result_log
+ --let $res= `SELECT MASTER_GTID_WAIT('$gtid_pos')`
+ if ($res != 0) {
+ --die "FAIL: MASTER_GTID_WAIT($gtid_pos) returned $res, should have been 0"
+ }
+ --source include/wait_for_slave_to_stop.inc
+ --let $slave_count = `SELECT COUNT(*) FROM t1`
+ if ($master_count != $slave_count) {
+ SELECT * FROM gtid_data ORDER BY file, pos;
+ SELECT * FROM t1 ORDER BY a;
+ --die "Not all rows replicated. $master_count on master but $slave_count on slave."
+ }
+ --let $i= `SELECT $i + ceil($NUM_POS / $NUM_SLAVE_CONNECTS)`
+}
+--enable_query_log
+
+--echo *** Test slave connecting to some GTID positions where the position in
+--echo *** the master's binlog is different between the different domains.
+--echo *** Revind the slave and test on the same binlog data from the master as before.
+--connection slave
+SET sql_log_bin= 0;
+TRUNCATE gtid_data;
+DELETE FROM t1 WHERE a > @orig_t1_limit;
+SET sql_log_bin= 1;
+SET GLOBAL gtid_slave_pos= @orig_pos;
+
+--let $i= 0
+--disable_query_log
+while ($i <= $NUM_DOMAIN) {
+ # Build a GTID position from GTIDs that are picked at different locations
+ # in the gtid_data table for each domain.
+ --connection master
+ let $until_pos=`
+ SELECT GROUP_CONCAT(gtid SEPARATOR ',')
+ FROM gtid_data
+ WHERE idx IN (
+ SELECT MAX(gtid_data.idx) AS pick
+ FROM gtid_data
+ INNER JOIN rand_data ON (rand_data.idx = gtid_data.idx)
+ WHERE gtid_data.idx*$NUM_DOMAIN <= (domain_id + $i)*$NUM_POS
+ GROUP BY domain_id
+ )`;
+ --connection slave
+ --disable_result_log
+ eval START SLAVE UNTIL master_gtid_pos='$until_pos';
+ --enable_result_log
+ --let $res= `SELECT MASTER_GTID_WAIT('$until_pos')`
+ if ($res != 0) {
+ --die "FAIL: MASTER_GTID_WAIT($until_pos) returned $res, should have been 0"
+ }
+ --source include/wait_for_slave_to_stop.inc
+
+ inc $i;
+}
+--enable_query_log
+--let $keep_include_silent= $old_silent
+
+# Check that everything was replicated (nothing skipped).
+# We have one less row on the slave since the last UNTIL is the one before
+# the master inserted the last row.
+--connection master
+--let $master_count= `SELECT COUNT(*)-1 FROM t1`
+--connection slave
+--let $slave_count= `SELECT COUNT(*) FROM t1`
+if ($master_count != $slave_count) {
+ SELECT * FROM gtid_data ORDER BY file, pos;
+ SELECT * FROM t1 ORDER BY a;
+ --die "Not all rows replicated. $master_count on master but $slave_count on slave."
+}
+
+--connection master
+DROP TABLE gtid_data, rand_data;
+--source include/save_master_gtid.inc
+
+--connection slave
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+--connection master
diff --git a/mysql-test/suite/rpl/include/rpl_gtid_until_before_after_gtids.test b/mysql-test/suite/rpl/include/rpl_gtid_until_before_after_gtids.test
new file mode 100644
index 00000000..4f907d0b
--- /dev/null
+++ b/mysql-test/suite/rpl/include/rpl_gtid_until_before_after_gtids.test
@@ -0,0 +1,375 @@
+#
+# Helper file to run through test cases to validate that the replica will stop
+# at the correct place when running STOP SLAVE UNTIL with options
+# SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS.
+#
+# MTR Parameters:
+# ssu_before_gtids (Boolean): Indicates whether to test SQL_BEFORE_GTIDS,
+# (when true), or SQL_AFTER_GTIDS (when false).
+#
+
+--let $include_filename= rpl_gtid_until_before_after_gtids.inc
+--source include/begin_include_file.inc
+
+if ($ssu_before_gtids)
+{
+ --let $ssu_opt=SQL_BEFORE_GTIDS
+}
+if (!$ssu_before_gtids)
+{
+ --let $ssu_opt=SQL_AFTER_GTIDS
+}
+
+--echo #
+--echo # Test Setup ($ssu_opt)
+
+--echo # Clean primary and replica states
+--connection master
+--source include/save_master_gtid.inc
+--connection slave
+--source include/stop_slave.inc
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+--source include/stop_slave.inc
+--source include/reset_slave.inc
+--connection master
+RESET MASTER;
+set session gtid_domain_id=0;
+
+--echo # Initialize test data
+--connection master
+create table t1 (a int);
+create table t2 (a int);
+
+# Set the value counters to use on insertions. Note they are only set once per
+# test, subsequent invocations of this .inc file continue to increment the
+# previous values.
+if (!$t1_ctr)
+{
+ --let $t1_ctr= 100
+ --let $t2_ctr= 200
+}
+
+--source include/save_master_gtid.inc
+
+--connection slave
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+
+--echo #
+--echo # Test Case 1 ($ssu_opt): For a single-dimensional binlog state and a
+--echo # STOP SLAVE UNTIL gtid position with one GTID, the replica should
+if ($ssu_before_gtids)
+{
+--echo # execute events up until the GTID is encountered, and immediately stop
+}
+if (!$ssu_before_gtids)
+{
+--echo # execute events up until the GTID is encountered, finish replicating
+--echo # that event group, and then stop
+}
+
+--connection slave
+--source include/stop_slave.inc
+--let $initial_slave_pos= query_get_value(SHOW ALL SLAVES STATUS, Exec_Master_Log_Pos, 1)
+
+--connection master
+set session gtid_domain_id=0;
+--eval INSERT INTO t1 VALUES ($t1_ctr)
+--inc $t1_ctr
+if ($ssu_before_gtids)
+{
+ --let $expected_stop_gtid= `SELECT @@gtid_binlog_pos`
+}
+--eval INSERT INTO t1 VALUES ($t1_ctr)
+--inc $t1_ctr
+--let $until_gtid= `SELECT @@gtid_binlog_pos`
+if (!$ssu_before_gtids)
+{
+ --let $expected_stop_gtid= `SELECT @@gtid_binlog_pos`
+}
+--eval INSERT INTO t1 VALUES ($t1_ctr)
+--inc $t1_ctr
+
+--connection slave
+--eval START SLAVE UNTIL $ssu_opt="$until_gtid"
+
+--echo # Ensure the slave started
+--let $slave_param= Exec_Master_Log_Pos
+--let $slave_param_comparison= !=
+--let $slave_param_value= $initial_slave_pos
+--source include/wait_for_slave_param.inc
+--let $slave_param_comparison= =
+
+--source include/wait_for_slave_to_stop.inc
+--let $actual_stop_gtid= `SELECT @@gtid_slave_pos`
+
+if (`SELECT strcmp("$expected_stop_gtid","$actual_stop_gtid") != 0`)
+{
+ --echo # Expected stop gtid != actual stop gtid ($expected_stop_gtid != $actual_stop_gtid)
+ --die Expected stop gtid != actual stop gtid
+}
+
+--echo # Clean replica state
+--connection master
+--source include/save_master_gtid.inc
+--connection slave
+--source include/start_slave.inc
+--source include/sync_with_master_gtid.inc
+
+
+--echo #
+--echo # Test Case 2 ($ssu_opt): If a provided until GTID doesn't exist in the
+--echo # binary log due to a gap, once an event is seen that is beyond the
+--echo # until GTID, the slave should immediately stop. Note the behavior of
+--echo # this test case should be the same between SQL_BEFORE_GTIDS and
+--echo # SQL_AFTER_GTIDS.
+
+--connection slave
+--let $initial_slave_pos= query_get_value(SHOW ALL SLAVES STATUS, Exec_Master_Log_Pos, 1)
+--source include/stop_slave.inc
+
+--connection master
+set session gtid_domain_id=0;
+--eval INSERT INTO t1 VALUES ($t1_ctr)
+--inc $t1_ctr
+--eval INSERT INTO t1 VALUES ($t1_ctr)
+--inc $t1_ctr
+
+
+--echo # Skip a seq_no
+--let $binlog_pos= `SELECT @@gtid_binlog_pos`
+--let $domain_id= `SELECT @@gtid_domain_id`
+--let $server_id= `SELECT @@server_id`
+--let $last_seq_no= `SELECT REGEXP_SUBSTR('$binlog_pos','[0-9]+\\\$')`
+
+--let $skipped_seq_no= `SELECT ($last_seq_no + 1)`
+--let $new_seq_no= `SELECT ($skipped_seq_no + 1)`
+--eval set @@session.gtid_seq_no= $new_seq_no
+
+--let $until_gtid= $domain_id-$server_id-$skipped_seq_no
+--let $expected_stop_gtid= $binlog_pos
+
+--eval INSERT INTO t1 VALUES ($t1_ctr)
+--inc $t1_ctr
+
+--connection slave
+--eval START SLAVE UNTIL $ssu_opt="$until_gtid"
+
+--echo # Ensure the slave started
+--let $slave_param= Exec_Master_Log_Pos
+--let $slave_param_comparison= !=
+--let $slave_param_value= $initial_slave_pos
+--source include/wait_for_slave_param.inc
+--let $slave_param_comparison= =
+
+--source include/wait_for_slave_to_stop.inc
+--let $actual_stop_gtid= `SELECT @@gtid_slave_pos`
+
+if (`SELECT strcmp("$expected_stop_gtid","$actual_stop_gtid") != 0`)
+{
+ --echo # Expected stop gtid != actual stop gtid ($expected_stop_gtid != $actual_stop_gtid)
+ --die Expected stop gtid != actual stop gtid
+}
+
+--connection slave
+--source include/start_slave.inc
+--connection master
+--sync_slave_with_master
+
+
+--echo #
+--echo # Test Case 3 ($ssu_opt): For a multi-dimensional binlog state and a
+--echo # STOP SLAVE UNTIL gtid position with one GTID, the replica should
+--echo # execute events from only the specified domain until the provided GTID
+if ($ssu_before_gtids)
+{
+--echo # is encountered, and immediately stop
+}
+if (!$ssu_before_gtids)
+{
+--echo # is encountered, finish replicating that event group, and then stop
+}
+
+--connection slave
+--source include/stop_slave.inc
+--let $initial_slave_pos= query_get_value(SHOW ALL SLAVES STATUS, Exec_Master_Log_Pos, 1)
+
+--connection master
+set session gtid_domain_id=0;
+--eval INSERT INTO t1 VALUES ($t1_ctr)
+--inc $t1_ctr
+
+set session gtid_domain_id=1;
+--eval INSERT INTO t2 VALUES ($t2_ctr)
+--inc $t2_ctr
+--eval INSERT INTO t2 VALUES ($t2_ctr)
+--inc $t2_ctr
+
+if ($ssu_before_gtids)
+{
+ # Will have GTIDs for both domains 0 and 1
+ --let $binlog_pos= `SELECT @@gtid_binlog_pos`
+ --let $expected_stop_gtid= `SELECT REGEXP_SUBSTR('$binlog_pos','0-[0-9]+-[0-9]+')`
+}
+
+set session gtid_domain_id=0;
+--eval INSERT INTO t1 VALUES ($t1_ctr)
+--inc $t1_ctr
+
+--let $binlog_pos= `SELECT @@gtid_binlog_pos`
+
+# Just the GTID for domain 0
+--let $until_gtid= `SELECT REGEXP_SUBSTR('$binlog_pos','0-[0-9]+-[0-9]+')`
+
+if (!$ssu_before_gtids)
+{
+ --let $expected_stop_gtid= $until_gtid
+}
+
+set session gtid_domain_id=1;
+--eval INSERT INTO t2 VALUES ($t2_ctr)
+--inc $t2_ctr
+set session gtid_domain_id=0;
+
+--connection slave
+--eval START SLAVE UNTIL $ssu_opt="$until_gtid"
+
+--echo # Ensure the slave started
+--let $slave_param= Exec_Master_Log_Pos
+--let $slave_param_comparison= !=
+--let $slave_param_value= $initial_slave_pos
+--source include/wait_for_slave_param.inc
+--let $slave_param_comparison= =
+
+--source include/wait_for_slave_to_stop.inc
+--let $actual_stop_gtid= `SELECT @@gtid_slave_pos`
+
+if (`SELECT strcmp("$expected_stop_gtid","$actual_stop_gtid") != 0`)
+{
+ --echo # Expected stop gtid != actual stop gtid ($expected_stop_gtid != $actual_stop_gtid)
+ --die Expected stop gtid != actual stop gtid
+}
+
+--connection slave
+--source include/start_slave.inc
+--connection master
+--sync_slave_with_master
+
+
+--echo #
+--echo # Test Case 4 ($ssu_opt): For a multi-dimensional binlog state and a
+--echo # STOP SLAVE UNTIL gtid position with multiple GTIDs, the replica should
+if ($ssu_before_gtids)
+{
+--echo # for each domain, execute events only up until its provided GTID, and
+--echo # once all domains have hit their end point, immediately stop.
+}
+if (!$ssu_before_gtids)
+{
+--echo # stop executing events as soon as all listed GTIDs in the UNTIL list
+--echo # have been executed.
+}
+
+--connection slave
+--source include/stop_slave.inc
+--let $initial_slave_pos= query_get_value(SHOW ALL SLAVES STATUS, Exec_Master_Log_Pos, 1)
+
+--connection master
+--eval SET STATEMENT gtid_domain_id=0 FOR INSERT INTO t1 VALUES ($t1_ctr)
+--inc $t1_ctr
+
+if ($ssu_before_gtids)
+{
+ # Save binlog pos for domain 0
+ --let $expected_stop_gtid_d0= `SELECT REGEXP_SUBSTR(@@global.gtid_binlog_pos,'0-[0-9]+-[0-9]+')`
+ --echo # Tagging domain 0 stop: $expected_stop_gtid_d0
+}
+
+--eval SET STATEMENT gtid_domain_id=0 FOR INSERT INTO t1 VALUES ($t1_ctr)
+--inc $t1_ctr
+
+--eval SET STATEMENT gtid_domain_id=1 FOR INSERT INTO t2 VALUES ($t2_ctr)
+--inc $t2_ctr
+
+if ($ssu_before_gtids)
+{
+ # Save binlog pos for domain 1
+ --let $expected_stop_gtid_d1= `SELECT REGEXP_SUBSTR(@@global.gtid_binlog_pos,'1-[0-9]+-[0-9]+')`
+ --let $expected_stop_gtid= $expected_stop_gtid_d0,$expected_stop_gtid_d1
+}
+
+--eval SET STATEMENT gtid_domain_id=1 FOR INSERT INTO t2 VALUES ($t2_ctr)
+--inc $t2_ctr
+
+--let $until_gtid= `SELECT @@gtid_binlog_pos`
+if (!$ssu_before_gtids)
+{
+ --let $expected_stop_gtid= $until_gtid
+}
+
+--eval SET STATEMENT gtid_domain_id=0 FOR INSERT INTO t1 VALUES ($t1_ctr)
+--inc $t1_ctr
+--eval SET STATEMENT gtid_domain_id=1 FOR INSERT INTO t2 VALUES ($t2_ctr)
+--inc $t2_ctr
+
+--connection slave
+--eval START SLAVE UNTIL $ssu_opt="$until_gtid"
+
+--echo # Ensure the slave started
+--let $slave_param= Exec_Master_Log_Pos
+--let $slave_param_comparison= !=
+--let $slave_param_value= $initial_slave_pos
+--source include/wait_for_slave_param.inc
+--let $slave_param_comparison= =
+
+--source include/wait_for_slave_to_stop.inc
+--let $actual_stop_gtid= `SELECT @@gtid_slave_pos`
+
+if (`SELECT strcmp("$expected_stop_gtid","$actual_stop_gtid") != 0`)
+{
+ --echo # Expected stop gtid != actual stop gtid ($expected_stop_gtid != $actual_stop_gtid)
+ --die Expected stop gtid != actual stop gtid
+}
+
+--connection slave
+--source include/start_slave.inc
+--connection master
+--sync_slave_with_master
+
+
+--echo #
+--echo # Error Case 1: Not providing a valid GTID should result in a syntax
+--echo # error
+
+--connection slave
+--source include/stop_slave.inc
+
+--error ER_INCORRECT_GTID_STATE
+--eval START SLAVE UNTIL $ssu_opt="a"
+
+--error ER_INCORRECT_GTID_STATE
+--eval START SLAVE UNTIL $ssu_opt="0"
+
+--error ER_INCORRECT_GTID_STATE
+--eval START SLAVE UNTIL $ssu_opt="0-1"
+
+--error ER_INCORRECT_GTID_STATE
+--eval START SLAVE UNTIL $ssu_opt="0-1-"
+
+--error ER_INCORRECT_GTID_STATE
+--eval START SLAVE UNTIL $ssu_opt="a-b-c"
+
+--source include/start_slave.inc
+
+--echo #
+--echo # Cleanup test data
+--connection master
+DROP TABLE t1, t2;
+--source include/save_master_gtid.inc
+--connection slave
+--source include/sync_with_master_gtid.inc
+
+--let $include_filename= rpl_gtid_until_before_after_gtids.inc
+--source include/end_include_file.inc
diff --git a/mysql-test/suite/rpl/include/rpl_row_blob.test b/mysql-test/suite/rpl/include/rpl_row_blob.test
index 5cd7b6b4..408a2351 100644
--- a/mysql-test/suite/rpl/include/rpl_row_blob.test
+++ b/mysql-test/suite/rpl/include/rpl_row_blob.test
@@ -173,3 +173,21 @@ DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
# ensure cleanup on slave as well:
--sync_slave_with_master
+
+--echo #
+--echo # MDEV-30985 Replica stops with error on ALTER ONLINE with Geometry Types
+--echo #
+--connection master
+CREATE TABLE t(txt TEXT DEFAULT '111111111', blb LONGBLOB AS (txt));
+INSERT INTO t () VALUES (),(),();
+DELETE FROM t;
+
+DROP TABLE t;
+--sync_slave_with_master
+--connection master
+CREATE TABLE t(txt TEXT DEFAULT '111111111', blb LONGBLOB AS (txt) STORED);
+INSERT INTO t () VALUES (),(),();
+DELETE FROM t;
+
+DROP TABLE t;
+--sync_slave_with_master
diff --git a/mysql-test/suite/rpl/my.cnf b/mysql-test/suite/rpl/my.cnf
index d61e32ed..fa0a2c26 100644
--- a/mysql-test/suite/rpl/my.cnf
+++ b/mysql-test/suite/rpl/my.cnf
@@ -6,3 +6,5 @@
# E.g. after !include ../my.cnf, in your `test.cnf`, specify your configuration
# in option group e.g [mysqld.x], so that number `x` corresponds to the number
# in the rpl server topology.
+[mariadbd]
+slave_connections_needed_for_purge=0
diff --git a/mysql-test/suite/rpl/r/grant_replication_slave.result b/mysql-test/suite/rpl/r/grant_replication_slave.result
index 6ded7e72..b8de7e9f 100644
--- a/mysql-test/suite/rpl/r/grant_replication_slave.result
+++ b/mysql-test/suite/rpl/r/grant_replication_slave.result
@@ -38,6 +38,6 @@ drop database mysqltest1;
connection slave;
stop slave;
change master to master_user='root';
-start slave;
+include/start_slave.inc
include/rpl_end.inc
drop user rpl@localhost;
diff --git a/mysql-test/suite/rpl/r/max_binlog_total_size.result b/mysql-test/suite/rpl/r/max_binlog_total_size.result
new file mode 100644
index 00000000..f88e373d
--- /dev/null
+++ b/mysql-test/suite/rpl/r/max_binlog_total_size.result
@@ -0,0 +1,49 @@
+include/master-slave.inc
+[connection master]
+#
+# MDEV-31404 Implement binlog_space_limit
+#
+# Test that master is not deleting binary logs before slave has a
+# chance to digest them
+select @@global.max_binlog_total_size;
+@@global.max_binlog_total_size
+1500
+select @@global.max_binlog_size;
+@@global.max_binlog_size
+4096
+connection slave;
+STOP SLAVE IO_THREAD;
+include/wait_for_slave_io_to_stop.inc
+connection master;
+kill DUMP_THREAD;
+CREATE TABLE `t1` (
+`v1` int(11) DEFAULT NULL,
+`v2` varchar(8000) DEFAULT NULL,
+KEY `v1` (`v1`)
+);
+FLUSH LOGS;
+FLUSH LOGS;
+FLUSH LOGS;
+show binary logs;
+Log_name File_size
+binary.000001 #
+binary.000002 #
+binary.000003 #
+binary.000004 #
+INSERT INTO t1 VALUES (0,repeat("a",3000));
+show binary logs;
+Log_name File_size
+binary.000001 #
+binary.000002 #
+binary.000003 #
+binary.000004 #
+connection slave;
+START SLAVE IO_THREAD;
+connection master;
+connection slave;
+connection master;
+DROP TABLE t1;
+show binary logs;
+Log_name File_size
+binary.000004 #
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_000010.result b/mysql-test/suite/rpl/r/rpl_000010.result
index a86d71bd..0b3a67bf 100644
--- a/mysql-test/suite/rpl/r/rpl_000010.result
+++ b/mysql-test/suite/rpl/r/rpl_000010.result
@@ -16,4 +16,5 @@ n
connection master;
drop table t1;
connection slave;
+include/wait_for_slave_to_start.inc
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_alter_extra_persistent.result b/mysql-test/suite/rpl/r/rpl_alter_extra_persistent.result
index 96df87d8..b1b72830 100644
--- a/mysql-test/suite/rpl/r/rpl_alter_extra_persistent.result
+++ b/mysql-test/suite/rpl/r/rpl_alter_extra_persistent.result
@@ -32,8 +32,24 @@ a z1 z2
4 5 6
5 6 7
6 7 8
-#UPDATE query
+alter table t1 add column z3 int default(a+2);
connection master;
+insert into t1 values(7);
+insert into t1 values(8);
+connection slave;
+select * from t1 order by a;
+a z1 z2 z3
+1 2 3 3
+2 3 4 4
+3 4 5 5
+4 5 6 6
+5 6 7 7
+6 7 8 8
+7 8 9 9
+8 9 10 10
+connection master;
+delete from t1 where a > 6;
+#UPDATE query
update t1 set a = a+10;
select * from t1 order by a;
a
@@ -45,13 +61,13 @@ a
16
connection slave;
select * from t1 order by a;
-a z1 z2
-11 12 13
-12 13 14
-13 14 15
-14 15 16
-15 16 17
-16 17 18
+a z1 z2 z3
+11 12 13 3
+12 13 14 4
+13 14 15 5
+14 15 16 6
+15 16 17 7
+16 17 18 8
connection master;
update t1 set a = a-10;
select * from t1 order by a;
@@ -64,13 +80,13 @@ a
6
connection slave;
select * from t1 order by a;
-a z1 z2
-1 2 3
-2 3 4
-3 4 5
-4 5 6
-5 6 7
-6 7 8
+a z1 z2 z3
+1 2 3 3
+2 3 4 4
+3 4 5 5
+4 5 6 6
+5 6 7 7
+6 7 8 8
#DELETE quert
connection master;
delete from t1 where a > 2 and a < 4;
@@ -83,12 +99,12 @@ a
6
connection slave;
select * from t1 order by a;
-a z1 z2
-1 2 3
-2 3 4
-4 5 6
-5 6 7
-6 7 8
+a z1 z2 z3
+1 2 3 3
+2 3 4 4
+4 5 6 6
+5 6 7 7
+6 7 8 8
#REPLACE query
connection master;
replace into t1 values(1);
@@ -96,13 +112,13 @@ replace into t1 values(3);
replace into t1 values(1);
connection slave;
select * from t1 order by a;
-a z1 z2
-1 2 3
-2 3 4
-3 4 5
-4 5 6
-5 6 7
-6 7 8
+a z1 z2 z3
+1 2 3 3
+2 3 4 4
+3 4 5 5
+4 5 6 6
+5 6 7 7
+6 7 8 8
#SELECT query
connection master;
select * from t1 where a > 2 and a < 4;
@@ -110,8 +126,8 @@ a
3
connection slave;
select * from t1 where a > 2 and a < 4;
-a z1 z2
-3 4 5
+a z1 z2 z3
+3 4 5 5
#UPDATE with SELECT query
connection master;
update t1 set a = a + 10 where a > 2 and a < 4;
@@ -125,13 +141,13 @@ a
13
connection slave;
select * from t1 order by a;
-a z1 z2
-1 2 3
-2 3 4
-4 5 6
-5 6 7
-6 7 8
-13 14 15
+a z1 z2 z3
+1 2 3 3
+2 3 4 4
+4 5 6 6
+5 6 7 7
+6 7 8 8
+13 14 15 5
connection master;
update t1 set a = a - 10 where a = 13;
select * from t1 order by a;
@@ -144,13 +160,13 @@ a
6
connection slave;
select * from t1 order by a;
-a z1 z2
-1 2 3
-2 3 4
-3 4 5
-4 5 6
-5 6 7
-6 7 8
+a z1 z2 z3
+1 2 3 3
+2 3 4 4
+3 4 5 5
+4 5 6 6
+5 6 7 7
+6 7 8 8
#Break Unique Constraint
alter table t1 add column z4 int as (a % 6) persistent unique;
connection master;
@@ -168,27 +184,27 @@ a
connection slave;
include/wait_for_slave_sql_error.inc [errno=1062]
select * from t1 order by a;
-a z1 z2 z4
-1 2 3 1
-2 3 4 2
-3 4 5 3
-4 5 6 4
-5 6 7 5
-6 7 8 0
+a z1 z2 z3 z4
+1 2 3 3 1
+2 3 4 4 2
+3 4 5 5 3
+4 5 6 6 4
+5 6 7 7 5
+6 7 8 8 0
alter table t1 drop column z4;
start slave;
include/wait_for_slave_sql_to_start.inc
connection master;
connection slave;
select * from t1 order by a;
-a z1 z2
-1 2 3
-2 3 4
-3 4 5
-4 5 6
-5 6 7
-6 7 8
-7 8 9
+a z1 z2 z3
+1 2 3 3
+2 3 4 4
+3 4 5 5
+4 5 6 6
+5 6 7 7
+6 7 8 8
+7 8 9 9
connection master;
select * from t1 order by a;
a
@@ -200,4 +216,161 @@ a
6
7
drop table t1;
+connection slave;
+connection master;
+set binlog_row_image=minimal;
+create table t1(a int primary key auto_increment, b int unique);
+insert into t1 values(1, 1);
+insert into t1 values(2, 2);
+insert into t1 values(3, 3);
+insert into t1 values(4, 4);
+insert into t1 values(5, 5);
+connection slave;
+alter table t1 add column d1 int default (b),
+add column z1 int as (b+1) virtual,
+add column z2 int as (b+2) persistent;
+connection master;
+insert into t1 values(6, 6);
+update t1 set a = 11 where a = 1;
+update t1 set b = 12 where b = 2;
+delete from t1 where a = 3;
+delete from t1 where b = 5;
+update t1 set b = 16 where a = 6;
+connection slave;
+select * from t1;
+a b d1 z1 z2
+11 1 1 2 3
+2 12 2 13 14
+4 4 4 5 6
+6 16 6 17 18
+# Cleanup
+connection master;
+drop table t1;
+connection slave;
+connection master;
+set binlog_row_image=minimal;
+#
+# MDEV-29069 ER_KEY_NOT_FOUND upon online autoinc addition and
+# concurrent DELETE
+#
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+connection slave;
+alter table t add pk int auto_increment primary key;
+connection master;
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+connection slave;
+select * from t;
+a pk
+11 1
+30 3
+connection master;
+#
+# Add clumsy DEFAULT
+#
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+connection slave;
+alter table t add b int default(RAND() * 20), add key(b),
+algorithm=copy, lock=none;
+connection master;
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+connection slave;
+select a from t;
+a
+11
+30
+connection master;
+# CURRENT_TIMESTAMP
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+connection slave;
+alter table t add b timestamp default CURRENT_TIMESTAMP, add key(b);
+connection master;
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+connection slave;
+select a from t;
+a
+11
+30
+connection master;
+# CURRENT_TIMESTAMP, mixed key
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+connection slave;
+alter table t add b timestamp default CURRENT_TIMESTAMP, add key(a, b);
+connection master;
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+connection slave;
+select a from t;
+a
+11
+30
+connection master;
+# Mixed primary key
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+connection slave;
+alter table t add b int default (1), add primary key(b, a);
+connection master;
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+connection slave;
+select a from t;
+a
+11
+30
+connection master;
+#
+# Normal row, could be used as a key
+#
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+connection slave;
+alter table t add b int as (a * 10) unique;
+connection master;
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+connection slave;
+select * from t;
+a b
+11 110
+30 300
+connection master;
+#
+# Add key for old row
+#
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+connection slave;
+alter table t add unique(a);
+connection master;
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+connection slave;
+select * from t;
+a
+11
+30
+# Cleanup
+connection master;
+connection slave;
+connection master;
+drop table t;
+#
+# MDEV-30985 Replica stops with error on ALTER ONLINE with Geometry Types
+#
+create table t(geo geometrycollection default st_geomfromtext('point(1 1)'));
+insert into t () values (),(),();
+connection slave;
+alter table t add vcol9 point as (geo), add key(vcol9);
+connection master;
+delete from t;
+connection slave;
+connection master;
+drop table t;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_alter_instant.result b/mysql-test/suite/rpl/r/rpl_alter_innodb.result
index 35380fde..35380fde 100644
--- a/mysql-test/suite/rpl/r/rpl_alter_instant.result
+++ b/mysql-test/suite/rpl/r/rpl_alter_innodb.result
diff --git a/mysql-test/suite/rpl/r/rpl_alter_online_debug.result b/mysql-test/suite/rpl/r/rpl_alter_online_debug.result
new file mode 100644
index 00000000..d0040b39
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_alter_online_debug.result
@@ -0,0 +1,84 @@
+include/master-slave.inc
+[connection master]
+connection master;
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format");
+connection slave;
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format");
+# MDEV-31804 Assertion `thd->m_transaction_psi == __null' fails upon
+# replicating online ALTER
+connection master;
+create table t (a char(8)) engine=myisam;
+insert into t values ('foo'),('bar');
+set debug_sync= 'alter_table_online_progress signal go_dml wait_for go_alter';
+set @old_slave_exec_mode= @@global.slave_exec_mode;
+set @@global.slave_exec_mode= idempotent;
+alter table t force;
+connection master1;
+set debug_sync= 'now wait_for go_dml';
+insert into t (a) values ('qux');
+set debug_sync= 'now signal go_alter';
+connection master;
+connection slave;
+connection master;
+drop table t;
+set global slave_exec_mode= @old_slave_exec_mode;
+set debug_sync= reset;
+#
+# End of 11.2 tests (Single-phase alter)
+#
+connection slave;
+include/stop_slave.inc
+set global slave_parallel_threads=3;
+set global slave_parallel_mode= optimistic;
+set global binlog_row_image=MINIMAL;
+connection master;
+#
+# MDEV-31755 Replica's DML event deadlocks wit online alter table
+#
+# Three threads for SA,U,CA
+create table t (id int, a int, primary key (id)) engine=innodb;
+insert into t values (1,10), (2,20);
+set @@session.binlog_alter_two_phase=1;
+set debug_sync= 'alter_table_online_downgraded signal ready wait_for go';
+alter table t add c text default('qqq') after id, algorithm=copy, lock=none;
+connection master1;
+set debug_sync= 'now wait_for ready';
+update t set a = 1;
+set debug_sync= 'now signal go';
+connection master;
+include/save_master_gtid.inc
+connection slave;
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+select * from t;
+id c a
+1 qqq 1
+2 qqq 1
+connection master;
+drop table t;
+# MDEV-31838 Assertion fails on replica upon parallel
+# replication with two-phase alter and MINIMAL row image
+create table t (id int, a int, primary key(id)) engine=aria;
+insert into t values (1,0);
+set @@session.binlog_alter_two_phase=1;
+set debug_sync= 'alter_table_online_progress signal go_dml wait_for go_alter';
+alter table t force, algorithm=copy, lock=none;
+connection master1;
+set binlog_row_image=MINIMAL;
+set debug_sync= 'now wait_for go_dml';
+update ignore t set a = 1;
+set debug_sync= 'now signal go_alter';
+connection master;
+drop table t;
+connection slave;
+connection master;
+#
+# End of 11.2 tests (Two-phase alter)
+#
+connection slave;
+include/stop_slave.inc
+set global binlog_row_image=FULL;
+set global slave_parallel_threads=0;
+set global slave_parallel_mode= optimistic;
+include/start_slave.inc
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bug26395.result b/mysql-test/suite/rpl/r/rpl_bug26395.result
index 7c54e7b2..9053c332 100644
--- a/mysql-test/suite/rpl/r/rpl_bug26395.result
+++ b/mysql-test/suite/rpl/r/rpl_bug26395.result
@@ -8,7 +8,7 @@ Table Create Table
tinnodb CREATE TABLE `tinnodb` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-set @old_debug= @@debug;
+set @old_debug= @@debug_dbug;
set @@debug_dbug= 'd,do_not_write_xid';
==== Test ====
INSERT INTO tinnodb VALUES (1);
diff --git a/mysql-test/suite/rpl/r/rpl_change_master_demote.result b/mysql-test/suite/rpl/r/rpl_change_master_demote.result
index 2114ac4a..5deb412c 100644
--- a/mysql-test/suite/rpl/r/rpl_change_master_demote.result
+++ b/mysql-test/suite/rpl/r/rpl_change_master_demote.result
@@ -24,7 +24,7 @@ GTID_CURRENT_POS
GTID_SLAVE_POS
# First ensure gtid_slave_pos after master_demote_to_slave matches
# gtid_current_pos calculation
-CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_use_gtid=slave_pos, master_demote_to_slave=1 ;
+CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos, master_demote_to_slave=1 ;
SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC;
VARIABLE_NAME GLOBAL_VALUE
GTID_BINLOG_POS
@@ -91,7 +91,7 @@ GTID_CURRENT_POS 0-1-2
GTID_SLAVE_POS
# First ensure gtid_slave_pos after master_demote_to_slave matches
# gtid_current_pos calculation
-CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_use_gtid=slave_pos, master_demote_to_slave=1 ;
+CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos, master_demote_to_slave=1 ;
SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC;
VARIABLE_NAME GLOBAL_VALUE
GTID_BINLOG_POS 0-1-2
@@ -151,7 +151,7 @@ GTID_CURRENT_POS 0-1-6
GTID_SLAVE_POS 0-2-5
# First ensure gtid_slave_pos after master_demote_to_slave matches
# gtid_current_pos calculation
-CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_use_gtid=slave_pos, master_demote_to_slave=1 ;
+CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos, master_demote_to_slave=1 ;
SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC;
VARIABLE_NAME GLOBAL_VALUE
GTID_BINLOG_POS 0-1-6
@@ -213,7 +213,7 @@ GTID_CURRENT_POS 0-1-10
GTID_SLAVE_POS 0-1-10
# First ensure gtid_slave_pos after master_demote_to_slave matches
# gtid_current_pos calculation
-CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_use_gtid=slave_pos, master_demote_to_slave=1 ;
+CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos, master_demote_to_slave=1 ;
SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC;
VARIABLE_NAME GLOBAL_VALUE
GTID_BINLOG_POS 0-1-10
@@ -278,7 +278,7 @@ GTID_CURRENT_POS 0-1-14,1-1-2
GTID_SLAVE_POS 0-2-13
# First ensure gtid_slave_pos after master_demote_to_slave matches
# gtid_current_pos calculation
-CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_use_gtid=slave_pos, master_demote_to_slave=1 ;
+CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos, master_demote_to_slave=1 ;
SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC;
VARIABLE_NAME GLOBAL_VALUE
GTID_BINLOG_POS 0-1-14,1-1-2
@@ -361,7 +361,7 @@ GTID_CURRENT_POS 0-1-18,1-1-2,2-1-2
GTID_SLAVE_POS 0-1-18,1-1-2
# First ensure gtid_slave_pos after master_demote_to_slave matches
# gtid_current_pos calculation
-CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_use_gtid=slave_pos, master_demote_to_slave=1 ;
+CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos, master_demote_to_slave=1 ;
SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC;
VARIABLE_NAME GLOBAL_VALUE
GTID_BINLOG_POS 0-1-18,1-3-4,2-1-2,4-3-2
@@ -427,7 +427,7 @@ GTID_CURRENT_POS 0-2-21,1-3-4,2-1-3,3-1-2,4-3-2
GTID_SLAVE_POS 0-2-21,1-3-4,2-1-2,4-3-2
# First ensure gtid_slave_pos after master_demote_to_slave matches
# gtid_current_pos calculation
-CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_use_gtid=slave_pos, master_demote_to_slave=1 , ignore_domain_ids=(2,3);
+CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos, master_demote_to_slave=1 , ignore_domain_ids=(2,3);
SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC;
VARIABLE_NAME GLOBAL_VALUE
GTID_BINLOG_POS 0-1-18,1-3-4,2-1-3,3-1-2,4-3-2
@@ -527,7 +527,7 @@ GTID_CURRENT_POS 0-1-26,1-3-4,2-1-3,3-1-2,4-3-2
GTID_SLAVE_POS 0-1-26,1-3-4,2-1-3,3-1-2,4-3-2
# First ensure gtid_slave_pos after master_demote_to_slave matches
# gtid_current_pos calculation
-CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_use_gtid=slave_pos, master_demote_to_slave=1 , ignore_domain_ids=(2,3);
+CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos, master_demote_to_slave=1 , ignore_domain_ids=(2,3);
SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC;
VARIABLE_NAME GLOBAL_VALUE
GTID_BINLOG_POS 0-1-26,1-3-4,2-1-3,3-1-2,4-3-2
@@ -593,7 +593,7 @@ GTID_CURRENT_POS 0-2-29,1-3-4,2-1-3,3-1-2,4-3-2
GTID_SLAVE_POS 0-2-29,1-3-4,2-1-3,3-1-2,4-3-2
# First ensure gtid_slave_pos after master_demote_to_slave matches
# gtid_current_pos calculation
-CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_use_gtid=slave_pos, master_demote_to_slave=1 , ignore_domain_ids=(2,3);
+CHANGE MASTER TO master_host='127.0.0.1', master_port=SLAVE_PORT, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos, master_demote_to_slave=1 , ignore_domain_ids=(2,3);
SELECT VARIABLE_NAME, GLOBAL_VALUE FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_binlog_pos' OR VARIABLE_NAME LIKE 'gtid_slave_pos' OR VARIABLE_NAME LIKE 'gtid_current_pos' ORDER BY VARIABLE_NAME ASC;
VARIABLE_NAME GLOBAL_VALUE
GTID_BINLOG_POS 0-1-26,1-3-4,2-1-3,3-1-2,4-3-2
diff --git a/mysql-test/suite/rpl/r/rpl_checksum_cache.result b/mysql-test/suite/rpl/r/rpl_checksum_cache.result
index e8f221cc..b908c546 100644
--- a/mysql-test/suite/rpl/r/rpl_checksum_cache.result
+++ b/mysql-test/suite/rpl/r/rpl_checksum_cache.result
@@ -121,13 +121,54 @@ connection slave;
include/diff_tables.inc [master:test.t1, slave:test.t1]
include/diff_tables.inc [master:test.t2, slave:test.t2]
include/diff_tables.inc [master:test.t3, slave:test.t3]
+*** Test switching checksum algorithm while ongoing transactions have pre-computed checksum in their binlog cache ***
+connection master;
+CREATE TABLE t4 (a INT, b INT, c VARCHAR(1024), PRIMARY KEY (a,b)) ENGINE=InnoDB;
+BEGIN;
+INSERT INTO t4 VALUES (1, 1, "small, pre-computed checksums");
+connection server_1;
+BEGIN;
+INSERT INTO t4 VALUES (2, 1, "big, pre-computed checksums");
+set @@global.binlog_checksum = NONE;
+connection master;
+INSERT INTO t4 VALUES (1, 2, "done");
+COMMIT;
+connection server_1;
+INSERT INTO t4 VALUES (2, 22, "done");
+COMMIT;
+connection master;
+BEGIN;
+INSERT INTO t4 VALUES (3, 1, "small, no pre-computed checksums");
+connection server_1;
+BEGIN;
+INSERT INTO t4 VALUES (4, 1, "big, no pre-computed checksums");
+set @@global.binlog_checksum = CRC32;
+connection master;
+INSERT INTO t4 VALUES (3, 2, "done");
+COMMIT;
+connection server_1;
+INSERT INTO t4 VALUES (4, 22, "done");
+COMMIT;
+connection slave;
+*** Test the --binlog-legacy-event-pos option.
+connection master;
+FLUSH BINARY LOGS;
+BEGIN;
+INSERT INTO t4 VALUES (5, 1, "Zero end_log_pos");
+COMMIT;
+set @@global.binlog_legacy_event_pos= 1;
+BEGIN;
+INSERT INTO t4 VALUES (6, 1, "Non-zero end_log_pos");
+COMMIT;
+set @@global.binlog_legacy_event_pos= 0;
+connection slave;
connection master;
begin;
delete from t1;
delete from t2;
delete from t3;
commit;
-drop table t1, t2, t3;
+drop table t1, t2, t3, t4;
set @@global.binlog_cache_size = @save_binlog_cache_size;
set @@global.binlog_checksum = @save_binlog_checksum;
set @@global.master_verify_checksum = @save_master_verify_checksum;
diff --git a/mysql-test/suite/rpl/r/rpl_circular_semi_sync.result b/mysql-test/suite/rpl/r/rpl_circular_semi_sync.result
index 2596d346..9dd4aed2 100644
--- a/mysql-test/suite/rpl/r/rpl_circular_semi_sync.result
+++ b/mysql-test/suite/rpl/r/rpl_circular_semi_sync.result
@@ -32,7 +32,7 @@ include/sync_with_master_gtid.inc
connection server_1;
set @@global.gtid_strict_mode = true;
set @@global.rpl_semi_sync_slave_enabled = 1;
-CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_2, master_user='root', master_use_gtid=SLAVE_POS;
+CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_2, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=SLAVE_POS;
include/start_slave.inc
... is done.
## A. no out-of-order gtid error for own transaction made round trip
diff --git a/mysql-test/suite/rpl/r/rpl_connection.result b/mysql-test/suite/rpl/r/rpl_connection.result
index 9fb17b5f..4ca15c47 100644
--- a/mysql-test/suite/rpl/r/rpl_connection.result
+++ b/mysql-test/suite/rpl/r/rpl_connection.result
@@ -8,5 +8,5 @@ START SLAVE;
include/wait_for_slave_io_error.inc [errno=1045, 1593]
include/stop_slave_sql.inc
CHANGE MASTER TO MASTER_USER= 'root', MASTER_PASSWORD= '';
-START SLAVE;
+include/start_slave.inc
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_cross_version.result b/mysql-test/suite/rpl/r/rpl_cross_version.result
deleted file mode 100644
index 1b67542c..00000000
--- a/mysql-test/suite/rpl/r/rpl_cross_version.result
+++ /dev/null
@@ -1,22 +0,0 @@
-include/master-slave.inc
-[connection master]
-==== Initialize ====
-connection slave;
-include/stop_slave.inc
-RESET SLAVE;
-include/setup_fake_relay_log.inc
-Setting up fake replication from MYSQL_TEST_DIR/suite/binlog/std_data/binlog_old_version_4_1.000001
-==== Test ====
-start slave sql_thread;
-include/wait_for_slave_param.inc [Exec_Master_Log_Pos]
-==== a prove that the fake has been processed successfully ====
-SELECT COUNT(*) - 17920 as zero FROM t3;
-zero
-0
-==== Clean up ====
-include/stop_slave_sql.inc
-include/cleanup_fake_relay_log.inc
-Warnings:
-Note 4190 RESET SLAVE is implicitly changing the value of 'Using_Gtid' from 'No' to 'Slave_Pos'
-drop table t1, t3;
-include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_ctype_collate_implicit.result b/mysql-test/suite/rpl/r/rpl_ctype_collate_implicit.result
new file mode 100644
index 00000000..0616b22e
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_ctype_collate_implicit.result
@@ -0,0 +1,83 @@
+include/master-slave.inc
+[connection master]
+#
+# MDEV-30164 System variable for default collations
+#
+connection master;
+SET @@character_set_collations='utf8mb3=uca1400_ai_ci,'
+ 'utf8mb4=uca1400_ai_ci,'
+ 'ucs2=uca1400_ai_ci,'
+ 'utf16=uca1400_ai_ci,'
+ 'utf32=uca1400_ai_ci';
+connection master;
+CREATE TABLE t1 AS SELECT CHAR(0x61 USING utf8mb4);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `CHAR(0x61 USING utf8mb4)` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection slave;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `CHAR(0x61 USING utf8mb4)` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master;
+DROP TABLE t1;
+connection slave;
+connection master;
+CREATE TABLE t1 AS SELECT CONVERT('a' USING utf8mb4);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `CONVERT('a' USING utf8mb4)` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection slave;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `CONVERT('a' USING utf8mb4)` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master;
+DROP TABLE t1;
+connection slave;
+connection master;
+CREATE TABLE t1 (
+c0 TEXT CHARACTER SET utf8mb3,
+c1 TEXT CHARACTER SET utf8mb4,
+c2 TEXT CHARACTER SET utf16,
+c3 TEXT CHARACTER SET utf32,
+c4 TEXT CHARACTER SET ucs2
+);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c0` text CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
+ `c1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL,
+ `c2` text CHARACTER SET utf16 COLLATE utf16_uca1400_ai_ci DEFAULT NULL,
+ `c3` text CHARACTER SET utf32 COLLATE utf32_uca1400_ai_ci DEFAULT NULL,
+ `c4` text CHARACTER SET ucs2 COLLATE ucs2_uca1400_ai_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection slave;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c0` text CHARACTER SET utf8mb3 COLLATE utf8mb3_uca1400_ai_ci DEFAULT NULL,
+ `c1` text CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci DEFAULT NULL,
+ `c2` text CHARACTER SET utf16 COLLATE utf16_uca1400_ai_ci DEFAULT NULL,
+ `c3` text CHARACTER SET utf32 COLLATE utf32_uca1400_ai_ci DEFAULT NULL,
+ `c4` text CHARACTER SET ucs2 COLLATE ucs2_uca1400_ai_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
+connection master;
+DROP TABLE t1;
+connection slave;
+connection master;
+CREATE DATABASE db1 CHARACTER SET utf8mb4;
+connection slave;
+SHOW CREATE DATABASE db1;
+Database Create Database
+db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci */
+connection master;
+DROP DATABASE db1;
+connection slave;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_delayed_slave,parallel.rdiff b/mysql-test/suite/rpl/r/rpl_delayed_slave,parallel.rdiff
index aaadbb28..d803f8be 100644
--- a/mysql-test/suite/rpl/r/rpl_delayed_slave,parallel.rdiff
+++ b/mysql-test/suite/rpl/r/rpl_delayed_slave,parallel.rdiff
@@ -1,5 +1,5 @@
---- mysql-test/suite/rpl/r/rpl_delayed_slave.result 2016-10-14 21:14:02.338075590 +0200
-+++ mysql-test/suite/rpl/r/rpl_delayed_slave,parallel.reject 2016-10-14 21:17:51.296986686 +0200
+--- mysql-test/suite/rpl/r/rpl_delayed_slave.result
++++ mysql-test/suite/rpl/r/rpl_delayed_slave,parallel.reject
@@ -45,7 +45,6 @@
# wait for first query to execute
# sleep 1*T
diff --git a/mysql-test/suite/rpl/r/rpl_drop_db.result b/mysql-test/suite/rpl/r/rpl_drop_db.result
index 3712527a..1b132c20 100644
--- a/mysql-test/suite/rpl/r/rpl_drop_db.result
+++ b/mysql-test/suite/rpl/r/rpl_drop_db.result
@@ -6,8 +6,6 @@ create database mysqltest1;
create table mysqltest1.t1 (n int);
insert into mysqltest1.t1 values (1);
select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt';
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create table mysqltest1.t2 (n int);
create table mysqltest1.t3 (n int);
drop database mysqltest1;
diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result
index ea784e7f..5a9eb5ee 100644
--- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result
@@ -260,8 +260,7 @@ connection slave;
STOP SLAVE;
include/reset_slave.inc
CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
-d TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
-ON UPDATE CURRENT_TIMESTAMP,
+d TIMESTAMP NOT NULL DEFAULT 0,
e INT NOT NULL,
f text not null,
g text,
diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_minimal.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_minimal.result
new file mode 100644
index 00000000..adbee24d
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_minimal.result
@@ -0,0 +1,46 @@
+include/master-slave.inc
+[connection master]
+set binlog_row_image=minimal;
+connection slave;
+stop slave;
+set global binlog_row_image=minimal;
+include/reset_slave.inc
+create table t1 (
+a int key, b blob, c char(5),
+d char(10) as (concat(trim(c), '-U')) unique,
+e char(10) as (concat('S', b)) stored) engine=innodb;
+connection master;
+create table t1 (a int primary key, b blob, c char(5)) engine=innodb;
+reset master;
+connection slave;
+start slave;
+connection master;
+set timestamp=unix_timestamp('2010-10-10 10:10:10');
+insert t1 values (1,'.','Kyle'),(2,'?','JOE'),(3,'!','QA'), (4, '$', '4TH');
+update t1 set c='UPD' where a=3;
+update t1 set b='#' where a=2;
+delete from t1 where a=4;
+select * from t1;
+a b c
+1 . Kyle
+2 # JOE
+3 ! UPD
+connection slave;
+select * from t1;
+a b c d e
+1 . Kyle Kyle-U S.
+2 # JOE JOE-U S#
+3 ! UPD UPD-U S!
+select d from t1;
+d
+JOE-U
+Kyle-U
+UPD-U
+select * from t1 where d='JOE-U';
+a b c d e
+2 # JOE JOE-U S#
+connection master;
+drop table t1;
+connection slave;
+set global binlog_row_image=full;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result
index 8ad7e987..d0fb5a30 100644
--- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result
@@ -260,8 +260,7 @@ connection slave;
STOP SLAVE;
include/reset_slave.inc
CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
-d TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
-ON UPDATE CURRENT_TIMESTAMP,
+d TIMESTAMP NOT NULL DEFAULT 0,
e INT NOT NULL,
f text not null,
g text,
diff --git a/mysql-test/suite/rpl/r/rpl_geometry.result b/mysql-test/suite/rpl/r/rpl_geometry.result
index 01dad7b0..b2c9503f 100644
--- a/mysql-test/suite/rpl/r/rpl_geometry.result
+++ b/mysql-test/suite/rpl/r/rpl_geometry.result
@@ -14,4 +14,14 @@ insert into t2(c) values (null);
connection slave;
connection master;
drop table t1, t2;
+#
+# MDEV-30985 Replica stops with error on ALTER ONLINE with Geometry Types
+#
+create table t(geo geometrycollection default st_geomfromtext('point(1 1)'),
+vc point as (geo));
+insert into t () values (),(),();
+delete from t;
+connection slave;
+connection master;
+drop table t;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_glle_no_terminate.result b/mysql-test/suite/rpl/r/rpl_gtid_glle_no_terminate.result
index f4d257c2..98daf309 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_glle_no_terminate.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_glle_no_terminate.result
@@ -28,7 +28,6 @@ include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
slave-relay-bin.000002 # Rotate # # master-bin.000001;pos=POS
slave-relay-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
-slave-relay-bin.000002 # Gtid_list # # []
slave-relay-bin.000002 # Binlog_checkpoint # # master-bin.000001
slave-relay-bin.000002 # Gtid # # GTID #-#-#
slave-relay-bin.000002 # Gtid_list # # [#-#-#]
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_index.result b/mysql-test/suite/rpl/r/rpl_gtid_index.result
new file mode 100644
index 00000000..a4cd2491
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_gtid_index.result
@@ -0,0 +1,366 @@
+include/master-slave.inc
+[connection master]
+connection slave;
+include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid= slave_pos;
+include/start_slave.inc
+connection master;
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (0, 0);
+*** Test looking up a lot of different event positions and GTIDs.
+CREATE FUNCTION gtid_eq(a VARCHAR(255), b VARCHAR(255)) RETURNS BOOLEAN DETERMINISTIC
+BEGIN
+DECLARE g VARCHAR(255);
+IF a IS NULL OR b IS NULL OR LENGTH(a) != LENGTH(b) THEN
+RETURN FALSE;
+END IF;
+SET a= CONCAT(a, ',');
+SET b= CONCAT(',', b, ',');
+WHILE LENGTH(a) > 0 DO
+SET g= REGEXP_SUBSTR(a, '^[^,]+,');
+SET a= SUBSTRING(a, LENGTH(g)+1);
+SET b= REPLACE(b, CONCAT(',', g), ',');
+END WHILE;
+RETURN b = ',';
+END //
+SET @old_page_size= @@GLOBAL.binlog_gtid_index_page_size;
+SET @old_span_min= @@GLOBAL.binlog_gtid_index_span_min;
+*** A fair amount of work with default GTID index settings.
+*** Testing 200 GTIDs with 50 test connects
+connection master;
+DELETE FROM t1 WHERE a >= 1000;
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+CREATE TABLE rand_data(idx INT PRIMARY KEY, domain_id INT, server_id INT)
+ENGINE=InnoDB;
+INSERT INTO rand_data(idx, domain_id, server_id) VALUES (0, 0, 1);
+INSERT INTO rand_data(idx, domain_id, server_id)
+SELECT seq,
+@tmp:=floor(5*POW(rand(42),2)),
+100 + 5*@tmp + floor(5*rand(42))
+FROM seq_1_to_200;
+SELECT COUNT(*), SUM(domain_id), SUM(server_id) FROM rand_data;
+COUNT(*) SUM(domain_id) SUM(server_id)
+201 285 21852
+CREATE TABLE gtid_data(
+idx INT PRIMARY KEY,
+gtid VARCHAR(44),
+gtid_pos VARCHAR(255),
+file VARCHAR(100),
+pos INT,
+row_count INT,
+KEY(file, pos)) ENGINE=InnoDB;
+include/save_master_gtid.inc
+connection slave;
+include/sync_with_master_gtid.inc
+include/stop_slave.inc
+connection master;
+SET @orig_domain_id= @@gtid_domain_id;
+SET @orig_server_id= @@server_id;
+SET gtid_domain_id= @orig_domain_id;
+SET server_id= @orig_server_id;
+SELECT COUNT(*) FROM gtid_data;
+COUNT(*)
+200
+*** The result should be empty, otherwise some result is wrong:
+SELECT idx, gtid_pos, BINLOG_GTID_POS(file, pos)
+FROM gtid_data
+WHERE NOT gtid_eq(CONVERT(gtid_pos USING utf8),BINLOG_GTID_POS(file, pos))
+ORDER BY idx;
+idx gtid_pos BINLOG_GTID_POS(file, pos)
+connection slave;
+SET @orig_pos= @@GLOBAL.gtid_slave_pos;
+SET @orig_t1_limit= (SELECT MAX(a) FROM t1);
+*** Now connect the slave to each position in turn, and test that
+*** the right amount of data is replicated at each point.
+*** Test slave connecting to some GTID positions where the position in
+*** the master's binlog is different between the different domains.
+*** Revind the slave and test on the same binlog data from the master as before.
+connection slave;
+SET sql_log_bin= 0;
+TRUNCATE gtid_data;
+DELETE FROM t1 WHERE a > @orig_t1_limit;
+SET sql_log_bin= 1;
+SET GLOBAL gtid_slave_pos= @orig_pos;
+connection master;
+connection slave;
+connection master;
+DROP TABLE gtid_data, rand_data;
+include/save_master_gtid.inc
+connection slave;
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+connection master;
+*** A lot of GTIDs with small btree pages to stress the Btree code.
+SET GLOBAL binlog_gtid_index_page_size= 64;
+SET GLOBAL binlog_gtid_index_span_min= 1;
+*** Testing 1000 GTIDs with 50 test connects
+connection master;
+DELETE FROM t1 WHERE a >= 1000;
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+CREATE TABLE rand_data(idx INT PRIMARY KEY, domain_id INT, server_id INT)
+ENGINE=InnoDB;
+INSERT INTO rand_data(idx, domain_id, server_id) VALUES (0, 0, 1);
+INSERT INTO rand_data(idx, domain_id, server_id)
+SELECT seq,
+@tmp:=floor(10*POW(rand(150),2)),
+100 + 5*@tmp + floor(5*rand(150))
+FROM seq_1_to_1000;
+SELECT COUNT(*), SUM(domain_id), SUM(server_id) FROM rand_data;
+COUNT(*) SUM(domain_id) SUM(server_id)
+1001 2881 116394
+CREATE TABLE gtid_data(
+idx INT PRIMARY KEY,
+gtid VARCHAR(44),
+gtid_pos VARCHAR(255),
+file VARCHAR(100),
+pos INT,
+row_count INT,
+KEY(file, pos)) ENGINE=InnoDB;
+include/save_master_gtid.inc
+connection slave;
+include/sync_with_master_gtid.inc
+include/stop_slave.inc
+connection master;
+SET @orig_domain_id= @@gtid_domain_id;
+SET @orig_server_id= @@server_id;
+SET gtid_domain_id= @orig_domain_id;
+SET server_id= @orig_server_id;
+SELECT COUNT(*) FROM gtid_data;
+COUNT(*)
+1000
+*** The result should be empty, otherwise some result is wrong:
+SELECT idx, gtid_pos, BINLOG_GTID_POS(file, pos)
+FROM gtid_data
+WHERE NOT gtid_eq(CONVERT(gtid_pos USING utf8),BINLOG_GTID_POS(file, pos))
+ORDER BY idx;
+idx gtid_pos BINLOG_GTID_POS(file, pos)
+connection slave;
+SET @orig_pos= @@GLOBAL.gtid_slave_pos;
+SET @orig_t1_limit= (SELECT MAX(a) FROM t1);
+*** Now connect the slave to each position in turn, and test that
+*** the right amount of data is replicated at each point.
+*** Test slave connecting to some GTID positions where the position in
+*** the master's binlog is different between the different domains.
+*** Revind the slave and test on the same binlog data from the master as before.
+connection slave;
+SET sql_log_bin= 0;
+TRUNCATE gtid_data;
+DELETE FROM t1 WHERE a > @orig_t1_limit;
+SET sql_log_bin= 1;
+SET GLOBAL gtid_slave_pos= @orig_pos;
+connection master;
+connection slave;
+connection master;
+DROP TABLE gtid_data, rand_data;
+include/save_master_gtid.inc
+connection slave;
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+connection master;
+*** Small page size with sparse index.
+SET GLOBAL binlog_gtid_index_page_size= 64;
+SET GLOBAL binlog_gtid_index_span_min= 2048;
+*** Testing 200 GTIDs with 50 test connects
+connection master;
+DELETE FROM t1 WHERE a >= 1000;
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+CREATE TABLE rand_data(idx INT PRIMARY KEY, domain_id INT, server_id INT)
+ENGINE=InnoDB;
+INSERT INTO rand_data(idx, domain_id, server_id) VALUES (0, 0, 1);
+INSERT INTO rand_data(idx, domain_id, server_id)
+SELECT seq,
+@tmp:=floor(10*POW(rand(666),2)),
+100 + 5*@tmp + floor(5*rand(666))
+FROM seq_1_to_200;
+SELECT COUNT(*), SUM(domain_id), SUM(server_id) FROM rand_data;
+COUNT(*) SUM(domain_id) SUM(server_id)
+201 599 23410
+CREATE TABLE gtid_data(
+idx INT PRIMARY KEY,
+gtid VARCHAR(44),
+gtid_pos VARCHAR(255),
+file VARCHAR(100),
+pos INT,
+row_count INT,
+KEY(file, pos)) ENGINE=InnoDB;
+include/save_master_gtid.inc
+connection slave;
+include/sync_with_master_gtid.inc
+include/stop_slave.inc
+connection master;
+SET @orig_domain_id= @@gtid_domain_id;
+SET @orig_server_id= @@server_id;
+SET gtid_domain_id= @orig_domain_id;
+SET server_id= @orig_server_id;
+SELECT COUNT(*) FROM gtid_data;
+COUNT(*)
+200
+*** The result should be empty, otherwise some result is wrong:
+SELECT idx, gtid_pos, BINLOG_GTID_POS(file, pos)
+FROM gtid_data
+WHERE NOT gtid_eq(CONVERT(gtid_pos USING utf8),BINLOG_GTID_POS(file, pos))
+ORDER BY idx;
+idx gtid_pos BINLOG_GTID_POS(file, pos)
+connection slave;
+SET @orig_pos= @@GLOBAL.gtid_slave_pos;
+SET @orig_t1_limit= (SELECT MAX(a) FROM t1);
+*** Now connect the slave to each position in turn, and test that
+*** the right amount of data is replicated at each point.
+*** Test slave connecting to some GTID positions where the position in
+*** the master's binlog is different between the different domains.
+*** Revind the slave and test on the same binlog data from the master as before.
+connection slave;
+SET sql_log_bin= 0;
+TRUNCATE gtid_data;
+DELETE FROM t1 WHERE a > @orig_t1_limit;
+SET sql_log_bin= 1;
+SET GLOBAL gtid_slave_pos= @orig_pos;
+connection master;
+connection slave;
+connection master;
+DROP TABLE gtid_data, rand_data;
+include/save_master_gtid.inc
+connection slave;
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+connection master;
+*** Medium page size.
+SET GLOBAL binlog_gtid_index_page_size= 512;
+SET GLOBAL binlog_gtid_index_span_min= 512;
+*** Testing 200 GTIDs with 50 test connects
+connection master;
+DELETE FROM t1 WHERE a >= 1000;
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+CREATE TABLE rand_data(idx INT PRIMARY KEY, domain_id INT, server_id INT)
+ENGINE=InnoDB;
+INSERT INTO rand_data(idx, domain_id, server_id) VALUES (0, 0, 1);
+INSERT INTO rand_data(idx, domain_id, server_id)
+SELECT seq,
+@tmp:=floor(10*POW(rand(1024),2)),
+100 + 5*@tmp + floor(5*rand(1024))
+FROM seq_1_to_200;
+SELECT COUNT(*), SUM(domain_id), SUM(server_id) FROM rand_data;
+COUNT(*) SUM(domain_id) SUM(server_id)
+201 555 23160
+CREATE TABLE gtid_data(
+idx INT PRIMARY KEY,
+gtid VARCHAR(44),
+gtid_pos VARCHAR(255),
+file VARCHAR(100),
+pos INT,
+row_count INT,
+KEY(file, pos)) ENGINE=InnoDB;
+include/save_master_gtid.inc
+connection slave;
+include/sync_with_master_gtid.inc
+include/stop_slave.inc
+connection master;
+SET @orig_domain_id= @@gtid_domain_id;
+SET @orig_server_id= @@server_id;
+SET gtid_domain_id= @orig_domain_id;
+SET server_id= @orig_server_id;
+SELECT COUNT(*) FROM gtid_data;
+COUNT(*)
+200
+*** The result should be empty, otherwise some result is wrong:
+SELECT idx, gtid_pos, BINLOG_GTID_POS(file, pos)
+FROM gtid_data
+WHERE NOT gtid_eq(CONVERT(gtid_pos USING utf8),BINLOG_GTID_POS(file, pos))
+ORDER BY idx;
+idx gtid_pos BINLOG_GTID_POS(file, pos)
+connection slave;
+SET @orig_pos= @@GLOBAL.gtid_slave_pos;
+SET @orig_t1_limit= (SELECT MAX(a) FROM t1);
+*** Now connect the slave to each position in turn, and test that
+*** the right amount of data is replicated at each point.
+*** Test slave connecting to some GTID positions where the position in
+*** the master's binlog is different between the different domains.
+*** Revind the slave and test on the same binlog data from the master as before.
+connection slave;
+SET sql_log_bin= 0;
+TRUNCATE gtid_data;
+DELETE FROM t1 WHERE a > @orig_t1_limit;
+SET sql_log_bin= 1;
+SET GLOBAL gtid_slave_pos= @orig_pos;
+connection master;
+connection slave;
+connection master;
+DROP TABLE gtid_data, rand_data;
+include/save_master_gtid.inc
+connection slave;
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+connection master;
+*** Large page size.
+SET GLOBAL binlog_gtid_index_page_size= 16384;
+SET GLOBAL binlog_gtid_index_span_min= 1;
+*** Testing 200 GTIDs with 50 test connects
+connection master;
+DELETE FROM t1 WHERE a >= 1000;
+FLUSH NO_WRITE_TO_BINLOG BINARY LOGS;
+CREATE TABLE rand_data(idx INT PRIMARY KEY, domain_id INT, server_id INT)
+ENGINE=InnoDB;
+INSERT INTO rand_data(idx, domain_id, server_id) VALUES (0, 0, 1);
+INSERT INTO rand_data(idx, domain_id, server_id)
+SELECT seq,
+@tmp:=floor(10*POW(rand(12345),2)),
+100 + 5*@tmp + floor(5*rand(12345))
+FROM seq_1_to_200;
+SELECT COUNT(*), SUM(domain_id), SUM(server_id) FROM rand_data;
+COUNT(*) SUM(domain_id) SUM(server_id)
+201 571 23252
+CREATE TABLE gtid_data(
+idx INT PRIMARY KEY,
+gtid VARCHAR(44),
+gtid_pos VARCHAR(255),
+file VARCHAR(100),
+pos INT,
+row_count INT,
+KEY(file, pos)) ENGINE=InnoDB;
+include/save_master_gtid.inc
+connection slave;
+include/sync_with_master_gtid.inc
+include/stop_slave.inc
+connection master;
+SET @orig_domain_id= @@gtid_domain_id;
+SET @orig_server_id= @@server_id;
+SET gtid_domain_id= @orig_domain_id;
+SET server_id= @orig_server_id;
+SELECT COUNT(*) FROM gtid_data;
+COUNT(*)
+200
+*** The result should be empty, otherwise some result is wrong:
+SELECT idx, gtid_pos, BINLOG_GTID_POS(file, pos)
+FROM gtid_data
+WHERE NOT gtid_eq(CONVERT(gtid_pos USING utf8),BINLOG_GTID_POS(file, pos))
+ORDER BY idx;
+idx gtid_pos BINLOG_GTID_POS(file, pos)
+connection slave;
+SET @orig_pos= @@GLOBAL.gtid_slave_pos;
+SET @orig_t1_limit= (SELECT MAX(a) FROM t1);
+*** Now connect the slave to each position in turn, and test that
+*** the right amount of data is replicated at each point.
+*** Test slave connecting to some GTID positions where the position in
+*** the master's binlog is different between the different domains.
+*** Revind the slave and test on the same binlog data from the master as before.
+connection slave;
+SET sql_log_bin= 0;
+TRUNCATE gtid_data;
+DELETE FROM t1 WHERE a > @orig_t1_limit;
+SET sql_log_bin= 1;
+SET GLOBAL gtid_slave_pos= @orig_pos;
+connection master;
+connection slave;
+connection master;
+DROP TABLE gtid_data, rand_data;
+include/save_master_gtid.inc
+connection slave;
+include/start_slave.inc
+include/sync_with_master_gtid.inc
+connection master;
+connection master;
+SET GLOBAL binlog_gtid_index_page_size= @old_page_size;
+SET GLOBAL binlog_gtid_index_span_min= @old_span_min;
+DROP TABLE t1;
+DROP FUNCTION gtid_eq;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_master_promote.result b/mysql-test/suite/rpl/r/rpl_gtid_master_promote.result
index 92430be1..af562e93 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_master_promote.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_master_promote.result
@@ -335,7 +335,8 @@ a b
*** Now let the old master join up as slave. ***
connection server_1;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2,
-master_user = "root", master_use_gtid = slave_pos, master_demote_to_slave=1;
+master_user = "root", master_ssl_verify_server_cert=0,
+master_use_gtid = slave_pos, master_demote_to_slave=1;
include/start_slave.inc
SELECT * FROM t1 ORDER BY a;
a
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result
index 9524dafb..c2a1cd28 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result
@@ -12,7 +12,8 @@ include/wait_for_slave_to_stop.inc
reset slave all;
connection server_1;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2,
-master_user='root', MASTER_USE_GTID=SLAVE_POS, master_demote_to_slave=1;
+master_user='root', master_ssl_verify_server_cert=0,
+MASTER_USE_GTID=SLAVE_POS, master_demote_to_slave=1;
include/start_slave.inc
include/wait_for_slave_to_start.inc
connection server_2;
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev4485.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev4485.result
index 58953491..fee14722 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_mdev4485.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev4485.result
@@ -6,7 +6,7 @@ connection server_2;
create table t2 (i int);
connection server_3;
set default_master_connection = 'm2';
-change master to master_host='127.0.0.1', master_port=SERVER_MYPORT_2, master_user='root', master_use_gtid=slave_pos;
+change master to master_host='127.0.0.1', master_port=SERVER_MYPORT_2, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
include/start_slave.inc
connection server_2;
insert into t2 values (1);
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result
index 665fc536..5fba9966 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result
@@ -44,7 +44,7 @@ RESET MASTER;
SET GLOBAL gtid_slave_pos= '0-2-10';
connection server_1;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2,
-master_user= 'root', master_use_gtid=CURRENT_POS;
+master_user= 'root', master_ssl_verify_server_cert=0, master_use_gtid=CURRENT_POS;
START SLAVE;
connection server_2;
INSERT INTO t1 VALUES (11);
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result b/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result
index 8b896560..6a31eedc 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result
@@ -20,8 +20,8 @@ a b
2 1
include/stop_slave.inc
connection server_1;
-CHANGE MASTER TO master_host = '127.0.0.1', master_port = SLAVE_PORT,
-master_user = 'root';
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = SLAVE_PORT, master_ssl_verify_server_cert=0,
+master_user = 'root', master_ssl_verify_server_cert=0;
START SLAVE;
include/wait_for_slave_to_start.inc
connection server_2;
@@ -50,7 +50,7 @@ INSERT INTO t1 VALUES (5, 1);
INSERT INTO t1 VALUES (6, 1);
include/save_master_gtid.inc
connection server_2;
-CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT;
+CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT, master_ssl_verify_server_cert=0;
START SLAVE;
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_until_before_after_gtids.result b/mysql-test/suite/rpl/r/rpl_gtid_until_before_after_gtids.result
new file mode 100644
index 00000000..dd9035d3
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_gtid_until_before_after_gtids.result
@@ -0,0 +1,239 @@
+include/master-slave.inc
+[connection master]
+include/rpl_gtid_until_before_after_gtids.inc
+#
+# Test Setup (SQL_BEFORE_GTIDS)
+# Clean primary and replica states
+connection master;
+connection slave;
+connection master;
+RESET MASTER;
+set session gtid_domain_id=0;
+# Initialize test data
+connection master;
+create table t1 (a int);
+create table t2 (a int);
+connection slave;
+#
+# Test Case 1 (SQL_BEFORE_GTIDS): For a single-dimensional binlog state and a
+# STOP SLAVE UNTIL gtid position with one GTID, the replica should
+# execute events up until the GTID is encountered, and immediately stop
+connection slave;
+connection master;
+set session gtid_domain_id=0;
+INSERT INTO t1 VALUES (100);
+INSERT INTO t1 VALUES (101);
+INSERT INTO t1 VALUES (102);
+connection slave;
+START SLAVE UNTIL SQL_BEFORE_GTIDS="0-1-4";
+# Ensure the slave started
+# Clean replica state
+connection master;
+connection slave;
+#
+# Test Case 2 (SQL_BEFORE_GTIDS): If a provided until GTID doesn't exist in the
+# binary log due to a gap, once an event is seen that is beyond the
+# until GTID, the slave should immediately stop. Note the behavior of
+# this test case should be the same between SQL_BEFORE_GTIDS and
+# SQL_AFTER_GTIDS.
+connection slave;
+connection master;
+set session gtid_domain_id=0;
+INSERT INTO t1 VALUES (103);
+INSERT INTO t1 VALUES (104);
+# Skip a seq_no
+set @@session.gtid_seq_no= 9;
+INSERT INTO t1 VALUES (105);
+connection slave;
+START SLAVE UNTIL SQL_BEFORE_GTIDS="0-1-8";
+# Ensure the slave started
+connection slave;
+connection master;
+connection slave;
+#
+# Test Case 3 (SQL_BEFORE_GTIDS): For a multi-dimensional binlog state and a
+# STOP SLAVE UNTIL gtid position with one GTID, the replica should
+# execute events from only the specified domain until the provided GTID
+# is encountered, and immediately stop
+connection slave;
+connection master;
+set session gtid_domain_id=0;
+INSERT INTO t1 VALUES (106);
+set session gtid_domain_id=1;
+INSERT INTO t2 VALUES (200);
+INSERT INTO t2 VALUES (201);
+set session gtid_domain_id=0;
+INSERT INTO t1 VALUES (107);
+set session gtid_domain_id=1;
+INSERT INTO t2 VALUES (202);
+set session gtid_domain_id=0;
+connection slave;
+START SLAVE UNTIL SQL_BEFORE_GTIDS="0-1-11";
+# Ensure the slave started
+connection slave;
+connection master;
+connection slave;
+#
+# Test Case 4 (SQL_BEFORE_GTIDS): For a multi-dimensional binlog state and a
+# STOP SLAVE UNTIL gtid position with multiple GTIDs, the replica should
+# for each domain, execute events only up until its provided GTID, and
+# once all domains have hit their end point, immediately stop.
+connection slave;
+connection master;
+SET STATEMENT gtid_domain_id=0 FOR INSERT INTO t1 VALUES (108);
+# Tagging domain 0 stop: 0-1-12
+SET STATEMENT gtid_domain_id=0 FOR INSERT INTO t1 VALUES (109);
+SET STATEMENT gtid_domain_id=1 FOR INSERT INTO t2 VALUES (203);
+SET STATEMENT gtid_domain_id=1 FOR INSERT INTO t2 VALUES (204);
+SET STATEMENT gtid_domain_id=0 FOR INSERT INTO t1 VALUES (110);
+SET STATEMENT gtid_domain_id=1 FOR INSERT INTO t2 VALUES (205);
+connection slave;
+START SLAVE UNTIL SQL_BEFORE_GTIDS="0-1-13,1-1-5";
+# Ensure the slave started
+connection slave;
+connection master;
+connection slave;
+#
+# Error Case 1: Not providing a valid GTID should result in a syntax
+# error
+connection slave;
+START SLAVE UNTIL SQL_BEFORE_GTIDS="a";
+ERROR HY000: Could not parse GTID list
+START SLAVE UNTIL SQL_BEFORE_GTIDS="0";
+ERROR HY000: Could not parse GTID list
+START SLAVE UNTIL SQL_BEFORE_GTIDS="0-1";
+ERROR HY000: Could not parse GTID list
+START SLAVE UNTIL SQL_BEFORE_GTIDS="0-1-";
+ERROR HY000: Could not parse GTID list
+START SLAVE UNTIL SQL_BEFORE_GTIDS="a-b-c";
+ERROR HY000: Could not parse GTID list
+#
+# Cleanup test data
+connection master;
+DROP TABLE t1, t2;
+connection slave;
+include/rpl_gtid_until_before_after_gtids.inc
+#
+# Test Setup (SQL_AFTER_GTIDS)
+# Clean primary and replica states
+connection master;
+connection slave;
+connection master;
+RESET MASTER;
+set session gtid_domain_id=0;
+# Initialize test data
+connection master;
+create table t1 (a int);
+create table t2 (a int);
+connection slave;
+#
+# Test Case 1 (SQL_AFTER_GTIDS): For a single-dimensional binlog state and a
+# STOP SLAVE UNTIL gtid position with one GTID, the replica should
+# execute events up until the GTID is encountered, finish replicating
+# that event group, and then stop
+connection slave;
+connection master;
+set session gtid_domain_id=0;
+INSERT INTO t1 VALUES (111);
+INSERT INTO t1 VALUES (112);
+INSERT INTO t1 VALUES (113);
+connection slave;
+START SLAVE UNTIL SQL_AFTER_GTIDS="0-1-4";
+# Ensure the slave started
+# Clean replica state
+connection master;
+connection slave;
+#
+# Test Case 2 (SQL_AFTER_GTIDS): If a provided until GTID doesn't exist in the
+# binary log due to a gap, once an event is seen that is beyond the
+# until GTID, the slave should immediately stop. Note the behavior of
+# this test case should be the same between SQL_BEFORE_GTIDS and
+# SQL_AFTER_GTIDS.
+connection slave;
+connection master;
+set session gtid_domain_id=0;
+INSERT INTO t1 VALUES (114);
+INSERT INTO t1 VALUES (115);
+# Skip a seq_no
+set @@session.gtid_seq_no= 9;
+INSERT INTO t1 VALUES (116);
+connection slave;
+START SLAVE UNTIL SQL_AFTER_GTIDS="0-1-8";
+# Ensure the slave started
+connection slave;
+connection master;
+connection slave;
+#
+# Test Case 3 (SQL_AFTER_GTIDS): For a multi-dimensional binlog state and a
+# STOP SLAVE UNTIL gtid position with one GTID, the replica should
+# execute events from only the specified domain until the provided GTID
+# is encountered, finish replicating that event group, and then stop
+connection slave;
+connection master;
+set session gtid_domain_id=0;
+INSERT INTO t1 VALUES (117);
+set session gtid_domain_id=1;
+INSERT INTO t2 VALUES (206);
+INSERT INTO t2 VALUES (207);
+set session gtid_domain_id=0;
+INSERT INTO t1 VALUES (118);
+set session gtid_domain_id=1;
+INSERT INTO t2 VALUES (208);
+set session gtid_domain_id=0;
+connection slave;
+START SLAVE UNTIL SQL_AFTER_GTIDS="0-1-11";
+# Ensure the slave started
+connection slave;
+connection master;
+connection slave;
+#
+# Test Case 4 (SQL_AFTER_GTIDS): For a multi-dimensional binlog state and a
+# STOP SLAVE UNTIL gtid position with multiple GTIDs, the replica should
+# stop executing events as soon as all listed GTIDs in the UNTIL list
+# have been executed.
+connection slave;
+connection master;
+SET STATEMENT gtid_domain_id=0 FOR INSERT INTO t1 VALUES (119);
+SET STATEMENT gtid_domain_id=0 FOR INSERT INTO t1 VALUES (120);
+SET STATEMENT gtid_domain_id=1 FOR INSERT INTO t2 VALUES (209);
+SET STATEMENT gtid_domain_id=1 FOR INSERT INTO t2 VALUES (210);
+SET STATEMENT gtid_domain_id=0 FOR INSERT INTO t1 VALUES (121);
+SET STATEMENT gtid_domain_id=1 FOR INSERT INTO t2 VALUES (211);
+connection slave;
+START SLAVE UNTIL SQL_AFTER_GTIDS="0-1-13,1-1-5";
+# Ensure the slave started
+connection slave;
+connection master;
+connection slave;
+#
+# Error Case 1: Not providing a valid GTID should result in a syntax
+# error
+connection slave;
+START SLAVE UNTIL SQL_AFTER_GTIDS="a";
+ERROR HY000: Could not parse GTID list
+START SLAVE UNTIL SQL_AFTER_GTIDS="0";
+ERROR HY000: Could not parse GTID list
+START SLAVE UNTIL SQL_AFTER_GTIDS="0-1";
+ERROR HY000: Could not parse GTID list
+START SLAVE UNTIL SQL_AFTER_GTIDS="0-1-";
+ERROR HY000: Could not parse GTID list
+START SLAVE UNTIL SQL_AFTER_GTIDS="a-b-c";
+ERROR HY000: Could not parse GTID list
+#
+# Cleanup test data
+connection master;
+DROP TABLE t1, t2;
+connection slave;
+#
+# Error Case 2: Providing both SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS
+# should result in a syntax error
+connection slave;
+START SLAVE UNTIL SQL_AFTER_GTIDS="0-1-1" SQL_BEFORE_GTIDS="0-1-1";
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SQL_BEFORE_GTIDS="0-1-1"' at line 1
+#
+# Cleanup
+include/save_master_gtid.inc
+connection slave;
+include/sync_with_master_gtid.inc
+include/rpl_end.inc
+# End of rpl_gtid_until_before_gtids.test
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat.result b/mysql-test/suite/rpl/r/rpl_heartbeat.result
index c9baf960..42cf90bc 100644
--- a/mysql-test/suite/rpl/r/rpl_heartbeat.result
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat.result
@@ -52,7 +52,7 @@ connection master;
drop table if exists t1;
connection slave;
set @@global.slave_net_timeout= 10;
-change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 0.5;
+change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_ssl_verify_server_cert=0, master_heartbeat_period= 0.5;
show status like 'Slave_heartbeat_period';;
Variable_name Slave_heartbeat_period
Value 0.500
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result b/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result
index 533290d2..7f11b856 100644
--- a/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result
@@ -24,7 +24,7 @@ Heartbeat event has received
*** Clean up ***
include/stop_slave.inc
CHANGE MASTER TO
-MASTER_SSL=0,
+MASTER_SSL=1,
MASTER_SSL_CA='',
MASTER_SSL_CERT='',
MASTER_SSL_KEY='';
diff --git a/mysql-test/suite/rpl/r/rpl_hrtime.result b/mysql-test/suite/rpl/r/rpl_hrtime.result
index 28573576..6b06fff1 100644
--- a/mysql-test/suite/rpl/r/rpl_hrtime.result
+++ b/mysql-test/suite/rpl/r/rpl_hrtime.result
@@ -52,7 +52,7 @@ SET TIMESTAMP=1293832861.123456/*!*/;
SET @@session.time_zone='+03:00'/*!*/;
insert t1 (b,c) values (now(6), now(6))
/*!*/;
-SET TIMESTAMP=1293832861.123456/*!*/;
+SET TIMESTAMP=1293832861/*!*/;
COMMIT
/*!*/;
START TRANSACTION
@@ -68,7 +68,7 @@ START TRANSACTION
SET TIMESTAMP=1643756522.654321/*!*/;
insert t1 (b,c) values (now(), now())
/*!*/;
-SET TIMESTAMP=1643756522.654321/*!*/;
+SET TIMESTAMP=1643756522/*!*/;
COMMIT
/*!*/;
START TRANSACTION
@@ -76,7 +76,7 @@ START TRANSACTION
SET TIMESTAMP=1643756522.654321/*!*/;
insert t1 (b,c) values (0,0)
/*!*/;
-SET TIMESTAMP=1643756522.654321/*!*/;
+SET TIMESTAMP=1643756522/*!*/;
COMMIT
/*!*/;
START TRANSACTION
@@ -84,7 +84,7 @@ START TRANSACTION
SET TIMESTAMP=1643756522.654321/*!*/;
insert t1 (a,b,c) values (0,0,now(6))
/*!*/;
-SET TIMESTAMP=1643756522.654321/*!*/;
+SET TIMESTAMP=1643756522/*!*/;
COMMIT
/*!*/;
SET TIMESTAMP=1643756522/*!*/;
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result
index 2ecc3ac1..063e568f 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result
@@ -51,10 +51,6 @@ DELETE FROM test.regular_tbl WHERE id = del_count;
SET del_count = del_count - 2;
END WHILE;
END|
-Warnings:
-Level Warning
-Code 1287
-Message '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CREATE PROCEDURE test.proc_bykey()
BEGIN
DECLARE ins_count INT DEFAULT 1000;
@@ -76,10 +72,6 @@ DELETE FROM test.bykey_tbl WHERE id = del_count;
SET del_count = del_count - 2;
END WHILE;
END|
-Warnings:
-Level Warning
-Code 1287
-Message '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CREATE PROCEDURE test.proc_byrange()
BEGIN
DECLARE ins_count INT DEFAULT 1000;
@@ -101,10 +93,6 @@ DELETE FROM test.byrange_tbl WHERE id = del_count;
SET del_count = del_count - 2;
END WHILE;
END|
-Warnings:
-Level Warning
-Code 1287
-Message '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
begin;
CALL test.proc_norm();
commit;
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result b/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result
index da6888e7..d4640a36 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result
@@ -26,10 +26,6 @@ DELETE FROM test.regular_tbl WHERE id = del_count;
SET del_count = del_count - 2;
END WHILE;
END|
-Warnings:
-Level Warning
-Code 1287
-Message '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
CALL test.proc_norm();
connection slave;
connection master;
diff --git a/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff b/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff
index 1946228f..d1a101e5 100644
--- a/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff
+++ b/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff
@@ -1,5 +1,5 @@
---- suite/rpl/r/rpl_insert_delayed.result 2016-03-25 19:44:43.408210896 +0400
-+++ suite/rpl/r/rpl_insert_delayed,stmt.reject 2016-03-25 23:55:18.396360848 +0400
+--- suite/rpl/r/rpl_insert_delayed.result
++++ suite/rpl/r/rpl_insert_delayed,stmt.reject
@@ -18,19 +18,19 @@
insert delayed into t1 values(10, "my name");
flush table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_invoked_features.result b/mysql-test/suite/rpl/r/rpl_invoked_features.result
index 3cfd40d5..c8acf49c 100644
--- a/mysql-test/suite/rpl/r/rpl_invoked_features.result
+++ b/mysql-test/suite/rpl/r/rpl_invoked_features.result
@@ -1,15 +1,8 @@
include/master-slave.inc
[connection master]
-USE test;
-DROP VIEW IF EXISTS v1,v11;
-DROP TABLE IF EXISTS t1,t2,t3,t11,t12,t13;
-DROP PROCEDURE IF EXISTS p1;
-DROP PROCEDURE IF EXISTS p11;
-DROP FUNCTION IF EXISTS f1;
-DROP FUNCTION IF EXISTS f2;
-DROP EVENT IF EXISTS e1;
-DROP EVENT IF EXISTS e11;
-
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+call mtr.add_suppression("Event Scheduler: .* Duplicate entry '10' for key 'a'");
+# Create tables
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b INT, c VARCHAR(64)) ENGINE=myisam;
INSERT INTO t1 VALUES (1,1,'1');
INSERT INTO t1 VALUES (2,2,UUID());
@@ -22,7 +15,7 @@ INSERT INTO t11 VALUES (2,2,UUID());
CREATE TABLE t12 (a INT UNIQUE, b INT, c VARCHAR(64)) ENGINE=innodb;
INSERT INTO t12 VALUES (1,1,'1');
INSERT INTO t12 VALUES (2,2,UUID());
-
+# Create invoked features
CREATE VIEW v1 AS SELECT * FROM t1;
CREATE VIEW v11 AS SELECT * FROM t11;
CREATE TRIGGER t1_tr1 BEFORE INSERT ON t1 FOR EACH ROW
@@ -45,7 +38,7 @@ BEGIN
UPDATE t12 SET c = '';
UPDATE t13 SET c = '';
END|
-CREATE EVENT e1 ON SCHEDULE EVERY 10 SECOND DISABLE DO
+CREATE EVENT e1 ON SCHEDULE EVERY 1 SECOND DISABLE DO
BEGIN
ALTER EVENT e1 DISABLE;
CALL p1(10, '');
@@ -78,7 +71,7 @@ CREATE PROCEDURE p11 (IN x INT, IN y VARCHAR(64))
BEGIN
INSERT IGNORE INTO t11 VALUES (x,x,y);
END|
-
+# Do some actions for non-transactional tables
CREATE TABLE t3 SELECT * FROM v1;
INSERT INTO t1 VALUES (3,3,'');
UPDATE t1 SET c='2' WHERE a = 1;
@@ -90,7 +83,7 @@ INSERT INTO t1 VALUES(6,6,f1(6));
INSERT INTO t1 VALUES (102,102,'');
INSERT INTO t1 VALUES(7,7,f2(7));
INSERT INTO t1 VALUES (103,103,'');
-
+# Do some actions for transactional tables
CREATE TABLE t13 SELECT * FROM v11;
INSERT INTO t11 VALUES (3,3,'');
UPDATE t11 SET c='2' WHERE a = 1;
@@ -102,12 +95,12 @@ INSERT INTO t11 VALUES(6,6,f1(6));
INSERT INTO t11 VALUES (102,102,'');
INSERT INTO t11 VALUES(7,7,f2(7));
INSERT INTO t11 VALUES (103,103,'');
-
+# Scheduler is on
SET GLOBAL EVENT_SCHEDULER = on;
ALTER EVENT e1 ENABLE;
ALTER EVENT e11 ENABLE;
SET GLOBAL EVENT_SCHEDULER = off;
-
+# Check original objects
SHOW TABLES LIKE 't%';
Tables_in_test (t%)
t1
@@ -268,7 +261,7 @@ a b
102 102
103 103
connection slave;
-
+# Check replicated objects
SHOW TABLES LIKE 't%';
Tables_in_test (t%)
t1
@@ -297,7 +290,7 @@ SELECT event_name, status FROM information_schema.events WHERE event_schema='tes
event_name status
e1 SLAVESIDE_DISABLED
e11 SLAVESIDE_DISABLED
-
+# Check replicated data
SELECT COUNT(*) FROM t1;
COUNT(*)
12
@@ -429,7 +422,7 @@ a b
102 102
103 103
connection master;
-
+# Remove UUID() before comparing and sort tables
UPDATE t1 SET c='';
UPDATE t2 SET c='';
UPDATE t3 SET c='';
@@ -439,10 +432,8 @@ UPDATE t13 SET c='';
ALTER TABLE t3 ORDER BY a;
ALTER TABLE t13 ORDER BY a;
connection slave;
-
-
+# Compare a data from master and slave
connection master;
-
DROP VIEW IF EXISTS v1,v11;
DROP TABLE IF EXISTS t1,t2,t3,t11,t12,t13;
DROP PROCEDURE IF EXISTS p1;
diff --git a/mysql-test/suite/rpl/r/rpl_iodku,stmt.rdiff b/mysql-test/suite/rpl/r/rpl_iodku,stmt.rdiff
index e31f1e5d..2986a47c 100644
--- a/mysql-test/suite/rpl/r/rpl_iodku,stmt.rdiff
+++ b/mysql-test/suite/rpl/r/rpl_iodku,stmt.rdiff
@@ -1,5 +1,5 @@
---- r/rpl_iodku.result 2022-05-04 18:51:24.956414404 +0300
-+++ r/rpl_iodku,stmt.reject 2022-05-04 18:51:49.520106231 +0300
+--- r/rpl_iodku.result
++++ r/rpl_iodku,stmt.reject
@@ -1,10 +1,15 @@
include/master-slave.inc
[connection master]
diff --git a/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result b/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result
index b1b16fb0..5ad4b3ea 100644
--- a/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result
+++ b/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result
@@ -105,4 +105,4 @@ change master to master_host='127.0.0.1';
Master-Host: 127.0.0.1
change master to master_host='0:0000:0000:0:0000:FFFF:127.0.0.1';
Master-Host: 0:0000:0000:0:0000:FFFF:127.0.0.1
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0;
diff --git a/mysql-test/suite/rpl/r/rpl_ipv6.result b/mysql-test/suite/rpl/r/rpl_ipv6.result
index f1c5619b..fc9171d8 100644
--- a/mysql-test/suite/rpl/r/rpl_ipv6.result
+++ b/mysql-test/suite/rpl/r/rpl_ipv6.result
@@ -60,4 +60,4 @@ change master to master_host='127.0.0.1';
Master-Host: 127.0.0.1
change master to master_host='0:0:0:0:0:0:0:1';
Master-Host: 0:0:0:0:0:0:0:1
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0;
diff --git a/mysql-test/suite/rpl/r/rpl_master_pos_wait.result b/mysql-test/suite/rpl/r/rpl_master_pos_wait.result
index aae3418b..4d19d81d 100644
--- a/mysql-test/suite/rpl/r/rpl_master_pos_wait.result
+++ b/mysql-test/suite/rpl/r/rpl_master_pos_wait.result
@@ -27,7 +27,7 @@ NULL
connection slave;
include/stop_slave.inc
reset slave all;
-change master 'my_slave' to master_port=MASTER_MYPORT, master_host='127.0.0.1', master_user='root';
+change master 'my_slave' to master_port=MASTER_MYPORT, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0;
set default_master_connection = 'my_slave';
include/start_slave.inc
# Call without connection name -- works (expected -1)
diff --git a/mysql-test/suite/rpl/r/rpl_mdev12179.result b/mysql-test/suite/rpl/r/rpl_mdev12179.result
index dcda036c..7cb750dd 100644
--- a/mysql-test/suite/rpl/r/rpl_mdev12179.result
+++ b/mysql-test/suite/rpl/r/rpl_mdev12179.result
@@ -259,8 +259,6 @@ connection server_2;
*** Restart the slave server to prove 'gtid_slave_pos_innodb' autodiscovery ***
connection server_2;
SELECT max(seq_no) FROM mysql.gtid_slave_pos_InnoDB into @seq_no;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
connection server_1;
INSERT INTO t2(a) SELECT 1+MAX(a) FROM t2;
include/save_master_gtid.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mdev33798.result b/mysql-test/suite/rpl/r/rpl_mdev33798.result
index 8796e948..12431ed2 100644
--- a/mysql-test/suite/rpl/r/rpl_mdev33798.result
+++ b/mysql-test/suite/rpl/r/rpl_mdev33798.result
@@ -68,7 +68,7 @@ include/sync_with_master_gtid.inc
include/stop_slave.inc
connection server_2;
include/stop_slave.inc
-CHANGE MASTER 'm2' to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+CHANGE MASTER 'm2' to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos, master_ssl_verify_server_cert=0;
connection server_1;
SET SESSION gtid_domain_id= 1;
BEGIN;
diff --git a/mysql-test/suite/rpl/r/rpl_misc_functions.result b/mysql-test/suite/rpl/r/rpl_misc_functions.result
index 302cf235..6c20623d 100644
--- a/mysql-test/suite/rpl/r/rpl_misc_functions.result
+++ b/mysql-test/suite/rpl/r/rpl_misc_functions.result
@@ -42,8 +42,6 @@ INSERT INTO t1 (col_a) VALUES (test_replication_sf());
INSERT INTO t1 (col_a) VALUES (test_replication_sf());
connection slave;
select * from t1 into outfile "../../tmp/t1_slave.txt";
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
connection master;
create temporary table t1_slave select * from t1 where 1=0;
load data infile '../../tmp/t1_slave.txt' into table t1_slave;
diff --git a/mysql-test/suite/rpl/r/rpl_old_master_29078.result b/mysql-test/suite/rpl/r/rpl_old_master_29078.result
index 98bd707a..911705d1 100644
--- a/mysql-test/suite/rpl/r/rpl_old_master_29078.result
+++ b/mysql-test/suite/rpl/r/rpl_old_master_29078.result
@@ -48,6 +48,8 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
connection slave;
set global explicit_defaults_for_timestamp=0;
+Warnings:
+Warning 1287 'explicit_defaults_for_timestamp=0' is deprecated and will be removed in a future release
include/reset_slave.inc
include/start_slave.inc
show create table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_29322.result b/mysql-test/suite/rpl/r/rpl_parallel_29322.result
index 4045e579..78180410 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_29322.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_29322.result
@@ -10,6 +10,8 @@ set @@session.explicit_defaults_for_timestamp = 1;
connection slave;
set @sav.explicit_defaults_for_timestamp = @@global.explicit_defaults_for_timestamp;
set global explicit_defaults_for_timestamp = 0;
+Warnings:
+Warning 1287 'explicit_defaults_for_timestamp=0' is deprecated and will be removed in a future release
set @sav.slave_parallel_workers = @@global.slave_parallel_workers;
include/stop_slave.inc
set @@global.slave_parallel_workers = 1;
@@ -105,6 +107,8 @@ connection slave;
# B. alternate the master and slave vars' values to (0,1)
connection master;
set @@session.explicit_defaults_for_timestamp = 0;
+Warnings:
+Warning 1287 'explicit_defaults_for_timestamp=0' is deprecated and will be removed in a future release
connection slave;
set @@global.explicit_defaults_for_timestamp = 1;
connection slave;
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result b/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result
index 0b317c46..45f708fb 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result
@@ -270,7 +270,7 @@ connection server_2;
include/stop_slave.inc
SET @old_format= @@GLOBAL.binlog_format;
SET GLOBAL binlog_format= MIXED;
-SET @old_isolation= @@GLOBAL.tx_isolation;
+SET @old_isolation= @@GLOBAL.transaction_isolation;
SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
SET GLOBAL slave_parallel_threads=0;
SET GLOBAL slave_parallel_threads=10;
@@ -346,7 +346,7 @@ a b
10 10
include/stop_slave.inc
SET GLOBAL binlog_format= @old_format;
-SET GLOBAL tx_isolation= @old_isolation;
+SET GLOBAL transaction_isolation= @old_isolation;
include/start_slave.inc
*** MDEV-7888: ANALYZE TABLE does wakeup_subsequent_commits(), causing wrong binlog order and parallel replication hang ***
connection server_1;
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_optimistic_nobinlog.result b/mysql-test/suite/rpl/r/rpl_parallel_optimistic_nobinlog.result
index 4172abb1..28c5ceb1 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_optimistic_nobinlog.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_optimistic_nobinlog.result
@@ -6,7 +6,7 @@ CREATE TABLE t2 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,0), (2,0), (3,0);
INSERT INTO t2 VALUES (1,0), (2,0);
connection server_2;
-SET @old_isolation= @@GLOBAL.tx_isolation;
+SET @old_isolation= @@GLOBAL.transaction_isolation;
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
include/stop_slave.inc
SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
@@ -82,7 +82,7 @@ a b
10 10
connection server_2;
include/stop_slave.inc
-SET GLOBAL tx_isolation= @old_isolation;
+SET GLOBAL transaction_isolation= @old_isolation;
SET GLOBAL slave_parallel_mode=@old_parallel_mode;
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
include/start_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_worker.result b/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_worker.result
index 268ab010..8180d0c0 100644
--- a/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_worker.result
+++ b/mysql-test/suite/rpl/r/rpl_perfschema_applier_status_by_worker.result
@@ -10,7 +10,7 @@ include/stop_slave.inc
set @save_slave_parallel_workers= @@global.slave_parallel_workers;
set @save_slave_transaction_retries= @@global.slave_transaction_retries;
RESET SLAVE ALL;
-CHANGE MASTER 'slave1' TO MASTER_USER='root',MASTER_PORT=$MASTER_MYPORT, MASTER_HOST='127.0.0.1', MASTER_USE_GTID=slave_pos;
+CHANGE MASTER 'slave1' TO MASTER_USER='root',MASTER_PORT=$MASTER_MYPORT, MASTER_HOST='127.0.0.1', MASTER_USE_GTID=slave_pos, MASTER_SSL_VERIFY_SERVER_CERT=0;
SET default_master_connection='slave1';
SET @@global.slave_parallel_workers=1;
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
diff --git a/mysql-test/suite/rpl/r/rpl_perfschema_connect_config.result b/mysql-test/suite/rpl/r/rpl_perfschema_connect_config.result
index 4ace84ff..695ba3a9 100644
--- a/mysql-test/suite/rpl/r/rpl_perfschema_connect_config.result
+++ b/mysql-test/suite/rpl/r/rpl_perfschema_connect_config.result
@@ -67,7 +67,7 @@ master_ssl_ca= '',
master_ssl_cert= '',
master_ssl_key= '',
master_ssl_verify_server_cert=0,
-master_ssl=0,
+master_ssl=1,
master_use_gtid=no;
include/start_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_rewrite_db_sys_vars.result b/mysql-test/suite/rpl/r/rpl_rewrite_db_sys_vars.result
index 1734b200..e0e6681c 100644
--- a/mysql-test/suite/rpl/r/rpl_rewrite_db_sys_vars.result
+++ b/mysql-test/suite/rpl/r/rpl_rewrite_db_sys_vars.result
@@ -130,7 +130,7 @@ connection slave;
include/stop_slave.inc
include/reset_slave.inc
include/rpl_restart_server.inc [server_number=2]
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT, MASTER_USER='root';
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT, MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0;
connection slave;
include/start_slave.inc
SELECT @@GLOBAL.replicate_rewrite_db;
diff --git a/mysql-test/suite/rpl/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result
index d720b0b8..4b7c1642 100644
--- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result
+++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result
@@ -10,7 +10,7 @@ ERROR HY000: Could not initialize master info structure for ''; more error messa
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log
reset slave;
-change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
+change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_ssl_verify_server_cert=0;
connection master;
reset master;
connection slave;
diff --git a/mysql-test/suite/rpl/r/rpl_row_big_table_id,32bit.rdiff b/mysql-test/suite/rpl/r/rpl_row_big_table_id,32bit.rdiff
index 3815ec93..1154f92c 100644
--- a/mysql-test/suite/rpl/r/rpl_row_big_table_id,32bit.rdiff
+++ b/mysql-test/suite/rpl/r/rpl_row_big_table_id,32bit.rdiff
@@ -1,5 +1,5 @@
---- /home/my/maria-test/mysql-test/suite/rpl/r/rpl_row_big_table_id.result 2019-08-18 15:19:56.829962449 +0300
-+++ /home/my/maria-test/mysql-test/suite/rpl/r/rpl_row_big_table_id,32bit.reject 2019-08-18 15:20:19.253763968 +0300
+--- /home/my/maria-test/mysql-test/suite/rpl/r/rpl_row_big_table_id.result
++++ /home/my/maria-test/mysql-test/suite/rpl/r/rpl_row_big_table_id,32bit.reject
@@ -20,22 +20,22 @@
master-bin.000001 # Query 1 # use `test`; ALTER TABLE t comment ''
master-bin.000001 # Gtid 1 # BEGIN GTID #-#-#
diff --git a/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result b/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result
index 08408907..9959854a 100644
--- a/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result
@@ -160,4 +160,19 @@ connection master;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
connection slave;
+#
+# MDEV-30985 Replica stops with error on ALTER ONLINE with Geometry Types
+#
+connection master;
+CREATE TABLE t(txt TEXT DEFAULT '111111111', blb LONGBLOB AS (txt));
+INSERT INTO t () VALUES (),(),();
+DELETE FROM t;
+DROP TABLE t;
+connection slave;
+connection master;
+CREATE TABLE t(txt TEXT DEFAULT '111111111', blb LONGBLOB AS (txt) STORED);
+INSERT INTO t () VALUES (),(),();
+DELETE FROM t;
+DROP TABLE t;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result b/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result
index 08408907..9959854a 100644
--- a/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result
@@ -160,4 +160,19 @@ connection master;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
connection slave;
+#
+# MDEV-30985 Replica stops with error on ALTER ONLINE with Geometry Types
+#
+connection master;
+CREATE TABLE t(txt TEXT DEFAULT '111111111', blb LONGBLOB AS (txt));
+INSERT INTO t () VALUES (),(),();
+DELETE FROM t;
+DROP TABLE t;
+connection slave;
+connection master;
+CREATE TABLE t(txt TEXT DEFAULT '111111111', blb LONGBLOB AS (txt) STORED);
+INSERT INTO t () VALUES (),(),();
+DELETE FROM t;
+DROP TABLE t;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_create_table.result b/mysql-test/suite/rpl/r/rpl_row_create_table.result
index e63212db..197b4be2 100644
--- a/mysql-test/suite/rpl/r/rpl_row_create_table.result
+++ b/mysql-test/suite/rpl/r/rpl_row_create_table.result
@@ -243,6 +243,11 @@ Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
SHOW TABLES;
Tables_in_test
+tt7
+tt6
+tt5
+tt4
+tt3
t1
t2
t3
diff --git a/mysql-test/suite/rpl/r/rpl_row_drop.result b/mysql-test/suite/rpl/r/rpl_row_drop.result
index 8753764e..8546960b 100644
--- a/mysql-test/suite/rpl/r/rpl_row_drop.result
+++ b/mysql-test/suite/rpl/r/rpl_row_drop.result
@@ -6,6 +6,7 @@ CREATE TABLE t2 (a int);
CREATE TEMPORARY TABLE t2 (a int, b int);
SHOW TABLES;
Tables_in_test
+t2
t1
t2
connection slave;
@@ -28,6 +29,7 @@ connection master;
CREATE TEMPORARY TABLE t2 (a int, b int);
SHOW TABLES;
Tables_in_test
+t2
t1
t2
connection slave;
diff --git a/mysql-test/suite/rpl/r/rpl_row_end_of_statement_loss.result b/mysql-test/suite/rpl/r/rpl_row_end_of_statement_loss.result
index dc6a67b4..f34c41f9 100644
--- a/mysql-test/suite/rpl/r/rpl_row_end_of_statement_loss.result
+++ b/mysql-test/suite/rpl/r/rpl_row_end_of_statement_loss.result
@@ -3,7 +3,7 @@ include/master-slave.inc
connection slave;
call mtr.add_suppression("Slave IO thread did not receive an expected Rows-log end-of-statement");
call mtr.add_suppression("Relay log write failure: could not queue event from master");
-SET @save_debug= @@global.debug;
+SET @save_debug= @@global.debug_dbug;
SET GLOBAL debug_dbug="+d,simulate_stmt_end_rows_event_loss";
include/stop_slave.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT, MASTER_USE_GTID=SLAVE_POS;
diff --git a/mysql-test/suite/rpl/r/rpl_row_img_blobs.result b/mysql-test/suite/rpl/r/rpl_row_img_blobs.result
index 546f42b6..0131f65d 100644
--- a/mysql-test/suite/rpl/r/rpl_row_img_blobs.result
+++ b/mysql-test/suite/rpl/r/rpl_row_img_blobs.result
@@ -4637,6 +4637,2323 @@ include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+CON: 'server_1', IMG: 'FULL_NODUP', RESTART SLAVE: 'N'
+connection server_1;
+SET SESSION binlog_row_image= 'FULL_NODUP';
+SET GLOBAL binlog_row_image= 'FULL_NODUP';
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL_NODUP
+CON: 'server_2', IMG: 'FULL_NODUP', RESTART SLAVE: 'Y'
+connection server_2;
+SET SESSION binlog_row_image= 'FULL_NODUP';
+SET GLOBAL binlog_row_image= 'FULL_NODUP';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL_NODUP
+CON: 'server_3', IMG: 'FULL_NODUP', RESTART SLAVE: 'Y'
+connection server_3;
+SET SESSION binlog_row_image= 'FULL_NODUP';
+SET GLOBAL binlog_row_image= 'FULL_NODUP';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL_NODUP
+connection server_1;
+### engines: MyISAM, MyISAM, MyISAM
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, MyISAM, InnoDB
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, InnoDB, MyISAM
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, InnoDB, InnoDB
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, MyISAM, MyISAM
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, MyISAM, InnoDB
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, InnoDB, MyISAM
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, InnoDB, InnoDB
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check when there is no key in the table)
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the AI (they are not updated)
+### will not break replication (check even if there is a key in the table)
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
+### will not break replication
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that updates without blobs in the BI (PK exists int the table)
+### will not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob in a key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, "a", 10);
+INSERT INTO t VALUES (2, "b", 20);
+INSERT INTO t VALUES (3, "c", 30);
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c1=10 WHERE c2="a";
+UPDATE t SET c1=20 WHERE c1=2;
+UPDATE t SET c1=30 WHERE c3=30;
+UPDATE t SET c3=40 WHERE c1=30;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c2="a";
+DELETE FROM t WHERE c1=20;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N'
connection server_1;
SET SESSION binlog_row_image= 'FULL';
diff --git a/mysql-test/suite/rpl/r/rpl_row_img_eng_full_nodup.result b/mysql-test/suite/rpl/r/rpl_row_img_eng_full_nodup.result
new file mode 100644
index 00000000..17973c3a
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_img_eng_full_nodup.result
@@ -0,0 +1,4799 @@
+include/rpl_init.inc [topology=1->2->3]
+connection server_1;
+connection server_2;
+connection server_3;
+connection server_1;
+CON: 'server_1', IMG: 'FULL_NODUP', RESTART SLAVE: 'N'
+connection server_1;
+SET SESSION binlog_row_image= 'FULL_NODUP';
+SET GLOBAL binlog_row_image= 'FULL_NODUP';
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL_NODUP
+CON: 'server_2', IMG: 'FULL_NODUP', RESTART SLAVE: 'Y'
+connection server_2;
+SET SESSION binlog_row_image= 'FULL_NODUP';
+SET GLOBAL binlog_row_image= 'FULL_NODUP';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL_NODUP
+CON: 'server_3', IMG: 'FULL_NODUP', RESTART SLAVE: 'Y'
+connection server_3;
+SET SESSION binlog_row_image= 'FULL_NODUP';
+SET GLOBAL binlog_row_image= 'FULL_NODUP';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL_NODUP
+connection server_1;
+### engines: MyISAM, MyISAM, MyISAM
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, MyISAM, InnoDB
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, InnoDB, MyISAM
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, InnoDB, InnoDB
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, MyISAM, MyISAM
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, MyISAM, InnoDB
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, InnoDB, MyISAM
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, InnoDB, InnoDB
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+CREATE TABLE t1(c1 INT NOT NULL PRIMARY KEY, c2 varchar(10) DEFAULT NULL,
+c3 decimal(12,4) DEFAULT NULL);
+INSERT INTO t1(c1) VALUES (1);
+include/save_master_pos.inc
+UPDATE t1 SET c2 = 'c2';
+include/rpl_sync.inc
+FLUSH BINARY LOGS;
+UPDATE t1 SET c2 = "c2_new";
+# Use 'BINLOG' statement to apply the first update row event
+# BINLOG statement is same to slave applier, it should work well.
+# After 'BINLOG' statement c2's value should be "c2"
+SELECT * FROM t1;
+c1 c2 c3
+1 c2 NULL
+DROP TABLE t1;
+CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N'
+connection server_1;
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL
+CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y'
+connection server_2;
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL
+CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y'
+connection server_3;
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL
+connection server_1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_img_full_nodup.result b/mysql-test/suite/rpl/r/rpl_row_img_full_nodup.result
new file mode 100644
index 00000000..39c9ee03
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_img_full_nodup.result
@@ -0,0 +1,4784 @@
+include/rpl_init.inc [topology=1->2->3]
+connection server_1;
+connection server_2;
+connection server_3;
+connection server_1;
+CON: 'server_1', IMG: 'FULL_NODUP', RESTART SLAVE: 'N'
+connection server_1;
+SET SESSION binlog_row_image= 'FULL_NODUP';
+SET GLOBAL binlog_row_image= 'FULL_NODUP';
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL_NODUP
+CON: 'server_2', IMG: 'FULL_NODUP', RESTART SLAVE: 'Y'
+connection server_2;
+SET SESSION binlog_row_image= 'FULL_NODUP';
+SET GLOBAL binlog_row_image= 'FULL_NODUP';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL_NODUP
+CON: 'server_3', IMG: 'FULL_NODUP', RESTART SLAVE: 'Y'
+connection server_3;
+SET SESSION binlog_row_image= 'FULL_NODUP';
+SET GLOBAL binlog_row_image= 'FULL_NODUP';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL_NODUP
+connection server_1;
+### engines: MyISAM, MyISAM, MyISAM
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, MyISAM, InnoDB
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, InnoDB, MyISAM
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: MyISAM, InnoDB, InnoDB
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, MyISAM, MyISAM
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, MyISAM, InnoDB
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, InnoDB, MyISAM
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+### engines: InnoDB, InnoDB, InnoDB
+connection server_1;
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key with holes
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Primary Key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Primary key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Unique key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+****** TEST: One Composite key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: One key
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+connection server_1;
+SET SQL_LOG_BIN=0;
+connection server_2;
+SET SQL_LOG_BIN=0;
+connection server_3;
+SET SQL_LOG_BIN=0;
+******* TEST: No keys
+connection server_1;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_2;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_3;
+CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_1;
+SET SQL_LOG_BIN=1;
+connection server_2;
+SET SQL_LOG_BIN=1;
+connection server_3;
+SET SQL_LOG_BIN=1;
+connection server_1;
+INSERT INTO t VALUES (1, '1', '1', '1' );
+INSERT INTO t VALUES (4, '4', '4', '4' );
+INSERT INTO t VALUES (7, '7', '7', '7' );
+INSERT INTO t VALUES (9, '9', '9', NULL );
+INSERT INTO t VALUES (2, '1', '2', '2' );
+INSERT INTO t VALUES (3, '1', '3', '2' );
+include/rpl_sync.inc
+connection server_1;
+UPDATE t SET c4 = '7';
+UPDATE t SET c4 = '5' WHERE c1 = 1;
+UPDATE t SET c2 = '5' WHERE c1 = 1;
+UPDATE t SET c1 = '5' WHERE c1 = 1;
+UPDATE t SET c4 = '8' WHERE c2 = '4';
+UPDATE t SET c1 = '8' WHERE c2 = '4';
+UPDATE t SET c2 = '8' WHERE c2 = '4';
+UPDATE t SET c3 = '0' WHERE c4 = NULL;
+UPDATE t SET c2 = '0' WHERE c4 = '0';
+UPDATE t SET c2 = '2' WHERE c4 = '2';
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DELETE FROM t WHERE c1 = 7;
+DELETE FROM t WHERE c1 = 8;
+DELETE FROM t;
+include/rpl_sync.inc
+include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
+DROP TABLE t;
+include/rpl_sync.inc
+CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N'
+connection server_1;
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL
+CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y'
+connection server_2;
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL
+CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y'
+connection server_3;
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL
+connection server_1;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_img_sequence_full_nodup.result b/mysql-test/suite/rpl/r/rpl_row_img_sequence_full_nodup.result
new file mode 100644
index 00000000..c6afb2ec
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_row_img_sequence_full_nodup.result
@@ -0,0 +1,796 @@
+include/rpl_init.inc [topology=1->2->3]
+connection server_1;
+connection server_2;
+connection server_3;
+connection server_1;
+#
+# binlog_row_image=FULL_NODUP should write all columns to the binary log
+#
+CON: 'server_1', IMG: 'FULL_NODUP', RESTART SLAVE: 'N'
+connection server_1;
+SET SESSION binlog_row_image= 'FULL_NODUP';
+SET GLOBAL binlog_row_image= 'FULL_NODUP';
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL_NODUP
+CON: 'server_2', IMG: 'FULL_NODUP', RESTART SLAVE: 'Y'
+connection server_2;
+SET SESSION binlog_row_image= 'FULL_NODUP';
+SET GLOBAL binlog_row_image= 'FULL_NODUP';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL_NODUP
+CON: 'server_3', IMG: 'FULL_NODUP', RESTART SLAVE: 'Y'
+connection server_3;
+SET SESSION binlog_row_image= 'FULL_NODUP';
+SET GLOBAL binlog_row_image= 'FULL_NODUP';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL_NODUP
+connection server_1;
+### engines: MyISAM, MyISAM, MyISAM
+# Create sequences with specific engines per server
+connection server_1;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM;
+include/save_master_gtid.inc
+connection server_2;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM;
+include/sync_with_master_gtid.inc
+connection server_3;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM;
+include/sync_with_master_gtid.inc
+# Pt.1 Ensure SETVAL replicates and binlogs correctly
+connection server_1;
+SELECT SETVAL(s1, 10);
+SETVAL(s1, 10)
+10
+include/save_master_gtid.inc
+# Validate SETVAL replicated correctly to other servers
+connection server_3;
+include/sync_with_master_gtid.inc
+include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1]
+# Validate server_1 binlogged SETVAL with the correct columns
+connection server_1;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_2 binlogged SETVAL with the correct columns
+connection server_2;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_3 binlogged SETVAL with the correct columns
+connection server_3;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Pt.2 Ensure NEXTVAL replicates and binlogs correctly
+connection server_1;
+SELECT NEXTVAL(s1);
+NEXTVAL(s1)
+11
+include/save_master_gtid.inc
+# Validate NEXTVAL replicated correctly to other servers
+connection server_3;
+include/sync_with_master_gtid.inc
+include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1]
+# Validate server_1 binlogged NEXTVAL with the correct columns
+connection server_1;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_2 binlogged NEXTVAL with the correct columns
+connection server_2;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_3 binlogged NEXTVAL with the correct columns
+connection server_3;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Cleanup
+connection server_1;
+DROP TABLE s1;
+include/save_master_gtid.inc
+connection server_3;
+include/sync_with_master_gtid.inc
+### engines: MyISAM, MyISAM, InnoDB
+# Create sequences with specific engines per server
+connection server_1;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM;
+include/save_master_gtid.inc
+connection server_2;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM;
+include/sync_with_master_gtid.inc
+connection server_3;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB;
+include/sync_with_master_gtid.inc
+# Pt.1 Ensure SETVAL replicates and binlogs correctly
+connection server_1;
+SELECT SETVAL(s1, 10);
+SETVAL(s1, 10)
+10
+include/save_master_gtid.inc
+# Validate SETVAL replicated correctly to other servers
+connection server_3;
+include/sync_with_master_gtid.inc
+include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1]
+# Validate server_1 binlogged SETVAL with the correct columns
+connection server_1;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_2 binlogged SETVAL with the correct columns
+connection server_2;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_3 binlogged SETVAL with the correct columns
+connection server_3;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Pt.2 Ensure NEXTVAL replicates and binlogs correctly
+connection server_1;
+SELECT NEXTVAL(s1);
+NEXTVAL(s1)
+11
+include/save_master_gtid.inc
+# Validate NEXTVAL replicated correctly to other servers
+connection server_3;
+include/sync_with_master_gtid.inc
+include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1]
+# Validate server_1 binlogged NEXTVAL with the correct columns
+connection server_1;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_2 binlogged NEXTVAL with the correct columns
+connection server_2;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_3 binlogged NEXTVAL with the correct columns
+connection server_3;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Cleanup
+connection server_1;
+DROP TABLE s1;
+include/save_master_gtid.inc
+connection server_3;
+include/sync_with_master_gtid.inc
+### engines: MyISAM, InnoDB, MyISAM
+# Create sequences with specific engines per server
+connection server_1;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM;
+include/save_master_gtid.inc
+connection server_2;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB;
+include/sync_with_master_gtid.inc
+connection server_3;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM;
+include/sync_with_master_gtid.inc
+# Pt.1 Ensure SETVAL replicates and binlogs correctly
+connection server_1;
+SELECT SETVAL(s1, 10);
+SETVAL(s1, 10)
+10
+include/save_master_gtid.inc
+# Validate SETVAL replicated correctly to other servers
+connection server_3;
+include/sync_with_master_gtid.inc
+include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1]
+# Validate server_1 binlogged SETVAL with the correct columns
+connection server_1;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_2 binlogged SETVAL with the correct columns
+connection server_2;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_3 binlogged SETVAL with the correct columns
+connection server_3;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Pt.2 Ensure NEXTVAL replicates and binlogs correctly
+connection server_1;
+SELECT NEXTVAL(s1);
+NEXTVAL(s1)
+11
+include/save_master_gtid.inc
+# Validate NEXTVAL replicated correctly to other servers
+connection server_3;
+include/sync_with_master_gtid.inc
+include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1]
+# Validate server_1 binlogged NEXTVAL with the correct columns
+connection server_1;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_2 binlogged NEXTVAL with the correct columns
+connection server_2;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_3 binlogged NEXTVAL with the correct columns
+connection server_3;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Cleanup
+connection server_1;
+DROP TABLE s1;
+include/save_master_gtid.inc
+connection server_3;
+include/sync_with_master_gtid.inc
+### engines: MyISAM, InnoDB, InnoDB
+# Create sequences with specific engines per server
+connection server_1;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM;
+include/save_master_gtid.inc
+connection server_2;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB;
+include/sync_with_master_gtid.inc
+connection server_3;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB;
+include/sync_with_master_gtid.inc
+# Pt.1 Ensure SETVAL replicates and binlogs correctly
+connection server_1;
+SELECT SETVAL(s1, 10);
+SETVAL(s1, 10)
+10
+include/save_master_gtid.inc
+# Validate SETVAL replicated correctly to other servers
+connection server_3;
+include/sync_with_master_gtid.inc
+include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1]
+# Validate server_1 binlogged SETVAL with the correct columns
+connection server_1;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_2 binlogged SETVAL with the correct columns
+connection server_2;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_3 binlogged SETVAL with the correct columns
+connection server_3;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Pt.2 Ensure NEXTVAL replicates and binlogs correctly
+connection server_1;
+SELECT NEXTVAL(s1);
+NEXTVAL(s1)
+11
+include/save_master_gtid.inc
+# Validate NEXTVAL replicated correctly to other servers
+connection server_3;
+include/sync_with_master_gtid.inc
+include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1]
+# Validate server_1 binlogged NEXTVAL with the correct columns
+connection server_1;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_2 binlogged NEXTVAL with the correct columns
+connection server_2;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_3 binlogged NEXTVAL with the correct columns
+connection server_3;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Cleanup
+connection server_1;
+DROP TABLE s1;
+include/save_master_gtid.inc
+connection server_3;
+include/sync_with_master_gtid.inc
+### engines: InnoDB, MyISAM, MyISAM
+# Create sequences with specific engines per server
+connection server_1;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB;
+include/save_master_gtid.inc
+connection server_2;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM;
+include/sync_with_master_gtid.inc
+connection server_3;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM;
+include/sync_with_master_gtid.inc
+# Pt.1 Ensure SETVAL replicates and binlogs correctly
+connection server_1;
+SELECT SETVAL(s1, 10);
+SETVAL(s1, 10)
+10
+include/save_master_gtid.inc
+# Validate SETVAL replicated correctly to other servers
+connection server_3;
+include/sync_with_master_gtid.inc
+include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1]
+# Validate server_1 binlogged SETVAL with the correct columns
+connection server_1;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_2 binlogged SETVAL with the correct columns
+connection server_2;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_3 binlogged SETVAL with the correct columns
+connection server_3;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Pt.2 Ensure NEXTVAL replicates and binlogs correctly
+connection server_1;
+SELECT NEXTVAL(s1);
+NEXTVAL(s1)
+11
+include/save_master_gtid.inc
+# Validate NEXTVAL replicated correctly to other servers
+connection server_3;
+include/sync_with_master_gtid.inc
+include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1]
+# Validate server_1 binlogged NEXTVAL with the correct columns
+connection server_1;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_2 binlogged NEXTVAL with the correct columns
+connection server_2;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_3 binlogged NEXTVAL with the correct columns
+connection server_3;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Cleanup
+connection server_1;
+DROP TABLE s1;
+include/save_master_gtid.inc
+connection server_3;
+include/sync_with_master_gtid.inc
+### engines: InnoDB, MyISAM, InnoDB
+# Create sequences with specific engines per server
+connection server_1;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB;
+include/save_master_gtid.inc
+connection server_2;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM;
+include/sync_with_master_gtid.inc
+connection server_3;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB;
+include/sync_with_master_gtid.inc
+# Pt.1 Ensure SETVAL replicates and binlogs correctly
+connection server_1;
+SELECT SETVAL(s1, 10);
+SETVAL(s1, 10)
+10
+include/save_master_gtid.inc
+# Validate SETVAL replicated correctly to other servers
+connection server_3;
+include/sync_with_master_gtid.inc
+include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1]
+# Validate server_1 binlogged SETVAL with the correct columns
+connection server_1;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_2 binlogged SETVAL with the correct columns
+connection server_2;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_3 binlogged SETVAL with the correct columns
+connection server_3;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Pt.2 Ensure NEXTVAL replicates and binlogs correctly
+connection server_1;
+SELECT NEXTVAL(s1);
+NEXTVAL(s1)
+11
+include/save_master_gtid.inc
+# Validate NEXTVAL replicated correctly to other servers
+connection server_3;
+include/sync_with_master_gtid.inc
+include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1]
+# Validate server_1 binlogged NEXTVAL with the correct columns
+connection server_1;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_2 binlogged NEXTVAL with the correct columns
+connection server_2;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_3 binlogged NEXTVAL with the correct columns
+connection server_3;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Cleanup
+connection server_1;
+DROP TABLE s1;
+include/save_master_gtid.inc
+connection server_3;
+include/sync_with_master_gtid.inc
+### engines: InnoDB, InnoDB, MyISAM
+# Create sequences with specific engines per server
+connection server_1;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB;
+include/save_master_gtid.inc
+connection server_2;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB;
+include/sync_with_master_gtid.inc
+connection server_3;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=MyISAM;
+include/sync_with_master_gtid.inc
+# Pt.1 Ensure SETVAL replicates and binlogs correctly
+connection server_1;
+SELECT SETVAL(s1, 10);
+SETVAL(s1, 10)
+10
+include/save_master_gtid.inc
+# Validate SETVAL replicated correctly to other servers
+connection server_3;
+include/sync_with_master_gtid.inc
+include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1]
+# Validate server_1 binlogged SETVAL with the correct columns
+connection server_1;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_2 binlogged SETVAL with the correct columns
+connection server_2;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_3 binlogged SETVAL with the correct columns
+connection server_3;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Pt.2 Ensure NEXTVAL replicates and binlogs correctly
+connection server_1;
+SELECT NEXTVAL(s1);
+NEXTVAL(s1)
+11
+include/save_master_gtid.inc
+# Validate NEXTVAL replicated correctly to other servers
+connection server_3;
+include/sync_with_master_gtid.inc
+include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1]
+# Validate server_1 binlogged NEXTVAL with the correct columns
+connection server_1;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_2 binlogged NEXTVAL with the correct columns
+connection server_2;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_3 binlogged NEXTVAL with the correct columns
+connection server_3;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Cleanup
+connection server_1;
+DROP TABLE s1;
+include/save_master_gtid.inc
+connection server_3;
+include/sync_with_master_gtid.inc
+### engines: InnoDB, InnoDB, InnoDB
+# Create sequences with specific engines per server
+connection server_1;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB;
+include/save_master_gtid.inc
+connection server_2;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB;
+include/sync_with_master_gtid.inc
+connection server_3;
+SET STATEMENT sql_log_bin=0 FOR create sequence s1 cache=0 engine=InnoDB;
+include/sync_with_master_gtid.inc
+# Pt.1 Ensure SETVAL replicates and binlogs correctly
+connection server_1;
+SELECT SETVAL(s1, 10);
+SETVAL(s1, 10)
+10
+include/save_master_gtid.inc
+# Validate SETVAL replicated correctly to other servers
+connection server_3;
+include/sync_with_master_gtid.inc
+include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1]
+# Validate server_1 binlogged SETVAL with the correct columns
+connection server_1;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_2 binlogged SETVAL with the correct columns
+connection server_2;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_3 binlogged SETVAL with the correct columns
+connection server_3;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Pt.2 Ensure NEXTVAL replicates and binlogs correctly
+connection server_1;
+SELECT NEXTVAL(s1);
+NEXTVAL(s1)
+11
+include/save_master_gtid.inc
+# Validate NEXTVAL replicated correctly to other servers
+connection server_3;
+include/sync_with_master_gtid.inc
+include/diff_tables.inc [server_1:test.s1,server_2:test.s1,server_3:test.s1]
+# Validate server_1 binlogged NEXTVAL with the correct columns
+connection server_1;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_2 binlogged NEXTVAL with the correct columns
+connection server_2;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Validate server_3 binlogged NEXTVAL with the correct columns
+connection server_3;
+FLUSH LOGS;
+include/ensure_binlog_row_event_columns.inc [(1,2,3,4,5,6,7,8)]
+# MYSQL_BINLOG mysqld_datadir/binlog_filename -vv > assert_file
+# Verifying all expected column ids appear in binlog event output..
+# ..success
+# Verifying only expected column ids appear in binlog event output..
+# ..success
+# Cleanup
+connection server_1;
+DROP TABLE s1;
+include/save_master_gtid.inc
+connection server_3;
+include/sync_with_master_gtid.inc
+CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N'
+connection server_1;
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL
+CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y'
+connection server_2;
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL
+CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y'
+connection server_3;
+SET SESSION binlog_row_image= 'FULL';
+SET GLOBAL binlog_row_image= 'FULL';
+include/stop_slave.inc
+include/start_slave.inc
+FLUSH TABLES;
+SHOW VARIABLES LIKE 'binlog_row_image';
+Variable_name Value
+binlog_row_image FULL
+connection server_3;
+include/rpl_end.inc
+# End of tests
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_cond_var_per_thd.result b/mysql-test/suite/rpl/r/rpl_semi_sync_cond_var_per_thd.result
index 08f60144..dbea479b 100644
--- a/mysql-test/suite/rpl/r/rpl_semi_sync_cond_var_per_thd.result
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync_cond_var_per_thd.result
@@ -2,14 +2,24 @@ include/master-slave.inc
[connection master]
connection master;
call mtr.add_suppression("Got an error reading communication packets");
+call mtr.add_suppression("Could not read packet:.* vio_errno: 1158");
+call mtr.add_suppression("Could not write packet:.* vio_errno: 1160");
+set @save_semi_sync_master_enabled= @@global.rpl_semi_sync_master_enabled;
+set @save_semi_sync_wp= @@global.rpl_semi_sync_master_wait_point;
set @save_bgc_count= @@global.binlog_commit_wait_count;
set @save_bgc_usec= @@global.binlog_commit_wait_usec;
set @save_debug_dbug= @@global.debug_dbug;
set @@global.binlog_commit_wait_count=3;
set @@global.binlog_commit_wait_usec=10000000;
set @@global.debug_dbug="+d,testing_cond_var_per_thd";
+set @@global.rpl_semi_sync_master_enabled= 1;
+set @@global.rpl_semi_sync_master_wait_point= AFTER_COMMIT;
# Ensure semi-sync is on
connection slave;
+set @save_semi_sync_slave_enabled= @@global.rpl_semi_sync_master_enabled;
+include/stop_slave.inc
+set @@global.rpl_semi_sync_slave_enabled=1;
+include/start_slave.inc
connection master;
# Create three transactions to binlog group commit together
connection master;
@@ -22,11 +32,20 @@ connection master;
connection server_1;
connection default;
include/assert_grep.inc [Check that there is no 'Thread awaiting semi-sync ACK was awoken before its ACK' warning in error log.]
+connection slave;
#
# Cleanup
connection master;
set @@global.binlog_commit_wait_count=@save_bgc_count;
set @@global.binlog_commit_wait_usec=@save_bgc_usec;
set @@global.debug_dbug=@save_debug_dbug;
+set @@global.rpl_semi_sync_master_enabled= @save_semi_sync_master_enabled;
+set @@global.rpl_semi_sync_master_wait_point= @save_semi_sync_wp;
+connection slave;
+include/stop_slave.inc
+set @@global.rpl_semi_sync_slave_enabled= @save_semi_sync_slave_enabled;
+include/start_slave.inc
+connection master;
drop table t1, t2, t3;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_fail_over.result b/mysql-test/suite/rpl/r/rpl_semi_sync_fail_over.result
index 49fdb485..b881f69a 100644
--- a/mysql-test/suite/rpl/r/rpl_semi_sync_fail_over.result
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync_fail_over.result
@@ -63,7 +63,7 @@ connection server_2;
set global rpl_semi_sync_master_enabled = 1;
set global rpl_semi_sync_master_wait_point=AFTER_SYNC;
connection server_1;
-CHANGE MASTER TO master_host='127.0.0.1', master_port=$new_master_port, master_user='root', master_use_gtid=SLAVE_POS;
+CHANGE MASTER TO master_host='127.0.0.1', master_port=$new_master_port, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=SLAVE_POS;
set global rpl_semi_sync_slave_enabled = 1;
set @@global.gtid_slave_pos=@@global.gtid_binlog_pos;
include/start_slave.inc
@@ -149,7 +149,7 @@ connection server_1;
set global rpl_semi_sync_master_enabled = 1;
set global rpl_semi_sync_master_wait_point=AFTER_SYNC;
connection server_2;
-CHANGE MASTER TO master_host='127.0.0.1', master_port=$new_master_port, master_user='root', master_use_gtid=SLAVE_POS;
+CHANGE MASTER TO master_host='127.0.0.1', master_port=$new_master_port, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=SLAVE_POS;
set global rpl_semi_sync_slave_enabled = 1;
set @@global.gtid_slave_pos=@@global.gtid_binlog_pos;
include/start_slave.inc
@@ -234,7 +234,7 @@ connection server_2;
set global rpl_semi_sync_master_enabled = 1;
set global rpl_semi_sync_master_wait_point=AFTER_SYNC;
connection server_1;
-CHANGE MASTER TO master_host='127.0.0.1', master_port=$new_master_port, master_user='root', master_use_gtid=SLAVE_POS;
+CHANGE MASTER TO master_host='127.0.0.1', master_port=$new_master_port, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=SLAVE_POS;
set global rpl_semi_sync_slave_enabled = 1;
set @@global.gtid_slave_pos=@@global.gtid_binlog_pos;
include/start_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_slave_reply_fail.result b/mysql-test/suite/rpl/r/rpl_semi_sync_slave_reply_fail.result
index 3c9cf71a..fca143bd 100644
--- a/mysql-test/suite/rpl/r/rpl_semi_sync_slave_reply_fail.result
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync_slave_reply_fail.result
@@ -11,7 +11,7 @@ create table t1 (i int);
connection slave;
set global rpl_semi_sync_slave_enabled = ON;
CALL mtr.add_suppression("Semi-sync slave net_flush*");
-SET @save_debug= @@global.debug;
+SET @save_debug= @@global.debug_dbug;
SET GLOBAL debug_dbug="+d,semislave_failed_net_flush";
include/start_slave.inc
connection master;
diff --git a/mysql-test/suite/rpl/r/rpl_semisync_ali_issues.result b/mysql-test/suite/rpl/r/rpl_semisync_ali_issues.result
index d7f87ae5..d20960a9 100644
--- a/mysql-test/suite/rpl/r/rpl_semisync_ali_issues.result
+++ b/mysql-test/suite/rpl/r/rpl_semisync_ali_issues.result
@@ -268,20 +268,20 @@ show status like 'Rpl_semi_sync_master_clients';
Variable_name Value
Rpl_semi_sync_master_clients 1
# Test failure of select error .
-SET GLOBAL debug = 'd,rpl_semisync_simulate_select_error';
+SET GLOBAL debug_dbug = 'd,rpl_semisync_simulate_select_error';
INSERT INTO t1 VALUES(3);
connection slave;
connection con1;
# Test failure of pthread_create
SET GLOBAL rpl_semi_sync_master_enabled = 0;
-SET GLOBAL debug = 'd,rpl_semisync_simulate_create_thread_failure';
+SET GLOBAL debug_dbug = 'd,rpl_semisync_simulate_create_thread_failure';
SET GLOBAL rpl_semi_sync_master_enabled= ON;
# Test failure of pthread_join
SET GLOBAL rpl_semi_sync_master_enabled= OFF;
#
# Failure on registering semisync slave
#
-SET GLOBAL debug= 'd,rpl_semisync_simulate_add_slave_failure';
+SET GLOBAL debug_dbug= 'd,rpl_semisync_simulate_add_slave_failure';
SET GLOBAL rpl_semi_sync_master_enabled= ON;
connection slave;
STOP SLAVE IO_THREAD;
@@ -289,7 +289,7 @@ include/wait_for_slave_io_to_stop.inc
START SLAVE IO_THREAD;
include/wait_for_slave_io_to_start.inc
connection con1;
-SET GLOBAL debug='';
+SET GLOBAL debug_dbug='';
connection slave;
START SLAVE IO_THREAD;
include/wait_for_slave_io_to_start.inc
@@ -343,6 +343,4 @@ SET GLOBAL rpl_semi_sync_master_enabled = 0;
DROP TABLE t1;
connection slave;
SET GLOBAL rpl_semi_sync_slave_enabled = 0;
-stop slave;
-start slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_set_statement_default_master.result b/mysql-test/suite/rpl/r/rpl_set_statement_default_master.result
index 46f5a7c9..8681d67f 100644
--- a/mysql-test/suite/rpl/r/rpl_set_statement_default_master.result
+++ b/mysql-test/suite/rpl/r/rpl_set_statement_default_master.result
@@ -11,7 +11,9 @@ CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT, MASTER_USER
#
Connection_name = 'm1'
RESET SLAVE ALL;
-CHANGE MASTER 'm1' TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT, MASTER_USER='root';
+CHANGE MASTER 'm1' TO MASTER_HOST='127.0.0.1',
+MASTER_PORT=MASTER_MYPORT, MASTER_USER='root',
+MASTER_SSL_VERIFY_SERVER_CERT=0;
SET STATEMENT default_master_connection = 'm1' FOR START SLAVE;
set default_master_connection = 'm1';
include/wait_for_slave_to_start.inc
diff --git a/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result b/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result
index 79803cca..0c890337 100644
--- a/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result
+++ b/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result
@@ -3,7 +3,7 @@ include/master-slave.inc
connect slave2,127.0.0.1,root,,test,$SLAVE_MYPORT2,;
connection slave2;
RESET SLAVE;
-CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_PORT,master_user='root';
+CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_PORT,master_user='root', master_ssl_verify_server_cert=0;
START SLAVE IO_THREAD;
include/wait_for_slave_io_to_start.inc
connection master;
diff --git a/mysql-test/suite/rpl/r/rpl_skip_replication.result b/mysql-test/suite/rpl/r/rpl_skip_replication.result
index 96e0a303..c17ffbb5 100644
--- a/mysql-test/suite/rpl/r/rpl_skip_replication.result
+++ b/mysql-test/suite/rpl/r/rpl_skip_replication.result
@@ -12,7 +12,7 @@ SELECT,UPDATE ON *.* TO 'nonsuperuser'@'127.0.0.1';
connect nonpriv, 127.0.0.1, nonsuperuser,, test, $SLAVE_MYPORT,;
connection nonpriv;
SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
disconnect nonpriv;
connection slave;
DROP USER'nonsuperuser'@'127.0.0.1';
diff --git a/mysql-test/suite/rpl/r/rpl_slave_shutdown_mdev20821.result b/mysql-test/suite/rpl/r/rpl_slave_shutdown_mdev20821.result
index f90d2126..4d0c81f4 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_shutdown_mdev20821.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_shutdown_mdev20821.result
@@ -5,7 +5,7 @@ include/start_slave.inc
Warnings:
Note 1254 Slave is already running
set default_master_connection = 'm2';
-change master to master_host='127.0.0.1', master_port=SERVER_MYPORT_2, master_user='root', master_use_gtid=slave_pos;
+change master to master_host='127.0.0.1', master_port=SERVER_MYPORT_2, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
include/start_slave.inc
select @@global.slave_parallel_workers as two;
two
diff --git a/mysql-test/suite/rpl/r/rpl_ssl.result b/mysql-test/suite/rpl/r/rpl_ssl.result
index ce9e4d48..8c696f25 100644
--- a/mysql-test/suite/rpl/r/rpl_ssl.result
+++ b/mysql-test/suite/rpl/r/rpl_ssl.result
@@ -51,7 +51,7 @@ connection slave;
include/stop_slave.inc
CHANGE MASTER TO
master_user = 'root',
-master_ssl = 0,
+master_ssl = 1,
master_ssl_ca = '',
master_ssl_cert = '',
master_ssl_key = '';
diff --git a/mysql-test/suite/rpl/r/rpl_ssl1.result b/mysql-test/suite/rpl/r/rpl_ssl1.result
index 0cb21716..c6721d2f 100644
--- a/mysql-test/suite/rpl/r/rpl_ssl1.result
+++ b/mysql-test/suite/rpl/r/rpl_ssl1.result
@@ -7,7 +7,7 @@ create table t1 (t int);
connection slave;
stop slave;
include/wait_for_slave_to_stop.inc
-change master to master_user='replssl',master_password='';
+change master to master_user='replssl',master_password='',master_ssl=0;
start slave;
connection master;
insert into t1 values (1);
@@ -16,7 +16,11 @@ select * from t1;
t
include/wait_for_slave_io_error.inc [errno=1045]
include/stop_slave_sql.inc
-change master to master_ssl=1 , master_ssl_ca ='MYSQL_TEST_DIR/std_data/cacert.pem', master_ssl_cert='MYSQL_TEST_DIR/std_data/client-cert.pem', master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem';
+change master to
+master_ssl=1,
+master_ssl_ca ='MYSQL_TEST_DIR/std_data/cacert.pem',
+master_ssl_cert='MYSQL_TEST_DIR/std_data/client-cert.pem',
+master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem';
start slave;
include/wait_for_slave_to_start.inc
connection master;
@@ -61,7 +65,6 @@ connection master;
create table t1 (t int);
insert into t1 values (1);
connection slave;
-on slave
select * from t1;
t
1
@@ -72,14 +75,42 @@ Master_SSL_Cert = 'MYSQL_TEST_DIR/std_data/client-cert.pem'
Master_SSL_Key = 'MYSQL_TEST_DIR/std_data/client-key.pem'
include/check_slave_is_running.inc
connection master;
+create user replssl@127.0.0.1 identified by "sslrepl";
+grant replication slave on *.* to replssl@127.0.0.1 require ssl;
+connection slave;
+stop slave;
+include/wait_for_slave_to_stop.inc
+change master to
+master_host="127.0.0.1",
+master_user='replssl',
+master_password="sslrepl",
+master_ssl=1,
+master_ssl_verify_server_cert=1,
+master_ssl_ca ='',
+master_ssl_cert='',
+master_ssl_key='';
+start slave;
+include/wait_for_slave_to_start.inc
+show tables;
+Tables_in_test
+t1
+connection master;
drop table t1;
connection slave;
+show tables;
+Tables_in_test
include/stop_slave.inc
CHANGE MASTER TO
master_host="127.0.0.1",
+master_user='root',
+master_password='',
master_ssl_ca ='',
master_ssl_cert='',
master_ssl_key='',
master_ssl_verify_server_cert=0,
-master_ssl=0;
+master_ssl=1;
+connection master;
+drop user replssl@127.0.0.1;
+connection slave;
+drop user replssl@127.0.0.1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_restart_master.result b/mysql-test/suite/rpl/r/rpl_start_alter_restart_master.result
index 2b53fde5..15c1ae00 100644
--- a/mysql-test/suite/rpl/r/rpl_start_alter_restart_master.result
+++ b/mysql-test/suite/rpl/r/rpl_start_alter_restart_master.result
@@ -5,7 +5,7 @@ include/stop_slave.inc
CHANGE MASTER TO MASTER_USE_GTID=NO;
include/start_slave.inc
connection slave;
-SET @old_debug_slave= @@global.debug;
+SET @old_debug_slave= @@global.debug_dbug;
stop slave;
SET GLOBAL slave_parallel_threads=4;
set global slave_parallel_mode=optimistic;
@@ -13,7 +13,7 @@ set global gtid_strict_mode=1;
start slave;
connection master;
call mtr.add_suppression("ALTER query started at .+ could not be completed");
-SET @old_debug_master= @@global.debug;
+SET @old_debug_master= @@global.debug_dbug;
set binlog_alter_two_phase=true;
create table t3( a int primary key, b int) engine=innodb;
connection master;
diff --git a/mysql-test/suite/rpl/r/rpl_start_alter_restart_slave.result b/mysql-test/suite/rpl/r/rpl_start_alter_restart_slave.result
index 76f9cbcd..39b98042 100644
--- a/mysql-test/suite/rpl/r/rpl_start_alter_restart_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_start_alter_restart_slave.result
@@ -1,7 +1,7 @@
include/master-slave.inc
[connection master]
connection slave;
-SET @old_debug_slave= @@global.debug;
+SET @old_debug_slave= @@global.debug_dbug;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=4;
set global slave_parallel_mode=optimistic;
@@ -9,7 +9,7 @@ set global gtid_strict_mode=1;
set global debug_dbug="+d,rpl_slave_stop_CA_before_binlog";
include/start_slave.inc
connection master;
-SET @old_debug_master= @@global.debug;
+SET @old_debug_master= @@global.debug_dbug;
set global debug_dbug="+d,start_alter_delay_master";
set global binlog_alter_two_phase=true;
create table t1( a int primary key, b int) engine=myisam;
@@ -112,10 +112,10 @@ set global binlog_alter_two_phase = 0;
SET GLOBAL debug_dbug= @old_debug_master;
set DEBUG_SYNC= 'RESET';
connection slave;
-stop slave;
+include/stop_slave.inc
set global slave_parallel_threads = 0;;
set global slave_parallel_mode = optimistic;;
set global gtid_strict_mode = 0;;
set DEBUG_SYNC= 'RESET';
-start slave;
+include/start_slave.inc
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temporary.result b/mysql-test/suite/rpl/r/rpl_temporary.result
index 492e9ac3..3651ead1 100644
--- a/mysql-test/suite/rpl/r/rpl_temporary.result
+++ b/mysql-test/suite/rpl/r/rpl_temporary.result
@@ -42,12 +42,12 @@ connect con3,localhost,zedjzlcsjhd,,;
connection con3;
SET @save_select_limit=@@session.sql_select_limit;
SET @@session.sql_select_limit=10, @@session.pseudo_thread_id=100;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG REPLAY privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG REPLAY privilege(s) for this operation
SELECT @@session.sql_select_limit = @save_select_limit;
@@session.sql_select_limit = @save_select_limit
1
SET @@session.sql_select_limit=10, @@session.sql_log_bin=0;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SELECT @@session.sql_select_limit = @save_select_limit;
@@session.sql_select_limit = @save_select_limit
1
diff --git a/mysql-test/suite/rpl/r/rpl_timestamp.result b/mysql-test/suite/rpl/r/rpl_timestamp.result
index 9fc93062..929d3d95 100644
--- a/mysql-test/suite/rpl/r/rpl_timestamp.result
+++ b/mysql-test/suite/rpl/r/rpl_timestamp.result
@@ -2,6 +2,8 @@ include/master-slave.inc
[connection master]
set timestamp=1656940000;
set explicit_defaults_for_timestamp=!@@explicit_defaults_for_timestamp;
+Warnings:
+Warning 1287 'explicit_defaults_for_timestamp=0' is deprecated and will be removed in a future release
connection master;
create table t1 (f1 timestamp, f2 timestamp);
show create table t1;
diff --git a/mysql-test/suite/rpl/r/rpl_upgrade_master_info.result b/mysql-test/suite/rpl/r/rpl_upgrade_master_info.result
index 1babddf9..08a0a6a4 100644
--- a/mysql-test/suite/rpl/r/rpl_upgrade_master_info.result
+++ b/mysql-test/suite/rpl/r/rpl_upgrade_master_info.result
@@ -90,7 +90,7 @@ connection master;
INSERT INTO t1 VALUES (6);
include/save_master_gtid.inc
connection slave;
-CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1;
+CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1, MASTER_SSL=1;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
diff --git a/mysql-test/suite/rpl/r/rpl_xa.result b/mysql-test/suite/rpl/r/rpl_xa.result
index 061c7b36..91e2a1f3 100644
--- a/mysql-test/suite/rpl/r/rpl_xa.result
+++ b/mysql-test/suite/rpl/r/rpl_xa.result
@@ -225,7 +225,7 @@ drop table t1, t2, t3, tm;
create table t1 (a int primary key, b int unique) engine=innodb;
insert t1 values (1,1),(3,3),(5,5);
connection slave;
-set session tx_isolation='repeatable-read';
+set session transaction_isolation='repeatable-read';
start transaction;
select * from t1;
a b
diff --git a/mysql-test/suite/rpl/r/rpl_xa_gtid_pos_auto_engine.result b/mysql-test/suite/rpl/r/rpl_xa_gtid_pos_auto_engine.result
index 35625cc7..66300e4d 100644
--- a/mysql-test/suite/rpl/r/rpl_xa_gtid_pos_auto_engine.result
+++ b/mysql-test/suite/rpl/r/rpl_xa_gtid_pos_auto_engine.result
@@ -234,7 +234,7 @@ drop table t1, t2, t3, tm;
create table t1 (a int primary key, b int unique) engine=innodb;
insert t1 values (1,1),(3,3),(5,5);
connection slave;
-set session tx_isolation='repeatable-read';
+set session transaction_isolation='repeatable-read';
start transaction;
select * from t1;
a b
diff --git a/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result
index 35cb3fcd..c38d1343 100644
--- a/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result
+++ b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result
@@ -3,6 +3,6 @@ include/master-slave.inc
connection slave;
connection slave;
include/wait_for_slave_to_stop.inc
-start slave;
+include/start_slave.inc
connection master;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/rpl_1slave_base.cnf b/mysql-test/suite/rpl/rpl_1slave_base.cnf
index a7a7f5c6..c1e9e828 100644
--- a/mysql-test/suite/rpl/rpl_1slave_base.cnf
+++ b/mysql-test/suite/rpl/rpl_1slave_base.cnf
@@ -1,6 +1,5 @@
# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
-!include include/default_client.cnf
+!include include/default_my.cnf
[mysqld.1]
diff --git a/mysql-test/suite/rpl/t/grant_replication_slave.test b/mysql-test/suite/rpl/t/grant_replication_slave.test
index c5aca0a6..d50e8a13 100644
--- a/mysql-test/suite/rpl/t/grant_replication_slave.test
+++ b/mysql-test/suite/rpl/t/grant_replication_slave.test
@@ -33,7 +33,7 @@ drop database mysqltest1;
sync_slave_with_master;
stop slave;
change master to master_user='root';
-start slave;
+source include/start_slave.inc;
source include/rpl_end.inc;
drop user rpl@localhost;
diff --git a/mysql-test/suite/rpl/t/max_binlog_total_size-master.opt b/mysql-test/suite/rpl/t/max_binlog_total_size-master.opt
new file mode 100644
index 00000000..9ba64a44
--- /dev/null
+++ b/mysql-test/suite/rpl/t/max_binlog_total_size-master.opt
@@ -0,0 +1,5 @@
+--log-bin=binary
+--max-binlog-total-size=1500
+--max-binlog-size=4096
+--binlog-format=row
+--slave_connections_needed_for_purge=1
diff --git a/mysql-test/suite/rpl/t/max_binlog_total_size.test b/mysql-test/suite/rpl/t/max_binlog_total_size.test
new file mode 100644
index 00000000..2892d137
--- /dev/null
+++ b/mysql-test/suite/rpl/t/max_binlog_total_size.test
@@ -0,0 +1,58 @@
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+
+--echo #
+--echo # MDEV-31404 Implement binlog_space_limit
+--echo #
+
+--echo # Test that master is not deleting binary logs before slave has a
+--echo # chance to digest them
+
+select @@global.max_binlog_total_size;
+select @@global.max_binlog_size;
+
+--connection slave
+STOP SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_stop.inc
+--connection master
+
+# Kill the dump thread
+let $id=`SELECT id from information_schema.processlist where command='Binlog Dump'`;
+
+if ($id)
+{
+ replace_result $id DUMP_THREAD;
+ eval kill $id;
+ let $wait_condition= SELECT count(*)=0 from information_schema.processlist where command='Killed';
+ source include/wait_condition.inc;
+}
+
+CREATE TABLE `t1` (
+ `v1` int(11) DEFAULT NULL,
+ `v2` varchar(8000) DEFAULT NULL,
+ KEY `v1` (`v1`)
+);
+
+FLUSH LOGS;
+FLUSH LOGS;
+FLUSH LOGS;
+--source include/show_binary_logs.inc
+
+INSERT INTO t1 VALUES (0,repeat("a",3000));
+--source include/show_binary_logs.inc
+
+--connection slave
+START SLAVE IO_THREAD;
+--connection master
+
+--sync_slave_with_master
+--connection master
+
+# Slave is now connected. Next query should remove old binary logs.
+
+DROP TABLE t1;
+--source include/show_binary_logs.inc
+
+# End of 11.4 tests
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_000010.test b/mysql-test/suite/rpl/t/rpl_000010.test
index 9ff2d6c5..27b29017 100644
--- a/mysql-test/suite/rpl/t/rpl_000010.test
+++ b/mysql-test/suite/rpl/t/rpl_000010.test
@@ -17,6 +17,7 @@ select n from t1;
connection master;
drop table t1;
sync_slave_with_master;
+source include/wait_for_slave_to_start.inc;
# End of 4.1 tests
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_alter_extra_persistent.test b/mysql-test/suite/rpl/t/rpl_alter_extra_persistent.test
index 4e604787..e61d0502 100644
--- a/mysql-test/suite/rpl/t/rpl_alter_extra_persistent.test
+++ b/mysql-test/suite/rpl/t/rpl_alter_extra_persistent.test
@@ -20,11 +20,19 @@ insert into t1 values(6);
--sync_slave_with_master
select * from t1 order by a;
+alter table t1 add column z3 int default(a+2);
+--connection master
+insert into t1 values(7);
+insert into t1 values(8);
+
+--sync_slave_with_master
+select * from t1 order by a;
+--connection master
+delete from t1 where a > 6;
--echo #UPDATE query
---connection master
update t1 set a = a+10;
select * from t1 order by a;
@@ -95,12 +103,177 @@ start slave;
--source include/wait_for_slave_sql_to_start.inc
---connection master
+--connection master
--sync_slave_with_master
select * from t1 order by a;
--connection master
select * from t1 order by a;
drop table t1;
+--sync_slave_with_master
+--connection master
+
+set binlog_row_image=minimal;
+
+create table t1(a int primary key auto_increment, b int unique);
+insert into t1 values(1, 1);
+insert into t1 values(2, 2);
+insert into t1 values(3, 3);
+insert into t1 values(4, 4);
+insert into t1 values(5, 5);
+
+--sync_slave_with_master
+alter table t1 add column d1 int default (b),
+ add column z1 int as (b+1) virtual,
+ add column z2 int as (b+2) persistent;
+--connection master
+
+insert into t1 values(6, 6);
+update t1 set a = 11 where a = 1;
+update t1 set b = 12 where b = 2;
+
+delete from t1 where a = 3;
+delete from t1 where b = 5;
+
+update t1 set b = 16 where a = 6;
+
+--sync_slave_with_master
+select * from t1;
+
+--echo # Cleanup
+--connection master
+drop table t1;
+--sync_slave_with_master
+--connection master
+
+
+set binlog_row_image=minimal;
+
+--echo #
+--echo # MDEV-29069 ER_KEY_NOT_FOUND upon online autoinc addition and
+--echo # concurrent DELETE
+--echo #
+
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+
+--sync_slave_with_master
+alter table t add pk int auto_increment primary key;
+
+--connection master
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+--sync_slave_with_master
+select * from t;
+--connection master
+
+--echo #
+--echo # Add clumsy DEFAULT
+--echo #
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+
+--sync_slave_with_master
+alter table t add b int default(RAND() * 20), add key(b),
+ algorithm=copy, lock=none;
+--connection master
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+--sync_slave_with_master
+select a from t;
+--connection master
+
+--echo # CURRENT_TIMESTAMP
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+
+--sync_slave_with_master
+alter table t add b timestamp default CURRENT_TIMESTAMP, add key(b);
+--connection master
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+--sync_slave_with_master
+select a from t;
+--connection master
+
+--echo # CURRENT_TIMESTAMP, mixed key
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+
+--sync_slave_with_master
+alter table t add b timestamp default CURRENT_TIMESTAMP, add key(a, b);
+--connection master
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+
+--sync_slave_with_master
+select a from t;
+--connection master
+
+--echo # Mixed primary key
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+
+--sync_slave_with_master
+alter table t add b int default (1), add primary key(b, a);
+--connection master
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+
+--sync_slave_with_master
+select a from t;
+--connection master
+
+--echo #
+--echo # Normal row, could be used as a key
+--echo #
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+
+--sync_slave_with_master
+alter table t add b int as (a * 10) unique;
+--connection master
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+
+--sync_slave_with_master
+select * from t;
+--connection master
+
+--echo #
+--echo # Add key for old row
+--echo #
+create or replace table t (a int);
+insert into t values (10),(20),(30);
+
+--sync_slave_with_master
+alter table t add unique(a);
+--connection master
+delete from t where a = 20;
+update t set a = a + 1 where a = 10;
+
+--sync_slave_with_master
+select * from t;
+
+--echo # Cleanup
+--connection master
+--sync_slave_with_master
+--connection master
+drop table t;
+
+--echo #
+--echo # MDEV-30985 Replica stops with error on ALTER ONLINE with Geometry Types
+--echo #
+create table t(geo geometrycollection default st_geomfromtext('point(1 1)'));
+insert into t () values (),(),();
+--sync_slave_with_master
+alter table t add vcol9 point as (geo), add key(vcol9);
+--connection master
+
+delete from t;
+--sync_slave_with_master
+--connection master
+
+drop table t;
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_alter_instant.test b/mysql-test/suite/rpl/t/rpl_alter_innodb.test
index 260f7e92..260f7e92 100644
--- a/mysql-test/suite/rpl/t/rpl_alter_instant.test
+++ b/mysql-test/suite/rpl/t/rpl_alter_innodb.test
diff --git a/mysql-test/suite/rpl/t/rpl_alter_online_debug.test b/mysql-test/suite/rpl/t/rpl_alter_online_debug.test
new file mode 100644
index 00000000..b257ce29
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_alter_online_debug.test
@@ -0,0 +1,128 @@
+source include/have_debug_sync.inc;
+source include/have_innodb.inc;
+source include/master-slave.inc;
+
+--connection master
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format");
+
+--connection slave
+call mtr.add_suppression("Unsafe statement written to the binary log using statement format");
+
+#
+# Single-phase alter
+#
+
+--echo # MDEV-31804 Assertion `thd->m_transaction_psi == __null' fails upon
+--echo # replicating online ALTER
+--connection master
+create table t (a char(8)) engine=myisam;
+insert into t values ('foo'),('bar');
+
+set debug_sync= 'alter_table_online_progress signal go_dml wait_for go_alter';
+set @old_slave_exec_mode= @@global.slave_exec_mode;
+set @@global.slave_exec_mode= idempotent;
+send alter table t force;
+
+--connection master1
+set debug_sync= 'now wait_for go_dml';
+insert into t (a) values ('qux');
+set debug_sync= 'now signal go_alter';
+
+--connection master
+--reap
+--sync_slave_with_master
+
+# Cleanup
+--connection master
+drop table t;
+set global slave_exec_mode= @old_slave_exec_mode;
+set debug_sync= reset;
+
+
+--echo #
+--echo # End of 11.2 tests (Single-phase alter)
+--echo #
+
+
+#
+# Two-phase alter
+#
+--connection slave
+source include/stop_slave.inc;
+--let $slave_parallel_threads=`select @@global.slave_parallel_threads`
+--let $slave_parallel_mode= `select @@global.slave_parallel_mode`
+--let $binlog_row_image= `select @@global.binlog_row_image`
+set global slave_parallel_threads=3;
+set global slave_parallel_mode= optimistic;
+set global binlog_row_image=MINIMAL;
+--connection master
+
+
+--echo #
+--echo # MDEV-31755 Replica's DML event deadlocks wit online alter table
+--echo #
+--echo # Three threads for SA,U,CA
+
+create table t (id int, a int, primary key (id)) engine=innodb;
+insert into t values (1,10), (2,20);
+
+set @@session.binlog_alter_two_phase=1;
+set debug_sync= 'alter_table_online_downgraded signal ready wait_for go';
+send alter table t add c text default('qqq') after id, algorithm=copy, lock=none;
+
+--connection master1
+set debug_sync= 'now wait_for ready';
+
+update t set a = 1;
+
+set debug_sync= 'now signal go';
+
+--connection master
+--reap
+--source include/save_master_gtid.inc
+
+--connection slave
+source include/start_slave.inc;
+--source include/sync_with_master_gtid.inc
+select * from t;
+
+# Cleanup
+--connection master
+drop table t;
+
+--echo # MDEV-31838 Assertion fails on replica upon parallel
+--echo # replication with two-phase alter and MINIMAL row image
+create table t (id int, a int, primary key(id)) engine=aria;
+insert into t values (1,0);
+
+set @@session.binlog_alter_two_phase=1;
+set debug_sync= 'alter_table_online_progress signal go_dml wait_for go_alter';
+send alter table t force, algorithm=copy, lock=none;
+
+--connection master1
+set binlog_row_image=MINIMAL;
+set debug_sync= 'now wait_for go_dml';
+--disable_warnings
+update ignore t set a = 1;
+--enable_warnings
+set debug_sync= 'now signal go_alter';
+
+# Cleanup
+--connection master
+--reap
+drop table t;
+--sync_slave_with_master
+--connection master
+
+--echo #
+--echo # End of 11.2 tests (Two-phase alter)
+--echo #
+
+--connection slave
+source include/stop_slave.inc;
+--eval set global binlog_row_image=$binlog_row_image
+--eval set global slave_parallel_threads=$slave_parallel_threads
+--eval set global slave_parallel_mode= $slave_parallel_mode
+source include/start_slave.inc;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_bug26395.test b/mysql-test/suite/rpl/t/rpl_bug26395.test
index 0c1b2a7a..5054b106 100644
--- a/mysql-test/suite/rpl/t/rpl_bug26395.test
+++ b/mysql-test/suite/rpl/t/rpl_bug26395.test
@@ -30,7 +30,7 @@
# BUG#26395: if crash during autocommit update to transactional table on master, slave fails
source include/have_innodb.inc;
-# have_debug is needed since we use the @@debug variable on master
+# have_debug is needed since we use the @@debug_dbug variable on master
source include/have_debug.inc;
source include/master-slave.inc;
@@ -43,7 +43,7 @@ CREATE TABLE tinnodb (a INT) ENGINE = INNODB;
SHOW CREATE TABLE tinnodb;
# do_not_write_xid stops the master from writing an XID event.
-set @old_debug= @@debug;
+set @old_debug= @@debug_dbug;
set @@debug_dbug= 'd,do_not_write_xid';
diff --git a/mysql-test/suite/rpl/t/rpl_checksum_cache.test b/mysql-test/suite/rpl/t/rpl_checksum_cache.test
index e04f618b..173af8c1 100644
--- a/mysql-test/suite/rpl/t/rpl_checksum_cache.test
+++ b/mysql-test/suite/rpl/t/rpl_checksum_cache.test
@@ -243,6 +243,102 @@ let $diff_tables=master:test.t3, slave:test.t3;
source include/diff_tables.inc;
+--echo *** Test switching checksum algorithm while ongoing transactions have pre-computed checksum in their binlog cache ***
+
+--connection master
+CREATE TABLE t4 (a INT, b INT, c VARCHAR(1024), PRIMARY KEY (a,b)) ENGINE=InnoDB;
+
+# Create a couple transactions that will precompute checksums but commit
+# without them.
+
+BEGIN;
+INSERT INTO t4 VALUES (1, 1, "small, pre-computed checksums");
+
+--connection server_1
+BEGIN;
+INSERT INTO t4 VALUES (2, 1, "big, pre-computed checksums");
+--let $i= 20
+--disable_query_log
+while ($i) {
+ eval INSERT INTO t4 VALUES (2, 22-$i, REPEAT("x", FLOOR(RAND()*100) + 831));
+ dec $i;
+}
+--enable_query_log
+
+# Disable checksums dynamically, so MYSQL_BIN_LOG::write_cache() will have
+# to drop the pre-computed checksums.
+set @@global.binlog_checksum = NONE;
+
+--connection master
+INSERT INTO t4 VALUES (1, 2, "done");
+COMMIT;
+--connection server_1
+INSERT INTO t4 VALUES (2, 22, "done");
+COMMIT;
+
+# Create a couple transactions that will not precompute checksums but commit
+# with them.
+
+--connection master
+BEGIN;
+INSERT INTO t4 VALUES (3, 1, "small, no pre-computed checksums");
+
+--connection server_1
+BEGIN;
+INSERT INTO t4 VALUES (4, 1, "big, no pre-computed checksums");
+--let $i= 20
+--disable_query_log
+while ($i) {
+ eval INSERT INTO t4 VALUES (4, 22-$i, REPEAT("x", FLOOR(RAND()*100) + 853));
+ dec $i;
+}
+--enable_query_log
+
+# Ebable checksums dynamically, so MYSQL_BIN_LOG::write_cache() will have
+# to recompute the checksums.
+set @@global.binlog_checksum = CRC32;
+
+--connection master
+INSERT INTO t4 VALUES (3, 2, "done");
+COMMIT;
+--connection server_1
+INSERT INTO t4 VALUES (4, 22, "done");
+COMMIT;
+
+sync_slave_with_master;
+
+
+--echo *** Test the --binlog-legacy-event-pos option.
+--connection master
+FLUSH BINARY LOGS;
+--source include/wait_for_binlog_checkpoint.inc
+
+--let $query_file= query_get_value(SHOW MASTER STATUS, File, 1)
+--let $query_pos= query_get_value(SHOW MASTER STATUS, Position, 1)
+BEGIN;
+INSERT INTO t4 VALUES (5, 1, "Zero end_log_pos");
+COMMIT;
+--let $end_log_pos= query_get_value(SHOW BINLOG EVENTS IN "$query_file" FROM $query_pos LIMIT 3, End_log_pos, 2)
+if ($end_log_pos!=0) {
+ eval SHOW BINLOG EVENTS IN "$query_file";
+ --die Wrong End_log_pos=$end_log_pos, expected zero.
+}
+
+set @@global.binlog_legacy_event_pos= 1;
+--let $query_pos= query_get_value(SHOW MASTER STATUS, Position, 1)
+BEGIN;
+INSERT INTO t4 VALUES (6, 1, "Non-zero end_log_pos");
+COMMIT;
+--let $end_log_pos= query_get_value(SHOW BINLOG EVENTS IN "$query_file" FROM $query_pos LIMIT 3, End_log_pos, 2)
+if ($end_log_pos==0) {
+ eval SHOW BINLOG EVENTS IN "$query_file";
+ --die Wrong End_log_pos=$end_log_pos, expected non-zero.
+}
+set @@global.binlog_legacy_event_pos= 0;
+
+sync_slave_with_master;
+
+
connection master;
begin;
@@ -251,7 +347,7 @@ delete from t2;
delete from t3;
commit;
-drop table t1, t2, t3;
+drop table t1, t2, t3, t4;
set @@global.binlog_cache_size = @save_binlog_cache_size;
set @@global.binlog_checksum = @save_binlog_checksum;
set @@global.master_verify_checksum = @save_master_verify_checksum;
diff --git a/mysql-test/suite/rpl/t/rpl_circular_semi_sync.test b/mysql-test/suite/rpl/t/rpl_circular_semi_sync.test
index e533c54b..75d04d65 100644
--- a/mysql-test/suite/rpl/t/rpl_circular_semi_sync.test
+++ b/mysql-test/suite/rpl/t/rpl_circular_semi_sync.test
@@ -55,7 +55,7 @@ INSERT INTO t1(a) VALUES (1);
set @@global.gtid_strict_mode = true;
set @@global.rpl_semi_sync_slave_enabled = 1;
-evalp CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_2, master_user='root', master_use_gtid=SLAVE_POS;
+evalp CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_2, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=SLAVE_POS;
--source include/start_slave.inc
--echo ... is done.
diff --git a/mysql-test/suite/rpl/t/rpl_connection.test b/mysql-test/suite/rpl/t/rpl_connection.test
index 24ada7c8..5ad076de 100644
--- a/mysql-test/suite/rpl/t/rpl_connection.test
+++ b/mysql-test/suite/rpl/t/rpl_connection.test
@@ -19,6 +19,6 @@ START SLAVE;
--source include/stop_slave_sql.inc
CHANGE MASTER TO MASTER_USER= 'root', MASTER_PASSWORD= '';
-START SLAVE;
+--source include/start_slave.inc
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_corruption.test b/mysql-test/suite/rpl/t/rpl_corruption.test
index cd2a1cc7..16270fa4 100644
--- a/mysql-test/suite/rpl/t/rpl_corruption.test
+++ b/mysql-test/suite/rpl/t/rpl_corruption.test
@@ -14,10 +14,10 @@
############################################################
#
-# The tests intensively utilize @@global.debug. Note,
+# The tests intensively utilize @@global.debug_dbug. Note,
# Bug#11765758 - 58754,
-# @@global.debug is read by the slave threads through dbug-interface.
-# Hence, before a client thread set @@global.debug we have to ensure that:
+# @@global.debug_dbug is read by the slave threads through dbug-interface.
+# Hence, before a client thread set @@global.debug_dbug we have to ensure that:
# (a) the slave threads are stopped, or (b) the slave threads are in
# sync and waiting.
diff --git a/mysql-test/suite/rpl/t/rpl_cross_version-master.opt b/mysql-test/suite/rpl/t/rpl_cross_version-master.opt
deleted file mode 100644
index 815a8f81..00000000
--- a/mysql-test/suite/rpl/t/rpl_cross_version-master.opt
+++ /dev/null
@@ -1 +0,0 @@
---replicate-same-server-id --relay-log=slave-relay-bin
diff --git a/mysql-test/suite/rpl/t/rpl_cross_version.test b/mysql-test/suite/rpl/t/rpl_cross_version.test
deleted file mode 100644
index 94c9f043..00000000
--- a/mysql-test/suite/rpl/t/rpl_cross_version.test
+++ /dev/null
@@ -1,48 +0,0 @@
-# ==== Purpose ====
-#
-# Verify cross-version replication from an old master to the up-to-date slave
-#
-# ==== Implementation ====
-#
-# Feed to the slave server a binlog recorded on an old version master
-# via setting up slave-to-slave replication. The latter is done by means of
-# the opt file and include/setup_fake_relay_log.inc.
-# The master's binlog is treated as a relay log that the SQL thread executes.
-#
-
---source include/master-slave.inc
-
-#
-# Bug#31240 load data infile replication between (4.0 or 4.1) and 5.1 fails
-#
-
---echo ==== Initialize ====
---connection slave
-
---disable_query_log
-# The binlog contains the function RAND which is unsafe.
-CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
---enable_query_log
-
---source include/stop_slave.inc
-RESET SLAVE;
-
-# the relay log contains create t1, t3 tables and load data infile
---let $fake_relay_log = $MYSQL_TEST_DIR/suite/binlog/std_data/binlog_old_version_4_1.000001
---source include/setup_fake_relay_log.inc
-
---echo ==== Test ====
-start slave sql_thread;
---let $slave_param = Exec_Master_Log_Pos
-# end_log_pos of the last event of the relay log
---let $slave_param_value = 149436
---source include/wait_for_slave_param.inc
---echo ==== a prove that the fake has been processed successfully ====
-SELECT COUNT(*) - 17920 as zero FROM t3;
-
---echo ==== Clean up ====
---source include/stop_slave_sql.inc
---source include/cleanup_fake_relay_log.inc
-drop table t1, t3;
---let $rpl_only_running_threads= 1
---source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ctype_collate_implicit.test b/mysql-test/suite/rpl/t/rpl_ctype_collate_implicit.test
new file mode 100644
index 00000000..ba4e3fed
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_ctype_collate_implicit.test
@@ -0,0 +1,60 @@
+--source include/have_binlog_format_row.inc
+--source include/master-slave.inc
+
+--echo #
+--echo # MDEV-30164 System variable for default collations
+--echo #
+
+--connection master
+SET @@character_set_collations='utf8mb3=uca1400_ai_ci,'
+ 'utf8mb4=uca1400_ai_ci,'
+ 'ucs2=uca1400_ai_ci,'
+ 'utf16=uca1400_ai_ci,'
+ 'utf32=uca1400_ai_ci';
+
+--connection master
+CREATE TABLE t1 AS SELECT CHAR(0x61 USING utf8mb4);
+SHOW CREATE TABLE t1;
+--sync_slave_with_master
+SHOW CREATE TABLE t1;
+--connection master
+DROP TABLE t1;
+--sync_slave_with_master
+
+
+--connection master
+CREATE TABLE t1 AS SELECT CONVERT('a' USING utf8mb4);
+SHOW CREATE TABLE t1;
+--sync_slave_with_master
+SHOW CREATE TABLE t1;
+--connection master
+DROP TABLE t1;
+--sync_slave_with_master
+
+
+--connection master
+CREATE TABLE t1 (
+ c0 TEXT CHARACTER SET utf8mb3,
+ c1 TEXT CHARACTER SET utf8mb4,
+ c2 TEXT CHARACTER SET utf16,
+ c3 TEXT CHARACTER SET utf32,
+ c4 TEXT CHARACTER SET ucs2
+);
+SHOW CREATE TABLE t1;
+--sync_slave_with_master
+SHOW CREATE TABLE t1;
+--connection master
+DROP TABLE t1;
+--sync_slave_with_master
+
+
+--connection master
+CREATE DATABASE db1 CHARACTER SET utf8mb4;
+--sync_slave_with_master
+SHOW CREATE DATABASE db1;
+--connection master
+DROP DATABASE db1;
+--sync_slave_with_master
+
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_extra_col_slave_minimal.test b/mysql-test/suite/rpl/t/rpl_extra_col_slave_minimal.test
new file mode 100644
index 00000000..7e2daa9a
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_extra_col_slave_minimal.test
@@ -0,0 +1,44 @@
+--source include/have_binlog_format_row.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+
+set binlog_row_image=minimal;
+
+connection slave;
+stop slave;
+set global binlog_row_image=minimal;
+--source include/reset_slave.inc
+
+create table t1 (
+ a int key, b blob, c char(5),
+ d char(10) as (concat(trim(c), '-U')) unique,
+ e char(10) as (concat('S', b)) stored) engine=innodb;
+
+connection master;
+create table t1 (a int primary key, b blob, c char(5)) engine=innodb;
+reset master;
+
+connection slave;
+start slave;
+
+connection master;
+set timestamp=unix_timestamp('2010-10-10 10:10:10');
+insert t1 values (1,'.','Kyle'),(2,'?','JOE'),(3,'!','QA'), (4, '$', '4TH');
+update t1 set c='UPD' where a=3;
+update t1 set b='#' where a=2;
+delete from t1 where a=4;
+--sorted_result
+select * from t1;
+--sorted_result
+sync_slave_with_master;
+--sorted_result
+select * from t1;
+select d from t1; # no --sorted_result here, this must be KEYREAD, so must be sorted
+select * from t1 where d='JOE-U';
+
+connection master;
+drop table t1;
+sync_slave_with_master;
+set global binlog_row_image=full;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_geometry.test b/mysql-test/suite/rpl/t/rpl_geometry.test
index 415732a0..664979eb 100644
--- a/mysql-test/suite/rpl/t/rpl_geometry.test
+++ b/mysql-test/suite/rpl/t/rpl_geometry.test
@@ -23,4 +23,17 @@ sync_slave_with_master;
connection master;
drop table t1, t2;
+
+--echo #
+--echo # MDEV-30985 Replica stops with error on ALTER ONLINE with Geometry Types
+--echo #
+create table t(geo geometrycollection default st_geomfromtext('point(1 1)'),
+ vc point as (geo));
+insert into t () values (),(),();
+delete from t;
+
+sync_slave_with_master;
+connection master;
+drop table t;
+
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_glle_no_terminate.test b/mysql-test/suite/rpl/t/rpl_gtid_glle_no_terminate.test
index f0f38a31..8d8f22bb 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_glle_no_terminate.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_glle_no_terminate.test
@@ -24,6 +24,7 @@ CHANGE MASTER TO MASTER_USE_GTID=slave_pos;
--echo #
--echo # Initialize test data
--connection master
+--source include/wait_for_binlog_checkpoint.inc
create table t1 (a int);
SET @@session.server_id= 3;
create table t2 (a int);
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_index.test b/mysql-test/suite/rpl/t/rpl_gtid_index.test
new file mode 100644
index 00000000..6001cc6e
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_gtid_index.test
@@ -0,0 +1,89 @@
+--source include/have_sequence.inc
+--source include/have_innodb.inc
+--source include/master-slave.inc
+--source include/have_binlog_format_mixed.inc
+
+--connection slave
+--source include/stop_slave.inc
+CHANGE MASTER TO master_use_gtid= slave_pos;
+--source include/start_slave.inc
+
+--connection master
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (0, 0);
+
+
+--echo *** Test looking up a lot of different event positions and GTIDs.
+
+# A function for comparing GTID positions.
+# Handles that the domain_id order is different in the two strings.
+# Works by repeatedly removing one GTID from each string. If the strings have
+# the same length and nothing is left at the end, then they are identical.
+delimiter //;
+CREATE FUNCTION gtid_eq(a VARCHAR(255), b VARCHAR(255)) RETURNS BOOLEAN DETERMINISTIC
+BEGIN
+ DECLARE g VARCHAR(255);
+ IF a IS NULL OR b IS NULL OR LENGTH(a) != LENGTH(b) THEN
+ RETURN FALSE;
+ END IF;
+ SET a= CONCAT(a, ',');
+ SET b= CONCAT(',', b, ',');
+ WHILE LENGTH(a) > 0 DO
+ SET g= REGEXP_SUBSTR(a, '^[^,]+,');
+ SET a= SUBSTRING(a, LENGTH(g)+1);
+ SET b= REPLACE(b, CONCAT(',', g), ',');
+ END WHILE;
+ RETURN b = ',';
+END //
+delimiter ;//
+
+SET @old_page_size= @@GLOBAL.binlog_gtid_index_page_size;
+SET @old_span_min= @@GLOBAL.binlog_gtid_index_span_min;
+
+--echo *** A fair amount of work with default GTID index settings.
+--let $NUM_POS= 200
+--let $NUM_DOMAIN= 5
+--let $NUM_SERVER= 5
+--let $NUM_SLAVE_CONNECTS= 50
+--let $RND_SEED= 42
+--source suite/rpl/include/rpl_gtid_index.inc
+
+--echo *** A lot of GTIDs with small btree pages to stress the Btree code.
+--let $NUM_POS= 1000
+--let $NUM_DOMAIN= 10
+--let $RND_SEED= 150
+SET GLOBAL binlog_gtid_index_page_size= 64;
+SET GLOBAL binlog_gtid_index_span_min= 1;
+--source suite/rpl/include/rpl_gtid_index.inc
+
+--echo *** Small page size with sparse index.
+--let $NUM_POS= 200
+--let $RND_SEED= 666
+SET GLOBAL binlog_gtid_index_page_size= 64;
+SET GLOBAL binlog_gtid_index_span_min= 2048;
+--source suite/rpl/include/rpl_gtid_index.inc
+
+--echo *** Medium page size.
+--let $NUM_POS= 200
+--let $RND_SEED= 1024
+SET GLOBAL binlog_gtid_index_page_size= 512;
+SET GLOBAL binlog_gtid_index_span_min= 512;
+--source suite/rpl/include/rpl_gtid_index.inc
+
+--echo *** Large page size.
+--let $NUM_POS= 200
+--let $RND_SEED= 12345
+SET GLOBAL binlog_gtid_index_page_size= 16384;
+SET GLOBAL binlog_gtid_index_span_min= 1;
+--source suite/rpl/include/rpl_gtid_index.inc
+
+
+# Cleanup.
+--connection master
+SET GLOBAL binlog_gtid_index_page_size= @old_page_size;
+SET GLOBAL binlog_gtid_index_span_min= @old_span_min;
+
+DROP TABLE t1;
+DROP FUNCTION gtid_eq;
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_master_promote.test b/mysql-test/suite/rpl/t/rpl_gtid_master_promote.test
index 064c70b1..5e2470ed 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_master_promote.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_master_promote.test
@@ -221,7 +221,8 @@ SELECT * FROM t4 ORDER BY a,b;
--connection server_1
--replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_2,
- master_user = "root", master_use_gtid = slave_pos, master_demote_to_slave=1;
+ master_user = "root", master_ssl_verify_server_cert=0,
+ master_use_gtid = slave_pos, master_demote_to_slave=1;
--source include/start_slave.inc
--sync_with_master
SELECT * FROM t1 ORDER BY a;
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test b/mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test
index f52e51c2..396ea5de 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test
@@ -24,7 +24,8 @@ reset slave all;
connection server_1;
--replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_2,
- master_user='root', MASTER_USE_GTID=SLAVE_POS, master_demote_to_slave=1;
+ master_user='root', master_ssl_verify_server_cert=0,
+ MASTER_USE_GTID=SLAVE_POS, master_demote_to_slave=1;
source include/start_slave.inc;
source include/wait_for_slave_to_start.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_mdev4485.test b/mysql-test/suite/rpl/t/rpl_gtid_mdev4485.test
index 6c37ceaf..7ee811ba 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_mdev4485.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_mdev4485.test
@@ -13,7 +13,7 @@ create table t2 (i int);
set default_master_connection = 'm2';
--replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2
-eval change master to master_host='127.0.0.1', master_port=$SERVER_MYPORT_2, master_user='root', master_use_gtid=slave_pos;
+eval change master to master_host='127.0.0.1', master_port=$SERVER_MYPORT_2, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
--source include/start_slave.inc
--connection server_2
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test b/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test
index 7f4d851f..79b3b7d4 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_mdev4820.test
@@ -59,7 +59,7 @@ SET GLOBAL gtid_slave_pos= '0-2-10';
--connection server_1
--replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2
eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SERVER_MYPORT_2,
- master_user= 'root', master_use_gtid=CURRENT_POS;
+ master_user= 'root', master_ssl_verify_server_cert=0, master_use_gtid=CURRENT_POS;
START SLAVE;
--connection server_2
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test b/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test
index e140f335..48627a6d 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_nobinlog.test
@@ -24,8 +24,8 @@ SELECT * FROM t1 ORDER BY a;
--connection server_1
--replace_result $SLAVE_MYPORT SLAVE_PORT
-eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SLAVE_MYPORT,
- master_user = 'root';
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $SLAVE_MYPORT, master_ssl_verify_server_cert=0,
+ master_user = 'root', master_ssl_verify_server_cert=0;
START SLAVE;
--source include/wait_for_slave_to_start.inc
@@ -49,7 +49,7 @@ INSERT INTO t1 VALUES (6, 1);
--connection server_2
--replace_result $MASTER_MYPORT MASTER_PORT
-eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT;
+eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT, master_ssl_verify_server_cert=0;
START SLAVE;
--source include/sync_with_master_gtid.inc
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_until_before_after_gtids.test b/mysql-test/suite/rpl/t/rpl_gtid_until_before_after_gtids.test
new file mode 100644
index 00000000..cf245ca0
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_gtid_until_before_after_gtids.test
@@ -0,0 +1,45 @@
+#
+# This test validates the behavior of SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS
+# of a slave's START SLAVE UNTIL command. Notably, it tests the following
+# scenarios:
+# 1. Single domain id in binary log with a single domain id in the UNTIL
+# condition
+# 2. Multiple domain ids in binary log with a single domain id in the UNTIL
+# condition
+# 3. Multiple domain ids in binary log with multiple domain ids in the UNTIL
+# condition
+# 4. A gap in the binary log with the UNTIL condition GTID pointed to the
+# missing transaction
+# 5. Syntax errors using the new options
+#
+#
+# References:
+# MDEV-27247: Add keywords "exclusive" and "inclusive" for START SLAVE UNTIL
+#
+
+--source include/have_innodb.inc
+--source include/have_log_bin.inc
+--source include/master-slave.inc
+
+--let $ssu_before_gtids=1
+--source include/rpl_gtid_until_before_after_gtids.test
+
+--let $ssu_before_gtids=0
+--source include/rpl_gtid_until_before_after_gtids.test
+
+--echo #
+--echo # Error Case 2: Providing both SQL_BEFORE_GTIDS and SQL_AFTER_GTIDS
+--echo # should result in a syntax error
+--connection slave
+--error ER_PARSE_ERROR
+START SLAVE UNTIL SQL_AFTER_GTIDS="0-1-1" SQL_BEFORE_GTIDS="0-1-1";
+
+--echo #
+--echo # Cleanup
+--source include/save_master_gtid.inc
+
+--connection slave
+--source include/sync_with_master_gtid.inc
+
+--source include/rpl_end.inc
+--echo # End of rpl_gtid_until_before_gtids.test
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat.test b/mysql-test/suite/rpl/t/rpl_heartbeat.test
index 8a852fd3..a34cf761 100644
--- a/mysql-test/suite/rpl/t/rpl_heartbeat.test
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat.test
@@ -106,7 +106,7 @@ connection slave;
set @@global.slave_net_timeout= 10;
--replace_result $MASTER_MYPORT MASTER_PORT
# no error this time but rather a warning
-eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root', master_heartbeat_period= 0.5;
+eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root', master_ssl_verify_server_cert=0, master_heartbeat_period= 0.5;
--query_vertical show status like 'Slave_heartbeat_period';
start slave;
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test b/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test
index 2c41fdee..156294ee 100644
--- a/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat_ssl.test
@@ -49,7 +49,7 @@ let $status_var_comparsion= >;
--echo *** Clean up ***
--source include/stop_slave.inc
CHANGE MASTER TO
- MASTER_SSL=0,
+ MASTER_SSL=1,
MASTER_SSL_CA='',
MASTER_SSL_CERT='',
MASTER_SSL_KEY='';
diff --git a/mysql-test/suite/rpl/t/rpl_invoked_features.test b/mysql-test/suite/rpl/t/rpl_invoked_features.test
index cd2b770c..0467a243 100644
--- a/mysql-test/suite/rpl/t/rpl_invoked_features.test
+++ b/mysql-test/suite/rpl/t/rpl_invoked_features.test
@@ -8,9 +8,8 @@
--source include/have_innodb.inc
--source include/master-slave.inc
-disable_query_log;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-enable_query_log;
+call mtr.add_suppression("Event Scheduler: .* Duplicate entry '10' for key 'a'");
# --disable_warnings/--enable_warnings added before/after query
# if one uses UUID() function because we need to avoid warnings
@@ -22,60 +21,35 @@ enable_query_log;
# Transactional engine
--let $engine_type2= innodb
-
-#
-# Clean up
-#
-
-USE test;
---disable_warnings
-DROP VIEW IF EXISTS v1,v11;
-DROP TABLE IF EXISTS t1,t2,t3,t11,t12,t13;
-DROP PROCEDURE IF EXISTS p1;
-DROP PROCEDURE IF EXISTS p11;
-DROP FUNCTION IF EXISTS f1;
-DROP FUNCTION IF EXISTS f2;
-DROP EVENT IF EXISTS e1;
-DROP EVENT IF EXISTS e11;
---enable_warnings
-
-
#
# Prepare objects (tables etc)
#
-# Create tables
+--echo # Create tables
---echo
eval CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b INT, c VARCHAR(64)) ENGINE=$engine_type;
INSERT INTO t1 VALUES (1,1,'1');
---disable_warnings
+--disable_warnings ONCE
INSERT INTO t1 VALUES (2,2,UUID());
---enable_warnings
eval CREATE TABLE t2 (a INT UNIQUE, b INT, c VARCHAR(64)) ENGINE=$engine_type;
INSERT INTO t2 VALUES (1,1,'1');
---disable_warnings
+--disable_warnings ONCE
INSERT INTO t2 VALUES (2,2,UUID());
---enable_warnings
eval CREATE TABLE t11 (a INT NOT NULL PRIMARY KEY, b INT, c VARCHAR(64)) ENGINE=$engine_type2;
INSERT INTO t11 VALUES (1,1,'1');
---disable_warnings
+--disable_warnings ONCE
INSERT INTO t11 VALUES (2,2,UUID());
---enable_warnings
eval CREATE TABLE t12 (a INT UNIQUE, b INT, c VARCHAR(64)) ENGINE=$engine_type2;
INSERT INTO t12 VALUES (1,1,'1');
---disable_warnings
+--disable_warnings ONCE
INSERT INTO t12 VALUES (2,2,UUID());
---enable_warnings
-# Create invoked features
---echo
-# Create view for tables t1,t11
+--echo # Create invoked features
+
CREATE VIEW v1 AS SELECT * FROM t1;
CREATE VIEW v11 AS SELECT * FROM t11;
-# Create triggers for t1,t11
DELIMITER |;
CREATE TRIGGER t1_tr1 BEFORE INSERT ON t1 FOR EACH ROW
@@ -102,11 +76,7 @@ BEGIN
UPDATE t13 SET c = '';
END|
-# Create events which will run every 10 sec
-# It cannot be much shorter as we have to ensure that a new
-# event is not scheduled before the DISABLE has been
-# executed.
-CREATE EVENT e1 ON SCHEDULE EVERY 10 SECOND DISABLE DO
+CREATE EVENT e1 ON SCHEDULE EVERY 1 SECOND DISABLE DO
BEGIN
ALTER EVENT e1 DISABLE;
CALL p1(10, '');
@@ -118,7 +88,6 @@ BEGIN
CALL p11(10, '');
END|
-# Create functions and procedures used for events
CREATE FUNCTION f1 (x INT) RETURNS VARCHAR(64)
BEGIN
IF x > 5 THEN
@@ -149,46 +118,39 @@ DELIMITER ;|
# Start test case
#
-# Do some actions for non-transactional tables
---echo
+--echo # Do some actions for non-transactional tables
CREATE TABLE t3 SELECT * FROM v1;
INSERT INTO t1 VALUES (3,3,'');
UPDATE t1 SET c='2' WHERE a = 1;
---disable_warnings
+--disable_warnings ONCE
INSERT INTO t1 VALUES(4,4,f1(4));
---enable_warnings
INSERT INTO t1 VALUES (100,100,'');
---disable_warnings
CALL p1(5, UUID());
---enable_warnings
INSERT INTO t1 VALUES (101,101,'');
---disable_warnings
+--disable_warnings ONCE
INSERT INTO t1 VALUES(6,6,f1(6));
---enable_warnings
INSERT INTO t1 VALUES (102,102,'');
---disable_warnings
+--disable_warnings ONCE
INSERT INTO t1 VALUES(7,7,f2(7));
---enable_warnings
INSERT INTO t1 VALUES (103,103,'');
-# Do some actions for transactional tables
---echo
---disable_warnings
+--echo # Do some actions for transactional tables
CREATE TABLE t13 SELECT * FROM v11;
INSERT INTO t11 VALUES (3,3,'');
UPDATE t11 SET c='2' WHERE a = 1;
+--disable_warnings ONCE
INSERT INTO t11 VALUES(4,4,f1(4));
INSERT INTO t11 VALUES (100,100,'');
CALL p11(5, UUID());
INSERT INTO t11 VALUES (101,101,'');
+--disable_warnings ONCE
INSERT INTO t11 VALUES(6,6,f1(6));
INSERT INTO t11 VALUES (102,102,'');
+--disable_warnings ONCE
INSERT INTO t11 VALUES(7,7,f2(7));
INSERT INTO t11 VALUES (103,103,'');
---enable_warnings
-# Scheduler is on
---echo
+--echo # Scheduler is on
# Temporally events fire sequentally due Bug#29020.
SET GLOBAL EVENT_SCHEDULER = on;
# Wait while events will executed
@@ -200,8 +162,7 @@ let $wait_condition= SELECT COUNT(*) = 1 FROM t11 WHERE t11.a = 10;
--source include/wait_condition.inc
SET GLOBAL EVENT_SCHEDULER = off;
-# Check original objects
---echo
+--echo # Check original objects
--sorted_result
SHOW TABLES LIKE 't%';
--sorted_result
@@ -232,8 +193,7 @@ SELECT a,b FROM v11 ORDER BY a;
--sync_slave_with_master slave
-# Check replicated objects
---echo
+--echo # Check replicated objects
--sorted_result
SHOW TABLES LIKE 't%';
--sorted_result
@@ -245,8 +205,7 @@ SELECT routine_type, routine_name FROM information_schema.routines WHERE routine
--sorted_result
SELECT event_name, status FROM information_schema.events WHERE event_schema='test';
-# Check replicated data
---echo
+--echo # Check replicated data
SELECT COUNT(*) FROM t1;
SELECT a,b FROM t1 ORDER BY a;
SELECT COUNT(*) FROM t2;
@@ -262,10 +221,8 @@ SELECT COUNT(*) FROM t13;
SELECT a,b FROM t13 ORDER BY a;
SELECT a,b FROM v11 ORDER BY a;
-# Remove UUID() before comparing and sort tables
-
--connection master
---echo
+--echo # Remove UUID() before comparing and sort tables
UPDATE t1 SET c='';
UPDATE t2 SET c='';
UPDATE t3 SET c='';
@@ -280,25 +237,19 @@ ALTER TABLE t13 ORDER BY a;
--sync_slave_with_master slave
-# Compare a data from master and slave
---echo
+--echo # Compare a data from master and slave
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_invoked_features_master.sql
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_invoked_features_slave.sql
--diff_files $MYSQLTEST_VARDIR/tmp/rpl_invoked_features_master.sql $MYSQLTEST_VARDIR/tmp/rpl_invoked_features_slave.sql
-
#
# Clean up
#
-# Remove dumps
---echo
--remove_file $MYSQLTEST_VARDIR/tmp/rpl_invoked_features_master.sql
--remove_file $MYSQLTEST_VARDIR/tmp/rpl_invoked_features_slave.sql
-# Remove tables,views,procedures,functions
--connection master
---echo
DROP VIEW IF EXISTS v1,v11;
DROP TABLE IF EXISTS t1,t2,t3,t11,t12,t13;
DROP PROCEDURE IF EXISTS p1;
diff --git a/mysql-test/suite/rpl/t/rpl_ip_mix.cnf b/mysql-test/suite/rpl/t/rpl_ip_mix.cnf
index 00e2637d..195bc57c 100644
--- a/mysql-test/suite/rpl/t/rpl_ip_mix.cnf
+++ b/mysql-test/suite/rpl/t/rpl_ip_mix.cnf
@@ -1,6 +1,5 @@
# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
-!include include/default_client.cnf
+!include include/default_my.cnf
[mysqld.1]
diff --git a/mysql-test/suite/rpl/t/rpl_ip_mix2.cnf b/mysql-test/suite/rpl/t/rpl_ip_mix2.cnf
index 306df437..5a247cbe 100644
--- a/mysql-test/suite/rpl/t/rpl_ip_mix2.cnf
+++ b/mysql-test/suite/rpl/t/rpl_ip_mix2.cnf
@@ -1,6 +1,5 @@
# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
-!include include/default_client.cnf
+!include include/default_my.cnf
[mysqld.1]
diff --git a/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.cnf b/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.cnf
index b646a408..ce31d05f 100644
--- a/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.cnf
+++ b/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.cnf
@@ -1,6 +1,5 @@
# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
-!include include/default_client.cnf
+!include include/default_my.cnf
[mysqld.1]
diff --git a/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test b/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test
index d17b32c3..2988cac9 100644
--- a/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test
+++ b/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test
@@ -60,4 +60,4 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
# clean up
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0;
diff --git a/mysql-test/suite/rpl/t/rpl_ipv6.cnf b/mysql-test/suite/rpl/t/rpl_ipv6.cnf
index 6bf97a94..52b2a80a 100644
--- a/mysql-test/suite/rpl/t/rpl_ipv6.cnf
+++ b/mysql-test/suite/rpl/t/rpl_ipv6.cnf
@@ -1,6 +1,5 @@
# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
-!include include/default_client.cnf
+!include include/default_my.cnf
[mysqld.1]
diff --git a/mysql-test/suite/rpl/t/rpl_ipv6.test b/mysql-test/suite/rpl/t/rpl_ipv6.test
index f3795832..c68255a1 100644
--- a/mysql-test/suite/rpl/t/rpl_ipv6.test
+++ b/mysql-test/suite/rpl/t/rpl_ipv6.test
@@ -46,4 +46,4 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
# clean up
-CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root';
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0;
diff --git a/mysql-test/suite/rpl/t/rpl_known_bugs_detection-master.opt b/mysql-test/suite/rpl/t/rpl_known_bugs_detection-master.opt
index d4ba386a..5cbc1f9d 100644
--- a/mysql-test/suite/rpl/t/rpl_known_bugs_detection-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_known_bugs_detection-master.opt
@@ -1 +1 @@
---loose-debug=d,pretend_version_50034_in_binlog
+--loose-debug-dbug=d,pretend_version_50034_in_binlog
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_fatal-slave.opt b/mysql-test/suite/rpl/t/rpl_loaddata_fatal-slave.opt
index 9c846c79..39a1271c 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_fatal-slave.opt
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_fatal-slave.opt
@@ -1 +1 @@
---loose-debug=+d,LOAD_DATA_INFILE_has_fatal_error
+--loose-debug-dbug=+d,LOAD_DATA_INFILE_has_fatal_error
diff --git a/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test b/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test
index 7e313b37..c3a7055d 100644
--- a/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test
+++ b/mysql-test/suite/rpl/t/rpl_mariadb_slave_capability.test
@@ -28,7 +28,6 @@ CHANGE MASTER TO MASTER_USE_GTID=NO;
--let $wait_condition= select count(*)=1 from information_schema.processlist where state LIKE '%Master has sent all binlog to slave%' and command='Binlog Dump'
--source include/wait_condition.inc
-
--connection slave
--source include/stop_slave.inc
--echo # Test slave with no capability gets dummy event, which is ignored.
diff --git a/mysql-test/suite/rpl/t/rpl_master_pos_wait.test b/mysql-test/suite/rpl/t/rpl_master_pos_wait.test
index 437d8412..e815502d 100644
--- a/mysql-test/suite/rpl/t/rpl_master_pos_wait.test
+++ b/mysql-test/suite/rpl/t/rpl_master_pos_wait.test
@@ -34,7 +34,7 @@ select master_pos_wait('foo', 98);
--source include/stop_slave.inc
reset slave all;
--replace_result $MASTER_MYPORT MASTER_MYPORT
-eval change master 'my_slave' to master_port=$MASTER_MYPORT, master_host='127.0.0.1', master_user='root';
+eval change master 'my_slave' to master_port=$MASTER_MYPORT, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0;
set default_master_connection = 'my_slave';
--source include/start_slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_mdev33798.test b/mysql-test/suite/rpl/t/rpl_mdev33798.test
index 1448ed91..76d2de26 100644
--- a/mysql-test/suite/rpl/t/rpl_mdev33798.test
+++ b/mysql-test/suite/rpl/t/rpl_mdev33798.test
@@ -101,7 +101,7 @@ SELECT a, (
--connection server_2
--source include/stop_slave.inc
--replace_result $SERVER_MYPORT_3 MYPORT_3
-eval CHANGE MASTER 'm2' to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+eval CHANGE MASTER 'm2' to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos, master_ssl_verify_server_cert=0;
--connection server_1
diff --git a/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test b/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test
index f44c883e..dab2e3f6 100644
--- a/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test
+++ b/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test
@@ -55,7 +55,7 @@ connection master;
--exec $MYSQL_UPGRADE --skip-verbose --write-binlog --force --user=root > $MYSQLTEST_VARDIR/log/mysql_upgrade.log 2>&1
let $datadir= `select @@datadir`;
-remove_file $datadir/mysql_upgrade_info;
+remove_file $datadir/mariadb_upgrade_info;
connection master;
let $after_file= query_get_value(SHOW MASTER STATUS, File, 1);
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test b/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test
index 09da8c2d..2cf18cd2 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test
@@ -272,7 +272,7 @@ eval SELECT IF($retry1=$retry2, "Ok, no retry",
SET @old_format= @@GLOBAL.binlog_format;
# Use MIXED format; we cannot binlog ROW events on slave in STATEMENT format.
SET GLOBAL binlog_format= MIXED;
-SET @old_isolation= @@GLOBAL.tx_isolation;
+SET @old_isolation= @@GLOBAL.transaction_isolation;
SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
# Reset the worker threads to make the new settings take effect.
SET GLOBAL slave_parallel_threads=0;
@@ -317,7 +317,7 @@ SELECT * FROM t2 ORDER BY a;
--source include/stop_slave.inc
SET GLOBAL binlog_format= @old_format;
-SET GLOBAL tx_isolation= @old_isolation;
+SET GLOBAL transaction_isolation= @old_isolation;
--source include/start_slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_optimistic_nobinlog.test b/mysql-test/suite/rpl/t/rpl_parallel_optimistic_nobinlog.test
index ee0de499..b8df2ffa 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel_optimistic_nobinlog.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel_optimistic_nobinlog.test
@@ -14,7 +14,7 @@ INSERT INTO t2 VALUES (1,0), (2,0);
--connection server_2
--sync_with_master
-SET @old_isolation= @@GLOBAL.tx_isolation;
+SET @old_isolation= @@GLOBAL.transaction_isolation;
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
--source include/stop_slave.inc
SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
@@ -62,7 +62,7 @@ SELECT * FROM t2 ORDER BY a;
--connection server_2
--source include/stop_slave.inc
-SET GLOBAL tx_isolation= @old_isolation;
+SET GLOBAL transaction_isolation= @old_isolation;
SET GLOBAL slave_parallel_mode=@old_parallel_mode;
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
--source include/start_slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_worker.test b/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_worker.test
index 5ef28a62..72559fc4 100644
--- a/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_worker.test
+++ b/mysql-test/suite/rpl/t/rpl_perfschema_applier_status_by_worker.test
@@ -52,7 +52,7 @@ set @save_slave_parallel_workers= @@global.slave_parallel_workers;
# to avoid warnings
set @save_slave_transaction_retries= @@global.slave_transaction_retries;
RESET SLAVE ALL;
-evalp CHANGE MASTER 'slave1' TO MASTER_USER='root',MASTER_PORT=$MASTER_MYPORT, MASTER_HOST='127.0.0.1', MASTER_USE_GTID=slave_pos;
+evalp CHANGE MASTER 'slave1' TO MASTER_USER='root',MASTER_PORT=$MASTER_MYPORT, MASTER_HOST='127.0.0.1', MASTER_USE_GTID=slave_pos, MASTER_SSL_VERIFY_SERVER_CERT=0;
SET default_master_connection='slave1';
SET @@global.slave_parallel_workers=1;
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
diff --git a/mysql-test/suite/rpl/t/rpl_perfschema_connect_config.test b/mysql-test/suite/rpl/t/rpl_perfschema_connect_config.test
index 7b2bf8d5..e2b974c1 100644
--- a/mysql-test/suite/rpl/t/rpl_perfschema_connect_config.test
+++ b/mysql-test/suite/rpl/t/rpl_perfschema_connect_config.test
@@ -161,7 +161,6 @@ grant replication slave on *.* to replssl@localhost require ssl;
# Setup slave to use SSL for connection to master
--source include/stop_slave.inc
replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR;
-replace_column 2 ####;
eval change master to
master_user= 'replssl',
master_password= '',
@@ -232,7 +231,7 @@ CHANGE MASTER TO
master_ssl_cert= '',
master_ssl_key= '',
master_ssl_verify_server_cert=0,
- master_ssl=0,
+ master_ssl=1,
master_use_gtid=no;
--source include/start_slave.inc
@@ -244,7 +243,6 @@ CHANGE MASTER TO
--echo # 1) Test for MASTER_USE_GTID=NO
--echo
--source include/stop_slave.inc
-replace_column 2 ####;
change master to
master_user = 'root',
master_use_gtid = NO;
@@ -258,7 +256,6 @@ source include/assert.inc;
--echo
--echo # 2) Test for Auto_position= CURRENT_POS.
--echo
-replace_column 2 ####;
change master to
master_user = 'root',
master_use_gtid= CURRENT_POS;
@@ -272,7 +269,6 @@ source include/assert.inc;
--echo
--echo # 3) Test for Auto_position= SLAVE_POS
--echo
-replace_column 2 ####;
change master to
master_user = 'root',
master_use_gtid= SLAVE_POS;
diff --git a/mysql-test/suite/rpl/t/rpl_rewrite_db_sys_vars.test b/mysql-test/suite/rpl/t/rpl_rewrite_db_sys_vars.test
index fab78a92..1b2d2be1 100644
--- a/mysql-test/suite/rpl/t/rpl_rewrite_db_sys_vars.test
+++ b/mysql-test/suite/rpl/t/rpl_rewrite_db_sys_vars.test
@@ -121,7 +121,7 @@ connection slave;
--let $rpl_server_number= 2
--source include/rpl_restart_server.inc
--replace_result $MASTER_MYPORT MASTER_MYPORT
-eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root';
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root', MASTER_SSL_VERIFY_SERVER_CERT=0;
# New value
connection slave;
diff --git a/mysql-test/suite/rpl/t/rpl_rotate_logs.test b/mysql-test/suite/rpl/t/rpl_rotate_logs.test
index 4dd58931..98016667 100644
--- a/mysql-test/suite/rpl/t/rpl_rotate_logs.test
+++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.test
@@ -50,7 +50,7 @@ start slave;
eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
reset slave;
--replace_result $MASTER_MYPORT MASTER_PORT
-eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
+eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root', master_ssl_verify_server_cert=0;
connection master;
reset master;
connection slave;
diff --git a/mysql-test/suite/rpl/t/rpl_row_4_bytes-master.opt b/mysql-test/suite/rpl/t/rpl_row_4_bytes-master.opt
index 3073fa4f..b3f3d539 100644
--- a/mysql-test/suite/rpl/t/rpl_row_4_bytes-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_row_4_bytes-master.opt
@@ -1,2 +1,2 @@
---loose-debug=d,"old_row_based_repl_4_byte_map_id_master"
+--loose-debug-dbug=d,"old_row_based_repl_4_byte_map_id_master"
--log-bin-use-v1-row-events=1
diff --git a/mysql-test/suite/rpl/t/rpl_row_end_of_statement_loss.test b/mysql-test/suite/rpl/t/rpl_row_end_of_statement_loss.test
index 5b2d99f3..97bbc84f 100644
--- a/mysql-test/suite/rpl/t/rpl_row_end_of_statement_loss.test
+++ b/mysql-test/suite/rpl/t/rpl_row_end_of_statement_loss.test
@@ -7,7 +7,7 @@
call mtr.add_suppression("Slave IO thread did not receive an expected Rows-log end-of-statement");
call mtr.add_suppression("Relay log write failure: could not queue event from master");
-SET @save_debug= @@global.debug;
+SET @save_debug= @@global.debug_dbug;
SET GLOBAL debug_dbug="+d,simulate_stmt_end_rows_event_loss";
--source include/stop_slave.inc
--replace_result $MASTER_MYPORT MASTER_PORT
diff --git a/mysql-test/suite/rpl/t/rpl_row_img.cnf b/mysql-test/suite/rpl/t/rpl_row_img.cnf
index ed9a4292..62b5c99c 100644
--- a/mysql-test/suite/rpl/t/rpl_row_img.cnf
+++ b/mysql-test/suite/rpl/t/rpl_row_img.cnf
@@ -1,4 +1,4 @@
-!include include/default_mysqld.cnf
+!include include/default_my.cnf
[mysqld.1]
log-slave-updates
diff --git a/mysql-test/suite/rpl/t/rpl_row_img_blobs.test b/mysql-test/suite/rpl/t/rpl_row_img_blobs.test
index 21f224f5..a4f26fda 100644
--- a/mysql-test/suite/rpl/t/rpl_row_img_blobs.test
+++ b/mysql-test/suite/rpl/t/rpl_row_img_blobs.test
@@ -47,6 +47,14 @@
-- let $row_img_test_script= include/rpl_row_img_blobs.test
-- source include/rpl_row_img_general_loop.inc
+## FULL_NODUP
+
+-- let $row_img_set=server_1:FULL_NODUP:N,server_2:FULL_NODUP:Y,server_3:FULL_NODUP:Y
+-- source include/rpl_row_img_set.inc
+
+-- let $row_img_test_script= include/rpl_row_img_blobs.test
+-- source include/rpl_row_img_general_loop.inc
+
## FULL
-- let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y
diff --git a/mysql-test/suite/rpl/t/rpl_row_img_eng_full_nodup.cnf b/mysql-test/suite/rpl/t/rpl_row_img_eng_full_nodup.cnf
new file mode 100644
index 00000000..d758d29f
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_img_eng_full_nodup.cnf
@@ -0,0 +1 @@
+!include suite/rpl/t/rpl_row_img.cnf
diff --git a/mysql-test/suite/rpl/t/rpl_row_img_eng_full_nodup.test b/mysql-test/suite/rpl/t/rpl_row_img_eng_full_nodup.test
new file mode 100644
index 00000000..f4a53a38
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_img_eng_full_nodup.test
@@ -0,0 +1,67 @@
+#Want to skip this test from daily Valgrind execution
+--source include/no_valgrind_without_big.inc
+#
+# This file contains tests for FULL_NODUP row image mode
+#
+
+--let $rpl_topology= 1->2->3
+--source include/rpl_init.inc
+-- source include/have_binlog_format_row.inc
+
+-- connection server_1
+-- source include/have_innodb.inc
+-- connection server_2
+-- source include/have_innodb.inc
+-- connection server_3
+-- source include/have_innodb.inc
+-- connection server_1
+
+# Tests for different storage engines on each server,
+# but same index structure on tables. The tests are conducted
+# using FULL_NODUP binlog-row-image on all servers.
+#
+
+-- let $row_img_set=server_1:FULL_NODUP:N,server_2:FULL_NODUP:Y,server_3:FULL_NODUP:Y
+-- source include/rpl_row_img_set.inc
+
+-- let $row_img_test_script= include/rpl_row_img.test
+-- source include/rpl_row_img_general_loop.inc
+
+################################################################################
+# MDEV-33049 Assertion `marked_for_write_or_computed()' failed in bool
+# Field_new_decimal::store_value(const my_decimal*, int*)
+#
+# In FULL_NODUP mode, the before image has all fields and the after image has
+# only updated fields. Crash happened when slave was unpacking a row event
+# if the new decimal field is null in the before image.
+################################################################################
+CREATE TABLE t1(c1 INT NOT NULL PRIMARY KEY, c2 varchar(10) DEFAULT NULL,
+ c3 decimal(12,4) DEFAULT NULL);
+INSERT INTO t1(c1) VALUES (1);
+--source include/save_master_pos.inc
+--let $datadir= `SELECT @@datadir`
+
+# It will generate a row event that c3 is only in before image and it is null.
+UPDATE t1 SET c2 = 'c2';
+
+# the UPDATE will crash the slave without this fix.
+--source include/rpl_sync.inc
+
+FLUSH BINARY LOGS;
+UPDATE t1 SET c2 = "c2_new";
+
+--echo # Use 'BINLOG' statement to apply the first update row event
+--echo # BINLOG statement is same to slave applier, it should work well.
+--exec $MYSQL_BINLOG --start-position=$_master_pos $datadir$_master_file > $MYSQLTEST_VARDIR/tmp/binlog.sql
+--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/binlog.sql
+
+--echo # After 'BINLOG' statement c2's value should be "c2"
+SELECT * FROM t1;
+
+--remove_file $MYSQLTEST_VARDIR/tmp/binlog.sql
+DROP TABLE t1;
+
+-- let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y
+-- source include/rpl_row_img_set.inc
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_img_full_nodup.cnf b/mysql-test/suite/rpl/t/rpl_row_img_full_nodup.cnf
new file mode 100644
index 00000000..d758d29f
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_img_full_nodup.cnf
@@ -0,0 +1 @@
+!include suite/rpl/t/rpl_row_img.cnf
diff --git a/mysql-test/suite/rpl/t/rpl_row_img_full_nodup.test b/mysql-test/suite/rpl/t/rpl_row_img_full_nodup.test
new file mode 100644
index 00000000..12ec91bf
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_img_full_nodup.test
@@ -0,0 +1,34 @@
+#Want to skip this test from daily Valgrind execution
+--source include/no_valgrind_without_big.inc
+#
+# This file contains tests for FULL_NODUP row image mode
+#
+
+--let $rpl_topology= 1->2->3
+--source include/rpl_init.inc
+-- source include/have_binlog_format_row.inc
+
+-- connection server_1
+-- source include/have_innodb.inc
+-- connection server_2
+-- source include/have_innodb.inc
+-- connection server_3
+-- source include/have_innodb.inc
+-- connection server_1
+
+# Tests for different storage engines on each server,
+# but same index structure on tables. The tests are conducted
+# using FULL_NODUP binlog-row-image on all servers.
+#
+
+-- let $row_img_set=server_1:FULL_NODUP:N,server_2:FULL_NODUP:Y,server_3:FULL_NODUP:Y
+-- source include/rpl_row_img_set.inc
+
+-- let $row_img_test_script= include/rpl_row_img.test
+-- source include/rpl_row_img_general_loop.inc
+
+-- let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y
+-- source include/rpl_row_img_set.inc
+
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_img_sequence_full.cnf b/mysql-test/suite/rpl/t/rpl_row_img_sequence_full.cnf
index 7104b4e4..7d48e441 100644
--- a/mysql-test/suite/rpl/t/rpl_row_img_sequence_full.cnf
+++ b/mysql-test/suite/rpl/t/rpl_row_img_sequence_full.cnf
@@ -1,4 +1,4 @@
-!include include/default_mysqld.cnf
+!include include/default_my.cnf
[mysqld.1]
log-slave-updates
diff --git a/mysql-test/suite/rpl/t/rpl_row_img_sequence_full_nodup.cnf b/mysql-test/suite/rpl/t/rpl_row_img_sequence_full_nodup.cnf
new file mode 100644
index 00000000..7d48e441
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_img_sequence_full_nodup.cnf
@@ -0,0 +1,21 @@
+!include include/default_my.cnf
+
+[mysqld.1]
+log-slave-updates
+innodb
+gtid_domain_id=0
+
+[mysqld.2]
+log-slave-updates
+innodb
+gtid_domain_id=1
+
+[mysqld.3]
+log-slave-updates
+innodb
+gtid_domain_id=2
+
+[ENV]
+SERVER_MYPORT_1= @mysqld.1.port
+SERVER_MYPORT_2= @mysqld.2.port
+SERVER_MYPORT_3= @mysqld.3.port
diff --git a/mysql-test/suite/rpl/t/rpl_row_img_sequence_full_nodup.test b/mysql-test/suite/rpl/t/rpl_row_img_sequence_full_nodup.test
new file mode 100644
index 00000000..cc3c7df0
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_row_img_sequence_full_nodup.test
@@ -0,0 +1,51 @@
+#
+# Purpose:
+# The rpl_row_img_sequence group of tests verify that sequence MDL updates,
+# i.e. NEXTVAL and SETVAL, respect the binlog_row_image variable value when
+# written into the binary log. In particular, it ensures that only changed
+# columns are written with MINIMAL image mode, and all columns are written
+# otherwise. This test focuses on validating the behavior of
+# binlog_row_img=FULL_NODUP.
+#
+# Methodology
+# After issuing a sequence update, ensure that both 1) it was replicated
+# correctly, and 2) it was binlogged respective to the binlog_row_image value.
+# The sequence table does not use caching to ensure each update is immediately
+# binlogged. Each command is binlogged into its own unique log file, and the
+# entirety of the file is analyzed for correctness of its sequence event.
+# Specifically, mysqlbinlog is used in verbose mode so it outputs the columns
+# which belong to the event, and the columns are analyzed to ensure the correct
+# ones were logged. rpl_row_img_general_loop.inc is used to test with multiple
+# chained replicas, varying engines between InnoDB and MyISAM.
+#
+# References:
+# MDEV-28487: sequences not respect value of binlog_row_image with select
+# nextval(seq_gen)
+#
+
+--let $rpl_topology= 1->2->3
+--source include/rpl_init.inc
+--source include/have_binlog_format_row.inc
+
+--connection server_1
+--source include/have_innodb.inc
+--connection server_2
+--source include/have_innodb.inc
+--connection server_3
+--source include/have_innodb.inc
+--connection server_1
+
+--echo #
+--echo # binlog_row_image=FULL_NODUP should write all columns to the binary log
+--echo #
+--let $row_img_set=server_1:FULL_NODUP:N,server_2:FULL_NODUP:Y,server_3:FULL_NODUP:Y
+--source include/rpl_row_img_set.inc
+--let $expected_columns=(1,2,3,4,5,6,7,8)
+--let row_img_test_script= include/rpl_row_img_sequence.inc
+--source include/rpl_row_img_general_loop.inc
+
+--let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y
+--source include/rpl_row_img_set.inc
+
+--source include/rpl_end.inc
+--echo # End of tests
diff --git a/mysql-test/suite/rpl/t/rpl_row_img_sequence_min.cnf b/mysql-test/suite/rpl/t/rpl_row_img_sequence_min.cnf
index 7104b4e4..7d48e441 100644
--- a/mysql-test/suite/rpl/t/rpl_row_img_sequence_min.cnf
+++ b/mysql-test/suite/rpl/t/rpl_row_img_sequence_min.cnf
@@ -1,4 +1,4 @@
-!include include/default_mysqld.cnf
+!include include/default_my.cnf
[mysqld.1]
log-slave-updates
diff --git a/mysql-test/suite/rpl/t/rpl_row_img_sequence_noblob.cnf b/mysql-test/suite/rpl/t/rpl_row_img_sequence_noblob.cnf
index 7104b4e4..7d48e441 100644
--- a/mysql-test/suite/rpl/t/rpl_row_img_sequence_noblob.cnf
+++ b/mysql-test/suite/rpl/t/rpl_row_img_sequence_noblob.cnf
@@ -1,4 +1,4 @@
-!include include/default_mysqld.cnf
+!include include/default_my.cnf
[mysqld.1]
log-slave-updates
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_cond_var_per_thd.cnf b/mysql-test/suite/rpl/t/rpl_semi_sync_cond_var_per_thd.cnf
index e8e03e71..1f7fa7b4 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync_cond_var_per_thd.cnf
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_cond_var_per_thd.cnf
@@ -2,9 +2,6 @@
[mysqld.1]
log-warnings=9
-rpl_semi_sync_master_enabled=1
-rpl_semi_sync_master_wait_point=AFTER_COMMIT
[mysqld.2]
log-warnings=9
-rpl_semi_sync_slave_enabled=1
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_cond_var_per_thd.test b/mysql-test/suite/rpl/t/rpl_semi_sync_cond_var_per_thd.test
index 65b6e8b4..0567d8a5 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync_cond_var_per_thd.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_cond_var_per_thd.test
@@ -26,15 +26,26 @@
--connection master
call mtr.add_suppression("Got an error reading communication packets");
+call mtr.add_suppression("Could not read packet:.* vio_errno: 1158");
+call mtr.add_suppression("Could not write packet:.* vio_errno: 1160");
+set @save_semi_sync_master_enabled= @@global.rpl_semi_sync_master_enabled;
+set @save_semi_sync_wp= @@global.rpl_semi_sync_master_wait_point;
set @save_bgc_count= @@global.binlog_commit_wait_count;
set @save_bgc_usec= @@global.binlog_commit_wait_usec;
set @save_debug_dbug= @@global.debug_dbug;
set @@global.binlog_commit_wait_count=3;
set @@global.binlog_commit_wait_usec=10000000;
set @@global.debug_dbug="+d,testing_cond_var_per_thd";
+set @@global.rpl_semi_sync_master_enabled= 1;
+set @@global.rpl_semi_sync_master_wait_point= AFTER_COMMIT;
--echo # Ensure semi-sync is on
--connection slave
+set @save_semi_sync_slave_enabled= @@global.rpl_semi_sync_master_enabled;
+--source include/stop_slave.inc
+set @@global.rpl_semi_sync_slave_enabled=1;
+--source include/start_slave.inc
+
let $status_var= rpl_semi_sync_slave_status;
let $status_var_value= ON;
source include/wait_for_status_var.inc;
@@ -66,12 +77,25 @@ source include/wait_for_status_var.inc;
--let $assert_only_after=CURRENT_TEST
--source include/assert_grep.inc
+--sync_slave_with_master
+
+
--echo #
--echo # Cleanup
--connection master
set @@global.binlog_commit_wait_count=@save_bgc_count;
set @@global.binlog_commit_wait_usec=@save_bgc_usec;
set @@global.debug_dbug=@save_debug_dbug;
+set @@global.rpl_semi_sync_master_enabled= @save_semi_sync_master_enabled;
+set @@global.rpl_semi_sync_master_wait_point= @save_semi_sync_wp;
+
+--connection slave
+--source include/stop_slave.inc
+set @@global.rpl_semi_sync_slave_enabled= @save_semi_sync_slave_enabled;
+--source include/start_slave.inc
+
+--connection master
drop table t1, t2, t3;
+--sync_slave_with_master
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_crash.inc b/mysql-test/suite/rpl/t/rpl_semi_sync_crash.inc
index bb705d39..1bb5ff9f 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync_crash.inc
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_crash.inc
@@ -118,7 +118,7 @@ if (`select $server_to_crash = 2`)
{
--let $master_port=$SERVER_MYPORT_1
}
-evalp CHANGE MASTER TO master_host='127.0.0.1', master_port=$new_master_port, master_user='root', master_use_gtid=SLAVE_POS;
+evalp CHANGE MASTER TO master_host='127.0.0.1', master_port=$new_master_port, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=SLAVE_POS;
set global rpl_semi_sync_slave_enabled = 1;
set @@global.gtid_slave_pos=@@global.gtid_binlog_pos;
--source include/start_slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_slave_reply_fail.test b/mysql-test/suite/rpl/t/rpl_semi_sync_slave_reply_fail.test
index 84462ed6..30aeea48 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync_slave_reply_fail.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_slave_reply_fail.test
@@ -40,7 +40,7 @@ create table t1 (i int);
--connection slave
set global rpl_semi_sync_slave_enabled = ON;
CALL mtr.add_suppression("Semi-sync slave net_flush*");
-SET @save_debug= @@global.debug;
+SET @save_debug= @@global.debug_dbug;
SET GLOBAL debug_dbug="+d,semislave_failed_net_flush";
--source include/start_slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_semisync_ali_issues.test b/mysql-test/suite/rpl/t/rpl_semisync_ali_issues.test
index c5c1daa4..ba9c5f04 100644
--- a/mysql-test/suite/rpl/t/rpl_semisync_ali_issues.test
+++ b/mysql-test/suite/rpl/t/rpl_semisync_ali_issues.test
@@ -284,7 +284,7 @@ INSERT INTO t1 VALUES (2);
show status like 'Rpl_semi_sync_master_clients';
--echo # Test failure of select error .
-SET GLOBAL debug = 'd,rpl_semisync_simulate_select_error';
+SET GLOBAL debug_dbug = 'd,rpl_semisync_simulate_select_error';
# It can still receive ACK from semi-sync slave
INSERT INTO t1 VALUES(3);
sync_slave_with_master;
@@ -292,7 +292,7 @@ sync_slave_with_master;
connection con1;
--echo # Test failure of pthread_create
SET GLOBAL rpl_semi_sync_master_enabled = 0;
-SET GLOBAL debug = 'd,rpl_semisync_simulate_create_thread_failure';
+SET GLOBAL debug_dbug = 'd,rpl_semisync_simulate_create_thread_failure';
SET GLOBAL rpl_semi_sync_master_enabled= ON;
--let $wait_condition= SELECT @@global.rpl_semi_sync_master_enabled = 0
@@ -300,7 +300,7 @@ SET GLOBAL rpl_semi_sync_master_enabled= ON;
# Todo: implement the thread join failure simulation
--echo # Test failure of pthread_join
-#SET GLOBAL DEBUG = 'd,rpl_semisync_simulate_thread_join_failure';
+#SET GLOBAL DEBUG_DBUG = 'd,rpl_semisync_simulate_thread_join_failure';
#SET GLOBAL rpl_semi_sync_master_enabled= ON;
#
#--let $wait_condition= SELECT @@global.rpl_semi_sync_master_enabled = 0
@@ -310,7 +310,7 @@ SET GLOBAL rpl_semi_sync_master_enabled= OFF;
--echo #
--echo # Failure on registering semisync slave
--echo #
-SET GLOBAL debug= 'd,rpl_semisync_simulate_add_slave_failure';
+SET GLOBAL debug_dbug= 'd,rpl_semisync_simulate_add_slave_failure';
SET GLOBAL rpl_semi_sync_master_enabled= ON;
connection slave;
@@ -324,7 +324,7 @@ connection con1;
# Todo: implement the add_slave_failure simulation. Meanwhile
# the status will be 1.
# show status like 'Rpl_semi_sync_master_clients';
-SET GLOBAL debug='';
+SET GLOBAL debug_dbug='';
--let $status_var= Rpl_semi_sync_master_clients
--let $status_var_value= 1
@@ -423,6 +423,5 @@ SET GLOBAL rpl_semi_sync_master_enabled = 0;
DROP TABLE t1;
connection slave;
SET GLOBAL rpl_semi_sync_slave_enabled = 0;
-stop slave;start slave;
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_set_statement_default_master.test b/mysql-test/suite/rpl/t/rpl_set_statement_default_master.test
index d30da61b..e121e7ba 100644
--- a/mysql-test/suite/rpl/t/rpl_set_statement_default_master.test
+++ b/mysql-test/suite/rpl/t/rpl_set_statement_default_master.test
@@ -22,7 +22,9 @@ eval SET STATEMENT default_master_connection = 'm1' FOR
RESET SLAVE ALL;
--replace_result $MASTER_MYPORT MASTER_MYPORT
-eval CHANGE MASTER 'm1' TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root';
+eval CHANGE MASTER 'm1' TO MASTER_HOST='127.0.0.1',
+ MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root',
+ MASTER_SSL_VERIFY_SERVER_CERT=0;
SET STATEMENT default_master_connection = 'm1' FOR START SLAVE;
set default_master_connection = 'm1';
diff --git a/mysql-test/suite/rpl/t/rpl_show_slave_hosts.test b/mysql-test/suite/rpl/t/rpl_show_slave_hosts.test
index 84c5c215..afac2984 100644
--- a/mysql-test/suite/rpl/t/rpl_show_slave_hosts.test
+++ b/mysql-test/suite/rpl/t/rpl_show_slave_hosts.test
@@ -15,7 +15,7 @@ connect (slave2,127.0.0.1,root,,test,$SLAVE_MYPORT2,);
connection slave2;
RESET SLAVE;
--replace_result $MASTER_MYPORT MASTER_PORT
---eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$MASTER_MYPORT,master_user='root'
+--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$MASTER_MYPORT,master_user='root', master_ssl_verify_server_cert=0
START SLAVE IO_THREAD;
source include/wait_for_slave_io_to_start.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_skip_incident-master.opt b/mysql-test/suite/rpl/t/rpl_skip_incident-master.opt
index 912801de..4e746bf1 100644
--- a/mysql-test/suite/rpl/t/rpl_skip_incident-master.opt
+++ b/mysql-test/suite/rpl/t/rpl_skip_incident-master.opt
@@ -1 +1 @@
---loose-debug=+d,incident_database_resync_on_replace
+--loose-debug-dbug=+d,incident_database_resync_on_replace
diff --git a/mysql-test/suite/rpl/t/rpl_slave_shutdown_mdev20821.test b/mysql-test/suite/rpl/t/rpl_slave_shutdown_mdev20821.test
index 6f73de98..1179d7bf 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_shutdown_mdev20821.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_shutdown_mdev20821.test
@@ -23,7 +23,7 @@ set default_master_connection = '';
set default_master_connection = 'm2';
--replace_result $SERVER_MYPORT_2 SERVER_MYPORT_2
-eval change master to master_host='127.0.0.1', master_port=$SERVER_MYPORT_2, master_user='root', master_use_gtid=slave_pos;
+eval change master to master_host='127.0.0.1', master_port=$SERVER_MYPORT_2, master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
--source include/start_slave.inc
select @@global.slave_parallel_workers as two;
diff --git a/mysql-test/suite/rpl/t/rpl_ssl.test b/mysql-test/suite/rpl/t/rpl_ssl.test
index 0420a6c8..ad9a191d 100644
--- a/mysql-test/suite/rpl/t/rpl_ssl.test
+++ b/mysql-test/suite/rpl/t/rpl_ssl.test
@@ -106,7 +106,7 @@ sync_slave_with_master;
--source include/stop_slave.inc
CHANGE MASTER TO
master_user = 'root',
- master_ssl = 0,
+ master_ssl = 1,
master_ssl_ca = '',
master_ssl_cert = '',
master_ssl_key = '';
diff --git a/mysql-test/suite/rpl/t/rpl_ssl1.test b/mysql-test/suite/rpl/t/rpl_ssl1.test
index 04f6cfff..0caaae25 100644
--- a/mysql-test/suite/rpl/t/rpl_ssl1.test
+++ b/mysql-test/suite/rpl/t/rpl_ssl1.test
@@ -16,7 +16,7 @@ sync_slave_with_master;
#trying to use this user without ssl
stop slave;
--source include/wait_for_slave_to_stop.inc
-change master to master_user='replssl',master_password='';
+change master to master_user='replssl',master_password='',master_ssl=0;
start slave;
#showing that replication don't work
@@ -34,7 +34,11 @@ select * from t1;
--source include/stop_slave_sql.inc
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
-eval change master to master_ssl=1 , master_ssl_ca ='$MYSQL_TEST_DIR/std_data/cacert.pem', master_ssl_cert='$MYSQL_TEST_DIR/std_data/client-cert.pem', master_ssl_key='$MYSQL_TEST_DIR/std_data/client-key.pem';
+eval change master to
+ master_ssl=1,
+ master_ssl_ca ='$MYSQL_TEST_DIR/std_data/cacert.pem',
+ master_ssl_cert='$MYSQL_TEST_DIR/std_data/client-cert.pem',
+ master_ssl_key='$MYSQL_TEST_DIR/std_data/client-key.pem';
start slave;
--source include/wait_for_slave_to_start.inc
@@ -85,28 +89,53 @@ create table t1 (t int);
insert into t1 values (1);
sync_slave_with_master;
-
-echo on slave;
-#checking that replication is ok
select * from t1;
#checking show slave status
source include/show_slave_status.inc;
--source include/check_slave_is_running.inc
-# ==== Clean up ====
+# MDEV-31855 validate with master_password
+connection master;
+create user replssl@127.0.0.1 identified by "sslrepl";
+grant replication slave on *.* to replssl@127.0.0.1 require ssl;
+connection slave;
+stop slave;
+--source include/wait_for_slave_to_stop.inc
+eval change master to
+ master_host="127.0.0.1",
+ master_user='replssl',
+ master_password="sslrepl",
+ master_ssl=1,
+ master_ssl_verify_server_cert=1,
+ master_ssl_ca ='',
+ master_ssl_cert='',
+ master_ssl_key='';
+start slave;
+--source include/wait_for_slave_to_start.inc
+
+show tables;
connection master;
drop table t1;
sync_slave_with_master;
+show tables;
+
+# ==== Clean up ====
--source include/stop_slave.inc
CHANGE MASTER TO
master_host="127.0.0.1",
+ master_user='root',
+ master_password='',
master_ssl_ca ='',
master_ssl_cert='',
master_ssl_key='',
master_ssl_verify_server_cert=0,
- master_ssl=0;
+ master_ssl=1;
+connection master;
+drop user replssl@127.0.0.1;
+connection slave;
+drop user replssl@127.0.0.1;
--let $rpl_only_running_threads= 1
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_7.test b/mysql-test/suite/rpl/t/rpl_start_alter_7.test
index 21c21c85..0e72b43e 100644
--- a/mysql-test/suite/rpl/t/rpl_start_alter_7.test
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_7.test
@@ -36,9 +36,9 @@ set global gtid_strict_mode=1;
--disable_warnings
--disable_query_log
--replace_result $SERVER_MYPORT_1 MYPORT_1
-eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
--replace_result $SERVER_MYPORT_2 MYPORT_2
-eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
--enable_query_log
--enable_warnings
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_8.test b/mysql-test/suite/rpl/t/rpl_start_alter_8.test
index c8c5ac74..ac7abca2 100644
--- a/mysql-test/suite/rpl/t/rpl_start_alter_8.test
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_8.test
@@ -35,9 +35,9 @@ set global gtid_strict_mode=1;
--disable_warnings
--disable_query_log
--replace_result $SERVER_MYPORT_1 MYPORT_1
-eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
--replace_result $SERVER_MYPORT_2 MYPORT_2
-eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root', master_use_gtid=slave_pos;
+eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0, master_use_gtid=slave_pos;
--enable_query_log
--enable_warnings
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_2.test b/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_2.test
index 9d9675c6..1cbc5b67 100644
--- a/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_2.test
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_mysqlbinlog_2.test
@@ -71,9 +71,9 @@ SET GLOBAL gtid_strict_mode=1;
--disable_warnings
--disable_query_log
--replace_result $SERVER_MYPORT_1 MYPORT_1
-eval CHANGE MASTER 'm1' TO MASTER_PORT=$SERVER_MYPORT_1, MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_USE_GTID=slave_pos;
+eval CHANGE MASTER 'm1' TO MASTER_PORT=$SERVER_MYPORT_1, MASTER_HOST='127.0.0.1', MASTER_USER='root', master_ssl_verify_server_cert=0, MASTER_USE_GTID=slave_pos;
--replace_result $SERVER_MYPORT_2 MYPORT_2
-eval CHANGE MASTER 'm2' TO MASTER_PORT=$SERVER_MYPORT_2, MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_USE_GTID=slave_pos;
+eval CHANGE MASTER 'm2' TO MASTER_PORT=$SERVER_MYPORT_2, MASTER_HOST='127.0.0.1', MASTER_USER='root', master_ssl_verify_server_cert=0, MASTER_USE_GTID=slave_pos;
--enable_query_log
--enable_warnings
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_restart_master.test b/mysql-test/suite/rpl/t/rpl_start_alter_restart_master.test
index aac3af6f..959af0ef 100644
--- a/mysql-test/suite/rpl/t/rpl_start_alter_restart_master.test
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_restart_master.test
@@ -15,7 +15,7 @@ CHANGE MASTER TO MASTER_USE_GTID=NO;
--source include/start_slave.inc
--connection slave
-SET @old_debug_slave= @@global.debug;
+SET @old_debug_slave= @@global.debug_dbug;
stop slave;
--let $gtid_strict_mode= `select @@gtid_strict_mode`
--let $slave_parallel_threads= `select @@slave_parallel_threads`
@@ -28,7 +28,7 @@ start slave;
--connection master
call mtr.add_suppression("ALTER query started at .+ could not be completed");
-SET @old_debug_master= @@global.debug;
+SET @old_debug_master= @@global.debug_dbug;
--let $binlog_alter_two_phase= `select @@binlog_alter_two_phase`
set binlog_alter_two_phase=true;
create table t3( a int primary key, b int) engine=innodb;
diff --git a/mysql-test/suite/rpl/t/rpl_start_alter_restart_slave.test b/mysql-test/suite/rpl/t/rpl_start_alter_restart_slave.test
index 5dcb0bf8..43586fdd 100644
--- a/mysql-test/suite/rpl/t/rpl_start_alter_restart_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_start_alter_restart_slave.test
@@ -6,11 +6,11 @@
#
--source include/have_log_bin.inc
--source include/have_innodb.inc
---source include/master-slave.inc
--source include/have_debug.inc
+--source include/master-slave.inc
--connection slave
-SET @old_debug_slave= @@global.debug;
+SET @old_debug_slave= @@global.debug_dbug;
--source include/stop_slave.inc
--let $gtid_strict_mode= `select @@gtid_strict_mode`
--let $slave_parallel_threads= `select @@slave_parallel_threads`
@@ -25,7 +25,7 @@ set global debug_dbug="+d,rpl_slave_stop_CA_before_binlog";
#
# SLAVE Shutdown
--connection master
-SET @old_debug_master= @@global.debug;
+SET @old_debug_master= @@global.debug_dbug;
set global debug_dbug="+d,start_alter_delay_master";
--let $binlog_alter_two_phase= `select @@binlog_alter_two_phase`
set global binlog_alter_two_phase=true;
@@ -116,10 +116,10 @@ SET GLOBAL debug_dbug= @old_debug_master;
set DEBUG_SYNC= 'RESET';
--sync_slave_with_master
-stop slave;
+--source include/stop_slave.inc
--eval set global slave_parallel_threads = $slave_parallel_threads;
--eval set global slave_parallel_mode = $slave_parallel_mode;
--eval set global gtid_strict_mode = $gtid_strict_mode;
set DEBUG_SYNC= 'RESET';
-start slave;
+--source include/start_slave.inc
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_upgrade_master_info.test b/mysql-test/suite/rpl/t/rpl_upgrade_master_info.test
index fb0e3cf4..dc904166 100644
--- a/mysql-test/suite/rpl/t/rpl_upgrade_master_info.test
+++ b/mysql-test/suite/rpl/t/rpl_upgrade_master_info.test
@@ -155,7 +155,7 @@ INSERT INTO t1 VALUES (6);
--connection slave
# Fix the port after we replaced master.info.
--replace_result $SERVER_MYPORT_1 SERVER_MYPORT_1
-eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1;
+eval CHANGE MASTER TO master_host='127.0.0.1', master_port=$SERVER_MYPORT_1, MASTER_SSL=1;
--source include/start_slave.inc
--source include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
diff --git a/mysql-test/suite/rpl/t/rpl_xa.inc b/mysql-test/suite/rpl/t/rpl_xa.inc
index d22d2d2e..30e7a4bb 100644
--- a/mysql-test/suite/rpl/t/rpl_xa.inc
+++ b/mysql-test/suite/rpl/t/rpl_xa.inc
@@ -363,7 +363,7 @@ sync_slave_with_master;
# set a strong isolation level to keep the read view below.
# alternatively a long-running select can do that too even in read-committed
-set session tx_isolation='repeatable-read';
+set session transaction_isolation='repeatable-read';
start transaction;
# opens a read view to disable purge on the slave
select * from t1;
diff --git a/mysql-test/suite/rpl/t/rpl_xa_empty_transaction.cnf b/mysql-test/suite/rpl/t/rpl_xa_empty_transaction.cnf
index 92acd0c7..261852a4 100644
--- a/mysql-test/suite/rpl/t/rpl_xa_empty_transaction.cnf
+++ b/mysql-test/suite/rpl/t/rpl_xa_empty_transaction.cnf
@@ -1,4 +1,4 @@
-!include include/default_mysqld.cnf
+!include include/default_my.cnf
[mysqld.1]
log-slave-updates
diff --git a/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test b/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test
index 815b2537..a350d093 100644
--- a/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test
+++ b/mysql-test/suite/rpl/t/show_status_stop_slave_race-7126.test
@@ -22,7 +22,7 @@ call mtr.add_suppression("Could not read packet:.* errno: 11");
# aborted by the master due to conflicting server_id from multiple connections.
--let $rpl_allow_error= 1
--source include/wait_for_slave_to_stop.inc
-start slave;
+--source include/start_slave.inc
--connection master
--source include/rpl_end.inc
diff --git a/mysql-test/suite/s3/alter.result b/mysql-test/suite/s3/alter.result
index 1a931b71..da8accca 100644
--- a/mysql-test/suite/s3/alter.result
+++ b/mysql-test/suite/s3/alter.result
@@ -130,3 +130,7 @@ count(*) sum(a) sum(b)
select count(*), sum(a), sum(b) from t1;
ERROR 42S02: Table 'database.t1' doesn't exist
drop table t2;
+# MDEV-31781 ALTER TABLE ENGINE=s3 fails
+create table t (a int) engine=Aria;
+alter table t engine=S3, algorithm=copy, lock=none;
+ERROR 0A000: LOCK=NONE is not supported. Reason: S3. Try LOCK=SHARED
diff --git a/mysql-test/suite/s3/alter.test b/mysql-test/suite/s3/alter.test
index 7882d14e..495e6dc2 100644
--- a/mysql-test/suite/s3/alter.test
+++ b/mysql-test/suite/s3/alter.test
@@ -93,6 +93,12 @@ select count(*), sum(a), sum(b) from t2;
select count(*), sum(a), sum(b) from t1;
drop table t2;
+
+--echo # MDEV-31781 ALTER TABLE ENGINE=s3 fails
+create table t (a int) engine=Aria;
+--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
+alter table t engine=S3, algorithm=copy, lock=none;
+
#
# clean up
#
diff --git a/mysql-test/suite/s3/my.cnf b/mysql-test/suite/s3/my.cnf
index f851aa18..818b2a88 100644
--- a/mysql-test/suite/s3/my.cnf
+++ b/mysql-test/suite/s3/my.cnf
@@ -1,5 +1,4 @@
-!include include/default_mysqld.cnf
-!include include/default_client.cnf
+!include include/default_my.cnf
[mysqld.1]
plugin-load-add=@ENV.HA_S3_SO
diff --git a/mysql-test/suite/storage_engine/type_char_indexes.result b/mysql-test/suite/storage_engine/type_char_indexes.result
index 73c07686..a72d0de5 100644
--- a/mysql-test/suite/storage_engine/type_char_indexes.result
+++ b/mysql-test/suite/storage_engine/type_char_indexes.result
@@ -95,17 +95,6 @@ v128 COUNT(*)
varchar1b 2
varchar2b 1
varchar3b 1
-SET SESSION optimizer_switch = 'engine_condition_pushdown=on';
-Warnings:
-Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release
-EXPLAIN SELECT c,c20,v16,v128 FROM t1 WHERE c > 'a';
-id select_type table type possible_keys key key_len ref rows Extra
-# # # range c_v c_v # # # Using index condition
-SELECT c,c20,v16,v128 FROM t1 WHERE c > 'a';
-c c20 v16 v128
-b char3 varchar1a varchar1b
-c char4 varchar3a varchar3b
-SET SESSION optimizer_switch = @@global.optimizer_switch;
DROP TABLE t1;
CREATE TABLE t1 (c CHAR <CUSTOM_COL_OPTIONS>,
c20 CHAR(20) <CUSTOM_COL_OPTIONS>,
diff --git a/mysql-test/suite/storage_engine/type_char_indexes.test b/mysql-test/suite/storage_engine/type_char_indexes.test
index 6fff8a6f..c44e9a8a 100644
--- a/mysql-test/suite/storage_engine/type_char_indexes.test
+++ b/mysql-test/suite/storage_engine/type_char_indexes.test
@@ -133,13 +133,6 @@ if (!$mysql_errname)
--sorted_result
SELECT v128, COUNT(*) FROM t1 USE INDEX FOR GROUP BY (c_v) GROUP BY v128;
- SET SESSION optimizer_switch = 'engine_condition_pushdown=on';
- --replace_column 1 # 2 # 3 # 7 # 8 # 9 #
- EXPLAIN SELECT c,c20,v16,v128 FROM t1 WHERE c > 'a';
- --sorted_result
- SELECT c,c20,v16,v128 FROM t1 WHERE c > 'a';
- SET SESSION optimizer_switch = @@global.optimizer_switch;
-
DROP TABLE t1;
}
diff --git a/mysql-test/suite/sys_vars/inc/explicit_defaults_for_timestamp.inc b/mysql-test/suite/sys_vars/inc/explicit_defaults_for_timestamp.inc
index 0cd8aa2c..46acf4ba 100644
--- a/mysql-test/suite/sys_vars/inc/explicit_defaults_for_timestamp.inc
+++ b/mysql-test/suite/sys_vars/inc/explicit_defaults_for_timestamp.inc
@@ -105,7 +105,9 @@ SET timestamp=DEFAULT;
--echo #
--echo # MDEV-29075 Changing explicit_defaults_for_timestamp within stored procedure works inconsistently
--echo #
+--disable_warnings
set statement explicit_defaults_for_timestamp=1-@@explicit_defaults_for_timestamp for create table t1 (ts timestamp);
+--enable_warnings
show create table t1;
drop table t1;
diff --git a/mysql-test/suite/sys_vars/inc/sysvar_global_and_session_grant.inc b/mysql-test/suite/sys_vars/inc/sysvar_global_and_session_grant.inc
index 0c6d0705..09b178de 100644
--- a/mysql-test/suite/sys_vars/inc/sysvar_global_and_session_grant.inc
+++ b/mysql-test/suite/sys_vars/inc/sysvar_global_and_session_grant.inc
@@ -3,11 +3,11 @@
--eval SET @global=@@global.$var
---echo # Test that "SET $var" is not allowed without $grant or SUPER
+--echo # Test that "SET $var" is not allowed without $grant
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
---eval REVOKE $grant, SUPER ON *.* FROM user1@localhost
+--eval REVOKE $grant ON *.* FROM user1@localhost
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -33,17 +33,4 @@ CREATE USER user1@localhost;
--connection default
DROP USER user1@localhost;
---echo # Test that "SET $var" is allowed with SUPER
-
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,)
---connection user1
---eval SET GLOBAL $var=$value
---eval SET $var=$value
---eval SET SESSION $var=$value
---disconnect user1
---connection default
-DROP USER user1@localhost;
-
--eval SET @@global.$var=@global
diff --git a/mysql-test/suite/sys_vars/inc/sysvar_global_grant.inc b/mysql-test/suite/sys_vars/inc/sysvar_global_grant.inc
index f452c1b1..bf121d72 100644
--- a/mysql-test/suite/sys_vars/inc/sysvar_global_grant.inc
+++ b/mysql-test/suite/sys_vars/inc/sysvar_global_grant.inc
@@ -1,13 +1,12 @@
--source include/not_embedded.inc
-
--eval SET @global=@@global.$var
---echo # Test that "SET $var" is not allowed without $grant or SUPER
+--echo # Test that "SET $var" is not allowed without $grant
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
---eval REVOKE $grant, SUPER ON *.* FROM user1@localhost
+--eval REVOKE $grant ON *.* FROM user1@localhost
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -35,19 +34,4 @@ CREATE USER user1@localhost;
--connection default
DROP USER user1@localhost;
---echo # Test that "SET $var" is allowed with SUPER
-
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,)
---connection user1
---eval SET GLOBAL $var=$value
---error ER_GLOBAL_VARIABLE
---eval SET $var=$value
---error ER_GLOBAL_VARIABLE
---eval SET SESSION $var=$value
---disconnect user1
---connection default
-DROP USER user1@localhost;
-
--eval SET @@global.$var=@global
diff --git a/mysql-test/suite/sys_vars/inc/sysvar_global_grant_alone.inc b/mysql-test/suite/sys_vars/inc/sysvar_global_grant_alone.inc
index 6a1cf1a7..4fb93ce4 100644
--- a/mysql-test/suite/sys_vars/inc/sysvar_global_grant_alone.inc
+++ b/mysql-test/suite/sys_vars/inc/sysvar_global_grant_alone.inc
@@ -1,13 +1,12 @@
--source include/not_embedded.inc
-
--eval SET @global=@@global.$var
---echo # Test that "SET GLOBAL $var" is not allowed without $grant or SUPER
+--echo # Test that "SET GLOBAL $var" is not allowed without $grant
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
---eval REVOKE $grant, SUPER ON *.* FROM user1@localhost
+--eval REVOKE $grant ON *.* FROM user1@localhost
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -27,15 +26,4 @@ CREATE USER user1@localhost;
--connection default
DROP USER user1@localhost;
---echo # Test that "SET GLOBAL $var" is allowed with SUPER
-
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,)
---connection user1
---eval SET GLOBAL $var=$value
---disconnect user1
---connection default
-DROP USER user1@localhost;
-
--eval SET @@global.$var=@global
diff --git a/mysql-test/suite/sys_vars/inc/sysvar_session_grant.inc b/mysql-test/suite/sys_vars/inc/sysvar_session_grant.inc
index 1cdc6e71..ce41d524 100644
--- a/mysql-test/suite/sys_vars/inc/sysvar_session_grant.inc
+++ b/mysql-test/suite/sys_vars/inc/sysvar_session_grant.inc
@@ -3,11 +3,11 @@
--eval SET @session=@@session.$var
---echo # Test that "SET $var" is not allowed without $grant or SUPER
+--echo # Test that "SET $var" is not allowed without $grant
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
---eval REVOKE $grant, SUPER ON *.* FROM user1@localhost
+--eval REVOKE $grant ON *.* FROM user1@localhost
--connect(user1,localhost,user1,,)
--connection user1
--error ER_LOCAL_VARIABLE
@@ -34,18 +34,4 @@ CREATE USER user1@localhost;
--connection default
DROP USER user1@localhost;
---echo # Test that "SET $var" is allowed with SUPER
-
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,)
---connection user1
---error ER_LOCAL_VARIABLE
---eval SET GLOBAL $var=$value
---eval SET $var=$value
---eval SET SESSION $var=$value
---disconnect user1
---connection default
-DROP USER user1@localhost;
-
--eval SET @@session.$var=@session
diff --git a/mysql-test/suite/sys_vars/inc/sysvar_session_grant_alone.inc b/mysql-test/suite/sys_vars/inc/sysvar_session_grant_alone.inc
index af38623a..b5a484a3 100644
--- a/mysql-test/suite/sys_vars/inc/sysvar_session_grant_alone.inc
+++ b/mysql-test/suite/sys_vars/inc/sysvar_session_grant_alone.inc
@@ -3,11 +3,11 @@
--eval SET @session=@@session.$var
---echo # Test that "SET $var" is not allowed without $grant or SUPER
+--echo # Test that "SET $var" is not allowed without $grant
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
---eval REVOKE $grant, SUPER ON *.* FROM user1@localhost
+--eval REVOKE $grant ON *.* FROM user1@localhost
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -30,16 +30,4 @@ CREATE USER user1@localhost;
--connection default
DROP USER user1@localhost;
---echo # Test that "SET $var" is allowed with SUPER
-
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,)
---connection user1
---eval SET $var=$value
---eval SET SESSION $var=$value
---disconnect user1
---connection default
-DROP USER user1@localhost;
-
--eval SET @@session.$var=@session
diff --git a/mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic,32bit.rdiff b/mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic,32bit.rdiff
deleted file mode 100644
index c30b99f1..00000000
--- a/mysql-test/suite/sys_vars/r/aria_sort_buffer_size_basic,32bit.rdiff
+++ /dev/null
@@ -1,9 +0,0 @@
---- suite/sys_vars/r/aria_sort_buffer_size_basic.result 2021-02-02 02:58:55.686921205 +0200
-+++ suite/sys_vars/r/aria_sort_buffer_size_basic.reject 2021-02-02 11:02:12.361178360 +0200
-@@ -44,5 +44,5 @@
- set session aria_sort_buffer_size=cast(-1 as unsigned int);
- select @@session.aria_sort_buffer_size;
- @@session.aria_sort_buffer_size
--9223372036854775807
-+2147483647
- SET @@global.aria_sort_buffer_size = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/binlog_annotate_row_events_grant.result b/mysql-test/suite/sys_vars/r/binlog_annotate_row_events_grant.result
index 1ff25d20..69aa3644 100644
--- a/mysql-test/suite/sys_vars/r/binlog_annotate_row_events_grant.result
+++ b/mysql-test/suite/sys_vars/r/binlog_annotate_row_events_grant.result
@@ -2,18 +2,18 @@
# MDEV-21971 Bind BINLOG ADMIN to binlog_annotate_row_events and binlog_row_image global and session variables
#
SET @global=@@global.binlog_annotate_row_events;
-# Test that "SET binlog_annotate_row_events" is not allowed without BINLOG ADMIN or SUPER
+# Test that "SET binlog_annotate_row_events" is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL binlog_annotate_row_events=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET binlog_annotate_row_events=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET SESSION binlog_annotate_row_events=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
disconnect user1;
connection default;
DROP USER user1@localhost;
@@ -28,15 +28,4 @@ SET SESSION binlog_annotate_row_events=1;
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET binlog_annotate_row_events" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL binlog_annotate_row_events=1;
-SET binlog_annotate_row_events=1;
-SET SESSION binlog_annotate_row_events=1;
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.binlog_annotate_row_events=@global;
diff --git a/mysql-test/suite/sys_vars/r/binlog_cache_size_grant.result b/mysql-test/suite/sys_vars/r/binlog_cache_size_grant.result
index e6898e58..49dac964 100644
--- a/mysql-test/suite/sys_vars/r/binlog_cache_size_grant.result
+++ b/mysql-test/suite/sys_vars/r/binlog_cache_size_grant.result
@@ -2,14 +2,14 @@
# MDEV-21963 Bind BINLOG ADMIN to a number of global system variables
#
SET @global=@@global.binlog_cache_size;
-# Test that "SET binlog_cache_size" is not allowed without BINLOG ADMIN or SUPER
+# Test that "SET binlog_cache_size" is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL binlog_cache_size=65536;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET binlog_cache_size=65536;
ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION binlog_cache_size=65536;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET binlog_cache_size" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL binlog_cache_size=65536;
-SET binlog_cache_size=65536;
-ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION binlog_cache_size=65536;
-ERROR HY000: Variable 'binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.binlog_cache_size=@global;
diff --git a/mysql-test/suite/sys_vars/r/binlog_commit_wait_count_grant.result b/mysql-test/suite/sys_vars/r/binlog_commit_wait_count_grant.result
index 930772f7..69d69cf5 100644
--- a/mysql-test/suite/sys_vars/r/binlog_commit_wait_count_grant.result
+++ b/mysql-test/suite/sys_vars/r/binlog_commit_wait_count_grant.result
@@ -2,14 +2,14 @@
# MDEV-21963 Bind BINLOG ADMIN to a number of global system variables
#
SET @global=@@global.binlog_commit_wait_count;
-# Test that "SET binlog_commit_wait_count" is not allowed without BINLOG ADMIN or SUPER
+# Test that "SET binlog_commit_wait_count" is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL binlog_commit_wait_count=65536;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET binlog_commit_wait_count=65536;
ERROR HY000: Variable 'binlog_commit_wait_count' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION binlog_commit_wait_count=65536;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'binlog_commit_wait_count' is a GLOBAL variable and should
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET binlog_commit_wait_count" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL binlog_commit_wait_count=65536;
-SET binlog_commit_wait_count=65536;
-ERROR HY000: Variable 'binlog_commit_wait_count' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION binlog_commit_wait_count=65536;
-ERROR HY000: Variable 'binlog_commit_wait_count' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.binlog_commit_wait_count=@global;
diff --git a/mysql-test/suite/sys_vars/r/binlog_commit_wait_usec_grant.result b/mysql-test/suite/sys_vars/r/binlog_commit_wait_usec_grant.result
index cfbb759e..e5ef4fec 100644
--- a/mysql-test/suite/sys_vars/r/binlog_commit_wait_usec_grant.result
+++ b/mysql-test/suite/sys_vars/r/binlog_commit_wait_usec_grant.result
@@ -2,14 +2,14 @@
# MDEV-21963 Bind BINLOG ADMIN to a number of global system variables
#
SET @global=@@global.binlog_commit_wait_usec;
-# Test that "SET binlog_commit_wait_usec" is not allowed without BINLOG ADMIN or SUPER
+# Test that "SET binlog_commit_wait_usec" is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL binlog_commit_wait_usec=65536;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET binlog_commit_wait_usec=65536;
ERROR HY000: Variable 'binlog_commit_wait_usec' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION binlog_commit_wait_usec=65536;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'binlog_commit_wait_usec' is a GLOBAL variable and should
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET binlog_commit_wait_usec" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL binlog_commit_wait_usec=65536;
-SET binlog_commit_wait_usec=65536;
-ERROR HY000: Variable 'binlog_commit_wait_usec' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION binlog_commit_wait_usec=65536;
-ERROR HY000: Variable 'binlog_commit_wait_usec' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.binlog_commit_wait_usec=@global;
diff --git a/mysql-test/suite/sys_vars/r/binlog_direct_non_transactional_updates_grant.result b/mysql-test/suite/sys_vars/r/binlog_direct_non_transactional_updates_grant.result
index e70dbbf4..f283d226 100644
--- a/mysql-test/suite/sys_vars/r/binlog_direct_non_transactional_updates_grant.result
+++ b/mysql-test/suite/sys_vars/r/binlog_direct_non_transactional_updates_grant.result
@@ -3,18 +3,18 @@ SET @session= @@global.binlog_direct_non_transactional_updates;
#
#
#
-# Test that "SET binlog_direct_non_transactional_updates" is not allowed without BINLOG ADMIN or SUPER
+# Test that "SET binlog_direct_non_transactional_updates" is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET binlog_direct_non_transactional_updates=0;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET GLOBAL binlog_direct_non_transactional_updates=0;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET SESSION binlog_direct_non_transactional_updates=0;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
disconnect user1;
connection default;
DROP USER user1@localhost;
@@ -29,16 +29,5 @@ SET SESSION binlog_direct_non_transactional_updates=0;
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET binlog_direct_non_transactional_updates" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET binlog_direct_non_transactional_updates=0;
-SET GLOBAL binlog_direct_non_transactional_updates=0;
-SET SESSION binlog_direct_non_transactional_updates=0;
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET GLOBAL binlog_direct_non_transactional_updates=@global;
SET SESSION binlog_direct_non_transactional_updates=@session;
diff --git a/mysql-test/suite/sys_vars/r/binlog_expire_logs_seconds_grant.result b/mysql-test/suite/sys_vars/r/binlog_expire_logs_seconds_grant.result
index 94b57d2e..5e864322 100644
--- a/mysql-test/suite/sys_vars/r/binlog_expire_logs_seconds_grant.result
+++ b/mysql-test/suite/sys_vars/r/binlog_expire_logs_seconds_grant.result
@@ -3,14 +3,14 @@
# Test that "SET binlog_expire_logs_seconds" is not allowed without BINLOG ADMIN or SUPER
#
SET @global=@@global.binlog_expire_logs_seconds;
-# Test that "SET binlog_expire_logs_seconds" is not allowed without BINLOG ADMIN or SUPER
+# Test that "SET binlog_expire_logs_seconds" is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL binlog_expire_logs_seconds=10;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET binlog_expire_logs_seconds=10;
ERROR HY000: Variable 'binlog_expire_logs_seconds' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION binlog_expire_logs_seconds=10;
@@ -31,17 +31,4 @@ ERROR HY000: Variable 'binlog_expire_logs_seconds' is a GLOBAL variable and shou
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET binlog_expire_logs_seconds" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL binlog_expire_logs_seconds=10;
-SET binlog_expire_logs_seconds=10;
-ERROR HY000: Variable 'binlog_expire_logs_seconds' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION binlog_expire_logs_seconds=10;
-ERROR HY000: Variable 'binlog_expire_logs_seconds' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.binlog_expire_logs_seconds=@global;
diff --git a/mysql-test/suite/sys_vars/r/binlog_file_cache_size_grant.result b/mysql-test/suite/sys_vars/r/binlog_file_cache_size_grant.result
index 3cd5aaf5..38ae2098 100644
--- a/mysql-test/suite/sys_vars/r/binlog_file_cache_size_grant.result
+++ b/mysql-test/suite/sys_vars/r/binlog_file_cache_size_grant.result
@@ -2,14 +2,14 @@
# MDEV-21963 Bind BINLOG ADMIN to a number of global system variables
#
SET @global=@@global.binlog_file_cache_size;
-# Test that "SET binlog_file_cache_size" is not allowed without BINLOG ADMIN or SUPER
+# Test that "SET binlog_file_cache_size" is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL binlog_file_cache_size=65536;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET binlog_file_cache_size=65536;
ERROR HY000: Variable 'binlog_file_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION binlog_file_cache_size=65536;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'binlog_file_cache_size' is a GLOBAL variable and should b
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET binlog_file_cache_size" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL binlog_file_cache_size=65536;
-SET binlog_file_cache_size=65536;
-ERROR HY000: Variable 'binlog_file_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION binlog_file_cache_size=65536;
-ERROR HY000: Variable 'binlog_file_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.binlog_file_cache_size=@global;
diff --git a/mysql-test/suite/sys_vars/r/binlog_format_grant.result b/mysql-test/suite/sys_vars/r/binlog_format_grant.result
index b3cd77a6..ba9ec79d 100644
--- a/mysql-test/suite/sys_vars/r/binlog_format_grant.result
+++ b/mysql-test/suite/sys_vars/r/binlog_format_grant.result
@@ -1,18 +1,18 @@
#
#
#
-# Test that "SET binlog_format" is not allowed without BINLOG ADMIN or SUPER
+# Test that "SET binlog_format" is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET binlog_format=mixed;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET GLOBAL binlog_format=mixed;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET SESSION binlog_format=mixed;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
disconnect user1;
connection default;
DROP USER user1@localhost;
@@ -27,14 +27,3 @@ SET SESSION binlog_format=mixed;
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET binlog_format" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET binlog_format=mixed;
-SET GLOBAL binlog_format=mixed;
-SET SESSION binlog_format=mixed;
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
diff --git a/mysql-test/suite/sys_vars/r/binlog_row_image_grant.result b/mysql-test/suite/sys_vars/r/binlog_row_image_grant.result
index d9cf65d9..c2194aec 100644
--- a/mysql-test/suite/sys_vars/r/binlog_row_image_grant.result
+++ b/mysql-test/suite/sys_vars/r/binlog_row_image_grant.result
@@ -2,18 +2,18 @@
# MDEV-21971 Bind BINLOG ADMIN to binlog_annotate_row_events and binlog_row_image global and session variables
#
SET @global=@@global.binlog_row_image;
-# Test that "SET binlog_row_image" is not allowed without BINLOG ADMIN or SUPER
+# Test that "SET binlog_row_image" is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL binlog_row_image=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET binlog_row_image=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET SESSION binlog_row_image=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
disconnect user1;
connection default;
DROP USER user1@localhost;
@@ -28,15 +28,4 @@ SET SESSION binlog_row_image=1;
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET binlog_row_image" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL binlog_row_image=1;
-SET binlog_row_image=1;
-SET SESSION binlog_row_image=1;
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.binlog_row_image=@global;
diff --git a/mysql-test/suite/sys_vars/r/binlog_row_metadata_grant.result b/mysql-test/suite/sys_vars/r/binlog_row_metadata_grant.result
index 43282278..2c47c148 100644
--- a/mysql-test/suite/sys_vars/r/binlog_row_metadata_grant.result
+++ b/mysql-test/suite/sys_vars/r/binlog_row_metadata_grant.result
@@ -2,14 +2,14 @@
# MDEV-21963 Bind BINLOG ADMIN to a number of global system variables
#
SET @global=@@global.binlog_row_metadata;
-# Test that "SET binlog_row_metadata" is not allowed without BINLOG ADMIN or SUPER
+# Test that "SET binlog_row_metadata" is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL binlog_row_metadata=NO_LOG;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET binlog_row_metadata=NO_LOG;
ERROR HY000: Variable 'binlog_row_metadata' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION binlog_row_metadata=NO_LOG;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'binlog_row_metadata' is a GLOBAL variable and should be s
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET binlog_row_metadata" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL binlog_row_metadata=NO_LOG;
-SET binlog_row_metadata=NO_LOG;
-ERROR HY000: Variable 'binlog_row_metadata' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION binlog_row_metadata=NO_LOG;
-ERROR HY000: Variable 'binlog_row_metadata' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.binlog_row_metadata=@global;
diff --git a/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_grant.result b/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_grant.result
index 87070de9..ca2505e9 100644
--- a/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_grant.result
+++ b/mysql-test/suite/sys_vars/r/binlog_stmt_cache_size_grant.result
@@ -2,14 +2,14 @@
# MDEV-21963 Bind BINLOG ADMIN to a number of global system variables
#
SET @global=@@global.binlog_stmt_cache_size;
-# Test that "SET binlog_stmt_cache_size" is not allowed without BINLOG ADMIN or SUPER
+# Test that "SET binlog_stmt_cache_size" is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL binlog_stmt_cache_size=65536;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET binlog_stmt_cache_size=65536;
ERROR HY000: Variable 'binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION binlog_stmt_cache_size=65536;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'binlog_stmt_cache_size' is a GLOBAL variable and should b
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET binlog_stmt_cache_size" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL binlog_stmt_cache_size=65536;
-SET binlog_stmt_cache_size=65536;
-ERROR HY000: Variable 'binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION binlog_stmt_cache_size=65536;
-ERROR HY000: Variable 'binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.binlog_stmt_cache_size=@global;
diff --git a/mysql-test/suite/sys_vars/r/connect_timeout_grant.result b/mysql-test/suite/sys_vars/r/connect_timeout_grant.result
index 96351490..488649a4 100644
--- a/mysql-test/suite/sys_vars/r/connect_timeout_grant.result
+++ b/mysql-test/suite/sys_vars/r/connect_timeout_grant.result
@@ -2,14 +2,14 @@ SET @global=@@global.connect_timeout;
#
# MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
#
-# Test that "SET connect_timeout" is not allowed without CONNECTION ADMIN or SUPER
+# Test that "SET connect_timeout" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL connect_timeout=10;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, CONNECTION ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the CONNECTION ADMIN privilege(s) for this operation
SET connect_timeout=10;
ERROR HY000: Variable 'connect_timeout' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION connect_timeout=10;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'connect_timeout' is a GLOBAL variable and should be set w
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET connect_timeout" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL connect_timeout=10;
-SET connect_timeout=10;
-ERROR HY000: Variable 'connect_timeout' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION connect_timeout=10;
-ERROR HY000: Variable 'connect_timeout' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.connect_timeout=@global;
diff --git a/mysql-test/suite/sys_vars/r/date_format_basic.result b/mysql-test/suite/sys_vars/r/date_format_basic.result
deleted file mode 100644
index a92d275d..00000000
--- a/mysql-test/suite/sys_vars/r/date_format_basic.result
+++ /dev/null
@@ -1,21 +0,0 @@
-select @@global.date_format;
-@@global.date_format
-%Y-%m-%d
-select @@session.date_format;
-ERROR HY000: Variable 'date_format' is a GLOBAL variable
-show global variables like 'date_format';
-Variable_name Value
-date_format %Y-%m-%d
-show session variables like 'date_format';
-Variable_name Value
-date_format %Y-%m-%d
-select * from information_schema.global_variables where variable_name='date_format';
-VARIABLE_NAME VARIABLE_VALUE
-DATE_FORMAT %Y-%m-%d
-select * from information_schema.session_variables where variable_name='date_format';
-VARIABLE_NAME VARIABLE_VALUE
-DATE_FORMAT %Y-%m-%d
-set global date_format="foo";
-ERROR HY000: Variable 'date_format' is a read only variable
-set session date_format="foo";
-ERROR HY000: Variable 'date_format' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/datetime_format_basic.result b/mysql-test/suite/sys_vars/r/datetime_format_basic.result
deleted file mode 100644
index ac80ee37..00000000
--- a/mysql-test/suite/sys_vars/r/datetime_format_basic.result
+++ /dev/null
@@ -1,21 +0,0 @@
-select @@global.datetime_format;
-@@global.datetime_format
-%Y-%m-%d %H:%i:%s
-select @@session.datetime_format;
-ERROR HY000: Variable 'datetime_format' is a GLOBAL variable
-show global variables like 'datetime_format';
-Variable_name Value
-datetime_format %Y-%m-%d %H:%i:%s
-show session variables like 'datetime_format';
-Variable_name Value
-datetime_format %Y-%m-%d %H:%i:%s
-select * from information_schema.global_variables where variable_name='datetime_format';
-VARIABLE_NAME VARIABLE_VALUE
-DATETIME_FORMAT %Y-%m-%d %H:%i:%s
-select * from information_schema.session_variables where variable_name='datetime_format';
-VARIABLE_NAME VARIABLE_VALUE
-DATETIME_FORMAT %Y-%m-%d %H:%i:%s
-set global datetime_format="foo";
-ERROR HY000: Variable 'datetime_format' is a read only variable
-set session datetime_format="foo";
-ERROR HY000: Variable 'datetime_format' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/debug_basic.result b/mysql-test/suite/sys_vars/r/debug_basic.result
deleted file mode 100644
index 5a77446d..00000000
--- a/mysql-test/suite/sys_vars/r/debug_basic.result
+++ /dev/null
@@ -1,25 +0,0 @@
-set session debug="L";
-select @@global.debug="1";
-@@global.debug="1"
-0
-select @@session.debug;
-@@session.debug
-L
-show global variables like 'debug';
-Variable_name Value
-debug #
-show session variables like 'debug';
-Variable_name Value
-debug L
-select * from information_schema.global_variables where variable_name="debug";
-VARIABLE_NAME VARIABLE_VALUE
-DEBUG #
-select * from information_schema.session_variables where variable_name="debug";
-VARIABLE_NAME VARIABLE_VALUE
-DEBUG L
-set @@global.debug=1;
-ERROR 42000: Incorrect argument type to variable 'debug'
-set @@global.debug=1.1;
-ERROR 42000: Incorrect argument type to variable 'debug'
-set @@global.debug=1e1;
-ERROR 42000: Incorrect argument type to variable 'debug'
diff --git a/mysql-test/suite/sys_vars/r/debug_dbug_basic.result b/mysql-test/suite/sys_vars/r/debug_dbug_basic.result
index ad2fbc5a..091f8ed3 100644
--- a/mysql-test/suite/sys_vars/r/debug_dbug_basic.result
+++ b/mysql-test/suite/sys_vars/r/debug_dbug_basic.result
@@ -2,21 +2,21 @@ set session debug_dbug="L";
select @@global.debug_dbug="1";
@@global.debug_dbug="1"
0
-select @@session.debug;
-@@session.debug
+select @@session.debug_dbug;
+@@session.debug_dbug
L
-show global variables like 'debug';
+show global variables like 'debug_dbug';
Variable_name Value
-debug #
-show session variables like 'debug';
+debug_dbug #
+show session variables like 'debug_dbug';
Variable_name Value
-debug L
-select * from information_schema.global_variables where variable_name="debug";
+debug_dbug L
+select * from information_schema.global_variables where variable_name='debug_dbug';
VARIABLE_NAME VARIABLE_VALUE
-DEBUG #
-select * from information_schema.session_variables where variable_name="debug";
+DEBUG_DBUG #
+select * from information_schema.session_variables where variable_name='debug_dbug';
VARIABLE_NAME VARIABLE_VALUE
-DEBUG L
+DEBUG_DBUG L
set @@global.debug_dbug=1;
ERROR 42000: Incorrect argument type to variable 'debug_dbug'
set @@global.debug_dbug=1.1;
diff --git a/mysql-test/suite/sys_vars/r/debug_dbug_func_notembedded.result b/mysql-test/suite/sys_vars/r/debug_dbug_func_notembedded.result
index 45de298e..7f8c0709 100644
--- a/mysql-test/suite/sys_vars/r/debug_dbug_func_notembedded.result
+++ b/mysql-test/suite/sys_vars/r/debug_dbug_func_notembedded.result
@@ -2,23 +2,23 @@ connect con1,localhost,root,,test,,;
connect con2,localhost,root,,test,,;
connection con1;
set session debug_dbug="t";
-show session variables like 'debug';
+show session variables like 'debug_dbug';
Variable_name Value
-debug t
+debug_dbug t
connection con2;
set session debug_dbug="t";
-show session variables like 'debug';
+show session variables like 'debug_dbug';
Variable_name Value
-debug t
+debug_dbug t
connection con1;
set session debug_dbug="d:t";
-show session variables like 'debug';
+show session variables like 'debug_dbug';
Variable_name Value
-debug d:t
+debug_dbug d:t
connection con2;
-show session variables like 'debug';
+show session variables like 'debug_dbug';
Variable_name Value
-debug t
+debug_dbug t
disconnect con1;
disconnect con2;
connection default;
diff --git a/mysql-test/suite/sys_vars/r/debug_no_thread_alarm_basic.result b/mysql-test/suite/sys_vars/r/debug_no_thread_alarm_basic.result
deleted file mode 100644
index 817c7880..00000000
--- a/mysql-test/suite/sys_vars/r/debug_no_thread_alarm_basic.result
+++ /dev/null
@@ -1,21 +0,0 @@
-select @@global.debug_no_thread_alarm;
-@@global.debug_no_thread_alarm
-0
-select @@session.debug_no_thread_alarm;
-ERROR HY000: Variable 'debug_no_thread_alarm' is a GLOBAL variable
-show global variables like 'debug_no_thread_alarm';
-Variable_name Value
-debug_no_thread_alarm OFF
-show session variables like 'debug_no_thread_alarm';
-Variable_name Value
-debug_no_thread_alarm OFF
-select * from information_schema.global_variables where variable_name='debug_no_thread_alarm';
-VARIABLE_NAME VARIABLE_VALUE
-DEBUG_NO_THREAD_ALARM OFF
-select * from information_schema.session_variables where variable_name='debug_no_thread_alarm';
-VARIABLE_NAME VARIABLE_VALUE
-DEBUG_NO_THREAD_ALARM OFF
-set global debug_no_thread_alarm=1;
-ERROR HY000: Variable 'debug_no_thread_alarm' is a read only variable
-set session debug_no_thread_alarm=1;
-ERROR HY000: Variable 'debug_no_thread_alarm' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/disconnect_on_expired_password_grant.result b/mysql-test/suite/sys_vars/r/disconnect_on_expired_password_grant.result
index b7152351..e3bc2754 100644
--- a/mysql-test/suite/sys_vars/r/disconnect_on_expired_password_grant.result
+++ b/mysql-test/suite/sys_vars/r/disconnect_on_expired_password_grant.result
@@ -2,14 +2,14 @@ SET @global=@@global.disconnect_on_expired_password;
#
# MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
#
-# Test that "SET disconnect_on_expired_password" is not allowed without CONNECTION ADMIN or SUPER
+# Test that "SET disconnect_on_expired_password" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL disconnect_on_expired_password=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, CONNECTION ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the CONNECTION ADMIN privilege(s) for this operation
SET disconnect_on_expired_password=1;
ERROR HY000: Variable 'disconnect_on_expired_password' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION disconnect_on_expired_password=1;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'disconnect_on_expired_password' is a GLOBAL variable and
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET disconnect_on_expired_password" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL disconnect_on_expired_password=1;
-SET disconnect_on_expired_password=1;
-ERROR HY000: Variable 'disconnect_on_expired_password' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION disconnect_on_expired_password=1;
-ERROR HY000: Variable 'disconnect_on_expired_password' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.disconnect_on_expired_password=@global;
diff --git a/mysql-test/suite/sys_vars/r/expire_logs_days_grant.result b/mysql-test/suite/sys_vars/r/expire_logs_days_grant.result
index f7a3ddc7..4dcff017 100644
--- a/mysql-test/suite/sys_vars/r/expire_logs_days_grant.result
+++ b/mysql-test/suite/sys_vars/r/expire_logs_days_grant.result
@@ -2,14 +2,14 @@
# MDEV-21963 Bind BINLOG ADMIN to a number of global system variables
#
SET @global=@@global.expire_logs_days;
-# Test that "SET expire_logs_days" is not allowed without BINLOG ADMIN or SUPER
+# Test that "SET expire_logs_days" is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL expire_logs_days=33;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET expire_logs_days=33;
ERROR HY000: Variable 'expire_logs_days' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION expire_logs_days=33;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'expire_logs_days' is a GLOBAL variable and should be set
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET expire_logs_days" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL expire_logs_days=33;
-SET expire_logs_days=33;
-ERROR HY000: Variable 'expire_logs_days' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION expire_logs_days=33;
-ERROR HY000: Variable 'expire_logs_days' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.expire_logs_days=@global;
diff --git a/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_off.result b/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_off.result
index 1d779352..7cdf564c 100644
--- a/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_off.result
+++ b/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_off.result
@@ -1,4 +1,6 @@
set @@explicit_defaults_for_timestamp=0;
+Warnings:
+Warning 1287 'explicit_defaults_for_timestamp=0' is deprecated and will be removed in a future release
CREATE TABLE t1 (a TIMESTAMP);
SHOW CREATE TABLE t1;
Table Create Table
@@ -224,6 +226,8 @@ t1 CREATE TABLE `t1` (
`a` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
set explicit_defaults_for_timestamp=1-@@explicit_defaults_for_timestamp;
+Warnings:
+Warning 1287 'explicit_defaults_for_timestamp=0' is deprecated and will be removed in a future release
execute stmt;
show create table t1;
Table Create Table
diff --git a/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_on.result b/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_on.result
index 85cbfbc2..cbb4834d 100644
--- a/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_on.result
+++ b/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_on.result
@@ -233,6 +233,8 @@ t1 CREATE TABLE `t1` (
`a` timestamp NULL DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
set explicit_defaults_for_timestamp=1-@@explicit_defaults_for_timestamp;
+Warnings:
+Warning 1287 'explicit_defaults_for_timestamp=0' is deprecated and will be removed in a future release
execute stmt;
show create table t1;
Table Create Table
diff --git a/mysql-test/suite/sys_vars/r/extra_max_connections_grant.result b/mysql-test/suite/sys_vars/r/extra_max_connections_grant.result
index 2f211dd5..2663cfad 100644
--- a/mysql-test/suite/sys_vars/r/extra_max_connections_grant.result
+++ b/mysql-test/suite/sys_vars/r/extra_max_connections_grant.result
@@ -2,14 +2,14 @@ SET @global=@@global.extra_max_connections;
#
# MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
#
-# Test that "SET extra_max_connections" is not allowed without CONNECTION ADMIN or SUPER
+# Test that "SET extra_max_connections" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL extra_max_connections=10;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, CONNECTION ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the CONNECTION ADMIN privilege(s) for this operation
SET extra_max_connections=10;
ERROR HY000: Variable 'extra_max_connections' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION extra_max_connections=10;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'extra_max_connections' is a GLOBAL variable and should be
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET extra_max_connections" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL extra_max_connections=10;
-SET extra_max_connections=10;
-ERROR HY000: Variable 'extra_max_connections' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION extra_max_connections=10;
-ERROR HY000: Variable 'extra_max_connections' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.extra_max_connections=@global;
diff --git a/mysql-test/suite/sys_vars/r/gtid_binlog_state_grant.result b/mysql-test/suite/sys_vars/r/gtid_binlog_state_grant.result
index 0ccf610c..4aa0a800 100644
--- a/mysql-test/suite/sys_vars/r/gtid_binlog_state_grant.result
+++ b/mysql-test/suite/sys_vars/r/gtid_binlog_state_grant.result
@@ -1,14 +1,14 @@
#
# MDEV-21973 Bind REPLICATION {MASTER|SLAVE} ADMIN to gtid_* GLOBAL-only system variables
#
-# Test that "SET gtid_binlog_state" is not allowed without REPLICATION MASTER ADMIN or SUPER
+# Test that "SET gtid_binlog_state" is not allowed without REPLICATION MASTER ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION MASTER ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION MASTER ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL gtid_binlog_state='0-1-10';
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION MASTER ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION MASTER ADMIN privilege(s) for this operation
SET gtid_binlog_state='0-1-10';
ERROR HY000: Variable 'gtid_binlog_state' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION gtid_binlog_state='0-1-10';
@@ -30,17 +30,3 @@ ERROR HY000: Variable 'gtid_binlog_state' is a GLOBAL variable and should be set
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET gtid_binlog_state" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL gtid_binlog_state='0-1-10';
-ERROR HY000: Binlog closed, cannot RESET MASTER
-SET gtid_binlog_state='0-1-10';
-ERROR HY000: Variable 'gtid_binlog_state' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION gtid_binlog_state='0-1-10';
-ERROR HY000: Variable 'gtid_binlog_state' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
diff --git a/mysql-test/suite/sys_vars/r/gtid_cleanup_batch_size_grant.result b/mysql-test/suite/sys_vars/r/gtid_cleanup_batch_size_grant.result
index 326fb47d..33a39d1c 100644
--- a/mysql-test/suite/sys_vars/r/gtid_cleanup_batch_size_grant.result
+++ b/mysql-test/suite/sys_vars/r/gtid_cleanup_batch_size_grant.result
@@ -2,14 +2,14 @@
# MDEV-21973 Bind REPLICATION {MASTER|SLAVE} ADMIN to gtid_* GLOBAL-only system variables
#
SET @global=@@global.gtid_cleanup_batch_size;
-# Test that "SET gtid_cleanup_batch_size" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET gtid_cleanup_batch_size" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL gtid_cleanup_batch_size=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET gtid_cleanup_batch_size=1;
ERROR HY000: Variable 'gtid_cleanup_batch_size' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION gtid_cleanup_batch_size=1;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'gtid_cleanup_batch_size' is a GLOBAL variable and should
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET gtid_cleanup_batch_size" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL gtid_cleanup_batch_size=1;
-SET gtid_cleanup_batch_size=1;
-ERROR HY000: Variable 'gtid_cleanup_batch_size' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION gtid_cleanup_batch_size=1;
-ERROR HY000: Variable 'gtid_cleanup_batch_size' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.gtid_cleanup_batch_size=@global;
diff --git a/mysql-test/suite/sys_vars/r/gtid_domain_id_grant.result b/mysql-test/suite/sys_vars/r/gtid_domain_id_grant.result
index 096f5136..9d1ac3de 100644
--- a/mysql-test/suite/sys_vars/r/gtid_domain_id_grant.result
+++ b/mysql-test/suite/sys_vars/r/gtid_domain_id_grant.result
@@ -2,14 +2,14 @@
# MDEV-21975 Add BINLOG REPLAY privilege and bind new privileges to gtid_seq_no, preudo_thread_id, server_id, gtid_domain_id
#
SET @global=@@global.gtid_domain_id;
-# Test that "SET GLOBAL gtid_domain_id" is not allowed without REPLICATION MASTER ADMIN or SUPER
+# Test that "SET GLOBAL gtid_domain_id" is not allowed without REPLICATION MASTER ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION MASTER ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION MASTER ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL gtid_domain_id=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION MASTER ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION MASTER ADMIN privilege(s) for this operation
disconnect user1;
connection default;
DROP USER user1@localhost;
@@ -22,27 +22,18 @@ SET GLOBAL gtid_domain_id=1;
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET GLOBAL gtid_domain_id" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL gtid_domain_id=1;
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.gtid_domain_id=@global;
SET @session=@@session.gtid_domain_id;
-# Test that "SET gtid_domain_id" is not allowed without BINLOG REPLAY or SUPER
+# Test that "SET gtid_domain_id" is not allowed without BINLOG REPLAY
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG REPLAY, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG REPLAY ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET gtid_domain_id=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG REPLAY privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG REPLAY privilege(s) for this operation
SET SESSION gtid_domain_id=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG REPLAY privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG REPLAY privilege(s) for this operation
disconnect user1;
connection default;
DROP USER user1@localhost;
@@ -56,14 +47,4 @@ SET SESSION gtid_domain_id=1;
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET gtid_domain_id" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET gtid_domain_id=1;
-SET SESSION gtid_domain_id=1;
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@session.gtid_domain_id=@session;
diff --git a/mysql-test/suite/sys_vars/r/gtid_ignore_duplicates_grant.result b/mysql-test/suite/sys_vars/r/gtid_ignore_duplicates_grant.result
index f4c95fb6..ed6faac5 100644
--- a/mysql-test/suite/sys_vars/r/gtid_ignore_duplicates_grant.result
+++ b/mysql-test/suite/sys_vars/r/gtid_ignore_duplicates_grant.result
@@ -2,14 +2,14 @@
# MDEV-21973 Bind REPLICATION {MASTER|SLAVE} ADMIN to gtid_* GLOBAL-only system variables
#
SET @global=@@global.gtid_ignore_duplicates;
-# Test that "SET gtid_ignore_duplicates" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET gtid_ignore_duplicates" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL gtid_ignore_duplicates=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET gtid_ignore_duplicates=1;
ERROR HY000: Variable 'gtid_ignore_duplicates' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION gtid_ignore_duplicates=1;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'gtid_ignore_duplicates' is a GLOBAL variable and should b
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET gtid_ignore_duplicates" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL gtid_ignore_duplicates=1;
-SET gtid_ignore_duplicates=1;
-ERROR HY000: Variable 'gtid_ignore_duplicates' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION gtid_ignore_duplicates=1;
-ERROR HY000: Variable 'gtid_ignore_duplicates' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.gtid_ignore_duplicates=@global;
diff --git a/mysql-test/suite/sys_vars/r/gtid_pos_auto_engines_grant.result b/mysql-test/suite/sys_vars/r/gtid_pos_auto_engines_grant.result
index 60fae07c..f3ee0179 100644
--- a/mysql-test/suite/sys_vars/r/gtid_pos_auto_engines_grant.result
+++ b/mysql-test/suite/sys_vars/r/gtid_pos_auto_engines_grant.result
@@ -2,14 +2,14 @@
# MDEV-21973 Bind REPLICATION {MASTER|SLAVE} ADMIN to gtid_* GLOBAL-only system variables
#
SET @global=@@global.gtid_pos_auto_engines;
-# Test that "SET gtid_pos_auto_engines" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET gtid_pos_auto_engines" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL gtid_pos_auto_engines='';
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET gtid_pos_auto_engines='';
ERROR HY000: Variable 'gtid_pos_auto_engines' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION gtid_pos_auto_engines='';
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'gtid_pos_auto_engines' is a GLOBAL variable and should be
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET gtid_pos_auto_engines" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL gtid_pos_auto_engines='';
-SET gtid_pos_auto_engines='';
-ERROR HY000: Variable 'gtid_pos_auto_engines' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION gtid_pos_auto_engines='';
-ERROR HY000: Variable 'gtid_pos_auto_engines' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.gtid_pos_auto_engines=@global;
diff --git a/mysql-test/suite/sys_vars/r/gtid_seq_no_grant.result b/mysql-test/suite/sys_vars/r/gtid_seq_no_grant.result
index 0d08cde5..d8a5d976 100644
--- a/mysql-test/suite/sys_vars/r/gtid_seq_no_grant.result
+++ b/mysql-test/suite/sys_vars/r/gtid_seq_no_grant.result
@@ -2,18 +2,18 @@
# MDEV-21975 Add BINLOG REPLAY privilege and bind new privileges to gtid_seq_no, preudo_thread_id, server_id, gtid_domain_id
#
SET @session=@@session.gtid_seq_no;
-# Test that "SET gtid_seq_no" is not allowed without BINLOG REPLAY or SUPER
+# Test that "SET gtid_seq_no" is not allowed without BINLOG REPLAY
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG REPLAY, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG REPLAY ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL gtid_seq_no=1;
ERROR HY000: Variable 'gtid_seq_no' is a SESSION variable and can't be used with SET GLOBAL
SET gtid_seq_no=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG REPLAY privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG REPLAY privilege(s) for this operation
SET SESSION gtid_seq_no=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG REPLAY privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG REPLAY privilege(s) for this operation
disconnect user1;
connection default;
DROP USER user1@localhost;
@@ -29,16 +29,4 @@ SET SESSION gtid_seq_no=1;
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET gtid_seq_no" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL gtid_seq_no=1;
-ERROR HY000: Variable 'gtid_seq_no' is a SESSION variable and can't be used with SET GLOBAL
-SET gtid_seq_no=1;
-SET SESSION gtid_seq_no=1;
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@session.gtid_seq_no=@session;
diff --git a/mysql-test/suite/sys_vars/r/gtid_slave_pos_grant.result b/mysql-test/suite/sys_vars/r/gtid_slave_pos_grant.result
index 52918706..dfad91fb 100644
--- a/mysql-test/suite/sys_vars/r/gtid_slave_pos_grant.result
+++ b/mysql-test/suite/sys_vars/r/gtid_slave_pos_grant.result
@@ -2,14 +2,14 @@
# MDEV-21973 Bind REPLICATION {MASTER|SLAVE} ADMIN to gtid_* GLOBAL-only system variables
#
SET @global=@@global.gtid_slave_pos;
-# Test that "SET gtid_slave_pos" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET gtid_slave_pos" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL gtid_slave_pos='';
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET gtid_slave_pos='';
ERROR HY000: Variable 'gtid_slave_pos' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION gtid_slave_pos='';
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'gtid_slave_pos' is a GLOBAL variable and should be set wi
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET gtid_slave_pos" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL gtid_slave_pos='';
-SET gtid_slave_pos='';
-ERROR HY000: Variable 'gtid_slave_pos' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION gtid_slave_pos='';
-ERROR HY000: Variable 'gtid_slave_pos' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.gtid_slave_pos=@global;
diff --git a/mysql-test/suite/sys_vars/r/gtid_strict_mode_grant.result b/mysql-test/suite/sys_vars/r/gtid_strict_mode_grant.result
index 0ea4d0ab..8744d743 100644
--- a/mysql-test/suite/sys_vars/r/gtid_strict_mode_grant.result
+++ b/mysql-test/suite/sys_vars/r/gtid_strict_mode_grant.result
@@ -2,14 +2,14 @@
# MDEV-21973 Bind REPLICATION {MASTER|SLAVE} ADMIN to gtid_* GLOBAL-only system variables
#
SET @global=@@global.gtid_strict_mode;
-# Test that "SET gtid_strict_mode" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET gtid_strict_mode" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL gtid_strict_mode=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET gtid_strict_mode=1;
ERROR HY000: Variable 'gtid_strict_mode' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION gtid_strict_mode=1;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'gtid_strict_mode' is a GLOBAL variable and should be set
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET gtid_strict_mode" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL gtid_strict_mode=1;
-SET gtid_strict_mode=1;
-ERROR HY000: Variable 'gtid_strict_mode' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION gtid_strict_mode=1;
-ERROR HY000: Variable 'gtid_strict_mode' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.gtid_strict_mode=@global;
diff --git a/mysql-test/suite/sys_vars/r/histogram_type_basic.result b/mysql-test/suite/sys_vars/r/histogram_type_basic.result
index c2419200..8dbd3251 100644
--- a/mysql-test/suite/sys_vars/r/histogram_type_basic.result
+++ b/mysql-test/suite/sys_vars/r/histogram_type_basic.result
@@ -10,7 +10,7 @@ SET @@global.histogram_type = 1;
SET @@global.histogram_type = DEFAULT;
SELECT @@global.histogram_type;
@@global.histogram_type
-DOUBLE_PREC_HB
+JSON_HB
SET @@global.histogram_type = 0;
SELECT @@global.histogram_type;
@@global.histogram_type
diff --git a/mysql-test/suite/sys_vars/r/init_connect_grant.result b/mysql-test/suite/sys_vars/r/init_connect_grant.result
index 6c372670..2575052c 100644
--- a/mysql-test/suite/sys_vars/r/init_connect_grant.result
+++ b/mysql-test/suite/sys_vars/r/init_connect_grant.result
@@ -2,14 +2,14 @@ SET @global=@@global.init_connect;
#
# MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
#
-# Test that "SET init_connect" is not allowed without CONNECTION ADMIN or SUPER
+# Test that "SET init_connect" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL init_connect="SET @xxx=1";
-ERROR 42000: Access denied; you need (at least one of) the SUPER, CONNECTION ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the CONNECTION ADMIN privilege(s) for this operation
SET init_connect="SET @xxx=1";
ERROR HY000: Variable 'init_connect' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION init_connect="SET @xxx=1";
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'init_connect' is a GLOBAL variable and should be set with
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET init_connect" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL init_connect="SET @xxx=1";
-SET init_connect="SET @xxx=1";
-ERROR HY000: Variable 'init_connect' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION init_connect="SET @xxx=1";
-ERROR HY000: Variable 'init_connect' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.init_connect=@global;
diff --git a/mysql-test/suite/sys_vars/r/init_slave_grant.result b/mysql-test/suite/sys_vars/r/init_slave_grant.result
index 59639b92..9655498d 100644
--- a/mysql-test/suite/sys_vars/r/init_slave_grant.result
+++ b/mysql-test/suite/sys_vars/r/init_slave_grant.result
@@ -2,14 +2,14 @@
# MDEV-21966 Bind REPLICATION SLAVE ADMIN to a number of global system variables
#
SET @global=@@global.init_slave;
-# Test that "SET init_slave" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET init_slave" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL init_slave='SET @x=1';
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET init_slave='SET @x=1';
ERROR HY000: Variable 'init_slave' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION init_slave='SET @x=1';
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'init_slave' is a GLOBAL variable and should be set with S
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET init_slave" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL init_slave='SET @x=1';
-SET init_slave='SET @x=1';
-ERROR HY000: Variable 'init_slave' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION init_slave='SET @x=1';
-ERROR HY000: Variable 'init_slave' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.init_slave=@global;
diff --git a/mysql-test/suite/sys_vars/r/innodb_change_buffer_max_size_basic.result b/mysql-test/suite/sys_vars/r/innodb_change_buffer_max_size_basic.result
deleted file mode 100644
index 03f11ece..00000000
--- a/mysql-test/suite/sys_vars/r/innodb_change_buffer_max_size_basic.result
+++ /dev/null
@@ -1,77 +0,0 @@
-SET @start_global_value = @@global.innodb_change_buffer_max_size;
-SELECT @start_global_value;
-@start_global_value
-25
-Valid values are between 0 and 50
-select @@global.innodb_change_buffer_max_size between 0 and 50;
-@@global.innodb_change_buffer_max_size between 0 and 50
-1
-select @@global.innodb_change_buffer_max_size;
-@@global.innodb_change_buffer_max_size
-25
-select @@session.innodb_change_buffer_max_size;
-ERROR HY000: Variable 'innodb_change_buffer_max_size' is a GLOBAL variable
-show global variables like 'innodb_change_buffer_max_size';
-Variable_name Value
-innodb_change_buffer_max_size 25
-show session variables like 'innodb_change_buffer_max_size';
-Variable_name Value
-innodb_change_buffer_max_size 25
-select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_CHANGE_BUFFER_MAX_SIZE 25
-select * from information_schema.session_variables where variable_name='innodb_change_buffer_max_size';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_CHANGE_BUFFER_MAX_SIZE 25
-set global innodb_change_buffer_max_size=10;
-select @@global.innodb_change_buffer_max_size;
-@@global.innodb_change_buffer_max_size
-10
-select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_CHANGE_BUFFER_MAX_SIZE 10
-select * from information_schema.session_variables where variable_name='innodb_change_buffer_max_size';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_CHANGE_BUFFER_MAX_SIZE 10
-set session innodb_change_buffer_max_size=1;
-ERROR HY000: Variable 'innodb_change_buffer_max_size' is a GLOBAL variable and should be set with SET GLOBAL
-set global innodb_change_buffer_max_size=1.1;
-ERROR 42000: Incorrect argument type to variable 'innodb_change_buffer_max_size'
-set global innodb_change_buffer_max_size=1e1;
-ERROR 42000: Incorrect argument type to variable 'innodb_change_buffer_max_size'
-set global innodb_change_buffer_max_size="foo";
-ERROR 42000: Incorrect argument type to variable 'innodb_change_buffer_max_size'
-set global innodb_change_buffer_max_size=-7;
-Warnings:
-Warning 1292 Truncated incorrect innodb_change_buffer_max_size value: '-7'
-select @@global.innodb_change_buffer_max_size;
-@@global.innodb_change_buffer_max_size
-0
-select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_CHANGE_BUFFER_MAX_SIZE 0
-set global innodb_change_buffer_max_size=56;
-Warnings:
-Warning 1292 Truncated incorrect innodb_change_buffer_max_size value: '56'
-select @@global.innodb_change_buffer_max_size;
-@@global.innodb_change_buffer_max_size
-50
-select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_CHANGE_BUFFER_MAX_SIZE 50
-set global innodb_change_buffer_max_size=0;
-select @@global.innodb_change_buffer_max_size;
-@@global.innodb_change_buffer_max_size
-0
-set global innodb_change_buffer_max_size=50;
-select @@global.innodb_change_buffer_max_size;
-@@global.innodb_change_buffer_max_size
-50
-set global innodb_change_buffer_max_size=DEFAULT;
-select @@global.innodb_change_buffer_max_size;
-@@global.innodb_change_buffer_max_size
-25
-SET @@global.innodb_change_buffer_max_size = @start_global_value;
-SELECT @@global.innodb_change_buffer_max_size;
-@@global.innodb_change_buffer_max_size
-25
diff --git a/mysql-test/suite/sys_vars/r/innodb_change_buffering_basic.result b/mysql-test/suite/sys_vars/r/innodb_change_buffering_basic.result
deleted file mode 100644
index f3b7ac80..00000000
--- a/mysql-test/suite/sys_vars/r/innodb_change_buffering_basic.result
+++ /dev/null
@@ -1,73 +0,0 @@
-SET @start_global_value = @@global.innodb_change_buffering;
-SELECT @start_global_value;
-@start_global_value
-none
-Valid values are 'all', 'deletes', 'changes', 'inserts', 'none', 'purges'
-select @@global.innodb_change_buffering in ('all', 'deletes', 'changes', 'inserts', 'none', 'purges');
-@@global.innodb_change_buffering in ('all', 'deletes', 'changes', 'inserts', 'none', 'purges')
-1
-select @@global.innodb_change_buffering;
-@@global.innodb_change_buffering
-none
-select @@session.innodb_change_buffering;
-ERROR HY000: Variable 'innodb_change_buffering' is a GLOBAL variable
-show global variables like 'innodb_change_buffering';
-Variable_name Value
-innodb_change_buffering none
-show session variables like 'innodb_change_buffering';
-Variable_name Value
-innodb_change_buffering none
-select * from information_schema.global_variables where variable_name='innodb_change_buffering';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_CHANGE_BUFFERING none
-select * from information_schema.session_variables where variable_name='innodb_change_buffering';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_CHANGE_BUFFERING none
-set global innodb_change_buffering='none';
-Warnings:
-Warning 1287 '@@innodb_change_buffering' is deprecated and will be removed in a future release
-select @@global.innodb_change_buffering;
-@@global.innodb_change_buffering
-none
-select * from information_schema.global_variables where variable_name='innodb_change_buffering';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_CHANGE_BUFFERING none
-select * from information_schema.session_variables where variable_name='innodb_change_buffering';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_CHANGE_BUFFERING none
-set @@global.innodb_change_buffering='inserts';
-Warnings:
-Warning 1287 '@@innodb_change_buffering' is deprecated and will be removed in a future release
-select @@global.innodb_change_buffering;
-@@global.innodb_change_buffering
-inserts
-select * from information_schema.global_variables where variable_name='innodb_change_buffering';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_CHANGE_BUFFERING inserts
-select * from information_schema.session_variables where variable_name='innodb_change_buffering';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_CHANGE_BUFFERING inserts
-set session innodb_change_buffering='some';
-ERROR HY000: Variable 'innodb_change_buffering' is a GLOBAL variable and should be set with SET GLOBAL
-set @@session.innodb_change_buffering='some';
-ERROR HY000: Variable 'innodb_change_buffering' is a GLOBAL variable and should be set with SET GLOBAL
-set global innodb_change_buffering=1.1;
-ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering'
-set global innodb_change_buffering=1;
-Warnings:
-Warning 1287 '@@innodb_change_buffering' is deprecated and will be removed in a future release
-SELECT @@global.innodb_change_buffering;
-@@global.innodb_change_buffering
-inserts
-set global innodb_change_buffering=-2;
-ERROR 42000: Variable 'innodb_change_buffering' can't be set to the value of '-2'
-set global innodb_change_buffering=1e1;
-ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering'
-set global innodb_change_buffering='some';
-ERROR 42000: Variable 'innodb_change_buffering' can't be set to the value of 'some'
-SET @@global.innodb_change_buffering = @start_global_value;
-Warnings:
-Warning 1287 '@@innodb_change_buffering' is deprecated and will be removed in a future release
-SELECT @@global.innodb_change_buffering;
-@@global.innodb_change_buffering
-none
diff --git a/mysql-test/suite/sys_vars/r/innodb_change_buffering_debug_basic.result b/mysql-test/suite/sys_vars/r/innodb_change_buffering_debug_basic.result
deleted file mode 100644
index 2cb3fc76..00000000
--- a/mysql-test/suite/sys_vars/r/innodb_change_buffering_debug_basic.result
+++ /dev/null
@@ -1,67 +0,0 @@
-SET @start_global_value = @@global.innodb_change_buffering_debug;
-SELECT @start_global_value;
-@start_global_value
-0
-select @@global.innodb_change_buffering_debug in (0, 1);
-@@global.innodb_change_buffering_debug in (0, 1)
-1
-select @@global.innodb_change_buffering_debug;
-@@global.innodb_change_buffering_debug
-0
-select @@session.innodb_change_buffering_debug;
-ERROR HY000: Variable 'innodb_change_buffering_debug' is a GLOBAL variable
-show global variables like 'innodb_change_buffering_debug';
-Variable_name Value
-innodb_change_buffering_debug 0
-show session variables like 'innodb_change_buffering_debug';
-Variable_name Value
-innodb_change_buffering_debug 0
-select * from information_schema.global_variables where variable_name='innodb_change_buffering_debug';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_CHANGE_BUFFERING_DEBUG 0
-select * from information_schema.session_variables where variable_name='innodb_change_buffering_debug';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_CHANGE_BUFFERING_DEBUG 0
-set global innodb_change_buffering_debug=1;
-select @@global.innodb_change_buffering_debug;
-@@global.innodb_change_buffering_debug
-1
-select * from information_schema.global_variables where variable_name='innodb_change_buffering_debug';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_CHANGE_BUFFERING_DEBUG 1
-select * from information_schema.session_variables where variable_name='innodb_change_buffering_debug';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_CHANGE_BUFFERING_DEBUG 1
-set @@global.innodb_change_buffering_debug=0;
-select @@global.innodb_change_buffering_debug;
-@@global.innodb_change_buffering_debug
-0
-select * from information_schema.global_variables where variable_name='innodb_change_buffering_debug';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_CHANGE_BUFFERING_DEBUG 0
-select * from information_schema.session_variables where variable_name='innodb_change_buffering_debug';
-VARIABLE_NAME VARIABLE_VALUE
-INNODB_CHANGE_BUFFERING_DEBUG 0
-set session innodb_change_buffering_debug='some';
-ERROR HY000: Variable 'innodb_change_buffering_debug' is a GLOBAL variable and should be set with SET GLOBAL
-set @@session.innodb_change_buffering_debug='some';
-ERROR HY000: Variable 'innodb_change_buffering_debug' is a GLOBAL variable and should be set with SET GLOBAL
-set global innodb_change_buffering_debug=1.1;
-ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering_debug'
-set global innodb_change_buffering_debug='foo';
-ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering_debug'
-set global innodb_change_buffering_debug=-2;
-Warnings:
-Warning 1292 Truncated incorrect innodb_change_buffering_debug value: '-2'
-set global innodb_change_buffering_debug=1e1;
-ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering_debug'
-set global innodb_change_buffering_debug=2;
-Warnings:
-Warning 1292 Truncated incorrect innodb_change_buffering_debug value: '2'
-select @@global.innodb_change_buffering_debug;
-@@global.innodb_change_buffering_debug
-1
-SET @@global.innodb_change_buffering_debug = @start_global_value;
-SELECT @@global.innodb_change_buffering_debug;
-@@global.innodb_change_buffering_debug
-0
diff --git a/mysql-test/suite/sys_vars/r/innodb_defragment_basic.result b/mysql-test/suite/sys_vars/r/innodb_defragment_basic.result
deleted file mode 100644
index 916bb5ca..00000000
--- a/mysql-test/suite/sys_vars/r/innodb_defragment_basic.result
+++ /dev/null
@@ -1,18 +0,0 @@
-SET @orig = @@global.innodb_defragment;
-SELECT @orig;
-@orig
-0
-SET GLOBAL innodb_defragment = OFF;
-SELECT @@global.innodb_defragment;
-@@global.innodb_defragment
-0
-SET GLOBAL innodb_defragment = ON;
-SELECT @@global.innodb_defragment;
-@@global.innodb_defragment
-1
-SET GLOBAL innodb_defragment = 100;
-ERROR 42000: Variable 'innodb_defragment' can't be set to the value of '100'
-SELECT @@global.innodb_defragment;
-@@global.innodb_defragment
-1
-SET GLOBAL innodb_defragment = @orig;
diff --git a/mysql-test/suite/sys_vars/r/innodb_defragment_fill_factor_basic.result b/mysql-test/suite/sys_vars/r/innodb_defragment_fill_factor_basic.result
deleted file mode 100644
index 93a5af72..00000000
--- a/mysql-test/suite/sys_vars/r/innodb_defragment_fill_factor_basic.result
+++ /dev/null
@@ -1,37 +0,0 @@
-SET @start_innodb_defragment_fill_factor = @@global.innodb_defragment_fill_factor;
-SELECT @start_innodb_defragment_fill_factor;
-@start_innodb_defragment_fill_factor
-0.9
-SELECT COUNT(@@global.innodb_defragment_fill_factor);
-COUNT(@@global.innodb_defragment_fill_factor)
-1
-SET @@global.innodb_defragment_fill_factor = 0.77777777777777;
-SELECT @@global.innodb_defragment_fill_factor;
-@@global.innodb_defragment_fill_factor
-0.777778
-SET @@global.innodb_defragment_fill_factor = 1;
-SELECT @@global.innodb_defragment_fill_factor;
-@@global.innodb_defragment_fill_factor
-1.000000
-SET @@global.innodb_defragment_fill_factor = 0.7;
-SELECT @@global.innodb_defragment_fill_factor;
-@@global.innodb_defragment_fill_factor
-0.700000
-SET @@global.innodb_defragment_fill_factor = -1;
-Warnings:
-Warning 1292 Truncated incorrect innodb_defragment_fill_factor value: '-1'
-SELECT @@global.innodb_defragment_fill_factor;
-@@global.innodb_defragment_fill_factor
-0.700000
-SET @@global.innodb_defragment_fill_factor = 2;
-Warnings:
-Warning 1292 Truncated incorrect innodb_defragment_fill_factor value: '2'
-SELECT @@global.innodb_defragment_fill_factor;
-@@global.innodb_defragment_fill_factor
-1.000000
-SET @@global.innodb_defragment_fill_factor = "abc";
-ERROR 42000: Incorrect argument type to variable 'innodb_defragment_fill_factor'
-SELECT @@global.innodb_defragment_fill_factor;
-@@global.innodb_defragment_fill_factor
-1.000000
-SET @@global.innodb_defragment_fill_factor = @start_innodb_defragment_fill_factor;
diff --git a/mysql-test/suite/sys_vars/r/innodb_defragment_fill_factor_n_recs_basic.result b/mysql-test/suite/sys_vars/r/innodb_defragment_fill_factor_n_recs_basic.result
deleted file mode 100644
index a8ca081d..00000000
--- a/mysql-test/suite/sys_vars/r/innodb_defragment_fill_factor_n_recs_basic.result
+++ /dev/null
@@ -1,42 +0,0 @@
-SET @start_innodb_defragment_fill_factor_n_recs = @@global.innodb_defragment_fill_factor_n_recs;
-SELECT @start_innodb_defragment_fill_factor_n_recs;
-@start_innodb_defragment_fill_factor_n_recs
-20
-SELECT COUNT(@@global.innodb_defragment_fill_factor_n_recs);
-COUNT(@@global.innodb_defragment_fill_factor_n_recs)
-1
-SET @@global.innodb_defragment_fill_factor_n_recs = 50;
-SELECT @@global.innodb_defragment_fill_factor_n_recs;
-@@global.innodb_defragment_fill_factor_n_recs
-50
-SET @@global.innodb_defragment_fill_factor_n_recs = 100;
-SELECT @@global.innodb_defragment_fill_factor_n_recs;
-@@global.innodb_defragment_fill_factor_n_recs
-100
-SET @@global.innodb_defragment_fill_factor_n_recs = 1;
-SELECT @@global.innodb_defragment_fill_factor_n_recs;
-@@global.innodb_defragment_fill_factor_n_recs
-1
-SET @@global.innodb_defragment_fill_factor_n_recs = -1;
-Warnings:
-Warning 1292 Truncated incorrect innodb_defragment_fill_factor... value: '-1'
-SELECT @@global.innodb_defragment_fill_factor_n_recs;
-@@global.innodb_defragment_fill_factor_n_recs
-1
-SET @@global.innodb_defragment_fill_factor_n_recs = 10000;
-Warnings:
-Warning 1292 Truncated incorrect innodb_defragment_fill_factor... value: '10000'
-SELECT @@global.innodb_defragment_fill_factor_n_recs;
-@@global.innodb_defragment_fill_factor_n_recs
-100
-SET @@global.innodb_defragment_fill_factor_n_recs = 10.5;
-ERROR 42000: Incorrect argument type to variable 'innodb_defragment_fill_factor_n_recs'
-SELECT @@global.innodb_defragment_fill_factor_n_recs;
-@@global.innodb_defragment_fill_factor_n_recs
-100
-SET @@global.innodb_defragment_fill_factor_n_recs = "abc";
-ERROR 42000: Incorrect argument type to variable 'innodb_defragment_fill_factor_n_recs'
-SELECT @@global.innodb_defragment_fill_factor_n_recs;
-@@global.innodb_defragment_fill_factor_n_recs
-100
-SET @@global.innodb_defragment_fill_factor_n_recs = @start_innodb_defragment_fill_factor_n_recs;
diff --git a/mysql-test/suite/sys_vars/r/innodb_defragment_frequency_basic.result b/mysql-test/suite/sys_vars/r/innodb_defragment_frequency_basic.result
deleted file mode 100644
index d4314d65..00000000
--- a/mysql-test/suite/sys_vars/r/innodb_defragment_frequency_basic.result
+++ /dev/null
@@ -1,42 +0,0 @@
-SET @start_innodb_defragment_frequency = @@global.innodb_defragment_frequency;
-SELECT @start_innodb_defragment_frequency;
-@start_innodb_defragment_frequency
-40
-SELECT COUNT(@@global.innodb_defragment_frequency);
-COUNT(@@global.innodb_defragment_frequency)
-1
-SET @@global.innodb_defragment_frequency = 200;
-SELECT @@global.innodb_defragment_frequency;
-@@global.innodb_defragment_frequency
-200
-SET @@global.innodb_defragment_frequency = 1;
-SELECT @@global.innodb_defragment_frequency;
-@@global.innodb_defragment_frequency
-1
-SET @@global.innodb_defragment_frequency = 1000;
-SELECT @@global.innodb_defragment_frequency;
-@@global.innodb_defragment_frequency
-1000
-SET @@global.innodb_defragment_frequency = -1;
-Warnings:
-Warning 1292 Truncated incorrect innodb_defragment_frequency value: '-1'
-SELECT @@global.innodb_defragment_frequency;
-@@global.innodb_defragment_frequency
-1
-SET @@global.innodb_defragment_frequency = 10000;
-Warnings:
-Warning 1292 Truncated incorrect innodb_defragment_frequency value: '10000'
-SELECT @@global.innodb_defragment_frequency;
-@@global.innodb_defragment_frequency
-1000
-SET @@global.innodb_defragment_frequency = 10.5;
-ERROR 42000: Incorrect argument type to variable 'innodb_defragment_frequency'
-SELECT @@global.innodb_defragment_frequency;
-@@global.innodb_defragment_frequency
-1000
-SET @@global.innodb_defragment_frequency = "abc";
-ERROR 42000: Incorrect argument type to variable 'innodb_defragment_frequency'
-SELECT @@global.innodb_defragment_frequency;
-@@global.innodb_defragment_frequency
-1000
-SET @@global.innodb_defragment_frequency = @start_innodb_defragment_frequency;
diff --git a/mysql-test/suite/sys_vars/r/innodb_defragment_n_pages_basic.result b/mysql-test/suite/sys_vars/r/innodb_defragment_n_pages_basic.result
deleted file mode 100644
index 99b68b39..00000000
--- a/mysql-test/suite/sys_vars/r/innodb_defragment_n_pages_basic.result
+++ /dev/null
@@ -1,28 +0,0 @@
-SET @start_innodb_defragment_n_pages = @@global.innodb_defragment_n_pages;
-SELECT @start_innodb_defragment_n_pages;
-@start_innodb_defragment_n_pages
-7
-SELECT COUNT(@@global.innodb_defragment_n_pages);
-COUNT(@@global.innodb_defragment_n_pages)
-1
-SET @@global.innodb_defragment_n_pages = 1;
-Warnings:
-Warning 1292 Truncated incorrect innodb_defragment_n_pages value: '1'
-SELECT @@global.innodb_defragment_n_pages;
-@@global.innodb_defragment_n_pages
-2
-SET @@global.innodb_defragment_n_pages = 2;
-SELECT @@global.innodb_defragment_n_pages;
-@@global.innodb_defragment_n_pages
-2
-SET @@global.innodb_defragment_n_pages = 32;
-SELECT @@global.innodb_defragment_n_pages;
-@@global.innodb_defragment_n_pages
-32
-SET @@global.innodb_defragment_n_pages = 64;
-Warnings:
-Warning 1292 Truncated incorrect innodb_defragment_n_pages value: '64'
-SELECT @@global.innodb_defragment_n_pages;
-@@global.innodb_defragment_n_pages
-32
-SET @@global.innodb_defragment_n_pages = @start_innodb_defragment_n_pages;
diff --git a/mysql-test/suite/sys_vars/r/innodb_defragment_stats_accuracy_basic.result b/mysql-test/suite/sys_vars/r/innodb_defragment_stats_accuracy_basic.result
deleted file mode 100644
index 025dacdb..00000000
--- a/mysql-test/suite/sys_vars/r/innodb_defragment_stats_accuracy_basic.result
+++ /dev/null
@@ -1,33 +0,0 @@
-SET @start_innodb_defragment_stats_accuracy = @@global.innodb_defragment_stats_accuracy;
-SELECT @start_innodb_defragment_stats_accuracy;
-@start_innodb_defragment_stats_accuracy
-0
-SELECT COUNT(@@global.innodb_defragment_stats_accuracy);
-COUNT(@@global.innodb_defragment_stats_accuracy)
-1
-SET @@global.innodb_defragment_stats_accuracy = 1;
-SELECT @@global.innodb_defragment_stats_accuracy;
-@@global.innodb_defragment_stats_accuracy
-1
-SET @@global.innodb_defragment_stats_accuracy = 1000;
-SELECT @@global.innodb_defragment_stats_accuracy;
-@@global.innodb_defragment_stats_accuracy
-1000
-SET @@global.innodb_defragment_stats_accuracy = -1;
-Warnings:
-Warning 1292 Truncated incorrect innodb_defragment_stats_accuracy value: '-1'
-SELECT @@global.innodb_defragment_stats_accuracy;
-@@global.innodb_defragment_stats_accuracy
-0
-SET @@global.innodb_defragment_stats_accuracy = 1000000000000;
-Warnings:
-Warning 1292 Truncated incorrect innodb_defragment_stats_accuracy value: '1000000000000'
-SELECT @@global.innodb_defragment_stats_accuracy;
-@@global.innodb_defragment_stats_accuracy
-4294967295
-SET @@global.innodb_defragment_stats_accuracy = "abc";
-ERROR 42000: Incorrect argument type to variable 'innodb_defragment_stats_accuracy'
-SELECT @@global.innodb_defragment_stats_accuracy;
-@@global.innodb_defragment_stats_accuracy
-4294967295
-SET @@global.innodb_defragment_stats_accuracy = @start_innodb_defragment_stats_accuracy;
diff --git a/mysql-test/suite/sys_vars/r/innodb_doublewrite_basic.result b/mysql-test/suite/sys_vars/r/innodb_doublewrite_basic.result
index 4a5baf0a..9e93d943 100644
--- a/mysql-test/suite/sys_vars/r/innodb_doublewrite_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_doublewrite_basic.result
@@ -1,33 +1,25 @@
-'#---------------------BS_STVARS_026_01----------------------#'
-SELECT COUNT(@@GLOBAL.innodb_doublewrite);
-COUNT(@@GLOBAL.innodb_doublewrite)
-1
-1 Expected
-'#---------------------BS_STVARS_026_02----------------------#'
+SELECT @@GLOBAL.innodb_doublewrite;
+@@GLOBAL.innodb_doublewrite
+ON
+SET @@GLOBAL.innodb_doublewrite=0;
+SELECT @@GLOBAL.innodb_doublewrite;
+@@GLOBAL.innodb_doublewrite
+OFF
+SET @@GLOBAL.innodb_doublewrite=2;
+SET @@GLOBAL.innodb_doublewrite=3;
+ERROR 42000: Variable 'innodb_doublewrite' can't be set to the value of '3'
+SELECT @@GLOBAL.innodb_doublewrite;
+@@GLOBAL.innodb_doublewrite
+fast
SET @@GLOBAL.innodb_doublewrite=1;
-ERROR HY000: Variable 'innodb_doublewrite' is a read only variable
-Expected error 'Read only variable'
-SELECT COUNT(@@GLOBAL.innodb_doublewrite);
-COUNT(@@GLOBAL.innodb_doublewrite)
-1
-1 Expected
-'#---------------------BS_STVARS_026_03----------------------#'
-SELECT IF(@@GLOBAL.innodb_doublewrite, "ON", "OFF") = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_doublewrite';
-IF(@@GLOBAL.innodb_doublewrite, "ON", "OFF") = VARIABLE_VALUE
-1
-1 Expected
-SELECT COUNT(@@GLOBAL.innodb_doublewrite);
-COUNT(@@GLOBAL.innodb_doublewrite)
-1
-1 Expected
+SELECT @@GLOBAL.innodb_doublewrite;
+@@GLOBAL.innodb_doublewrite
+ON
SELECT COUNT(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_doublewrite';
COUNT(VARIABLE_VALUE)
1
-1 Expected
'#---------------------BS_STVARS_026_04----------------------#'
SELECT @@innodb_doublewrite = @@GLOBAL.innodb_doublewrite;
@@innodb_doublewrite = @@GLOBAL.innodb_doublewrite
@@ -48,6 +40,5 @@ SELECT COUNT(@@GLOBAL.innodb_doublewrite);
COUNT(@@GLOBAL.innodb_doublewrite)
1
1 Expected
-SELECT innodb_doublewrite = @@SESSION.innodb_doublewrite;
-ERROR 42S22: Unknown column 'innodb_doublewrite' in 'field list'
-Expected error 'Readonly variable'
+SELECT @@innodb_doublewrite = @@SESSION.innodb_doublewrite;
+ERROR HY000: Variable 'innodb_doublewrite' is a GLOBAL variable
diff --git a/mysql-test/suite/sys_vars/r/innodb_fil_make_page_dirty_debug_basic.result b/mysql-test/suite/sys_vars/r/innodb_fil_make_page_dirty_debug_basic.result
index db0de5e3..8bea1748 100644
--- a/mysql-test/suite/sys_vars/r/innodb_fil_make_page_dirty_debug_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_fil_make_page_dirty_debug_basic.result
@@ -17,8 +17,6 @@ ERROR HY000: Variable 'innodb_fil_make_page_dirty_debug' is a GLOBAL variable an
create table t1 (f1 int primary key) engine = innodb;
select space from information_schema.innodb_sys_tables
where name = 'test/t1' into @space_id;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
set global innodb_saved_page_number_debug = 0;
set global innodb_fil_make_page_dirty_debug = @space_id;
drop table t1;
diff --git a/mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result b/mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result
index 9780357e..9d755533 100644
--- a/mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_file_per_table_basic.result
@@ -9,18 +9,26 @@ COUNT(@@GLOBAL.innodb_file_per_table)
1 Expected
'#---------------------BS_STVARS_028_02----------------------#'
SET @@global.innodb_file_per_table = 0;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
SELECT @@global.innodb_file_per_table;
@@global.innodb_file_per_table
0
SET @@global.innodb_file_per_table ='On' ;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
SELECT @@global.innodb_file_per_table;
@@global.innodb_file_per_table
1
SET @@global.innodb_file_per_table ='Off' ;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
SELECT @@global.innodb_file_per_table;
@@global.innodb_file_per_table
0
SET @@global.innodb_file_per_table = 1;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
SELECT @@global.innodb_file_per_table;
@@global.innodb_file_per_table
1
@@ -64,6 +72,8 @@ COUNT(@@GLOBAL.innodb_file_per_table)
SELECT innodb_file_per_table = @@SESSION.innodb_file_per_table;
ERROR 42S22: Unknown column 'innodb_file_per_table' in 'field list'
SET @@global.innodb_file_per_table = @start_global_value;
+Warnings:
+Warning 1287 '@@innodb_file_per_table' is deprecated and will be removed in a future release
SELECT @@global.innodb_file_per_table;
@@global.innodb_file_per_table
1
diff --git a/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit,32bit.rdiff b/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit,32bit.rdiff
index cd9a004a..79e15420 100644
--- a/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit,32bit.rdiff
+++ b/mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit,32bit.rdiff
@@ -1,5 +1,5 @@
---- mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit.result 2019-05-07 15:09:57.220599318 +0530
-+++ mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit.reject 2019-05-07 15:10:20.012718538 +0530
+--- mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit.result
++++ mysql-test/suite/sys_vars/r/innodb_ft_result_cache_limit.reject
@@ -1,5 +1,7 @@
set global innodb_ft_result_cache_limit=5000000000;
+Warnings:
diff --git a/mysql-test/suite/sys_vars/r/innodb_saved_page_number_debug_basic.result b/mysql-test/suite/sys_vars/r/innodb_saved_page_number_debug_basic.result
index 2096e65f..1fc959f4 100644
--- a/mysql-test/suite/sys_vars/r/innodb_saved_page_number_debug_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_saved_page_number_debug_basic.result
@@ -17,8 +17,6 @@ ERROR HY000: Variable 'innodb_saved_page_number_debug' is a GLOBAL variable and
create table t1 (f1 int primary key) engine = innodb;
select space from information_schema.innodb_sys_tables
where name = 'test/t1' into @space_id;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
set global innodb_saved_page_number_debug = 0;
set global innodb_fil_make_page_dirty_debug = @space_id;
drop table t1;
diff --git a/mysql-test/suite/sys_vars/r/lc_time_names_basic.result b/mysql-test/suite/sys_vars/r/lc_time_names_basic.result
index c1896a0c..2cd5fa81 100644
--- a/mysql-test/suite/sys_vars/r/lc_time_names_basic.result
+++ b/mysql-test/suite/sys_vars/r/lc_time_names_basic.result
@@ -456,12 +456,6 @@ SET @@session.lc_time_names=sq_AL;
SELECT @@session.lc_time_names;
@@session.lc_time_names
sq_AL
-SET @@session.lc_time_names=sr_YU;
-Warnings:
-Warning 1287 'sr_YU' is deprecated and will be removed in a future release. Please use sr_RS instead
-SELECT @@session.lc_time_names;
-@@session.lc_time_names
-sr_RS
SET @@session.lc_time_names=sv_FI;
SELECT @@session.lc_time_names;
@@session.lc_time_names
@@ -903,12 +897,6 @@ SET @@global.lc_time_names=sq_AL;
SELECT @@global.lc_time_names;
@@global.lc_time_names
sq_AL
-SET @@global.lc_time_names=sr_YU;
-Warnings:
-Warning 1287 'sr_YU' is deprecated and will be removed in a future release. Please use sr_RS instead
-SELECT @@global.lc_time_names;
-@@global.lc_time_names
-sr_RS
SET @@global.lc_time_names=sv_FI;
SELECT @@global.lc_time_names;
@@global.lc_time_names
@@ -1028,7 +1016,11 @@ SELECT @@lc_time_names;
@@lc_time_names
ka_GE
SET @@lc_time_names = 112;
-ERROR HY000: Unknown locale: '112'
+SELECT @@lc_time_names;
+@@lc_time_names
+sw_KE
+SET @@lc_time_names = 113;
+ERROR HY000: Unknown locale: '113'
'#--------------------FN_DYNVARS_060_10-------------------------#'
SET @@lc_time_names = en_EN;
ERROR HY000: Unknown locale: 'en_EN'
@@ -1042,6 +1034,8 @@ SET @@lc_time_names = 'en US';
ERROR HY000: Unknown locale: 'en US'
SET @@lc_time_names = 'enUS';
ERROR HY000: Unknown locale: 'enUS'
+SET @@session.lc_time_names=sr_YU;
+ERROR HY000: Unknown locale: 'sr_YU'
SET @@lc_time_names = true;
SELECT @@lc_time_names AS res_with_true;
res_with_true
diff --git a/mysql-test/suite/sys_vars/r/log_bin_compress_grant.result b/mysql-test/suite/sys_vars/r/log_bin_compress_grant.result
index f75f22a7..1f0220a8 100644
--- a/mysql-test/suite/sys_vars/r/log_bin_compress_grant.result
+++ b/mysql-test/suite/sys_vars/r/log_bin_compress_grant.result
@@ -2,14 +2,14 @@
# MDEV-21963 Bind BINLOG ADMIN to a number of global system variables
#
SET @global=@@global.log_bin_compress;
-# Test that "SET log_bin_compress" is not allowed without BINLOG ADMIN or SUPER
+# Test that "SET log_bin_compress" is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL log_bin_compress=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET log_bin_compress=1;
ERROR HY000: Variable 'log_bin_compress' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION log_bin_compress=1;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'log_bin_compress' is a GLOBAL variable and should be set
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET log_bin_compress" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL log_bin_compress=1;
-SET log_bin_compress=1;
-ERROR HY000: Variable 'log_bin_compress' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION log_bin_compress=1;
-ERROR HY000: Variable 'log_bin_compress' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.log_bin_compress=@global;
diff --git a/mysql-test/suite/sys_vars/r/log_bin_compress_min_len_grant.result b/mysql-test/suite/sys_vars/r/log_bin_compress_min_len_grant.result
index b1ccafb1..2f4590b4 100644
--- a/mysql-test/suite/sys_vars/r/log_bin_compress_min_len_grant.result
+++ b/mysql-test/suite/sys_vars/r/log_bin_compress_min_len_grant.result
@@ -2,14 +2,14 @@
# MDEV-21963 Bind BINLOG ADMIN to a number of global system variables
#
SET @global=@@global.log_bin_compress_min_len;
-# Test that "SET log_bin_compress_min_len" is not allowed without BINLOG ADMIN or SUPER
+# Test that "SET log_bin_compress_min_len" is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL log_bin_compress_min_len=512;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET log_bin_compress_min_len=512;
ERROR HY000: Variable 'log_bin_compress_min_len' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION log_bin_compress_min_len=512;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'log_bin_compress_min_len' is a GLOBAL variable and should
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET log_bin_compress_min_len" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL log_bin_compress_min_len=512;
-SET log_bin_compress_min_len=512;
-ERROR HY000: Variable 'log_bin_compress_min_len' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION log_bin_compress_min_len=512;
-ERROR HY000: Variable 'log_bin_compress_min_len' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.log_bin_compress_min_len=@global;
diff --git a/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_grant.result b/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_grant.result
index ef9af94d..5d3948bf 100644
--- a/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_grant.result
+++ b/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_grant.result
@@ -2,14 +2,14 @@
# MDEV-21963 Bind BINLOG ADMIN to a number of global system variables
#
SET @global=@@global.log_bin_trust_function_creators;
-# Test that "SET log_bin_trust_function_creators" is not allowed without BINLOG ADMIN or SUPER
+# Test that "SET log_bin_trust_function_creators" is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL log_bin_trust_function_creators=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET log_bin_trust_function_creators=1;
ERROR HY000: Variable 'log_bin_trust_function_creators' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION log_bin_trust_function_creators=1;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'log_bin_trust_function_creators' is a GLOBAL variable and
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET log_bin_trust_function_creators" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL log_bin_trust_function_creators=1;
-SET log_bin_trust_function_creators=1;
-ERROR HY000: Variable 'log_bin_trust_function_creators' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION log_bin_trust_function_creators=1;
-ERROR HY000: Variable 'log_bin_trust_function_creators' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.log_bin_trust_function_creators=@global;
diff --git a/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result b/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result
index 95916d8c..41a15e43 100644
--- a/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result
+++ b/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result
@@ -11,6 +11,8 @@ SET GLOBAL log_output = 'file,table';
SET GLOBAL slow_query_log = on;
SET SESSION long_query_time = 0;
SET SESSION log_slow_admin_statements = on;
+Warnings:
+Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead
ALTER TABLE log_slow_admin_statements ADD COLUMN k INT DEFAULT 17;
CREATE PROCEDURE add_rows()
BEGIN
@@ -42,22 +44,32 @@ SET @@global.log_output= @old_log_output;
SET @@global.slow_query_log= @old_slow_query_log;
SET @@session.long_query_time= @old_long_query_time;
SET @@global.log_slow_admin_statements= @old_log_slow_admin_statements;
+Warnings:
+Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead
DROP PROCEDURE add_rows;
TRUNCATE TABLE mysql.slow_log;
SET @save_log_slow_disabled_statements= @@global.log_slow_disabled_statements;
SET @@SESSION.log_slow_admin_statements= TRUE;
+Warnings:
+Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead
select @@SESSION.log_slow_disabled_statements;
@@SESSION.log_slow_disabled_statements
sp
SET @@SESSION.log_slow_admin_statements= FALSE;
+Warnings:
+Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead
select @@SESSION.log_slow_disabled_statements;
@@SESSION.log_slow_disabled_statements
admin,sp
SET @@GLOBAL.log_slow_admin_statements= TRUE;
+Warnings:
+Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead
select @@GLOBAL.log_slow_disabled_statements;
@@GLOBAL.log_slow_disabled_statements
sp
SET @@GLOBAL.log_slow_admin_statements= FALSE;
+Warnings:
+Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead
select @@GLOBAL.log_slow_disabled_statements;
@@GLOBAL.log_slow_disabled_statements
admin,sp
diff --git a/mysql-test/suite/sys_vars/r/master_verify_checksum_grant.result b/mysql-test/suite/sys_vars/r/master_verify_checksum_grant.result
index 4791e4cd..8d773f35 100644
--- a/mysql-test/suite/sys_vars/r/master_verify_checksum_grant.result
+++ b/mysql-test/suite/sys_vars/r/master_verify_checksum_grant.result
@@ -2,14 +2,14 @@
# MDEV-21972 Bind REPLICATION MASTER ADMIN to master_verify_checksum
#
SET @global=@@global.master_verify_checksum;
-# Test that "SET master_verify_checksum" is not allowed without REPLICATION MASTER ADMIN or SUPER
+# Test that "SET master_verify_checksum" is not allowed without REPLICATION MASTER ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION MASTER ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION MASTER ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL master_verify_checksum=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION MASTER ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION MASTER ADMIN privilege(s) for this operation
SET master_verify_checksum=1;
ERROR HY000: Variable 'master_verify_checksum' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION master_verify_checksum=1;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'master_verify_checksum' is a GLOBAL variable and should b
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET master_verify_checksum" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL master_verify_checksum=1;
-SET master_verify_checksum=1;
-ERROR HY000: Variable 'master_verify_checksum' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION master_verify_checksum=1;
-ERROR HY000: Variable 'master_verify_checksum' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.master_verify_checksum=@global;
diff --git a/mysql-test/suite/sys_vars/r/max_binlog_cache_size_grant.result b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_grant.result
index 350194c4..f1108553 100644
--- a/mysql-test/suite/sys_vars/r/max_binlog_cache_size_grant.result
+++ b/mysql-test/suite/sys_vars/r/max_binlog_cache_size_grant.result
@@ -2,14 +2,14 @@
# MDEV-21963 Bind BINLOG ADMIN to a number of global system variables
#
SET @global=@@global.max_binlog_cache_size;
-# Test that "SET max_binlog_cache_size" is not allowed without BINLOG ADMIN or SUPER
+# Test that "SET max_binlog_cache_size" is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL max_binlog_cache_size=4096;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET max_binlog_cache_size=4096;
ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION max_binlog_cache_size=4096;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable and should be
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET max_binlog_cache_size" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL max_binlog_cache_size=4096;
-SET max_binlog_cache_size=4096;
-ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION max_binlog_cache_size=4096;
-ERROR HY000: Variable 'max_binlog_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.max_binlog_cache_size=@global;
diff --git a/mysql-test/suite/sys_vars/r/max_binlog_size_grant.result b/mysql-test/suite/sys_vars/r/max_binlog_size_grant.result
index 34e1fde7..6937e82d 100644
--- a/mysql-test/suite/sys_vars/r/max_binlog_size_grant.result
+++ b/mysql-test/suite/sys_vars/r/max_binlog_size_grant.result
@@ -2,14 +2,14 @@
# MDEV-21963 Bind BINLOG ADMIN to a number of global system variables
#
SET @global=@@global.max_binlog_size;
-# Test that "SET max_binlog_size" is not allowed without BINLOG ADMIN or SUPER
+# Test that "SET max_binlog_size" is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL max_binlog_size=4096;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET max_binlog_size=4096;
ERROR HY000: Variable 'max_binlog_size' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION max_binlog_size=4096;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'max_binlog_size' is a GLOBAL variable and should be set w
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET max_binlog_size" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL max_binlog_size=4096;
-SET max_binlog_size=4096;
-ERROR HY000: Variable 'max_binlog_size' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION max_binlog_size=4096;
-ERROR HY000: Variable 'max_binlog_size' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.max_binlog_size=@global;
diff --git a/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_grant.result b/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_grant.result
index 2ddd164f..c6a01661 100644
--- a/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_grant.result
+++ b/mysql-test/suite/sys_vars/r/max_binlog_stmt_cache_size_grant.result
@@ -2,14 +2,14 @@
# MDEV-21963 Bind BINLOG ADMIN to a number of global system variables
#
SET @global=@@global.max_binlog_stmt_cache_size;
-# Test that "SET max_binlog_stmt_cache_size" is not allowed without BINLOG ADMIN or SUPER
+# Test that "SET max_binlog_stmt_cache_size" is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL max_binlog_stmt_cache_size=4096;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET max_binlog_stmt_cache_size=4096;
ERROR HY000: Variable 'max_binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION max_binlog_stmt_cache_size=4096;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'max_binlog_stmt_cache_size' is a GLOBAL variable and shou
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET max_binlog_stmt_cache_size" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL max_binlog_stmt_cache_size=4096;
-SET max_binlog_stmt_cache_size=4096;
-ERROR HY000: Variable 'max_binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION max_binlog_stmt_cache_size=4096;
-ERROR HY000: Variable 'max_binlog_stmt_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.max_binlog_stmt_cache_size=@global;
diff --git a/mysql-test/suite/sys_vars/r/max_binlog_total_size_basic.result b/mysql-test/suite/sys_vars/r/max_binlog_total_size_basic.result
new file mode 100644
index 00000000..898d3bcd
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/max_binlog_total_size_basic.result
@@ -0,0 +1,41 @@
+select @@global.max_binlog_total_size;
+@@global.max_binlog_total_size
+0
+select @@session.max_binlog_total_size;
+ERROR HY000: Variable 'max_binlog_total_size' is a GLOBAL variable
+show global variables like 'max_binlog_total_size';
+Variable_name Value
+max_binlog_total_size 0
+show session variables like 'max_binlog_total_size';
+Variable_name Value
+max_binlog_total_size 0
+select * from information_schema.global_variables where variable_name='max_binlog_total_size';
+VARIABLE_NAME VARIABLE_VALUE
+MAX_BINLOG_TOTAL_SIZE 0
+select * from information_schema.session_variables where variable_name='max_binlog_total_size';
+VARIABLE_NAME VARIABLE_VALUE
+MAX_BINLOG_TOTAL_SIZE 0
+set global max_binlog_total_size=1;
+select @@global.max_binlog_total_size, @@global.binlog_space_limit;
+@@global.max_binlog_total_size @@global.binlog_space_limit
+1 1
+set global max_binlog_total_size=1;
+select @@global.max_binlog_total_size;
+@@global.max_binlog_total_size
+1
+set global binlog_space_limit=2;
+select @@global.max_binlog_total_size, @@global.binlog_space_limit;
+@@global.max_binlog_total_size @@global.binlog_space_limit
+2 2
+set session max_binlog_total_size=1;
+ERROR HY000: Variable 'max_binlog_total_size' is a GLOBAL variable and should be set with SET GLOBAL
+set global max_binlog_total_size=default;
+CREATE USER user1@localhost;
+connect con2,localhost,user1,,;
+set global max_binlog_total_size=1;
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
+set global binlog_space_limit=1;
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
+disconnect con2;
+connection default;
+DROP USER user1@localhost;
diff --git a/mysql-test/suite/sys_vars/r/max_connect_errors_grant.result b/mysql-test/suite/sys_vars/r/max_connect_errors_grant.result
index 527a4eca..be145cb6 100644
--- a/mysql-test/suite/sys_vars/r/max_connect_errors_grant.result
+++ b/mysql-test/suite/sys_vars/r/max_connect_errors_grant.result
@@ -2,14 +2,14 @@ SET @global=@@global.max_connect_errors;
#
# MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
#
-# Test that "SET max_connect_errors" is not allowed without CONNECTION ADMIN or SUPER
+# Test that "SET max_connect_errors" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL max_connect_errors=10;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, CONNECTION ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the CONNECTION ADMIN privilege(s) for this operation
SET max_connect_errors=10;
ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION max_connect_errors=10;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable and should be se
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET max_connect_errors" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL max_connect_errors=10;
-SET max_connect_errors=10;
-ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION max_connect_errors=10;
-ERROR HY000: Variable 'max_connect_errors' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.max_connect_errors=@global;
diff --git a/mysql-test/suite/sys_vars/r/max_connections_grant.result b/mysql-test/suite/sys_vars/r/max_connections_grant.result
index e55904d4..7cd67847 100644
--- a/mysql-test/suite/sys_vars/r/max_connections_grant.result
+++ b/mysql-test/suite/sys_vars/r/max_connections_grant.result
@@ -2,14 +2,14 @@ SET @global=@@global.max_connections;
#
# MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
#
-# Test that "SET max_connections" is not allowed without CONNECTION ADMIN or SUPER
+# Test that "SET max_connections" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL max_connections=10;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, CONNECTION ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the CONNECTION ADMIN privilege(s) for this operation
SET max_connections=10;
ERROR HY000: Variable 'max_connections' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION max_connections=10;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'max_connections' is a GLOBAL variable and should be set w
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET max_connections" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL max_connections=10;
-SET max_connections=10;
-ERROR HY000: Variable 'max_connections' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION max_connections=10;
-ERROR HY000: Variable 'max_connections' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.max_connections=@global;
diff --git a/mysql-test/suite/sys_vars/r/max_join_size_basic.result b/mysql-test/suite/sys_vars/r/max_join_size_basic.result
index b87de2bc..784d0d0f 100644
--- a/mysql-test/suite/sys_vars/r/max_join_size_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_join_size_basic.result
@@ -21,25 +21,25 @@ select * from information_schema.session_variables where variable_name='max_join
VARIABLE_NAME VARIABLE_VALUE
MAX_JOIN_SIZE 18446744073709551615
set global max_join_size=10;
-set session max_join_size=20;
+set session max_join_size=100;
select @@global.max_join_size;
@@global.max_join_size
10
select @@session.max_join_size;
@@session.max_join_size
-20
+100
show global variables like 'max_join_size';
Variable_name Value
max_join_size 10
show session variables like 'max_join_size';
Variable_name Value
-max_join_size 20
+max_join_size 100
select * from information_schema.global_variables where variable_name='max_join_size';
VARIABLE_NAME VARIABLE_VALUE
MAX_JOIN_SIZE 10
select * from information_schema.session_variables where variable_name='max_join_size';
VARIABLE_NAME VARIABLE_VALUE
-MAX_JOIN_SIZE 20
+MAX_JOIN_SIZE 100
set global max_join_size=1.1;
ERROR 42000: Incorrect argument type to variable 'max_join_size'
set global max_join_size=1e1;
diff --git a/mysql-test/suite/sys_vars/r/max_join_size_func.result b/mysql-test/suite/sys_vars/r/max_join_size_func.result
index cacc918e..d46b89d1 100644
--- a/mysql-test/suite/sys_vars/r/max_join_size_func.result
+++ b/mysql-test/suite/sys_vars/r/max_join_size_func.result
@@ -39,19 +39,19 @@ id name id name
connect test_con1, localhost, root,,;
connection test_con1;
## Setting value of max_join_size ##
-SET @@session.max_join_size=8;
+SET @@session.max_join_size=4;
## Since total joins are more than max_join_size value so error will occur ##
SELECT * FROM t1 INNER JOIN t2 ON t1.id = t2.id;
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
'#--------------------FN_DYNVARS_079_03-------------------------#'
## Setting global value of variable ##
-SET @@global.max_join_size=8;
+SET @@global.max_join_size=4;
connect test_con2, localhost, root,,;
connection test_con2;
## Verifying value of max_join_size ##
SELECT @@global.max_join_size;
@@global.max_join_size
-8
+4
## Since total joins are more than max_join_size value so error will occur ##
SELECT * FROM t1 INNER JOIN t2 ON t1.id = t2.id;
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
diff --git a/mysql-test/suite/sys_vars/r/max_password_errors_grant.result b/mysql-test/suite/sys_vars/r/max_password_errors_grant.result
index 4ae0dfb8..58817d3c 100644
--- a/mysql-test/suite/sys_vars/r/max_password_errors_grant.result
+++ b/mysql-test/suite/sys_vars/r/max_password_errors_grant.result
@@ -2,14 +2,14 @@ SET @global=@@global.max_password_errors;
#
# MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
#
-# Test that "SET max_password_errors" is not allowed without CONNECTION ADMIN or SUPER
+# Test that "SET max_password_errors" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL max_password_errors=10;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, CONNECTION ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the CONNECTION ADMIN privilege(s) for this operation
SET max_password_errors=10;
ERROR HY000: Variable 'max_password_errors' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION max_password_errors=10;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'max_password_errors' is a GLOBAL variable and should be s
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET max_password_errors" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL max_password_errors=10;
-SET max_password_errors=10;
-ERROR HY000: Variable 'max_password_errors' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION max_password_errors=10;
-ERROR HY000: Variable 'max_password_errors' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.max_password_errors=@global;
diff --git a/mysql-test/suite/sys_vars/r/max_tmp_tables_basic.result b/mysql-test/suite/sys_vars/r/max_tmp_tables_basic.result
deleted file mode 100644
index dd00d1a0..00000000
--- a/mysql-test/suite/sys_vars/r/max_tmp_tables_basic.result
+++ /dev/null
@@ -1,251 +0,0 @@
-SET @start_global_value = @@global.max_tmp_tables;
-SELECT @start_global_value;
-@start_global_value
-32
-SET @start_session_value = @@session.max_tmp_tables;
-SELECT @start_session_value;
-@start_session_value
-32
-'#--------------------FN_DYNVARS_086_01-------------------------#'
-SET @@global.max_tmp_tables = 1000;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-SET @@global.max_tmp_tables = DEFAULT;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-32
-SET @@session.max_tmp_tables = 1000;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-SET @@session.max_tmp_tables = DEFAULT;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-32
-'#--------------------FN_DYNVARS_086_02-------------------------#'
-SET @@global.max_tmp_tables = DEFAULT;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-SELECT @@global.max_tmp_tables = 32;
-@@global.max_tmp_tables = 32
-1
-SET @@session.max_tmp_tables = DEFAULT;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-SELECT @@session.max_tmp_tables = 32;
-@@session.max_tmp_tables = 32
-1
-'#--------------------FN_DYNVARS_086_03-------------------------#'
-SET @@global.max_tmp_tables = 1;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-1
-SET @@global.max_tmp_tables = 2;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-2
-SET @@global.max_tmp_tables = 65536;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-65536
-SET @@global.max_tmp_tables = 4294967295;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-4294967295
-SET @@global.max_tmp_tables = 4294967294;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-4294967294
-'#--------------------FN_DYNVARS_086_04-------------------------#'
-SET @@session.max_tmp_tables = 1;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-1
-SET @@session.max_tmp_tables = 2;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-2
-SET @@session.max_tmp_tables = 65536;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-65536
-SET @@session.max_tmp_tables = 4294967295;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-4294967295
-SET @@session.max_tmp_tables = 4294967294;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-4294967294
-'#------------------FN_DYNVARS_086_05-----------------------#'
-SET @@global.max_tmp_tables = -1024;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-Warning 1292 Truncated incorrect max_tmp_tables value: '-1024'
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-1
-SET @@global.max_tmp_tables = 4294967296;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-Warning 1292 Truncated incorrect max_tmp_tables value: '4294967296'
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-4294967295
-SET @@global.max_tmp_tables = -1;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-Warning 1292 Truncated incorrect max_tmp_tables value: '-1'
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-1
-SET @@global.max_tmp_tables = 429496729500;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-Warning 1292 Truncated incorrect max_tmp_tables value: '429496729500'
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-4294967295
-SET @@global.max_tmp_tables = 65530.34;
-ERROR 42000: Incorrect argument type to variable 'max_tmp_tables'
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-4294967295
-SET @@global.max_tmp_tables = test;
-ERROR 42000: Incorrect argument type to variable 'max_tmp_tables'
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-4294967295
-SET @@session.max_tmp_tables = 4294967296;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-Warning 1292 Truncated incorrect max_tmp_tables value: '4294967296'
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-4294967295
-SET @@session.max_tmp_tables = -1;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-Warning 1292 Truncated incorrect max_tmp_tables value: '-1'
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-1
-SET @@session.max_tmp_tables = 429496729500;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-Warning 1292 Truncated incorrect max_tmp_tables value: '429496729500'
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-4294967295
-SET @@session.max_tmp_tables = -001;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-Warning 1292 Truncated incorrect max_tmp_tables value: '-1'
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-1
-SET @@session.max_tmp_tables = 65530.34;
-ERROR 42000: Incorrect argument type to variable 'max_tmp_tables'
-SET @@session.max_tmp_tables = 10737418241;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-Warning 1292 Truncated incorrect max_tmp_tables value: '10737418241'
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-4294967295
-SET @@session.max_tmp_tables = test;
-ERROR 42000: Incorrect argument type to variable 'max_tmp_tables'
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-4294967295
-'#------------------FN_DYNVARS_086_06-----------------------#'
-SELECT @@global.max_tmp_tables = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='max_tmp_tables';
-@@global.max_tmp_tables = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_086_07-----------------------#'
-SELECT @@session.max_tmp_tables = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='max_tmp_tables';
-@@session.max_tmp_tables = VARIABLE_VALUE
-1
-'#------------------FN_DYNVARS_086_08-----------------------#'
-SET @@global.max_tmp_tables = TRUE;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-1
-SET @@global.max_tmp_tables = FALSE;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-Warning 1292 Truncated incorrect max_tmp_tables value: '0'
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-1
-'#---------------------FN_DYNVARS_086_09----------------------#'
-SET @@global.max_tmp_tables = 20;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-SELECT @@max_tmp_tables = @@global.max_tmp_tables;
-@@max_tmp_tables = @@global.max_tmp_tables
-0
-'#---------------------FN_DYNVARS_086_10----------------------#'
-SET @@max_tmp_tables = 255;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-SELECT @@max_tmp_tables = @@local.max_tmp_tables;
-@@max_tmp_tables = @@local.max_tmp_tables
-1
-SELECT @@local.max_tmp_tables = @@session.max_tmp_tables;
-@@local.max_tmp_tables = @@session.max_tmp_tables
-1
-'#---------------------FN_DYNVARS_086_11----------------------#'
-SET max_tmp_tables = 102;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-SELECT @@max_tmp_tables;
-@@max_tmp_tables
-102
-SELECT local.max_tmp_tables;
-ERROR 42S02: Unknown table 'local' in field list
-SELECT session.max_tmp_tables;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT max_tmp_tables = @@session.max_tmp_tables;
-ERROR 42S22: Unknown column 'max_tmp_tables' in 'field list'
-SET @@global.max_tmp_tables = @start_global_value;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-SELECT @@global.max_tmp_tables;
-@@global.max_tmp_tables
-32
-SET @@session.max_tmp_tables = @start_session_value;
-Warnings:
-Warning 1287 '@@max_tmp_tables' is deprecated and will be removed in a future release
-SELECT @@session.max_tmp_tables;
-@@session.max_tmp_tables
-32
diff --git a/mysql-test/suite/sys_vars/r/mdev_15935.result b/mysql-test/suite/sys_vars/r/mdev_15935.result
new file mode 100644
index 00000000..551cd539
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/mdev_15935.result
@@ -0,0 +1,10 @@
+#
+# test cleanup of sys_var classes
+#
+set global init_connect=".................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................";
+ERROR HY000: String '......................................................................' is too long for init_connect (should be no longer than 2000)
+set global ft_boolean_syntax=".................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................";
+ERROR HY000: String '......................................................................' is too long for ft_boolean_syntax (should be no longer than 2000)
+#
+# end of test mdev_15935
+#
diff --git a/mysql-test/suite/sys_vars/r/mdev_32254.result b/mysql-test/suite/sys_vars/r/mdev_32254.result
new file mode 100644
index 00000000..5188c56e
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/mdev_32254.result
@@ -0,0 +1,13 @@
+#
+# MDEV-32254 Server crashes when adding records to table after setting redirect_url with empty variable
+#
+set @old_redirect_url=@@global.redirect_url;
+set global redirect_url=@empty_value;
+ERROR 42000: Variable 'redirect_url' can't be set to the value of 'NULL'
+CREATE TABLE t (c1 INT) ENGINE=INNODB;
+INSERT INTO t VALUES (1),(1);
+drop table t;
+set global redirect_url=@old_redirect_url;
+#
+# end of test mdev_32254
+#
diff --git a/mysql-test/suite/sys_vars/r/mdev_32525.result b/mysql-test/suite/sys_vars/r/mdev_32525.result
new file mode 100644
index 00000000..fd7af58d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/mdev_32525.result
@@ -0,0 +1,11 @@
+#
+# MDEV-32525 Server startup fails to validate invalid redirect_url
+#
+FOUND 1 /\[ERROR\].*Invalid redirect_url: mariadbaaa://test/ in mdev_32525.err
+# restart
+select @@redirect_url;
+@@redirect_url
+
+#
+# end of test mdev_32525
+#
diff --git a/mysql-test/suite/sys_vars/r/mdev_32640.result b/mysql-test/suite/sys_vars/r/mdev_32640.result
new file mode 100644
index 00000000..ea93f3a7
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/mdev_32640.result
@@ -0,0 +1,15 @@
+PREPARE s_1 FROM 'SHOW RELAYLOG EVENTS';
+/* 1 */ SET default_master_connection='MASTER';
+/* 1 */ EXECUTE s_1;
+ERROR HY000: There is no master connection 'MASTER'
+/* 2 */ SET default_master_connection='MASTER';
+/* 2 */ EXECUTE s_1;
+ERROR HY000: There is no master connection 'MASTER'
+create procedure p() SHOW RELAYLOG EVENTS;
+/* 1 */ SET default_master_connection='MASTER';
+/* 1 */ call p;
+ERROR HY000: There is no master connection 'MASTER'
+/* 2 */ SET default_master_connection='MASTER';
+/* 2 */ call p;
+ERROR HY000: There is no master connection 'MASTER'
+drop procedure p;
diff --git a/mysql-test/suite/sys_vars/r/old_alter_table_basic.result b/mysql-test/suite/sys_vars/r/old_alter_table_basic.result
deleted file mode 100644
index 3cc7fff7..00000000
--- a/mysql-test/suite/sys_vars/r/old_alter_table_basic.result
+++ /dev/null
@@ -1,130 +0,0 @@
-SET @start_global_value = @@global.old_alter_table;
-SELECT @start_global_value;
-@start_global_value
-DEFAULT
-select @@global.old_alter_table;
-@@global.old_alter_table
-DEFAULT
-select @@session.old_alter_table;
-@@session.old_alter_table
-DEFAULT
-show global variables like 'old_alter_table';
-Variable_name Value
-old_alter_table DEFAULT
-show session variables like 'old_alter_table';
-Variable_name Value
-old_alter_table DEFAULT
-select * from information_schema.global_variables where variable_name='old_alter_table';
-VARIABLE_NAME VARIABLE_VALUE
-OLD_ALTER_TABLE DEFAULT
-select * from information_schema.session_variables where variable_name='old_alter_table';
-VARIABLE_NAME VARIABLE_VALUE
-OLD_ALTER_TABLE DEFAULT
-set global old_alter_table=1;
-Warnings:
-Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
-set session old_alter_table=1;
-Warnings:
-Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
-select @@global.old_alter_table;
-@@global.old_alter_table
-COPY
-select @@session.old_alter_table;
-@@session.old_alter_table
-COPY
-show global variables like 'old_alter_table';
-Variable_name Value
-old_alter_table COPY
-show session variables like 'old_alter_table';
-Variable_name Value
-old_alter_table COPY
-select * from information_schema.global_variables where variable_name='old_alter_table';
-VARIABLE_NAME VARIABLE_VALUE
-OLD_ALTER_TABLE COPY
-select * from information_schema.session_variables where variable_name='old_alter_table';
-VARIABLE_NAME VARIABLE_VALUE
-OLD_ALTER_TABLE COPY
-set global old_alter_table=2;
-Warnings:
-Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
-set session old_alter_table=2;
-Warnings:
-Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
-select @@global.old_alter_table;
-@@global.old_alter_table
-INPLACE
-select @@session.old_alter_table;
-@@session.old_alter_table
-INPLACE
-show global variables like 'old_alter_table';
-Variable_name Value
-old_alter_table INPLACE
-show session variables like 'old_alter_table';
-Variable_name Value
-old_alter_table INPLACE
-select * from information_schema.global_variables where variable_name='old_alter_table';
-VARIABLE_NAME VARIABLE_VALUE
-OLD_ALTER_TABLE INPLACE
-select * from information_schema.session_variables where variable_name='old_alter_table';
-VARIABLE_NAME VARIABLE_VALUE
-OLD_ALTER_TABLE INPLACE
-set global old_alter_table=3;
-Warnings:
-Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
-set session old_alter_table=3;
-Warnings:
-Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
-select @@global.old_alter_table;
-@@global.old_alter_table
-NOCOPY
-select @@session.old_alter_table;
-@@session.old_alter_table
-NOCOPY
-show global variables like 'old_alter_table';
-Variable_name Value
-old_alter_table NOCOPY
-show session variables like 'old_alter_table';
-Variable_name Value
-old_alter_table NOCOPY
-select * from information_schema.global_variables where variable_name='old_alter_table';
-VARIABLE_NAME VARIABLE_VALUE
-OLD_ALTER_TABLE NOCOPY
-select * from information_schema.session_variables where variable_name='old_alter_table';
-VARIABLE_NAME VARIABLE_VALUE
-OLD_ALTER_TABLE NOCOPY
-set global old_alter_table=4;
-Warnings:
-Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
-set session old_alter_table=4;
-Warnings:
-Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
-select @@global.old_alter_table;
-@@global.old_alter_table
-INSTANT
-select @@session.old_alter_table;
-@@session.old_alter_table
-INSTANT
-show global variables like 'old_alter_table';
-Variable_name Value
-old_alter_table INSTANT
-show session variables like 'old_alter_table';
-Variable_name Value
-old_alter_table INSTANT
-select * from information_schema.global_variables where variable_name='old_alter_table';
-VARIABLE_NAME VARIABLE_VALUE
-OLD_ALTER_TABLE INSTANT
-select * from information_schema.session_variables where variable_name='old_alter_table';
-VARIABLE_NAME VARIABLE_VALUE
-OLD_ALTER_TABLE INSTANT
-set global old_alter_table=1.1;
-ERROR 42000: Incorrect argument type to variable 'old_alter_table'
-set global old_alter_table=1e1;
-ERROR 42000: Incorrect argument type to variable 'old_alter_table'
-set global old_alter_table="foo";
-ERROR 42000: Variable 'old_alter_table' can't be set to the value of 'foo'
-SET @@global.old_alter_table = @start_global_value;
-Warnings:
-Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead
-SELECT @@global.old_alter_table;
-@@global.old_alter_table
-DEFAULT
diff --git a/mysql-test/suite/sys_vars/r/old_mode_basic.result b/mysql-test/suite/sys_vars/r/old_mode_basic.result
index 776d45a1..3032a825 100644
--- a/mysql-test/suite/sys_vars/r/old_mode_basic.result
+++ b/mysql-test/suite/sys_vars/r/old_mode_basic.result
@@ -8,11 +8,15 @@ SELECT @session_start_value;
UTF8_IS_UTF8MB3
'#--------------------FN_DYNVARS_152_01------------------------#'
SET @@global.old_mode = "NO_PROGRESS_INFO";
+Warnings:
+Warning 1287 'NO_PROGRESS_INFO' is deprecated and will be removed in a future release
SET @@global.old_mode = DEFAULT;
SELECT @@global.old_mode;
@@global.old_mode
UTF8_IS_UTF8MB3
SET @@session.old_mode = "NO_PROGRESS_INFO";
+Warnings:
+Warning 1287 'NO_PROGRESS_INFO' is deprecated and will be removed in a future release
SET @@session.old_mode = DEFAULT;
SELECT @@session.old_mode;
@@session.old_mode
@@ -40,20 +44,28 @@ SELECT @@session.old_mode;
'#--------------------FN_DYNVARS_152_03------------------------#'
SET @@global.old_mode = NO_PROGRESS_INFO;
+Warnings:
+Warning 1287 'NO_PROGRESS_INFO' is deprecated and will be removed in a future release
SELECT @@global.old_mode;
@@global.old_mode
NO_PROGRESS_INFO
SET @@global.old_mode = NO_DUP_KEY_WARNINGS_WITH_IGNORE;
+Warnings:
+Warning 1287 'NO_DUP_KEY_WARNINGS_WITH_IGNORE' is deprecated and will be removed in a future release
SELECT @@global.old_mode;
@@global.old_mode
NO_DUP_KEY_WARNINGS_WITH_IGNORE
SET @@global.old_mode = OFF;
ERROR 42000: Variable 'old_mode' can't be set to the value of 'OFF'
SET @@session.old_mode = NO_PROGRESS_INFO;
+Warnings:
+Warning 1287 'NO_PROGRESS_INFO' is deprecated and will be removed in a future release
SELECT @@session.old_mode;
@@session.old_mode
NO_PROGRESS_INFO
SET @@session.old_mode = NO_DUP_KEY_WARNINGS_WITH_IGNORE;
+Warnings:
+Warning 1287 'NO_DUP_KEY_WARNINGS_WITH_IGNORE' is deprecated and will be removed in a future release
SELECT @@session.old_mode;
@@session.old_mode
NO_DUP_KEY_WARNINGS_WITH_IGNORE
@@ -103,19 +115,25 @@ SELECT @@global.old_mode;
@@global.old_mode
SET @@global.old_mode = 1;
+Warnings:
+Warning 1287 'NO_DUP_KEY_WARNINGS_WITH_IGNORE' is deprecated and will be removed in a future release
SELECT @@global.old_mode;
@@global.old_mode
NO_DUP_KEY_WARNINGS_WITH_IGNORE
SET @@global.old_mode = 2;
+Warnings:
+Warning 1287 'NO_PROGRESS_INFO' is deprecated and will be removed in a future release
SELECT @@global.old_mode;
@@global.old_mode
NO_PROGRESS_INFO
SET @@global.old_mode = 4;
+Warnings:
+Warning 1287 'ZERO_DATE_TIME_CAST' is deprecated and will be removed in a future release
SELECT @@global.old_mode;
@@global.old_mode
ZERO_DATE_TIME_CAST
-SET @@global.old_mode = 128;
-ERROR 42000: Variable 'old_mode' can't be set to the value of '128'
+SET @@global.old_mode = 256;
+ERROR 42000: Variable 'old_mode' can't be set to the value of '256'
SELECT @@global.old_mode;
@@global.old_mode
ZERO_DATE_TIME_CAST
@@ -123,6 +141,8 @@ SET @@global.old_mode = 0.4;
ERROR 42000: Incorrect argument type to variable 'old_mode'
'#---------------------FN_DYNVARS_152_08----------------------#'
SET @@global.old_mode = TRUE;
+Warnings:
+Warning 1287 'NO_DUP_KEY_WARNINGS_WITH_IGNORE' is deprecated and will be removed in a future release
SELECT @@global.old_mode;
@@global.old_mode
NO_DUP_KEY_WARNINGS_WITH_IGNORE
@@ -132,7 +152,11 @@ SELECT @@global.old_mode;
'#---------------------FN_DYNVARS_152_09----------------------#'
SET old_mode = 'NO_PROGRESS_INFO';
+Warnings:
+Warning 1287 'NO_PROGRESS_INFO' is deprecated and will be removed in a future release
SET session old_mode = 1;
+Warnings:
+Warning 1287 'NO_DUP_KEY_WARNINGS_WITH_IGNORE' is deprecated and will be removed in a future release
SELECT @@old_mode;
@@old_mode
NO_DUP_KEY_WARNINGS_WITH_IGNORE
@@ -142,10 +166,16 @@ SELECT @@global.old_mode;
'#---------------------FN_DYNVARS_152_10----------------------#'
SET @@session.old_mode = 'NO_PROGRESS_INFO,NO_DUP_KEY_WARNINGS_WITH_IGNORE';
+Warnings:
+Warning 1287 'NO_DUP_KEY_WARNINGS_WITH_IGNORE' is deprecated and will be removed in a future release
+Warning 1287 'NO_PROGRESS_INFO' is deprecated and will be removed in a future release
SELECT @@session.old_mode;
@@session.old_mode
NO_DUP_KEY_WARNINGS_WITH_IGNORE,NO_PROGRESS_INFO
SET @@global.old_mode = 'NO_DUP_KEY_WARNINGS_WITH_IGNORE,NO_PROGRESS_INFO';
+Warnings:
+Warning 1287 'NO_DUP_KEY_WARNINGS_WITH_IGNORE' is deprecated and will be removed in a future release
+Warning 1287 'NO_PROGRESS_INFO' is deprecated and will be removed in a future release
SELECT @@global.old_mode;
@@global.old_mode
NO_DUP_KEY_WARNINGS_WITH_IGNORE,NO_PROGRESS_INFO
@@ -156,6 +186,8 @@ SELECT @@old_mode;
@@old_mode
SET @@old_mode=',,,,NO_PROGRESS_INFO,,,';
+Warnings:
+Warning 1287 'NO_PROGRESS_INFO' is deprecated and will be removed in a future release
SELECT @@old_mode;
@@old_mode
NO_PROGRESS_INFO
@@ -292,10 +324,14 @@ SELECT @@OLD_MODE;
UTF8_IS_UTF8MB3
SET @save_old_mode = @@OLD_MODE;
SET @@OLD_MODE= IGNORE_INDEX_ONLY_FOR_JOIN;
+Warnings:
+Warning 1287 'IGNORE_INDEX_ONLY_FOR_JOIN' is deprecated and will be removed in a future release
SELECT @@OLD_MODE;
@@OLD_MODE
IGNORE_INDEX_ONLY_FOR_JOIN
SET @@OLD_MODE= COMPAT_5_1_CHECKSUM;
+Warnings:
+Warning 1287 'COMPAT_5_1_CHECKSUM' is deprecated and will be removed in a future release
SELECT @@OLD_MODE;
@@OLD_MODE
COMPAT_5_1_CHECKSUM
diff --git a/mysql-test/suite/sys_vars/r/old_passwords_func.result b/mysql-test/suite/sys_vars/r/old_passwords_func.result
index fb250eeb..1220fb1a 100644
--- a/mysql-test/suite/sys_vars/r/old_passwords_func.result
+++ b/mysql-test/suite/sys_vars/r/old_passwords_func.result
@@ -21,7 +21,10 @@ SELECT CURRENT_USER();
CURRENT_USER()
userNewPass2@localhost
userNewPass2@localhost Expected
-connect con3,localhost,userOldPass,pass3,;
+connect(localhost,userOldPass,pass3,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect con3,localhost,userOldPass,pass3;
+ERROR HY000: Authentication plugin 'mysql_old_password' couldn't be found in restricted_auth plugin list.
+connect con3,localhost,userOldPass,pass3,,,,auth=mysql_old_password:mysql_native_password;
SELECT CURRENT_USER();
CURRENT_USER()
userOldPass@localhost
diff --git a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
index 8f5d9071..c0755278 100644
--- a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
+++ b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
@@ -1,60 +1,58 @@
set @@global.optimizer_switch=@@optimizer_switch;
select @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on,cset_narrowing=off,sargable_casefold=on
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on,cset_narrowing=off,sargable_casefold=on
show global variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off
+optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on,cset_narrowing=off,sargable_casefold=on
show session variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off
+optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on,cset_narrowing=off,sargable_casefold=on
select * from information_schema.global_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off
+OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on,cset_narrowing=off,sargable_casefold=on
select * from information_schema.session_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off
-set global optimizer_switch=4101;
-set session optimizer_switch=2058;
+OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=off,hash_join_cardinality=on,cset_narrowing=off,sargable_casefold=on
+set global optimizer_switch=2053;
+set session optimizer_switch=1034;
select @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off
+index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off,sargable_casefold=off
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off
+index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off,sargable_casefold=off
set global optimizer_switch="index_merge_sort_union=on";
set session optimizer_switch="index_merge=off";
select @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off
+index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off,sargable_casefold=off
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off
+index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off,sargable_casefold=off
show global variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off
+optimizer_switch index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off,sargable_casefold=off
show session variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off
+optimizer_switch index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off,sargable_casefold=off
select * from information_schema.global_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off
+OPTIMIZER_SWITCH index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off,sargable_casefold=off
select * from information_schema.session_variables where variable_name='optimizer_switch';
VARIABLE_NAME VARIABLE_VALUE
-OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off
+OPTIMIZER_SWITCH index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off,sargable_casefold=off
set session optimizer_switch="default";
select @@session.optimizer_switch;
@@session.optimizer_switch
-index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off
+index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,index_merge_sort_intersection=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=off,partial_match_table_scan=off,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=off,join_cache_hashed=off,join_cache_bka=off,optimize_join_buffer_size=off,table_elimination=off,extended_keys=off,exists_to_in=off,orderby_uses_equalities=off,condition_pushdown_for_derived=off,split_materialized=off,condition_pushdown_for_subquery=off,rowid_filter=off,condition_pushdown_from_having=off,not_null_range_scan=off,hash_join_cardinality=off,cset_narrowing=off,sargable_casefold=off
set optimizer_switch = replace(@@optimizer_switch, '=off', '=on');
-Warnings:
-Warning 1681 'engine_condition_pushdown=on' is deprecated and will be removed in a future release
select @@optimizer_switch;
@@optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=on,engine_condition_pushdown=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=on,hash_join_cardinality=on,cset_narrowing=on
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=on,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=on,mrr_cost_based=on,mrr_sort_keys=on,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=on,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on,split_materialized=on,condition_pushdown_for_subquery=on,rowid_filter=on,condition_pushdown_from_having=on,not_null_range_scan=on,hash_join_cardinality=on,cset_narrowing=on,sargable_casefold=on
set global optimizer_switch=1.1;
ERROR 42000: Incorrect argument type to variable 'optimizer_switch'
set global optimizer_switch=1e1;
diff --git a/mysql-test/suite/sys_vars/r/preudo_thread_id_grant.result b/mysql-test/suite/sys_vars/r/preudo_thread_id_grant.result
index d306a192..8ac8e32d 100644
--- a/mysql-test/suite/sys_vars/r/preudo_thread_id_grant.result
+++ b/mysql-test/suite/sys_vars/r/preudo_thread_id_grant.result
@@ -2,18 +2,18 @@
# MDEV-21975 Add BINLOG REPLAY privilege and bind new privileges to gtid_seq_no, preudo_thread_id, server_id, gtid_domain_id
#
SET @session=@@session.pseudo_thread_id;
-# Test that "SET pseudo_thread_id" is not allowed without BINLOG REPLAY or SUPER
+# Test that "SET pseudo_thread_id" is not allowed without BINLOG REPLAY
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG REPLAY, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG REPLAY ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL pseudo_thread_id=1;
ERROR HY000: Variable 'pseudo_thread_id' is a SESSION variable and can't be used with SET GLOBAL
SET pseudo_thread_id=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG REPLAY privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG REPLAY privilege(s) for this operation
SET SESSION pseudo_thread_id=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG REPLAY privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG REPLAY privilege(s) for this operation
disconnect user1;
connection default;
DROP USER user1@localhost;
@@ -29,16 +29,4 @@ SET SESSION pseudo_thread_id=1;
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET pseudo_thread_id" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL pseudo_thread_id=1;
-ERROR HY000: Variable 'pseudo_thread_id' is a SESSION variable and can't be used with SET GLOBAL
-SET pseudo_thread_id=1;
-SET SESSION pseudo_thread_id=1;
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@session.pseudo_thread_id=@session;
diff --git a/mysql-test/suite/sys_vars/r/proxy_protocol_networks_grant.result b/mysql-test/suite/sys_vars/r/proxy_protocol_networks_grant.result
index b6bae272..90419a80 100644
--- a/mysql-test/suite/sys_vars/r/proxy_protocol_networks_grant.result
+++ b/mysql-test/suite/sys_vars/r/proxy_protocol_networks_grant.result
@@ -2,14 +2,14 @@ SET @global=@@global.proxy_protocol_networks;
#
# MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
#
-# Test that "SET proxy_protocol_networks" is not allowed without CONNECTION ADMIN or SUPER
+# Test that "SET proxy_protocol_networks" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL proxy_protocol_networks="";
-ERROR 42000: Access denied; you need (at least one of) the SUPER, CONNECTION ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the CONNECTION ADMIN privilege(s) for this operation
SET proxy_protocol_networks="";
ERROR HY000: Variable 'proxy_protocol_networks' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION proxy_protocol_networks="";
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'proxy_protocol_networks' is a GLOBAL variable and should
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET proxy_protocol_networks" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL proxy_protocol_networks="";
-SET proxy_protocol_networks="";
-ERROR HY000: Variable 'proxy_protocol_networks' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION proxy_protocol_networks="";
-ERROR HY000: Variable 'proxy_protocol_networks' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.proxy_protocol_networks=@global;
diff --git a/mysql-test/suite/sys_vars/r/read_binlog_speed_limit_grant.result b/mysql-test/suite/sys_vars/r/read_binlog_speed_limit_grant.result
index 03536c1c..73a2127e 100644
--- a/mysql-test/suite/sys_vars/r/read_binlog_speed_limit_grant.result
+++ b/mysql-test/suite/sys_vars/r/read_binlog_speed_limit_grant.result
@@ -2,14 +2,14 @@
# MDEV-21966 Bind REPLICATION SLAVE ADMIN to a number of global system variables
#
SET @global=@@global.read_binlog_speed_limit;
-# Test that "SET read_binlog_speed_limit" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET read_binlog_speed_limit" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL read_binlog_speed_limit=65536;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET read_binlog_speed_limit=65536;
ERROR HY000: Variable 'read_binlog_speed_limit' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION read_binlog_speed_limit=65536;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'read_binlog_speed_limit' is a GLOBAL variable and should
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET read_binlog_speed_limit" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL read_binlog_speed_limit=65536;
-SET read_binlog_speed_limit=65536;
-ERROR HY000: Variable 'read_binlog_speed_limit' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION read_binlog_speed_limit=65536;
-ERROR HY000: Variable 'read_binlog_speed_limit' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.read_binlog_speed_limit=@global;
diff --git a/mysql-test/suite/sys_vars/r/read_only_grant.result b/mysql-test/suite/sys_vars/r/read_only_grant.result
index 455390eb..fd908b0e 100644
--- a/mysql-test/suite/sys_vars/r/read_only_grant.result
+++ b/mysql-test/suite/sys_vars/r/read_only_grant.result
@@ -36,5 +36,5 @@ insert mysql.global_priv values ('bar', 'foo', '{"access":32768,"version_id":101
flush privileges;
show grants for foo@bar;
Grants for foo@bar
-GRANT SUPER, READ_ONLY ADMIN ON *.* TO `foo`@`bar`
+GRANT SUPER, BINLOG MONITOR, SET USER, FEDERATED ADMIN, CONNECTION ADMIN, READ_ONLY ADMIN, REPLICATION SLAVE ADMIN, REPLICATION MASTER ADMIN, BINLOG ADMIN, BINLOG REPLAY, SLAVE MONITOR ON *.* TO `foo`@`bar`
drop user foo@bar;
diff --git a/mysql-test/suite/sys_vars/r/redirect.result b/mysql-test/suite/sys_vars/r/redirect.result
new file mode 100644
index 00000000..7d704de3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/redirect.result
@@ -0,0 +1,81 @@
+#
+# MDEV-15935 Connection Redirection Mechanism in MariaDB Client/Server Protocol
+#
+connect con,localhost,anyone_but_root;
+select @@redirect_url;
+@@redirect_url
+mysql://foobar
+connection default;
+set @old_global_redirect_url=@@global.redirect_url;
+set @old_session_redirect_url=@@session.redirect_url;
+set @old_session_track_system_variables=@@session_track_system_variables;
+set session_track_system_variables="";
+select @@global.redirect_url;
+@@global.redirect_url
+
+set global redirect_url=default;
+select @@global.redirect_url;
+@@global.redirect_url
+
+set global redirect_url="mariadb.org";
+ERROR 42000: Variable 'redirect_url' can't be set to the value of 'mariadb.org'
+set global redirect_url="https://mariadb.org";
+ERROR 42000: Variable 'redirect_url' can't be set to the value of 'https://mariadb.org'
+set global redirect_url="mysql://mariadb.org:";
+ERROR 42000: Variable 'redirect_url' can't be set to the value of 'mysql://mariadb.org:'
+set global redirect_url="mysql://mariadb.org:hello";
+ERROR 42000: Variable 'redirect_url' can't be set to the value of 'mysql://mariadb.org:hello'
+set global redirect_url="mysql://";
+ERROR 42000: Variable 'redirect_url' can't be set to the value of 'mysql://'
+set global redirect_url="mysql://mariadb.org";
+select @@global.redirect_url;
+@@global.redirect_url
+mysql://mariadb.org
+set global redirect_url="mysql://mariadb.org:12a";
+ERROR 42000: Variable 'redirect_url' can't be set to the value of 'mysql://mariadb.org:12a'
+set global redirect_url="mysql://mariadb.org:66666";
+ERROR 42000: Variable 'redirect_url' can't be set to the value of 'mysql://mariadb.org:66666'
+set global redirect_url="mysql://mariadb.org:12345";
+select @@global.redirect_url;
+@@global.redirect_url
+mysql://mariadb.org:12345
+set global redirect_url="maria";
+ERROR 42000: Variable 'redirect_url' can't be set to the value of 'maria'
+set global redirect_url="mariadb://mariadb.org:";
+ERROR 42000: Variable 'redirect_url' can't be set to the value of 'mariadb://mariadb.org:'
+set global redirect_url="mariadb://mariadb.org:hello";
+ERROR 42000: Variable 'redirect_url' can't be set to the value of 'mariadb://mariadb.org:hello'
+set global redirect_url="mariadb://";
+ERROR 42000: Variable 'redirect_url' can't be set to the value of 'mariadb://'
+set global redirect_url="mariadb://mariadb.org";
+select @@global.redirect_url;
+@@global.redirect_url
+mariadb://mariadb.org
+set global redirect_url="mariadb://mariadb.org:12a";
+ERROR 42000: Variable 'redirect_url' can't be set to the value of 'mariadb://mariadb.org:12a'
+set global redirect_url="mariadb://mariadb.org:66666";
+ERROR 42000: Variable 'redirect_url' can't be set to the value of 'mariadb://mariadb.org:66666'
+set global redirect_url="mariadb://mariadb.org:12345";
+select @@global.redirect_url;
+@@global.redirect_url
+mariadb://mariadb.org:12345
+select @@session.redirect_url;
+@@session.redirect_url
+
+set session redirect_url=default;
+select @@session.redirect_url;
+@@session.redirect_url
+mariadb://mariadb.org:12345
+set session redirect_url="mysql://localhost";
+select @@session.redirect_url;
+@@session.redirect_url
+mysql://localhost
+select @@global.redirect_url;
+@@global.redirect_url
+mariadb://mariadb.org:12345
+set global redirect_url=@old_global_redirect_url;
+set session redirect_url=@old_session_redirect_url;
+set session session_track_system_variables=@old_session_track_system_variables;
+#
+# end of test MDEV-15935
+#
diff --git a/mysql-test/suite/sys_vars/r/relay_log_purge_grant.result b/mysql-test/suite/sys_vars/r/relay_log_purge_grant.result
index 0823bf1f..b22b86f2 100644
--- a/mysql-test/suite/sys_vars/r/relay_log_purge_grant.result
+++ b/mysql-test/suite/sys_vars/r/relay_log_purge_grant.result
@@ -2,14 +2,14 @@
# MDEV-21969 Bind REPLICATION SLAVE ADMIN to relay_log_*, sync_master_info, sync_relay_log, sync_relay_log_info
#
SET @global=@@global.relay_log_purge;
-# Test that "SET relay_log_purge" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET relay_log_purge" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL relay_log_purge=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET relay_log_purge=1;
ERROR HY000: Variable 'relay_log_purge' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION relay_log_purge=1;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'relay_log_purge' is a GLOBAL variable and should be set w
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET relay_log_purge" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL relay_log_purge=1;
-SET relay_log_purge=1;
-ERROR HY000: Variable 'relay_log_purge' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION relay_log_purge=1;
-ERROR HY000: Variable 'relay_log_purge' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.relay_log_purge=@global;
diff --git a/mysql-test/suite/sys_vars/r/relay_log_recovery_grant.result b/mysql-test/suite/sys_vars/r/relay_log_recovery_grant.result
index 9e90c99f..14e2ef0e 100644
--- a/mysql-test/suite/sys_vars/r/relay_log_recovery_grant.result
+++ b/mysql-test/suite/sys_vars/r/relay_log_recovery_grant.result
@@ -2,14 +2,14 @@
# MDEV-21969 Bind REPLICATION SLAVE ADMIN to relay_log_*, sync_master_info, sync_relay_log, sync_relay_log_info
#
SET @global=@@global.relay_log_recovery;
-# Test that "SET relay_log_recovery" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET relay_log_recovery" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL relay_log_recovery=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET relay_log_recovery=1;
ERROR HY000: Variable 'relay_log_recovery' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION relay_log_recovery=1;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'relay_log_recovery' is a GLOBAL variable and should be se
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET relay_log_recovery" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL relay_log_recovery=1;
-SET relay_log_recovery=1;
-ERROR HY000: Variable 'relay_log_recovery' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION relay_log_recovery=1;
-ERROR HY000: Variable 'relay_log_recovery' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.relay_log_recovery=@global;
diff --git a/mysql-test/suite/sys_vars/r/replicate_do_db_grant.result b/mysql-test/suite/sys_vars/r/replicate_do_db_grant.result
index 1f352590..e5418dd6 100644
--- a/mysql-test/suite/sys_vars/r/replicate_do_db_grant.result
+++ b/mysql-test/suite/sys_vars/r/replicate_do_db_grant.result
@@ -2,14 +2,14 @@
# MDEV-21966 Bind REPLICATION SLAVE ADMIN to a number of global system variables
#
SET @global=@@global.replicate_do_db;
-# Test that "SET replicate_do_db" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET replicate_do_db" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL replicate_do_db='';
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET replicate_do_db='';
ERROR HY000: Variable 'replicate_do_db' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION replicate_do_db='';
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'replicate_do_db' is a GLOBAL variable and should be set w
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET replicate_do_db" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL replicate_do_db='';
-SET replicate_do_db='';
-ERROR HY000: Variable 'replicate_do_db' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION replicate_do_db='';
-ERROR HY000: Variable 'replicate_do_db' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.replicate_do_db=@global;
diff --git a/mysql-test/suite/sys_vars/r/replicate_do_table_grant.result b/mysql-test/suite/sys_vars/r/replicate_do_table_grant.result
index 31290979..37b5450f 100644
--- a/mysql-test/suite/sys_vars/r/replicate_do_table_grant.result
+++ b/mysql-test/suite/sys_vars/r/replicate_do_table_grant.result
@@ -2,14 +2,14 @@
# MDEV-21966 Bind REPLICATION SLAVE ADMIN to a number of global system variables
#
SET @global=@@global.replicate_do_table;
-# Test that "SET replicate_do_table" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET replicate_do_table" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL replicate_do_table='';
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET replicate_do_table='';
ERROR HY000: Variable 'replicate_do_table' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION replicate_do_table='';
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'replicate_do_table' is a GLOBAL variable and should be se
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET replicate_do_table" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL replicate_do_table='';
-SET replicate_do_table='';
-ERROR HY000: Variable 'replicate_do_table' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION replicate_do_table='';
-ERROR HY000: Variable 'replicate_do_table' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.replicate_do_table=@global;
diff --git a/mysql-test/suite/sys_vars/r/replicate_events_marked_for_skip_grant.result b/mysql-test/suite/sys_vars/r/replicate_events_marked_for_skip_grant.result
index f649294f..250be74b 100644
--- a/mysql-test/suite/sys_vars/r/replicate_events_marked_for_skip_grant.result
+++ b/mysql-test/suite/sys_vars/r/replicate_events_marked_for_skip_grant.result
@@ -2,14 +2,14 @@
# MDEV-21966 Bind REPLICATION SLAVE ADMIN to a number of global system variables
#
SET @global=@@global.replicate_events_marked_for_skip;
-# Test that "SET replicate_events_marked_for_skip" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET replicate_events_marked_for_skip" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET replicate_events_marked_for_skip=REPLICATE;
ERROR HY000: Variable 'replicate_events_marked_for_skip' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION replicate_events_marked_for_skip=REPLICATE;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'replicate_events_marked_for_skip' is a GLOBAL variable an
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET replicate_events_marked_for_skip" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
-SET replicate_events_marked_for_skip=REPLICATE;
-ERROR HY000: Variable 'replicate_events_marked_for_skip' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION replicate_events_marked_for_skip=REPLICATE;
-ERROR HY000: Variable 'replicate_events_marked_for_skip' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.replicate_events_marked_for_skip=@global;
diff --git a/mysql-test/suite/sys_vars/r/replicate_ignore_db_grant.result b/mysql-test/suite/sys_vars/r/replicate_ignore_db_grant.result
index 612fab62..6086f363 100644
--- a/mysql-test/suite/sys_vars/r/replicate_ignore_db_grant.result
+++ b/mysql-test/suite/sys_vars/r/replicate_ignore_db_grant.result
@@ -2,14 +2,14 @@
# MDEV-21966 Bind REPLICATION SLAVE ADMIN to a number of global system variables
#
SET @global=@@global.replicate_ignore_db;
-# Test that "SET replicate_ignore_db" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET replicate_ignore_db" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL replicate_ignore_db='';
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET replicate_ignore_db='';
ERROR HY000: Variable 'replicate_ignore_db' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION replicate_ignore_db='';
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'replicate_ignore_db' is a GLOBAL variable and should be s
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET replicate_ignore_db" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL replicate_ignore_db='';
-SET replicate_ignore_db='';
-ERROR HY000: Variable 'replicate_ignore_db' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION replicate_ignore_db='';
-ERROR HY000: Variable 'replicate_ignore_db' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.replicate_ignore_db=@global;
diff --git a/mysql-test/suite/sys_vars/r/replicate_ignore_table_grant.result b/mysql-test/suite/sys_vars/r/replicate_ignore_table_grant.result
index 9f2354a8..b2ff3384 100644
--- a/mysql-test/suite/sys_vars/r/replicate_ignore_table_grant.result
+++ b/mysql-test/suite/sys_vars/r/replicate_ignore_table_grant.result
@@ -2,14 +2,14 @@
# MDEV-21966 Bind REPLICATION SLAVE ADMIN to a number of global system variables
#
SET @global=@@global.replicate_ignore_table;
-# Test that "SET replicate_ignore_table" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET replicate_ignore_table" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL replicate_ignore_table='';
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET replicate_ignore_table='';
ERROR HY000: Variable 'replicate_ignore_table' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION replicate_ignore_table='';
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'replicate_ignore_table' is a GLOBAL variable and should b
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET replicate_ignore_table" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL replicate_ignore_table='';
-SET replicate_ignore_table='';
-ERROR HY000: Variable 'replicate_ignore_table' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION replicate_ignore_table='';
-ERROR HY000: Variable 'replicate_ignore_table' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.replicate_ignore_table=@global;
diff --git a/mysql-test/suite/sys_vars/r/replicate_wild_do_table_grant.result b/mysql-test/suite/sys_vars/r/replicate_wild_do_table_grant.result
index 1c9e12de..c09ef6ec 100644
--- a/mysql-test/suite/sys_vars/r/replicate_wild_do_table_grant.result
+++ b/mysql-test/suite/sys_vars/r/replicate_wild_do_table_grant.result
@@ -2,14 +2,14 @@
# MDEV-21966 Bind REPLICATION SLAVE ADMIN to a number of global system variables
#
SET @global=@@global.replicate_wild_do_table;
-# Test that "SET replicate_wild_do_table" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET replicate_wild_do_table" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL replicate_wild_do_table='';
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET replicate_wild_do_table='';
ERROR HY000: Variable 'replicate_wild_do_table' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION replicate_wild_do_table='';
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'replicate_wild_do_table' is a GLOBAL variable and should
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET replicate_wild_do_table" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL replicate_wild_do_table='';
-SET replicate_wild_do_table='';
-ERROR HY000: Variable 'replicate_wild_do_table' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION replicate_wild_do_table='';
-ERROR HY000: Variable 'replicate_wild_do_table' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.replicate_wild_do_table=@global;
diff --git a/mysql-test/suite/sys_vars/r/replicate_wild_ignore_table_grant.result b/mysql-test/suite/sys_vars/r/replicate_wild_ignore_table_grant.result
index 27a82173..2f5998e1 100644
--- a/mysql-test/suite/sys_vars/r/replicate_wild_ignore_table_grant.result
+++ b/mysql-test/suite/sys_vars/r/replicate_wild_ignore_table_grant.result
@@ -2,14 +2,14 @@
# MDEV-21966 Bind REPLICATION SLAVE ADMIN to a number of global system variables
#
SET @global=@@global.replicate_wild_ignore_table;
-# Test that "SET replicate_wild_ignore_table" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET replicate_wild_ignore_table" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL replicate_wild_ignore_table='';
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET replicate_wild_ignore_table='';
ERROR HY000: Variable 'replicate_wild_ignore_table' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION replicate_wild_ignore_table='';
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'replicate_wild_ignore_table' is a GLOBAL variable and sho
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET replicate_wild_ignore_table" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL replicate_wild_ignore_table='';
-SET replicate_wild_ignore_table='';
-ERROR HY000: Variable 'replicate_wild_ignore_table' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION replicate_wild_ignore_table='';
-ERROR HY000: Variable 'replicate_wild_ignore_table' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.replicate_wild_ignore_table=@global;
diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_grant.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_grant.result
index 3c5b3d07..803a5551 100644
--- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_grant.result
+++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_grant.result
@@ -2,14 +2,14 @@
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
#
SET @global=@@global.rpl_semi_sync_master_enabled;
-# Test that "SET rpl_semi_sync_master_enabled" is not allowed without REPLICATION MASTER ADMIN or SUPER
+# Test that "SET rpl_semi_sync_master_enabled" is not allowed without REPLICATION MASTER ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION MASTER ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION MASTER ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_master_enabled=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION MASTER ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION MASTER ADMIN privilege(s) for this operation
SET rpl_semi_sync_master_enabled=1;
ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_master_enabled=1;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable and sh
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET rpl_semi_sync_master_enabled" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL rpl_semi_sync_master_enabled=1;
-SET rpl_semi_sync_master_enabled=1;
-ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION rpl_semi_sync_master_enabled=1;
-ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.rpl_semi_sync_master_enabled=@global;
diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_timeout_grant.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_timeout_grant.result
index 2e8b51d5..be12c0ff 100644
--- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_timeout_grant.result
+++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_timeout_grant.result
@@ -2,14 +2,14 @@
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
#
SET @global=@@global.rpl_semi_sync_master_timeout;
-# Test that "SET rpl_semi_sync_master_timeout" is not allowed without REPLICATION MASTER ADMIN or SUPER
+# Test that "SET rpl_semi_sync_master_timeout" is not allowed without REPLICATION MASTER ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION MASTER ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION MASTER ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_master_timeout=20000;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION MASTER ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION MASTER ADMIN privilege(s) for this operation
SET rpl_semi_sync_master_timeout=20000;
ERROR HY000: Variable 'rpl_semi_sync_master_timeout' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_master_timeout=20000;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'rpl_semi_sync_master_timeout' is a GLOBAL variable and sh
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET rpl_semi_sync_master_timeout" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL rpl_semi_sync_master_timeout=20000;
-SET rpl_semi_sync_master_timeout=20000;
-ERROR HY000: Variable 'rpl_semi_sync_master_timeout' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION rpl_semi_sync_master_timeout=20000;
-ERROR HY000: Variable 'rpl_semi_sync_master_timeout' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.rpl_semi_sync_master_timeout=@global;
diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_trace_level_grant.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_trace_level_grant.result
index c31d063f..2c5a7e65 100644
--- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_trace_level_grant.result
+++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_trace_level_grant.result
@@ -2,14 +2,14 @@
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
#
SET @global=@@global.rpl_semi_sync_master_trace_level;
-# Test that "SET rpl_semi_sync_master_trace_level" is not allowed without REPLICATION MASTER ADMIN or SUPER
+# Test that "SET rpl_semi_sync_master_trace_level" is not allowed without REPLICATION MASTER ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION MASTER ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION MASTER ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_master_trace_level=64;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION MASTER ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION MASTER ADMIN privilege(s) for this operation
SET rpl_semi_sync_master_trace_level=64;
ERROR HY000: Variable 'rpl_semi_sync_master_trace_level' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_master_trace_level=64;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'rpl_semi_sync_master_trace_level' is a GLOBAL variable an
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET rpl_semi_sync_master_trace_level" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL rpl_semi_sync_master_trace_level=64;
-SET rpl_semi_sync_master_trace_level=64;
-ERROR HY000: Variable 'rpl_semi_sync_master_trace_level' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION rpl_semi_sync_master_trace_level=64;
-ERROR HY000: Variable 'rpl_semi_sync_master_trace_level' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.rpl_semi_sync_master_trace_level=@global;
diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_no_slave_grant.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_no_slave_grant.result
index 14e239f7..7af4016a 100644
--- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_no_slave_grant.result
+++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_no_slave_grant.result
@@ -2,14 +2,14 @@
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
#
SET @global=@@global.rpl_semi_sync_master_wait_no_slave;
-# Test that "SET rpl_semi_sync_master_wait_no_slave" is not allowed without REPLICATION MASTER ADMIN or SUPER
+# Test that "SET rpl_semi_sync_master_wait_no_slave" is not allowed without REPLICATION MASTER ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION MASTER ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION MASTER ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_master_wait_no_slave=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION MASTER ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION MASTER ADMIN privilege(s) for this operation
SET rpl_semi_sync_master_wait_no_slave=1;
ERROR HY000: Variable 'rpl_semi_sync_master_wait_no_slave' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_master_wait_no_slave=1;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'rpl_semi_sync_master_wait_no_slave' is a GLOBAL variable
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET rpl_semi_sync_master_wait_no_slave" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL rpl_semi_sync_master_wait_no_slave=1;
-SET rpl_semi_sync_master_wait_no_slave=1;
-ERROR HY000: Variable 'rpl_semi_sync_master_wait_no_slave' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION rpl_semi_sync_master_wait_no_slave=1;
-ERROR HY000: Variable 'rpl_semi_sync_master_wait_no_slave' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.rpl_semi_sync_master_wait_no_slave=@global;
diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_point_grant.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_point_grant.result
index 5760c459..0ce01cdb 100644
--- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_point_grant.result
+++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_wait_point_grant.result
@@ -2,14 +2,14 @@
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
#
SET @global=@@global.rpl_semi_sync_master_wait_point;
-# Test that "SET rpl_semi_sync_master_wait_point" is not allowed without REPLICATION MASTER ADMIN or SUPER
+# Test that "SET rpl_semi_sync_master_wait_point" is not allowed without REPLICATION MASTER ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION MASTER ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION MASTER ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_master_wait_point=AFTER_SYNC;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION MASTER ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION MASTER ADMIN privilege(s) for this operation
SET rpl_semi_sync_master_wait_point=AFTER_SYNC;
ERROR HY000: Variable 'rpl_semi_sync_master_wait_point' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_master_wait_point=AFTER_SYNC;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'rpl_semi_sync_master_wait_point' is a GLOBAL variable and
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET rpl_semi_sync_master_wait_point" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL rpl_semi_sync_master_wait_point=AFTER_SYNC;
-SET rpl_semi_sync_master_wait_point=AFTER_SYNC;
-ERROR HY000: Variable 'rpl_semi_sync_master_wait_point' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION rpl_semi_sync_master_wait_point=AFTER_SYNC;
-ERROR HY000: Variable 'rpl_semi_sync_master_wait_point' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.rpl_semi_sync_master_wait_point=@global;
diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_delay_master_grant.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_delay_master_grant.result
index 9e1c3073..9460df95 100644
--- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_delay_master_grant.result
+++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_delay_master_grant.result
@@ -2,14 +2,14 @@
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
#
SET @global=@@global.rpl_semi_sync_slave_delay_master;
-# Test that "SET rpl_semi_sync_slave_delay_master" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET rpl_semi_sync_slave_delay_master" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_slave_delay_master=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET rpl_semi_sync_slave_delay_master=1;
ERROR HY000: Variable 'rpl_semi_sync_slave_delay_master' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_slave_delay_master=1;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'rpl_semi_sync_slave_delay_master' is a GLOBAL variable an
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET rpl_semi_sync_slave_delay_master" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL rpl_semi_sync_slave_delay_master=1;
-SET rpl_semi_sync_slave_delay_master=1;
-ERROR HY000: Variable 'rpl_semi_sync_slave_delay_master' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION rpl_semi_sync_slave_delay_master=1;
-ERROR HY000: Variable 'rpl_semi_sync_slave_delay_master' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.rpl_semi_sync_slave_delay_master=@global;
diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_grant.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_grant.result
index f370b82d..f99eee16 100644
--- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_grant.result
+++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_grant.result
@@ -2,14 +2,14 @@
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
#
SET @global=@@global.rpl_semi_sync_slave_enabled;
-# Test that "SET rpl_semi_sync_slave_enabled" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET rpl_semi_sync_slave_enabled" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_slave_enabled=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET rpl_semi_sync_slave_enabled=1;
ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_slave_enabled=1;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable and sho
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET rpl_semi_sync_slave_enabled" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL rpl_semi_sync_slave_enabled=1;
-SET rpl_semi_sync_slave_enabled=1;
-ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION rpl_semi_sync_slave_enabled=1;
-ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.rpl_semi_sync_slave_enabled=@global;
diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_kill_conn_timeout_grant.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_kill_conn_timeout_grant.result
index f5e0f3b3..42eda805 100644
--- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_kill_conn_timeout_grant.result
+++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_kill_conn_timeout_grant.result
@@ -2,14 +2,14 @@
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
#
SET @global=@@global.rpl_semi_sync_slave_kill_conn_timeout;
-# Test that "SET rpl_semi_sync_slave_kill_conn_timeout" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET rpl_semi_sync_slave_kill_conn_timeout" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_slave_kill_conn_timeout=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET rpl_semi_sync_slave_kill_conn_timeout=1;
ERROR HY000: Variable 'rpl_semi_sync_slave_kill_conn_timeout' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_slave_kill_conn_timeout=1;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'rpl_semi_sync_slave_kill_conn_timeout' is a GLOBAL variab
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET rpl_semi_sync_slave_kill_conn_timeout" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL rpl_semi_sync_slave_kill_conn_timeout=1;
-SET rpl_semi_sync_slave_kill_conn_timeout=1;
-ERROR HY000: Variable 'rpl_semi_sync_slave_kill_conn_timeout' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION rpl_semi_sync_slave_kill_conn_timeout=1;
-ERROR HY000: Variable 'rpl_semi_sync_slave_kill_conn_timeout' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.rpl_semi_sync_slave_kill_conn_timeout=@global;
diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_trace_level_grant.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_trace_level_grant.result
index a1471906..9693731d 100644
--- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_trace_level_grant.result
+++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_trace_level_grant.result
@@ -2,14 +2,14 @@
# MDEV-21967 Bind REPLICATION {MASTER|SLAVE} ADMIN to rpl_semi_sync_* variables
#
SET @global=@@global.rpl_semi_sync_slave_trace_level;
-# Test that "SET rpl_semi_sync_slave_trace_level" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET rpl_semi_sync_slave_trace_level" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL rpl_semi_sync_slave_trace_level=64;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET rpl_semi_sync_slave_trace_level=64;
ERROR HY000: Variable 'rpl_semi_sync_slave_trace_level' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION rpl_semi_sync_slave_trace_level=64;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'rpl_semi_sync_slave_trace_level' is a GLOBAL variable and
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET rpl_semi_sync_slave_trace_level" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL rpl_semi_sync_slave_trace_level=64;
-SET rpl_semi_sync_slave_trace_level=64;
-ERROR HY000: Variable 'rpl_semi_sync_slave_trace_level' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION rpl_semi_sync_slave_trace_level=64;
-ERROR HY000: Variable 'rpl_semi_sync_slave_trace_level' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.rpl_semi_sync_slave_trace_level=@global;
diff --git a/mysql-test/suite/sys_vars/r/secure_auth_func.result b/mysql-test/suite/sys_vars/r/secure_auth_func.result
index ee0d6146..30885dcb 100644
--- a/mysql-test/suite/sys_vars/r/secure_auth_func.result
+++ b/mysql-test/suite/sys_vars/r/secure_auth_func.result
@@ -14,7 +14,7 @@ CREATE USER 'testUser'@'localhost' IDENTIFIED BY 'newpass';
connect con_user1,localhost,testUser,newpass,;
connection default;
SET PASSWORD FOR 'testUser'@'localhost' = OLD_PASSWORD('newpass');
-connect con_user2,localhost,testUser,newpass,;
+connect con_user2,localhost,testUser,newpass,,,,auth=mysql_old_password:mysql_native_password;
connection default;
'#--------------------FN_DYNVARS_144_03-------------------------#'
SET GLOBAL secure_auth = ON;
diff --git a/mysql-test/suite/sys_vars/r/secure_auth_grant.result b/mysql-test/suite/sys_vars/r/secure_auth_grant.result
index ea4b1b09..18174d77 100644
--- a/mysql-test/suite/sys_vars/r/secure_auth_grant.result
+++ b/mysql-test/suite/sys_vars/r/secure_auth_grant.result
@@ -2,14 +2,14 @@ SET @global=@@global.secure_auth;
#
# MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
#
-# Test that "SET secure_auth" is not allowed without CONNECTION ADMIN or SUPER
+# Test that "SET secure_auth" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL secure_auth=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, CONNECTION ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the CONNECTION ADMIN privilege(s) for this operation
SET secure_auth=1;
ERROR HY000: Variable 'secure_auth' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION secure_auth=1;
@@ -32,21 +32,6 @@ ERROR HY000: Variable 'secure_auth' is a GLOBAL variable and should be set with
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET secure_auth" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL secure_auth=1;
-Warnings:
-Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release
-SET secure_auth=1;
-ERROR HY000: Variable 'secure_auth' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION secure_auth=1;
-ERROR HY000: Variable 'secure_auth' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.secure_auth=@global;
Warnings:
Warning 1287 '@@secure_auth' is deprecated and will be removed in a future release
diff --git a/mysql-test/suite/sys_vars/r/secure_file_priv.result b/mysql-test/suite/sys_vars/r/secure_file_priv.result
index 74f816df..eeeb9a58 100644
--- a/mysql-test/suite/sys_vars/r/secure_file_priv.result
+++ b/mysql-test/suite/sys_vars/r/secure_file_priv.result
@@ -6,8 +6,6 @@ INSERT INTO t1 VALUES ("one"),("two"),("three"),("four"),("five");
SHOW VARIABLES LIKE 'secure_file_priv';
Variable_name Value
secure_file_priv
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
c1
one
two
diff --git a/mysql-test/suite/sys_vars/r/server_id_grant.result b/mysql-test/suite/sys_vars/r/server_id_grant.result
index f562560e..444c1a56 100644
--- a/mysql-test/suite/sys_vars/r/server_id_grant.result
+++ b/mysql-test/suite/sys_vars/r/server_id_grant.result
@@ -2,14 +2,14 @@
# MDEV-21975 Add BINLOG REPLAY privilege and bind new privileges to gtid_seq_no, preudo_thread_id, server_id, gtid_domain_id
#
SET @global=@@global.server_id;
-# Test that "SET GLOBAL server_id" is not allowed without REPLICATION MASTER ADMIN or SUPER
+# Test that "SET GLOBAL server_id" is not allowed without REPLICATION MASTER ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION MASTER ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION MASTER ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL server_id=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION MASTER ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION MASTER ADMIN privilege(s) for this operation
disconnect user1;
connection default;
DROP USER user1@localhost;
@@ -22,27 +22,18 @@ SET GLOBAL server_id=1;
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET GLOBAL server_id" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL server_id=1;
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.server_id=@global;
SET @session=@@session.server_id;
-# Test that "SET server_id" is not allowed without BINLOG REPLAY or SUPER
+# Test that "SET server_id" is not allowed without BINLOG REPLAY
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG REPLAY, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG REPLAY ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET server_id=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG REPLAY privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG REPLAY privilege(s) for this operation
SET SESSION server_id=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG REPLAY privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG REPLAY privilege(s) for this operation
disconnect user1;
connection default;
DROP USER user1@localhost;
@@ -56,14 +47,4 @@ SET SESSION server_id=1;
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET server_id" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET server_id=1;
-SET SESSION server_id=1;
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@session.server_id=@session;
diff --git a/mysql-test/suite/sys_vars/r/session_track_system_variables_basic.result b/mysql-test/suite/sys_vars/r/session_track_system_variables_basic.result
index c3f4a4ee..4208a2e3 100644
--- a/mysql-test/suite/sys_vars/r/session_track_system_variables_basic.result
+++ b/mysql-test/suite/sys_vars/r/session_track_system_variables_basic.result
@@ -5,20 +5,20 @@
# Global - default
SELECT @@global.session_track_system_variables;
@@global.session_track_system_variables
-autocommit,character_set_client,character_set_connection,character_set_results,time_zone
+autocommit,character_set_client,character_set_connection,character_set_results,redirect_url,time_zone
# Session - default
SELECT @@session.session_track_system_variables;
@@session.session_track_system_variables
-autocommit,character_set_client,character_set_connection,character_set_results,time_zone
+autocommit,character_set_client,character_set_connection,character_set_results,redirect_url,time_zone
# via INFORMATION_SCHEMA.GLOBAL_VARIABLES
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'session_track_system_variables' ORDER BY VARIABLE_NAME;
VARIABLE_NAME VARIABLE_VALUE
-SESSION_TRACK_SYSTEM_VARIABLES autocommit,character_set_client,character_set_connection,character_set_results,time_zone
+SESSION_TRACK_SYSTEM_VARIABLES autocommit,character_set_client,character_set_connection,character_set_results,redirect_url,time_zone
# via INFORMATION_SCHEMA.SESSION_VARIABLES
SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'session_track_system_variables' ORDER BY VARIABLE_NAME;
VARIABLE_NAME VARIABLE_VALUE
-SESSION_TRACK_SYSTEM_VARIABLES autocommit,character_set_client,character_set_connection,character_set_results,time_zone
+SESSION_TRACK_SYSTEM_VARIABLES autocommit,character_set_client,character_set_connection,character_set_results,redirect_url,time_zone
SET @global_saved_tmp = @@global.session_track_system_variables;
# Altering global variable's value
@@ -28,7 +28,7 @@ SELECT @@global.session_track_system_variables;
autocommit
SELECT @@session.session_track_system_variables;
@@session.session_track_system_variables
-autocommit,character_set_client,character_set_connection,character_set_results,time_zone
+autocommit,character_set_client,character_set_connection,character_set_results,redirect_url,time_zone
# Altering session variable's value
SET @@session.session_track_system_variables='autocommit';
@@ -66,25 +66,25 @@ SET @@session.session_track_system_variables = DEFAULT;
SELECT @@global.session_track_system_variables;
@@global.session_track_system_variables
-autocommit,character_set_client,character_set_connection,character_set_results,time_zone
+autocommit,character_set_client,character_set_connection,character_set_results,redirect_url,time_zone
SELECT @@session.session_track_system_variables;
@@session.session_track_system_variables
-autocommit,character_set_client,character_set_connection,character_set_results,time_zone
+autocommit,character_set_client,character_set_connection,character_set_results,redirect_url,time_zone
# Variables' values in a new session (con2).
connect con2,"127.0.0.1",root,,test,$MASTER_MYPORT,;
SELECT @@global.session_track_system_variables;
@@global.session_track_system_variables
-autocommit,character_set_client,character_set_connection,character_set_results,time_zone
+autocommit,character_set_client,character_set_connection,character_set_results,redirect_url,time_zone
SELECT @@session.session_track_system_variables;
@@session.session_track_system_variables
-autocommit,character_set_client,character_set_connection,character_set_results,time_zone
+autocommit,character_set_client,character_set_connection,character_set_results,redirect_url,time_zone
# Altering session should not affect global.
SET @@session.session_track_system_variables = 'sql_mode';
SELECT @@global.session_track_system_variables;
@@global.session_track_system_variables
-autocommit,character_set_client,character_set_connection,character_set_results,time_zone
+autocommit,character_set_client,character_set_connection,character_set_results,redirect_url,time_zone
SELECT @@session.session_track_system_variables;
@@session.session_track_system_variables
sql_mode
@@ -98,7 +98,7 @@ SELECT @@global.session_track_system_variables;
sql_mode
SELECT @@session.session_track_system_variables;
@@session.session_track_system_variables
-autocommit,character_set_client,character_set_connection,character_set_results,time_zone
+autocommit,character_set_client,character_set_connection,character_set_results,redirect_url,time_zone
# Switching to the default connection.
connection default;
diff --git a/mysql-test/suite/sys_vars/r/slave_compressed_protocol_grant.result b/mysql-test/suite/sys_vars/r/slave_compressed_protocol_grant.result
index 2f3f5298..3ef5417d 100644
--- a/mysql-test/suite/sys_vars/r/slave_compressed_protocol_grant.result
+++ b/mysql-test/suite/sys_vars/r/slave_compressed_protocol_grant.result
@@ -2,14 +2,14 @@
# MDEV-21966 Bind REPLICATION SLAVE ADMIN to a number of global system variables
#
SET @global=@@global.slave_compressed_protocol;
-# Test that "SET slave_compressed_protocol" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET slave_compressed_protocol" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL slave_compressed_protocol=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET slave_compressed_protocol=1;
ERROR HY000: Variable 'slave_compressed_protocol' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION slave_compressed_protocol=1;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'slave_compressed_protocol' is a GLOBAL variable and shoul
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET slave_compressed_protocol" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL slave_compressed_protocol=1;
-SET slave_compressed_protocol=1;
-ERROR HY000: Variable 'slave_compressed_protocol' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION slave_compressed_protocol=1;
-ERROR HY000: Variable 'slave_compressed_protocol' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.slave_compressed_protocol=@global;
diff --git a/mysql-test/suite/sys_vars/r/slave_ddl_exec_mode_grant.result b/mysql-test/suite/sys_vars/r/slave_ddl_exec_mode_grant.result
index d4f21f1e..dc05d6ce 100644
--- a/mysql-test/suite/sys_vars/r/slave_ddl_exec_mode_grant.result
+++ b/mysql-test/suite/sys_vars/r/slave_ddl_exec_mode_grant.result
@@ -2,14 +2,14 @@
# MDEV-21966 Bind REPLICATION SLAVE ADMIN to a number of global system variables
#
SET @global=@@global.slave_ddl_exec_mode;
-# Test that "SET slave_ddl_exec_mode" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET slave_ddl_exec_mode" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL slave_ddl_exec_mode=STRICT;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET slave_ddl_exec_mode=STRICT;
ERROR HY000: Variable 'slave_ddl_exec_mode' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION slave_ddl_exec_mode=STRICT;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'slave_ddl_exec_mode' is a GLOBAL variable and should be s
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET slave_ddl_exec_mode" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL slave_ddl_exec_mode=STRICT;
-SET slave_ddl_exec_mode=STRICT;
-ERROR HY000: Variable 'slave_ddl_exec_mode' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION slave_ddl_exec_mode=STRICT;
-ERROR HY000: Variable 'slave_ddl_exec_mode' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.slave_ddl_exec_mode=@global;
diff --git a/mysql-test/suite/sys_vars/r/slave_domain_parallel_threads_grant.result b/mysql-test/suite/sys_vars/r/slave_domain_parallel_threads_grant.result
index f31e48e2..757b188a 100644
--- a/mysql-test/suite/sys_vars/r/slave_domain_parallel_threads_grant.result
+++ b/mysql-test/suite/sys_vars/r/slave_domain_parallel_threads_grant.result
@@ -2,14 +2,14 @@
# MDEV-21966 Bind REPLICATION SLAVE ADMIN to a number of global system variables
#
SET @global=@@global.slave_domain_parallel_threads;
-# Test that "SET slave_domain_parallel_threads" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET slave_domain_parallel_threads" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL slave_domain_parallel_threads=0;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET slave_domain_parallel_threads=0;
ERROR HY000: Variable 'slave_domain_parallel_threads' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION slave_domain_parallel_threads=0;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'slave_domain_parallel_threads' is a GLOBAL variable and s
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET slave_domain_parallel_threads" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL slave_domain_parallel_threads=0;
-SET slave_domain_parallel_threads=0;
-ERROR HY000: Variable 'slave_domain_parallel_threads' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION slave_domain_parallel_threads=0;
-ERROR HY000: Variable 'slave_domain_parallel_threads' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.slave_domain_parallel_threads=@global;
diff --git a/mysql-test/suite/sys_vars/r/slave_exec_mode_grant.result b/mysql-test/suite/sys_vars/r/slave_exec_mode_grant.result
index c1cfdba7..7fd5481c 100644
--- a/mysql-test/suite/sys_vars/r/slave_exec_mode_grant.result
+++ b/mysql-test/suite/sys_vars/r/slave_exec_mode_grant.result
@@ -2,14 +2,14 @@
# MDEV-21966 Bind REPLICATION SLAVE ADMIN to a number of global system variables
#
SET @global=@@global.slave_exec_mode;
-# Test that "SET slave_exec_mode" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET slave_exec_mode" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL slave_exec_mode=STRICT;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET slave_exec_mode=STRICT;
ERROR HY000: Variable 'slave_exec_mode' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION slave_exec_mode=STRICT;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'slave_exec_mode' is a GLOBAL variable and should be set w
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET slave_exec_mode" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL slave_exec_mode=STRICT;
-SET slave_exec_mode=STRICT;
-ERROR HY000: Variable 'slave_exec_mode' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION slave_exec_mode=STRICT;
-ERROR HY000: Variable 'slave_exec_mode' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.slave_exec_mode=@global;
diff --git a/mysql-test/suite/sys_vars/r/slave_max_allowed_packet_grant.result b/mysql-test/suite/sys_vars/r/slave_max_allowed_packet_grant.result
index 664d580e..45e79aad 100644
--- a/mysql-test/suite/sys_vars/r/slave_max_allowed_packet_grant.result
+++ b/mysql-test/suite/sys_vars/r/slave_max_allowed_packet_grant.result
@@ -2,14 +2,14 @@
# MDEV-21966 Bind REPLICATION SLAVE ADMIN to a number of global system variables
#
SET @global=@@global.slave_max_allowed_packet;
-# Test that "SET slave_max_allowed_packet" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET slave_max_allowed_packet" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL slave_max_allowed_packet=65536;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET slave_max_allowed_packet=65536;
ERROR HY000: Variable 'slave_max_allowed_packet' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION slave_max_allowed_packet=65536;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'slave_max_allowed_packet' is a GLOBAL variable and should
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET slave_max_allowed_packet" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL slave_max_allowed_packet=65536;
-SET slave_max_allowed_packet=65536;
-ERROR HY000: Variable 'slave_max_allowed_packet' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION slave_max_allowed_packet=65536;
-ERROR HY000: Variable 'slave_max_allowed_packet' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.slave_max_allowed_packet=@global;
diff --git a/mysql-test/suite/sys_vars/r/slave_net_timeout_grant.result b/mysql-test/suite/sys_vars/r/slave_net_timeout_grant.result
index 2b6664ab..da6e8b04 100644
--- a/mysql-test/suite/sys_vars/r/slave_net_timeout_grant.result
+++ b/mysql-test/suite/sys_vars/r/slave_net_timeout_grant.result
@@ -2,14 +2,14 @@
# MDEV-21966 Bind REPLICATION SLAVE ADMIN to a number of global system variables
#
SET @global=@@global.slave_net_timeout;
-# Test that "SET slave_net_timeout" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET slave_net_timeout" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL slave_net_timeout=60;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET slave_net_timeout=60;
ERROR HY000: Variable 'slave_net_timeout' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION slave_net_timeout=60;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'slave_net_timeout' is a GLOBAL variable and should be set
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET slave_net_timeout" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL slave_net_timeout=60;
-SET slave_net_timeout=60;
-ERROR HY000: Variable 'slave_net_timeout' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION slave_net_timeout=60;
-ERROR HY000: Variable 'slave_net_timeout' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.slave_net_timeout=@global;
diff --git a/mysql-test/suite/sys_vars/r/slave_parallel_max_queued_grant.result b/mysql-test/suite/sys_vars/r/slave_parallel_max_queued_grant.result
index 315de478..9594c7ce 100644
--- a/mysql-test/suite/sys_vars/r/slave_parallel_max_queued_grant.result
+++ b/mysql-test/suite/sys_vars/r/slave_parallel_max_queued_grant.result
@@ -2,14 +2,14 @@
# MDEV-21966 Bind REPLICATION SLAVE ADMIN to a number of global system variables
#
SET @global=@@global.slave_parallel_max_queued;
-# Test that "SET slave_parallel_max_queued" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET slave_parallel_max_queued" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL slave_parallel_max_queued=65536;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET slave_parallel_max_queued=65536;
ERROR HY000: Variable 'slave_parallel_max_queued' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION slave_parallel_max_queued=65536;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'slave_parallel_max_queued' is a GLOBAL variable and shoul
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET slave_parallel_max_queued" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL slave_parallel_max_queued=65536;
-SET slave_parallel_max_queued=65536;
-ERROR HY000: Variable 'slave_parallel_max_queued' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION slave_parallel_max_queued=65536;
-ERROR HY000: Variable 'slave_parallel_max_queued' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.slave_parallel_max_queued=@global;
diff --git a/mysql-test/suite/sys_vars/r/slave_parallel_mode_grant.result b/mysql-test/suite/sys_vars/r/slave_parallel_mode_grant.result
index 6d5da37d..1bb894f9 100644
--- a/mysql-test/suite/sys_vars/r/slave_parallel_mode_grant.result
+++ b/mysql-test/suite/sys_vars/r/slave_parallel_mode_grant.result
@@ -2,14 +2,14 @@
# MDEV-21966 Bind REPLICATION SLAVE ADMIN to a number of global system variables
#
SET @global=@@global.slave_parallel_mode;
-# Test that "SET slave_parallel_mode" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET slave_parallel_mode" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL slave_parallel_mode=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET slave_parallel_mode=1;
ERROR HY000: Variable 'slave_parallel_mode' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION slave_parallel_mode=1;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'slave_parallel_mode' is a GLOBAL variable and should be s
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET slave_parallel_mode" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL slave_parallel_mode=1;
-SET slave_parallel_mode=1;
-ERROR HY000: Variable 'slave_parallel_mode' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION slave_parallel_mode=1;
-ERROR HY000: Variable 'slave_parallel_mode' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.slave_parallel_mode=@global;
diff --git a/mysql-test/suite/sys_vars/r/slave_parallel_threads_grant.result b/mysql-test/suite/sys_vars/r/slave_parallel_threads_grant.result
index 147252f7..a1dbcfc6 100644
--- a/mysql-test/suite/sys_vars/r/slave_parallel_threads_grant.result
+++ b/mysql-test/suite/sys_vars/r/slave_parallel_threads_grant.result
@@ -2,14 +2,14 @@
# MDEV-21966 Bind REPLICATION SLAVE ADMIN to a number of global system variables
#
SET @global=@@global.slave_parallel_threads;
-# Test that "SET slave_parallel_threads" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET slave_parallel_threads" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL slave_parallel_threads=256;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET slave_parallel_threads=256;
ERROR HY000: Variable 'slave_parallel_threads' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION slave_parallel_threads=256;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'slave_parallel_threads' is a GLOBAL variable and should b
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET slave_parallel_threads" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL slave_parallel_threads=256;
-SET slave_parallel_threads=256;
-ERROR HY000: Variable 'slave_parallel_threads' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION slave_parallel_threads=256;
-ERROR HY000: Variable 'slave_parallel_threads' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.slave_parallel_threads=@global;
diff --git a/mysql-test/suite/sys_vars/r/slave_parallel_workers_grant.result b/mysql-test/suite/sys_vars/r/slave_parallel_workers_grant.result
index 1985cc42..0de4af52 100644
--- a/mysql-test/suite/sys_vars/r/slave_parallel_workers_grant.result
+++ b/mysql-test/suite/sys_vars/r/slave_parallel_workers_grant.result
@@ -2,14 +2,14 @@
# MDEV-21966 Bind REPLICATION SLAVE ADMIN to a number of global system variables
#
SET @global=@@global.slave_parallel_workers;
-# Test that "SET slave_parallel_workers" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET slave_parallel_workers" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL slave_parallel_workers=256;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET slave_parallel_workers=256;
ERROR HY000: Variable 'slave_parallel_workers' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION slave_parallel_workers=256;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'slave_parallel_workers' is a GLOBAL variable and should b
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET slave_parallel_workers" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL slave_parallel_workers=256;
-SET slave_parallel_workers=256;
-ERROR HY000: Variable 'slave_parallel_workers' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION slave_parallel_workers=256;
-ERROR HY000: Variable 'slave_parallel_workers' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.slave_parallel_workers=@global;
diff --git a/mysql-test/suite/sys_vars/r/slave_run_triggers_for_rbr_grant.result b/mysql-test/suite/sys_vars/r/slave_run_triggers_for_rbr_grant.result
index fd33c95f..fea67a80 100644
--- a/mysql-test/suite/sys_vars/r/slave_run_triggers_for_rbr_grant.result
+++ b/mysql-test/suite/sys_vars/r/slave_run_triggers_for_rbr_grant.result
@@ -2,14 +2,14 @@
# MDEV-21966 Bind REPLICATION SLAVE ADMIN to a number of global system variables
#
SET @global=@@global.slave_run_triggers_for_rbr;
-# Test that "SET slave_run_triggers_for_rbr" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET slave_run_triggers_for_rbr" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL slave_run_triggers_for_rbr=YES;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET slave_run_triggers_for_rbr=YES;
ERROR HY000: Variable 'slave_run_triggers_for_rbr' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION slave_run_triggers_for_rbr=YES;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'slave_run_triggers_for_rbr' is a GLOBAL variable and shou
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET slave_run_triggers_for_rbr" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL slave_run_triggers_for_rbr=YES;
-SET slave_run_triggers_for_rbr=YES;
-ERROR HY000: Variable 'slave_run_triggers_for_rbr' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION slave_run_triggers_for_rbr=YES;
-ERROR HY000: Variable 'slave_run_triggers_for_rbr' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.slave_run_triggers_for_rbr=@global;
diff --git a/mysql-test/suite/sys_vars/r/slave_sql_verify_checksum_grant.result b/mysql-test/suite/sys_vars/r/slave_sql_verify_checksum_grant.result
index 1cc4f3f3..236b3a34 100644
--- a/mysql-test/suite/sys_vars/r/slave_sql_verify_checksum_grant.result
+++ b/mysql-test/suite/sys_vars/r/slave_sql_verify_checksum_grant.result
@@ -2,14 +2,14 @@
# MDEV-21966 Bind REPLICATION SLAVE ADMIN to a number of global system variables
#
SET @global=@@global.slave_sql_verify_checksum;
-# Test that "SET slave_sql_verify_checksum" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET slave_sql_verify_checksum" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL slave_sql_verify_checksum=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET slave_sql_verify_checksum=1;
ERROR HY000: Variable 'slave_sql_verify_checksum' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION slave_sql_verify_checksum=1;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'slave_sql_verify_checksum' is a GLOBAL variable and shoul
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET slave_sql_verify_checksum" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL slave_sql_verify_checksum=1;
-SET slave_sql_verify_checksum=1;
-ERROR HY000: Variable 'slave_sql_verify_checksum' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION slave_sql_verify_checksum=1;
-ERROR HY000: Variable 'slave_sql_verify_checksum' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.slave_sql_verify_checksum=@global;
diff --git a/mysql-test/suite/sys_vars/r/slave_transaction_retry_interval_grant.result b/mysql-test/suite/sys_vars/r/slave_transaction_retry_interval_grant.result
index e2e5e396..ac144e62 100644
--- a/mysql-test/suite/sys_vars/r/slave_transaction_retry_interval_grant.result
+++ b/mysql-test/suite/sys_vars/r/slave_transaction_retry_interval_grant.result
@@ -2,14 +2,14 @@
# MDEV-21966 Bind REPLICATION SLAVE ADMIN to a number of global system variables
#
SET @global=@@global.slave_transaction_retry_interval;
-# Test that "SET slave_transaction_retry_interval" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET slave_transaction_retry_interval" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL slave_transaction_retry_interval=256;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET slave_transaction_retry_interval=256;
ERROR HY000: Variable 'slave_transaction_retry_interval' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION slave_transaction_retry_interval=256;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'slave_transaction_retry_interval' is a GLOBAL variable an
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET slave_transaction_retry_interval" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL slave_transaction_retry_interval=256;
-SET slave_transaction_retry_interval=256;
-ERROR HY000: Variable 'slave_transaction_retry_interval' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION slave_transaction_retry_interval=256;
-ERROR HY000: Variable 'slave_transaction_retry_interval' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.slave_transaction_retry_interval=@global;
diff --git a/mysql-test/suite/sys_vars/r/slave_type_conversions_grant.result b/mysql-test/suite/sys_vars/r/slave_type_conversions_grant.result
index 01022e73..5057f190 100644
--- a/mysql-test/suite/sys_vars/r/slave_type_conversions_grant.result
+++ b/mysql-test/suite/sys_vars/r/slave_type_conversions_grant.result
@@ -2,14 +2,14 @@
# MDEV-21966 Bind REPLICATION SLAVE ADMIN to a number of global system variables
#
SET @global=@@global.slave_type_conversions;
-# Test that "SET slave_type_conversions" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET slave_type_conversions" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL slave_type_conversions=ALL_NON_LOSSY;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET slave_type_conversions=ALL_NON_LOSSY;
ERROR HY000: Variable 'slave_type_conversions' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION slave_type_conversions=ALL_NON_LOSSY;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'slave_type_conversions' is a GLOBAL variable and should b
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET slave_type_conversions" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL slave_type_conversions=ALL_NON_LOSSY;
-SET slave_type_conversions=ALL_NON_LOSSY;
-ERROR HY000: Variable 'slave_type_conversions' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION slave_type_conversions=ALL_NON_LOSSY;
-ERROR HY000: Variable 'slave_type_conversions' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.slave_type_conversions=@global;
diff --git a/mysql-test/suite/sys_vars/r/slow_launch_time_grant.result b/mysql-test/suite/sys_vars/r/slow_launch_time_grant.result
index 45aef07d..52435ae3 100644
--- a/mysql-test/suite/sys_vars/r/slow_launch_time_grant.result
+++ b/mysql-test/suite/sys_vars/r/slow_launch_time_grant.result
@@ -2,14 +2,14 @@ SET @global=@@global.slow_launch_time;
#
# MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
#
-# Test that "SET slow_launch_time" is not allowed without CONNECTION ADMIN or SUPER
+# Test that "SET slow_launch_time" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL slow_launch_time=10;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, CONNECTION ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the CONNECTION ADMIN privilege(s) for this operation
SET slow_launch_time=10;
ERROR HY000: Variable 'slow_launch_time' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION slow_launch_time=10;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'slow_launch_time' is a GLOBAL variable and should be set
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET slow_launch_time" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL slow_launch_time=10;
-SET slow_launch_time=10;
-ERROR HY000: Variable 'slow_launch_time' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION slow_launch_time=10;
-ERROR HY000: Variable 'slow_launch_time' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.slow_launch_time=@global;
diff --git a/mysql-test/suite/sys_vars/r/sql_big_selects_func.result b/mysql-test/suite/sys_vars/r/sql_big_selects_func.result
index 609401c7..104103f6 100644
--- a/mysql-test/suite/sys_vars/r/sql_big_selects_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_big_selects_func.result
@@ -3,7 +3,7 @@
SET @session_sql_big_selects = @@SESSION.sql_big_selects;
SET @session_max_join_size = @@SESSION.max_join_size;
SET @global_max_join_size = @@GLOBAL.max_join_size;
-SET MAX_JOIN_SIZE=9;
+SET MAX_JOIN_SIZE=21;
CREATE TEMPORARY TABLE t1(a varchar(20) not null, b varchar(20));
CREATE TEMPORARY TABLE t2(a varchar(20) null, b varchar(20));
INSERT INTO t1 VALUES('aa','bb');
diff --git a/mysql-test/suite/sys_vars/r/sql_log_bin_grant.result b/mysql-test/suite/sys_vars/r/sql_log_bin_grant.result
index 574c53e1..336b2943 100644
--- a/mysql-test/suite/sys_vars/r/sql_log_bin_grant.result
+++ b/mysql-test/suite/sys_vars/r/sql_log_bin_grant.result
@@ -1,18 +1,18 @@
#
#
#
-# Test that "SET sql_log_bin" is not allowed without BINLOG ADMIN or SUPER
+# Test that "SET sql_log_bin" is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET sql_log_bin=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET GLOBAL sql_log_bin=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET SESSION sql_log_bin=1;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
disconnect user1;
connection default;
DROP USER user1@localhost;
@@ -28,15 +28,3 @@ SET SESSION sql_log_bin=1;
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET sql_log_bin" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET sql_log_bin=1;
-SET GLOBAL sql_log_bin=1;
-ERROR HY000: Variable 'sql_log_bin' is a SESSION variable
-SET SESSION sql_log_bin=1;
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
diff --git a/mysql-test/suite/sys_vars/r/sql_notes_basic.result b/mysql-test/suite/sys_vars/r/sql_notes_basic.result
deleted file mode 100644
index 7a54f90f..00000000
--- a/mysql-test/suite/sys_vars/r/sql_notes_basic.result
+++ /dev/null
@@ -1,107 +0,0 @@
-SET @session_start_value = @@session.sql_notes;
-SELECT @session_start_value;
-@session_start_value
-1
-'#--------------------FN_DYNVARS_161_01------------------------#'
-SET @@session.sql_notes = 0;
-SET @@session.sql_notes = DEFAULT;
-SELECT @@session.sql_notes;
-@@session.sql_notes
-1
-SET @@session.sql_notes = 1;
-SET @@session.sql_notes = DEFAULT;
-SELECT @@session.sql_notes;
-@@session.sql_notes
-1
-'#---------------------FN_DYNVARS_161_02-------------------------#'
-SET sql_notes = 1;
-SELECT @@sql_notes;
-@@sql_notes
-1
-SELECT session.sql_notes;
-ERROR 42S02: Unknown table 'session' in field list
-SELECT local.sql_notes;
-ERROR 42S02: Unknown table 'local' in field list
-SET session sql_notes = 0;
-SELECT @@session.sql_notes;
-@@session.sql_notes
-0
-'#--------------------FN_DYNVARS_161_03------------------------#'
-SET @@session.sql_notes = 0;
-SELECT @@session.sql_notes;
-@@session.sql_notes
-0
-SET @@session.sql_notes = 1;
-SELECT @@session.sql_notes;
-@@session.sql_notes
-1
-'#--------------------FN_DYNVARS_161_04-------------------------#'
-SET @@session.sql_notes = -1;
-ERROR 42000: Variable 'sql_notes' can't be set to the value of '-1'
-SET @@session.sql_notes = 2;
-ERROR 42000: Variable 'sql_notes' can't be set to the value of '2'
-SET @@session.sql_notes = "T";
-ERROR 42000: Variable 'sql_notes' can't be set to the value of 'T'
-SET @@session.sql_notes = "Y";
-ERROR 42000: Variable 'sql_notes' can't be set to the value of 'Y'
-SET @@session.sql_notes = TRÜE;
-ERROR 42000: Variable 'sql_notes' can't be set to the value of 'TRÜE'
-SET @@session.sql_notes = ÕN;
-ERROR 42000: Variable 'sql_notes' can't be set to the value of 'ÕN'
-SET @@session.sql_notes = OF;
-ERROR 42000: Variable 'sql_notes' can't be set to the value of 'OF'
-SET @@session.sql_notes = ÓFF;
-ERROR 42000: Variable 'sql_notes' can't be set to the value of 'ÓFF'
-SET @@session.sql_notes = '¹';
-ERROR 42000: Variable 'sql_notes' can't be set to the value of '¹'
-SET @@session.sql_notes = NO;
-ERROR 42000: Variable 'sql_notes' can't be set to the value of 'NO'
-'#-------------------FN_DYNVARS_161_05----------------------------#'
-SET @@global.sql_notes = 1-@@global.sql_notes;
-SELECT @@global.sql_notes;
-@@global.sql_notes
-0
-SET @@global.sql_notes = 1-@@global.sql_notes;
-SELECT @@global.sql_notes;
-@@global.sql_notes
-1
-'#----------------------FN_DYNVARS_161_06------------------------#'
-SELECT count(VARIABLE_VALUE) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sql_notes';
-count(VARIABLE_VALUE)
-1
-'#----------------------FN_DYNVARS_161_07------------------------#'
-SELECT IF(@@session.sql_notes, "ON", "OFF") = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='sql_notes';
-IF(@@session.sql_notes, "ON", "OFF") = VARIABLE_VALUE
-1
-SELECT @@session.sql_notes;
-@@session.sql_notes
-1
-SELECT VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='sql_notes';
-VARIABLE_VALUE
-ON
-'#---------------------FN_DYNVARS_161_08-------------------------#'
-SET @@session.sql_notes = OFF;
-SELECT @@session.sql_notes;
-@@session.sql_notes
-0
-SET @@session.sql_notes = ON;
-SELECT @@session.sql_notes;
-@@session.sql_notes
-1
-'#---------------------FN_DYNVARS_161_09----------------------#'
-SET @@session.sql_notes = TRUE;
-SELECT @@session.sql_notes;
-@@session.sql_notes
-1
-SET @@session.sql_notes = FALSE;
-SELECT @@session.sql_notes;
-@@session.sql_notes
-0
-SET @@session.sql_notes = @session_start_value;
-SELECT @@session.sql_notes;
-@@session.sql_notes
-1
diff --git a/mysql-test/suite/sys_vars/r/sql_notes_func.result b/mysql-test/suite/sys_vars/r/sql_notes_func.result
index 51da0ea5..1871dd2d 100644
--- a/mysql-test/suite/sys_vars/r/sql_notes_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_notes_func.result
@@ -3,6 +3,8 @@
SET @default_sql_notes = @@sql_notes;
'#--------------------FN_DYNVARS_162_01-------------------------#'
SET SESSION sql_notes = ON;
+Warnings:
+Warning 1287 '@@sql_notes' is deprecated and will be removed in a future release. Please use '@@note_verbosity' instead
creating a temporary table
CREATE TEMPORARY TABLE t1(a varchar(20), b varchar(20));
conditionally dropping the table twice so that a note generates
@@ -20,6 +22,8 @@ SELECT @@warning_count;
1 Expected
'#--------------------FN_DYNVARS_162_02-------------------------#'
SET SESSION sql_notes = OFF;
+Warnings:
+Warning 1287 '@@sql_notes' is deprecated and will be removed in a future release. Please use '@@note_verbosity' instead
creating a temporary table
CREATE TEMPORARY TABLE t1(a varchar(20), b varchar(20));
conditionally dropping the table twice so that a note generates
@@ -41,6 +45,8 @@ SELECT @@SESSION.sql_notes;
1
1 / TRUE Expected
SET SESSION sql_notes = FALSE;
+Warnings:
+Warning 1287 '@@sql_notes' is deprecated and will be removed in a future release. Please use '@@note_verbosity' instead
connect con_int2,localhost,root,,;
connection con_int2;
SELECT @@SESSION.sql_notes;
@@ -48,6 +54,8 @@ SELECT @@SESSION.sql_notes;
1
1 / TRUE Expected
SET SESSION sql_notes = TRUE;
+Warnings:
+Warning 1287 '@@sql_notes' is deprecated and will be removed in a future release. Please use '@@note_verbosity' instead
connection con_int2;
SELECT @@SESSION.sql_notes;
@@SESSION.sql_notes
@@ -62,4 +70,6 @@ connection default;
disconnect con_int1;
disconnect con_int2;
SET SESSION sql_notes = @default_sql_notes;
+Warnings:
+Warning 1287 '@@sql_notes' is deprecated and will be removed in a future release. Please use '@@note_verbosity' instead
DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/suite/sys_vars/r/stored_program_cache_func.result b/mysql-test/suite/sys_vars/r/stored_program_cache_func.result
index 11151847..13b15ea7 100644
--- a/mysql-test/suite/sys_vars/r/stored_program_cache_func.result
+++ b/mysql-test/suite/sys_vars/r/stored_program_cache_func.result
@@ -41,8 +41,7 @@ end |
call pr(1);
b
call pr(2);
-ERROR 42S22: Unknown column 'test.t1.b' in 'field list'
-drop table t1;
+a
set global stored_program_cache=0;
call pr(1);
b
diff --git a/mysql-test/suite/sys_vars/r/sync_binlog_grant.result b/mysql-test/suite/sys_vars/r/sync_binlog_grant.result
index 1fcdf8b0..b66ba1fb 100644
--- a/mysql-test/suite/sys_vars/r/sync_binlog_grant.result
+++ b/mysql-test/suite/sys_vars/r/sync_binlog_grant.result
@@ -2,14 +2,14 @@
# MDEV-21963 Bind BINLOG ADMIN to a number of global system variables
#
SET @global=@@global.sync_binlog;
-# Test that "SET sync_binlog" is not allowed without BINLOG ADMIN or SUPER
+# Test that "SET sync_binlog" is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL sync_binlog=10;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the BINLOG ADMIN privilege(s) for this operation
SET sync_binlog=10;
ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION sync_binlog=10;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET sync_binlog" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL sync_binlog=10;
-SET sync_binlog=10;
-ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION sync_binlog=10;
-ERROR HY000: Variable 'sync_binlog' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.sync_binlog=@global;
diff --git a/mysql-test/suite/sys_vars/r/sync_master_info_grant.result b/mysql-test/suite/sys_vars/r/sync_master_info_grant.result
index 40b04ea4..6a81685d 100644
--- a/mysql-test/suite/sys_vars/r/sync_master_info_grant.result
+++ b/mysql-test/suite/sys_vars/r/sync_master_info_grant.result
@@ -2,14 +2,14 @@
# MDEV-21969 Bind REPLICATION SLAVE ADMIN to relay_log_*, sync_master_info, sync_relay_log, sync_relay_log_info
#
SET @global=@@global.sync_master_info;
-# Test that "SET sync_master_info" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET sync_master_info" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL sync_master_info=20000;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET sync_master_info=20000;
ERROR HY000: Variable 'sync_master_info' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION sync_master_info=20000;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'sync_master_info' is a GLOBAL variable and should be set
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET sync_master_info" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL sync_master_info=20000;
-SET sync_master_info=20000;
-ERROR HY000: Variable 'sync_master_info' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION sync_master_info=20000;
-ERROR HY000: Variable 'sync_master_info' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.sync_master_info=@global;
diff --git a/mysql-test/suite/sys_vars/r/sync_relay_log_grant.result b/mysql-test/suite/sys_vars/r/sync_relay_log_grant.result
index f71e8325..881a7b1f 100644
--- a/mysql-test/suite/sys_vars/r/sync_relay_log_grant.result
+++ b/mysql-test/suite/sys_vars/r/sync_relay_log_grant.result
@@ -2,14 +2,14 @@
# MDEV-21969 Bind REPLICATION SLAVE ADMIN to relay_log_*, sync_master_info, sync_relay_log, sync_relay_log_info
#
SET @global=@@global.sync_relay_log;
-# Test that "SET sync_relay_log" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET sync_relay_log" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL sync_relay_log=20000;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET sync_relay_log=20000;
ERROR HY000: Variable 'sync_relay_log' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION sync_relay_log=20000;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'sync_relay_log' is a GLOBAL variable and should be set wi
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET sync_relay_log" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL sync_relay_log=20000;
-SET sync_relay_log=20000;
-ERROR HY000: Variable 'sync_relay_log' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION sync_relay_log=20000;
-ERROR HY000: Variable 'sync_relay_log' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.sync_relay_log=@global;
diff --git a/mysql-test/suite/sys_vars/r/sync_relay_log_info_grant.result b/mysql-test/suite/sys_vars/r/sync_relay_log_info_grant.result
index 25727aac..18eae3fa 100644
--- a/mysql-test/suite/sys_vars/r/sync_relay_log_info_grant.result
+++ b/mysql-test/suite/sys_vars/r/sync_relay_log_info_grant.result
@@ -2,14 +2,14 @@
# MDEV-21969 Bind REPLICATION SLAVE ADMIN to relay_log_*, sync_master_info, sync_relay_log, sync_relay_log_info
#
SET @global=@@global.sync_relay_log_info;
-# Test that "SET sync_relay_log_info" is not allowed without REPLICATION SLAVE ADMIN or SUPER
+# Test that "SET sync_relay_log_info" is not allowed without REPLICATION SLAVE ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE REPLICATION SLAVE ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE REPLICATION SLAVE ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL sync_relay_log_info=20000;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, REPLICATION SLAVE ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the REPLICATION SLAVE ADMIN privilege(s) for this operation
SET sync_relay_log_info=20000;
ERROR HY000: Variable 'sync_relay_log_info' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION sync_relay_log_info=20000;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'sync_relay_log_info' is a GLOBAL variable and should be s
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET sync_relay_log_info" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL sync_relay_log_info=20000;
-SET sync_relay_log_info=20000;
-ERROR HY000: Variable 'sync_relay_log_info' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION sync_relay_log_info=20000;
-ERROR HY000: Variable 'sync_relay_log_info' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.sync_relay_log_info=@global;
diff --git a/mysql-test/suite/sys_vars/r/sysvars_aria,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_aria,32bit.rdiff
index 6569d266..f7d64b78 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_aria,32bit.rdiff
+++ b/mysql-test/suite/sys_vars/r/sysvars_aria,32bit.rdiff
@@ -1,5 +1,5 @@
---- suite/sys_vars/r/sysvars_aria.result 2021-02-02 02:58:55.686921205 +0200
-+++ suite/sys_vars/r/sysvars_aria,32bit.reject 2021-02-02 10:55:53.876791633 +0200
+--- a/mysql-test/suite/sys_vars/r/sysvars_aria.result
++++ b/mysql-test/suite/sys_vars/r/sysvars_aria.result
@@ -5,7 +5,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 8192
@@ -45,7 +45,7 @@
VARIABLE_COMMENT Interval between commits in microseconds (1/1000000 sec). 0 stands for no waiting for other threads to come and do a commit in "hard" mode and no sync()/commit at all in "soft" mode. Option has only an effect if aria_group_commit is used
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -89,7 +89,7 @@
+@@ -101,7 +101,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 1073741824
VARIABLE_SCOPE GLOBAL
@@ -54,7 +54,7 @@
VARIABLE_COMMENT Limit for transaction log size
NUMERIC_MIN_VALUE 8388608
NUMERIC_MAX_VALUE 4294967295
-@@ -125,10 +125,10 @@
+@@ -137,10 +137,10 @@
SESSION_VALUE NULL
DEFAULT_VALUE 300
VARIABLE_SCOPE GLOBAL
@@ -67,7 +67,7 @@
NUMERIC_BLOCK_SIZE 100
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -149,7 +149,7 @@
+@@ -161,7 +161,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 100
VARIABLE_SCOPE GLOBAL
@@ -76,7 +76,7 @@
VARIABLE_COMMENT The minimum percentage of warm blocks in key cache
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 100
-@@ -161,7 +161,7 @@
+@@ -173,7 +173,7 @@
SESSION_VALUE NULL
DEFAULT_VALUE 512
VARIABLE_SCOPE GLOBAL
@@ -85,7 +85,7 @@
VARIABLE_COMMENT Number of hash buckets for open and changed files. If you have a lot of Aria files open you should increase this for faster flush of changes. A good value is probably 1/10 of number of possible open Aria files.
NUMERIC_MIN_VALUE 128
NUMERIC_MAX_VALUE 16384
-@@ -197,7 +197,7 @@
+@@ -209,7 +209,7 @@
SESSION_VALUE 1
DEFAULT_VALUE 1
VARIABLE_SCOPE SESSION
@@ -94,7 +94,7 @@
VARIABLE_COMMENT Number of threads to use when repairing Aria tables. The value of 1 disables parallel repair.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 128
-@@ -212,7 +212,7 @@
+@@ -224,7 +224,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE.
NUMERIC_MIN_VALUE 16376
diff --git a/mysql-test/suite/sys_vars/r/sysvars_debug,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_debug,32bit.rdiff
index 8adb294d..50a3bed4 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_debug,32bit.rdiff
+++ b/mysql-test/suite/sys_vars/r/sysvars_debug,32bit.rdiff
@@ -1,7 +1,7 @@
---- r\sysvars_debug.result 2017-08-08 10:52:39.036804900 +0300
-+++ r\sysvars_debug,32bit.reject 2017-09-10 08:06:38.447122100 +0300
-@@ -21,7 +21,7 @@
- GLOBAL_VALUE_ORIGIN CONFIG
+--- a/mysql-test/suite/sys_vars/r/sysvars_debug.result
++++ b/mysql-test/suite/sys_vars/r/sysvars_debug.result
+@@ -22,7 +22,7 @@
+ GLOBAL_VALUE_ORIGIN COMMAND-LINE
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
diff --git a/mysql-test/suite/sys_vars/r/sysvars_debug.result b/mysql-test/suite/sys_vars/r/sysvars_debug.result
index 01f74170..37f03aee 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_debug.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_debug.result
@@ -61,21 +61,6 @@ ENUM_VALUE_LIST OFF,ON
READ_ONLY YES
COMMAND_LINE_ARGUMENT OPTIONAL
GLOBAL_VALUE_PATH NULL
-VARIABLE_NAME DEBUG_NO_THREAD_ALARM
-SESSION_VALUE NULL
-GLOBAL_VALUE OFF
-GLOBAL_VALUE_ORIGIN COMPILE-TIME
-DEFAULT_VALUE OFF
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Disable system thread alarm calls. Disabling it may be useful in debugging or testing, never do it in production
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY YES
-COMMAND_LINE_ARGUMENT OPTIONAL
-GLOBAL_VALUE_PATH NULL
VARIABLE_NAME DEBUG_SYNC
SESSION_VALUE ON - current signals: ''
GLOBAL_VALUE NULL
diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
index 6a7e184f..cfd035be 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
@@ -223,54 +223,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
-VARIABLE_NAME INNODB_CHANGE_BUFFERING
-SESSION_VALUE NULL
-DEFAULT_VALUE none
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE ENUM
-VARIABLE_COMMENT Buffer changes to secondary indexes.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST none,inserts,deletes,changes,purges,all
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME INNODB_CHANGE_BUFFERING_DEBUG
-SESSION_VALUE NULL
-DEFAULT_VALUE 0
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE INT UNSIGNED
-VARIABLE_COMMENT Debug flags for InnoDB change buffering (0=none, 1=try to buffer)
-NUMERIC_MIN_VALUE 0
-NUMERIC_MAX_VALUE 1
-NUMERIC_BLOCK_SIZE 0
-ENUM_VALUE_LIST NULL
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME INNODB_CHANGE_BUFFER_DUMP
-SESSION_VALUE NULL
-DEFAULT_VALUE OFF
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Dump the change buffer at startup.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY YES
-COMMAND_LINE_ARGUMENT NONE
-VARIABLE_NAME INNODB_CHANGE_BUFFER_MAX_SIZE
-SESSION_VALUE NULL
-DEFAULT_VALUE 25
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE INT UNSIGNED
-VARIABLE_COMMENT Maximum on-disk size of change buffer in terms of percentage of the buffer pool.
-NUMERIC_MIN_VALUE 0
-NUMERIC_MAX_VALUE 50
-NUMERIC_BLOCK_SIZE 0
-ENUM_VALUE_LIST NULL
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_CHECKSUM_ALGORITHM
SESSION_VALUE NULL
DEFAULT_VALUE full_crc32
@@ -355,6 +307,18 @@ NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_DATA_FILE_BUFFERING
+SESSION_VALUE NULL
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Whether the file system cache for data files is enabled
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_DATA_FILE_PATH
SESSION_VALUE NULL
DEFAULT_VALUE ibdata1:12M:autoextend
@@ -379,6 +343,18 @@ NUMERIC_BLOCK_SIZE 0
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_DATA_FILE_WRITE_THROUGH
+SESSION_VALUE NULL
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Whether each write to data files writes through
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_DATA_HOME_DIR
SESSION_VALUE NULL
DEFAULT_VALUE
@@ -439,78 +415,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST redundant,compact,dynamic
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME INNODB_DEFRAGMENT
-SESSION_VALUE NULL
-DEFAULT_VALUE OFF
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Enable/disable InnoDB defragmentation (default FALSE). When set to FALSE, all existing defragmentation will be paused. And new defragmentation command will fail.Paused defragmentation commands will resume when this variable is set to true again.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME INNODB_DEFRAGMENT_FILL_FACTOR
-SESSION_VALUE NULL
-DEFAULT_VALUE 0.900000
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE DOUBLE
-VARIABLE_COMMENT A number between [0.7, 1] that tells defragmentation how full it should fill a page. Default is 0.9. Number below 0.7 won't make much sense.This variable, together with innodb_defragment_fill_factor_n_recs, is introduced so defragmentation won't pack the page too full and cause page split on the next insert on every page. The variable indicating more defragmentation gain is the one effective.
-NUMERIC_MIN_VALUE 0.7
-NUMERIC_MAX_VALUE 1
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST NULL
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME INNODB_DEFRAGMENT_FILL_FACTOR_N_RECS
-SESSION_VALUE NULL
-DEFAULT_VALUE 20
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE INT UNSIGNED
-VARIABLE_COMMENT How many records of space defragmentation should leave on the page. This variable, together with innodb_defragment_fill_factor, is introduced so defragmentation won't pack the page too full and cause page split on the next insert on every page. The variable indicating more defragmentation gain is the one effective.
-NUMERIC_MIN_VALUE 1
-NUMERIC_MAX_VALUE 100
-NUMERIC_BLOCK_SIZE 0
-ENUM_VALUE_LIST NULL
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME INNODB_DEFRAGMENT_FREQUENCY
-SESSION_VALUE NULL
-DEFAULT_VALUE 40
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE INT UNSIGNED
-VARIABLE_COMMENT Do not defragment a single index more than this number of time per second.This controls the number of time defragmentation thread can request X_LOCK on an index. Defragmentation thread will check whether 1/defragment_frequency (s) has passed since it worked on this index last time, and put the index back to the queue if not enough time has passed. The actual frequency can only be lower than this given number.
-NUMERIC_MIN_VALUE 1
-NUMERIC_MAX_VALUE 1000
-NUMERIC_BLOCK_SIZE 0
-ENUM_VALUE_LIST NULL
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME INNODB_DEFRAGMENT_N_PAGES
-SESSION_VALUE NULL
-DEFAULT_VALUE 7
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE INT UNSIGNED
-VARIABLE_COMMENT Number of pages considered at once when merging multiple pages to defragment
-NUMERIC_MIN_VALUE 2
-NUMERIC_MAX_VALUE 32
-NUMERIC_BLOCK_SIZE 0
-ENUM_VALUE_LIST NULL
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME INNODB_DEFRAGMENT_STATS_ACCURACY
-SESSION_VALUE NULL
-DEFAULT_VALUE 0
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE INT UNSIGNED
-VARIABLE_COMMENT How many defragment stats changes there are before the stats are written to persistent storage. Set to 0 meaning disable defragment stats tracking.
-NUMERIC_MIN_VALUE 0
-NUMERIC_MAX_VALUE 4294967295
-NUMERIC_BLOCK_SIZE 0
-ENUM_VALUE_LIST NULL
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME INNODB_DISABLE_SORT_FILE_CACHE
SESSION_VALUE NULL
DEFAULT_VALUE OFF
@@ -527,14 +431,14 @@ VARIABLE_NAME INNODB_DOUBLEWRITE
SESSION_VALUE NULL
DEFAULT_VALUE ON
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Enable InnoDB doublewrite buffer (enabled by default). Disable with --skip-innodb-doublewrite.
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Whether and how to use the doublewrite buffer. OFF=Assume that writes of innodb_page_size are atomic; ON=Prevent torn writes (the default); fast=Like ON, but do not synchronize writes to data files
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY YES
-COMMAND_LINE_ARGUMENT NONE
+ENUM_VALUE_LIST OFF,ON,fast
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_ENCRYPTION_ROTATE_KEY_AGE
SESSION_VALUE NULL
DEFAULT_VALUE 1
@@ -1015,6 +919,18 @@ NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME INNODB_LOG_FILE_WRITE_THROUGH
+SESSION_VALUE NULL
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Whether each write to ib_logfile0 is write through
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_LOG_GROUP_HOME_DIR
SESSION_VALUE NULL
DEFAULT_VALUE
@@ -1639,6 +1555,18 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_TRUNCATE_TEMPORARY_TABLESPACE_NOW
+SESSION_VALUE NULL
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Shrink the temporary tablespace
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG
SESSION_VALUE NULL
DEFAULT_VALUE OFF
@@ -1689,7 +1617,7 @@ READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME INNODB_UNDO_TABLESPACES
SESSION_VALUE NULL
-DEFAULT_VALUE 0
+DEFAULT_VALUE 3
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Number of undo tablespaces to use.
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff
index e7621986..771fa906 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff
@@ -1,5 +1,5 @@
---- sysvars_server_embedded.result 2024-01-24 07:43:25.510260081 +0100
-+++ sysvars_server_embedded,32bit.result 2024-01-28 18:07:02.851488186 +0100
+--- sysvars_server_embedded.result 2024-02-15 09:34:10.105925200 +0100
++++ sysvars_server_embedded,32bit.result 2024-02-15 13:49:05.823558727 +0100
@@ -44,7 +44,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_BLOCK_SIZE
@@ -182,7 +182,7 @@
NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -467,7 +467,7 @@
+@@ -507,7 +507,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The size of the statement cache for updates to non-transactional engines for the binary log. If you often use statements updating a great number of rows, you can increase this to get more performance.
NUMERIC_MIN_VALUE 4096
@@ -191,7 +191,7 @@
NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -477,7 +477,7 @@
+@@ -527,7 +527,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Size of tree cache used in bulk insert optimisation. Note that this is a limit per thread!
NUMERIC_MIN_VALUE 0
@@ -200,7 +200,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -664,7 +664,7 @@
+@@ -724,7 +724,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME CONNECT_TIMEOUT
VARIABLE_SCOPE GLOBAL
@@ -209,7 +209,7 @@
VARIABLE_COMMENT The number of seconds the mysqld server is waiting for a connect packet before responding with 'Bad handshake'
NUMERIC_MIN_VALUE 2
NUMERIC_MAX_VALUE 31536000
-@@ -714,7 +714,7 @@
+@@ -754,7 +754,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEADLOCK_SEARCH_DEPTH_LONG
VARIABLE_SCOPE SESSION
@@ -218,7 +218,7 @@
VARIABLE_COMMENT Long search depth for the two-step deadlock detection
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 33
-@@ -724,7 +724,7 @@
+@@ -764,7 +764,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEADLOCK_SEARCH_DEPTH_SHORT
VARIABLE_SCOPE SESSION
@@ -227,7 +227,7 @@
VARIABLE_COMMENT Short search depth for the two-step deadlock detection
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 32
-@@ -734,7 +734,7 @@
+@@ -774,7 +774,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEADLOCK_TIMEOUT_LONG
VARIABLE_SCOPE SESSION
@@ -236,7 +236,7 @@
VARIABLE_COMMENT Long timeout for the two-step deadlock detection (in microseconds)
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -744,7 +744,7 @@
+@@ -784,7 +784,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEADLOCK_TIMEOUT_SHORT
VARIABLE_SCOPE SESSION
@@ -245,7 +245,7 @@
VARIABLE_COMMENT Short timeout for the two-step deadlock detection (in microseconds)
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -794,7 +794,7 @@
+@@ -834,7 +834,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME DEFAULT_WEEK_FORMAT
VARIABLE_SCOPE SESSION
@@ -254,7 +254,7 @@
VARIABLE_COMMENT The default week format used by WEEK() functions
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 7
-@@ -804,7 +804,7 @@
+@@ -844,7 +844,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DELAYED_INSERT_LIMIT
VARIABLE_SCOPE GLOBAL
@@ -263,7 +263,7 @@
VARIABLE_COMMENT After inserting delayed_insert_limit rows, the INSERT DELAYED handler will check if there are any SELECT statements pending. If so, it allows these to execute before continuing.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -814,7 +814,7 @@
+@@ -854,7 +854,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DELAYED_INSERT_TIMEOUT
VARIABLE_SCOPE GLOBAL
@@ -272,7 +272,7 @@
VARIABLE_COMMENT How long a INSERT DELAYED thread should wait for INSERT statements before terminating
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
-@@ -824,7 +824,7 @@
+@@ -864,7 +864,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DELAYED_QUEUE_SIZE
VARIABLE_SCOPE GLOBAL
@@ -281,7 +281,7 @@
VARIABLE_COMMENT What size queue (in rows) should be allocated for handling INSERT DELAYED. If the queue becomes full, any client that does INSERT DELAYED will wait until there is room in the queue again
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -854,7 +854,7 @@
+@@ -894,7 +894,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME DIV_PRECISION_INCREMENT
VARIABLE_SCOPE SESSION
@@ -290,7 +290,7 @@
VARIABLE_COMMENT Precision of the result of '/' operator will be increased on that value
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 38
-@@ -964,7 +964,7 @@
+@@ -1004,7 +1004,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME EXTRA_MAX_CONNECTIONS
VARIABLE_SCOPE GLOBAL
@@ -299,7 +299,7 @@
VARIABLE_COMMENT The number of connections on extra-port
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 100000
-@@ -994,7 +994,7 @@
+@@ -1034,7 +1034,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME FLUSH_TIME
VARIABLE_SCOPE GLOBAL
@@ -308,7 +308,7 @@
VARIABLE_COMMENT A dedicated thread is created to flush all tables at the given interval
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 31536000
-@@ -1024,7 +1024,7 @@
+@@ -1064,7 +1064,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME FT_MAX_WORD_LEN
VARIABLE_SCOPE GLOBAL
@@ -317,7 +317,7 @@
VARIABLE_COMMENT The maximum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 84
-@@ -1034,7 +1034,7 @@
+@@ -1074,7 +1074,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME FT_MIN_WORD_LEN
VARIABLE_SCOPE GLOBAL
@@ -326,7 +326,7 @@
VARIABLE_COMMENT The minimum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 84
-@@ -1044,7 +1044,7 @@
+@@ -1084,7 +1084,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME FT_QUERY_EXPANSION_LIMIT
VARIABLE_SCOPE GLOBAL
@@ -335,7 +335,7 @@
VARIABLE_COMMENT Number of best matches to use for query expansion
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1000
-@@ -1214,7 +1214,7 @@
+@@ -1254,7 +1254,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME HISTOGRAM_SIZE
VARIABLE_SCOPE SESSION
@@ -344,7 +344,7 @@
VARIABLE_COMMENT Number of bytes used for a histogram. If set to 0, no histograms are created by ANALYZE.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 255
-@@ -1244,7 +1244,7 @@
+@@ -1284,7 +1284,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME HOST_CACHE_SIZE
VARIABLE_SCOPE GLOBAL
@@ -353,7 +353,7 @@
VARIABLE_COMMENT How many host names should be cached to avoid resolving.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 65536
-@@ -1354,7 +1354,7 @@
+@@ -1394,7 +1394,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME INTERACTIVE_TIMEOUT
VARIABLE_SCOPE SESSION
@@ -362,7 +362,7 @@
VARIABLE_COMMENT The number of seconds the server waits for activity on an interactive connection before closing it
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
-@@ -1387,7 +1387,7 @@
+@@ -1427,7 +1427,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The size of the buffer that is used for joins
NUMERIC_MIN_VALUE 128
@@ -371,7 +371,7 @@
NUMERIC_BLOCK_SIZE 128
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1404,7 +1404,7 @@
+@@ -1444,7 +1444,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME JOIN_CACHE_LEVEL
VARIABLE_SCOPE SESSION
@@ -380,7 +380,7 @@
VARIABLE_COMMENT Controls what join operations can be executed with join buffers. Odd numbers are used for plain join buffers while even numbers are used for linked buffers
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 8
-@@ -1427,7 +1427,7 @@
+@@ -1467,7 +1467,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford
NUMERIC_MIN_VALUE 0
@@ -389,7 +389,7 @@
NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1584,7 +1584,7 @@
+@@ -1624,7 +1624,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME LOCK_WAIT_TIMEOUT
VARIABLE_SCOPE SESSION
@@ -398,7 +398,7 @@
VARIABLE_COMMENT Timeout in seconds to wait for a lock before returning an error.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 31536000
-@@ -1704,7 +1704,7 @@
+@@ -1744,7 +1744,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_SLOW_MAX_WARNINGS
VARIABLE_SCOPE SESSION
@@ -407,7 +407,7 @@
VARIABLE_COMMENT Max numbers of warnings printed to slow query log per statement
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1000
-@@ -1714,7 +1714,7 @@
+@@ -1754,7 +1754,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_SLOW_MIN_EXAMINED_ROW_LIMIT
VARIABLE_SCOPE SESSION
@@ -416,7 +416,7 @@
VARIABLE_COMMENT Don't write queries to slow log that examine fewer rows than that
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -1754,7 +1754,7 @@
+@@ -1794,7 +1794,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_SLOW_RATE_LIMIT
VARIABLE_SCOPE SESSION
@@ -425,7 +425,7 @@
VARIABLE_COMMENT Write to slow log every #th slow query. Set to 1 to log everything. Increase it to reduce the size of the slow or the performance impact of slow logging
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -1784,7 +1784,7 @@
+@@ -1824,7 +1824,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_WARNINGS
VARIABLE_SCOPE SESSION
@@ -434,7 +434,7 @@
VARIABLE_COMMENT Log some non critical warnings to the error log.Value can be between 0 and 11. Higher values mean more verbosity
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -1834,7 +1834,7 @@
+@@ -1874,7 +1874,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME MAX_ALLOWED_PACKET
VARIABLE_SCOPE SESSION
@@ -443,7 +443,7 @@
VARIABLE_COMMENT Max packet length to send to or receive from the server
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1073741824
-@@ -1847,14 +1847,14 @@
+@@ -1887,14 +1887,14 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the total size of the transactional cache
NUMERIC_MIN_VALUE 4096
@@ -460,7 +460,7 @@
VARIABLE_COMMENT Binary log will be rotated automatically when the size exceeds this value.
NUMERIC_MIN_VALUE 4096
NUMERIC_MAX_VALUE 1073741824
-@@ -1867,14 +1867,14 @@
+@@ -1907,7 +1907,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the total size of the statement cache
NUMERIC_MIN_VALUE 4096
@@ -469,6 +469,7 @@
NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
+@@ -1924,7 +1924,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_CONNECTIONS
VARIABLE_SCOPE GLOBAL
@@ -477,7 +478,7 @@
VARIABLE_COMMENT The number of simultaneous clients allowed
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 100000
-@@ -1884,7 +1884,7 @@
+@@ -1934,7 +1934,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_CONNECT_ERRORS
VARIABLE_SCOPE GLOBAL
@@ -486,7 +487,7 @@
VARIABLE_COMMENT If there is more than this number of interrupted connections from a host this host will be blocked from further connections
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -1894,7 +1894,7 @@
+@@ -1944,7 +1944,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_DELAYED_THREADS
VARIABLE_SCOPE SESSION
@@ -495,7 +496,7 @@
VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16384
-@@ -1914,7 +1914,7 @@
+@@ -1964,7 +1964,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_ERROR_COUNT
VARIABLE_SCOPE SESSION
@@ -504,7 +505,7 @@
VARIABLE_COMMENT Max number of errors/warnings to store for a statement
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 65535
-@@ -1927,14 +1927,14 @@
+@@ -1977,14 +1977,14 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Don't allow creation of heap tables bigger than this
NUMERIC_MIN_VALUE 16384
@@ -521,7 +522,7 @@
VARIABLE_COMMENT Alias for max_delayed_threads. Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16384
-@@ -1954,7 +1954,7 @@
+@@ -2004,7 +2004,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_LENGTH_FOR_SORT_DATA
VARIABLE_SCOPE SESSION
@@ -530,7 +531,7 @@
VARIABLE_COMMENT Max number of bytes in sorted records
NUMERIC_MIN_VALUE 4
NUMERIC_MAX_VALUE 8388608
-@@ -1984,7 +1984,7 @@
+@@ -2034,7 +2034,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_RECURSIVE_ITERATIONS
VARIABLE_SCOPE SESSION
@@ -539,7 +540,7 @@
VARIABLE_COMMENT Maximum number of iterations when executing recursive queries
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -1997,14 +1997,14 @@
+@@ -2047,14 +2047,14 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The maximum size of the container of a rowid filter
NUMERIC_MIN_VALUE 1024
@@ -556,7 +557,7 @@
VARIABLE_COMMENT Limit assumed max number of seeks when looking up rows based on a key
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -2024,7 +2024,7 @@
+@@ -2074,7 +2074,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_SORT_LENGTH
VARIABLE_SCOPE SESSION
@@ -565,7 +566,7 @@
VARIABLE_COMMENT The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored)
NUMERIC_MIN_VALUE 64
NUMERIC_MAX_VALUE 8388608
-@@ -2034,7 +2034,7 @@
+@@ -2084,7 +2084,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_SP_RECURSION_DEPTH
VARIABLE_SCOPE SESSION
@@ -574,16 +575,7 @@
VARIABLE_COMMENT Maximum stored procedure recursion depth
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 255
-@@ -2054,7 +2054,7 @@
- COMMAND_LINE_ARGUMENT REQUIRED
- VARIABLE_NAME MAX_TMP_TABLES
- VARIABLE_SCOPE SESSION
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Unused, will be removed.
- NUMERIC_MIN_VALUE 1
- NUMERIC_MAX_VALUE 4294967295
-@@ -2074,7 +2074,7 @@
+@@ -2114,7 +2114,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_WRITE_LOCK_COUNT
VARIABLE_SCOPE GLOBAL
@@ -592,7 +584,7 @@
VARIABLE_COMMENT After this many write locks, allow some read locks to run in between
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -2084,7 +2084,7 @@
+@@ -2124,7 +2124,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME METADATA_LOCKS_CACHE_SIZE
VARIABLE_SCOPE GLOBAL
@@ -601,7 +593,7 @@
VARIABLE_COMMENT Unused
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1048576
-@@ -2094,7 +2094,7 @@
+@@ -2134,7 +2134,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME METADATA_LOCKS_HASH_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -610,7 +602,7 @@
VARIABLE_COMMENT Unused
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1024
-@@ -2104,7 +2104,7 @@
+@@ -2144,7 +2144,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MIN_EXAMINED_ROW_LIMIT
VARIABLE_SCOPE SESSION
@@ -619,7 +611,7 @@
VARIABLE_COMMENT Alias for log_slow_min_examined_row_limit. Don't write queries to slow log that examine fewer rows than that
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -2114,7 +2114,7 @@
+@@ -2154,7 +2154,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MRR_BUFFER_SIZE
VARIABLE_SCOPE SESSION
@@ -628,7 +620,7 @@
VARIABLE_COMMENT Size of buffer to use when using MRR with range access
NUMERIC_MIN_VALUE 8192
NUMERIC_MAX_VALUE 2147483647
-@@ -2124,7 +2124,7 @@
+@@ -2164,7 +2164,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MYISAM_BLOCK_SIZE
VARIABLE_SCOPE GLOBAL
@@ -637,7 +629,7 @@
VARIABLE_COMMENT Block size to be used for MyISAM index pages
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 16384
-@@ -2134,7 +2134,7 @@
+@@ -2174,7 +2174,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MYISAM_DATA_POINTER_SIZE
VARIABLE_SCOPE GLOBAL
@@ -646,7 +638,7 @@
VARIABLE_COMMENT Default pointer size to be used for MyISAM tables
NUMERIC_MIN_VALUE 2
NUMERIC_MAX_VALUE 7
-@@ -2157,7 +2157,7 @@
+@@ -2197,7 +2197,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Restricts the total memory used for memory mapping of MySQL tables
NUMERIC_MIN_VALUE 7
@@ -655,7 +647,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY YES
-@@ -2174,10 +2174,10 @@
+@@ -2214,10 +2214,10 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME MYISAM_REPAIR_THREADS
VARIABLE_SCOPE SESSION
@@ -668,7 +660,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -2187,7 +2187,7 @@
+@@ -2227,7 +2227,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE
NUMERIC_MIN_VALUE 4096
@@ -677,7 +669,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -2224,7 +2224,7 @@
+@@ -2264,7 +2264,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME NET_BUFFER_LENGTH
VARIABLE_SCOPE SESSION
@@ -686,7 +678,7 @@
VARIABLE_COMMENT Buffer length for TCP/IP and socket communication
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1048576
-@@ -2234,7 +2234,7 @@
+@@ -2274,7 +2274,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME NET_READ_TIMEOUT
VARIABLE_SCOPE SESSION
@@ -695,7 +687,7 @@
VARIABLE_COMMENT Number of seconds to wait for more data from a connection before aborting the read
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
-@@ -2244,7 +2244,7 @@
+@@ -2284,7 +2284,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME NET_RETRY_COUNT
VARIABLE_SCOPE SESSION
@@ -704,7 +696,7 @@
VARIABLE_COMMENT If a read on a communication port is interrupted, retry this many times before giving up
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -2254,7 +2254,7 @@
+@@ -2294,7 +2294,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME NET_WRITE_TIMEOUT
VARIABLE_SCOPE SESSION
@@ -713,7 +705,7 @@
VARIABLE_COMMENT Number of seconds to wait for a block to be written to a connection before aborting the write
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
-@@ -2314,7 +2314,7 @@
+@@ -2344,7 +2344,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME OPEN_FILES_LIMIT
VARIABLE_SCOPE GLOBAL
@@ -722,16 +714,16 @@
VARIABLE_COMMENT If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 or autoset then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of file descriptors
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -2324,7 +2324,7 @@
+@@ -2354,7 +2354,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_ADJUST_SECONDARY_KEY_COSTS
VARIABLE_SCOPE SESSION
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT 0 = No changes. 1 = Update secondary key costs for ranges to be at least 5x of clustered primary key costs. 2 = Remove 'max_seek optimization' for secondary keys and slight adjustment of filter cost. This option will be deleted in MariaDB 11.0 as it is not needed with the new 11.0 optimizer.
+ VARIABLE_COMMENT Unused, will be removed.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 2
-@@ -2334,7 +2334,7 @@
+@@ -2384,7 +2384,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_EXTRA_PRUNING_DEPTH
VARIABLE_SCOPE SESSION
@@ -740,7 +732,7 @@
VARIABLE_COMMENT If the optimizer needs to enumerate join prefix of this size or larger, then it will try aggressively prune away the search space.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 62
-@@ -2344,7 +2344,7 @@
+@@ -2444,7 +2444,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_MAX_SEL_ARGS
VARIABLE_SCOPE SESSION
@@ -749,7 +741,7 @@
VARIABLE_COMMENT The maximum number of SEL_ARG objects created when optimizing a range. If more objects would be needed, the range will not be used by the optimizer.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -2354,7 +2354,7 @@
+@@ -2454,7 +2454,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_MAX_SEL_ARG_WEIGHT
VARIABLE_SCOPE SESSION
@@ -758,7 +750,7 @@
VARIABLE_COMMENT The maximum weight of the SEL_ARG graph. Set to 0 for no limit
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -2364,7 +2364,7 @@
+@@ -2464,7 +2464,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_PRUNE_LEVEL
VARIABLE_SCOPE SESSION
@@ -767,7 +759,7 @@
VARIABLE_COMMENT Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search: 1 - prune plans based on cost and number of retrieved rows eq_ref: 2 - prune also if we find an eq_ref chain
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 2
-@@ -2374,7 +2374,7 @@
+@@ -2534,7 +2534,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_SEARCH_DEPTH
VARIABLE_SCOPE SESSION
@@ -776,7 +768,7 @@
VARIABLE_COMMENT Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 62
-@@ -2384,7 +2384,7 @@
+@@ -2544,7 +2544,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_SELECTIVITY_SAMPLING_LIMIT
VARIABLE_SCOPE SESSION
@@ -785,7 +777,7 @@
VARIABLE_COMMENT Controls number of record samples to check condition selectivity
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 4294967295
-@@ -2414,17 +2414,17 @@
+@@ -2574,17 +2574,17 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_TRACE_MAX_MEM_SIZE
VARIABLE_SCOPE SESSION
@@ -806,7 +798,7 @@
VARIABLE_COMMENT Controls selectivity of which conditions the optimizer takes into account to calculate cardinality of a partial join when it searches for the best execution plan Meaning: 1 - use selectivity of index backed range conditions to calculate the cardinality of a partial join if the last joined table is accessed by full table scan or an index scan, 2 - use selectivity of index backed range conditions to calculate the cardinality of a partial join in any case, 3 - additionally always use selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join, 4 - use histograms to calculate selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join.5 - additionally use selectivity of certain non-range predicates calculated on record samples
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 5
-@@ -2444,7 +2444,7 @@
+@@ -2614,7 +2614,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME PERFORMANCE_SCHEMA_ACCOUNTS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -815,7 +807,7 @@
VARIABLE_COMMENT Maximum number of instrumented user@host accounts. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2454,7 +2454,7 @@
+@@ -2624,7 +2624,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_DIGESTS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -824,7 +816,7 @@
VARIABLE_COMMENT Size of the statement digest. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2464,7 +2464,7 @@
+@@ -2634,7 +2634,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STAGES_HISTORY_LONG_SIZE
VARIABLE_SCOPE GLOBAL
@@ -833,7 +825,7 @@
VARIABLE_COMMENT Number of rows in EVENTS_STAGES_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2474,7 +2474,7 @@
+@@ -2644,7 +2644,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STAGES_HISTORY_SIZE
VARIABLE_SCOPE GLOBAL
@@ -842,7 +834,7 @@
VARIABLE_COMMENT Number of rows per thread in EVENTS_STAGES_HISTORY. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1024
-@@ -2484,7 +2484,7 @@
+@@ -2654,7 +2654,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STATEMENTS_HISTORY_LONG_SIZE
VARIABLE_SCOPE GLOBAL
@@ -851,7 +843,7 @@
VARIABLE_COMMENT Number of rows in EVENTS_STATEMENTS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2494,7 +2494,7 @@
+@@ -2664,7 +2664,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STATEMENTS_HISTORY_SIZE
VARIABLE_SCOPE GLOBAL
@@ -860,7 +852,7 @@
VARIABLE_COMMENT Number of rows per thread in EVENTS_STATEMENTS_HISTORY. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1024
-@@ -2504,7 +2504,7 @@
+@@ -2674,7 +2674,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_TRANSACTIONS_HISTORY_LONG_SIZE
VARIABLE_SCOPE GLOBAL
@@ -869,7 +861,7 @@
VARIABLE_COMMENT Number of rows in EVENTS_TRANSACTIONS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2514,7 +2514,7 @@
+@@ -2684,7 +2684,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_TRANSACTIONS_HISTORY_SIZE
VARIABLE_SCOPE GLOBAL
@@ -878,7 +870,7 @@
VARIABLE_COMMENT Number of rows per thread in EVENTS_TRANSACTIONS_HISTORY. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1024
-@@ -2524,7 +2524,7 @@
+@@ -2694,7 +2694,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_LONG_SIZE
VARIABLE_SCOPE GLOBAL
@@ -887,7 +879,7 @@
VARIABLE_COMMENT Number of rows in EVENTS_WAITS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2534,7 +2534,7 @@
+@@ -2704,7 +2704,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_SIZE
VARIABLE_SCOPE GLOBAL
@@ -896,7 +888,7 @@
VARIABLE_COMMENT Number of rows per thread in EVENTS_WAITS_HISTORY. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1024
-@@ -2544,7 +2544,7 @@
+@@ -2714,7 +2714,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_HOSTS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -905,7 +897,7 @@
VARIABLE_COMMENT Maximum number of instrumented hosts. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2554,7 +2554,7 @@
+@@ -2724,7 +2724,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_COND_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -914,7 +906,7 @@
VARIABLE_COMMENT Maximum number of condition instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2564,7 +2564,7 @@
+@@ -2734,7 +2734,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_COND_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -923,7 +915,7 @@
VARIABLE_COMMENT Maximum number of instrumented condition objects. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2574,7 +2574,7 @@
+@@ -2744,7 +2744,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_DIGEST_LENGTH
VARIABLE_SCOPE GLOBAL
@@ -932,7 +924,7 @@
VARIABLE_COMMENT Maximum length considered for digest text, when stored in performance_schema tables.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
-@@ -2584,7 +2584,7 @@
+@@ -2754,7 +2754,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -941,7 +933,7 @@
VARIABLE_COMMENT Maximum number of file instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2594,7 +2594,7 @@
+@@ -2764,7 +2764,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_HANDLES
VARIABLE_SCOPE GLOBAL
@@ -950,7 +942,7 @@
VARIABLE_COMMENT Maximum number of opened instrumented files.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
-@@ -2604,7 +2604,7 @@
+@@ -2774,7 +2774,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -959,7 +951,7 @@
VARIABLE_COMMENT Maximum number of instrumented files. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2614,7 +2614,7 @@
+@@ -2784,7 +2784,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_INDEX_STAT
VARIABLE_SCOPE GLOBAL
@@ -968,7 +960,7 @@
VARIABLE_COMMENT Maximum number of index statistics for instrumented tables. Use 0 to disable, -1 for automated scaling.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2624,7 +2624,7 @@
+@@ -2794,7 +2794,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_MEMORY_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -977,7 +969,7 @@
VARIABLE_COMMENT Maximum number of memory pool instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1024
-@@ -2634,7 +2634,7 @@
+@@ -2804,7 +2804,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_METADATA_LOCKS
VARIABLE_SCOPE GLOBAL
@@ -986,7 +978,7 @@
VARIABLE_COMMENT Maximum number of metadata locks. Use 0 to disable, -1 for automated scaling.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 104857600
-@@ -2644,7 +2644,7 @@
+@@ -2814,7 +2814,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_MUTEX_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -995,7 +987,7 @@
VARIABLE_COMMENT Maximum number of mutex instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2654,7 +2654,7 @@
+@@ -2824,7 +2824,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_MUTEX_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -1004,7 +996,7 @@
VARIABLE_COMMENT Maximum number of instrumented MUTEX objects. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 104857600
-@@ -2664,7 +2664,7 @@
+@@ -2834,7 +2834,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_PREPARED_STATEMENTS_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -1013,7 +1005,7 @@
VARIABLE_COMMENT Maximum number of instrumented prepared statements. Use 0 to disable, -1 for automated scaling.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2674,7 +2674,7 @@
+@@ -2844,7 +2844,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_PROGRAM_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -1022,7 +1014,7 @@
VARIABLE_COMMENT Maximum number of instrumented programs. Use 0 to disable, -1 for automated scaling.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2684,7 +2684,7 @@
+@@ -2854,7 +2854,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_RWLOCK_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -1031,7 +1023,7 @@
VARIABLE_COMMENT Maximum number of rwlock instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2694,7 +2694,7 @@
+@@ -2864,7 +2864,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_RWLOCK_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -1040,7 +1032,7 @@
VARIABLE_COMMENT Maximum number of instrumented RWLOCK objects. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 104857600
-@@ -2704,7 +2704,7 @@
+@@ -2874,7 +2874,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_SOCKET_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -1049,7 +1041,7 @@
VARIABLE_COMMENT Maximum number of socket instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2714,7 +2714,7 @@
+@@ -2884,7 +2884,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_SOCKET_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -1058,7 +1050,7 @@
VARIABLE_COMMENT Maximum number of opened instrumented sockets. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2724,7 +2724,7 @@
+@@ -2894,7 +2894,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_SQL_TEXT_LENGTH
VARIABLE_SCOPE GLOBAL
@@ -1067,7 +1059,7 @@
VARIABLE_COMMENT Maximum length of displayed sql text.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
-@@ -2734,7 +2734,7 @@
+@@ -2904,7 +2904,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STAGE_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -1076,7 +1068,7 @@
VARIABLE_COMMENT Maximum number of stage instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2744,7 +2744,7 @@
+@@ -2914,7 +2914,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STATEMENT_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -1085,7 +1077,7 @@
VARIABLE_COMMENT Maximum number of statement instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2754,7 +2754,7 @@
+@@ -2924,7 +2924,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STATEMENT_STACK
VARIABLE_SCOPE GLOBAL
@@ -1094,7 +1086,7 @@
VARIABLE_COMMENT Number of rows per thread in EVENTS_STATEMENTS_CURRENT.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 256
-@@ -2764,7 +2764,7 @@
+@@ -2934,7 +2934,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_TABLE_HANDLES
VARIABLE_SCOPE GLOBAL
@@ -1103,7 +1095,7 @@
VARIABLE_COMMENT Maximum number of opened instrumented tables. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2774,7 +2774,7 @@
+@@ -2944,7 +2944,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_TABLE_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -1112,7 +1104,7 @@
VARIABLE_COMMENT Maximum number of instrumented tables. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2784,7 +2784,7 @@
+@@ -2954,7 +2954,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_TABLE_LOCK_STAT
VARIABLE_SCOPE GLOBAL
@@ -1121,7 +1113,7 @@
VARIABLE_COMMENT Maximum number of lock statistics for instrumented tables. Use 0 to disable, -1 for automated scaling.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2794,7 +2794,7 @@
+@@ -2964,7 +2964,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_THREAD_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -1130,7 +1122,7 @@
VARIABLE_COMMENT Maximum number of thread instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2804,7 +2804,7 @@
+@@ -2974,7 +2974,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_THREAD_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -1139,7 +1131,7 @@
VARIABLE_COMMENT Maximum number of instrumented threads. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2814,7 +2814,7 @@
+@@ -2984,7 +2984,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_SESSION_CONNECT_ATTRS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -1148,7 +1140,7 @@
VARIABLE_COMMENT Size of session attribute string buffer per thread. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2824,7 +2824,7 @@
+@@ -2994,7 +2994,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_SETUP_ACTORS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -1157,7 +1149,7 @@
VARIABLE_COMMENT Maximum number of rows in SETUP_ACTORS.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1024
-@@ -2834,7 +2834,7 @@
+@@ -3004,7 +3004,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_SETUP_OBJECTS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -1166,7 +1158,7 @@
VARIABLE_COMMENT Maximum number of rows in SETUP_OBJECTS.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2844,7 +2844,7 @@
+@@ -3014,7 +3014,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_USERS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -1175,7 +1167,7 @@
VARIABLE_COMMENT Maximum number of instrumented users. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2894,7 +2894,7 @@
+@@ -3064,7 +3064,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PRELOAD_BUFFER_SIZE
VARIABLE_SCOPE SESSION
@@ -1184,7 +1176,7 @@
VARIABLE_COMMENT The size of the buffer that is allocated when preloading indexes
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1073741824
-@@ -2914,7 +2914,7 @@
+@@ -3084,7 +3084,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME PROFILING_HISTORY_SIZE
VARIABLE_SCOPE SESSION
@@ -1193,7 +1185,7 @@
VARIABLE_COMMENT Number of statements about which profiling information is maintained. If set to 0, no profiles are stored. See SHOW PROFILES.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 100
-@@ -2924,7 +2924,7 @@
+@@ -3094,7 +3094,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PROGRESS_REPORT_TIME
VARIABLE_SCOPE SESSION
@@ -1202,7 +1194,7 @@
VARIABLE_COMMENT Seconds between sending progress reports to the client for time-consuming statements. Set to 0 to disable progress reporting.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -2984,7 +2984,7 @@
+@@ -3154,7 +3154,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME QUERY_ALLOC_BLOCK_SIZE
VARIABLE_SCOPE SESSION
@@ -1211,7 +1203,7 @@
VARIABLE_COMMENT Allocation block size for query parsing and execution
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 4294967295
-@@ -2994,7 +2994,7 @@
+@@ -3164,7 +3164,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME QUERY_CACHE_LIMIT
VARIABLE_SCOPE GLOBAL
@@ -1220,7 +1212,7 @@
VARIABLE_COMMENT Don't cache results that are bigger than this
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -3004,7 +3004,7 @@
+@@ -3174,7 +3174,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME QUERY_CACHE_MIN_RES_UNIT
VARIABLE_SCOPE GLOBAL
@@ -1229,7 +1221,7 @@
VARIABLE_COMMENT The minimum size for blocks allocated by the query cache
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -3017,7 +3017,7 @@
+@@ -3187,7 +3187,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The memory allocated to store results from old queries
NUMERIC_MIN_VALUE 0
@@ -1238,7 +1230,7 @@
NUMERIC_BLOCK_SIZE 1024
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3054,7 +3054,7 @@
+@@ -3224,7 +3224,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME QUERY_PREALLOC_SIZE
VARIABLE_SCOPE SESSION
@@ -1247,7 +1239,7 @@
VARIABLE_COMMENT Persistent buffer for query parsing and execution
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 4294967295
-@@ -3067,7 +3067,7 @@
+@@ -3237,7 +3237,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes
NUMERIC_MIN_VALUE 0
@@ -1256,7 +1248,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3077,14 +3077,14 @@
+@@ -3247,14 +3247,14 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes
NUMERIC_MIN_VALUE 0
@@ -1273,7 +1265,7 @@
VARIABLE_COMMENT Allocation block size for storing ranges during optimization
NUMERIC_MIN_VALUE 4096
NUMERIC_MAX_VALUE 4294967295
-@@ -3094,7 +3094,7 @@
+@@ -3264,7 +3264,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME READ_BUFFER_SIZE
VARIABLE_SCOPE SESSION
@@ -1282,7 +1274,7 @@
VARIABLE_COMMENT Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value
NUMERIC_MIN_VALUE 8192
NUMERIC_MAX_VALUE 2147483647
-@@ -3114,7 +3114,7 @@
+@@ -3284,7 +3284,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME READ_RND_BUFFER_SIZE
VARIABLE_SCOPE SESSION
@@ -1291,7 +1283,7 @@
VARIABLE_COMMENT When reading rows in sorted order after a sort, the rows are read through this buffer to avoid a disk seeks
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 2147483647
-@@ -3134,10 +3134,10 @@
+@@ -3304,10 +3304,10 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME ROWID_MERGE_BUFF_SIZE
VARIABLE_SCOPE SESSION
@@ -1304,7 +1296,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3174,7 +3174,7 @@
+@@ -3344,7 +3344,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SERVER_ID
VARIABLE_SCOPE SESSION
@@ -1313,8 +1305,8 @@
VARIABLE_COMMENT Uniquely identifies the server instance in the community of replication partners
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -3254,7 +3254,7 @@
- COMMAND_LINE_ARGUMENT OPTIONAL
+@@ -3434,7 +3434,7 @@
+ COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SLAVE_MAX_ALLOWED_PACKET
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
@@ -1322,7 +1314,7 @@
VARIABLE_COMMENT The maximum packet length to sent successfully from the master to slave.
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1073741824
-@@ -3264,7 +3264,7 @@
+@@ -3444,7 +3444,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SLOW_LAUNCH_TIME
VARIABLE_SCOPE GLOBAL
@@ -1331,7 +1323,7 @@
VARIABLE_COMMENT If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 31536000
-@@ -3307,7 +3307,7 @@
+@@ -3487,7 +3487,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Each thread that needs to do a sort allocates a buffer of this size
NUMERIC_MIN_VALUE 1024
@@ -1340,7 +1332,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3524,7 +3524,7 @@
+@@ -3704,7 +3704,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME STORED_PROGRAM_CACHE
VARIABLE_SCOPE GLOBAL
@@ -1349,7 +1341,7 @@
VARIABLE_COMMENT The soft upper limit for number of cached stored routines for one connection.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 524288
-@@ -3614,7 +3614,7 @@
+@@ -3794,7 +3794,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME TABLE_DEFINITION_CACHE
VARIABLE_SCOPE GLOBAL
@@ -1358,7 +1350,7 @@
VARIABLE_COMMENT The number of cached table definitions
NUMERIC_MIN_VALUE 400
NUMERIC_MAX_VALUE 2097152
-@@ -3624,7 +3624,7 @@
+@@ -3804,7 +3804,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME TABLE_OPEN_CACHE
VARIABLE_SCOPE GLOBAL
@@ -1367,7 +1359,7 @@
VARIABLE_COMMENT The number of cached open tables
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 1048576
-@@ -3684,7 +3684,7 @@
+@@ -3864,7 +3864,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME THREAD_CACHE_SIZE
VARIABLE_SCOPE GLOBAL
@@ -1376,7 +1368,7 @@
VARIABLE_COMMENT How many threads we should keep in a cache for reuse. These are freed after 5 minutes of idle time
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16384
-@@ -3767,7 +3767,7 @@
+@@ -3937,7 +3937,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Max size for data for an internal temporary on-disk MyISAM or Aria table.
NUMERIC_MIN_VALUE 1024
@@ -1385,7 +1377,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3777,7 +3777,7 @@
+@@ -3947,7 +3947,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MariaDB will automatically convert it to an on-disk MyISAM or Aria table. Same as tmp_table_size.
NUMERIC_MIN_VALUE 0
@@ -1394,7 +1386,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3787,14 +3787,14 @@
+@@ -3957,14 +3957,14 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Alias for tmp_memory_table_size. If an internal in-memory temporary table exceeds this size, MariaDB will automatically convert it to an on-disk MyISAM or Aria table.
NUMERIC_MIN_VALUE 0
@@ -1411,8 +1403,8 @@
VARIABLE_COMMENT Allocation block size for transactions to be stored in binary log
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 134217728
-@@ -3804,7 +3804,7 @@
- COMMAND_LINE_ARGUMENT REQUIRED
+@@ -3984,7 +3984,7 @@
+ COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME TRANSACTION_PREALLOC_SIZE
VARIABLE_SCOPE SESSION
-VARIABLE_TYPE BIGINT UNSIGNED
@@ -1420,7 +1412,7 @@
VARIABLE_COMMENT Persistent buffer for transactions to be stored in binary log
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 134217728
-@@ -3944,7 +3944,7 @@
+@@ -4134,7 +4134,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME WAIT_TIMEOUT
VARIABLE_SCOPE SESSION
@@ -1429,7 +1421,7 @@
VARIABLE_COMMENT The number of seconds the server waits for activity on a connection before closing it
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
-@@ -3971,7 +3971,7 @@
+@@ -4161,7 +4161,7 @@
VARIABLE_NAME LOG_TC_SIZE
GLOBAL_VALUE_ORIGIN AUTO
VARIABLE_SCOPE GLOBAL
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
index b58d18fb..561d4a5e 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
@@ -432,6 +432,36 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST MIXED,STATEMENT,ROW
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BINLOG_GTID_INDEX
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable the creation of a GTID index for every binlog file, and the use of such index for speeding up GTID lookup in the binlog.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME BINLOG_GTID_INDEX_PAGE_SIZE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Page size to use for the binlog GTID index.
+NUMERIC_MIN_VALUE 64
+NUMERIC_MAX_VALUE 16777216
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BINLOG_GTID_INDEX_SPAN_MIN
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Control sparseness of the binlog GTID index. If set to N, at most one index record will be added for every N bytes of binlog file written, to reduce the size of the index. Normally does not need tuning.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 1073741824
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME BINLOG_OPTIMIZE_THREAD_SCHEDULING
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
@@ -445,11 +475,11 @@ COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME BINLOG_ROW_IMAGE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE ENUM
-VARIABLE_COMMENT Controls whether rows should be logged in 'FULL', 'NOBLOB' or 'MINIMAL' formats. 'FULL', means that all columns in the before and after image are logged. 'NOBLOB', means that mysqld avoids logging blob columns whenever possible (eg, blob column was not changed or is not part of primary key). 'MINIMAL', means that a PK equivalent (PK columns or full row if there is no PK in the table) is logged in the before image, and only changed columns are logged in the after image. (Default: FULL).
+VARIABLE_COMMENT Controls whether rows should be logged in 'FULL', 'FULL_NODUP', 'NOBLOB' or 'MINIMAL' formats. 'FULL', means that all columns in the before and after image are logged. 'FULL_NODUP', means that all columns are logged in before image, but only changed columns or all columns of inserted record are logged in after image, 'NOBLOB', means that mysqld avoids logging blob columns whenever possible (eg, blob column was not changed or is not part of primary key). 'MINIMAL', means that a PK equivalent (PK columns or full row if there is no PK in the table) is logged in the before image, and only changed columns are logged in the after image. (Default: FULL).
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST MINIMAL,NOBLOB,FULL
+ENUM_VALUE_LIST MINIMAL,NOBLOB,FULL,FULL_NODUP
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME BINLOG_ROW_METADATA
@@ -462,6 +492,16 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NO_LOG,MINIMAL,FULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BINLOG_SPACE_LIMIT
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Alias for max_binlog_total_size. Compatibility with Percona server.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME BINLOG_STMT_CACHE_SIZE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
@@ -472,6 +512,16 @@ NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BLOCK_ENCRYPTION_MODE
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Default block encryption mode for AES_ENCRYPT() and AES_DECRYPT() functions
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST aes-128-ecb,aes-192-ecb,aes-256-ecb,aes-128-cbc,aes-192-cbc,aes-256-cbc,aes-128-ctr,aes-192-ctr,aes-256-ctr
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME BULK_INSERT_BUFFER_SIZE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
@@ -502,6 +552,16 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME CHARACTER_SET_COLLATIONS
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Overrides for character set default collations
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME CHARACTER_SET_CONNECTION
VARIABLE_SCOPE SESSION
VARIABLE_TYPE ENUM
@@ -692,26 +752,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME DATETIME_FORMAT
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE VARCHAR
-VARIABLE_COMMENT The DATETIME format (ignored)
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST NULL
-READ_ONLY YES
-COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME DATE_FORMAT
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE VARCHAR
-VARIABLE_COMMENT The DATE format (ignored)
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST NULL
-READ_ONLY YES
-COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEADLOCK_SEARCH_DEPTH_LONG
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
@@ -1675,7 +1715,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME LOG_SLOW_ADMIN_STATEMENTS
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to the slow log if it is open. Resets or sets the option 'admin' in log_slow_disabled_statements
+VARIABLE_COMMENT Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to the slow log if it is open. Resets or sets the option 'admin' in log_slow_filter. Deprecated, use log_slow_filter without 'admin'.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
@@ -1872,6 +1912,16 @@ NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_BINLOG_TOTAL_SIZE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum space to use for all binary logs. Extra logs are deleted on server start, log rotation, FLUSH LOGS or when writing to binlog. Default is 0, which means no size restrictions. See also slave_connections_needed_for_purge
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_CONNECTIONS
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
@@ -2052,16 +2102,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME MAX_TMP_TABLES
-VARIABLE_SCOPE SESSION
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Unused, will be removed.
-NUMERIC_MIN_VALUE 1
-NUMERIC_MAX_VALUE 4294967295
-NUMERIC_BLOCK_SIZE 1
-ENUM_VALUE_LIST NULL
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_USER_CONNECTIONS
VARIABLE_SCOPE SESSION
VARIABLE_TYPE INT
@@ -2282,16 +2322,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
-VARIABLE_NAME OLD_ALTER_TABLE
-VARIABLE_SCOPE SESSION
-VARIABLE_TYPE ENUM
-VARIABLE_COMMENT Alias for alter_algorithm. Deprecated. Use --alter-algorithm instead.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST DEFAULT,COPY,INPLACE,NOCOPY,INSTANT
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME OLD_MODE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE SET
@@ -2299,7 +2329,7 @@ VARIABLE_COMMENT Used to emulate old behavior from earlier MariaDB or MySQL vers
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST NO_DUP_KEY_WARNINGS_WITH_IGNORE,NO_PROGRESS_INFO,ZERO_DATE_TIME_CAST,UTF8_IS_UTF8MB3,IGNORE_INDEX_ONLY_FOR_JOIN,COMPAT_5_1_CHECKSUM,NO_NULL_COLLATION_IDS
+ENUM_VALUE_LIST NO_DUP_KEY_WARNINGS_WITH_IGNORE,NO_PROGRESS_INFO,ZERO_DATE_TIME_CAST,UTF8_IS_UTF8MB3,IGNORE_INDEX_ONLY_FOR_JOIN,COMPAT_5_1_CHECKSUM,NO_NULL_COLLATION_IDS,LOCK_ALTER_TABLE_COPY
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OLD_PASSWORDS
@@ -2324,12 +2354,32 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_ADJUST_SECONDARY_KEY_COSTS
VARIABLE_SCOPE SESSION
-VARIABLE_TYPE SET
-VARIABLE_COMMENT A bit field with the following values: adjust_secondary_key_cost = Update secondary key costs for ranges to be at least 5x of clustered primary key costs. disable_max_seek = Disable 'max_seek optimization' for secondary keys and slight adjustment of filter cost. disable_forced_index_in_group_by = Disable automatic forced index in GROUP BY. This variable will be deleted in MariaDB 11.0 as it is not needed with the new 11.0 optimizer.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Unused, will be removed.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 2
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_DISK_READ_COST
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost of reading a block of IO_SIZE (4096) from a disk (in usec).
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 10000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_DISK_READ_RATIO
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Chance that we have to do a disk read to find a row or index entry from the engine cache (cache_misses/total_cache_requests). 0.0 means that everything is cached and 1.0 means that nothing is expected to be in the engine cache.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1
NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST adjust_secondary_key_cost,disable_max_seek,disable_forced_index_in_group_by
+ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_EXTRA_PRUNING_DEPTH
@@ -2342,6 +2392,56 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_INDEX_BLOCK_COPY_COST
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost of copying a key block from the cache to intern storage as part of an index scan.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_KEY_COMPARE_COST
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost of checking a key against the end key condition.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_KEY_COPY_COST
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost of finding the next key in the engine and copying it to the SQL layer.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_KEY_LOOKUP_COST
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost for finding a key based on a key value
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_KEY_NEXT_FIND_COST
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost of finding the next key and rowid when using filters.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_MAX_SEL_ARGS
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
@@ -2372,6 +2472,66 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_ROWID_COMPARE_COST
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost of comparing two rowid's
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_ROWID_COPY_COST
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost of copying a rowid
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_ROW_COPY_COST
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost of copying a row from the engine or the join cache to the SQL layer.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_ROW_LOOKUP_COST
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost of finding a row based on a rowid or a clustered key.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_ROW_NEXT_FIND_COST
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost of finding the next row when scanning the table.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_SCAN_SETUP_COST
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Extra cost added to TABLE and INDEX scans to get optimizer to prefer index lookups.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 100000000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_SEARCH_DEPTH
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
@@ -2399,7 +2559,7 @@ VARIABLE_COMMENT Fine-tune the optimizer behavior
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,condition_pushdown_for_derived,split_materialized,condition_pushdown_for_subquery,rowid_filter,condition_pushdown_from_having,not_null_range_scan,hash_join_cardinality,cset_narrowing,default
+ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,condition_pushdown_for_derived,split_materialized,condition_pushdown_for_subquery,rowid_filter,condition_pushdown_from_having,not_null_range_scan,hash_join_cardinality,cset_narrowing,sargable_casefold,default
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_TRACE
@@ -2432,6 +2592,16 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_WHERE_COST
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost of checking the row against the WHERE clause. Increasing this will have the optimizer to prefer plans with less row combinations.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 100000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
@@ -3252,6 +3422,16 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME SLAVE_CONNECTIONS_NEEDED_FOR_PURGE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Minimum number of connected slaves required for automatic binary log purge with max_binlog_total_size, binlog_expire_logs_seconds or binlog_expire_logs_days.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SLAVE_MAX_ALLOWED_PACKET
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
@@ -3722,16 +3902,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT NULL
-VARIABLE_NAME TIME_FORMAT
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE VARCHAR
-VARIABLE_COMMENT The TIME format (ignored)
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST NULL
-READ_ONLY YES
-COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME TIME_ZONE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE VARCHAR
@@ -3802,6 +3972,16 @@ NUMERIC_BLOCK_SIZE 1024
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME TRANSACTION_ISOLATION
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Default transaction isolation level
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST READ-UNCOMMITTED,READ-COMMITTED,REPEATABLE-READ,SERIALIZABLE
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME TRANSACTION_PREALLOC_SIZE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
@@ -3812,10 +3992,20 @@ NUMERIC_BLOCK_SIZE 1024
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME TRANSACTION_READ_ONLY
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Default transaction access mode. If set to OFF, the default, access is read/write. If set to ON, access is read-only. The SET TRANSACTION statement can also change the value of this variable. See SET TRANSACTION and START TRANSACTION.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME TX_ISOLATION
VARIABLE_SCOPE SESSION
VARIABLE_TYPE ENUM
-VARIABLE_COMMENT Default transaction isolation level
+VARIABLE_COMMENT Default transaction isolation level.This variable is deprecated and will be removed in a future release.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
@@ -3825,7 +4015,7 @@ COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME TX_READ_ONLY
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Default transaction access mode. If set to OFF, the default, access is read/write. If set to ON, access is read-only. The SET TRANSACTION statement can also change the value of this variable. See SET TRANSACTION and START TRANSACTION.
+VARIABLE_COMMENT Default transaction access mode. If set to OFF, the default, access is read/write. If set to ON, access is read-only. The SET TRANSACTION statement can also change the value of this variable. See SET TRANSACTION and START TRANSACTION.This variable is deprecated and will be removed in a future release.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff
index a3f9acf3..31978fd0 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff
@@ -1,5 +1,5 @@
---- sysvars_server_notembedded.result 2024-01-28 17:50:35.442241137 +0100
-+++ sysvars_server_notembedded,32bit.result 2024-01-28 17:51:20.662078993 +0100
+--- sysvars_server_notembedded.result 2024-02-15 09:34:10.109925277 +0100
++++ sysvars_server_notembedded,32bit.result 2024-02-15 10:35:52.037016777 +0100
@@ -44,7 +44,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME ARIA_BLOCK_SIZE
@@ -164,8 +164,8 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -414,7 +414,7 @@
- COMMAND_LINE_ARGUMENT OPTIONAL
+@@ -424,7 +424,7 @@
+ COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME BINLOG_EXPIRE_LOGS_SECONDS
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
@@ -173,7 +173,7 @@
VARIABLE_COMMENT If non-zero, binary logs will be purged after binlog_expire_logs_seconds seconds; It and expire_logs_days are linked, such that changes in one are converted into the other. Possible purges happen at startup and at binary log rotation.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 8553600
-@@ -427,7 +427,7 @@
+@@ -437,7 +437,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The size of file cache for the binary log
NUMERIC_MIN_VALUE 8192
@@ -182,7 +182,16 @@
NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -477,7 +477,7 @@
+@@ -514,7 +514,7 @@
+ COMMAND_LINE_ARGUMENT REQUIRED
+ VARIABLE_NAME BINLOG_ROW_EVENT_MAX_SIZE
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT The maximum size of a row-based binary log event in bytes. Rows will be grouped into events smaller than this size if possible. The value has to be a multiple of 256.
+ NUMERIC_MIN_VALUE 256
+ NUMERIC_MAX_VALUE 4294967040
+@@ -557,7 +557,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The size of the statement cache for updates to non-transactional engines for the binary log. If you often use statements updating a great number of rows, you can increase this to get more performance.
NUMERIC_MIN_VALUE 4096
@@ -191,7 +200,7 @@
NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -487,7 +487,7 @@
+@@ -577,7 +577,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Size of tree cache used in bulk insert optimisation. Note that this is a limit per thread!
NUMERIC_MIN_VALUE 0
@@ -200,7 +209,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -674,7 +674,7 @@
+@@ -774,7 +774,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME CONNECT_TIMEOUT
VARIABLE_SCOPE GLOBAL
@@ -209,7 +218,7 @@
VARIABLE_COMMENT The number of seconds the mysqld server is waiting for a connect packet before responding with 'Bad handshake'
NUMERIC_MIN_VALUE 2
NUMERIC_MAX_VALUE 31536000
-@@ -724,7 +724,7 @@
+@@ -804,7 +804,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEADLOCK_SEARCH_DEPTH_LONG
VARIABLE_SCOPE SESSION
@@ -218,7 +227,7 @@
VARIABLE_COMMENT Long search depth for the two-step deadlock detection
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 33
-@@ -734,7 +734,7 @@
+@@ -814,7 +814,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEADLOCK_SEARCH_DEPTH_SHORT
VARIABLE_SCOPE SESSION
@@ -227,7 +236,7 @@
VARIABLE_COMMENT Short search depth for the two-step deadlock detection
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 32
-@@ -744,7 +744,7 @@
+@@ -824,7 +824,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEADLOCK_TIMEOUT_LONG
VARIABLE_SCOPE SESSION
@@ -236,7 +245,7 @@
VARIABLE_COMMENT Long timeout for the two-step deadlock detection (in microseconds)
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -754,7 +754,7 @@
+@@ -834,7 +834,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEADLOCK_TIMEOUT_SHORT
VARIABLE_SCOPE SESSION
@@ -245,7 +254,7 @@
VARIABLE_COMMENT Short timeout for the two-step deadlock detection (in microseconds)
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -814,7 +814,7 @@
+@@ -894,7 +894,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME DEFAULT_WEEK_FORMAT
VARIABLE_SCOPE SESSION
@@ -254,7 +263,7 @@
VARIABLE_COMMENT The default week format used by WEEK() functions
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 7
-@@ -824,7 +824,7 @@
+@@ -904,7 +904,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DELAYED_INSERT_LIMIT
VARIABLE_SCOPE GLOBAL
@@ -263,7 +272,7 @@
VARIABLE_COMMENT After inserting delayed_insert_limit rows, the INSERT DELAYED handler will check if there are any SELECT statements pending. If so, it allows these to execute before continuing.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -834,7 +834,7 @@
+@@ -914,7 +914,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DELAYED_INSERT_TIMEOUT
VARIABLE_SCOPE GLOBAL
@@ -272,7 +281,7 @@
VARIABLE_COMMENT How long a INSERT DELAYED thread should wait for INSERT statements before terminating
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
-@@ -844,7 +844,7 @@
+@@ -924,7 +924,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DELAYED_QUEUE_SIZE
VARIABLE_SCOPE GLOBAL
@@ -281,7 +290,7 @@
VARIABLE_COMMENT What size queue (in rows) should be allocated for handling INSERT DELAYED. If the queue becomes full, any client that does INSERT DELAYED will wait until there is room in the queue again
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -874,7 +874,7 @@
+@@ -954,7 +954,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME DIV_PRECISION_INCREMENT
VARIABLE_SCOPE SESSION
@@ -290,7 +299,7 @@
VARIABLE_COMMENT Precision of the result of '/' operator will be increased on that value
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 38
-@@ -994,7 +994,7 @@
+@@ -1074,7 +1074,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME EXTRA_MAX_CONNECTIONS
VARIABLE_SCOPE GLOBAL
@@ -299,7 +308,7 @@
VARIABLE_COMMENT The number of connections on extra-port
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 100000
-@@ -1024,7 +1024,7 @@
+@@ -1104,7 +1104,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME FLUSH_TIME
VARIABLE_SCOPE GLOBAL
@@ -308,7 +317,7 @@
VARIABLE_COMMENT A dedicated thread is created to flush all tables at the given interval
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 31536000
-@@ -1054,7 +1054,7 @@
+@@ -1134,7 +1134,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME FT_MAX_WORD_LEN
VARIABLE_SCOPE GLOBAL
@@ -317,7 +326,7 @@
VARIABLE_COMMENT The maximum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 84
-@@ -1064,7 +1064,7 @@
+@@ -1144,7 +1144,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME FT_MIN_WORD_LEN
VARIABLE_SCOPE GLOBAL
@@ -326,7 +335,7 @@
VARIABLE_COMMENT The minimum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 84
-@@ -1074,7 +1074,7 @@
+@@ -1154,7 +1154,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME FT_QUERY_EXPANSION_LIMIT
VARIABLE_SCOPE GLOBAL
@@ -335,7 +344,7 @@
VARIABLE_COMMENT Number of best matches to use for query expansion
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1000
-@@ -1324,7 +1324,7 @@
+@@ -1404,7 +1404,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME HISTOGRAM_SIZE
VARIABLE_SCOPE SESSION
@@ -344,7 +353,7 @@
VARIABLE_COMMENT Number of bytes used for a histogram. If set to 0, no histograms are created by ANALYZE.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 255
-@@ -1354,7 +1354,7 @@
+@@ -1434,7 +1434,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME HOST_CACHE_SIZE
VARIABLE_SCOPE GLOBAL
@@ -353,7 +362,7 @@
VARIABLE_COMMENT How many host names should be cached to avoid resolving.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 65536
-@@ -1464,7 +1464,7 @@
+@@ -1544,7 +1544,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME INTERACTIVE_TIMEOUT
VARIABLE_SCOPE SESSION
@@ -362,7 +371,7 @@
VARIABLE_COMMENT The number of seconds the server waits for activity on an interactive connection before closing it
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
-@@ -1497,7 +1497,7 @@
+@@ -1577,7 +1577,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The size of the buffer that is used for joins
NUMERIC_MIN_VALUE 128
@@ -371,7 +380,7 @@
NUMERIC_BLOCK_SIZE 128
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1514,7 +1514,7 @@
+@@ -1594,7 +1594,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME JOIN_CACHE_LEVEL
VARIABLE_SCOPE SESSION
@@ -380,7 +389,7 @@
VARIABLE_COMMENT Controls what join operations can be executed with join buffers. Odd numbers are used for plain join buffers while even numbers are used for linked buffers
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 8
-@@ -1537,7 +1537,7 @@
+@@ -1617,7 +1617,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The size of the buffer used for index blocks for MyISAM tables. Increase this to get better index handling (for all reads and multiple writes) to as much as you can afford
NUMERIC_MIN_VALUE 0
@@ -389,7 +398,7 @@
NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -1704,7 +1704,7 @@
+@@ -1784,7 +1784,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME LOCK_WAIT_TIMEOUT
VARIABLE_SCOPE SESSION
@@ -398,7 +407,7 @@
VARIABLE_COMMENT Timeout in seconds to wait for a lock before returning an error.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 31536000
-@@ -1854,7 +1854,7 @@
+@@ -1934,7 +1934,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_SLOW_MAX_WARNINGS
VARIABLE_SCOPE SESSION
@@ -407,7 +416,7 @@
VARIABLE_COMMENT Max numbers of warnings printed to slow query log per statement
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1000
-@@ -1864,7 +1864,7 @@
+@@ -1944,7 +1944,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_SLOW_MIN_EXAMINED_ROW_LIMIT
VARIABLE_SCOPE SESSION
@@ -416,7 +425,7 @@
VARIABLE_COMMENT Don't write queries to slow log that examine fewer rows than that
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -1904,7 +1904,7 @@
+@@ -1984,7 +1984,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_SLOW_RATE_LIMIT
VARIABLE_SCOPE SESSION
@@ -425,7 +434,7 @@
VARIABLE_COMMENT Write to slow log every #th slow query. Set to 1 to log everything. Increase it to reduce the size of the slow or the performance impact of slow logging
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -1934,7 +1934,7 @@
+@@ -2014,7 +2014,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME LOG_WARNINGS
VARIABLE_SCOPE SESSION
@@ -434,7 +443,7 @@
VARIABLE_COMMENT Log some non critical warnings to the error log.Value can be between 0 and 11. Higher values mean more verbosity
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -1994,7 +1994,7 @@
+@@ -2074,7 +2074,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME MAX_ALLOWED_PACKET
VARIABLE_SCOPE SESSION
@@ -443,7 +452,7 @@
VARIABLE_COMMENT Max packet length to send to or receive from the server
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1073741824
-@@ -2007,14 +2007,14 @@
+@@ -2087,14 +2087,14 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the total size of the transactional cache
NUMERIC_MIN_VALUE 4096
@@ -460,7 +469,7 @@
VARIABLE_COMMENT Binary log will be rotated automatically when the size exceeds this value.
NUMERIC_MIN_VALUE 4096
NUMERIC_MAX_VALUE 1073741824
-@@ -2027,14 +2027,14 @@
+@@ -2107,7 +2107,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the total size of the statement cache
NUMERIC_MIN_VALUE 4096
@@ -469,6 +478,7 @@
NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
+@@ -2124,7 +2124,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_CONNECTIONS
VARIABLE_SCOPE GLOBAL
@@ -477,7 +487,7 @@
VARIABLE_COMMENT The number of simultaneous clients allowed
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 100000
-@@ -2044,7 +2044,7 @@
+@@ -2134,7 +2134,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_CONNECT_ERRORS
VARIABLE_SCOPE GLOBAL
@@ -486,7 +496,7 @@
VARIABLE_COMMENT If there is more than this number of interrupted connections from a host this host will be blocked from further connections
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -2054,7 +2054,7 @@
+@@ -2144,7 +2144,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_DELAYED_THREADS
VARIABLE_SCOPE SESSION
@@ -495,7 +505,7 @@
VARIABLE_COMMENT Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16384
-@@ -2074,7 +2074,7 @@
+@@ -2164,7 +2164,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_ERROR_COUNT
VARIABLE_SCOPE SESSION
@@ -504,7 +514,7 @@
VARIABLE_COMMENT Max number of errors/warnings to store for a statement
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 65535
-@@ -2087,14 +2087,14 @@
+@@ -2177,14 +2177,14 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Don't allow creation of heap tables bigger than this
NUMERIC_MIN_VALUE 16384
@@ -521,7 +531,7 @@
VARIABLE_COMMENT Alias for max_delayed_threads. Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero INSERT DELAYED will be not used
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16384
-@@ -2114,7 +2114,7 @@
+@@ -2204,7 +2204,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_LENGTH_FOR_SORT_DATA
VARIABLE_SCOPE SESSION
@@ -530,7 +540,7 @@
VARIABLE_COMMENT Max number of bytes in sorted records
NUMERIC_MIN_VALUE 4
NUMERIC_MAX_VALUE 8388608
-@@ -2144,7 +2144,7 @@
+@@ -2234,7 +2234,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_RECURSIVE_ITERATIONS
VARIABLE_SCOPE SESSION
@@ -539,7 +549,7 @@
VARIABLE_COMMENT Maximum number of iterations when executing recursive queries
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -2167,14 +2167,14 @@
+@@ -2257,14 +2257,14 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The maximum size of the container of a rowid filter
NUMERIC_MIN_VALUE 1024
@@ -556,7 +566,7 @@
VARIABLE_COMMENT Limit assumed max number of seeks when looking up rows based on a key
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -2194,7 +2194,7 @@
+@@ -2284,7 +2284,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_SORT_LENGTH
VARIABLE_SCOPE SESSION
@@ -565,7 +575,7 @@
VARIABLE_COMMENT The number of bytes to use when sorting BLOB or TEXT values (only the first max_sort_length bytes of each value are used; the rest are ignored)
NUMERIC_MIN_VALUE 64
NUMERIC_MAX_VALUE 8388608
-@@ -2204,7 +2204,7 @@
+@@ -2294,7 +2294,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_SP_RECURSION_DEPTH
VARIABLE_SCOPE SESSION
@@ -574,16 +584,7 @@
VARIABLE_COMMENT Maximum stored procedure recursion depth
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 255
-@@ -2224,7 +2224,7 @@
- COMMAND_LINE_ARGUMENT REQUIRED
- VARIABLE_NAME MAX_TMP_TABLES
- VARIABLE_SCOPE SESSION
--VARIABLE_TYPE BIGINT UNSIGNED
-+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT Unused, will be removed.
- NUMERIC_MIN_VALUE 1
- NUMERIC_MAX_VALUE 4294967295
-@@ -2244,7 +2244,7 @@
+@@ -2324,7 +2324,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_WRITE_LOCK_COUNT
VARIABLE_SCOPE GLOBAL
@@ -592,7 +593,7 @@
VARIABLE_COMMENT After this many write locks, allow some read locks to run in between
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -2254,7 +2254,7 @@
+@@ -2334,7 +2334,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME METADATA_LOCKS_CACHE_SIZE
VARIABLE_SCOPE GLOBAL
@@ -601,7 +602,7 @@
VARIABLE_COMMENT Unused
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1048576
-@@ -2264,7 +2264,7 @@
+@@ -2344,7 +2344,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME METADATA_LOCKS_HASH_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -610,7 +611,7 @@
VARIABLE_COMMENT Unused
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 1024
-@@ -2274,7 +2274,7 @@
+@@ -2354,7 +2354,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MIN_EXAMINED_ROW_LIMIT
VARIABLE_SCOPE SESSION
@@ -619,7 +620,7 @@
VARIABLE_COMMENT Alias for log_slow_min_examined_row_limit. Don't write queries to slow log that examine fewer rows than that
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -2284,7 +2284,7 @@
+@@ -2364,7 +2364,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MRR_BUFFER_SIZE
VARIABLE_SCOPE SESSION
@@ -628,7 +629,7 @@
VARIABLE_COMMENT Size of buffer to use when using MRR with range access
NUMERIC_MIN_VALUE 8192
NUMERIC_MAX_VALUE 2147483647
-@@ -2294,7 +2294,7 @@
+@@ -2374,7 +2374,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MYISAM_BLOCK_SIZE
VARIABLE_SCOPE GLOBAL
@@ -637,7 +638,7 @@
VARIABLE_COMMENT Block size to be used for MyISAM index pages
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 16384
-@@ -2304,7 +2304,7 @@
+@@ -2384,7 +2384,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MYISAM_DATA_POINTER_SIZE
VARIABLE_SCOPE GLOBAL
@@ -646,7 +647,7 @@
VARIABLE_COMMENT Default pointer size to be used for MyISAM tables
NUMERIC_MIN_VALUE 2
NUMERIC_MAX_VALUE 7
-@@ -2327,7 +2327,7 @@
+@@ -2407,7 +2407,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Restricts the total memory used for memory mapping of MySQL tables
NUMERIC_MIN_VALUE 7
@@ -655,7 +656,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY YES
-@@ -2344,10 +2344,10 @@
+@@ -2424,10 +2424,10 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME MYISAM_REPAIR_THREADS
VARIABLE_SCOPE SESSION
@@ -668,7 +669,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -2357,7 +2357,7 @@
+@@ -2437,7 +2437,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE
NUMERIC_MIN_VALUE 4096
@@ -677,7 +678,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -2394,7 +2394,7 @@
+@@ -2474,7 +2474,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME NET_BUFFER_LENGTH
VARIABLE_SCOPE SESSION
@@ -686,7 +687,7 @@
VARIABLE_COMMENT Buffer length for TCP/IP and socket communication
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1048576
-@@ -2404,7 +2404,7 @@
+@@ -2484,7 +2484,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME NET_READ_TIMEOUT
VARIABLE_SCOPE SESSION
@@ -695,7 +696,7 @@
VARIABLE_COMMENT Number of seconds to wait for more data from a connection before aborting the read
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
-@@ -2414,7 +2414,7 @@
+@@ -2494,7 +2494,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME NET_RETRY_COUNT
VARIABLE_SCOPE SESSION
@@ -704,7 +705,7 @@
VARIABLE_COMMENT If a read on a communication port is interrupted, retry this many times before giving up
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -2424,7 +2424,7 @@
+@@ -2504,7 +2504,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME NET_WRITE_TIMEOUT
VARIABLE_SCOPE SESSION
@@ -713,7 +714,7 @@
VARIABLE_COMMENT Number of seconds to wait for a block to be written to a connection before aborting the write
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
-@@ -2484,7 +2484,7 @@
+@@ -2554,7 +2554,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME OPEN_FILES_LIMIT
VARIABLE_SCOPE GLOBAL
@@ -722,16 +723,16 @@
VARIABLE_COMMENT If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 or autoset then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of file descriptors
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -2494,7 +2494,7 @@
+@@ -2564,7 +2564,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_ADJUST_SECONDARY_KEY_COSTS
VARIABLE_SCOPE SESSION
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
- VARIABLE_COMMENT 0 = No changes. 1 = Update secondary key costs for ranges to be at least 5x of clustered primary key costs. 2 = Remove 'max_seek optimization' for secondary keys and slight adjustment of filter cost. This option will be deleted in MariaDB 11.0 as it is not needed with the new 11.0 optimizer.
+ VARIABLE_COMMENT Unused, will be removed.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 2
-@@ -2504,7 +2504,7 @@
+@@ -2594,7 +2594,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_EXTRA_PRUNING_DEPTH
VARIABLE_SCOPE SESSION
@@ -740,7 +741,7 @@
VARIABLE_COMMENT If the optimizer needs to enumerate join prefix of this size or larger, then it will try aggressively prune away the search space.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 62
-@@ -2514,7 +2514,7 @@
+@@ -2654,7 +2654,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_MAX_SEL_ARGS
VARIABLE_SCOPE SESSION
@@ -749,7 +750,7 @@
VARIABLE_COMMENT The maximum number of SEL_ARG objects created when optimizing a range. If more objects would be needed, the range will not be used by the optimizer.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -2524,7 +2524,7 @@
+@@ -2664,7 +2664,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_MAX_SEL_ARG_WEIGHT
VARIABLE_SCOPE SESSION
@@ -758,7 +759,7 @@
VARIABLE_COMMENT The maximum weight of the SEL_ARG graph. Set to 0 for no limit
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -2534,7 +2534,7 @@
+@@ -2674,7 +2674,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_PRUNE_LEVEL
VARIABLE_SCOPE SESSION
@@ -767,7 +768,7 @@
VARIABLE_COMMENT Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search: 1 - prune plans based on cost and number of retrieved rows eq_ref: 2 - prune also if we find an eq_ref chain
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 2
-@@ -2544,7 +2544,7 @@
+@@ -2744,7 +2744,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_SEARCH_DEPTH
VARIABLE_SCOPE SESSION
@@ -776,7 +777,7 @@
VARIABLE_COMMENT Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Values smaller than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 62
-@@ -2554,7 +2554,7 @@
+@@ -2754,7 +2754,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_SELECTIVITY_SAMPLING_LIMIT
VARIABLE_SCOPE SESSION
@@ -785,7 +786,7 @@
VARIABLE_COMMENT Controls number of record samples to check condition selectivity
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 4294967295
-@@ -2584,17 +2584,17 @@
+@@ -2784,17 +2784,17 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_TRACE_MAX_MEM_SIZE
VARIABLE_SCOPE SESSION
@@ -806,7 +807,7 @@
VARIABLE_COMMENT Controls selectivity of which conditions the optimizer takes into account to calculate cardinality of a partial join when it searches for the best execution plan Meaning: 1 - use selectivity of index backed range conditions to calculate the cardinality of a partial join if the last joined table is accessed by full table scan or an index scan, 2 - use selectivity of index backed range conditions to calculate the cardinality of a partial join in any case, 3 - additionally always use selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join, 4 - use histograms to calculate selectivity of range conditions that are not backed by any index to calculate the cardinality of a partial join.5 - additionally use selectivity of certain non-range predicates calculated on record samples
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 5
-@@ -2614,7 +2614,7 @@
+@@ -2824,7 +2824,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME PERFORMANCE_SCHEMA_ACCOUNTS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -815,7 +816,7 @@
VARIABLE_COMMENT Maximum number of instrumented user@host accounts. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2624,7 +2624,7 @@
+@@ -2834,7 +2834,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_DIGESTS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -824,7 +825,7 @@
VARIABLE_COMMENT Size of the statement digest. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2634,7 +2634,7 @@
+@@ -2844,7 +2844,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STAGES_HISTORY_LONG_SIZE
VARIABLE_SCOPE GLOBAL
@@ -833,7 +834,7 @@
VARIABLE_COMMENT Number of rows in EVENTS_STAGES_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2644,7 +2644,7 @@
+@@ -2854,7 +2854,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STAGES_HISTORY_SIZE
VARIABLE_SCOPE GLOBAL
@@ -842,7 +843,7 @@
VARIABLE_COMMENT Number of rows per thread in EVENTS_STAGES_HISTORY. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1024
-@@ -2654,7 +2654,7 @@
+@@ -2864,7 +2864,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STATEMENTS_HISTORY_LONG_SIZE
VARIABLE_SCOPE GLOBAL
@@ -851,7 +852,7 @@
VARIABLE_COMMENT Number of rows in EVENTS_STATEMENTS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2664,7 +2664,7 @@
+@@ -2874,7 +2874,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_STATEMENTS_HISTORY_SIZE
VARIABLE_SCOPE GLOBAL
@@ -860,7 +861,7 @@
VARIABLE_COMMENT Number of rows per thread in EVENTS_STATEMENTS_HISTORY. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1024
-@@ -2674,7 +2674,7 @@
+@@ -2884,7 +2884,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_TRANSACTIONS_HISTORY_LONG_SIZE
VARIABLE_SCOPE GLOBAL
@@ -869,7 +870,7 @@
VARIABLE_COMMENT Number of rows in EVENTS_TRANSACTIONS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2684,7 +2684,7 @@
+@@ -2894,7 +2894,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_TRANSACTIONS_HISTORY_SIZE
VARIABLE_SCOPE GLOBAL
@@ -878,7 +879,7 @@
VARIABLE_COMMENT Number of rows per thread in EVENTS_TRANSACTIONS_HISTORY. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1024
-@@ -2694,7 +2694,7 @@
+@@ -2904,7 +2904,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_LONG_SIZE
VARIABLE_SCOPE GLOBAL
@@ -887,7 +888,7 @@
VARIABLE_COMMENT Number of rows in EVENTS_WAITS_HISTORY_LONG. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2704,7 +2704,7 @@
+@@ -2914,7 +2914,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_SIZE
VARIABLE_SCOPE GLOBAL
@@ -896,7 +897,7 @@
VARIABLE_COMMENT Number of rows per thread in EVENTS_WAITS_HISTORY. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1024
-@@ -2714,7 +2714,7 @@
+@@ -2924,7 +2924,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_HOSTS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -905,7 +906,7 @@
VARIABLE_COMMENT Maximum number of instrumented hosts. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2724,7 +2724,7 @@
+@@ -2934,7 +2934,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_COND_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -914,7 +915,7 @@
VARIABLE_COMMENT Maximum number of condition instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2734,7 +2734,7 @@
+@@ -2944,7 +2944,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_COND_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -923,7 +924,7 @@
VARIABLE_COMMENT Maximum number of instrumented condition objects. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2744,7 +2744,7 @@
+@@ -2954,7 +2954,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_DIGEST_LENGTH
VARIABLE_SCOPE GLOBAL
@@ -932,7 +933,7 @@
VARIABLE_COMMENT Maximum length considered for digest text, when stored in performance_schema tables.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
-@@ -2754,7 +2754,7 @@
+@@ -2964,7 +2964,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -941,7 +942,7 @@
VARIABLE_COMMENT Maximum number of file instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2764,7 +2764,7 @@
+@@ -2974,7 +2974,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_HANDLES
VARIABLE_SCOPE GLOBAL
@@ -950,7 +951,7 @@
VARIABLE_COMMENT Maximum number of opened instrumented files.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
-@@ -2774,7 +2774,7 @@
+@@ -2984,7 +2984,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_FILE_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -959,7 +960,7 @@
VARIABLE_COMMENT Maximum number of instrumented files. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2784,7 +2784,7 @@
+@@ -2994,7 +2994,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_INDEX_STAT
VARIABLE_SCOPE GLOBAL
@@ -968,7 +969,7 @@
VARIABLE_COMMENT Maximum number of index statistics for instrumented tables. Use 0 to disable, -1 for automated scaling.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2794,7 +2794,7 @@
+@@ -3004,7 +3004,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_MEMORY_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -977,7 +978,7 @@
VARIABLE_COMMENT Maximum number of memory pool instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1024
-@@ -2804,7 +2804,7 @@
+@@ -3014,7 +3014,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_METADATA_LOCKS
VARIABLE_SCOPE GLOBAL
@@ -986,7 +987,7 @@
VARIABLE_COMMENT Maximum number of metadata locks. Use 0 to disable, -1 for automated scaling.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 104857600
-@@ -2814,7 +2814,7 @@
+@@ -3024,7 +3024,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_MUTEX_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -995,7 +996,7 @@
VARIABLE_COMMENT Maximum number of mutex instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2824,7 +2824,7 @@
+@@ -3034,7 +3034,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_MUTEX_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -1004,7 +1005,7 @@
VARIABLE_COMMENT Maximum number of instrumented MUTEX objects. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 104857600
-@@ -2834,7 +2834,7 @@
+@@ -3044,7 +3044,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_PREPARED_STATEMENTS_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -1013,7 +1014,7 @@
VARIABLE_COMMENT Maximum number of instrumented prepared statements. Use 0 to disable, -1 for automated scaling.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2844,7 +2844,7 @@
+@@ -3054,7 +3054,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_PROGRAM_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -1022,7 +1023,7 @@
VARIABLE_COMMENT Maximum number of instrumented programs. Use 0 to disable, -1 for automated scaling.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2854,7 +2854,7 @@
+@@ -3064,7 +3064,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_RWLOCK_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -1031,7 +1032,7 @@
VARIABLE_COMMENT Maximum number of rwlock instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2864,7 +2864,7 @@
+@@ -3074,7 +3074,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_RWLOCK_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -1040,7 +1041,7 @@
VARIABLE_COMMENT Maximum number of instrumented RWLOCK objects. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 104857600
-@@ -2874,7 +2874,7 @@
+@@ -3084,7 +3084,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_SOCKET_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -1049,7 +1050,7 @@
VARIABLE_COMMENT Maximum number of socket instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2884,7 +2884,7 @@
+@@ -3094,7 +3094,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_SOCKET_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -1058,7 +1059,7 @@
VARIABLE_COMMENT Maximum number of opened instrumented sockets. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2894,7 +2894,7 @@
+@@ -3104,7 +3104,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_SQL_TEXT_LENGTH
VARIABLE_SCOPE GLOBAL
@@ -1067,7 +1068,7 @@
VARIABLE_COMMENT Maximum length of displayed sql text.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
-@@ -2904,7 +2904,7 @@
+@@ -3114,7 +3114,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STAGE_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -1076,7 +1077,7 @@
VARIABLE_COMMENT Maximum number of stage instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2914,7 +2914,7 @@
+@@ -3124,7 +3124,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STATEMENT_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -1085,7 +1086,7 @@
VARIABLE_COMMENT Maximum number of statement instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2924,7 +2924,7 @@
+@@ -3134,7 +3134,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_STATEMENT_STACK
VARIABLE_SCOPE GLOBAL
@@ -1094,7 +1095,7 @@
VARIABLE_COMMENT Number of rows per thread in EVENTS_STATEMENTS_CURRENT.
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 256
-@@ -2934,7 +2934,7 @@
+@@ -3144,7 +3144,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_TABLE_HANDLES
VARIABLE_SCOPE GLOBAL
@@ -1103,7 +1104,7 @@
VARIABLE_COMMENT Maximum number of opened instrumented tables. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2944,7 +2944,7 @@
+@@ -3154,7 +3154,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_TABLE_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -1112,7 +1113,7 @@
VARIABLE_COMMENT Maximum number of instrumented tables. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2954,7 +2954,7 @@
+@@ -3164,7 +3164,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_TABLE_LOCK_STAT
VARIABLE_SCOPE GLOBAL
@@ -1121,7 +1122,7 @@
VARIABLE_COMMENT Maximum number of lock statistics for instrumented tables. Use 0 to disable, -1 for automated scaling.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2964,7 +2964,7 @@
+@@ -3174,7 +3174,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_THREAD_CLASSES
VARIABLE_SCOPE GLOBAL
@@ -1130,7 +1131,7 @@
VARIABLE_COMMENT Maximum number of thread instruments.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 256
-@@ -2974,7 +2974,7 @@
+@@ -3184,7 +3184,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_MAX_THREAD_INSTANCES
VARIABLE_SCOPE GLOBAL
@@ -1139,7 +1140,7 @@
VARIABLE_COMMENT Maximum number of instrumented threads. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2984,7 +2984,7 @@
+@@ -3194,7 +3194,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_SESSION_CONNECT_ATTRS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -1148,7 +1149,7 @@
VARIABLE_COMMENT Size of session attribute string buffer per thread. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -2994,7 +2994,7 @@
+@@ -3204,7 +3204,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_SETUP_ACTORS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -1157,7 +1158,7 @@
VARIABLE_COMMENT Maximum number of rows in SETUP_ACTORS.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1024
-@@ -3004,7 +3004,7 @@
+@@ -3214,7 +3214,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_SETUP_OBJECTS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -1166,7 +1167,7 @@
VARIABLE_COMMENT Maximum number of rows in SETUP_OBJECTS.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -3014,7 +3014,7 @@
+@@ -3224,7 +3224,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA_USERS_SIZE
VARIABLE_SCOPE GLOBAL
@@ -1175,7 +1176,7 @@
VARIABLE_COMMENT Maximum number of instrumented users. Use 0 to disable, -1 for automated sizing.
NUMERIC_MIN_VALUE -1
NUMERIC_MAX_VALUE 1048576
-@@ -3064,7 +3064,7 @@
+@@ -3274,7 +3274,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PRELOAD_BUFFER_SIZE
VARIABLE_SCOPE SESSION
@@ -1184,7 +1185,7 @@
VARIABLE_COMMENT The size of the buffer that is allocated when preloading indexes
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1073741824
-@@ -3084,7 +3084,7 @@
+@@ -3294,7 +3294,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME PROFILING_HISTORY_SIZE
VARIABLE_SCOPE SESSION
@@ -1193,7 +1194,7 @@
VARIABLE_COMMENT Number of statements about which profiling information is maintained. If set to 0, no profiles are stored. See SHOW PROFILES.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 100
-@@ -3094,7 +3094,7 @@
+@@ -3304,7 +3304,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PROGRESS_REPORT_TIME
VARIABLE_SCOPE SESSION
@@ -1202,7 +1203,7 @@
VARIABLE_COMMENT Seconds between sending progress reports to the client for time-consuming statements. Set to 0 to disable progress reporting.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -3154,7 +3154,7 @@
+@@ -3364,7 +3364,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME QUERY_ALLOC_BLOCK_SIZE
VARIABLE_SCOPE SESSION
@@ -1211,7 +1212,7 @@
VARIABLE_COMMENT Allocation block size for query parsing and execution
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 4294967295
-@@ -3164,7 +3164,7 @@
+@@ -3374,7 +3374,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME QUERY_CACHE_LIMIT
VARIABLE_SCOPE GLOBAL
@@ -1220,7 +1221,7 @@
VARIABLE_COMMENT Don't cache results that are bigger than this
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -3174,7 +3174,7 @@
+@@ -3384,7 +3384,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME QUERY_CACHE_MIN_RES_UNIT
VARIABLE_SCOPE GLOBAL
@@ -1229,7 +1230,7 @@
VARIABLE_COMMENT The minimum size for blocks allocated by the query cache
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -3187,7 +3187,7 @@
+@@ -3397,7 +3397,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT The memory allocated to store results from old queries
NUMERIC_MIN_VALUE 0
@@ -1238,7 +1239,7 @@
NUMERIC_BLOCK_SIZE 1024
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3224,7 +3224,7 @@
+@@ -3434,7 +3434,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME QUERY_PREALLOC_SIZE
VARIABLE_SCOPE SESSION
@@ -1247,7 +1248,7 @@
VARIABLE_COMMENT Persistent buffer for query parsing and execution
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 4294967295
-@@ -3237,7 +3237,7 @@
+@@ -3447,7 +3447,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes
NUMERIC_MIN_VALUE 0
@@ -1256,7 +1257,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3247,14 +3247,14 @@
+@@ -3457,14 +3457,14 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Sets the internal state of the RAND() generator for replication purposes
NUMERIC_MIN_VALUE 0
@@ -1273,7 +1274,7 @@
VARIABLE_COMMENT Allocation block size for storing ranges during optimization
NUMERIC_MIN_VALUE 4096
NUMERIC_MAX_VALUE 4294967295
-@@ -3267,14 +3267,14 @@
+@@ -3477,14 +3477,14 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Maximum speed(KB/s) to read binlog from master (0 = no limit)
NUMERIC_MIN_VALUE 0
@@ -1290,7 +1291,7 @@
VARIABLE_COMMENT Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value
NUMERIC_MIN_VALUE 8192
NUMERIC_MAX_VALUE 2147483647
-@@ -3294,7 +3294,7 @@
+@@ -3504,7 +3504,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME READ_RND_BUFFER_SIZE
VARIABLE_SCOPE SESSION
@@ -1299,7 +1300,7 @@
VARIABLE_COMMENT When reading rows in sorted order after a sort, the rows are read through this buffer to avoid a disk seeks
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 2147483647
-@@ -3514,10 +3514,10 @@
+@@ -3734,10 +3734,10 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME ROWID_MERGE_BUFF_SIZE
VARIABLE_SCOPE SESSION
@@ -1312,7 +1313,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3534,20 +3534,20 @@
+@@ -3754,20 +3754,20 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME RPL_SEMI_SYNC_MASTER_TIMEOUT
VARIABLE_SCOPE GLOBAL
@@ -1337,7 +1338,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3604,10 +3604,10 @@
+@@ -3824,10 +3824,10 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME RPL_SEMI_SYNC_SLAVE_TRACE_LEVEL
VARIABLE_SCOPE GLOBAL
@@ -1350,7 +1351,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -3644,7 +3644,7 @@
+@@ -3864,7 +3864,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SERVER_ID
VARIABLE_SCOPE SESSION
@@ -1359,7 +1360,7 @@
VARIABLE_COMMENT Uniquely identifies the server instance in the community of replication partners
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 4294967295
-@@ -3784,7 +3784,7 @@
+@@ -4014,7 +4014,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SLAVE_DOMAIN_PARALLEL_THREADS
VARIABLE_SCOPE GLOBAL
@@ -1368,7 +1369,7 @@
VARIABLE_COMMENT Maximum number of parallel threads to use on slave for events in a single replication domain. When using multiple domains, this can be used to limit a single domain from grabbing all threads and thus stalling other domains. The default of 0 means to allow a domain to grab as many threads as it wants, up to the value of slave_parallel_threads.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16383
-@@ -3814,7 +3814,7 @@
+@@ -4044,7 +4044,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SLAVE_MAX_ALLOWED_PACKET
VARIABLE_SCOPE GLOBAL
@@ -1377,7 +1378,7 @@
VARIABLE_COMMENT The maximum packet length to sent successfully from the master to slave.
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 1073741824
-@@ -3844,7 +3844,7 @@
+@@ -4074,7 +4074,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SLAVE_PARALLEL_MAX_QUEUED
VARIABLE_SCOPE GLOBAL
@@ -1386,7 +1387,7 @@
VARIABLE_COMMENT Limit on how much memory SQL threads should use per parallel replication thread when reading ahead in the relay log looking for opportunities for parallel replication. Only used when --slave-parallel-threads > 0.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 2147483647
-@@ -3864,7 +3864,7 @@
+@@ -4094,7 +4094,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME SLAVE_PARALLEL_THREADS
VARIABLE_SCOPE GLOBAL
@@ -1395,7 +1396,7 @@
VARIABLE_COMMENT If non-zero, number of threads to spawn to apply in parallel events on the slave that were group-committed on the master or were logged with GTID in different replication domains. Note that these threads are in addition to the IO and SQL threads, which are always created by a replication slave
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16383
-@@ -3874,7 +3874,7 @@
+@@ -4104,7 +4104,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SLAVE_PARALLEL_WORKERS
VARIABLE_SCOPE GLOBAL
@@ -1404,7 +1405,7 @@
VARIABLE_COMMENT Alias for slave_parallel_threads
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16383
-@@ -3914,7 +3914,7 @@
+@@ -4144,7 +4144,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME SLAVE_TRANSACTION_RETRIES
VARIABLE_SCOPE GLOBAL
@@ -1413,7 +1414,7 @@
VARIABLE_COMMENT Number of times the slave SQL thread will retry a transaction in case it failed with a deadlock, elapsed lock wait timeout or listed in slave_transaction_retry_errors, before giving up and stopping
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 4294967295
-@@ -3934,7 +3934,7 @@
+@@ -4164,7 +4164,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SLAVE_TRANSACTION_RETRY_INTERVAL
VARIABLE_SCOPE GLOBAL
@@ -1422,7 +1423,7 @@
VARIABLE_COMMENT Interval of the slave SQL thread will retry a transaction in case it failed with a deadlock or elapsed lock wait timeout or listed in slave_transaction_retry_errors
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 3600
-@@ -3954,7 +3954,7 @@
+@@ -4184,7 +4184,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SLOW_LAUNCH_TIME
VARIABLE_SCOPE GLOBAL
@@ -1431,7 +1432,7 @@
VARIABLE_COMMENT If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be incremented
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 31536000
-@@ -3997,7 +3997,7 @@
+@@ -4227,7 +4227,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Each thread that needs to do a sort allocates a buffer of this size
NUMERIC_MIN_VALUE 1024
@@ -1440,7 +1441,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -4224,7 +4224,7 @@
+@@ -4454,7 +4454,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME STORED_PROGRAM_CACHE
VARIABLE_SCOPE GLOBAL
@@ -1449,7 +1450,7 @@
VARIABLE_COMMENT The soft upper limit for number of cached stored routines for one connection.
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 524288
-@@ -4334,7 +4334,7 @@
+@@ -4564,7 +4564,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME TABLE_DEFINITION_CACHE
VARIABLE_SCOPE GLOBAL
@@ -1458,7 +1459,7 @@
VARIABLE_COMMENT The number of cached table definitions
NUMERIC_MIN_VALUE 400
NUMERIC_MAX_VALUE 2097152
-@@ -4344,7 +4344,7 @@
+@@ -4574,7 +4574,7 @@
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME TABLE_OPEN_CACHE
VARIABLE_SCOPE GLOBAL
@@ -1467,7 +1468,7 @@
VARIABLE_COMMENT The number of cached open tables
NUMERIC_MIN_VALUE 10
NUMERIC_MAX_VALUE 1048576
-@@ -4404,7 +4404,7 @@
+@@ -4634,7 +4634,7 @@
COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME THREAD_CACHE_SIZE
VARIABLE_SCOPE GLOBAL
@@ -1476,7 +1477,7 @@
VARIABLE_COMMENT How many threads we should keep in a cache for reuse. These are freed after 5 minutes of idle time
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 16384
-@@ -4577,7 +4577,7 @@
+@@ -4797,7 +4797,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Max size for data for an internal temporary on-disk MyISAM or Aria table.
NUMERIC_MIN_VALUE 1024
@@ -1485,7 +1486,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -4587,7 +4587,7 @@
+@@ -4807,7 +4807,7 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MariaDB will automatically convert it to an on-disk MyISAM or Aria table. Same as tmp_table_size.
NUMERIC_MIN_VALUE 0
@@ -1494,7 +1495,7 @@
NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
-@@ -4597,14 +4597,14 @@
+@@ -4817,14 +4817,14 @@
VARIABLE_TYPE BIGINT UNSIGNED
VARIABLE_COMMENT Alias for tmp_memory_table_size. If an internal in-memory temporary table exceeds this size, MariaDB will automatically convert it to an on-disk MyISAM or Aria table.
NUMERIC_MIN_VALUE 0
@@ -1511,8 +1512,8 @@
VARIABLE_COMMENT Allocation block size for transactions to be stored in binary log
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 134217728
-@@ -4614,7 +4614,7 @@
- COMMAND_LINE_ARGUMENT REQUIRED
+@@ -4844,7 +4844,7 @@
+ COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME TRANSACTION_PREALLOC_SIZE
VARIABLE_SCOPE SESSION
-VARIABLE_TYPE BIGINT UNSIGNED
@@ -1520,7 +1521,7 @@
VARIABLE_COMMENT Persistent buffer for transactions to be stored in binary log
NUMERIC_MIN_VALUE 1024
NUMERIC_MAX_VALUE 134217728
-@@ -4754,7 +4754,7 @@
+@@ -4994,7 +4994,7 @@
COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME WAIT_TIMEOUT
VARIABLE_SCOPE SESSION
@@ -1529,7 +1530,7 @@
VARIABLE_COMMENT The number of seconds the server waits for activity on a connection before closing it
NUMERIC_MIN_VALUE 1
NUMERIC_MAX_VALUE 31536000
-@@ -4781,7 +4781,7 @@
+@@ -5021,7 +5021,7 @@
VARIABLE_NAME LOG_TC_SIZE
GLOBAL_VALUE_ORIGIN AUTO
VARIABLE_SCOPE GLOBAL
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,aix.rdiff b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,aix.rdiff
index 3fd27356..262be557 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,aix.rdiff
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,aix.rdiff
@@ -1,8 +1,6 @@
-diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
-index bb3378139f2..ddab28508ec 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
-@@ -4259,99 +4259,9 @@ VARIABLE_COMMENT Define threads usage for handling queries
+@@ -4639,99 +4639,9 @@
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
index 2c31e5f5..2740319d 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
@@ -412,6 +412,16 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME BINLOG_DO_DB
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Tells the primary it should log updates for the specified database, and exclude all others not explicitly mentioned.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME BINLOG_EXPIRE_LOGS_SECONDS
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
@@ -442,6 +452,56 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST MIXED,STATEMENT,ROW
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BINLOG_GTID_INDEX
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Enable the creation of a GTID index for every binlog file, and the use of such index for speeding up GTID lookup in the binlog.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME BINLOG_GTID_INDEX_PAGE_SIZE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Page size to use for the binlog GTID index.
+NUMERIC_MIN_VALUE 64
+NUMERIC_MAX_VALUE 16777216
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BINLOG_GTID_INDEX_SPAN_MIN
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Control sparseness of the binlog GTID index. If set to N, at most one index record will be added for every N bytes of binlog file written, to reduce the size of the index. Normally does not need tuning.
+NUMERIC_MIN_VALUE 1
+NUMERIC_MAX_VALUE 1073741824
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BINLOG_IGNORE_DB
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Tells the primary that updates to the given database should not be logged to the binary log.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME BINLOG_LEGACY_EVENT_POS
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Fill in the end_log_pos field of _all_ events in the binlog, even when doing so costs performance. Can be used in case some old application needs it for backwards compatibility. Setting this option can hurt binlog scalability.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME BINLOG_OPTIMIZE_THREAD_SCHEDULING
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
@@ -452,14 +512,24 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BINLOG_ROW_EVENT_MAX_SIZE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT The maximum size of a row-based binary log event in bytes. Rows will be grouped into events smaller than this size if possible. The value has to be a multiple of 256.
+NUMERIC_MIN_VALUE 256
+NUMERIC_MAX_VALUE 4294967040
+NUMERIC_BLOCK_SIZE 256
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME BINLOG_ROW_IMAGE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE ENUM
-VARIABLE_COMMENT Controls whether rows should be logged in 'FULL', 'NOBLOB' or 'MINIMAL' formats. 'FULL', means that all columns in the before and after image are logged. 'NOBLOB', means that mysqld avoids logging blob columns whenever possible (eg, blob column was not changed or is not part of primary key). 'MINIMAL', means that a PK equivalent (PK columns or full row if there is no PK in the table) is logged in the before image, and only changed columns are logged in the after image. (Default: FULL).
+VARIABLE_COMMENT Controls whether rows should be logged in 'FULL', 'FULL_NODUP', 'NOBLOB' or 'MINIMAL' formats. 'FULL', means that all columns in the before and after image are logged. 'FULL_NODUP', means that all columns are logged in before image, but only changed columns or all columns of inserted record are logged in after image, 'NOBLOB', means that mysqld avoids logging blob columns whenever possible (eg, blob column was not changed or is not part of primary key). 'MINIMAL', means that a PK equivalent (PK columns or full row if there is no PK in the table) is logged in the before image, and only changed columns are logged in the after image. (Default: FULL).
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST MINIMAL,NOBLOB,FULL
+ENUM_VALUE_LIST MINIMAL,NOBLOB,FULL,FULL_NODUP
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME BINLOG_ROW_METADATA
@@ -472,6 +542,16 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NO_LOG,MINIMAL,FULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BINLOG_SPACE_LIMIT
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Alias for max_binlog_total_size. Compatibility with Percona server.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME BINLOG_STMT_CACHE_SIZE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
@@ -482,6 +562,16 @@ NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME BLOCK_ENCRYPTION_MODE
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Default block encryption mode for AES_ENCRYPT() and AES_DECRYPT() functions
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST aes-128-ecb,aes-192-ecb,aes-256-ecb,aes-128-cbc,aes-192-cbc,aes-256-cbc,aes-128-ctr,aes-192-ctr,aes-256-ctr
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME BULK_INSERT_BUFFER_SIZE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
@@ -512,6 +602,16 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT NULL
+VARIABLE_NAME CHARACTER_SET_COLLATIONS
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Overrides for character set default collations
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME CHARACTER_SET_CONNECTION
VARIABLE_SCOPE SESSION
VARIABLE_TYPE ENUM
@@ -702,26 +802,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME DATETIME_FORMAT
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE VARCHAR
-VARIABLE_COMMENT The DATETIME format (ignored)
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST NULL
-READ_ONLY YES
-COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME DATE_FORMAT
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE VARCHAR
-VARIABLE_COMMENT The DATE format (ignored)
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST NULL
-READ_ONLY YES
-COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME DEADLOCK_SEARCH_DEPTH_LONG
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
@@ -1825,7 +1905,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME LOG_SLOW_ADMIN_STATEMENTS
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to the slow log if it is open. Resets or sets the option 'admin' in log_slow_disabled_statements
+VARIABLE_COMMENT Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to the slow log if it is open. Resets or sets the option 'admin' in log_slow_filter. Deprecated, use log_slow_filter without 'admin'.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
@@ -2032,6 +2112,16 @@ NUMERIC_BLOCK_SIZE 4096
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME MAX_BINLOG_TOTAL_SIZE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Maximum space to use for all binary logs. Extra logs are deleted on server start, log rotation, FLUSH LOGS or when writing to binlog. Default is 0, which means no size restrictions. See also slave_connections_needed_for_purge
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 18446744073709551615
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_CONNECTIONS
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BIGINT UNSIGNED
@@ -2222,16 +2312,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
-VARIABLE_NAME MAX_TMP_TABLES
-VARIABLE_SCOPE SESSION
-VARIABLE_TYPE BIGINT UNSIGNED
-VARIABLE_COMMENT Unused, will be removed.
-NUMERIC_MIN_VALUE 1
-NUMERIC_MAX_VALUE 4294967295
-NUMERIC_BLOCK_SIZE 1
-ENUM_VALUE_LIST NULL
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME MAX_USER_CONNECTIONS
VARIABLE_SCOPE SESSION
VARIABLE_TYPE INT
@@ -2452,16 +2532,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
-VARIABLE_NAME OLD_ALTER_TABLE
-VARIABLE_SCOPE SESSION
-VARIABLE_TYPE ENUM
-VARIABLE_COMMENT Alias for alter_algorithm. Deprecated. Use --alter-algorithm instead.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST DEFAULT,COPY,INPLACE,NOCOPY,INSTANT
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT OPTIONAL
VARIABLE_NAME OLD_MODE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE SET
@@ -2469,7 +2539,7 @@ VARIABLE_COMMENT Used to emulate old behavior from earlier MariaDB or MySQL vers
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST NO_DUP_KEY_WARNINGS_WITH_IGNORE,NO_PROGRESS_INFO,ZERO_DATE_TIME_CAST,UTF8_IS_UTF8MB3,IGNORE_INDEX_ONLY_FOR_JOIN,COMPAT_5_1_CHECKSUM,NO_NULL_COLLATION_IDS
+ENUM_VALUE_LIST NO_DUP_KEY_WARNINGS_WITH_IGNORE,NO_PROGRESS_INFO,ZERO_DATE_TIME_CAST,UTF8_IS_UTF8MB3,IGNORE_INDEX_ONLY_FOR_JOIN,COMPAT_5_1_CHECKSUM,NO_NULL_COLLATION_IDS,LOCK_ALTER_TABLE_COPY
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OLD_PASSWORDS
@@ -2494,12 +2564,32 @@ READ_ONLY YES
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_ADJUST_SECONDARY_KEY_COSTS
VARIABLE_SCOPE SESSION
-VARIABLE_TYPE SET
-VARIABLE_COMMENT A bit field with the following values: adjust_secondary_key_cost = Update secondary key costs for ranges to be at least 5x of clustered primary key costs. disable_max_seek = Disable 'max_seek optimization' for secondary keys and slight adjustment of filter cost. disable_forced_index_in_group_by = Disable automatic forced index in GROUP BY. This variable will be deleted in MariaDB 11.0 as it is not needed with the new 11.0 optimizer.
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Unused, will be removed.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 2
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_DISK_READ_COST
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost of reading a block of IO_SIZE (4096) from a disk (in usec).
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 10000
NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST adjust_secondary_key_cost,disable_max_seek,disable_forced_index_in_group_by
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_DISK_READ_RATIO
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Chance that we have to do a disk read to find a row or index entry from the engine cache (cache_misses/total_cache_requests). 0.0 means that everything is cached and 1.0 means that nothing is expected to be in the engine cache.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_EXTRA_PRUNING_DEPTH
@@ -2512,6 +2602,56 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_INDEX_BLOCK_COPY_COST
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost of copying a key block from the cache to intern storage as part of an index scan.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_KEY_COMPARE_COST
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost of checking a key against the end key condition.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_KEY_COPY_COST
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost of finding the next key in the engine and copying it to the SQL layer.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_KEY_LOOKUP_COST
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost for finding a key based on a key value
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_KEY_NEXT_FIND_COST
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost of finding the next key and rowid when using filters.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_MAX_SEL_ARGS
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
@@ -2542,6 +2682,66 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_ROWID_COMPARE_COST
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost of comparing two rowid's
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_ROWID_COPY_COST
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost of copying a rowid
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_ROW_COPY_COST
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost of copying a row from the engine or the join cache to the SQL layer.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_ROW_LOOKUP_COST
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost of finding a row based on a rowid or a clustered key.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_ROW_NEXT_FIND_COST
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost of finding the next row when scanning the table.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 1000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_SCAN_SETUP_COST
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Extra cost added to TABLE and INDEX scans to get optimizer to prefer index lookups.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 100000000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_SEARCH_DEPTH
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
@@ -2569,7 +2769,7 @@ VARIABLE_COMMENT Fine-tune the optimizer behavior
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,engine_condition_pushdown,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,condition_pushdown_for_derived,split_materialized,condition_pushdown_for_subquery,rowid_filter,condition_pushdown_from_having,not_null_range_scan,hash_join_cardinality,cset_narrowing,default
+ENUM_VALUE_LIST index_merge,index_merge_union,index_merge_sort_union,index_merge_intersection,index_merge_sort_intersection,index_condition_pushdown,derived_merge,derived_with_keys,firstmatch,loosescan,materialization,in_to_exists,semijoin,partial_match_rowid_merge,partial_match_table_scan,subquery_cache,mrr,mrr_cost_based,mrr_sort_keys,outer_join_with_cache,semijoin_with_cache,join_cache_incremental,join_cache_hashed,join_cache_bka,optimize_join_buffer_size,table_elimination,extended_keys,exists_to_in,orderby_uses_equalities,condition_pushdown_for_derived,split_materialized,condition_pushdown_for_subquery,rowid_filter,condition_pushdown_from_having,not_null_range_scan,hash_join_cardinality,cset_narrowing,sargable_casefold,default
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME OPTIMIZER_TRACE
@@ -2602,6 +2802,16 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME OPTIMIZER_WHERE_COST
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Cost of checking the row against the WHERE clause. Increasing this will have the optimizer to prefer plans with less row combinations.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 100000
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME PERFORMANCE_SCHEMA
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE BOOLEAN
@@ -3302,6 +3512,16 @@ NUMERIC_BLOCK_SIZE 1
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME REDIRECT_URL
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT URL of another server to redirect clients to. Empty string means no redirection
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME RELAY_LOG
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE VARCHAR
@@ -3772,6 +3992,16 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME SLAVE_CONNECTIONS_NEEDED_FOR_PURGE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE INT UNSIGNED
+VARIABLE_COMMENT Minimum number of connected slaves required for automatic binary log purge with max_binlog_total_size, binlog_expire_logs_seconds or binlog_expire_logs_days.
+NUMERIC_MIN_VALUE 0
+NUMERIC_MAX_VALUE 4294967295
+NUMERIC_BLOCK_SIZE 1
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME SLAVE_DDL_EXEC_MODE
VARIABLE_SCOPE GLOBAL
VARIABLE_TYPE ENUM
@@ -4532,16 +4762,6 @@ NUMERIC_BLOCK_SIZE NULL
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT NULL
-VARIABLE_NAME TIME_FORMAT
-VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE VARCHAR
-VARIABLE_COMMENT The TIME format (ignored)
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST NULL
-READ_ONLY YES
-COMMAND_LINE_ARGUMENT REQUIRED
VARIABLE_NAME TIME_ZONE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE VARCHAR
@@ -4612,6 +4832,16 @@ NUMERIC_BLOCK_SIZE 1024
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME TRANSACTION_ISOLATION
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE ENUM
+VARIABLE_COMMENT Default transaction isolation level
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST READ-UNCOMMITTED,READ-COMMITTED,REPEATABLE-READ,SERIALIZABLE
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME TRANSACTION_PREALLOC_SIZE
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BIGINT UNSIGNED
@@ -4622,10 +4852,20 @@ NUMERIC_BLOCK_SIZE 1024
ENUM_VALUE_LIST NULL
READ_ONLY NO
COMMAND_LINE_ARGUMENT REQUIRED
+VARIABLE_NAME TRANSACTION_READ_ONLY
+VARIABLE_SCOPE SESSION
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Default transaction access mode. If set to OFF, the default, access is read/write. If set to ON, access is read-only. The SET TRANSACTION statement can also change the value of this variable. See SET TRANSACTION and START TRANSACTION.
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME TX_ISOLATION
VARIABLE_SCOPE SESSION
VARIABLE_TYPE ENUM
-VARIABLE_COMMENT Default transaction isolation level
+VARIABLE_COMMENT Default transaction isolation level.This variable is deprecated and will be removed in a future release.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
@@ -4635,7 +4875,7 @@ COMMAND_LINE_ARGUMENT NULL
VARIABLE_NAME TX_READ_ONLY
VARIABLE_SCOPE SESSION
VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Default transaction access mode. If set to OFF, the default, access is read/write. If set to ON, access is read-only. The SET TRANSACTION statement can also change the value of this variable. See SET TRANSACTION and START TRANSACTION.
+VARIABLE_COMMENT Default transaction access mode. If set to OFF, the default, access is read/write. If set to ON, access is read-only. The SET TRANSACTION statement can also change the value of this variable. See SET TRANSACTION and START TRANSACTION.This variable is deprecated and will be removed in a future release.
NUMERIC_MIN_VALUE NULL
NUMERIC_MAX_VALUE NULL
NUMERIC_BLOCK_SIZE NULL
diff --git a/mysql-test/suite/sys_vars/r/sysvars_wsrep,32bit.rdiff b/mysql-test/suite/sys_vars/r/sysvars_wsrep,32bit.rdiff
index 016bd016..94292859 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_wsrep,32bit.rdiff
+++ b/mysql-test/suite/sys_vars/r/sysvars_wsrep,32bit.rdiff
@@ -1,24 +1,24 @@
---- suite/sys_vars/r/sysvars_wsrep.result 2014-10-10 13:33:55.000000000 +0300
-+++ suite/sys_vars/r/sysvars_wsrep,32bit.reject 2014-10-10 19:38:09.000000000 +0300
-@@ -245,7 +245,7 @@
+--- a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
++++ b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
+@@ -307,7 +307,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
- DEFAULT_VALUE 131072
+ DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Max number of rows in write set
- NUMERIC_MIN_VALUE 1
+ NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1048576
-@@ -259,7 +259,7 @@
+@@ -322,7 +322,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
- DEFAULT_VALUE 1073741824
+ DEFAULT_VALUE 2147483647
VARIABLE_SCOPE GLOBAL
-VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_TYPE INT UNSIGNED
VARIABLE_COMMENT Max write set size (bytes)
NUMERIC_MIN_VALUE 1024
- NUMERIC_MAX_VALUE 4294901759
-@@ -273,7 +273,7 @@
+ NUMERIC_MAX_VALUE 2147483647
+@@ -352,7 +352,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 0
VARIABLE_SCOPE GLOBAL
@@ -27,7 +27,7 @@
VARIABLE_COMMENT mysql replication group commit
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 1000
-@@ -455,7 +455,7 @@
+@@ -547,7 +547,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1
VARIABLE_SCOPE SESSION
@@ -36,7 +36,7 @@
VARIABLE_COMMENT Max number of times to retry a failed autocommit statement
NUMERIC_MIN_VALUE 0
NUMERIC_MAX_VALUE 10000
-@@ -483,7 +483,7 @@
+@@ -577,7 +577,7 @@
GLOBAL_VALUE_ORIGIN COMPILE-TIME
DEFAULT_VALUE 1
VARIABLE_SCOPE GLOBAL
diff --git a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
index 4ca95338..cbea1d71 100644
--- a/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
+++ b/mysql-test/suite/sys_vars/r/sysvars_wsrep.result
@@ -31,21 +31,6 @@ ENUM_VALUE_LIST OFF,ON
READ_ONLY NO
COMMAND_LINE_ARGUMENT OPTIONAL
GLOBAL_VALUE_PATH NULL
-VARIABLE_NAME WSREP_CAUSAL_READS
-SESSION_VALUE OFF
-GLOBAL_VALUE OFF
-GLOBAL_VALUE_ORIGIN COMPILE-TIME
-DEFAULT_VALUE OFF
-VARIABLE_SCOPE SESSION
-VARIABLE_TYPE BOOLEAN
-VARIABLE_COMMENT Setting this variable is equivalent to setting wsrep_sync_wait READ flag
-NUMERIC_MIN_VALUE NULL
-NUMERIC_MAX_VALUE NULL
-NUMERIC_BLOCK_SIZE NULL
-ENUM_VALUE_LIST OFF,ON
-READ_ONLY NO
-COMMAND_LINE_ARGUMENT OPTIONAL
-GLOBAL_VALUE_PATH NULL
VARIABLE_NAME WSREP_CERTIFICATION_RULES
SESSION_VALUE NULL
GLOBAL_VALUE strict
diff --git a/mysql-test/suite/sys_vars/r/thread_pool_idle_timeout_grant.result b/mysql-test/suite/sys_vars/r/thread_pool_idle_timeout_grant.result
index f9e14eaf..a9f3021d 100644
--- a/mysql-test/suite/sys_vars/r/thread_pool_idle_timeout_grant.result
+++ b/mysql-test/suite/sys_vars/r/thread_pool_idle_timeout_grant.result
@@ -2,14 +2,14 @@ SET @global=@@global.thread_pool_idle_timeout;
#
# MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
#
-# Test that "SET thread_pool_idle_timeout" is not allowed without CONNECTION ADMIN or SUPER
+# Test that "SET thread_pool_idle_timeout" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL thread_pool_idle_timeout=10;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, CONNECTION ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the CONNECTION ADMIN privilege(s) for this operation
SET thread_pool_idle_timeout=10;
ERROR HY000: Variable 'thread_pool_idle_timeout' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION thread_pool_idle_timeout=10;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'thread_pool_idle_timeout' is a GLOBAL variable and should
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET thread_pool_idle_timeout" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL thread_pool_idle_timeout=10;
-SET thread_pool_idle_timeout=10;
-ERROR HY000: Variable 'thread_pool_idle_timeout' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION thread_pool_idle_timeout=10;
-ERROR HY000: Variable 'thread_pool_idle_timeout' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.thread_pool_idle_timeout=@global;
diff --git a/mysql-test/suite/sys_vars/r/thread_pool_max_threads_grant.result b/mysql-test/suite/sys_vars/r/thread_pool_max_threads_grant.result
index 17511766..40ea57a7 100644
--- a/mysql-test/suite/sys_vars/r/thread_pool_max_threads_grant.result
+++ b/mysql-test/suite/sys_vars/r/thread_pool_max_threads_grant.result
@@ -2,14 +2,14 @@ SET @global=@@global.thread_pool_max_threads;
#
# MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
#
-# Test that "SET thread_pool_max_threads" is not allowed without CONNECTION ADMIN or SUPER
+# Test that "SET thread_pool_max_threads" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL thread_pool_max_threads=10;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, CONNECTION ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the CONNECTION ADMIN privilege(s) for this operation
SET thread_pool_max_threads=10;
ERROR HY000: Variable 'thread_pool_max_threads' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION thread_pool_max_threads=10;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'thread_pool_max_threads' is a GLOBAL variable and should
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET thread_pool_max_threads" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL thread_pool_max_threads=10;
-SET thread_pool_max_threads=10;
-ERROR HY000: Variable 'thread_pool_max_threads' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION thread_pool_max_threads=10;
-ERROR HY000: Variable 'thread_pool_max_threads' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.thread_pool_max_threads=@global;
diff --git a/mysql-test/suite/sys_vars/r/thread_pool_oversubscribe_grant.result b/mysql-test/suite/sys_vars/r/thread_pool_oversubscribe_grant.result
index 965be157..ddb5cc01 100644
--- a/mysql-test/suite/sys_vars/r/thread_pool_oversubscribe_grant.result
+++ b/mysql-test/suite/sys_vars/r/thread_pool_oversubscribe_grant.result
@@ -2,14 +2,14 @@ SET @global=@@global.thread_pool_oversubscribe;
#
# MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
#
-# Test that "SET thread_pool_oversubscribe" is not allowed without CONNECTION ADMIN or SUPER
+# Test that "SET thread_pool_oversubscribe" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL thread_pool_oversubscribe=10;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, CONNECTION ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the CONNECTION ADMIN privilege(s) for this operation
SET thread_pool_oversubscribe=10;
ERROR HY000: Variable 'thread_pool_oversubscribe' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION thread_pool_oversubscribe=10;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'thread_pool_oversubscribe' is a GLOBAL variable and shoul
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET thread_pool_oversubscribe" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL thread_pool_oversubscribe=10;
-SET thread_pool_oversubscribe=10;
-ERROR HY000: Variable 'thread_pool_oversubscribe' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION thread_pool_oversubscribe=10;
-ERROR HY000: Variable 'thread_pool_oversubscribe' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.thread_pool_oversubscribe=@global;
diff --git a/mysql-test/suite/sys_vars/r/thread_pool_stall_limit_grant.result b/mysql-test/suite/sys_vars/r/thread_pool_stall_limit_grant.result
index 08462dc4..335f60ea 100644
--- a/mysql-test/suite/sys_vars/r/thread_pool_stall_limit_grant.result
+++ b/mysql-test/suite/sys_vars/r/thread_pool_stall_limit_grant.result
@@ -2,14 +2,14 @@ SET @global=@@global.thread_pool_stall_limit;
#
# MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
#
-# Test that "SET thread_pool_stall_limit" is not allowed without CONNECTION ADMIN or SUPER
+# Test that "SET thread_pool_stall_limit" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
connect user1,localhost,user1,,;
connection user1;
SET GLOBAL thread_pool_stall_limit=400;
-ERROR 42000: Access denied; you need (at least one of) the SUPER, CONNECTION ADMIN privilege(s) for this operation
+ERROR 42000: Access denied; you need (at least one of) the CONNECTION ADMIN privilege(s) for this operation
SET thread_pool_stall_limit=400;
ERROR HY000: Variable 'thread_pool_stall_limit' is a GLOBAL variable and should be set with SET GLOBAL
SET SESSION thread_pool_stall_limit=400;
@@ -30,17 +30,4 @@ ERROR HY000: Variable 'thread_pool_stall_limit' is a GLOBAL variable and should
disconnect user1;
connection default;
DROP USER user1@localhost;
-# Test that "SET thread_pool_stall_limit" is allowed with SUPER
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
-connect user1,localhost,user1,,;
-connection user1;
-SET GLOBAL thread_pool_stall_limit=400;
-SET thread_pool_stall_limit=400;
-ERROR HY000: Variable 'thread_pool_stall_limit' is a GLOBAL variable and should be set with SET GLOBAL
-SET SESSION thread_pool_stall_limit=400;
-ERROR HY000: Variable 'thread_pool_stall_limit' is a GLOBAL variable and should be set with SET GLOBAL
-disconnect user1;
-connection default;
-DROP USER user1@localhost;
SET @@global.thread_pool_stall_limit=@global;
diff --git a/mysql-test/suite/sys_vars/r/time_format_basic.result b/mysql-test/suite/sys_vars/r/time_format_basic.result
deleted file mode 100644
index fcc23608..00000000
--- a/mysql-test/suite/sys_vars/r/time_format_basic.result
+++ /dev/null
@@ -1,21 +0,0 @@
-select @@global.time_format;
-@@global.time_format
-%H:%i:%s
-select @@session.time_format;
-ERROR HY000: Variable 'time_format' is a GLOBAL variable
-show global variables like 'time_format';
-Variable_name Value
-time_format %H:%i:%s
-show session variables like 'time_format';
-Variable_name Value
-time_format %H:%i:%s
-select * from information_schema.global_variables where variable_name='time_format';
-VARIABLE_NAME VARIABLE_VALUE
-TIME_FORMAT %H:%i:%s
-select * from information_schema.session_variables where variable_name='time_format';
-VARIABLE_NAME VARIABLE_VALUE
-TIME_FORMAT %H:%i:%s
-set global time_format=1;
-ERROR HY000: Variable 'time_format' is a read only variable
-set session time_format=1;
-ERROR HY000: Variable 'time_format' is a read only variable
diff --git a/mysql-test/suite/sys_vars/r/transaction_isolation_basic.result b/mysql-test/suite/sys_vars/r/transaction_isolation_basic.result
new file mode 100644
index 00000000..ef5d6007
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/transaction_isolation_basic.result
@@ -0,0 +1,141 @@
+SET @global_start_value = @@global.transaction_isolation;
+SELECT @global_start_value;
+@global_start_value
+REPEATABLE-READ
+SET @session_start_value = @@session.transaction_isolation;
+SELECT @session_start_value;
+@session_start_value
+REPEATABLE-READ
+'#--------------------FN_DYNVARS_183_01------------------------#'
+SET @@global.transaction_isolation = 'READ-UNCOMMITTED';
+SET @@global.transaction_isolation = DEFAULT;
+SELECT @@global.transaction_isolation;
+@@global.transaction_isolation
+REPEATABLE-READ
+SET @@session.transaction_isolation = DEFAULT;
+SELECT @@session.transaction_isolation;
+@@session.transaction_isolation
+REPEATABLE-READ
+'#---------------------FN_DYNVARS_183_02-------------------------#'
+SET @@global.transaction_isolation = NULL;
+ERROR 42000: Variable 'transaction_isolation' can't be set to the value of 'NULL'
+SET @@global.transaction_isolation = '';
+ERROR 42000: Variable 'transaction_isolation' can't be set to the value of ''
+SET @@session.transaction_isolation = NULL;
+ERROR 42000: Variable 'transaction_isolation' can't be set to the value of 'NULL'
+SET @@session.transaction_isolation = '';
+ERROR 42000: Variable 'transaction_isolation' can't be set to the value of ''
+'#--------------------FN_DYNVARS_183_03------------------------#'
+SET @@global.transaction_isolation = 'READ-UNCOMMITTED';
+SELECT @@global.transaction_isolation;
+@@global.transaction_isolation
+READ-UNCOMMITTED
+SET @@global.transaction_isolation = 'read-COMMITTED';
+SELECT @@global.transaction_isolation;
+@@global.transaction_isolation
+READ-COMMITTED
+SET @@global.transaction_isolation = 'REPEATABLE-READ';
+SELECT @@global.transaction_isolation;
+@@global.transaction_isolation
+REPEATABLE-READ
+SET @@global.transaction_isolation = 'SERIALIZable';
+SELECT @@global.transaction_isolation;
+@@global.transaction_isolation
+SERIALIZABLE
+SET @@session.transaction_isolation = 'READ-UNCOMMITTED';
+SELECT @@session.transaction_isolation;
+@@session.transaction_isolation
+READ-UNCOMMITTED
+SET @@session.transaction_isolation = 'READ-COMMITTED';
+SELECT @@session.transaction_isolation;
+@@session.transaction_isolation
+READ-COMMITTED
+SET @@session.transaction_isolation = 'REPEATABLE-READ';
+SELECT @@session.transaction_isolation;
+@@session.transaction_isolation
+REPEATABLE-READ
+SET @@session.transaction_isolation = 'serializable';
+SELECT @@session.transaction_isolation;
+@@session.transaction_isolation
+SERIALIZABLE
+'#--------------------FN_DYNVARS_183_04-------------------------#'
+SET @@global.transaction_isolation = -1;
+ERROR 42000: Variable 'transaction_isolation' can't be set to the value of '-1'
+SET @@global.transaction_isolation = READUNCOMMITTED;
+ERROR 42000: Variable 'transaction_isolation' can't be set to the value of 'READUNCOMMITTED'
+SET @@global.transaction_isolation = 'REPEATABLE';
+ERROR 42000: Variable 'transaction_isolation' can't be set to the value of 'REPEATABLE'
+SET @@global.transaction_isolation = OFF;
+ERROR 42000: Variable 'transaction_isolation' can't be set to the value of 'OFF'
+SET @@global.transaction_isolation = ON;
+ERROR 42000: Variable 'transaction_isolation' can't be set to the value of 'ON'
+SET @@global.transaction_isolation = 'NON-SERIALIZABLE';
+ERROR 42000: Variable 'transaction_isolation' can't be set to the value of 'NON-SERIALIZABLE'
+SET @@transaction_isolation = -1;
+ERROR 42000: Variable 'transaction_isolation' can't be set to the value of '-1'
+SET @@transaction_isolation = READUNCOMMITTED;
+ERROR 42000: Variable 'transaction_isolation' can't be set to the value of 'READUNCOMMITTED'
+SET @@transaction_isolation = 'REPEATABLE';
+ERROR 42000: Variable 'transaction_isolation' can't be set to the value of 'REPEATABLE'
+SET @@transaction_isolation = 'NONE';
+ERROR 42000: Variable 'transaction_isolation' can't be set to the value of 'NONE'
+SET @@transaction_isolation = 'ALL';
+ERROR 42000: Variable 'transaction_isolation' can't be set to the value of 'ALL'
+'#-------------------FN_DYNVARS_183_05----------------------------#'
+SELECT @@session.transaction_isolation = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='transaction_isolation';
+@@session.transaction_isolation = VARIABLE_VALUE
+1
+'#----------------------FN_DYNVARS_183_06------------------------#'
+SELECT @@global.transaction_isolation = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='transaction_isolation';
+@@global.transaction_isolation = VARIABLE_VALUE
+1
+'#---------------------FN_DYNVARS_183_07-------------------------#'
+SET @@global.transaction_isolation = 0;
+SELECT @@global.transaction_isolation;
+@@global.transaction_isolation
+READ-UNCOMMITTED
+SET @@global.transaction_isolation = 1;
+SELECT @@global.transaction_isolation;
+@@global.transaction_isolation
+READ-COMMITTED
+SET @@global.transaction_isolation = 2;
+SELECT @@global.transaction_isolation;
+@@global.transaction_isolation
+REPEATABLE-READ
+SET @@global.transaction_isolation = 3;
+SELECT @@global.transaction_isolation;
+@@global.transaction_isolation
+SERIALIZABLE
+SET @@global.transaction_isolation = 0.4;
+ERROR 42000: Incorrect argument type to variable 'transaction_isolation'
+'#---------------------FN_DYNVARS_183_08----------------------#'
+SET @@global.transaction_isolation = TRUE;
+SELECT @@global.transaction_isolation;
+@@global.transaction_isolation
+READ-COMMITTED
+SET @@global.transaction_isolation = FALSE;
+SELECT @@global.transaction_isolation;
+@@global.transaction_isolation
+READ-UNCOMMITTED
+'#---------------------FN_DYNVARS_183_09----------------------#'
+SET transaction_isolation = 'REPEATABLE-READ';
+SET session transaction_isolation = 'REPEATABLE-READ';
+SELECT @@transaction_isolation;
+@@transaction_isolation
+REPEATABLE-READ
+SET global transaction_isolation = 'REPEATABLE-READ';
+SELECT @@global.transaction_isolation;
+@@global.transaction_isolation
+REPEATABLE-READ
+SET @@global.transaction_isolation = @global_start_value;
+SELECT @@global.transaction_isolation;
+@@global.transaction_isolation
+REPEATABLE-READ
+SET @@session.transaction_isolation = @session_start_value;
+SELECT @@session.transaction_isolation;
+@@session.transaction_isolation
+REPEATABLE-READ
diff --git a/mysql-test/suite/sys_vars/r/tx_isolation_func.result b/mysql-test/suite/sys_vars/r/transaction_isolation_func.result
index 3f6bd0b4..b27050a0 100644
--- a/mysql-test/suite/sys_vars/r/tx_isolation_func.result
+++ b/mysql-test/suite/sys_vars/r/transaction_isolation_func.result
@@ -1,6 +1,6 @@
** Setup **
-SET @session_tx_isolation = @@SESSION.tx_isolation;
-SET @global_tx_isolation = @@GLOBAL.tx_isolation;
+SET @session_transaction_isolation = @@SESSION.transaction_isolation;
+SET @global_transaction_isolation = @@GLOBAL.transaction_isolation;
connect con0,localhost,root,,;
connection con0;
SET SESSION AUTOCOMMIT = OFF;
@@ -20,10 +20,10 @@ INSERT INTO t1 VALUES(22, 22);
INSERT INTO t1 VALUES(24, 24);
'#----------------------------FN_DYNVARS_184_01--------------------------------------#'
connection con0;
-SET SESSION tx_isolation = 'READ-UNCOMMITTED';
+SET SESSION transaction_isolation = 'READ-UNCOMMITTED';
set binlog_format=mixed;
connection con1;
-SET SESSION tx_isolation = 'READ-UNCOMMITTED';
+SET SESSION transaction_isolation = 'READ-UNCOMMITTED';
set binlog_format=mixed;
connection con0;
START TRANSACTION;
@@ -114,9 +114,9 @@ connection con0;
COMMIT;
'#----------------------------FN_DYNVARS_184_03--------------------------------------#'
connection con0;
-SET SESSION tx_isolation = 'READ-COMMITTED';
+SET SESSION transaction_isolation = 'READ-COMMITTED';
connection con1;
-SET SESSION tx_isolation = 'READ-COMMITTED';
+SET SESSION transaction_isolation = 'READ-COMMITTED';
connection con0;
START TRANSACTION;
SELECT * FROM t1 WHERE a % 2 = 0 FOR UPDATE;
@@ -168,9 +168,9 @@ connection con0;
COMMIT;
'#----------------------------FN_DYNVARS_184_04--------------------------------------#'
connection con0;
-SET SESSION tx_isolation = 'REPEATABLE-READ';
+SET SESSION transaction_isolation = 'REPEATABLE-READ';
connection con1;
-SET SESSION tx_isolation = 'REPEATABLE-READ';
+SET SESSION transaction_isolation = 'REPEATABLE-READ';
connection con0;
START TRANSACTION;
SELECT * FROM t1 WHERE a % 2 = 0 FOR UPDATE;
@@ -332,9 +332,9 @@ connection con0;
COMMIT;
'#----------------------------FN_DYNVARS_184_07--------------------------------------#'
connection con0;
-SET SESSION tx_isolation = 'SERIALIZABLE';
+SET SESSION transaction_isolation = 'SERIALIZABLE';
connection con1;
-SET SESSION tx_isolation = 'SERIALIZABLE';
+SET SESSION transaction_isolation = 'SERIALIZABLE';
connection con0;
START TRANSACTION;
SELECT * FROM t1 WHERE a % 2 = 0 FOR UPDATE;
@@ -363,40 +363,40 @@ COMMIT;
connection con0;
COMMIT;
'#----------------------------FN_DYNVARS_184_08--------------------------------------#'
-SET GLOBAL tx_isolation = 'READ-UNCOMMITTED';
+SET GLOBAL transaction_isolation = 'READ-UNCOMMITTED';
connect con_int1,localhost,root,,;
connection con_int1;
-SELECT @@SESSION.tx_isolation;
-@@SESSION.tx_isolation
+SELECT @@SESSION.transaction_isolation;
+@@SESSION.transaction_isolation
READ-UNCOMMITTED
READ-UNCOMMITTED Expected
-SET SESSION tx_isolation = 'SERIALIZABLE';
+SET SESSION transaction_isolation = 'SERIALIZABLE';
connect con_int2,localhost,root,,;
connection con_int2;
-SELECT @@SESSION.tx_isolation;
-@@SESSION.tx_isolation
+SELECT @@SESSION.transaction_isolation;
+@@SESSION.transaction_isolation
READ-UNCOMMITTED
READ-UNCOMMITTED Expected
-SET SESSION tx_isolation = 'REPEATABLE-READ';
+SET SESSION transaction_isolation = 'REPEATABLE-READ';
connection con_int2;
-SELECT @@SESSION.tx_isolation;
-@@SESSION.tx_isolation
+SELECT @@SESSION.transaction_isolation;
+@@SESSION.transaction_isolation
REPEATABLE-READ
REPEATABLE-READ Expected
connection con_int1;
-SELECT @@SESSION.tx_isolation;
-@@SESSION.tx_isolation
+SELECT @@SESSION.transaction_isolation;
+@@SESSION.transaction_isolation
SERIALIZABLE
SERIALIZABLE Expected
-SELECT @@GLOBAL.tx_isolation;
-@@GLOBAL.tx_isolation
+SELECT @@GLOBAL.transaction_isolation;
+@@GLOBAL.transaction_isolation
READ-UNCOMMITTED
READ-UNCOMMITTED Expected
connection default;
disconnect con_int1;
disconnect con_int2;
-SET @@SESSION.tx_isolation = @session_tx_isolation;
-SET @@GLOBAL.tx_isolation = @global_tx_isolation;
+SET @@SESSION.transaction_isolation = @session_transaction_isolation;
+SET @@GLOBAL.transaction_isolation = @global_transaction_isolation;
connection default;
disconnect con0;
disconnect con1;
diff --git a/mysql-test/suite/sys_vars/r/transaction_read_only_basic.result b/mysql-test/suite/sys_vars/r/transaction_read_only_basic.result
new file mode 100644
index 00000000..b0d1d8bc
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/transaction_read_only_basic.result
@@ -0,0 +1,181 @@
+####################################################################
+# START OF transaction_read_only TESTS #
+####################################################################
+#############################################################
+# Save initial value #
+#############################################################
+SET @start_global_value = @@global.transaction_read_only;
+SELECT @start_global_value;
+@start_global_value
+0
+SET @start_session_value = @@session.transaction_read_only;
+SELECT @start_session_value;
+@start_session_value
+0
+########################################################################
+# Display the DEFAULT value of transaction_read_only #
+########################################################################
+SET @@global.transaction_read_only = ON;
+SET @@global.transaction_read_only = DEFAULT;
+SELECT @@global.transaction_read_only;
+@@global.transaction_read_only
+0
+SET @@session.transaction_read_only = ON;
+SET @@session.transaction_read_only = DEFAULT;
+SELECT @@session.transaction_read_only;
+@@session.transaction_read_only
+0
+###############################################################################
+# Change the value of transaction_read_only to a valid value for GLOBAL Scope #
+###############################################################################
+SET @@global.transaction_read_only = ON;
+SELECT @@global.transaction_read_only;
+@@global.transaction_read_only
+1
+SET @@global.transaction_read_only = OFF;
+SELECT @@global.transaction_read_only;
+@@global.transaction_read_only
+0
+SET @@global.transaction_read_only = 0;
+SELECT @@global.transaction_read_only;
+@@global.transaction_read_only
+0
+SET @@global.transaction_read_only = 1;
+SELECT @@global.transaction_read_only;
+@@global.transaction_read_only
+1
+SET @@global.transaction_read_only = TRUE;
+SELECT @@global.transaction_read_only;
+@@global.transaction_read_only
+1
+SET @@global.transaction_read_only = FALSE;
+SELECT @@global.transaction_read_only;
+@@global.transaction_read_only
+0
+################################################################################
+# Change the value of transaction_read_only to a valid value for SESSION Scope #
+################################################################################
+SET @@session.transaction_read_only = ON;
+SELECT @@session.transaction_read_only;
+@@session.transaction_read_only
+1
+SET @@session.transaction_read_only = OFF;
+SELECT @@session.transaction_read_only;
+@@session.transaction_read_only
+0
+SET @@session.transaction_read_only = 0;
+SELECT @@session.transaction_read_only;
+@@session.transaction_read_only
+0
+SET @@session.transaction_read_only = 1;
+SELECT @@session.transaction_read_only;
+@@session.transaction_read_only
+1
+SET @@session.transaction_read_only = TRUE;
+SELECT @@session.transaction_read_only;
+@@session.transaction_read_only
+1
+SET @@session.transaction_read_only = FALSE;
+SELECT @@session.transaction_read_only;
+@@session.transaction_read_only
+0
+#################################################################
+# Change the value of transaction_read_only to an invalid value #
+#################################################################
+SET @@global.transaction_read_only = 'ONN';
+ERROR 42000: Variable 'transaction_read_only' can't be set to the value of 'ONN'
+SET @@global.transaction_read_only = "OFFF";
+ERROR 42000: Variable 'transaction_read_only' can't be set to the value of 'OFFF'
+SET @@global.transaction_read_only = TTRUE;
+ERROR 42000: Variable 'transaction_read_only' can't be set to the value of 'TTRUE'
+SET @@global.transaction_read_only = FELSE;
+ERROR 42000: Variable 'transaction_read_only' can't be set to the value of 'FELSE'
+SET @@global.transaction_read_only = -1024;
+ERROR 42000: Variable 'transaction_read_only' can't be set to the value of '-1024'
+SET @@global.transaction_read_only = 65536;
+ERROR 42000: Variable 'transaction_read_only' can't be set to the value of '65536'
+SET @@global.transaction_read_only = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'transaction_read_only'
+SET @@global.transaction_read_only = test;
+ERROR 42000: Variable 'transaction_read_only' can't be set to the value of 'test'
+SET @@session.transaction_read_only = ONN;
+ERROR 42000: Variable 'transaction_read_only' can't be set to the value of 'ONN'
+SET @@session.transaction_read_only = ONF;
+ERROR 42000: Variable 'transaction_read_only' can't be set to the value of 'ONF'
+SET @@session.transaction_read_only = OF;
+ERROR 42000: Variable 'transaction_read_only' can't be set to the value of 'OF'
+SET @@session.transaction_read_only = 'OFN';
+ERROR 42000: Variable 'transaction_read_only' can't be set to the value of 'OFN'
+SET @@session.transaction_read_only = -2;
+ERROR 42000: Variable 'transaction_read_only' can't be set to the value of '-2'
+SET @@session.transaction_read_only = 65530.34;
+ERROR 42000: Incorrect argument type to variable 'transaction_read_only'
+SET @@session.transaction_read_only = 65550;
+ERROR 42000: Variable 'transaction_read_only' can't be set to the value of '65550'
+SET @@session.transaction_read_only = test;
+ERROR 42000: Variable 'transaction_read_only' can't be set to the value of 'test'
+SELECT @@session.transaction_read_only;
+@@session.transaction_read_only
+0
+####################################################################
+# Check if the value in GLOBAL Table matches value in variable #
+####################################################################
+SELECT IF(@@global.transaction_read_only, "ON", "OFF") = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='transaction_read_only';
+IF(@@global.transaction_read_only, "ON", "OFF") = VARIABLE_VALUE
+1
+####################################################################
+# Check if the value in SESSION Table matches value in variable #
+####################################################################
+SELECT IF(@@session.transaction_read_only, "ON", "OFF") = VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.SESSION_VARIABLES
+WHERE VARIABLE_NAME='transaction_read_only';
+IF(@@session.transaction_read_only, "ON", "OFF") = VARIABLE_VALUE
+1
+###############################################################################
+# Check if accessing variable with and without GLOBAL point to same variable #
+###############################################################################
+SET @@transaction_read_only = OFF;
+SET @@global.transaction_read_only = ON;
+SELECT @@transaction_read_only = @@global.transaction_read_only;
+@@transaction_read_only = @@global.transaction_read_only
+0
+##############################################################################
+# Check if accessing variable with SESSION,LOCAL and without SCOPE points #
+# to same session variable #
+##############################################################################
+SET @@transaction_read_only = ON;
+SELECT @@transaction_read_only = @@local.transaction_read_only;
+@@transaction_read_only = @@local.transaction_read_only
+1
+SELECT @@local.transaction_read_only = @@session.transaction_read_only;
+@@local.transaction_read_only = @@session.transaction_read_only
+1
+###############################################################################
+# Check if transaction_read_only can be accessed with and without @@ sign #
+###############################################################################
+# @@session is synonym for SESSION
+SET @@session.transaction_read_only= 0;
+# Without modifier, SET changes session variable
+SET transaction_read_only = 1;
+SELECT @@transaction_read_only;
+@@transaction_read_only
+1
+# name1.name2 refers to database_name.table_name
+SELECT session.transaction_read_only;
+ERROR 42S02: Unknown table 'session' in field list
+####################################
+# Restore initial value #
+####################################
+SET @@global.transaction_read_only = @start_global_value;
+SELECT @@global.transaction_read_only;
+@@global.transaction_read_only
+0
+SET @@session.transaction_read_only = @start_session_value;
+SELECT @@session.transaction_read_only;
+@@session.transaction_read_only
+0
+#########################################################
+# END OF transaction_read_only TESTS #
+#########################################################
diff --git a/mysql-test/suite/sys_vars/r/tx_compatibility.result b/mysql-test/suite/sys_vars/r/tx_compatibility.result
new file mode 100644
index 00000000..4cf1cd61
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/tx_compatibility.result
@@ -0,0 +1,139 @@
+#
+# MDEV-21921 Make transaction_isolation and transaction_read_only into
+# system variables
+#
+SET @saved_global_isolation= @@global.transaction_isolation;
+SET @saved_global_read_only= @@global.transaction_read_only;
+# Case 1: Check the influence of --transaction_* on
+# @@session.transaction_* and @@global.transaction_*,
+# @@session.tx_*, @@global.tx_*.
+SELECT @@session.transaction_isolation, @@global.transaction_isolation,
+@@session.tx_isolation, @@global.tx_isolation;
+@@session.transaction_isolation @@global.transaction_isolation @@session.tx_isolation @@global.tx_isolation
+SERIALIZABLE SERIALIZABLE SERIALIZABLE SERIALIZABLE
+SHOW GLOBAL VARIABLES LIKE '%_isolation';
+Variable_name Value
+transaction_isolation SERIALIZABLE
+tx_isolation SERIALIZABLE
+SHOW SESSION VARIABLES LIKE '%_isolation';
+Variable_name Value
+transaction_isolation SERIALIZABLE
+tx_isolation SERIALIZABLE
+SELECT @@session.transaction_read_only, @@global.transaction_read_only,
+@@session.tx_read_only, @@global.tx_read_only;
+@@session.transaction_read_only @@global.transaction_read_only @@session.tx_read_only @@global.tx_read_only
+1 1 1 1
+SHOW GLOBAL VARIABLES LIKE '%_read_only';
+Variable_name Value
+transaction_read_only ON
+tx_read_only ON
+SHOW SESSION VARIABLES LIKE '%_read_only';
+Variable_name Value
+transaction_read_only ON
+tx_read_only ON
+# Case 2: Check that the change to tx_* is reflected to transaction_*.
+SET tx_isolation= 'REPEATABLE-READ';
+Warnings:
+Warning 1287 '@@tx_isolation' is deprecated and will be removed in a future release. Please use '@@transaction_isolation' instead
+SET @@global.tx_isolation= 'SERIALIZABLE';
+Warnings:
+Warning 1287 '@@tx_isolation' is deprecated and will be removed in a future release. Please use '@@transaction_isolation' instead
+SELECT @@session.tx_isolation, @@global.tx_isolation,
+@@session.transaction_isolation, @@global.transaction_isolation;
+@@session.tx_isolation @@global.tx_isolation @@session.transaction_isolation @@global.transaction_isolation
+REPEATABLE-READ SERIALIZABLE REPEATABLE-READ SERIALIZABLE
+SHOW GLOBAL VARIABLES LIKE '%_isolation';
+Variable_name Value
+transaction_isolation SERIALIZABLE
+tx_isolation SERIALIZABLE
+SHOW SESSION VARIABLES LIKE '%_isolation';
+Variable_name Value
+transaction_isolation REPEATABLE-READ
+tx_isolation REPEATABLE-READ
+SET STATEMENT tx_isolation= 'SERIALIZABLE' FOR SHOW SESSION VARIABLES LIKE '%_isolation';
+Variable_name Value
+transaction_isolation SERIALIZABLE
+tx_isolation SERIALIZABLE
+Warnings:
+Warning 1287 '@@tx_isolation' is deprecated and will be removed in a future release. Please use '@@transaction_isolation' instead
+Warning 1287 '@@tx_isolation' is deprecated and will be removed in a future release. Please use '@@transaction_isolation' instead
+SHOW SESSION VARIABLES LIKE '%_isolation';
+Variable_name Value
+transaction_isolation REPEATABLE-READ
+tx_isolation REPEATABLE-READ
+SET tx_read_only= OFF;
+Warnings:
+Warning 1287 '@@tx_read_only' is deprecated and will be removed in a future release. Please use '@@transaction_read_only' instead
+SET @@global.tx_read_only= ON;
+Warnings:
+Warning 1287 '@@tx_read_only' is deprecated and will be removed in a future release. Please use '@@transaction_read_only' instead
+SELECT @@session.tx_read_only, @@global.tx_read_only,
+@@session.transaction_read_only, @@global.transaction_read_only;
+@@session.tx_read_only @@global.tx_read_only @@session.transaction_read_only @@global.transaction_read_only
+0 1 0 1
+SHOW GLOBAL VARIABLES LIKE '%_read_only';
+Variable_name Value
+transaction_read_only ON
+tx_read_only ON
+SHOW SESSION VARIABLES LIKE '%_read_only';
+Variable_name Value
+transaction_read_only OFF
+tx_read_only OFF
+SET STATEMENT tx_read_only= ON FOR SHOW SESSION VARIABLES LIKE '%_read_only';
+Variable_name Value
+transaction_read_only ON
+tx_read_only ON
+Warnings:
+Warning 1287 '@@tx_read_only' is deprecated and will be removed in a future release. Please use '@@transaction_read_only' instead
+Warning 1287 '@@tx_read_only' is deprecated and will be removed in a future release. Please use '@@transaction_read_only' instead
+SHOW SESSION VARIABLES LIKE '%_read_only';
+Variable_name Value
+transaction_read_only OFF
+tx_read_only OFF
+# Case 3: Check that the change to transaction_* is reflected to tx_*.
+SET transaction_isolation= 'SERIALIZABLE';
+SET @@global.transaction_isolation= 'REPEATABLE-READ';
+SELECT @@session.tx_isolation, @@global.tx_isolation,
+@@session.transaction_isolation, @@global.transaction_isolation;
+@@session.tx_isolation @@global.tx_isolation @@session.transaction_isolation @@global.transaction_isolation
+SERIALIZABLE REPEATABLE-READ SERIALIZABLE REPEATABLE-READ
+SHOW GLOBAL VARIABLES LIKE '%_isolation';
+Variable_name Value
+transaction_isolation REPEATABLE-READ
+tx_isolation REPEATABLE-READ
+SHOW SESSION VARIABLES LIKE '%_isolation';
+Variable_name Value
+transaction_isolation SERIALIZABLE
+tx_isolation SERIALIZABLE
+SET STATEMENT transaction_isolation= 'REPEATABLE-READ' FOR SHOW SESSION VARIABLES LIKE '%_isolation';
+Variable_name Value
+transaction_isolation REPEATABLE-READ
+tx_isolation REPEATABLE-READ
+SHOW SESSION VARIABLES LIKE '%_isolation';
+Variable_name Value
+transaction_isolation SERIALIZABLE
+tx_isolation SERIALIZABLE
+SET transaction_read_only= ON;
+SET @@global.transaction_read_only= OFF;
+SELECT @@session.tx_read_only, @@global.tx_read_only,
+@@session.transaction_read_only, @@global.transaction_read_only;
+@@session.tx_read_only @@global.tx_read_only @@session.transaction_read_only @@global.transaction_read_only
+1 0 1 0
+SHOW GLOBAL VARIABLES LIKE '%_read_only';
+Variable_name Value
+transaction_read_only OFF
+tx_read_only OFF
+SHOW SESSION VARIABLES LIKE '%_read_only';
+Variable_name Value
+transaction_read_only ON
+tx_read_only ON
+SET STATEMENT transaction_read_only= OFF FOR SHOW SESSION VARIABLES LIKE '%_read_only';
+Variable_name Value
+transaction_read_only OFF
+tx_read_only OFF
+SHOW SESSION VARIABLES LIKE '%_read_only';
+Variable_name Value
+transaction_read_only ON
+tx_read_only ON
+SET @@global.transaction_isolation= @saved_global_isolation;
+SET @@global.transaction_read_only= @saved_global_read_only;
diff --git a/mysql-test/suite/sys_vars/r/tx_isolation_basic.result b/mysql-test/suite/sys_vars/r/tx_isolation_basic.result
deleted file mode 100644
index f6ee2c92..00000000
--- a/mysql-test/suite/sys_vars/r/tx_isolation_basic.result
+++ /dev/null
@@ -1,141 +0,0 @@
-SET @global_start_value = @@global.tx_isolation;
-SELECT @global_start_value;
-@global_start_value
-REPEATABLE-READ
-SET @session_start_value = @@session.tx_isolation;
-SELECT @session_start_value;
-@session_start_value
-REPEATABLE-READ
-'#--------------------FN_DYNVARS_183_01------------------------#'
-SET @@global.tx_isolation = 'READ-UNCOMMITTED';
-SET @@global.tx_isolation = DEFAULT;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-SET @@session.tx_isolation = DEFAULT;
-SELECT @@session.tx_isolation;
-@@session.tx_isolation
-REPEATABLE-READ
-'#---------------------FN_DYNVARS_183_02-------------------------#'
-SET @@global.tx_isolation = NULL;
-ERROR 42000: Variable 'tx_isolation' can't be set to the value of 'NULL'
-SET @@global.tx_isolation = '';
-ERROR 42000: Variable 'tx_isolation' can't be set to the value of ''
-SET @@session.tx_isolation = NULL;
-ERROR 42000: Variable 'tx_isolation' can't be set to the value of 'NULL'
-SET @@session.tx_isolation = '';
-ERROR 42000: Variable 'tx_isolation' can't be set to the value of ''
-'#--------------------FN_DYNVARS_183_03------------------------#'
-SET @@global.tx_isolation = 'READ-UNCOMMITTED';
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-READ-UNCOMMITTED
-SET @@global.tx_isolation = 'read-COMMITTED';
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-READ-COMMITTED
-SET @@global.tx_isolation = 'REPEATABLE-READ';
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-SET @@global.tx_isolation = 'SERIALIZable';
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-SERIALIZABLE
-SET @@session.tx_isolation = 'READ-UNCOMMITTED';
-SELECT @@session.tx_isolation;
-@@session.tx_isolation
-READ-UNCOMMITTED
-SET @@session.tx_isolation = 'READ-COMMITTED';
-SELECT @@session.tx_isolation;
-@@session.tx_isolation
-READ-COMMITTED
-SET @@session.tx_isolation = 'REPEATABLE-READ';
-SELECT @@session.tx_isolation;
-@@session.tx_isolation
-REPEATABLE-READ
-SET @@session.tx_isolation = 'serializable';
-SELECT @@session.tx_isolation;
-@@session.tx_isolation
-SERIALIZABLE
-'#--------------------FN_DYNVARS_183_04-------------------------#'
-SET @@global.tx_isolation = -1;
-ERROR 42000: Variable 'tx_isolation' can't be set to the value of '-1'
-SET @@global.tx_isolation = READUNCOMMITTED;
-ERROR 42000: Variable 'tx_isolation' can't be set to the value of 'READUNCOMMITTED'
-SET @@global.tx_isolation = 'REPEATABLE';
-ERROR 42000: Variable 'tx_isolation' can't be set to the value of 'REPEATABLE'
-SET @@global.tx_isolation = OFF;
-ERROR 42000: Variable 'tx_isolation' can't be set to the value of 'OFF'
-SET @@global.tx_isolation = ON;
-ERROR 42000: Variable 'tx_isolation' can't be set to the value of 'ON'
-SET @@global.tx_isolation = 'NON-SERIALIZABLE';
-ERROR 42000: Variable 'tx_isolation' can't be set to the value of 'NON-SERIALIZABLE'
-SET @@tx_isolation = -1;
-ERROR 42000: Variable 'tx_isolation' can't be set to the value of '-1'
-SET @@tx_isolation = READUNCOMMITTED;
-ERROR 42000: Variable 'tx_isolation' can't be set to the value of 'READUNCOMMITTED'
-SET @@tx_isolation = 'REPEATABLE';
-ERROR 42000: Variable 'tx_isolation' can't be set to the value of 'REPEATABLE'
-SET @@tx_isolation = 'NONE';
-ERROR 42000: Variable 'tx_isolation' can't be set to the value of 'NONE'
-SET @@tx_isolation = 'ALL';
-ERROR 42000: Variable 'tx_isolation' can't be set to the value of 'ALL'
-'#-------------------FN_DYNVARS_183_05----------------------------#'
-SELECT @@session.tx_isolation = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='tx_isolation';
-@@session.tx_isolation = VARIABLE_VALUE
-1
-'#----------------------FN_DYNVARS_183_06------------------------#'
-SELECT @@global.tx_isolation = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='tx_isolation';
-@@global.tx_isolation = VARIABLE_VALUE
-1
-'#---------------------FN_DYNVARS_183_07-------------------------#'
-SET @@global.tx_isolation = 0;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-READ-UNCOMMITTED
-SET @@global.tx_isolation = 1;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-READ-COMMITTED
-SET @@global.tx_isolation = 2;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-SET @@global.tx_isolation = 3;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-SERIALIZABLE
-SET @@global.tx_isolation = 0.4;
-ERROR 42000: Incorrect argument type to variable 'tx_isolation'
-'#---------------------FN_DYNVARS_183_08----------------------#'
-SET @@global.tx_isolation = TRUE;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-READ-COMMITTED
-SET @@global.tx_isolation = FALSE;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-READ-UNCOMMITTED
-'#---------------------FN_DYNVARS_183_09----------------------#'
-SET tx_isolation = 'REPEATABLE-READ';
-SET session tx_isolation = 'REPEATABLE-READ';
-SELECT @@tx_isolation;
-@@tx_isolation
-REPEATABLE-READ
-SET global tx_isolation = 'REPEATABLE-READ';
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-SET @@global.tx_isolation = @global_start_value;
-SELECT @@global.tx_isolation;
-@@global.tx_isolation
-REPEATABLE-READ
-SET @@session.tx_isolation = @session_start_value;
-SELECT @@session.tx_isolation;
-@@session.tx_isolation
-REPEATABLE-READ
diff --git a/mysql-test/suite/sys_vars/r/tx_read_only_basic.result b/mysql-test/suite/sys_vars/r/tx_read_only_basic.result
deleted file mode 100644
index 37501450..00000000
--- a/mysql-test/suite/sys_vars/r/tx_read_only_basic.result
+++ /dev/null
@@ -1,181 +0,0 @@
-####################################################################
-# START OF tx_read_only TESTS #
-####################################################################
-#############################################################
-# Save initial value #
-#############################################################
-SET @start_global_value = @@global.tx_read_only;
-SELECT @start_global_value;
-@start_global_value
-0
-SET @start_session_value = @@session.tx_read_only;
-SELECT @start_session_value;
-@start_session_value
-0
-########################################################################
-# Display the DEFAULT value of tx_read_only #
-########################################################################
-SET @@global.tx_read_only = ON;
-SET @@global.tx_read_only = DEFAULT;
-SELECT @@global.tx_read_only;
-@@global.tx_read_only
-0
-SET @@session.tx_read_only = ON;
-SET @@session.tx_read_only = DEFAULT;
-SELECT @@session.tx_read_only;
-@@session.tx_read_only
-0
-##############################################################################
-# Change the value of tx_read_only to a valid value for GLOBAL Scope #
-##############################################################################
-SET @@global.tx_read_only = ON;
-SELECT @@global.tx_read_only;
-@@global.tx_read_only
-1
-SET @@global.tx_read_only = OFF;
-SELECT @@global.tx_read_only;
-@@global.tx_read_only
-0
-SET @@global.tx_read_only = 0;
-SELECT @@global.tx_read_only;
-@@global.tx_read_only
-0
-SET @@global.tx_read_only = 1;
-SELECT @@global.tx_read_only;
-@@global.tx_read_only
-1
-SET @@global.tx_read_only = TRUE;
-SELECT @@global.tx_read_only;
-@@global.tx_read_only
-1
-SET @@global.tx_read_only = FALSE;
-SELECT @@global.tx_read_only;
-@@global.tx_read_only
-0
-###############################################################################
-# Change the value of tx_read_only to a valid value for SESSION Scope #
-###############################################################################
-SET @@session.tx_read_only = ON;
-SELECT @@session.tx_read_only;
-@@session.tx_read_only
-1
-SET @@session.tx_read_only = OFF;
-SELECT @@session.tx_read_only;
-@@session.tx_read_only
-0
-SET @@session.tx_read_only = 0;
-SELECT @@session.tx_read_only;
-@@session.tx_read_only
-0
-SET @@session.tx_read_only = 1;
-SELECT @@session.tx_read_only;
-@@session.tx_read_only
-1
-SET @@session.tx_read_only = TRUE;
-SELECT @@session.tx_read_only;
-@@session.tx_read_only
-1
-SET @@session.tx_read_only = FALSE;
-SELECT @@session.tx_read_only;
-@@session.tx_read_only
-0
-################################################################
-# Change the value of tx_read_only to an invalid value #
-################################################################
-SET @@global.tx_read_only = 'ONN';
-ERROR 42000: Variable 'tx_read_only' can't be set to the value of 'ONN'
-SET @@global.tx_read_only = "OFFF";
-ERROR 42000: Variable 'tx_read_only' can't be set to the value of 'OFFF'
-SET @@global.tx_read_only = TTRUE;
-ERROR 42000: Variable 'tx_read_only' can't be set to the value of 'TTRUE'
-SET @@global.tx_read_only = FELSE;
-ERROR 42000: Variable 'tx_read_only' can't be set to the value of 'FELSE'
-SET @@global.tx_read_only = -1024;
-ERROR 42000: Variable 'tx_read_only' can't be set to the value of '-1024'
-SET @@global.tx_read_only = 65536;
-ERROR 42000: Variable 'tx_read_only' can't be set to the value of '65536'
-SET @@global.tx_read_only = 65530.34;
-ERROR 42000: Incorrect argument type to variable 'tx_read_only'
-SET @@global.tx_read_only = test;
-ERROR 42000: Variable 'tx_read_only' can't be set to the value of 'test'
-SET @@session.tx_read_only = ONN;
-ERROR 42000: Variable 'tx_read_only' can't be set to the value of 'ONN'
-SET @@session.tx_read_only = ONF;
-ERROR 42000: Variable 'tx_read_only' can't be set to the value of 'ONF'
-SET @@session.tx_read_only = OF;
-ERROR 42000: Variable 'tx_read_only' can't be set to the value of 'OF'
-SET @@session.tx_read_only = 'OFN';
-ERROR 42000: Variable 'tx_read_only' can't be set to the value of 'OFN'
-SET @@session.tx_read_only = -2;
-ERROR 42000: Variable 'tx_read_only' can't be set to the value of '-2'
-SET @@session.tx_read_only = 65530.34;
-ERROR 42000: Incorrect argument type to variable 'tx_read_only'
-SET @@session.tx_read_only = 65550;
-ERROR 42000: Variable 'tx_read_only' can't be set to the value of '65550'
-SET @@session.tx_read_only = test;
-ERROR 42000: Variable 'tx_read_only' can't be set to the value of 'test'
-SELECT @@session.tx_read_only;
-@@session.tx_read_only
-0
-####################################################################
-# Check if the value in GLOBAL Table matches value in variable #
-####################################################################
-SELECT IF(@@global.tx_read_only, "ON", "OFF") = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='tx_read_only';
-IF(@@global.tx_read_only, "ON", "OFF") = VARIABLE_VALUE
-1
-####################################################################
-# Check if the value in SESSION Table matches value in variable #
-####################################################################
-SELECT IF(@@session.tx_read_only, "ON", "OFF") = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='tx_read_only';
-IF(@@session.tx_read_only, "ON", "OFF") = VARIABLE_VALUE
-1
-###############################################################################
-# Check if accessing variable with and without GLOBAL point to same variable #
-###############################################################################
-SET @@tx_read_only = OFF;
-SET @@global.tx_read_only = ON;
-SELECT @@tx_read_only = @@global.tx_read_only;
-@@tx_read_only = @@global.tx_read_only
-0
-##############################################################################
-# Check if accessing variable with SESSION,LOCAL and without SCOPE points #
-# to same session variable #
-##############################################################################
-SET @@tx_read_only = ON;
-SELECT @@tx_read_only = @@local.tx_read_only;
-@@tx_read_only = @@local.tx_read_only
-1
-SELECT @@local.tx_read_only = @@session.tx_read_only;
-@@local.tx_read_only = @@session.tx_read_only
-1
-###############################################################################
-# Check if tx_read_only can be accessed with and without @@ sign #
-###############################################################################
-# @@session is synonym for SESSION
-SET @@session.tx_read_only= 0;
-# Without modifier, SET changes session variable
-SET tx_read_only = 1;
-SELECT @@tx_read_only;
-@@tx_read_only
-1
-# name1.name2 refers to database_name.table_name
-SELECT session.tx_read_only;
-ERROR 42S02: Unknown table 'session' in field list
-####################################
-# Restore initial value #
-####################################
-SET @@global.tx_read_only = @start_global_value;
-SELECT @@global.tx_read_only;
-@@global.tx_read_only
-0
-SET @@session.tx_read_only = @start_session_value;
-SELECT @@session.tx_read_only;
-@@session.tx_read_only
-0
-#########################################################
-# END OF tx_read_only TESTS #
-#########################################################
diff --git a/mysql-test/suite/sys_vars/r/wsrep_causal_reads_basic.result b/mysql-test/suite/sys_vars/r/wsrep_causal_reads_basic.result
deleted file mode 100644
index b5f0c073..00000000
--- a/mysql-test/suite/sys_vars/r/wsrep_causal_reads_basic.result
+++ /dev/null
@@ -1,64 +0,0 @@
-#
-# wsrep_causal_reads
-#
-# save the initial values
-SET @wsrep_causal_reads_global_saved = @@global.wsrep_causal_reads;
-SET @wsrep_causal_reads_session_saved = @@session.wsrep_causal_reads;
-# default
-SELECT @@global.wsrep_causal_reads;
-@@global.wsrep_causal_reads
-0
-SELECT @@session.wsrep_causal_reads;
-@@session.wsrep_causal_reads
-0
-
-# scope and valid values
-SET @@global.wsrep_causal_reads=OFF;
-Warnings:
-Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
-SELECT @@global.wsrep_causal_reads;
-@@global.wsrep_causal_reads
-0
-SET @@global.wsrep_causal_reads=ON;
-Warnings:
-Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
-SELECT @@global.wsrep_causal_reads;
-@@global.wsrep_causal_reads
-1
-SET @@session.wsrep_causal_reads=OFF;
-Warnings:
-Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
-SELECT @@session.wsrep_causal_reads;
-@@session.wsrep_causal_reads
-0
-SET @@session.wsrep_causal_reads=ON;
-Warnings:
-Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
-SELECT @@session.wsrep_causal_reads;
-@@session.wsrep_causal_reads
-1
-SET @@session.wsrep_causal_reads=default;
-Warnings:
-Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
-SELECT @@session.wsrep_causal_reads;
-@@session.wsrep_causal_reads
-1
-
-# invalid values
-SET @@global.wsrep_causal_reads=NULL;
-ERROR 42000: Variable 'wsrep_causal_reads' can't be set to the value of 'NULL'
-SET @@global.wsrep_causal_reads='junk';
-ERROR 42000: Variable 'wsrep_causal_reads' can't be set to the value of 'junk'
-SET @@session.wsrep_causal_reads=NULL;
-ERROR 42000: Variable 'wsrep_causal_reads' can't be set to the value of 'NULL'
-SET @@session.wsrep_causal_reads='junk';
-ERROR 42000: Variable 'wsrep_causal_reads' can't be set to the value of 'junk'
-
-# restore the initial values
-SET @@global.wsrep_causal_reads = @wsrep_causal_reads_global_saved;
-Warnings:
-Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
-SET @@session.wsrep_causal_reads = @wsrep_causal_reads_session_saved;
-Warnings:
-Warning 1287 '@@wsrep_causal_reads' is deprecated and will be removed in a future release. Please use '@@wsrep_sync_wait=1' instead
-# End of test
diff --git a/mysql-test/suite/sys_vars/t/binlog_direct_non_transactional_updates_grant.test b/mysql-test/suite/sys_vars/t/binlog_direct_non_transactional_updates_grant.test
index 7de1a119..98970a43 100644
--- a/mysql-test/suite/sys_vars/t/binlog_direct_non_transactional_updates_grant.test
+++ b/mysql-test/suite/sys_vars/t/binlog_direct_non_transactional_updates_grant.test
@@ -3,16 +3,15 @@ source include/have_log_bin.inc;
SET @global= @@global.binlog_direct_non_transactional_updates;
SET @session= @@global.binlog_direct_non_transactional_updates;
-
--echo #
--echo #
--echo #
---echo # Test that "SET binlog_direct_non_transactional_updates" is not allowed without BINLOG ADMIN or SUPER
+--echo # Test that "SET binlog_direct_non_transactional_updates" is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -38,19 +37,5 @@ SET SESSION binlog_direct_non_transactional_updates=0;
--connection default
DROP USER user1@localhost;
---echo # Test that "SET binlog_direct_non_transactional_updates" is allowed with SUPER
-
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,)
---connection user1
-SET binlog_direct_non_transactional_updates=0;
-SET GLOBAL binlog_direct_non_transactional_updates=0;
-SET SESSION binlog_direct_non_transactional_updates=0;
---disconnect user1
---connection default
-DROP USER user1@localhost;
-
-
SET GLOBAL binlog_direct_non_transactional_updates=@global;
SET SESSION binlog_direct_non_transactional_updates=@session;
diff --git a/mysql-test/suite/sys_vars/t/binlog_format_grant.test b/mysql-test/suite/sys_vars/t/binlog_format_grant.test
index 6f89c75a..6f834db4 100644
--- a/mysql-test/suite/sys_vars/t/binlog_format_grant.test
+++ b/mysql-test/suite/sys_vars/t/binlog_format_grant.test
@@ -1,15 +1,14 @@
source include/have_log_bin.inc;
-
--echo #
--echo #
--echo #
---echo # Test that "SET binlog_format" is not allowed without BINLOG ADMIN or SUPER
+--echo # Test that "SET binlog_format" is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -34,16 +33,3 @@ SET SESSION binlog_format=mixed;
--disconnect user1
--connection default
DROP USER user1@localhost;
-
---echo # Test that "SET binlog_format" is allowed with SUPER
-
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,)
---connection user1
-SET binlog_format=mixed;
-SET GLOBAL binlog_format=mixed;
-SET SESSION binlog_format=mixed;
---disconnect user1
---connection default
-DROP USER user1@localhost;
diff --git a/mysql-test/suite/sys_vars/t/connect_timeout_grant.test b/mysql-test/suite/sys_vars/t/connect_timeout_grant.test
index 61a7a3eb..fa90b79e 100644
--- a/mysql-test/suite/sys_vars/t/connect_timeout_grant.test
+++ b/mysql-test/suite/sys_vars/t/connect_timeout_grant.test
@@ -6,11 +6,11 @@ SET @global=@@global.connect_timeout;
--echo # MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
--echo #
---echo # Test that "SET connect_timeout" is not allowed without CONNECTION ADMIN or SUPER
+--echo # Test that "SET connect_timeout" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -38,19 +38,4 @@ SET SESSION connect_timeout=10;
--connection default
DROP USER user1@localhost;
---echo # Test that "SET connect_timeout" is allowed with SUPER
-
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,)
---connection user1
-SET GLOBAL connect_timeout=10;
---error ER_GLOBAL_VARIABLE
-SET connect_timeout=10;
---error ER_GLOBAL_VARIABLE
-SET SESSION connect_timeout=10;
---disconnect user1
---connection default
-DROP USER user1@localhost;
-
SET @@global.connect_timeout=@global;
diff --git a/mysql-test/suite/sys_vars/t/date_format_basic.test b/mysql-test/suite/sys_vars/t/date_format_basic.test
deleted file mode 100644
index a69295b4..00000000
--- a/mysql-test/suite/sys_vars/t/date_format_basic.test
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# show the global and session values;
-#
-select @@global.date_format;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.date_format;
-show global variables like 'date_format';
-show session variables like 'date_format';
-select * from information_schema.global_variables where variable_name='date_format';
-select * from information_schema.session_variables where variable_name='date_format';
-
-#
-# show that it's read-only
-#
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set global date_format="foo";
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set session date_format="foo";
diff --git a/mysql-test/suite/sys_vars/t/datetime_format_basic.test b/mysql-test/suite/sys_vars/t/datetime_format_basic.test
deleted file mode 100644
index 553d3126..00000000
--- a/mysql-test/suite/sys_vars/t/datetime_format_basic.test
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# show the global and session values;
-#
-select @@global.datetime_format;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.datetime_format;
-show global variables like 'datetime_format';
-show session variables like 'datetime_format';
-select * from information_schema.global_variables where variable_name='datetime_format';
-select * from information_schema.session_variables where variable_name='datetime_format';
-
-#
-# show that it's read-only
-#
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set global datetime_format="foo";
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set session datetime_format="foo";
diff --git a/mysql-test/suite/sys_vars/t/debug_basic.test b/mysql-test/suite/sys_vars/t/debug_basic.test
deleted file mode 100644
index b54626c3..00000000
--- a/mysql-test/suite/sys_vars/t/debug_basic.test
+++ /dev/null
@@ -1,22 +0,0 @@
---source include/have_debug.inc
-#
-# exists both as global and session
-#
-set session debug="L";
-
-select @@global.debug="1"; # just to show that global.debug exists
-select @@session.debug; # here we know the value and can display it
---replace_column 2 #
-show global variables like 'debug';
-show session variables like 'debug';
---replace_column 2 #
-select * from information_schema.global_variables where variable_name="debug";
-select * from information_schema.session_variables where variable_name="debug";
-
---error ER_WRONG_TYPE_FOR_VAR
-set @@global.debug=1;
---error ER_WRONG_TYPE_FOR_VAR
-set @@global.debug=1.1;
---error ER_WRONG_TYPE_FOR_VAR
-set @@global.debug=1e1;
-
diff --git a/mysql-test/suite/sys_vars/t/debug_dbug_basic.test b/mysql-test/suite/sys_vars/t/debug_dbug_basic.test
index 44471bf1..fb597a67 100644
--- a/mysql-test/suite/sys_vars/t/debug_dbug_basic.test
+++ b/mysql-test/suite/sys_vars/t/debug_dbug_basic.test
@@ -4,14 +4,14 @@
#
set session debug_dbug="L";
-select @@global.debug_dbug="1"; # just to show that global.debug exists
-select @@session.debug; # here we know the value and can display it
+select @@global.debug_dbug="1"; # just to show that global.debug_dbug exists
+select @@session.debug_dbug; # here we know the value and can display it
--replace_column 2 #
-show global variables like 'debug';
-show session variables like 'debug';
+show global variables like 'debug_dbug';
+show session variables like 'debug_dbug';
--replace_column 2 #
-select * from information_schema.global_variables where variable_name="debug";
-select * from information_schema.session_variables where variable_name="debug";
+select * from information_schema.global_variables where variable_name='debug_dbug';
+select * from information_schema.session_variables where variable_name='debug_dbug';
--error ER_WRONG_TYPE_FOR_VAR
set @@global.debug_dbug=1;
diff --git a/mysql-test/suite/sys_vars/t/debug_dbug_func_notembedded.test b/mysql-test/suite/sys_vars/t/debug_dbug_func_notembedded.test
index cb379746..4088525b 100644
--- a/mysql-test/suite/sys_vars/t/debug_dbug_func_notembedded.test
+++ b/mysql-test/suite/sys_vars/t/debug_dbug_func_notembedded.test
@@ -1,5 +1,5 @@
#
-# Checks that assigning variable 'debug' in one session has no influence on
+# Checks that assigning variable 'debug_dbug' in one session has no influence on
# other session. (BUG#45632 of bugs.mysql.com)
#
# (this will not work with embedded server because mysqltest_embedded uses the
@@ -14,17 +14,17 @@ connect(con2,localhost,root,,test,,);
# makes output independant of current debug status
connection con1;
set session debug_dbug="t";
-show session variables like 'debug';
+show session variables like 'debug_dbug';
connection con2;
set session debug_dbug="t";
-show session variables like 'debug';
+show session variables like 'debug_dbug';
# checks influence one session debug variable on another
connection con1;
set session debug_dbug="d:t";
-show session variables like 'debug';
+show session variables like 'debug_dbug';
connection con2;
-show session variables like 'debug';
+show session variables like 'debug_dbug';
disconnect con1;
disconnect con2;
diff --git a/mysql-test/suite/sys_vars/t/debug_no_thread_alarm_basic.test b/mysql-test/suite/sys_vars/t/debug_no_thread_alarm_basic.test
deleted file mode 100644
index 39823ba2..00000000
--- a/mysql-test/suite/sys_vars/t/debug_no_thread_alarm_basic.test
+++ /dev/null
@@ -1,21 +0,0 @@
-# bool readonly
-
-#
-# show values;
-#
-select @@global.debug_no_thread_alarm;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.debug_no_thread_alarm;
-show global variables like 'debug_no_thread_alarm';
-show session variables like 'debug_no_thread_alarm';
-select * from information_schema.global_variables where variable_name='debug_no_thread_alarm';
-select * from information_schema.session_variables where variable_name='debug_no_thread_alarm';
-
-#
-# show that it's read-only
-#
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set global debug_no_thread_alarm=1;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set session debug_no_thread_alarm=1;
-
diff --git a/mysql-test/suite/sys_vars/t/disconnect_on_expired_password_grant.test b/mysql-test/suite/sys_vars/t/disconnect_on_expired_password_grant.test
index 0d317d29..e901d944 100644
--- a/mysql-test/suite/sys_vars/t/disconnect_on_expired_password_grant.test
+++ b/mysql-test/suite/sys_vars/t/disconnect_on_expired_password_grant.test
@@ -6,11 +6,11 @@ SET @global=@@global.disconnect_on_expired_password;
--echo # MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
--echo #
---echo # Test that "SET disconnect_on_expired_password" is not allowed without CONNECTION ADMIN or SUPER
+--echo # Test that "SET disconnect_on_expired_password" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -38,19 +38,4 @@ SET SESSION disconnect_on_expired_password=1;
--connection default
DROP USER user1@localhost;
---echo # Test that "SET disconnect_on_expired_password" is allowed with SUPER
-
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,)
---connection user1
-SET GLOBAL disconnect_on_expired_password=1;
---error ER_GLOBAL_VARIABLE
-SET disconnect_on_expired_password=1;
---error ER_GLOBAL_VARIABLE
-SET SESSION disconnect_on_expired_password=1;
---disconnect user1
---connection default
-DROP USER user1@localhost;
-
SET @@global.disconnect_on_expired_password=@global;
diff --git a/mysql-test/suite/sys_vars/t/extra_max_connections_grant.test b/mysql-test/suite/sys_vars/t/extra_max_connections_grant.test
index 058364ec..de35fa2c 100644
--- a/mysql-test/suite/sys_vars/t/extra_max_connections_grant.test
+++ b/mysql-test/suite/sys_vars/t/extra_max_connections_grant.test
@@ -6,11 +6,11 @@ SET @global=@@global.extra_max_connections;
--echo # MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
--echo #
---echo # Test that "SET extra_max_connections" is not allowed without CONNECTION ADMIN or SUPER
+--echo # Test that "SET extra_max_connections" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -38,19 +38,4 @@ SET SESSION extra_max_connections=10;
--connection default
DROP USER user1@localhost;
---echo # Test that "SET extra_max_connections" is allowed with SUPER
-
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,)
---connection user1
-SET GLOBAL extra_max_connections=10;
---error ER_GLOBAL_VARIABLE
-SET extra_max_connections=10;
---error ER_GLOBAL_VARIABLE
-SET SESSION extra_max_connections=10;
---disconnect user1
---connection default
-DROP USER user1@localhost;
-
SET @@global.extra_max_connections=@global;
diff --git a/mysql-test/suite/sys_vars/t/gtid_binlog_state_grant.test b/mysql-test/suite/sys_vars/t/gtid_binlog_state_grant.test
index b1cfa320..b08a439c 100644
--- a/mysql-test/suite/sys_vars/t/gtid_binlog_state_grant.test
+++ b/mysql-test/suite/sys_vars/t/gtid_binlog_state_grant.test
@@ -1,6 +1,5 @@
--source include/not_embedded.inc
-
--echo #
--echo # MDEV-21973 Bind REPLICATION {MASTER|SLAVE} ADMIN to gtid_* GLOBAL-only system variables
--echo #
@@ -11,17 +10,15 @@
# or "Binlog closed, cannot RESET MASTER" on success.
#
-
--let var = gtid_binlog_state
--let grant = REPLICATION MASTER ADMIN
--let value = '0-1-10'
-
---echo # Test that "SET $var" is not allowed without $grant or SUPER
+--echo # Test that "SET $var" is not allowed without $grant
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
---eval REVOKE $grant, SUPER ON *.* FROM user1@localhost
+--eval REVOKE $grant ON *.* FROM user1@localhost
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -49,19 +46,3 @@ CREATE USER user1@localhost;
--disconnect user1
--connection default
DROP USER user1@localhost;
-
---echo # Test that "SET $var" is allowed with SUPER
-
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,)
---connection user1
---error ER_FLUSH_MASTER_BINLOG_CLOSED
---eval SET GLOBAL $var=$value
---error ER_GLOBAL_VARIABLE
---eval SET $var=$value
---error ER_GLOBAL_VARIABLE
---eval SET SESSION $var=$value
---disconnect user1
---connection default
-DROP USER user1@localhost;
diff --git a/mysql-test/suite/sys_vars/t/init_connect_grant.test b/mysql-test/suite/sys_vars/t/init_connect_grant.test
index 685f0900..8f211459 100644
--- a/mysql-test/suite/sys_vars/t/init_connect_grant.test
+++ b/mysql-test/suite/sys_vars/t/init_connect_grant.test
@@ -6,11 +6,11 @@ SET @global=@@global.init_connect;
--echo # MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
--echo #
---echo # Test that "SET init_connect" is not allowed without CONNECTION ADMIN or SUPER
+--echo # Test that "SET init_connect" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -38,19 +38,4 @@ SET SESSION init_connect="SET @xxx=1";
--connection default
DROP USER user1@localhost;
---echo # Test that "SET init_connect" is allowed with SUPER
-
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,)
---connection user1
-SET GLOBAL init_connect="SET @xxx=1";
---error ER_GLOBAL_VARIABLE
-SET init_connect="SET @xxx=1";
---error ER_GLOBAL_VARIABLE
-SET SESSION init_connect="SET @xxx=1";
---disconnect user1
---connection default
-DROP USER user1@localhost;
-
SET @@global.init_connect=@global;
diff --git a/mysql-test/suite/sys_vars/t/innodb_change_buffer_max_size_basic.test b/mysql-test/suite/sys_vars/t/innodb_change_buffer_max_size_basic.test
deleted file mode 100644
index 2094ef3d..00000000
--- a/mysql-test/suite/sys_vars/t/innodb_change_buffer_max_size_basic.test
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-# 2011-02-09 - Added
-#
-
---source include/have_innodb.inc
-
-SET @start_global_value = @@global.innodb_change_buffer_max_size;
-SELECT @start_global_value;
-
-#
-# exists as global only
-#
---echo Valid values are between 0 and 50
-select @@global.innodb_change_buffer_max_size between 0 and 50;
-select @@global.innodb_change_buffer_max_size;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.innodb_change_buffer_max_size;
-show global variables like 'innodb_change_buffer_max_size';
-show session variables like 'innodb_change_buffer_max_size';
---disable_warnings
-select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
-select * from information_schema.session_variables where variable_name='innodb_change_buffer_max_size';
---enable_warnings
-
-#
-# show that it's writable
-#
-set global innodb_change_buffer_max_size=10;
-select @@global.innodb_change_buffer_max_size;
---disable_warnings
-select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
-select * from information_schema.session_variables where variable_name='innodb_change_buffer_max_size';
---enable_warnings
---error ER_GLOBAL_VARIABLE
-set session innodb_change_buffer_max_size=1;
-
-#
-# incorrect types
-#
---error ER_WRONG_TYPE_FOR_VAR
-set global innodb_change_buffer_max_size=1.1;
---error ER_WRONG_TYPE_FOR_VAR
-set global innodb_change_buffer_max_size=1e1;
---error ER_WRONG_TYPE_FOR_VAR
-set global innodb_change_buffer_max_size="foo";
-
-set global innodb_change_buffer_max_size=-7;
-select @@global.innodb_change_buffer_max_size;
---disable_warnings
-select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
---enable_warnings
-set global innodb_change_buffer_max_size=56;
-select @@global.innodb_change_buffer_max_size;
---disable_warnings
-select * from information_schema.global_variables where variable_name='innodb_change_buffer_max_size';
---enable_warnings
-
-#
-# min/max/DEFAULT values
-#
-set global innodb_change_buffer_max_size=0;
-select @@global.innodb_change_buffer_max_size;
-set global innodb_change_buffer_max_size=50;
-select @@global.innodb_change_buffer_max_size;
-set global innodb_change_buffer_max_size=DEFAULT;
-select @@global.innodb_change_buffer_max_size;
-
-
-SET @@global.innodb_change_buffer_max_size = @start_global_value;
-SELECT @@global.innodb_change_buffer_max_size;
diff --git a/mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test b/mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test
deleted file mode 100644
index 19f0890f..00000000
--- a/mysql-test/suite/sys_vars/t/innodb_change_buffering_basic.test
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-# 2010-01-25 - Added
-#
-
---source include/have_innodb.inc
-
-SET @start_global_value = @@global.innodb_change_buffering;
-SELECT @start_global_value;
-
-#
-# exists as global only
-#
---echo Valid values are 'all', 'deletes', 'changes', 'inserts', 'none', 'purges'
-select @@global.innodb_change_buffering in ('all', 'deletes', 'changes', 'inserts', 'none', 'purges');
-select @@global.innodb_change_buffering;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.innodb_change_buffering;
-show global variables like 'innodb_change_buffering';
-show session variables like 'innodb_change_buffering';
---disable_warnings
-select * from information_schema.global_variables where variable_name='innodb_change_buffering';
-select * from information_schema.session_variables where variable_name='innodb_change_buffering';
---enable_warnings
-
-#
-# show that it's writable
-#
-set global innodb_change_buffering='none';
-select @@global.innodb_change_buffering;
---disable_warnings
-select * from information_schema.global_variables where variable_name='innodb_change_buffering';
-select * from information_schema.session_variables where variable_name='innodb_change_buffering';
---enable_warnings
-set @@global.innodb_change_buffering='inserts';
-select @@global.innodb_change_buffering;
---disable_warnings
-select * from information_schema.global_variables where variable_name='innodb_change_buffering';
-select * from information_schema.session_variables where variable_name='innodb_change_buffering';
---enable_warnings
---error ER_GLOBAL_VARIABLE
-set session innodb_change_buffering='some';
---error ER_GLOBAL_VARIABLE
-set @@session.innodb_change_buffering='some';
-
-#
-# incorrect types
-#
---error ER_WRONG_TYPE_FOR_VAR
-set global innodb_change_buffering=1.1;
-set global innodb_change_buffering=1;
-SELECT @@global.innodb_change_buffering;
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_change_buffering=-2;
---error ER_WRONG_TYPE_FOR_VAR
-set global innodb_change_buffering=1e1;
---error ER_WRONG_VALUE_FOR_VAR
-set global innodb_change_buffering='some';
-
-#
-# Cleanup
-#
-
-SET @@global.innodb_change_buffering = @start_global_value;
-SELECT @@global.innodb_change_buffering;
diff --git a/mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test b/mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test
deleted file mode 100644
index 70f8bee1..00000000
--- a/mysql-test/suite/sys_vars/t/innodb_change_buffering_debug_basic.test
+++ /dev/null
@@ -1,59 +0,0 @@
---source include/have_innodb.inc
---source include/have_debug.inc
-
-SET @start_global_value = @@global.innodb_change_buffering_debug;
-SELECT @start_global_value;
-
-#
-# exists as global only
-#
-select @@global.innodb_change_buffering_debug in (0, 1);
-select @@global.innodb_change_buffering_debug;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.innodb_change_buffering_debug;
-show global variables like 'innodb_change_buffering_debug';
-show session variables like 'innodb_change_buffering_debug';
---disable_warnings
-select * from information_schema.global_variables where variable_name='innodb_change_buffering_debug';
-select * from information_schema.session_variables where variable_name='innodb_change_buffering_debug';
---enable_warnings
-
-#
-# show that it's writable
-#
-set global innodb_change_buffering_debug=1;
-select @@global.innodb_change_buffering_debug;
---disable_warnings
-select * from information_schema.global_variables where variable_name='innodb_change_buffering_debug';
-select * from information_schema.session_variables where variable_name='innodb_change_buffering_debug';
---enable_warnings
-set @@global.innodb_change_buffering_debug=0;
-select @@global.innodb_change_buffering_debug;
---disable_warnings
-select * from information_schema.global_variables where variable_name='innodb_change_buffering_debug';
-select * from information_schema.session_variables where variable_name='innodb_change_buffering_debug';
---enable_warnings
---error ER_GLOBAL_VARIABLE
-set session innodb_change_buffering_debug='some';
---error ER_GLOBAL_VARIABLE
-set @@session.innodb_change_buffering_debug='some';
-
-#
-# incorrect types
-#
---error ER_WRONG_TYPE_FOR_VAR
-set global innodb_change_buffering_debug=1.1;
---error ER_WRONG_TYPE_FOR_VAR
-set global innodb_change_buffering_debug='foo';
-set global innodb_change_buffering_debug=-2;
---error ER_WRONG_TYPE_FOR_VAR
-set global innodb_change_buffering_debug=1e1;
-set global innodb_change_buffering_debug=2;
-select @@global.innodb_change_buffering_debug;
-
-#
-# Cleanup
-#
-
-SET @@global.innodb_change_buffering_debug = @start_global_value;
-SELECT @@global.innodb_change_buffering_debug;
diff --git a/mysql-test/suite/sys_vars/t/innodb_defragment_basic.test b/mysql-test/suite/sys_vars/t/innodb_defragment_basic.test
deleted file mode 100644
index 9667f63f..00000000
--- a/mysql-test/suite/sys_vars/t/innodb_defragment_basic.test
+++ /dev/null
@@ -1,20 +0,0 @@
--- source include/have_innodb.inc
-
-# Check the default value
-SET @orig = @@global.innodb_defragment;
-SELECT @orig;
-
-# Turn off
-SET GLOBAL innodb_defragment = OFF;
-SELECT @@global.innodb_defragment;
-
-# Turn on
-SET GLOBAL innodb_defragment = ON;
-SELECT @@global.innodb_defragment;
-
-# Wrong value
---error ER_WRONG_VALUE_FOR_VAR
-SET GLOBAL innodb_defragment = 100;
-SELECT @@global.innodb_defragment;
-
-SET GLOBAL innodb_defragment = @orig;
diff --git a/mysql-test/suite/sys_vars/t/innodb_defragment_fill_factor_basic.test b/mysql-test/suite/sys_vars/t/innodb_defragment_fill_factor_basic.test
deleted file mode 100644
index ae9863e8..00000000
--- a/mysql-test/suite/sys_vars/t/innodb_defragment_fill_factor_basic.test
+++ /dev/null
@@ -1,27 +0,0 @@
---source include/have_innodb.inc
-
-SET @start_innodb_defragment_fill_factor = @@global.innodb_defragment_fill_factor;
-SELECT @start_innodb_defragment_fill_factor;
-
-SELECT COUNT(@@global.innodb_defragment_fill_factor);
-
-SET @@global.innodb_defragment_fill_factor = 0.77777777777777;
-SELECT @@global.innodb_defragment_fill_factor;
-
-SET @@global.innodb_defragment_fill_factor = 1;
-SELECT @@global.innodb_defragment_fill_factor;
-
-SET @@global.innodb_defragment_fill_factor = 0.7;
-SELECT @@global.innodb_defragment_fill_factor;
-
-SET @@global.innodb_defragment_fill_factor = -1;
-SELECT @@global.innodb_defragment_fill_factor;
-
-SET @@global.innodb_defragment_fill_factor = 2;
-SELECT @@global.innodb_defragment_fill_factor;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.innodb_defragment_fill_factor = "abc";
-SELECT @@global.innodb_defragment_fill_factor;
-
-SET @@global.innodb_defragment_fill_factor = @start_innodb_defragment_fill_factor;
diff --git a/mysql-test/suite/sys_vars/t/innodb_defragment_fill_factor_n_recs_basic.test b/mysql-test/suite/sys_vars/t/innodb_defragment_fill_factor_n_recs_basic.test
deleted file mode 100644
index 366817c4..00000000
--- a/mysql-test/suite/sys_vars/t/innodb_defragment_fill_factor_n_recs_basic.test
+++ /dev/null
@@ -1,31 +0,0 @@
---source include/have_innodb.inc
-
-SET @start_innodb_defragment_fill_factor_n_recs = @@global.innodb_defragment_fill_factor_n_recs;
-SELECT @start_innodb_defragment_fill_factor_n_recs;
-
-SELECT COUNT(@@global.innodb_defragment_fill_factor_n_recs);
-
-SET @@global.innodb_defragment_fill_factor_n_recs = 50;
-SELECT @@global.innodb_defragment_fill_factor_n_recs;
-
-SET @@global.innodb_defragment_fill_factor_n_recs = 100;
-SELECT @@global.innodb_defragment_fill_factor_n_recs;
-
-SET @@global.innodb_defragment_fill_factor_n_recs = 1;
-SELECT @@global.innodb_defragment_fill_factor_n_recs;
-
-SET @@global.innodb_defragment_fill_factor_n_recs = -1;
-SELECT @@global.innodb_defragment_fill_factor_n_recs;
-
-SET @@global.innodb_defragment_fill_factor_n_recs = 10000;
-SELECT @@global.innodb_defragment_fill_factor_n_recs;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.innodb_defragment_fill_factor_n_recs = 10.5;
-SELECT @@global.innodb_defragment_fill_factor_n_recs;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.innodb_defragment_fill_factor_n_recs = "abc";
-SELECT @@global.innodb_defragment_fill_factor_n_recs;
-
-SET @@global.innodb_defragment_fill_factor_n_recs = @start_innodb_defragment_fill_factor_n_recs;
diff --git a/mysql-test/suite/sys_vars/t/innodb_defragment_frequency_basic.test b/mysql-test/suite/sys_vars/t/innodb_defragment_frequency_basic.test
deleted file mode 100644
index 3ab45744..00000000
--- a/mysql-test/suite/sys_vars/t/innodb_defragment_frequency_basic.test
+++ /dev/null
@@ -1,37 +0,0 @@
---source include/have_innodb.inc
-
-SET @start_innodb_defragment_frequency = @@global.innodb_defragment_frequency;
-SELECT @start_innodb_defragment_frequency;
-
-SELECT COUNT(@@global.innodb_defragment_frequency);
-
-# test valid value
-SET @@global.innodb_defragment_frequency = 200;
-SELECT @@global.innodb_defragment_frequency;
-
-# test valid min
-SET @@global.innodb_defragment_frequency = 1;
-SELECT @@global.innodb_defragment_frequency;
-
-# test valid max
-SET @@global.innodb_defragment_frequency = 1000;
-SELECT @@global.innodb_defragment_frequency;
-
-# test invalid value < min
-SET @@global.innodb_defragment_frequency = -1;
-SELECT @@global.innodb_defragment_frequency;
-
-# test invalid value > max
-SET @@global.innodb_defragment_frequency = 10000;
-SELECT @@global.innodb_defragment_frequency;
-
-# test wrong type
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.innodb_defragment_frequency = 10.5;
-SELECT @@global.innodb_defragment_frequency;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.innodb_defragment_frequency = "abc";
-SELECT @@global.innodb_defragment_frequency;
-
-SET @@global.innodb_defragment_frequency = @start_innodb_defragment_frequency;
diff --git a/mysql-test/suite/sys_vars/t/innodb_defragment_n_pages_basic.test b/mysql-test/suite/sys_vars/t/innodb_defragment_n_pages_basic.test
deleted file mode 100644
index 64aa20a6..00000000
--- a/mysql-test/suite/sys_vars/t/innodb_defragment_n_pages_basic.test
+++ /dev/null
@@ -1,22 +0,0 @@
---source include/have_innodb.inc
-
-SET @start_innodb_defragment_n_pages = @@global.innodb_defragment_n_pages;
-SELECT @start_innodb_defragment_n_pages;
-
-SELECT COUNT(@@global.innodb_defragment_n_pages);
-
-SET @@global.innodb_defragment_n_pages = 1;
-SELECT @@global.innodb_defragment_n_pages;
-
-SET @@global.innodb_defragment_n_pages = 2;
-SELECT @@global.innodb_defragment_n_pages;
-
-SET @@global.innodb_defragment_n_pages = 32;
-SELECT @@global.innodb_defragment_n_pages;
-
-SET @@global.innodb_defragment_n_pages = 64;
-SELECT @@global.innodb_defragment_n_pages;
-
-SET @@global.innodb_defragment_n_pages = @start_innodb_defragment_n_pages;
-
-
diff --git a/mysql-test/suite/sys_vars/t/innodb_defragment_stats_accuracy_basic.test b/mysql-test/suite/sys_vars/t/innodb_defragment_stats_accuracy_basic.test
deleted file mode 100644
index 062753f2..00000000
--- a/mysql-test/suite/sys_vars/t/innodb_defragment_stats_accuracy_basic.test
+++ /dev/null
@@ -1,24 +0,0 @@
---source include/have_innodb.inc
-
-SET @start_innodb_defragment_stats_accuracy = @@global.innodb_defragment_stats_accuracy;
-SELECT @start_innodb_defragment_stats_accuracy;
-
-SELECT COUNT(@@global.innodb_defragment_stats_accuracy);
-
-SET @@global.innodb_defragment_stats_accuracy = 1;
-SELECT @@global.innodb_defragment_stats_accuracy;
-
-SET @@global.innodb_defragment_stats_accuracy = 1000;
-SELECT @@global.innodb_defragment_stats_accuracy;
-
-SET @@global.innodb_defragment_stats_accuracy = -1;
-SELECT @@global.innodb_defragment_stats_accuracy;
-
-SET @@global.innodb_defragment_stats_accuracy = 1000000000000;
-SELECT @@global.innodb_defragment_stats_accuracy;
-
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.innodb_defragment_stats_accuracy = "abc";
-SELECT @@global.innodb_defragment_stats_accuracy;
-
-SET @@global.innodb_defragment_stats_accuracy = @start_innodb_defragment_stats_accuracy;
diff --git a/mysql-test/suite/sys_vars/t/innodb_doublewrite_basic.opt b/mysql-test/suite/sys_vars/t/innodb_doublewrite_basic.opt
new file mode 100644
index 00000000..2bea5a22
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/innodb_doublewrite_basic.opt
@@ -0,0 +1 @@
+--innodb-doublewrite
diff --git a/mysql-test/suite/sys_vars/t/innodb_doublewrite_basic.test b/mysql-test/suite/sys_vars/t/innodb_doublewrite_basic.test
index 1ae10d0f..4e76c0ac 100644
--- a/mysql-test/suite/sys_vars/t/innodb_doublewrite_basic.test
+++ b/mysql-test/suite/sys_vars/t/innodb_doublewrite_basic.test
@@ -1,75 +1,20 @@
-
-
-################## mysql-test\t\innodb_doublewrite_basic.test #################
-# #
-# Variable Name: innodb_doublewrite #
-# Scope: Global #
-# Access Type: Static #
-# Data Type: boolean #
-# #
-# #
-# Creation Date: 2008-02-07 #
-# Author : Sharique Abdullah #
-# #
-# #
-# Description:Test Cases of Dynamic System Variable innodb_doublewrite #
-# that checks the behavior of this variable in the following ways #
-# * Value Check #
-# * Scope Check #
-# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
-# #
-###############################################################################
-
--source include/have_innodb.inc
---echo '#---------------------BS_STVARS_026_01----------------------#'
-####################################################################
-# Displaying default value #
-####################################################################
-SELECT COUNT(@@GLOBAL.innodb_doublewrite);
---echo 1 Expected
-
+SELECT @@GLOBAL.innodb_doublewrite;
---echo '#---------------------BS_STVARS_026_02----------------------#'
-####################################################################
-# Check if Value can set #
-####################################################################
+SET @@GLOBAL.innodb_doublewrite=0;
+SELECT @@GLOBAL.innodb_doublewrite;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET @@GLOBAL.innodb_doublewrite=2;
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@GLOBAL.innodb_doublewrite=3;
+SELECT @@GLOBAL.innodb_doublewrite;
SET @@GLOBAL.innodb_doublewrite=1;
---echo Expected error 'Read only variable'
-
-SELECT COUNT(@@GLOBAL.innodb_doublewrite);
---echo 1 Expected
-
-
-
-
---echo '#---------------------BS_STVARS_026_03----------------------#'
-#################################################################
-# Check if the value in GLOBAL Table matches value in variable #
-#################################################################
-
---disable_warnings
-SELECT IF(@@GLOBAL.innodb_doublewrite, "ON", "OFF") = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='innodb_doublewrite';
---enable_warnings
---echo 1 Expected
-
-SELECT COUNT(@@GLOBAL.innodb_doublewrite);
---echo 1 Expected
+SELECT @@GLOBAL.innodb_doublewrite;
---disable_warnings
SELECT COUNT(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_doublewrite';
---enable_warnings
---echo 1 Expected
-
-
--echo '#---------------------BS_STVARS_026_04----------------------#'
################################################################################
@@ -78,8 +23,6 @@ WHERE VARIABLE_NAME='innodb_doublewrite';
SELECT @@innodb_doublewrite = @@GLOBAL.innodb_doublewrite;
--echo 1 Expected
-
-
--echo '#---------------------BS_STVARS_026_05----------------------#'
################################################################################
# Check if innodb_doublewrite can be accessed with and without @@ sign #
@@ -99,8 +42,5 @@ SELECT COUNT(@@SESSION.innodb_doublewrite);
SELECT COUNT(@@GLOBAL.innodb_doublewrite);
--echo 1 Expected
---Error ER_BAD_FIELD_ERROR
-SELECT innodb_doublewrite = @@SESSION.innodb_doublewrite;
---echo Expected error 'Readonly variable'
-
-
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@innodb_doublewrite = @@SESSION.innodb_doublewrite;
diff --git a/mysql-test/suite/sys_vars/t/lc_time_names_basic.test b/mysql-test/suite/sys_vars/t/lc_time_names_basic.test
index 7e634eda..ff676a6d 100644
--- a/mysql-test/suite/sys_vars/t/lc_time_names_basic.test
+++ b/mysql-test/suite/sys_vars/t/lc_time_names_basic.test
@@ -315,8 +315,6 @@ SET @@session.lc_time_names=sl_SI;
SELECT @@session.lc_time_names;
SET @@session.lc_time_names=sq_AL;
SELECT @@session.lc_time_names;
-SET @@session.lc_time_names=sr_YU;
-SELECT @@session.lc_time_names;
SET @@session.lc_time_names=sv_FI;
SELECT @@session.lc_time_names;
SET @@session.lc_time_names=sr_RS;
@@ -548,8 +546,6 @@ SET @@global.lc_time_names=sl_SI;
SELECT @@global.lc_time_names;
SET @@global.lc_time_names=sq_AL;
SELECT @@global.lc_time_names;
-SET @@global.lc_time_names=sr_YU;
-SELECT @@global.lc_time_names;
SET @@global.lc_time_names=sv_FI;
SELECT @@global.lc_time_names;
SET @@global.lc_time_names=sr_RS;
@@ -623,8 +619,10 @@ SET @@lc_time_names = 110;
SELECT @@lc_time_names;
SET @@lc_time_names = 111;
SELECT @@lc_time_names;
---Error ER_UNKNOWN_LOCALE
SET @@lc_time_names = 112;
+SELECT @@lc_time_names;
+--Error ER_UNKNOWN_LOCALE
+SET @@lc_time_names = 113;
--echo '#--------------------FN_DYNVARS_060_10-------------------------#'
#############################################################################
@@ -643,6 +641,8 @@ SET @@lc_time_names = -1;
SET @@lc_time_names = 'en US';
--Error ER_UNKNOWN_LOCALE
SET @@lc_time_names = 'enUS';
+--Error ER_UNKNOWN_LOCALE
+SET @@session.lc_time_names=sr_YU;
SET @@lc_time_names = true;
SELECT @@lc_time_names AS res_with_true;
diff --git a/mysql-test/suite/sys_vars/t/max_binlog_total_size_basic.test b/mysql-test/suite/sys_vars/t/max_binlog_total_size_basic.test
new file mode 100644
index 00000000..6463a8fa
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/max_binlog_total_size_basic.test
@@ -0,0 +1,42 @@
+# We cannot use embedded server here as access right checking will not work
+--source include/not_embedded.inc
+#
+# only global
+#
+select @@global.max_binlog_total_size;
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+select @@session.max_binlog_total_size;
+show global variables like 'max_binlog_total_size';
+show session variables like 'max_binlog_total_size';
+--disable_warnings
+select * from information_schema.global_variables where variable_name='max_binlog_total_size';
+select * from information_schema.session_variables where variable_name='max_binlog_total_size';
+--enable_warnings
+
+#
+# show that it is not read-only
+#
+set global max_binlog_total_size=1;
+select @@global.max_binlog_total_size, @@global.binlog_space_limit;
+set global max_binlog_total_size=1;
+select @@global.max_binlog_total_size;
+set global binlog_space_limit=2;
+select @@global.max_binlog_total_size, @@global.binlog_space_limit;
+
+--error ER_GLOBAL_VARIABLE
+set session max_binlog_total_size=1;
+
+set global max_binlog_total_size=default;
+
+#
+# Check permissions
+#
+CREATE USER user1@localhost;
+connect (con2,localhost,user1,,);
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+set global max_binlog_total_size=1;
+--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+set global binlog_space_limit=1;
+disconnect con2;
+connection default;
+DROP USER user1@localhost;
diff --git a/mysql-test/suite/sys_vars/t/max_connect_errors_grant.test b/mysql-test/suite/sys_vars/t/max_connect_errors_grant.test
index d349d938..589be656 100644
--- a/mysql-test/suite/sys_vars/t/max_connect_errors_grant.test
+++ b/mysql-test/suite/sys_vars/t/max_connect_errors_grant.test
@@ -6,11 +6,11 @@ SET @global=@@global.max_connect_errors;
--echo # MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
--echo #
---echo # Test that "SET max_connect_errors" is not allowed without CONNECTION ADMIN or SUPER
+--echo # Test that "SET max_connect_errors" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -38,19 +38,4 @@ SET SESSION max_connect_errors=10;
--connection default
DROP USER user1@localhost;
---echo # Test that "SET max_connect_errors" is allowed with SUPER
-
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,)
---connection user1
-SET GLOBAL max_connect_errors=10;
---error ER_GLOBAL_VARIABLE
-SET max_connect_errors=10;
---error ER_GLOBAL_VARIABLE
-SET SESSION max_connect_errors=10;
---disconnect user1
---connection default
-DROP USER user1@localhost;
-
SET @@global.max_connect_errors=@global;
diff --git a/mysql-test/suite/sys_vars/t/max_connections_grant.test b/mysql-test/suite/sys_vars/t/max_connections_grant.test
index d51bd08e..1364e526 100644
--- a/mysql-test/suite/sys_vars/t/max_connections_grant.test
+++ b/mysql-test/suite/sys_vars/t/max_connections_grant.test
@@ -6,11 +6,11 @@ SET @global=@@global.max_connections;
--echo # MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
--echo #
---echo # Test that "SET max_connections" is not allowed without CONNECTION ADMIN or SUPER
+--echo # Test that "SET max_connections" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -38,19 +38,4 @@ SET SESSION max_connections=10;
--connection default
DROP USER user1@localhost;
---echo # Test that "SET max_connections" is allowed with SUPER
-
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,)
---connection user1
-SET GLOBAL max_connections=10;
---error ER_GLOBAL_VARIABLE
-SET max_connections=10;
---error ER_GLOBAL_VARIABLE
-SET SESSION max_connections=10;
---disconnect user1
---connection default
-DROP USER user1@localhost;
-
SET @@global.max_connections=@global;
diff --git a/mysql-test/suite/sys_vars/t/max_join_size_basic.test b/mysql-test/suite/sys_vars/t/max_join_size_basic.test
index bbe13457..1741857d 100644
--- a/mysql-test/suite/sys_vars/t/max_join_size_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_join_size_basic.test
@@ -23,7 +23,7 @@ select * from information_schema.session_variables where variable_name='max_join
# show that it's writable
#
set global max_join_size=10;
-set session max_join_size=20;
+set session max_join_size=100;
select @@global.max_join_size;
select @@session.max_join_size;
show global variables like 'max_join_size';
diff --git a/mysql-test/suite/sys_vars/t/max_join_size_func.test b/mysql-test/suite/sys_vars/t/max_join_size_func.test
index c649c036..5fc8ee58 100644
--- a/mysql-test/suite/sys_vars/t/max_join_size_func.test
+++ b/mysql-test/suite/sys_vars/t/max_join_size_func.test
@@ -84,7 +84,7 @@ connect (test_con1, localhost, root,,);
connection test_con1;
--echo ## Setting value of max_join_size ##
-SET @@session.max_join_size=8;
+SET @@session.max_join_size=4;
--echo ## Since total joins are more than max_join_size value so error will occur ##
--Error ER_TOO_BIG_SELECT
@@ -97,7 +97,7 @@ SELECT * FROM t1 INNER JOIN t2 ON t1.id = t2.id;
##########################################################
--echo ## Setting global value of variable ##
-SET @@global.max_join_size=8;
+SET @@global.max_join_size=4;
connect (test_con2, localhost, root,,);
connection test_con2;
diff --git a/mysql-test/suite/sys_vars/t/max_password_errors_grant.test b/mysql-test/suite/sys_vars/t/max_password_errors_grant.test
index f11c1fb8..c8b9e998 100644
--- a/mysql-test/suite/sys_vars/t/max_password_errors_grant.test
+++ b/mysql-test/suite/sys_vars/t/max_password_errors_grant.test
@@ -6,11 +6,11 @@ SET @global=@@global.max_password_errors;
--echo # MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
--echo #
---echo # Test that "SET max_password_errors" is not allowed without CONNECTION ADMIN or SUPER
+--echo # Test that "SET max_password_errors" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -38,19 +38,4 @@ SET SESSION max_password_errors=10;
--connection default
DROP USER user1@localhost;
---echo # Test that "SET max_password_errors" is allowed with SUPER
-
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,)
---connection user1
-SET GLOBAL max_password_errors=10;
---error ER_GLOBAL_VARIABLE
-SET max_password_errors=10;
---error ER_GLOBAL_VARIABLE
-SET SESSION max_password_errors=10;
---disconnect user1
---connection default
-DROP USER user1@localhost;
-
SET @@global.max_password_errors=@global;
diff --git a/mysql-test/suite/sys_vars/t/max_tmp_tables_basic.test b/mysql-test/suite/sys_vars/t/max_tmp_tables_basic.test
deleted file mode 100644
index 236c5983..00000000
--- a/mysql-test/suite/sys_vars/t/max_tmp_tables_basic.test
+++ /dev/null
@@ -1,227 +0,0 @@
-############## mysql-test\t\max_tmp_tables_basic.test ###############
-# #
-# Variable Name: max_tmp_tables #
-# Scope: GLOBAL | SESSION #
-# Access Type: Dynamic #
-# Data Type: numeric #
-# Default Value: 32 #
-# Range: 1-4294967295 #
-# #
-# #
-# #
-# #
-# #
-# Creation Date: 2008-02-07 #
-# Author: Salman #
-# #
-# Description: Test Cases of Dynamic System Variable max_tmp_tables #
-# that checks the behavior of this variable in the following ways#
-# * Default Value #
-# * Valid & Invalid values #
-# * Scope & Access method #
-# * Data Integrity #
-# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
-# #
-###############################################################################
-
---source include/load_sysvars.inc
-
-####################################
-# START OF max_tmp_tables TESTS #
-####################################
-
-
-#############################################################
-# Save initial value #
-#############################################################
-
-SET @start_global_value = @@global.max_tmp_tables;
-SELECT @start_global_value;
-SET @start_session_value = @@session.max_tmp_tables;
-SELECT @start_session_value;
-
-
---echo '#--------------------FN_DYNVARS_086_01-------------------------#'
-######################################################
-# Display the DEFAULT value of max_tmp_tables #
-######################################################
-
-SET @@global.max_tmp_tables = 1000;
-SET @@global.max_tmp_tables = DEFAULT;
-SELECT @@global.max_tmp_tables;
-
-
-SET @@session.max_tmp_tables = 1000;
-SET @@session.max_tmp_tables = DEFAULT;
-SELECT @@session.max_tmp_tables;
-
-
---echo '#--------------------FN_DYNVARS_086_02-------------------------#'
-######################################################
-# Check the DEFAULT value of max_tmp_tables #
-######################################################
-
-SET @@global.max_tmp_tables = DEFAULT;
-SELECT @@global.max_tmp_tables = 32;
-
-SET @@session.max_tmp_tables = DEFAULT;
-SELECT @@session.max_tmp_tables = 32;
-
-
-
---echo '#--------------------FN_DYNVARS_086_03-------------------------#'
-########################################################################
-# Change the value of max_tmp_tables to a valid value for GLOBAL Scope #
-########################################################################
-
-SET @@global.max_tmp_tables = 1;
-SELECT @@global.max_tmp_tables;
-SET @@global.max_tmp_tables = 2;
-SELECT @@global.max_tmp_tables;
-SET @@global.max_tmp_tables = 65536;
-SELECT @@global.max_tmp_tables;
-SET @@global.max_tmp_tables = 4294967295;
-SELECT @@global.max_tmp_tables;
-SET @@global.max_tmp_tables = 4294967294;
-SELECT @@global.max_tmp_tables;
-
---echo '#--------------------FN_DYNVARS_086_04-------------------------#'
-#########################################################################
-# Change the value of max_tmp_tables to a valid value for SESSION Scope #
-#########################################################################
-
-SET @@session.max_tmp_tables = 1;
-SELECT @@session.max_tmp_tables;
-
-SET @@session.max_tmp_tables = 2;
-SELECT @@session.max_tmp_tables;
-
-SET @@session.max_tmp_tables = 65536;
-SELECT @@session.max_tmp_tables;
-
-SET @@session.max_tmp_tables = 4294967295;
-SELECT @@session.max_tmp_tables;
-
-SET @@session.max_tmp_tables = 4294967294;
-SELECT @@session.max_tmp_tables;
-
-
---echo '#------------------FN_DYNVARS_086_05-----------------------#'
-##########################################################
-# Change the value of max_tmp_tables to an invalid value #
-##########################################################
-
-SET @@global.max_tmp_tables = -1024;
-SELECT @@global.max_tmp_tables;
-SET @@global.max_tmp_tables = 4294967296;
-SELECT @@global.max_tmp_tables;
-SET @@global.max_tmp_tables = -1;
-SELECT @@global.max_tmp_tables;
-SET @@global.max_tmp_tables = 429496729500;
-SELECT @@global.max_tmp_tables;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.max_tmp_tables = 65530.34;
-SELECT @@global.max_tmp_tables;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.max_tmp_tables = test;
-SELECT @@global.max_tmp_tables;
-
-SET @@session.max_tmp_tables = 4294967296;
-SELECT @@session.max_tmp_tables;
-SET @@session.max_tmp_tables = -1;
-SELECT @@session.max_tmp_tables;
-SET @@session.max_tmp_tables = 429496729500;
-SELECT @@session.max_tmp_tables;
-SET @@session.max_tmp_tables = -001;
-SELECT @@session.max_tmp_tables;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.max_tmp_tables = 65530.34;
-SET @@session.max_tmp_tables = 10737418241;
-SELECT @@session.max_tmp_tables;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.max_tmp_tables = test;
-SELECT @@session.max_tmp_tables;
-
-
---echo '#------------------FN_DYNVARS_086_06-----------------------#'
-####################################################################
-# Check if the value in GLOBAL Table matches value in variable #
-####################################################################
-
-
-SELECT @@global.max_tmp_tables = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='max_tmp_tables';
-
---echo '#------------------FN_DYNVARS_086_07-----------------------#'
-####################################################################
-# Check if the value in SESSION Table matches value in variable #
-####################################################################
-
-SELECT @@session.max_tmp_tables = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='max_tmp_tables';
-
-
---echo '#------------------FN_DYNVARS_086_08-----------------------#'
-####################################################################
-# Check if TRUE and FALSE values can be used on variable #
-####################################################################
-
-SET @@global.max_tmp_tables = TRUE;
-SELECT @@global.max_tmp_tables;
-SET @@global.max_tmp_tables = FALSE;
-SELECT @@global.max_tmp_tables;
-
-
---echo '#---------------------FN_DYNVARS_086_09----------------------#'
-#################################################################################
-# Check if accessing variable with and without GLOBAL point to same variable #
-#################################################################################
-
-SET @@global.max_tmp_tables = 20;
-SELECT @@max_tmp_tables = @@global.max_tmp_tables;
-
-
---echo '#---------------------FN_DYNVARS_086_10----------------------#'
-########################################################################################################
-# Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
-########################################################################################################
-
-SET @@max_tmp_tables = 255;
-SELECT @@max_tmp_tables = @@local.max_tmp_tables;
-SELECT @@local.max_tmp_tables = @@session.max_tmp_tables;
-
-
---echo '#---------------------FN_DYNVARS_086_11----------------------#'
-#########################################################################
-# Check if max_tmp_tables can be accessed with and without @@ sign #
-#########################################################################
-
-
-SET max_tmp_tables = 102;
-SELECT @@max_tmp_tables;
---Error ER_UNKNOWN_TABLE
-SELECT local.max_tmp_tables;
---Error ER_UNKNOWN_TABLE
-SELECT session.max_tmp_tables;
---Error ER_BAD_FIELD_ERROR
-SELECT max_tmp_tables = @@session.max_tmp_tables;
-
-
-####################################
-# Restore initial value #
-####################################
-
-SET @@global.max_tmp_tables = @start_global_value;
-SELECT @@global.max_tmp_tables;
-SET @@session.max_tmp_tables = @start_session_value;
-SELECT @@session.max_tmp_tables;
-
-
-###################################################
-# END OF max_tmp_tables TESTS #
-###################################################
-
diff --git a/mysql-test/suite/sys_vars/t/mdev_15935.test b/mysql-test/suite/sys_vars/t/mdev_15935.test
new file mode 100644
index 00000000..856a97e8
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/mdev_15935.test
@@ -0,0 +1,13 @@
+--echo #
+--echo # test cleanup of sys_var classes
+--echo #
+
+--let $long_string=`select repeat('.', 2001)`
+--error ER_WRONG_STRING_LENGTH
+eval set global init_connect="$long_string";
+--error ER_WRONG_STRING_LENGTH
+eval set global ft_boolean_syntax="$long_string";
+
+--echo #
+--echo # end of test mdev_15935
+--echo #
diff --git a/mysql-test/suite/sys_vars/t/mdev_32254.test b/mysql-test/suite/sys_vars/t/mdev_32254.test
new file mode 100644
index 00000000..d907806f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/mdev_32254.test
@@ -0,0 +1,17 @@
+--echo #
+--echo # MDEV-32254 Server crashes when adding records to table after setting redirect_url with empty variable
+--echo #
+--source include/have_innodb.inc
+# redirect_url is undefined in embedded.
+--source include/not_embedded.inc
+set @old_redirect_url=@@global.redirect_url;
+--error ER_WRONG_VALUE_FOR_VAR
+set global redirect_url=@empty_value;
+CREATE TABLE t (c1 INT) ENGINE=INNODB;
+INSERT INTO t VALUES (1),(1);
+drop table t;
+set global redirect_url=@old_redirect_url;
+
+--echo #
+--echo # end of test mdev_32254
+--echo #
diff --git a/mysql-test/suite/sys_vars/t/mdev_32525.test b/mysql-test/suite/sys_vars/t/mdev_32525.test
new file mode 100644
index 00000000..151c7e8d
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/mdev_32525.test
@@ -0,0 +1,23 @@
+--echo #
+--echo # MDEV-32525 Server startup fails to validate invalid redirect_url
+--echo #
+--source include/not_embedded.inc
+
+let $error_log= $MYSQLTEST_VARDIR/log/mdev_32525.err;
+let SEARCH_FILE= $error_log;
+--source include/shutdown_mysqld.inc
+# Server start should fail with an invalid --redirect_url
+--error 1
+--exec $MYSQLD_LAST_CMD --redirect_url="mariadbaaa://test" > $error_log 2>&1
+let SEARCH_PATTERN= \[ERROR\].*Invalid redirect_url: mariadbaaa://test;
+--source include/search_pattern_in_file.inc
+
+# Test empty --redirect_url to avoid similar problems as in
+# MDEV-32254.
+--let restart_parameter=--redirect_url=
+--source include/start_mysqld.inc
+select @@redirect_url;
+
+--echo #
+--echo # end of test mdev_32525
+--echo #
diff --git a/mysql-test/suite/sys_vars/t/mdev_32640.test b/mysql-test/suite/sys_vars/t/mdev_32640.test
new file mode 100644
index 00000000..693bb1e9
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/mdev_32640.test
@@ -0,0 +1,18 @@
+--source include/not_embedded.inc
+
+PREPARE s_1 FROM 'SHOW RELAYLOG EVENTS';
+/* 1 */ SET default_master_connection='MASTER';
+--error WARN_NO_MASTER_INFO
+/* 1 */ EXECUTE s_1;
+/* 2 */ SET default_master_connection='MASTER';
+--error WARN_NO_MASTER_INFO
+/* 2 */ EXECUTE s_1;
+
+create procedure p() SHOW RELAYLOG EVENTS;
+/* 1 */ SET default_master_connection='MASTER';
+--error WARN_NO_MASTER_INFO
+/* 1 */ call p;
+/* 2 */ SET default_master_connection='MASTER';
+--error WARN_NO_MASTER_INFO
+/* 2 */ call p;
+drop procedure p;
diff --git a/mysql-test/suite/sys_vars/t/old_alter_table_basic.test b/mysql-test/suite/sys_vars/t/old_alter_table_basic.test
deleted file mode 100644
index 9a6cb477..00000000
--- a/mysql-test/suite/sys_vars/t/old_alter_table_basic.test
+++ /dev/null
@@ -1,68 +0,0 @@
-
-#
-# 2010-01-20 OBN - added check of I_S values after variable value changed
-#
-
-SET @start_global_value = @@global.old_alter_table;
-SELECT @start_global_value;
-
-#
-# exists as global and session
-#
-select @@global.old_alter_table;
-select @@session.old_alter_table;
-show global variables like 'old_alter_table';
-show session variables like 'old_alter_table';
-select * from information_schema.global_variables where variable_name='old_alter_table';
-select * from information_schema.session_variables where variable_name='old_alter_table';
-
-#
-# show that it's writable
-#
-set global old_alter_table=1;
-set session old_alter_table=1;
-select @@global.old_alter_table;
-select @@session.old_alter_table;
-show global variables like 'old_alter_table';
-show session variables like 'old_alter_table';
-select * from information_schema.global_variables where variable_name='old_alter_table';
-select * from information_schema.session_variables where variable_name='old_alter_table';
-
-set global old_alter_table=2;
-set session old_alter_table=2;
-select @@global.old_alter_table;
-select @@session.old_alter_table;
-show global variables like 'old_alter_table';
-show session variables like 'old_alter_table';
-select * from information_schema.global_variables where variable_name='old_alter_table';
-select * from information_schema.session_variables where variable_name='old_alter_table';
-
-set global old_alter_table=3;
-set session old_alter_table=3;
-select @@global.old_alter_table;
-select @@session.old_alter_table;
-show global variables like 'old_alter_table';
-show session variables like 'old_alter_table';
-select * from information_schema.global_variables where variable_name='old_alter_table';
-select * from information_schema.session_variables where variable_name='old_alter_table';
-
-set global old_alter_table=4;
-set session old_alter_table=4;
-select @@global.old_alter_table;
-select @@session.old_alter_table;
-show global variables like 'old_alter_table';
-show session variables like 'old_alter_table';
-select * from information_schema.global_variables where variable_name='old_alter_table';
-select * from information_schema.session_variables where variable_name='old_alter_table';
-#
-# incorrect types
-#
---error ER_WRONG_TYPE_FOR_VAR
-set global old_alter_table=1.1;
---error ER_WRONG_TYPE_FOR_VAR
-set global old_alter_table=1e1;
---error ER_WRONG_VALUE_FOR_VAR
-set global old_alter_table="foo";
-
-SET @@global.old_alter_table = @start_global_value;
-SELECT @@global.old_alter_table;
diff --git a/mysql-test/suite/sys_vars/t/old_mode_basic.test b/mysql-test/suite/sys_vars/t/old_mode_basic.test
index cb187967..c3fc4c57 100644
--- a/mysql-test/suite/sys_vars/t/old_mode_basic.test
+++ b/mysql-test/suite/sys_vars/t/old_mode_basic.test
@@ -172,7 +172,7 @@ SET @@global.old_mode = 4;
SELECT @@global.old_mode;
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.old_mode = 128;
+SET @@global.old_mode = 256;
SELECT @@global.old_mode;
# use of decimal values
diff --git a/mysql-test/suite/sys_vars/t/old_passwords_func.test b/mysql-test/suite/sys_vars/t/old_passwords_func.test
index bf1d7dcc..842d25e2 100644
--- a/mysql-test/suite/sys_vars/t/old_passwords_func.test
+++ b/mysql-test/suite/sys_vars/t/old_passwords_func.test
@@ -61,7 +61,11 @@ connect (con2,localhost,userNewPass2,pass2,);
SELECT CURRENT_USER();
--echo userNewPass2@localhost Expected
-connect (con3,localhost,userOldPass,pass3,);
+--replace_result $MASTER_MYSOCK MASTER_MYSOCK $MASTER_MYPORT MASTER_MYPORT
+--error 5010
+connect con3,localhost,userOldPass,pass3;
+connect con3,localhost,userOldPass,pass3,,,,auth=mysql_old_password:mysql_native_password;
+
SELECT CURRENT_USER();
--echo userOldPass@localhost Expected
diff --git a/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test b/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test
index ada22845..a5162075 100644
--- a/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test
+++ b/mysql-test/suite/sys_vars/t/optimizer_switch_basic.test
@@ -19,8 +19,8 @@ select * from information_schema.session_variables where variable_name='optimize
#
# show that it's writable
#
-set global optimizer_switch=4101;
-set session optimizer_switch=2058;
+set global optimizer_switch=2053;
+set session optimizer_switch=1034;
select @@global.optimizer_switch;
select @@session.optimizer_switch;
set global optimizer_switch="index_merge_sort_union=on";
diff --git a/mysql-test/suite/sys_vars/t/proxy_protocol_networks_grant.test b/mysql-test/suite/sys_vars/t/proxy_protocol_networks_grant.test
index f2dd8158..85538755 100644
--- a/mysql-test/suite/sys_vars/t/proxy_protocol_networks_grant.test
+++ b/mysql-test/suite/sys_vars/t/proxy_protocol_networks_grant.test
@@ -6,11 +6,11 @@ SET @global=@@global.proxy_protocol_networks;
--echo # MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
--echo #
---echo # Test that "SET proxy_protocol_networks" is not allowed without CONNECTION ADMIN or SUPER
+--echo # Test that "SET proxy_protocol_networks" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -38,19 +38,4 @@ SET SESSION proxy_protocol_networks="";
--connection default
DROP USER user1@localhost;
---echo # Test that "SET proxy_protocol_networks" is allowed with SUPER
-
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,)
---connection user1
-SET GLOBAL proxy_protocol_networks="";
---error ER_GLOBAL_VARIABLE
-SET proxy_protocol_networks="";
---error ER_GLOBAL_VARIABLE
-SET SESSION proxy_protocol_networks="";
---disconnect user1
---connection default
-DROP USER user1@localhost;
-
SET @@global.proxy_protocol_networks=@global;
diff --git a/mysql-test/suite/sys_vars/t/redirect.opt b/mysql-test/suite/sys_vars/t/redirect.opt
new file mode 100644
index 00000000..4cf52749
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/redirect.opt
@@ -0,0 +1 @@
+--init-connect="set redirect_url='mysql://foobar'"
diff --git a/mysql-test/suite/sys_vars/t/redirect.test b/mysql-test/suite/sys_vars/t/redirect.test
new file mode 100644
index 00000000..5a0cb442
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/redirect.test
@@ -0,0 +1,74 @@
+--echo #
+--echo # MDEV-15935 Connection Redirection Mechanism in MariaDB Client/Server Protocol
+--echo #
+# redirect_url is undefined in embedded.
+--source include/not_embedded.inc
+
+# We need to connect as a non super user for the init-connect to take
+# effect
+--source include/add_anonymous_users.inc
+connect (con,localhost,anyone_but_root);
+select @@redirect_url;
+
+connection default;
+--source include/delete_anonymous_users.inc
+set @old_global_redirect_url=@@global.redirect_url;
+set @old_session_redirect_url=@@session.redirect_url;
+set @old_session_track_system_variables=@@session_track_system_variables;
+set session_track_system_variables="";
+
+select @@global.redirect_url;
+set global redirect_url=default;
+select @@global.redirect_url;
+--error ER_WRONG_VALUE_FOR_VAR
+set global redirect_url="mariadb.org";
+--error ER_WRONG_VALUE_FOR_VAR
+set global redirect_url="https://mariadb.org";
+
+--error ER_WRONG_VALUE_FOR_VAR
+set global redirect_url="mysql://mariadb.org:";
+--error ER_WRONG_VALUE_FOR_VAR
+set global redirect_url="mysql://mariadb.org:hello";
+--error ER_WRONG_VALUE_FOR_VAR
+set global redirect_url="mysql://";
+set global redirect_url="mysql://mariadb.org";
+select @@global.redirect_url;
+--error ER_WRONG_VALUE_FOR_VAR
+set global redirect_url="mysql://mariadb.org:12a";
+--error ER_WRONG_VALUE_FOR_VAR
+set global redirect_url="mysql://mariadb.org:66666";
+set global redirect_url="mysql://mariadb.org:12345";
+select @@global.redirect_url;
+
+--error ER_WRONG_VALUE_FOR_VAR
+set global redirect_url="maria";
+--error ER_WRONG_VALUE_FOR_VAR
+set global redirect_url="mariadb://mariadb.org:";
+--error ER_WRONG_VALUE_FOR_VAR
+set global redirect_url="mariadb://mariadb.org:hello";
+--error ER_WRONG_VALUE_FOR_VAR
+set global redirect_url="mariadb://";
+set global redirect_url="mariadb://mariadb.org";
+select @@global.redirect_url;
+--error ER_WRONG_VALUE_FOR_VAR
+set global redirect_url="mariadb://mariadb.org:12a";
+--error ER_WRONG_VALUE_FOR_VAR
+set global redirect_url="mariadb://mariadb.org:66666";
+set global redirect_url="mariadb://mariadb.org:12345";
+select @@global.redirect_url;
+
+select @@session.redirect_url;
+# Test that session default is global value
+set session redirect_url=default;
+select @@session.redirect_url;
+set session redirect_url="mysql://localhost";
+select @@session.redirect_url;
+select @@global.redirect_url;
+
+set global redirect_url=@old_global_redirect_url;
+set session redirect_url=@old_session_redirect_url;
+set session session_track_system_variables=@old_session_track_system_variables;
+
+--echo #
+--echo # end of test MDEV-15935
+--echo #
diff --git a/mysql-test/suite/sys_vars/t/secure_auth_func.test b/mysql-test/suite/sys_vars/t/secure_auth_func.test
index 905164ba..6f4043cc 100644
--- a/mysql-test/suite/sys_vars/t/secure_auth_func.test
+++ b/mysql-test/suite/sys_vars/t/secure_auth_func.test
@@ -65,7 +65,8 @@ connection default;
#
SET PASSWORD FOR 'testUser'@'localhost' = OLD_PASSWORD('newpass');
-connect (con_user2,localhost,testUser,newpass,);
+connect (con_user2,localhost,testUser,newpass,,,,auth=mysql_old_password:mysql_native_password);
+
connection default;
diff --git a/mysql-test/suite/sys_vars/t/secure_auth_grant.test b/mysql-test/suite/sys_vars/t/secure_auth_grant.test
index f597ec79..3cec03a2 100644
--- a/mysql-test/suite/sys_vars/t/secure_auth_grant.test
+++ b/mysql-test/suite/sys_vars/t/secure_auth_grant.test
@@ -6,11 +6,11 @@ SET @global=@@global.secure_auth;
--echo # MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
--echo #
---echo # Test that "SET secure_auth" is not allowed without CONNECTION ADMIN or SUPER
+--echo # Test that "SET secure_auth" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -38,19 +38,4 @@ SET SESSION secure_auth=1;
--connection default
DROP USER user1@localhost;
---echo # Test that "SET secure_auth" is allowed with SUPER
-
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,)
---connection user1
-SET GLOBAL secure_auth=1;
---error ER_GLOBAL_VARIABLE
-SET secure_auth=1;
---error ER_GLOBAL_VARIABLE
-SET SESSION secure_auth=1;
---disconnect user1
---connection default
-DROP USER user1@localhost;
-
SET @@global.secure_auth=@global;
diff --git a/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.cnf b/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.cnf
index 02bdb44e..08af82e1 100644
--- a/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.cnf
+++ b/mysql-test/suite/sys_vars/t/slave_parallel_threads_basic.cnf
@@ -1,5 +1,5 @@
# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
+!include include/default_my.cnf
[mysqld.1]
slave_parallel_threads=20
diff --git a/mysql-test/suite/sys_vars/t/slow_launch_time_grant.test b/mysql-test/suite/sys_vars/t/slow_launch_time_grant.test
index 1a819305..de0ded83 100644
--- a/mysql-test/suite/sys_vars/t/slow_launch_time_grant.test
+++ b/mysql-test/suite/sys_vars/t/slow_launch_time_grant.test
@@ -6,11 +6,11 @@ SET @global=@@global.slow_launch_time;
--echo # MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
--echo #
---echo # Test that "SET slow_launch_time" is not allowed without CONNECTION ADMIN or SUPER
+--echo # Test that "SET slow_launch_time" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -38,19 +38,4 @@ SET SESSION slow_launch_time=10;
--connection default
DROP USER user1@localhost;
---echo # Test that "SET slow_launch_time" is allowed with SUPER
-
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,)
---connection user1
-SET GLOBAL slow_launch_time=10;
---error ER_GLOBAL_VARIABLE
-SET slow_launch_time=10;
---error ER_GLOBAL_VARIABLE
-SET SESSION slow_launch_time=10;
---disconnect user1
---connection default
-DROP USER user1@localhost;
-
SET @@global.slow_launch_time=@global;
diff --git a/mysql-test/suite/sys_vars/t/sql_big_selects_func.test b/mysql-test/suite/sys_vars/t/sql_big_selects_func.test
index 59d81848..b8ff7c53 100644
--- a/mysql-test/suite/sys_vars/t/sql_big_selects_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_big_selects_func.test
@@ -28,7 +28,7 @@
SET @session_sql_big_selects = @@SESSION.sql_big_selects;
SET @session_max_join_size = @@SESSION.max_join_size;
SET @global_max_join_size = @@GLOBAL.max_join_size;
-SET MAX_JOIN_SIZE=9;
+SET MAX_JOIN_SIZE=21;
#
# Create tables
@@ -115,8 +115,6 @@ disconnect con_int2;
#
# Cleanup
#
-
-
SET @@SESSION.sql_big_selects = @session_sql_big_selects;
SET @@SESSION.max_join_size = @session_max_join_size;
SET @@GLOBAL.max_join_size = @global_max_join_size;
diff --git a/mysql-test/suite/sys_vars/t/sql_log_bin_grant.test b/mysql-test/suite/sys_vars/t/sql_log_bin_grant.test
index d7ffc2b6..fa0baefa 100644
--- a/mysql-test/suite/sys_vars/t/sql_log_bin_grant.test
+++ b/mysql-test/suite/sys_vars/t/sql_log_bin_grant.test
@@ -1,15 +1,14 @@
source include/have_log_bin.inc;
-
--echo #
--echo #
--echo #
---echo # Test that "SET sql_log_bin" is not allowed without BINLOG ADMIN or SUPER
+--echo # Test that "SET sql_log_bin" is not allowed without BINLOG ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE BINLOG ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE BINLOG ADMIN ON *.* FROM user1@localhost;
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -35,17 +34,3 @@ SET SESSION sql_log_bin=1;
--disconnect user1
--connection default
DROP USER user1@localhost;
-
---echo # Test that "SET sql_log_bin" is allowed with SUPER
-
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,)
---connection user1
-SET sql_log_bin=1;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-SET GLOBAL sql_log_bin=1;
-SET SESSION sql_log_bin=1;
---disconnect user1
---connection default
-DROP USER user1@localhost;
diff --git a/mysql-test/suite/sys_vars/t/sql_notes_basic.test b/mysql-test/suite/sys_vars/t/sql_notes_basic.test
deleted file mode 100644
index 9af5fa35..00000000
--- a/mysql-test/suite/sys_vars/t/sql_notes_basic.test
+++ /dev/null
@@ -1,171 +0,0 @@
-################### mysql-test\t\sql_notes_basic.test #########################
-# #
-# Variable Name: sql_notes #
-# Scope: SESSION #
-# Access Type: Dynamic #
-# Data Type: boolean #
-# Default Value: #
-# Valid Values: 0,1 #
-# #
-# #
-# Creation Date: 2008-02-07 #
-# Author: Rizwan #
-# #
-# Description: Test Cases of Dynamic System Variable sql_notes #
-# that checks the behavior of this variable in the following ways#
-# * Default Value #
-# * Valid & Invalid values #
-# * Scope & Access method #
-# * Data Integrity #
-# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
-# #
-###############################################################################
-
---source include/load_sysvars.inc
-
-########################################################################
-# START OF sql_notes TESTS #
-########################################################################
-
-
-##############################################################################
-# Saving initial value of sql_notes in a temporary variable #
-##############################################################################
-
-SET @session_start_value = @@session.sql_notes;
-SELECT @session_start_value;
-
-
---echo '#--------------------FN_DYNVARS_161_01------------------------#'
-######################################################################
-# Display the DEFAULT value of sql_notes #
-######################################################################
-
-SET @@session.sql_notes = 0;
-SET @@session.sql_notes = DEFAULT;
-SELECT @@session.sql_notes;
-
-SET @@session.sql_notes = 1;
-SET @@session.sql_notes = DEFAULT;
-SELECT @@session.sql_notes;
-
-
---echo '#---------------------FN_DYNVARS_161_02-------------------------#'
-###########################################################################
-# Check if sql_notes can be accessed with and without @@ sign #
-###########################################################################
-
-SET sql_notes = 1;
-SELECT @@sql_notes;
-
---Error ER_UNKNOWN_TABLE
-SELECT session.sql_notes;
-
---Error ER_UNKNOWN_TABLE
-SELECT local.sql_notes;
-
-SET session sql_notes = 0;
-SELECT @@session.sql_notes;
-
-
---echo '#--------------------FN_DYNVARS_161_03------------------------#'
-######################################################################
-# change the value of sql_notes to a valid value #
-######################################################################
-
-SET @@session.sql_notes = 0;
-SELECT @@session.sql_notes;
-SET @@session.sql_notes = 1;
-SELECT @@session.sql_notes;
-
-
---echo '#--------------------FN_DYNVARS_161_04-------------------------#'
-#########################################################################
-# Change the value of sql_notes to invalid value #
-#########################################################################
-
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.sql_notes = -1;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.sql_notes = 2;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.sql_notes = "T";
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.sql_notes = "Y";
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.sql_notes = TRÜE;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.sql_notes = ÕN;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.sql_notes = OF;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.sql_notes = ÓFF;
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.sql_notes = '¹';
---Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.sql_notes = NO;
-
-
---echo '#-------------------FN_DYNVARS_161_05----------------------------#'
-#########################################################################
-# Test if accessing global sql_notes gives error #
-#########################################################################
-
-SET @@global.sql_notes = 1-@@global.sql_notes;
-SELECT @@global.sql_notes;
-SET @@global.sql_notes = 1-@@global.sql_notes;
-SELECT @@global.sql_notes;
-
---echo '#----------------------FN_DYNVARS_161_06------------------------#'
-#########################################################################
-# Check if the value in GLOBAL Table contains variable value #
-#########################################################################
-
-SELECT count(VARIABLE_VALUE) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='sql_notes';
-
---echo '#----------------------FN_DYNVARS_161_07------------------------#'
-#########################################################################
-# Check if the value in GLOBAL Table matches value in variable #
-#########################################################################
-
-SELECT IF(@@session.sql_notes, "ON", "OFF") = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='sql_notes';
-SELECT @@session.sql_notes;
-SELECT VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='sql_notes';
-
---echo '#---------------------FN_DYNVARS_161_08-------------------------#'
-###################################################################
-# Check if ON and OFF values can be used on variable #
-###################################################################
-
-SET @@session.sql_notes = OFF;
-SELECT @@session.sql_notes;
-SET @@session.sql_notes = ON;
-SELECT @@session.sql_notes;
-
---echo '#---------------------FN_DYNVARS_161_09----------------------#'
-###################################################################
-# Check if TRUE and FALSE values can be used on variable #
-###################################################################
-
-SET @@session.sql_notes = TRUE;
-SELECT @@session.sql_notes;
-SET @@session.sql_notes = FALSE;
-SELECT @@session.sql_notes;
-
-##############################
-# Restore initial value #
-##############################
-
-SET @@session.sql_notes = @session_start_value;
-SELECT @@session.sql_notes;
-
-#############################################################
-# END OF sql_notes TESTS #
-#############################################################
-
diff --git a/mysql-test/suite/sys_vars/t/stored_program_cache_func.test b/mysql-test/suite/sys_vars/t/stored_program_cache_func.test
index 611c33b5..0a7340eb 100644
--- a/mysql-test/suite/sys_vars/t/stored_program_cache_func.test
+++ b/mysql-test/suite/sys_vars/t/stored_program_cache_func.test
@@ -33,9 +33,11 @@ create procedure pr(i int) begin
end |
--delimiter ;
call pr(1);
---error ER_BAD_FIELD_ERROR
+#--error ER_BAD_FIELD_ERROR
+# MDEV-5816 added support for recompilation of statements
+# inside a stored routine so the error ER_BAD_FIELD_ERROR is
+# no more expcted
call pr(2);
-drop table t1;
set global stored_program_cache=0;
call pr(1);
diff --git a/mysql-test/suite/sys_vars/t/thread_pool_idle_timeout_grant.test b/mysql-test/suite/sys_vars/t/thread_pool_idle_timeout_grant.test
index 8f5f2491..33b97ac6 100644
--- a/mysql-test/suite/sys_vars/t/thread_pool_idle_timeout_grant.test
+++ b/mysql-test/suite/sys_vars/t/thread_pool_idle_timeout_grant.test
@@ -8,11 +8,11 @@ SET @global=@@global.thread_pool_idle_timeout;
--echo # MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
--echo #
---echo # Test that "SET thread_pool_idle_timeout" is not allowed without CONNECTION ADMIN or SUPER
+--echo # Test that "SET thread_pool_idle_timeout" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -40,19 +40,4 @@ SET SESSION thread_pool_idle_timeout=10;
--connection default
DROP USER user1@localhost;
---echo # Test that "SET thread_pool_idle_timeout" is allowed with SUPER
-
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,)
---connection user1
-SET GLOBAL thread_pool_idle_timeout=10;
---error ER_GLOBAL_VARIABLE
-SET thread_pool_idle_timeout=10;
---error ER_GLOBAL_VARIABLE
-SET SESSION thread_pool_idle_timeout=10;
---disconnect user1
---connection default
-DROP USER user1@localhost;
-
SET @@global.thread_pool_idle_timeout=@global;
diff --git a/mysql-test/suite/sys_vars/t/thread_pool_max_threads_grant.test b/mysql-test/suite/sys_vars/t/thread_pool_max_threads_grant.test
index 299d5ff4..b77df149 100644
--- a/mysql-test/suite/sys_vars/t/thread_pool_max_threads_grant.test
+++ b/mysql-test/suite/sys_vars/t/thread_pool_max_threads_grant.test
@@ -8,11 +8,11 @@ SET @global=@@global.thread_pool_max_threads;
--echo # MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
--echo #
---echo # Test that "SET thread_pool_max_threads" is not allowed without CONNECTION ADMIN or SUPER
+--echo # Test that "SET thread_pool_max_threads" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -40,19 +40,4 @@ SET SESSION thread_pool_max_threads=10;
--connection default
DROP USER user1@localhost;
---echo # Test that "SET thread_pool_max_threads" is allowed with SUPER
-
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,)
---connection user1
-SET GLOBAL thread_pool_max_threads=10;
---error ER_GLOBAL_VARIABLE
-SET thread_pool_max_threads=10;
---error ER_GLOBAL_VARIABLE
-SET SESSION thread_pool_max_threads=10;
---disconnect user1
---connection default
-DROP USER user1@localhost;
-
SET @@global.thread_pool_max_threads=@global;
diff --git a/mysql-test/suite/sys_vars/t/thread_pool_oversubscribe_grant.test b/mysql-test/suite/sys_vars/t/thread_pool_oversubscribe_grant.test
index f3a96c69..3ff215ae 100644
--- a/mysql-test/suite/sys_vars/t/thread_pool_oversubscribe_grant.test
+++ b/mysql-test/suite/sys_vars/t/thread_pool_oversubscribe_grant.test
@@ -8,11 +8,11 @@ SET @global=@@global.thread_pool_oversubscribe;
--echo # MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
--echo #
---echo # Test that "SET thread_pool_oversubscribe" is not allowed without CONNECTION ADMIN or SUPER
+--echo # Test that "SET thread_pool_oversubscribe" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -40,19 +40,4 @@ SET SESSION thread_pool_oversubscribe=10;
--connection default
DROP USER user1@localhost;
---echo # Test that "SET thread_pool_oversubscribe" is allowed with SUPER
-
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,)
---connection user1
-SET GLOBAL thread_pool_oversubscribe=10;
---error ER_GLOBAL_VARIABLE
-SET thread_pool_oversubscribe=10;
---error ER_GLOBAL_VARIABLE
-SET SESSION thread_pool_oversubscribe=10;
---disconnect user1
---connection default
-DROP USER user1@localhost;
-
SET @@global.thread_pool_oversubscribe=@global;
diff --git a/mysql-test/suite/sys_vars/t/thread_pool_stall_limit_grant.test b/mysql-test/suite/sys_vars/t/thread_pool_stall_limit_grant.test
index ae0ed8a7..2c57fecd 100644
--- a/mysql-test/suite/sys_vars/t/thread_pool_stall_limit_grant.test
+++ b/mysql-test/suite/sys_vars/t/thread_pool_stall_limit_grant.test
@@ -8,11 +8,11 @@ SET @global=@@global.thread_pool_stall_limit;
--echo # MDEV-21961 Bind CONNECTION ADMIN to a number of global system variables
--echo #
---echo # Test that "SET thread_pool_stall_limit" is not allowed without CONNECTION ADMIN or SUPER
+--echo # Test that "SET thread_pool_stall_limit" is not allowed without CONNECTION ADMIN
CREATE USER user1@localhost;
GRANT ALL PRIVILEGES ON *.* TO user1@localhost;
-REVOKE CONNECTION ADMIN, SUPER ON *.* FROM user1@localhost;
+REVOKE CONNECTION ADMIN ON *.* FROM user1@localhost;
--connect(user1,localhost,user1,,)
--connection user1
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -40,19 +40,4 @@ SET SESSION thread_pool_stall_limit=400;
--connection default
DROP USER user1@localhost;
---echo # Test that "SET thread_pool_stall_limit" is allowed with SUPER
-
-CREATE USER user1@localhost;
-GRANT SUPER ON *.* TO user1@localhost;
---connect(user1,localhost,user1,,)
---connection user1
-SET GLOBAL thread_pool_stall_limit=400;
---error ER_GLOBAL_VARIABLE
-SET thread_pool_stall_limit=400;
---error ER_GLOBAL_VARIABLE
-SET SESSION thread_pool_stall_limit=400;
---disconnect user1
---connection default
-DROP USER user1@localhost;
-
SET @@global.thread_pool_stall_limit=@global;
diff --git a/mysql-test/suite/sys_vars/t/time_format_basic.test b/mysql-test/suite/sys_vars/t/time_format_basic.test
deleted file mode 100644
index ec737b8c..00000000
--- a/mysql-test/suite/sys_vars/t/time_format_basic.test
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# only global
-#
-select @@global.time_format;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-select @@session.time_format;
-show global variables like 'time_format';
-show session variables like 'time_format';
-select * from information_schema.global_variables where variable_name='time_format';
-select * from information_schema.session_variables where variable_name='time_format';
-
-#
-# show that it's read-only
-#
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set global time_format=1;
---error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set session time_format=1;
diff --git a/mysql-test/suite/sys_vars/t/tx_isolation_basic.test b/mysql-test/suite/sys_vars/t/transaction_isolation_basic.test
index 5b484cb9..3f0e8361 100644
--- a/mysql-test/suite/sys_vars/t/tx_isolation_basic.test
+++ b/mysql-test/suite/sys_vars/t/transaction_isolation_basic.test
@@ -1,6 +1,6 @@
-################# mysql-test\t\tx_isolation_basic.test ########################
+######## mysql-test\suite\sys_vars\t\transaction_isolation_basic.test #########
# #
-# Variable Name: tx_isolation #
+# Variable Name: transaction_isolation #
# Scope: GLOBAL | SESSION #
# Access Type: Dynamic #
# Data Type: enumeration #
@@ -11,7 +11,7 @@
# Creation Date: 2008-02-07 #
# Author: Rizwan #
# #
-# Description: Test Cases of Dynamic System Variable tx_isolation #
+# Description: Test Cases of Dynamic System Variable transaction_isolation #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
@@ -26,31 +26,31 @@
--source include/load_sysvars.inc
########################################################################
-# START OF tx_isolation TESTS #
+# START OF transaction_isolation TESTS #
########################################################################
#########################################################################
-# Saving initial value of tx_isolation in a temporary variable #
+# Saving initial value of transaction_isolation in a temporary variable #
#########################################################################
-SET @global_start_value = @@global.tx_isolation;
+SET @global_start_value = @@global.transaction_isolation;
SELECT @global_start_value;
-SET @session_start_value = @@session.tx_isolation;
+SET @session_start_value = @@session.transaction_isolation;
SELECT @session_start_value;
--echo '#--------------------FN_DYNVARS_183_01------------------------#'
####################################################################
-# Display the DEFAULT value of tx_isolation #
+# Display the DEFAULT value of transaction_isolation #
####################################################################
-SET @@global.tx_isolation = 'READ-UNCOMMITTED';
-SET @@global.tx_isolation = DEFAULT;
-SELECT @@global.tx_isolation;
+SET @@global.transaction_isolation = 'READ-UNCOMMITTED';
+SET @@global.transaction_isolation = DEFAULT;
+SELECT @@global.transaction_isolation;
-SET @@session.tx_isolation = DEFAULT;
-SELECT @@session.tx_isolation;
+SET @@session.transaction_isolation = DEFAULT;
+SELECT @@session.transaction_isolation;
--echo '#---------------------FN_DYNVARS_183_02-------------------------#'
#########################################################
@@ -58,97 +58,97 @@ SELECT @@session.tx_isolation;
#########################################################
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.tx_isolation = NULL;
+SET @@global.transaction_isolation = NULL;
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.tx_isolation = '';
+SET @@global.transaction_isolation = '';
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.tx_isolation = NULL;
+SET @@session.transaction_isolation = NULL;
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.tx_isolation = '';
+SET @@session.transaction_isolation = '';
--echo '#--------------------FN_DYNVARS_183_03------------------------#'
#####################################################################
-# Change the value of tx_isolation to a valid value #
+# Change the value of transaction_isolation to a valid value #
#####################################################################
-SET @@global.tx_isolation = 'READ-UNCOMMITTED';
-SELECT @@global.tx_isolation;
+SET @@global.transaction_isolation = 'READ-UNCOMMITTED';
+SELECT @@global.transaction_isolation;
-SET @@global.tx_isolation = 'read-COMMITTED';
-SELECT @@global.tx_isolation;
+SET @@global.transaction_isolation = 'read-COMMITTED';
+SELECT @@global.transaction_isolation;
-SET @@global.tx_isolation = 'REPEATABLE-READ';
-SELECT @@global.tx_isolation;
+SET @@global.transaction_isolation = 'REPEATABLE-READ';
+SELECT @@global.transaction_isolation;
-SET @@global.tx_isolation = 'SERIALIZable';
-SELECT @@global.tx_isolation;
+SET @@global.transaction_isolation = 'SERIALIZable';
+SELECT @@global.transaction_isolation;
-SET @@session.tx_isolation = 'READ-UNCOMMITTED';
-SELECT @@session.tx_isolation;
+SET @@session.transaction_isolation = 'READ-UNCOMMITTED';
+SELECT @@session.transaction_isolation;
-SET @@session.tx_isolation = 'READ-COMMITTED';
-SELECT @@session.tx_isolation;
+SET @@session.transaction_isolation = 'READ-COMMITTED';
+SELECT @@session.transaction_isolation;
-SET @@session.tx_isolation = 'REPEATABLE-READ';
-SELECT @@session.tx_isolation;
+SET @@session.transaction_isolation = 'REPEATABLE-READ';
+SELECT @@session.transaction_isolation;
-SET @@session.tx_isolation = 'serializable';
-SELECT @@session.tx_isolation;
+SET @@session.transaction_isolation = 'serializable';
+SELECT @@session.transaction_isolation;
--echo '#--------------------FN_DYNVARS_183_04-------------------------#'
#######################################################################
-# Change the value of tx_isolation to invalid value #
+# Change the value of transaction_isolation to invalid value #
#######################################################################
# for global scope
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.tx_isolation = -1;
+SET @@global.transaction_isolation = -1;
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.tx_isolation = READUNCOMMITTED;
+SET @@global.transaction_isolation = READUNCOMMITTED;
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.tx_isolation = 'REPEATABLE';
+SET @@global.transaction_isolation = 'REPEATABLE';
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.tx_isolation = OFF;
+SET @@global.transaction_isolation = OFF;
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.tx_isolation = ON;
+SET @@global.transaction_isolation = ON;
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.tx_isolation = 'NON-SERIALIZABLE';
+SET @@global.transaction_isolation = 'NON-SERIALIZABLE';
# for session scope
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@tx_isolation = -1;
+SET @@transaction_isolation = -1;
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@tx_isolation = READUNCOMMITTED;
+SET @@transaction_isolation = READUNCOMMITTED;
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@tx_isolation = 'REPEATABLE';
+SET @@transaction_isolation = 'REPEATABLE';
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@tx_isolation = 'NONE';
+SET @@transaction_isolation = 'NONE';
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@tx_isolation = 'ALL';
+SET @@transaction_isolation = 'ALL';
--echo '#-------------------FN_DYNVARS_183_05----------------------------#'
#########################################################################
# Check if the value in session Table matches value in variable #
#########################################################################
-SELECT @@session.tx_isolation = VARIABLE_VALUE
+SELECT @@session.transaction_isolation = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='tx_isolation';
+WHERE VARIABLE_NAME='transaction_isolation';
--echo '#----------------------FN_DYNVARS_183_06------------------------#'
#########################################################################
# Check if the value in GLOBAL Table matches value in variable #
#########################################################################
-SELECT @@global.tx_isolation = VARIABLE_VALUE
+SELECT @@global.transaction_isolation = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='tx_isolation';
+WHERE VARIABLE_NAME='transaction_isolation';
--echo '#---------------------FN_DYNVARS_183_07-------------------------#'
@@ -157,56 +157,56 @@ WHERE VARIABLE_NAME='tx_isolation';
###################################################################
# test if variable accepts 0,1,2
-SET @@global.tx_isolation = 0;
-SELECT @@global.tx_isolation;
+SET @@global.transaction_isolation = 0;
+SELECT @@global.transaction_isolation;
-SET @@global.tx_isolation = 1;
-SELECT @@global.tx_isolation;
+SET @@global.transaction_isolation = 1;
+SELECT @@global.transaction_isolation;
-SET @@global.tx_isolation = 2;
-SELECT @@global.tx_isolation;
+SET @@global.transaction_isolation = 2;
+SELECT @@global.transaction_isolation;
-SET @@global.tx_isolation = 3;
-SELECT @@global.tx_isolation;
+SET @@global.transaction_isolation = 3;
+SELECT @@global.transaction_isolation;
--Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.tx_isolation = 0.4;
+SET @@global.transaction_isolation = 0.4;
--echo '#---------------------FN_DYNVARS_183_08----------------------#'
###################################################################
# Check if TRUE and FALSE values can be used on variable #
###################################################################
-SET @@global.tx_isolation = TRUE;
-SELECT @@global.tx_isolation;
-SET @@global.tx_isolation = FALSE;
-SELECT @@global.tx_isolation;
+SET @@global.transaction_isolation = TRUE;
+SELECT @@global.transaction_isolation;
+SET @@global.transaction_isolation = FALSE;
+SELECT @@global.transaction_isolation;
--echo '#---------------------FN_DYNVARS_183_09----------------------#'
-########################################################################
-# Check if tx_isolation can be accessed with and without @@ sign #
-########################################################################
+###########################################################################
+# Check if transaction_isolation can be accessed with and without @@ sign #
+###########################################################################
-SET tx_isolation = 'REPEATABLE-READ';
+SET transaction_isolation = 'REPEATABLE-READ';
#using SET SESSION|GLOBAL syntax
-SET session tx_isolation = 'REPEATABLE-READ';
-SELECT @@tx_isolation;
+SET session transaction_isolation = 'REPEATABLE-READ';
+SELECT @@transaction_isolation;
-SET global tx_isolation = 'REPEATABLE-READ';
-SELECT @@global.tx_isolation;
+SET global transaction_isolation = 'REPEATABLE-READ';
+SELECT @@global.transaction_isolation;
##############################
# Restore initial value #
##############################
-SET @@global.tx_isolation = @global_start_value;
-SELECT @@global.tx_isolation;
+SET @@global.transaction_isolation = @global_start_value;
+SELECT @@global.transaction_isolation;
-SET @@session.tx_isolation = @session_start_value;
-SELECT @@session.tx_isolation;
+SET @@session.transaction_isolation = @session_start_value;
+SELECT @@session.transaction_isolation;
####################################################################
-# END OF tx_isolation TESTS #
+# END OF transaction_isolation TESTS #
####################################################################
diff --git a/mysql-test/suite/sys_vars/t/tx_isolation_func-master.opt b/mysql-test/suite/sys_vars/t/transaction_isolation_func-master.opt
index 67166a46..67166a46 100644
--- a/mysql-test/suite/sys_vars/t/tx_isolation_func-master.opt
+++ b/mysql-test/suite/sys_vars/t/transaction_isolation_func-master.opt
diff --git a/mysql-test/suite/sys_vars/t/tx_isolation_func.test b/mysql-test/suite/sys_vars/t/transaction_isolation_func.test
index 164422be..085d59cb 100644
--- a/mysql-test/suite/sys_vars/t/tx_isolation_func.test
+++ b/mysql-test/suite/sys_vars/t/transaction_isolation_func.test
@@ -1,6 +1,6 @@
-############# mysql-test\t\tx_isolation_func.test #######################################
+############## mysql-test\suite\sys_vars\t\transaction_isolation_func.test ##############
# #
-# Variable Name: tx_isolation #
+# Variable Name: transaction_isolation #
# Scope: GLOBAL & SESSION #
# Access Type: Dynamic #
# Data Type: ENUMERATION #
@@ -11,7 +11,7 @@
# Creation Date: 2008-02-25 #
# Author: Sharique Abdullah #
# #
-# Description: Test Cases of Dynamic System Variable "tx_isolation" #
+# Description: Test Cases of Dynamic System Variable "transaction_isolation" #
# that checks behavior of this variable in the following ways #
# * Functionality based on different values #
# #
@@ -26,8 +26,8 @@
# Setup
#
-SET @session_tx_isolation = @@SESSION.tx_isolation;
-SET @global_tx_isolation = @@GLOBAL.tx_isolation;
+SET @session_transaction_isolation = @@SESSION.transaction_isolation;
+SET @global_transaction_isolation = @@GLOBAL.transaction_isolation;
#
# Creating connections
@@ -68,11 +68,11 @@ INSERT INTO t1 VALUES(24, 24);
# Testing for value READ-UNCOMMITTED
#
connection con0;
-SET SESSION tx_isolation = 'READ-UNCOMMITTED';
+SET SESSION transaction_isolation = 'READ-UNCOMMITTED';
set binlog_format=mixed;
connection con1;
-SET SESSION tx_isolation = 'READ-UNCOMMITTED';
+SET SESSION transaction_isolation = 'READ-UNCOMMITTED';
set binlog_format=mixed;
#
@@ -139,10 +139,10 @@ COMMIT;
# Testing for value READ-COMMITTED
#
connection con0;
-SET SESSION tx_isolation = 'READ-COMMITTED';
+SET SESSION transaction_isolation = 'READ-COMMITTED';
connection con1;
-SET SESSION tx_isolation = 'READ-COMMITTED';
+SET SESSION transaction_isolation = 'READ-COMMITTED';
#
# Testing WHERE on keys using % on even rows
@@ -177,10 +177,10 @@ COMMIT;
# Testing for value REPEATABLE-READ
#
connection con0;
-SET SESSION tx_isolation = 'REPEATABLE-READ';
+SET SESSION transaction_isolation = 'REPEATABLE-READ';
connection con1;
-SET SESSION tx_isolation = 'REPEATABLE-READ';
+SET SESSION transaction_isolation = 'REPEATABLE-READ';
#
# Testing WHERE on keys using % on even rows
@@ -279,10 +279,10 @@ COMMIT;
# Testing for value SERIALIZABLE
#
connection con0;
-SET SESSION tx_isolation = 'SERIALIZABLE';
+SET SESSION transaction_isolation = 'SERIALIZABLE';
connection con1;
-SET SESSION tx_isolation = 'SERIALIZABLE';
+SET SESSION transaction_isolation = 'SERIALIZABLE';
#
# Testing WHERE on keys using # on even rows
@@ -321,33 +321,33 @@ COMMIT;
# Session data integrity check & GLOBAL Value check
#
-SET GLOBAL tx_isolation = 'READ-UNCOMMITTED';
+SET GLOBAL transaction_isolation = 'READ-UNCOMMITTED';
connect (con_int1,localhost,root,,);
connection con_int1;
-SELECT @@SESSION.tx_isolation;
+SELECT @@SESSION.transaction_isolation;
--echo READ-UNCOMMITTED Expected
-SET SESSION tx_isolation = 'SERIALIZABLE';
+SET SESSION transaction_isolation = 'SERIALIZABLE';
connect (con_int2,localhost,root,,);
connection con_int2;
-SELECT @@SESSION.tx_isolation;
+SELECT @@SESSION.transaction_isolation;
--echo READ-UNCOMMITTED Expected
-SET SESSION tx_isolation = 'REPEATABLE-READ';
+SET SESSION transaction_isolation = 'REPEATABLE-READ';
connection con_int2;
-SELECT @@SESSION.tx_isolation;
+SELECT @@SESSION.transaction_isolation;
--echo REPEATABLE-READ Expected
connection con_int1;
-SELECT @@SESSION.tx_isolation;
+SELECT @@SESSION.transaction_isolation;
--echo SERIALIZABLE Expected
-SELECT @@GLOBAL.tx_isolation;
+SELECT @@GLOBAL.transaction_isolation;
--echo READ-UNCOMMITTED Expected
connection default;
@@ -359,8 +359,8 @@ disconnect con_int2;
# Cleanup
#
-SET @@SESSION.tx_isolation = @session_tx_isolation;
-SET @@GLOBAL.tx_isolation = @global_tx_isolation;
+SET @@SESSION.transaction_isolation = @session_transaction_isolation;
+SET @@GLOBAL.transaction_isolation = @global_transaction_isolation;
connection default;
disconnect con0;
diff --git a/mysql-test/suite/sys_vars/t/tx_read_only_basic.test b/mysql-test/suite/sys_vars/t/transaction_read_only_basic.test
index 0ebfcc31..ba8d65a5 100644
--- a/mysql-test/suite/sys_vars/t/tx_read_only_basic.test
+++ b/mysql-test/suite/sys_vars/t/transaction_read_only_basic.test
@@ -1,6 +1,6 @@
-############## mysql-test\t\tx_read_only_basic.test ###########################
+######## mysql-test\suite\sys_vars\t\transaction_read_only_basic.test #########
# #
-# Variable Name: tx_read_only #
+# Variable Name: transaction_read_only #
# Scope: GLOBAL & SESSION #
# Access Type: Dynamic #
# Data Type: boolean #
@@ -11,7 +11,7 @@
# Creation Date: 2012-01-12 #
# Author: joh #
# #
-# Description: Test Cases of Dynamic System Variable tx_read_only #
+# Description: Test Cases of Dynamic System Variable transaction_read_only #
# that checks the behavior of this variable in the following ways#
# * Default Value #
# * Valid & Invalid values #
@@ -26,7 +26,7 @@
--source include/load_sysvars.inc
--echo ####################################################################
---echo # START OF tx_read_only TESTS #
+--echo # START OF transaction_read_only TESTS #
--echo ####################################################################
@@ -34,101 +34,101 @@
--echo # Save initial value #
--echo #############################################################
-SET @start_global_value = @@global.tx_read_only;
+SET @start_global_value = @@global.transaction_read_only;
SELECT @start_global_value;
-SET @start_session_value = @@session.tx_read_only;
+SET @start_session_value = @@session.transaction_read_only;
SELECT @start_session_value;
--echo ########################################################################
---echo # Display the DEFAULT value of tx_read_only #
+--echo # Display the DEFAULT value of transaction_read_only #
--echo ########################################################################
-SET @@global.tx_read_only = ON;
-SET @@global.tx_read_only = DEFAULT;
-SELECT @@global.tx_read_only;
+SET @@global.transaction_read_only = ON;
+SET @@global.transaction_read_only = DEFAULT;
+SELECT @@global.transaction_read_only;
-SET @@session.tx_read_only = ON;
-SET @@session.tx_read_only = DEFAULT;
-SELECT @@session.tx_read_only;
+SET @@session.transaction_read_only = ON;
+SET @@session.transaction_read_only = DEFAULT;
+SELECT @@session.transaction_read_only;
---echo ##############################################################################
---echo # Change the value of tx_read_only to a valid value for GLOBAL Scope #
---echo ##############################################################################
+--echo ###############################################################################
+--echo # Change the value of transaction_read_only to a valid value for GLOBAL Scope #
+--echo ###############################################################################
-SET @@global.tx_read_only = ON;
-SELECT @@global.tx_read_only;
-SET @@global.tx_read_only = OFF;
-SELECT @@global.tx_read_only;
-SET @@global.tx_read_only = 0;
-SELECT @@global.tx_read_only;
-SET @@global.tx_read_only = 1;
-SELECT @@global.tx_read_only;
-SET @@global.tx_read_only = TRUE;
-SELECT @@global.tx_read_only;
-SET @@global.tx_read_only = FALSE;
-SELECT @@global.tx_read_only;
+SET @@global.transaction_read_only = ON;
+SELECT @@global.transaction_read_only;
+SET @@global.transaction_read_only = OFF;
+SELECT @@global.transaction_read_only;
+SET @@global.transaction_read_only = 0;
+SELECT @@global.transaction_read_only;
+SET @@global.transaction_read_only = 1;
+SELECT @@global.transaction_read_only;
+SET @@global.transaction_read_only = TRUE;
+SELECT @@global.transaction_read_only;
+SET @@global.transaction_read_only = FALSE;
+SELECT @@global.transaction_read_only;
---echo ###############################################################################
---echo # Change the value of tx_read_only to a valid value for SESSION Scope #
---echo ###############################################################################
+--echo ################################################################################
+--echo # Change the value of transaction_read_only to a valid value for SESSION Scope #
+--echo ################################################################################
-SET @@session.tx_read_only = ON;
-SELECT @@session.tx_read_only;
-SET @@session.tx_read_only = OFF;
-SELECT @@session.tx_read_only;
-SET @@session.tx_read_only = 0;
-SELECT @@session.tx_read_only;
-SET @@session.tx_read_only = 1;
-SELECT @@session.tx_read_only;
-SET @@session.tx_read_only = TRUE;
-SELECT @@session.tx_read_only;
-SET @@session.tx_read_only = FALSE;
-SELECT @@session.tx_read_only;
-
-
---echo ################################################################
---echo # Change the value of tx_read_only to an invalid value #
---echo ################################################################
+SET @@session.transaction_read_only = ON;
+SELECT @@session.transaction_read_only;
+SET @@session.transaction_read_only = OFF;
+SELECT @@session.transaction_read_only;
+SET @@session.transaction_read_only = 0;
+SELECT @@session.transaction_read_only;
+SET @@session.transaction_read_only = 1;
+SELECT @@session.transaction_read_only;
+SET @@session.transaction_read_only = TRUE;
+SELECT @@session.transaction_read_only;
+SET @@session.transaction_read_only = FALSE;
+SELECT @@session.transaction_read_only;
+
+
+--echo #################################################################
+--echo # Change the value of transaction_read_only to an invalid value #
+--echo #################################################################
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.tx_read_only = 'ONN';
+SET @@global.transaction_read_only = 'ONN';
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.tx_read_only = "OFFF";
+SET @@global.transaction_read_only = "OFFF";
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.tx_read_only = TTRUE;
+SET @@global.transaction_read_only = TTRUE;
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.tx_read_only = FELSE;
+SET @@global.transaction_read_only = FELSE;
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.tx_read_only = -1024;
+SET @@global.transaction_read_only = -1024;
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.tx_read_only = 65536;
+SET @@global.transaction_read_only = 65536;
--Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.tx_read_only = 65530.34;
+SET @@global.transaction_read_only = 65530.34;
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@global.tx_read_only = test;
+SET @@global.transaction_read_only = test;
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.tx_read_only = ONN;
+SET @@session.transaction_read_only = ONN;
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.tx_read_only = ONF;
+SET @@session.transaction_read_only = ONF;
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.tx_read_only = OF;
+SET @@session.transaction_read_only = OF;
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.tx_read_only = 'OFN';
+SET @@session.transaction_read_only = 'OFN';
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.tx_read_only = -2;
+SET @@session.transaction_read_only = -2;
--Error ER_WRONG_TYPE_FOR_VAR
-SET @@session.tx_read_only = 65530.34;
+SET @@session.transaction_read_only = 65530.34;
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.tx_read_only = 65550;
+SET @@session.transaction_read_only = 65550;
--Error ER_WRONG_VALUE_FOR_VAR
-SET @@session.tx_read_only = test;
-SELECT @@session.tx_read_only;
+SET @@session.transaction_read_only = test;
+SELECT @@session.transaction_read_only;
--echo ####################################################################
@@ -136,26 +136,26 @@ SELECT @@session.tx_read_only;
--echo ####################################################################
-SELECT IF(@@global.tx_read_only, "ON", "OFF") = VARIABLE_VALUE
+SELECT IF(@@global.transaction_read_only, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='tx_read_only';
+WHERE VARIABLE_NAME='transaction_read_only';
--echo ####################################################################
--echo # Check if the value in SESSION Table matches value in variable #
--echo ####################################################################
-SELECT IF(@@session.tx_read_only, "ON", "OFF") = VARIABLE_VALUE
+SELECT IF(@@session.transaction_read_only, "ON", "OFF") = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='tx_read_only';
+WHERE VARIABLE_NAME='transaction_read_only';
--echo ###############################################################################
--echo # Check if accessing variable with and without GLOBAL point to same variable #
--echo ###############################################################################
-SET @@tx_read_only = OFF;
-SET @@global.tx_read_only = ON;
-SELECT @@tx_read_only = @@global.tx_read_only;
+SET @@transaction_read_only = OFF;
+SET @@global.transaction_read_only = ON;
+SELECT @@transaction_read_only = @@global.transaction_read_only;
--echo ##############################################################################
@@ -163,37 +163,37 @@ SELECT @@tx_read_only = @@global.tx_read_only;
--echo # to same session variable #
--echo ##############################################################################
-SET @@tx_read_only = ON;
-SELECT @@tx_read_only = @@local.tx_read_only;
-SELECT @@local.tx_read_only = @@session.tx_read_only;
+SET @@transaction_read_only = ON;
+SELECT @@transaction_read_only = @@local.transaction_read_only;
+SELECT @@local.transaction_read_only = @@session.transaction_read_only;
--echo ###############################################################################
---echo # Check if tx_read_only can be accessed with and without @@ sign #
+--echo # Check if transaction_read_only can be accessed with and without @@ sign #
--echo ###############################################################################
--echo # @@session is synonym for SESSION
-SET @@session.tx_read_only= 0;
+SET @@session.transaction_read_only= 0;
--echo # Without modifier, SET changes session variable
-SET tx_read_only = 1;
-SELECT @@tx_read_only;
+SET transaction_read_only = 1;
+SELECT @@transaction_read_only;
--echo # name1.name2 refers to database_name.table_name
--Error ER_UNKNOWN_TABLE
-SELECT session.tx_read_only;
+SELECT session.transaction_read_only;
--echo ####################################
--echo # Restore initial value #
--echo ####################################
-SET @@global.tx_read_only = @start_global_value;
-SELECT @@global.tx_read_only;
-SET @@session.tx_read_only = @start_session_value;
-SELECT @@session.tx_read_only;
+SET @@global.transaction_read_only = @start_global_value;
+SELECT @@global.transaction_read_only;
+SET @@session.transaction_read_only = @start_session_value;
+SELECT @@session.transaction_read_only;
--echo #########################################################
---echo # END OF tx_read_only TESTS #
+--echo # END OF transaction_read_only TESTS #
--echo #########################################################
diff --git a/mysql-test/suite/sys_vars/t/tx_compatibility-master.opt b/mysql-test/suite/sys_vars/t/tx_compatibility-master.opt
new file mode 100644
index 00000000..f22a5ebb
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/tx_compatibility-master.opt
@@ -0,0 +1,2 @@
+--transaction-isolation=SERIALIZABLE
+--transaction-read-only
diff --git a/mysql-test/suite/sys_vars/t/tx_compatibility.test b/mysql-test/suite/sys_vars/t/tx_compatibility.test
new file mode 100644
index 00000000..2521c366
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/tx_compatibility.test
@@ -0,0 +1,68 @@
+--echo #
+--echo # MDEV-21921 Make transaction_isolation and transaction_read_only into
+--echo # system variables
+--echo #
+
+SET @saved_global_isolation= @@global.transaction_isolation;
+SET @saved_global_read_only= @@global.transaction_read_only;
+
+--echo # Case 1: Check the influence of --transaction_* on
+--echo # @@session.transaction_* and @@global.transaction_*,
+--echo # @@session.tx_*, @@global.tx_*.
+
+SELECT @@session.transaction_isolation, @@global.transaction_isolation,
+ @@session.tx_isolation, @@global.tx_isolation;
+SHOW GLOBAL VARIABLES LIKE '%_isolation';
+SHOW SESSION VARIABLES LIKE '%_isolation';
+
+SELECT @@session.transaction_read_only, @@global.transaction_read_only,
+ @@session.tx_read_only, @@global.tx_read_only;
+SHOW GLOBAL VARIABLES LIKE '%_read_only';
+SHOW SESSION VARIABLES LIKE '%_read_only';
+
+--echo # Case 2: Check that the change to tx_* is reflected to transaction_*.
+
+SET tx_isolation= 'REPEATABLE-READ';
+SET @@global.tx_isolation= 'SERIALIZABLE';
+SELECT @@session.tx_isolation, @@global.tx_isolation,
+@@session.transaction_isolation, @@global.transaction_isolation;
+SHOW GLOBAL VARIABLES LIKE '%_isolation';
+SHOW SESSION VARIABLES LIKE '%_isolation';
+
+SET STATEMENT tx_isolation= 'SERIALIZABLE' FOR SHOW SESSION VARIABLES LIKE '%_isolation';
+SHOW SESSION VARIABLES LIKE '%_isolation';
+
+SET tx_read_only= OFF;
+SET @@global.tx_read_only= ON;
+SELECT @@session.tx_read_only, @@global.tx_read_only,
+@@session.transaction_read_only, @@global.transaction_read_only;
+SHOW GLOBAL VARIABLES LIKE '%_read_only';
+SHOW SESSION VARIABLES LIKE '%_read_only';
+
+SET STATEMENT tx_read_only= ON FOR SHOW SESSION VARIABLES LIKE '%_read_only';
+SHOW SESSION VARIABLES LIKE '%_read_only';
+
+--echo # Case 3: Check that the change to transaction_* is reflected to tx_*.
+
+SET transaction_isolation= 'SERIALIZABLE';
+SET @@global.transaction_isolation= 'REPEATABLE-READ';
+SELECT @@session.tx_isolation, @@global.tx_isolation,
+@@session.transaction_isolation, @@global.transaction_isolation;
+SHOW GLOBAL VARIABLES LIKE '%_isolation';
+SHOW SESSION VARIABLES LIKE '%_isolation';
+
+SET STATEMENT transaction_isolation= 'REPEATABLE-READ' FOR SHOW SESSION VARIABLES LIKE '%_isolation';
+SHOW SESSION VARIABLES LIKE '%_isolation';
+
+SET transaction_read_only= ON;
+SET @@global.transaction_read_only= OFF;
+SELECT @@session.tx_read_only, @@global.tx_read_only,
+@@session.transaction_read_only, @@global.transaction_read_only;
+SHOW GLOBAL VARIABLES LIKE '%_read_only';
+SHOW SESSION VARIABLES LIKE '%_read_only';
+
+SET STATEMENT transaction_read_only= OFF FOR SHOW SESSION VARIABLES LIKE '%_read_only';
+SHOW SESSION VARIABLES LIKE '%_read_only';
+
+SET @@global.transaction_isolation= @saved_global_isolation;
+SET @@global.transaction_read_only= @saved_global_read_only;
diff --git a/mysql-test/suite/sys_vars/t/version.test b/mysql-test/suite/sys_vars/t/version.test
index 35067a43..43c9d9ae 100644
--- a/mysql-test/suite/sys_vars/t/version.test
+++ b/mysql-test/suite/sys_vars/t/version.test
@@ -1,6 +1,6 @@
SELECT @@version;
perl;
- $cnt= $ENV{MYSQL_TEST} =~ /mysqltest_embedded / ? 1 :
+ $cnt= $ENV{MYSQL_TEST} =~ /embedded / ? 1 :
grep /my_favorite_version/, `$ENV{MYSQL} -e status`;
print "$cnt\n";
EOF
diff --git a/mysql-test/suite/sys_vars/t/wsrep_causal_reads_basic.test b/mysql-test/suite/sys_vars/t/wsrep_causal_reads_basic.test
deleted file mode 100644
index 6539e5cb..00000000
--- a/mysql-test/suite/sys_vars/t/wsrep_causal_reads_basic.test
+++ /dev/null
@@ -1,45 +0,0 @@
---source include/have_wsrep.inc
-
---echo #
---echo # wsrep_causal_reads
---echo #
-
---echo # save the initial values
-SET @wsrep_causal_reads_global_saved = @@global.wsrep_causal_reads;
-SET @wsrep_causal_reads_session_saved = @@session.wsrep_causal_reads;
-
---echo # default
-SELECT @@global.wsrep_causal_reads;
-SELECT @@session.wsrep_causal_reads;
-
---echo
---echo # scope and valid values
-SET @@global.wsrep_causal_reads=OFF;
-SELECT @@global.wsrep_causal_reads;
-SET @@global.wsrep_causal_reads=ON;
-SELECT @@global.wsrep_causal_reads;
-
-SET @@session.wsrep_causal_reads=OFF;
-SELECT @@session.wsrep_causal_reads;
-SET @@session.wsrep_causal_reads=ON;
-SELECT @@session.wsrep_causal_reads;
-SET @@session.wsrep_causal_reads=default;
-SELECT @@session.wsrep_causal_reads;
-
---echo
---echo # invalid values
---error ER_WRONG_VALUE_FOR_VAR
-SET @@global.wsrep_causal_reads=NULL;
---error ER_WRONG_VALUE_FOR_VAR
-SET @@global.wsrep_causal_reads='junk';
---error ER_WRONG_VALUE_FOR_VAR
-SET @@session.wsrep_causal_reads=NULL;
---error ER_WRONG_VALUE_FOR_VAR
-SET @@session.wsrep_causal_reads='junk';
-
---echo
---echo # restore the initial values
-SET @@global.wsrep_causal_reads = @wsrep_causal_reads_global_saved;
-SET @@session.wsrep_causal_reads = @wsrep_causal_reads_session_saved;
-
---echo # End of test
diff --git a/mysql-test/suite/sysschema/r/all_sys_objects_exist.result b/mysql-test/suite/sysschema/r/all_sys_objects_exist.result
index 6dddd8a1..81ff6b21 100644
--- a/mysql-test/suite/sysschema/r/all_sys_objects_exist.result
+++ b/mysql-test/suite/sysschema/r/all_sys_objects_exist.result
@@ -22,6 +22,7 @@ memory_by_user_by_current_bytes
memory_global_by_current_bytes
memory_global_total
metrics
+privileges_by_table_by_level
processlist
ps_check_lost_instrumentation
schema_auto_increment_columns
@@ -129,6 +130,9 @@ version_patch FUNCTION
create_synonym_db PROCEDURE
diagnostics PROCEDURE
execute_prepared_stmt PROCEDURE
+optimizer_switch_choice PROCEDURE
+optimizer_switch_off PROCEDURE
+optimizer_switch_on PROCEDURE
ps_setup_disable_background_threads PROCEDURE
ps_setup_disable_consumer PROCEDURE
ps_setup_disable_instrument PROCEDURE
@@ -156,4 +160,4 @@ SELECT TRIGGER_NAME FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_SCHEMA = 'sys
TRIGGER_NAME
SELECT sys_version FROM sys.version;
sys_version
-1.5.1
+1.5.2
diff --git a/mysql-test/suite/sysschema/r/optimizer_switch.result b/mysql-test/suite/sysschema/r/optimizer_switch.result
new file mode 100644
index 00000000..6336051d
--- /dev/null
+++ b/mysql-test/suite/sysschema/r/optimizer_switch.result
@@ -0,0 +1,42 @@
+call sys.optimizer_switch_on();
+option opt
+condition_pushdown_for_derived on
+condition_pushdown_for_subquery on
+condition_pushdown_from_having on
+derived_merge on
+derived_with_keys on
+exists_to_in on
+extended_keys on
+firstmatch on
+hash_join_cardinality on
+index_condition_pushdown on
+index_merge on
+index_merge_intersection on
+index_merge_sort_union on
+index_merge_union on
+in_to_exists on
+join_cache_bka on
+join_cache_hashed on
+join_cache_incremental on
+loosescan on
+materialization on
+optimize_join_buffer_size on
+orderby_uses_equalities on
+outer_join_with_cache on
+partial_match_rowid_merge on
+partial_match_table_scan on
+rowid_filter on
+sargable_casefold on
+semijoin on
+semijoin_with_cache on
+split_materialized on
+subquery_cache on
+table_elimination on
+call sys.optimizer_switch_off();
+option opt
+cset_narrowing off
+index_merge_sort_intersection off
+mrr off
+mrr_cost_based off
+mrr_sort_keys off
+not_null_range_scan off
diff --git a/mysql-test/suite/sysschema/r/pr_create_synonym_db.result b/mysql-test/suite/sysschema/r/pr_create_synonym_db.result
index 8c0e8dfa..d23d3bad 100644
--- a/mysql-test/suite/sysschema/r/pr_create_synonym_db.result
+++ b/mysql-test/suite/sysschema/r/pr_create_synonym_db.result
@@ -61,6 +61,37 @@ create table t (b int);
create table b(a int);
create temporary table b (a int);
call sys.create_synonym_db('db','db_copy');
-ERROR HY000: Table`db`.`b`shadows base table. View cannot be created! Terminating!
+summary
+Created 2 views in the `db_copy` database
+use db_copy;
+show tables;
+Tables_in_db_copy
+a
+t
drop database db;
drop database db_copy;
+# MDEV-28343: sys.create_synonym_db fails with ER_VIEW_SELECT_TMPTABLE
+# when schema contains temporary tables
+#
+create database mytestdb;
+use mytestdb;
+create table t (b int);
+create temporary table tmp (a int);
+call sys.create_synonym_db('mytestdb','db_syn1');
+summary
+Created 1 view in the `db_syn1` database
+use db_syn1;
+show tables;
+Tables_in_db_syn1
+t
+drop database db_syn1;
+use mytestdb;
+create temporary table t (b int);
+call sys.create_synonym_db('mytestdb','db_syn1');
+summary
+Created 0 views in the `db_syn1` database
+use db_syn1;
+show tables;
+Tables_in_db_syn1
+drop database mytestdb;
+drop database db_syn1;
diff --git a/mysql-test/suite/sysschema/r/pr_diagnostics.result b/mysql-test/suite/sysschema/r/pr_diagnostics.result
index d07295bd..390cf5c0 100644
--- a/mysql-test/suite/sysschema/r/pr_diagnostics.result
+++ b/mysql-test/suite/sysschema/r/pr_diagnostics.result
@@ -1,8 +1,8 @@
-SET @sys.debug = 'ON',
+SET @sys.debug_dbug = 'ON',
@sys.diagnostics.allow_i_s_tables = 'ON',
@sys.diagnostics.include_raw = 'ON';
CALL sys.diagnostics(4, 2, 'full');
-SET @sys.debug = 'OFF',
+SET @sys.debug_dbug = 'OFF',
@sys.diagnostics.allow_i_s_tables = 'OFF',
@sys.diagnostics.include_raw = 'OFF';
CALL sys.diagnostics(0, 0, 'full');
diff --git a/mysql-test/suite/sysschema/r/pr_table_exists.result b/mysql-test/suite/sysschema/r/pr_table_exists.result
index 76085bd7..b6f8fa2e 100644
--- a/mysql-test/suite/sysschema/r/pr_table_exists.result
+++ b/mysql-test/suite/sysschema/r/pr_table_exists.result
@@ -69,4 +69,121 @@ CALL sys.table_exists('test', '`ab``c`', @tbl_type);
SELECT @tbl_type;
@tbl_type
+# Remove temporary table
DROP TABLE `ab``c`;
+CALL sys.table_exists('test', 'ab`c', @tbl_type);
+SELECT @tbl_type;
+@tbl_type
+BASE TABLE
+# Remove base table
+DROP TABLE `ab``c`;
+# MDEV-12459: The information_schema tables for getting temporary tables
+# info is missing, at least for innodb, there is no
+# INNODB_TEMP_TABLE_INFO
+#
+CREATE TABLE t1 (id INT PRIMARY KEY);
+CALL sys.table_exists('test', 't1', @exists);
+SELECT @exists;
+@exists
+BASE TABLE
+CREATE TEMPORARY TABLE t1 (id INT PRIMARY KEY);
+CALL sys.table_exists('test', 't1', @exists);
+SELECT @exists;
+@exists
+TEMPORARY
+DROP TEMPORARY TABLE t1;
+DROP TABLE t1;
+#
+# MDEV-28335: TABLE_TYPE for temporary sequences
+# is the same as for permanent ones
+#
+CREATE TEMPORARY SEQUENCE s1;
+CALL sys.table_exists('test', 's1', @exists);
+SELECT @exists;
+@exists
+TEMPORARY SEQUENCE
+DROP SEQUENCE s1;
+CREATE SEQUENCE s;
+CALL sys.table_exists('test', 's', @exists);
+SELECT @exists;
+@exists
+SEQUENCE
+CREATE TEMPORARY SEQUENCE s;
+CALL sys.table_exists('test', 's', @exists);
+SELECT @exists;
+@exists
+TEMPORARY
+DROP SEQUENCE s;
+CALL sys.table_exists('test', 's', @exists);
+SELECT @exists;
+@exists
+SEQUENCE
+DROP SEQUENCE s;
+CALL sys.table_exists('test', 's', @exists);
+SELECT @exists;
+@exists
+
+CREATE TEMPORARY SEQUENCE t1;
+CALL sys.table_exists('test', 't1', @exists);
+SELECT @exists;
+@exists
+TEMPORARY SEQUENCE
+CREATE TABLE t1 (id INT PRIMARY KEY);
+CALL sys.table_exists('test', 't1', @exists);
+SELECT @exists;
+@exists
+TEMPORARY
+CREATE TEMPORARY TABLE t1 (id INT PRIMARY KEY);
+ERROR 42S01: Table 't1' already exists
+CREATE SEQUENCE t1;
+ERROR 42S01: Table 't1' already exists
+DROP SEQUENCE t1;
+CALL sys.table_exists('test', 't1', @exists);
+SELECT @exists;
+@exists
+BASE TABLE
+CREATE SEQUENCE t1;
+ERROR 42S01: Table 't1' already exists
+CREATE TEMPORARY SEQUENCE t1;
+CALL sys.table_exists('test', 't1', @exists);
+SELECT @exists;
+@exists
+TEMPORARY
+DROP SEQUENCE t1;
+CALL sys.table_exists('test', 't1', @exists);
+SELECT @exists;
+@exists
+BASE TABLE
+CREATE TEMPORARY TABLE t1 (id INT PRIMARY KEY);
+CALL sys.table_exists('test', 't1', @exists);
+SELECT @exists;
+@exists
+TEMPORARY
+CREATE TEMPORARY SEQUENCE t1;
+ERROR 42S01: Table 't1' already exists
+CREATE SEQUENCE t1;
+ERROR 42S01: Table 't1' already exists
+DROP TEMPORARY TABLE t1;
+DROP TABLE t1;
+CREATE SEQUENCE t1;
+CALL sys.table_exists('test', 't1', @exists);
+SELECT @exists;
+@exists
+SEQUENCE
+CREATE TEMPORARY TABLE t1(t int);
+CALL sys.table_exists('test', 't1', @exists);
+SELECT @exists;
+@exists
+TEMPORARY
+DROP TABLE t1;
+CALL sys.table_exists('test', 't1', @exists);
+SELECT @exists;
+@exists
+SEQUENCE
+CREATE TEMPORARY SEQUENCE t1;
+CALL sys.table_exists('test', 't1', @exists);
+SELECT @exists;
+@exists
+TEMPORARY
+DROP TABLE t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/sysschema/r/v_host_summary.result b/mysql-test/suite/sysschema/r/v_host_summary.result
index b619a8a5..6eef4a41 100644
--- a/mysql-test/suite/sysschema/r/v_host_summary.result
+++ b/mysql-test/suite/sysschema/r/v_host_summary.result
@@ -2,11 +2,11 @@ DESC sys.host_summary;
Field Type Null Key Default Extra
host varchar(255) YES NULL
statements decimal(64,0) YES NULL
-statement_latency text YES NULL
-statement_avg_latency text YES NULL
+statement_latency varchar(12) YES NULL
+statement_avg_latency varchar(12) YES NULL
table_scans decimal(65,0) YES NULL
file_ios decimal(64,0) YES NULL
-file_io_latency text YES NULL
+file_io_latency varchar(12) YES NULL
current_connections decimal(41,0) YES NULL
total_connections decimal(41,0) YES NULL
unique_users bigint(21) NO 0
diff --git a/mysql-test/suite/sysschema/r/v_host_summary_by_file_io.result b/mysql-test/suite/sysschema/r/v_host_summary_by_file_io.result
index 8e257163..979d4a71 100644
--- a/mysql-test/suite/sysschema/r/v_host_summary_by_file_io.result
+++ b/mysql-test/suite/sysschema/r/v_host_summary_by_file_io.result
@@ -2,7 +2,7 @@ DESC sys.host_summary_by_file_io;
Field Type Null Key Default Extra
host varchar(255) YES NULL
ios decimal(42,0) YES NULL
-io_latency text YES NULL
+io_latency varchar(12) YES NULL
SELECT * FROM sys.host_summary_by_file_io;
DESC sys.x$host_summary_by_file_io;
Field Type Null Key Default Extra
diff --git a/mysql-test/suite/sysschema/r/v_host_summary_by_file_io_type.result b/mysql-test/suite/sysschema/r/v_host_summary_by_file_io_type.result
index c9a56aa9..9844b8b7 100644
--- a/mysql-test/suite/sysschema/r/v_host_summary_by_file_io_type.result
+++ b/mysql-test/suite/sysschema/r/v_host_summary_by_file_io_type.result
@@ -3,8 +3,8 @@ Field Type Null Key Default Extra
host varchar(255) YES NULL
event_name varchar(128) NO NULL
total bigint(20) unsigned NO NULL
-total_latency text YES NULL
-max_latency text YES NULL
+total_latency varchar(12) YES NULL
+max_latency varchar(12) YES NULL
SELECT * FROM sys.host_summary_by_file_io_type;
DESC sys.x$host_summary_by_file_io_type;
Field Type Null Key Default Extra
diff --git a/mysql-test/suite/sysschema/r/v_host_summary_by_stages.result b/mysql-test/suite/sysschema/r/v_host_summary_by_stages.result
index 0ee6f255..3910ed6e 100644
--- a/mysql-test/suite/sysschema/r/v_host_summary_by_stages.result
+++ b/mysql-test/suite/sysschema/r/v_host_summary_by_stages.result
@@ -3,8 +3,8 @@ Field Type Null Key Default Extra
host varchar(255) YES NULL
event_name varchar(128) NO NULL
total bigint(20) unsigned NO NULL
-total_latency text YES NULL
-avg_latency text YES NULL
+total_latency varchar(12) YES NULL
+avg_latency varchar(12) YES NULL
SELECT * FROM sys.host_summary_by_stages;
DESC sys.x$host_summary_by_stages;
Field Type Null Key Default Extra
diff --git a/mysql-test/suite/sysschema/r/v_host_summary_by_statement_latency.result b/mysql-test/suite/sysschema/r/v_host_summary_by_statement_latency.result
index 882a30b7..e7f906e6 100644
--- a/mysql-test/suite/sysschema/r/v_host_summary_by_statement_latency.result
+++ b/mysql-test/suite/sysschema/r/v_host_summary_by_statement_latency.result
@@ -2,9 +2,9 @@ DESC sys.host_summary_by_statement_latency;
Field Type Null Key Default Extra
host varchar(255) YES NULL
total decimal(42,0) YES NULL
-total_latency text YES NULL
-max_latency text YES NULL
-lock_latency text YES NULL
+total_latency varchar(12) YES NULL
+max_latency varchar(12) YES NULL
+lock_latency varchar(12) YES NULL
rows_sent decimal(42,0) YES NULL
rows_examined decimal(42,0) YES NULL
rows_affected decimal(42,0) YES NULL
diff --git a/mysql-test/suite/sysschema/r/v_host_summary_by_statement_type.result b/mysql-test/suite/sysschema/r/v_host_summary_by_statement_type.result
index eec8f869..14e58d7d 100644
--- a/mysql-test/suite/sysschema/r/v_host_summary_by_statement_type.result
+++ b/mysql-test/suite/sysschema/r/v_host_summary_by_statement_type.result
@@ -3,9 +3,9 @@ Field Type Null Key Default Extra
host varchar(255) YES NULL
statement varchar(128) YES NULL
total bigint(20) unsigned NO NULL
-total_latency text YES NULL
-max_latency text YES NULL
-lock_latency text YES NULL
+total_latency varchar(12) YES NULL
+max_latency varchar(12) YES NULL
+lock_latency varchar(12) YES NULL
rows_sent bigint(20) unsigned NO NULL
rows_examined bigint(20) unsigned NO NULL
rows_affected bigint(20) unsigned NO NULL
diff --git a/mysql-test/suite/sysschema/r/v_io_by_thread_by_latency.result b/mysql-test/suite/sysschema/r/v_io_by_thread_by_latency.result
index fddd2f26..bed684ae 100644
--- a/mysql-test/suite/sysschema/r/v_io_by_thread_by_latency.result
+++ b/mysql-test/suite/sysschema/r/v_io_by_thread_by_latency.result
@@ -2,10 +2,10 @@ DESC sys.io_by_thread_by_latency;
Field Type Null Key Default Extra
user varchar(384) YES NULL
total decimal(42,0) YES NULL
-total_latency text YES NULL
-min_latency text YES NULL
-avg_latency text YES NULL
-max_latency text YES NULL
+total_latency varchar(12) YES NULL
+min_latency varchar(12) YES NULL
+avg_latency varchar(12) YES NULL
+max_latency varchar(12) YES NULL
thread_id bigint(20) unsigned NO NULL
processlist_id bigint(20) unsigned YES NULL
SELECT * FROM sys.io_by_thread_by_latency;
diff --git a/mysql-test/suite/sysschema/r/v_io_global_by_file_by_latency.result b/mysql-test/suite/sysschema/r/v_io_global_by_file_by_latency.result
index 32d992c2..c56d02f6 100644
--- a/mysql-test/suite/sysschema/r/v_io_global_by_file_by_latency.result
+++ b/mysql-test/suite/sysschema/r/v_io_global_by_file_by_latency.result
@@ -2,13 +2,13 @@ DESC sys.io_global_by_file_by_latency;
Field Type Null Key Default Extra
file varchar(512) YES NULL
total bigint(20) unsigned NO NULL
-total_latency text YES NULL
+total_latency varchar(12) YES NULL
count_read bigint(20) unsigned NO NULL
-read_latency text YES NULL
+read_latency varchar(12) YES NULL
count_write bigint(20) unsigned NO NULL
-write_latency text YES NULL
+write_latency varchar(12) YES NULL
count_misc bigint(20) unsigned NO NULL
-misc_latency text YES NULL
+misc_latency varchar(12) YES NULL
SELECT * FROM sys.io_global_by_file_by_latency;
DESC sys.x$io_global_by_file_by_latency;
Field Type Null Key Default Extra
diff --git a/mysql-test/suite/sysschema/r/v_io_global_by_wait_by_bytes.result b/mysql-test/suite/sysschema/r/v_io_global_by_wait_by_bytes.result
index 3d5dcbff..d47dc9df 100644
--- a/mysql-test/suite/sysschema/r/v_io_global_by_wait_by_bytes.result
+++ b/mysql-test/suite/sysschema/r/v_io_global_by_wait_by_bytes.result
@@ -2,10 +2,10 @@ DESC sys.io_global_by_wait_by_bytes;
Field Type Null Key Default Extra
event_name varchar(128) YES NULL
total bigint(20) unsigned NO NULL
-total_latency text YES NULL
-min_latency text YES NULL
-avg_latency text YES NULL
-max_latency text YES NULL
+total_latency varchar(12) YES NULL
+min_latency varchar(12) YES NULL
+avg_latency varchar(12) YES NULL
+max_latency varchar(12) YES NULL
count_read bigint(20) unsigned NO NULL
total_read text YES NULL
avg_read text YES NULL
diff --git a/mysql-test/suite/sysschema/r/v_io_global_by_wait_by_latency.result b/mysql-test/suite/sysschema/r/v_io_global_by_wait_by_latency.result
index 1c5db297..62399c79 100644
--- a/mysql-test/suite/sysschema/r/v_io_global_by_wait_by_latency.result
+++ b/mysql-test/suite/sysschema/r/v_io_global_by_wait_by_latency.result
@@ -2,12 +2,12 @@ DESC sys.io_global_by_wait_by_latency;
Field Type Null Key Default Extra
event_name varchar(128) YES NULL
total bigint(20) unsigned NO NULL
-total_latency text YES NULL
-avg_latency text YES NULL
-max_latency text YES NULL
-read_latency text YES NULL
-write_latency text YES NULL
-misc_latency text YES NULL
+total_latency varchar(12) YES NULL
+avg_latency varchar(12) YES NULL
+max_latency varchar(12) YES NULL
+read_latency varchar(12) YES NULL
+write_latency varchar(12) YES NULL
+misc_latency varchar(12) YES NULL
count_read bigint(20) unsigned NO NULL
total_read text YES NULL
avg_read text YES NULL
diff --git a/mysql-test/suite/sysschema/r/v_latest_file_io.result b/mysql-test/suite/sysschema/r/v_latest_file_io.result
index a65cdb2d..8bdc0214 100644
--- a/mysql-test/suite/sysschema/r/v_latest_file_io.result
+++ b/mysql-test/suite/sysschema/r/v_latest_file_io.result
@@ -2,7 +2,7 @@ DESC sys.latest_file_io;
Field Type Null Key Default Extra
thread varchar(214) YES NULL
file varchar(512) YES NULL
-latency text YES NULL
+latency varchar(12) YES NULL
operation varchar(32) NO NULL
requested text YES NULL
SELECT * FROM sys.latest_file_io;
diff --git a/mysql-test/suite/sysschema/r/v_privileges_by_table_by_level.result b/mysql-test/suite/sysschema/r/v_privileges_by_table_by_level.result
new file mode 100644
index 00000000..63b0d71c
--- /dev/null
+++ b/mysql-test/suite/sysschema/r/v_privileges_by_table_by_level.result
@@ -0,0 +1,264 @@
+DESC sys.privileges_by_table_by_level;
+Field Type Null Key Default Extra
+TABLE_SCHEMA varchar(64) NO NULL
+TABLE_NAME varchar(64) NO NULL
+GRANTEE varchar(385) NO
+PRIVILEGE varchar(64) NO
+LEVEL varchar(6) NO
+CREATE DATABASE test1;
+USE test1;
+CREATE TABLE t1 (a int);
+CREATE USER test1_user;
+GRANT ALL PRIVILEGES ON test1.* TO test1_user;
+# Grant all table privileges
+GRANT ALL ON t1 to test1_user;
+SELECT table_schema, table_name,
+CASE WHEN grantee LIKE '\'root%' THEN '<some-root-user>' ELSE GRANTEE END,
+ privilege, level
+ FROM sys.privileges_by_table_by_level WHERE table_name='t1';
+table_schema table_name CASE WHEN grantee LIKE '\'root%' THEN '<some-root-user>' ELSE GRANTEE END privilege level
+test1 t1 <some-root-user> SELECT GLOBAL
+test1 t1 <some-root-user> INSERT GLOBAL
+test1 t1 <some-root-user> UPDATE GLOBAL
+test1 t1 <some-root-user> DELETE GLOBAL
+test1 t1 <some-root-user> CREATE GLOBAL
+test1 t1 <some-root-user> DROP GLOBAL
+test1 t1 <some-root-user> REFERENCES GLOBAL
+test1 t1 <some-root-user> INDEX GLOBAL
+test1 t1 <some-root-user> ALTER GLOBAL
+test1 t1 <some-root-user> SHOW VIEW GLOBAL
+test1 t1 <some-root-user> TRIGGER GLOBAL
+test1 t1 <some-root-user> DELETE HISTORY GLOBAL
+test1 t1 <some-root-user> SELECT GLOBAL
+test1 t1 <some-root-user> INSERT GLOBAL
+test1 t1 <some-root-user> UPDATE GLOBAL
+test1 t1 <some-root-user> DELETE GLOBAL
+test1 t1 <some-root-user> CREATE GLOBAL
+test1 t1 <some-root-user> DROP GLOBAL
+test1 t1 <some-root-user> REFERENCES GLOBAL
+test1 t1 <some-root-user> INDEX GLOBAL
+test1 t1 <some-root-user> ALTER GLOBAL
+test1 t1 <some-root-user> SHOW VIEW GLOBAL
+test1 t1 <some-root-user> TRIGGER GLOBAL
+test1 t1 <some-root-user> DELETE HISTORY GLOBAL
+test1 t1 <some-root-user> SELECT GLOBAL
+test1 t1 <some-root-user> INSERT GLOBAL
+test1 t1 <some-root-user> UPDATE GLOBAL
+test1 t1 <some-root-user> DELETE GLOBAL
+test1 t1 <some-root-user> CREATE GLOBAL
+test1 t1 <some-root-user> DROP GLOBAL
+test1 t1 <some-root-user> REFERENCES GLOBAL
+test1 t1 <some-root-user> INDEX GLOBAL
+test1 t1 <some-root-user> ALTER GLOBAL
+test1 t1 <some-root-user> SHOW VIEW GLOBAL
+test1 t1 <some-root-user> TRIGGER GLOBAL
+test1 t1 <some-root-user> DELETE HISTORY GLOBAL
+test1 t1 <some-root-user> SELECT GLOBAL
+test1 t1 <some-root-user> INSERT GLOBAL
+test1 t1 <some-root-user> UPDATE GLOBAL
+test1 t1 <some-root-user> DELETE GLOBAL
+test1 t1 <some-root-user> CREATE GLOBAL
+test1 t1 <some-root-user> DROP GLOBAL
+test1 t1 <some-root-user> REFERENCES GLOBAL
+test1 t1 <some-root-user> INDEX GLOBAL
+test1 t1 <some-root-user> ALTER GLOBAL
+test1 t1 <some-root-user> SHOW VIEW GLOBAL
+test1 t1 <some-root-user> TRIGGER GLOBAL
+test1 t1 <some-root-user> DELETE HISTORY GLOBAL
+test1 t1 'test1_user'@'%' SELECT SCHEMA
+test1 t1 'test1_user'@'%' INSERT SCHEMA
+test1 t1 'test1_user'@'%' UPDATE SCHEMA
+test1 t1 'test1_user'@'%' DELETE SCHEMA
+test1 t1 'test1_user'@'%' CREATE SCHEMA
+test1 t1 'test1_user'@'%' DROP SCHEMA
+test1 t1 'test1_user'@'%' REFERENCES SCHEMA
+test1 t1 'test1_user'@'%' INDEX SCHEMA
+test1 t1 'test1_user'@'%' ALTER SCHEMA
+test1 t1 'test1_user'@'%' SHOW VIEW SCHEMA
+test1 t1 'test1_user'@'%' TRIGGER SCHEMA
+test1 t1 'test1_user'@'%' DELETE HISTORY SCHEMA
+test1 t1 'test1_user'@'%' SELECT TABLE
+test1 t1 'test1_user'@'%' INSERT TABLE
+test1 t1 'test1_user'@'%' UPDATE TABLE
+test1 t1 'test1_user'@'%' DELETE TABLE
+test1 t1 'test1_user'@'%' CREATE TABLE
+test1 t1 'test1_user'@'%' DROP TABLE
+test1 t1 'test1_user'@'%' REFERENCES TABLE
+test1 t1 'test1_user'@'%' INDEX TABLE
+test1 t1 'test1_user'@'%' ALTER TABLE
+test1 t1 'test1_user'@'%' SHOW VIEW TABLE
+test1 t1 'test1_user'@'%' TRIGGER TABLE
+test1 t1 'test1_user'@'%' DELETE HISTORY TABLE
+# Revoke some table privileges
+REVOKE REFERENCES, DELETE, ALTER, DROP ON t1 FROM test1_user;
+SELECT table_schema, table_name,
+CASE WHEN grantee LIKE '\'root%' THEN '<some-root-user>' ELSE GRANTEE END,
+ privilege, level
+ FROM sys.privileges_by_table_by_level WHERE table_name='t1';
+table_schema table_name CASE WHEN grantee LIKE '\'root%' THEN '<some-root-user>' ELSE GRANTEE END privilege level
+test1 t1 <some-root-user> SELECT GLOBAL
+test1 t1 <some-root-user> INSERT GLOBAL
+test1 t1 <some-root-user> UPDATE GLOBAL
+test1 t1 <some-root-user> DELETE GLOBAL
+test1 t1 <some-root-user> CREATE GLOBAL
+test1 t1 <some-root-user> DROP GLOBAL
+test1 t1 <some-root-user> REFERENCES GLOBAL
+test1 t1 <some-root-user> INDEX GLOBAL
+test1 t1 <some-root-user> ALTER GLOBAL
+test1 t1 <some-root-user> SHOW VIEW GLOBAL
+test1 t1 <some-root-user> TRIGGER GLOBAL
+test1 t1 <some-root-user> DELETE HISTORY GLOBAL
+test1 t1 <some-root-user> SELECT GLOBAL
+test1 t1 <some-root-user> INSERT GLOBAL
+test1 t1 <some-root-user> UPDATE GLOBAL
+test1 t1 <some-root-user> DELETE GLOBAL
+test1 t1 <some-root-user> CREATE GLOBAL
+test1 t1 <some-root-user> DROP GLOBAL
+test1 t1 <some-root-user> REFERENCES GLOBAL
+test1 t1 <some-root-user> INDEX GLOBAL
+test1 t1 <some-root-user> ALTER GLOBAL
+test1 t1 <some-root-user> SHOW VIEW GLOBAL
+test1 t1 <some-root-user> TRIGGER GLOBAL
+test1 t1 <some-root-user> DELETE HISTORY GLOBAL
+test1 t1 <some-root-user> SELECT GLOBAL
+test1 t1 <some-root-user> INSERT GLOBAL
+test1 t1 <some-root-user> UPDATE GLOBAL
+test1 t1 <some-root-user> DELETE GLOBAL
+test1 t1 <some-root-user> CREATE GLOBAL
+test1 t1 <some-root-user> DROP GLOBAL
+test1 t1 <some-root-user> REFERENCES GLOBAL
+test1 t1 <some-root-user> INDEX GLOBAL
+test1 t1 <some-root-user> ALTER GLOBAL
+test1 t1 <some-root-user> SHOW VIEW GLOBAL
+test1 t1 <some-root-user> TRIGGER GLOBAL
+test1 t1 <some-root-user> DELETE HISTORY GLOBAL
+test1 t1 <some-root-user> SELECT GLOBAL
+test1 t1 <some-root-user> INSERT GLOBAL
+test1 t1 <some-root-user> UPDATE GLOBAL
+test1 t1 <some-root-user> DELETE GLOBAL
+test1 t1 <some-root-user> CREATE GLOBAL
+test1 t1 <some-root-user> DROP GLOBAL
+test1 t1 <some-root-user> REFERENCES GLOBAL
+test1 t1 <some-root-user> INDEX GLOBAL
+test1 t1 <some-root-user> ALTER GLOBAL
+test1 t1 <some-root-user> SHOW VIEW GLOBAL
+test1 t1 <some-root-user> TRIGGER GLOBAL
+test1 t1 <some-root-user> DELETE HISTORY GLOBAL
+test1 t1 'test1_user'@'%' SELECT SCHEMA
+test1 t1 'test1_user'@'%' INSERT SCHEMA
+test1 t1 'test1_user'@'%' UPDATE SCHEMA
+test1 t1 'test1_user'@'%' DELETE SCHEMA
+test1 t1 'test1_user'@'%' CREATE SCHEMA
+test1 t1 'test1_user'@'%' DROP SCHEMA
+test1 t1 'test1_user'@'%' REFERENCES SCHEMA
+test1 t1 'test1_user'@'%' INDEX SCHEMA
+test1 t1 'test1_user'@'%' ALTER SCHEMA
+test1 t1 'test1_user'@'%' SHOW VIEW SCHEMA
+test1 t1 'test1_user'@'%' TRIGGER SCHEMA
+test1 t1 'test1_user'@'%' DELETE HISTORY SCHEMA
+test1 t1 'test1_user'@'%' SELECT TABLE
+test1 t1 'test1_user'@'%' INSERT TABLE
+test1 t1 'test1_user'@'%' UPDATE TABLE
+test1 t1 'test1_user'@'%' CREATE TABLE
+test1 t1 'test1_user'@'%' INDEX TABLE
+test1 t1 'test1_user'@'%' SHOW VIEW TABLE
+test1 t1 'test1_user'@'%' TRIGGER TABLE
+test1 t1 'test1_user'@'%' DELETE HISTORY TABLE
+CREATE ROLE test1_role;
+GRANT SELECT, UPDATE, DELETE, DROP, INDEX ON t1 to test1_role;
+# Must show both the user and the role
+SELECT * FROM sys.privileges_by_table_by_level
+WHERE table_schema='test1' AND table_name='t1' AND grantee LIKE '%test1%';
+TABLE_SCHEMA TABLE_NAME GRANTEE PRIVILEGE LEVEL
+test1 t1 'test1_user'@'%' SELECT SCHEMA
+test1 t1 'test1_user'@'%' INSERT SCHEMA
+test1 t1 'test1_user'@'%' UPDATE SCHEMA
+test1 t1 'test1_user'@'%' DELETE SCHEMA
+test1 t1 'test1_user'@'%' CREATE SCHEMA
+test1 t1 'test1_user'@'%' DROP SCHEMA
+test1 t1 'test1_user'@'%' REFERENCES SCHEMA
+test1 t1 'test1_user'@'%' INDEX SCHEMA
+test1 t1 'test1_user'@'%' ALTER SCHEMA
+test1 t1 'test1_user'@'%' SHOW VIEW SCHEMA
+test1 t1 'test1_user'@'%' TRIGGER SCHEMA
+test1 t1 'test1_user'@'%' DELETE HISTORY SCHEMA
+test1 t1 'test1_user'@'%' SELECT TABLE
+test1 t1 'test1_user'@'%' INSERT TABLE
+test1 t1 'test1_user'@'%' UPDATE TABLE
+test1 t1 'test1_user'@'%' CREATE TABLE
+test1 t1 'test1_user'@'%' INDEX TABLE
+test1 t1 'test1_user'@'%' SHOW VIEW TABLE
+test1 t1 'test1_user'@'%' TRIGGER TABLE
+test1 t1 'test1_user'@'%' DELETE HISTORY TABLE
+test1 t1 'test1_role'@'' SELECT TABLE
+test1 t1 'test1_role'@'' UPDATE TABLE
+test1 t1 'test1_role'@'' DELETE TABLE
+test1 t1 'test1_role'@'' DROP TABLE
+test1 t1 'test1_role'@'' INDEX TABLE
+CREATE VIEW v1 AS SELECT * FROM t1;
+SELECT * FROM sys.privileges_by_table_by_level
+WHERE table_schema='test1' AND table_name='v1' AND grantee LIKE '%test1%';
+TABLE_SCHEMA TABLE_NAME GRANTEE PRIVILEGE LEVEL
+test1 v1 'test1_user'@'%' SELECT SCHEMA
+test1 v1 'test1_user'@'%' INSERT SCHEMA
+test1 v1 'test1_user'@'%' UPDATE SCHEMA
+test1 v1 'test1_user'@'%' DELETE SCHEMA
+test1 v1 'test1_user'@'%' CREATE SCHEMA
+test1 v1 'test1_user'@'%' DROP SCHEMA
+test1 v1 'test1_user'@'%' REFERENCES SCHEMA
+test1 v1 'test1_user'@'%' INDEX SCHEMA
+test1 v1 'test1_user'@'%' ALTER SCHEMA
+test1 v1 'test1_user'@'%' SHOW VIEW SCHEMA
+test1 v1 'test1_user'@'%' TRIGGER SCHEMA
+test1 v1 'test1_user'@'%' DELETE HISTORY SCHEMA
+GRANT SELECT ON v1 TO test1_role;
+SELECT * FROM sys.privileges_by_table_by_level
+WHERE table_schema='test1' AND table_name='v1' AND grantee LIKE '%test1%';
+TABLE_SCHEMA TABLE_NAME GRANTEE PRIVILEGE LEVEL
+test1 v1 'test1_user'@'%' SELECT SCHEMA
+test1 v1 'test1_user'@'%' INSERT SCHEMA
+test1 v1 'test1_user'@'%' UPDATE SCHEMA
+test1 v1 'test1_user'@'%' DELETE SCHEMA
+test1 v1 'test1_user'@'%' CREATE SCHEMA
+test1 v1 'test1_user'@'%' DROP SCHEMA
+test1 v1 'test1_user'@'%' REFERENCES SCHEMA
+test1 v1 'test1_user'@'%' INDEX SCHEMA
+test1 v1 'test1_user'@'%' ALTER SCHEMA
+test1 v1 'test1_user'@'%' SHOW VIEW SCHEMA
+test1 v1 'test1_user'@'%' TRIGGER SCHEMA
+test1 v1 'test1_user'@'%' DELETE HISTORY SCHEMA
+test1 v1 'test1_role'@'' SELECT TABLE
+GRANT ALL ON v1 TO test1_user;
+SELECT * FROM sys.privileges_by_table_by_level
+WHERE table_schema='test1' AND table_name='v1' AND grantee LIKE '%test1%';
+TABLE_SCHEMA TABLE_NAME GRANTEE PRIVILEGE LEVEL
+test1 v1 'test1_user'@'%' SELECT SCHEMA
+test1 v1 'test1_user'@'%' INSERT SCHEMA
+test1 v1 'test1_user'@'%' UPDATE SCHEMA
+test1 v1 'test1_user'@'%' DELETE SCHEMA
+test1 v1 'test1_user'@'%' CREATE SCHEMA
+test1 v1 'test1_user'@'%' DROP SCHEMA
+test1 v1 'test1_user'@'%' REFERENCES SCHEMA
+test1 v1 'test1_user'@'%' INDEX SCHEMA
+test1 v1 'test1_user'@'%' ALTER SCHEMA
+test1 v1 'test1_user'@'%' SHOW VIEW SCHEMA
+test1 v1 'test1_user'@'%' TRIGGER SCHEMA
+test1 v1 'test1_user'@'%' DELETE HISTORY SCHEMA
+test1 v1 'test1_user'@'%' SELECT TABLE
+test1 v1 'test1_user'@'%' INSERT TABLE
+test1 v1 'test1_user'@'%' UPDATE TABLE
+test1 v1 'test1_user'@'%' DELETE TABLE
+test1 v1 'test1_user'@'%' CREATE TABLE
+test1 v1 'test1_user'@'%' DROP TABLE
+test1 v1 'test1_user'@'%' REFERENCES TABLE
+test1 v1 'test1_user'@'%' INDEX TABLE
+test1 v1 'test1_user'@'%' ALTER TABLE
+test1 v1 'test1_user'@'%' SHOW VIEW TABLE
+test1 v1 'test1_user'@'%' TRIGGER TABLE
+test1 v1 'test1_user'@'%' DELETE HISTORY TABLE
+test1 v1 'test1_role'@'' SELECT TABLE
+DROP TABLE t1;
+DROP VIEW v1;
+DROP USER test1_user;
+DROP ROLE test1_role;
+DROP DATABASE test1;
diff --git a/mysql-test/suite/sysschema/r/v_processlist.result b/mysql-test/suite/sysschema/r/v_processlist.result
index dfc04814..f2424979 100644
--- a/mysql-test/suite/sysschema/r/v_processlist.result
+++ b/mysql-test/suite/sysschema/r/v_processlist.result
@@ -8,9 +8,9 @@ command varchar(16) YES NULL
state varchar(64) YES NULL
time bigint(20) YES NULL
current_statement longtext YES NULL
-statement_latency mediumtext YES NULL
+statement_latency varchar(12) YES NULL
progress decimal(26,2) YES NULL
-lock_latency text YES NULL
+lock_latency varchar(12) YES NULL
rows_examined bigint(20) unsigned YES NULL
rows_sent bigint(20) unsigned YES NULL
rows_affected bigint(20) unsigned YES NULL
@@ -18,12 +18,12 @@ tmp_tables bigint(20) unsigned YES NULL
tmp_disk_tables bigint(20) unsigned YES NULL
full_scan varchar(3) YES NULL
last_statement longtext YES NULL
-last_statement_latency mediumtext YES NULL
+last_statement_latency varchar(12) YES NULL
current_memory text YES NULL
last_wait varchar(128) YES NULL
-last_wait_latency mediumtext YES NULL
+last_wait_latency varchar(13) YES NULL
source varchar(64) YES NULL
-trx_latency text YES NULL
+trx_latency varchar(12) YES NULL
trx_state enum('ACTIVE','COMMITTED','ROLLED BACK') YES NULL
trx_autocommit enum('YES','NO') YES NULL
pid varchar(1024) YES NULL
diff --git a/mysql-test/suite/sysschema/r/v_schema_index_statistics.result b/mysql-test/suite/sysschema/r/v_schema_index_statistics.result
index 63cf1931..959f8628 100644
--- a/mysql-test/suite/sysschema/r/v_schema_index_statistics.result
+++ b/mysql-test/suite/sysschema/r/v_schema_index_statistics.result
@@ -4,13 +4,13 @@ table_schema varchar(64) YES NULL
table_name varchar(64) YES NULL
index_name varchar(64) YES NULL
rows_selected bigint(20) unsigned NO NULL
-select_latency text YES NULL
+select_latency varchar(12) YES NULL
rows_inserted bigint(20) unsigned NO NULL
-insert_latency text YES NULL
+insert_latency varchar(12) YES NULL
rows_updated bigint(20) unsigned NO NULL
-update_latency text YES NULL
+update_latency varchar(12) YES NULL
rows_deleted bigint(20) unsigned NO NULL
-delete_latency text YES NULL
+delete_latency varchar(12) YES NULL
SELECT * FROM sys.schema_index_statistics;
DESC sys.x$schema_index_statistics;
Field Type Null Key Default Extra
diff --git a/mysql-test/suite/sysschema/r/v_schema_redundant_indexes.result b/mysql-test/suite/sysschema/r/v_schema_redundant_indexes.result
index 2199c959..8893726f 100644
--- a/mysql-test/suite/sysschema/r/v_schema_redundant_indexes.result
+++ b/mysql-test/suite/sysschema/r/v_schema_redundant_indexes.result
@@ -32,6 +32,6 @@ KEY (i, j, k)
);
SELECT * FROM sys.schema_redundant_indexes;
table_schema table_name redundant_index_name redundant_index_columns redundant_index_non_unique dominant_index_name dominant_index_columns dominant_index_non_unique subpart_exists sql_drop_index
-rkey rkey j j 1 j_2 j,k 1 0 ALTER TABLE `rkey`.`rkey` DROP INDEX `j`
rkey rkey i i,j,k 1 PRIMARY i 0 0 ALTER TABLE `rkey`.`rkey` DROP INDEX `i`
+rkey rkey j j 1 j_2 j,k 1 0 ALTER TABLE `rkey`.`rkey` DROP INDEX `j`
DROP DATABASE rkey;
diff --git a/mysql-test/suite/sysschema/r/v_schema_table_statistics.result b/mysql-test/suite/sysschema/r/v_schema_table_statistics.result
index fda0d7da..0ca9096d 100644
--- a/mysql-test/suite/sysschema/r/v_schema_table_statistics.result
+++ b/mysql-test/suite/sysschema/r/v_schema_table_statistics.result
@@ -2,23 +2,23 @@ DESC sys.schema_table_statistics;
Field Type Null Key Default Extra
table_schema varchar(64) YES NULL
table_name varchar(64) YES NULL
-total_latency text YES NULL
+total_latency varchar(12) YES NULL
rows_fetched bigint(20) unsigned NO NULL
-fetch_latency text YES NULL
+fetch_latency varchar(12) YES NULL
rows_inserted bigint(20) unsigned NO NULL
-insert_latency text YES NULL
+insert_latency varchar(12) YES NULL
rows_updated bigint(20) unsigned NO NULL
-update_latency text YES NULL
+update_latency varchar(12) YES NULL
rows_deleted bigint(20) unsigned NO NULL
-delete_latency text YES NULL
+delete_latency varchar(12) YES NULL
io_read_requests decimal(42,0) YES NULL
io_read text YES NULL
-io_read_latency text YES NULL
+io_read_latency varchar(12) YES NULL
io_write_requests decimal(42,0) YES NULL
io_write text YES NULL
-io_write_latency text YES NULL
+io_write_latency varchar(12) YES NULL
io_misc_requests decimal(42,0) YES NULL
-io_misc_latency text YES NULL
+io_misc_latency varchar(12) YES NULL
SELECT * FROM sys.schema_table_statistics;
DESC sys.x$schema_table_statistics;
Field Type Null Key Default Extra
diff --git a/mysql-test/suite/sysschema/r/v_schema_table_statistics_with_buffer.result b/mysql-test/suite/sysschema/r/v_schema_table_statistics_with_buffer.result
index 809e8a4e..28f5ee84 100644
--- a/mysql-test/suite/sysschema/r/v_schema_table_statistics_with_buffer.result
+++ b/mysql-test/suite/sysschema/r/v_schema_table_statistics_with_buffer.result
@@ -3,21 +3,21 @@ Field Type Null Key Default Extra
table_schema varchar(64) YES NULL
table_name varchar(64) YES NULL
rows_fetched bigint(20) unsigned NO NULL
-fetch_latency text YES NULL
+fetch_latency varchar(12) YES NULL
rows_inserted bigint(20) unsigned NO NULL
-insert_latency text YES NULL
+insert_latency varchar(12) YES NULL
rows_updated bigint(20) unsigned NO NULL
-update_latency text YES NULL
+update_latency varchar(12) YES NULL
rows_deleted bigint(20) unsigned NO NULL
-delete_latency text YES NULL
+delete_latency varchar(12) YES NULL
io_read_requests decimal(42,0) YES NULL
io_read text YES NULL
-io_read_latency text YES NULL
+io_read_latency varchar(12) YES NULL
io_write_requests decimal(42,0) YES NULL
io_write text YES NULL
-io_write_latency text YES NULL
+io_write_latency varchar(12) YES NULL
io_misc_requests decimal(42,0) YES NULL
-io_misc_latency text YES NULL
+io_misc_latency varchar(12) YES NULL
innodb_buffer_allocated text YES NULL
innodb_buffer_data text YES NULL
innodb_buffer_free text YES NULL
diff --git a/mysql-test/suite/sysschema/r/v_schema_tables_with_full_table_scans.result b/mysql-test/suite/sysschema/r/v_schema_tables_with_full_table_scans.result
index a6aca341..9516071c 100644
--- a/mysql-test/suite/sysschema/r/v_schema_tables_with_full_table_scans.result
+++ b/mysql-test/suite/sysschema/r/v_schema_tables_with_full_table_scans.result
@@ -3,7 +3,7 @@ Field Type Null Key Default Extra
object_schema varchar(64) YES NULL
object_name varchar(64) YES NULL
rows_full_scanned bigint(20) unsigned NO NULL
-latency text YES NULL
+latency varchar(12) YES NULL
SELECT * FROM sys.schema_tables_with_full_table_scans;
DESC sys.x$schema_tables_with_full_table_scans;
Field Type Null Key Default Extra
diff --git a/mysql-test/suite/sysschema/r/v_session.result b/mysql-test/suite/sysschema/r/v_session.result
index fd88b8f1..21e237ed 100644
--- a/mysql-test/suite/sysschema/r/v_session.result
+++ b/mysql-test/suite/sysschema/r/v_session.result
@@ -8,9 +8,9 @@ command varchar(16) YES NULL
state varchar(64) YES NULL
time bigint(20) YES NULL
current_statement longtext YES NULL
-statement_latency mediumtext YES NULL
+statement_latency varchar(12) YES NULL
progress decimal(26,2) YES NULL
-lock_latency text YES NULL
+lock_latency varchar(12) YES NULL
rows_examined bigint(20) unsigned YES NULL
rows_sent bigint(20) unsigned YES NULL
rows_affected bigint(20) unsigned YES NULL
@@ -18,12 +18,12 @@ tmp_tables bigint(20) unsigned YES NULL
tmp_disk_tables bigint(20) unsigned YES NULL
full_scan varchar(3) YES NULL
last_statement longtext YES NULL
-last_statement_latency mediumtext YES NULL
+last_statement_latency varchar(12) YES NULL
current_memory text YES NULL
last_wait varchar(128) YES NULL
-last_wait_latency mediumtext YES NULL
+last_wait_latency varchar(13) YES NULL
source varchar(64) YES NULL
-trx_latency text YES NULL
+trx_latency varchar(12) YES NULL
trx_state enum('ACTIVE','COMMITTED','ROLLED BACK') YES NULL
trx_autocommit enum('YES','NO') YES NULL
pid varchar(1024) YES NULL
diff --git a/mysql-test/suite/sysschema/r/v_statement_analysis.result b/mysql-test/suite/sysschema/r/v_statement_analysis.result
index c3dd167c..510e17d6 100644
--- a/mysql-test/suite/sysschema/r/v_statement_analysis.result
+++ b/mysql-test/suite/sysschema/r/v_statement_analysis.result
@@ -6,10 +6,10 @@ full_scan varchar(1) NO
exec_count bigint(20) unsigned NO NULL
err_count bigint(20) unsigned NO NULL
warn_count bigint(20) unsigned NO NULL
-total_latency text YES NULL
-max_latency text YES NULL
-avg_latency text YES NULL
-lock_latency text YES NULL
+total_latency varchar(12) YES NULL
+max_latency varchar(12) YES NULL
+avg_latency varchar(12) YES NULL
+lock_latency varchar(12) YES NULL
rows_sent bigint(20) unsigned NO NULL
rows_sent_avg decimal(21,0) NO 0
rows_examined bigint(20) unsigned NO NULL
diff --git a/mysql-test/suite/sysschema/r/v_statements_with_full_table_scans.result b/mysql-test/suite/sysschema/r/v_statements_with_full_table_scans.result
index a762cfd7..f543c8ad 100644
--- a/mysql-test/suite/sysschema/r/v_statements_with_full_table_scans.result
+++ b/mysql-test/suite/sysschema/r/v_statements_with_full_table_scans.result
@@ -3,7 +3,7 @@ Field Type Null Key Default Extra
query longtext YES NULL
db varchar(64) YES NULL
exec_count bigint(20) unsigned NO NULL
-total_latency text YES NULL
+total_latency varchar(12) YES NULL
no_index_used_count bigint(20) unsigned NO NULL
no_good_index_used_count bigint(20) unsigned NO NULL
no_index_used_pct decimal(24,0) NO 0
diff --git a/mysql-test/suite/sysschema/r/v_statements_with_runtimes_in_95th_percentile.result b/mysql-test/suite/sysschema/r/v_statements_with_runtimes_in_95th_percentile.result
index 5cc05f27..90ea51a4 100644
--- a/mysql-test/suite/sysschema/r/v_statements_with_runtimes_in_95th_percentile.result
+++ b/mysql-test/suite/sysschema/r/v_statements_with_runtimes_in_95th_percentile.result
@@ -6,9 +6,9 @@ full_scan varchar(1) NO
exec_count bigint(20) unsigned NO NULL
err_count bigint(20) unsigned NO NULL
warn_count bigint(20) unsigned NO NULL
-total_latency text YES NULL
-max_latency text YES NULL
-avg_latency text YES NULL
+total_latency varchar(12) YES NULL
+max_latency varchar(12) YES NULL
+avg_latency varchar(12) YES NULL
rows_sent bigint(20) unsigned NO NULL
rows_sent_avg decimal(21,0) NO 0
rows_examined bigint(20) unsigned NO NULL
diff --git a/mysql-test/suite/sysschema/r/v_statements_with_sorting.result b/mysql-test/suite/sysschema/r/v_statements_with_sorting.result
index 034987b8..b3a71573 100644
--- a/mysql-test/suite/sysschema/r/v_statements_with_sorting.result
+++ b/mysql-test/suite/sysschema/r/v_statements_with_sorting.result
@@ -3,7 +3,7 @@ Field Type Null Key Default Extra
query longtext YES NULL
db varchar(64) YES NULL
exec_count bigint(20) unsigned NO NULL
-total_latency text YES NULL
+total_latency varchar(12) YES NULL
sort_merge_passes bigint(20) unsigned NO NULL
avg_sort_merges decimal(21,0) NO 0
sorts_using_scans bigint(20) unsigned NO NULL
diff --git a/mysql-test/suite/sysschema/r/v_statements_with_temp_tables.result b/mysql-test/suite/sysschema/r/v_statements_with_temp_tables.result
index 52683a56..73ea1ae0 100644
--- a/mysql-test/suite/sysschema/r/v_statements_with_temp_tables.result
+++ b/mysql-test/suite/sysschema/r/v_statements_with_temp_tables.result
@@ -3,7 +3,7 @@ Field Type Null Key Default Extra
query longtext YES NULL
db varchar(64) YES NULL
exec_count bigint(20) unsigned NO NULL
-total_latency text YES NULL
+total_latency varchar(12) YES NULL
memory_tmp_tables bigint(20) unsigned NO NULL
disk_tmp_tables bigint(20) unsigned NO NULL
avg_tmp_tables_per_query decimal(21,0) NO 0
diff --git a/mysql-test/suite/sysschema/r/v_user_summary.result b/mysql-test/suite/sysschema/r/v_user_summary.result
index 233fcccc..9caa0200 100644
--- a/mysql-test/suite/sysschema/r/v_user_summary.result
+++ b/mysql-test/suite/sysschema/r/v_user_summary.result
@@ -2,11 +2,11 @@ DESC sys.user_summary;
Field Type Null Key Default Extra
user varchar(128) YES NULL
statements decimal(64,0) YES NULL
-statement_latency text YES NULL
-statement_avg_latency text YES NULL
+statement_latency varchar(12) YES NULL
+statement_avg_latency varchar(12) YES NULL
table_scans decimal(65,0) YES NULL
file_ios decimal(64,0) YES NULL
-file_io_latency text YES NULL
+file_io_latency varchar(12) YES NULL
current_connections decimal(41,0) YES NULL
total_connections decimal(41,0) YES NULL
unique_hosts bigint(21) NO 0
diff --git a/mysql-test/suite/sysschema/r/v_user_summary_by_file_io.result b/mysql-test/suite/sysschema/r/v_user_summary_by_file_io.result
index f6f106a5..d4429b8e 100644
--- a/mysql-test/suite/sysschema/r/v_user_summary_by_file_io.result
+++ b/mysql-test/suite/sysschema/r/v_user_summary_by_file_io.result
@@ -2,7 +2,7 @@ DESC sys.user_summary_by_file_io;
Field Type Null Key Default Extra
user varchar(128) YES NULL
ios decimal(42,0) YES NULL
-io_latency text YES NULL
+io_latency varchar(12) YES NULL
SELECT * FROM sys.user_summary_by_file_io;
DESC sys.x$user_summary_by_file_io;
Field Type Null Key Default Extra
diff --git a/mysql-test/suite/sysschema/r/v_user_summary_by_file_io_type.result b/mysql-test/suite/sysschema/r/v_user_summary_by_file_io_type.result
index c143697c..cff57e77 100644
--- a/mysql-test/suite/sysschema/r/v_user_summary_by_file_io_type.result
+++ b/mysql-test/suite/sysschema/r/v_user_summary_by_file_io_type.result
@@ -3,8 +3,8 @@ Field Type Null Key Default Extra
user varchar(128) YES NULL
event_name varchar(128) NO NULL
total bigint(20) unsigned NO NULL
-latency text YES NULL
-max_latency text YES NULL
+latency varchar(12) YES NULL
+max_latency varchar(12) YES NULL
SELECT * FROM sys.user_summary_by_file_io_type;
DESC sys.x$user_summary_by_file_io_type;
Field Type Null Key Default Extra
diff --git a/mysql-test/suite/sysschema/r/v_user_summary_by_stages.result b/mysql-test/suite/sysschema/r/v_user_summary_by_stages.result
index 9b90fe9c..655660a2 100644
--- a/mysql-test/suite/sysschema/r/v_user_summary_by_stages.result
+++ b/mysql-test/suite/sysschema/r/v_user_summary_by_stages.result
@@ -3,8 +3,8 @@ Field Type Null Key Default Extra
user varchar(128) YES NULL
event_name varchar(128) NO NULL
total bigint(20) unsigned NO NULL
-total_latency text YES NULL
-avg_latency text YES NULL
+total_latency varchar(12) YES NULL
+avg_latency varchar(12) YES NULL
SELECT * FROM sys.user_summary_by_stages;
DESC sys.x$user_summary_by_stages;
Field Type Null Key Default Extra
diff --git a/mysql-test/suite/sysschema/r/v_user_summary_by_statement_latency.result b/mysql-test/suite/sysschema/r/v_user_summary_by_statement_latency.result
index 36dadc29..b5a7fcc2 100644
--- a/mysql-test/suite/sysschema/r/v_user_summary_by_statement_latency.result
+++ b/mysql-test/suite/sysschema/r/v_user_summary_by_statement_latency.result
@@ -2,9 +2,9 @@ DESC sys.user_summary_by_statement_latency;
Field Type Null Key Default Extra
user varchar(128) YES NULL
total decimal(42,0) YES NULL
-total_latency text YES NULL
-max_latency text YES NULL
-lock_latency text YES NULL
+total_latency varchar(12) YES NULL
+max_latency varchar(12) YES NULL
+lock_latency varchar(12) YES NULL
rows_sent decimal(42,0) YES NULL
rows_examined decimal(42,0) YES NULL
rows_affected decimal(42,0) YES NULL
diff --git a/mysql-test/suite/sysschema/r/v_user_summary_by_statement_type.result b/mysql-test/suite/sysschema/r/v_user_summary_by_statement_type.result
index bd006c87..70a7ea3f 100644
--- a/mysql-test/suite/sysschema/r/v_user_summary_by_statement_type.result
+++ b/mysql-test/suite/sysschema/r/v_user_summary_by_statement_type.result
@@ -3,9 +3,9 @@ Field Type Null Key Default Extra
user varchar(128) YES NULL
statement varchar(128) YES NULL
total bigint(20) unsigned NO NULL
-total_latency text YES NULL
-max_latency text YES NULL
-lock_latency text YES NULL
+total_latency varchar(12) YES NULL
+max_latency varchar(12) YES NULL
+lock_latency varchar(12) YES NULL
rows_sent bigint(20) unsigned NO NULL
rows_examined bigint(20) unsigned NO NULL
rows_affected bigint(20) unsigned NO NULL
diff --git a/mysql-test/suite/sysschema/r/v_version.result b/mysql-test/suite/sysschema/r/v_version.result
index ac914fc8..ff1e351b 100644
--- a/mysql-test/suite/sysschema/r/v_version.result
+++ b/mysql-test/suite/sysschema/r/v_version.result
@@ -1,3 +1,3 @@
SELECT sys_version FROM sys.version;
sys_version
-1.5.1
+1.5.2
diff --git a/mysql-test/suite/sysschema/r/v_wait_classes_global_by_avg_latency.result b/mysql-test/suite/sysschema/r/v_wait_classes_global_by_avg_latency.result
index f6559cb7..52d506ea 100644
--- a/mysql-test/suite/sysschema/r/v_wait_classes_global_by_avg_latency.result
+++ b/mysql-test/suite/sysschema/r/v_wait_classes_global_by_avg_latency.result
@@ -2,10 +2,10 @@ DESC sys.wait_classes_global_by_avg_latency;
Field Type Null Key Default Extra
event_class varchar(128) YES NULL
total decimal(42,0) YES NULL
-total_latency text YES NULL
-min_latency text YES NULL
-avg_latency text YES NULL
-max_latency text YES NULL
+total_latency varchar(12) YES NULL
+min_latency varchar(12) YES NULL
+avg_latency varchar(12) YES NULL
+max_latency varchar(12) YES NULL
SELECT * FROM sys.wait_classes_global_by_avg_latency;
DESC sys.x$wait_classes_global_by_avg_latency;
Field Type Null Key Default Extra
diff --git a/mysql-test/suite/sysschema/r/v_wait_classes_global_by_latency.result b/mysql-test/suite/sysschema/r/v_wait_classes_global_by_latency.result
index 10db5ead..95f61961 100644
--- a/mysql-test/suite/sysschema/r/v_wait_classes_global_by_latency.result
+++ b/mysql-test/suite/sysschema/r/v_wait_classes_global_by_latency.result
@@ -2,10 +2,10 @@ DESC sys.wait_classes_global_by_latency;
Field Type Null Key Default Extra
event_class varchar(128) YES NULL
total decimal(42,0) YES NULL
-total_latency text YES NULL
-min_latency text YES NULL
-avg_latency text YES NULL
-max_latency text YES NULL
+total_latency varchar(12) YES NULL
+min_latency varchar(12) YES NULL
+avg_latency varchar(12) YES NULL
+max_latency varchar(12) YES NULL
SELECT * FROM sys.wait_classes_global_by_latency;
DESC sys.x$wait_classes_global_by_latency;
Field Type Null Key Default Extra
diff --git a/mysql-test/suite/sysschema/r/v_waits_by_host_by_latency.result b/mysql-test/suite/sysschema/r/v_waits_by_host_by_latency.result
index 5e595d9c..cbbed779 100644
--- a/mysql-test/suite/sysschema/r/v_waits_by_host_by_latency.result
+++ b/mysql-test/suite/sysschema/r/v_waits_by_host_by_latency.result
@@ -3,9 +3,9 @@ Field Type Null Key Default Extra
host varchar(255) YES NULL
event varchar(128) NO NULL
total bigint(20) unsigned NO NULL
-total_latency text YES NULL
-avg_latency text YES NULL
-max_latency text YES NULL
+total_latency varchar(12) YES NULL
+avg_latency varchar(12) YES NULL
+max_latency varchar(12) YES NULL
SELECT * FROM sys.waits_by_host_by_latency;
DESC sys.x$waits_by_host_by_latency;
Field Type Null Key Default Extra
diff --git a/mysql-test/suite/sysschema/r/v_waits_by_user_by_latency.result b/mysql-test/suite/sysschema/r/v_waits_by_user_by_latency.result
index 860db68c..369b3a18 100644
--- a/mysql-test/suite/sysschema/r/v_waits_by_user_by_latency.result
+++ b/mysql-test/suite/sysschema/r/v_waits_by_user_by_latency.result
@@ -3,9 +3,9 @@ Field Type Null Key Default Extra
user varchar(128) YES NULL
event varchar(128) NO NULL
total bigint(20) unsigned NO NULL
-total_latency text YES NULL
-avg_latency text YES NULL
-max_latency text YES NULL
+total_latency varchar(12) YES NULL
+avg_latency varchar(12) YES NULL
+max_latency varchar(12) YES NULL
SELECT * FROM sys.waits_by_user_by_latency;
DESC sys.x$waits_by_user_by_latency;
Field Type Null Key Default Extra
diff --git a/mysql-test/suite/sysschema/r/v_waits_global_by_latency.result b/mysql-test/suite/sysschema/r/v_waits_global_by_latency.result
index 1e32a9b8..0fafb723 100644
--- a/mysql-test/suite/sysschema/r/v_waits_global_by_latency.result
+++ b/mysql-test/suite/sysschema/r/v_waits_global_by_latency.result
@@ -2,9 +2,9 @@ DESC sys.waits_global_by_latency;
Field Type Null Key Default Extra
events varchar(128) NO NULL
total bigint(20) unsigned NO NULL
-total_latency text YES NULL
-avg_latency text YES NULL
-max_latency text YES NULL
+total_latency varchar(12) YES NULL
+avg_latency varchar(12) YES NULL
+max_latency varchar(12) YES NULL
SELECT * FROM sys.waits_global_by_latency;
DESC sys.x$waits_global_by_latency;
Field Type Null Key Default Extra
diff --git a/mysql-test/suite/sysschema/t/mysqldump.test b/mysql-test/suite/sysschema/t/mysqldump.test
index 35abc704..22f358c1 100644
--- a/mysql-test/suite/sysschema/t/mysqldump.test
+++ b/mysql-test/suite/sysschema/t/mysqldump.test
@@ -32,4 +32,4 @@ DROP TEMPORARY TABLE tmp_tables_priv;
FLUSH PRIVILEGES;
--let $MYSQLD_DATADIR= `select @@datadir`
---remove_file $MYSQLD_DATADIR/mysql_upgrade_info
+--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info
diff --git a/mysql-test/suite/sysschema/t/optimizer_switch.test b/mysql-test/suite/sysschema/t/optimizer_switch.test
new file mode 100644
index 00000000..b4d527e5
--- /dev/null
+++ b/mysql-test/suite/sysschema/t/optimizer_switch.test
@@ -0,0 +1,2 @@
+call sys.optimizer_switch_on();
+call sys.optimizer_switch_off();
diff --git a/mysql-test/suite/sysschema/t/pr_create_synonym_db.test b/mysql-test/suite/sysschema/t/pr_create_synonym_db.test
index 30c6f502..b05446c2 100644
--- a/mysql-test/suite/sysschema/t/pr_create_synonym_db.test
+++ b/mysql-test/suite/sysschema/t/pr_create_synonym_db.test
@@ -62,8 +62,34 @@ create table a(a int);
create table t (b int);
create table b(a int);
create temporary table b (a int);
---error ER_SIGNAL_EXCEPTION
call sys.create_synonym_db('db','db_copy');
+use db_copy;
+show tables;
+
drop database db;
drop database db_copy;
+--echo # MDEV-28343: sys.create_synonym_db fails with ER_VIEW_SELECT_TMPTABLE
+--echo # when schema contains temporary tables
+--echo #
+
+create database mytestdb;
+use mytestdb;
+create table t (b int);
+# This temporary table will not be created as an view in synonym db
+create temporary table tmp (a int);
+call sys.create_synonym_db('mytestdb','db_syn1');
+use db_syn1;
+show tables;
+drop database db_syn1;
+
+use mytestdb;
+# This temporary table will shadow the base table and no views will be created
+create temporary table t (b int);
+call sys.create_synonym_db('mytestdb','db_syn1');
+
+use db_syn1;
+show tables;
+
+drop database mytestdb;
+drop database db_syn1;
diff --git a/mysql-test/suite/sysschema/t/pr_diagnostics.test b/mysql-test/suite/sysschema/t/pr_diagnostics.test
index 40ea9000..f8c19f98 100644
--- a/mysql-test/suite/sysschema/t/pr_diagnostics.test
+++ b/mysql-test/suite/sysschema/t/pr_diagnostics.test
@@ -15,13 +15,13 @@
# any warnings.
--disable_result_log
-SET @sys.debug = 'ON',
+SET @sys.debug_dbug = 'ON',
@sys.diagnostics.allow_i_s_tables = 'ON',
@sys.diagnostics.include_raw = 'ON';
CALL sys.diagnostics(4, 2, 'full');
-SET @sys.debug = 'OFF',
+SET @sys.debug_dbug = 'OFF',
@sys.diagnostics.allow_i_s_tables = 'OFF',
@sys.diagnostics.include_raw = 'OFF';
--enable_result_log
diff --git a/mysql-test/suite/sysschema/t/pr_statement_performance_analyzer.test b/mysql-test/suite/sysschema/t/pr_statement_performance_analyzer.test
index b8932381..96b59a55 100644
--- a/mysql-test/suite/sysschema/t/pr_statement_performance_analyzer.test
+++ b/mysql-test/suite/sysschema/t/pr_statement_performance_analyzer.test
@@ -155,9 +155,10 @@ CALL sys.statement_performance_analyzer('delta', 'test.tmp_digests_ini', 'analys
CALL sys.statement_performance_analyzer('overall', NULL, 'with_errors_or_warnings');
CALL sys.statement_performance_analyzer('delta', 'test.tmp_digests_ini', 'with_errors_or_warnings');
---replace_result $query_select QUERY_SELECT $digest_select DIGEST_SELECT $o_sel_total_latency LATENCY $o_sel_first_seen FIRST_SEEN $o_sel_last_seen LAST_SEEN
+--replace_column 4 LATENCY
+--replace_result $query_select QUERY_SELECT $digest_select DIGEST_SELECT $o_sel_first_seen FIRST_SEEN $o_sel_last_seen LAST_SEEN $digest_update DIGEST_UPDATE $query_update QUERY_UPDATE $o_upd_first_seen FIRST_SEEN $o_upd_last_seen LAST_SEEN
CALL sys.statement_performance_analyzer('overall', NULL, 'with_full_table_scans');
---replace_result $query_select QUERY_SELECT $digest_select DIGEST_SELECT $d_sel_total_latency LATENCY $o_sel_first_seen FIRST_SEEN $o_sel_last_seen LAST_SEEN
+--replace_result $query_select QUERY_SELECT $digest_select DIGEST_SELECT $d_sel_total_latency LATENCY $o_sel_first_seen FIRST_SEEN $o_sel_last_seen LAST_SEEN
CALL sys.statement_performance_analyzer('delta', 'test.tmp_digests_ini', 'with_full_table_scans');
--replace_result $query_select QUERY_SELECT $digest_select DIGEST_SELECT $o_sel_total_latency LATENCY $o_sel_first_seen FIRST_SEEN $o_sel_last_seen LAST_SEEN
diff --git a/mysql-test/suite/sysschema/t/pr_table_exists.test b/mysql-test/suite/sysschema/t/pr_table_exists.test
index 83e1dc0b..11e5955b 100644
--- a/mysql-test/suite/sysschema/t/pr_table_exists.test
+++ b/mysql-test/suite/sysschema/t/pr_table_exists.test
@@ -66,4 +66,112 @@ SELECT @tbl_type;
--echo # We cannot send quoted identifer to the procedure, no table will be found
CALL sys.table_exists('test', '`ab``c`', @tbl_type);
SELECT @tbl_type;
-DROP TABLE `ab``c`; \ No newline at end of file
+--echo # Remove temporary table
+DROP TABLE `ab``c`;
+CALL sys.table_exists('test', 'ab`c', @tbl_type);
+SELECT @tbl_type;
+--echo # Remove base table
+DROP TABLE `ab``c`;
+--echo # MDEV-12459: The information_schema tables for getting temporary tables
+--echo # info is missing, at least for innodb, there is no
+--echo # INNODB_TEMP_TABLE_INFO
+--echo #
+
+# Temporary table will shadow the base table without warning
+CREATE TABLE t1 (id INT PRIMARY KEY);
+# Verify the base table and view is supported
+CALL sys.table_exists('test', 't1', @exists);
+SELECT @exists;
+CREATE TEMPORARY TABLE t1 (id INT PRIMARY KEY);
+CALL sys.table_exists('test', 't1', @exists);
+SELECT @exists;
+
+DROP TEMPORARY TABLE t1;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-28335: TABLE_TYPE for temporary sequences
+--echo # is the same as for permanent ones
+--echo #
+
+CREATE TEMPORARY SEQUENCE s1;
+CALL sys.table_exists('test', 's1', @exists);
+# If there is no shadowing with temporary table, result is table type
+SELECT @exists;
+DROP SEQUENCE s1;
+CREATE SEQUENCE s;
+CALL sys.table_exists('test', 's', @exists); SELECT @exists;
+# Creating temporary sequence over sequence results in `temporary`
+CREATE TEMPORARY SEQUENCE s;
+CALL sys.table_exists('test', 's', @exists); SELECT @exists;
+# First drop temporary sequence
+DROP SEQUENCE s;
+CALL sys.table_exists('test', 's', @exists); SELECT @exists;
+DROP SEQUENCE s;
+CALL sys.table_exists('test', 's', @exists); SELECT @exists;
+
+CREATE TEMPORARY SEQUENCE t1;
+CALL sys.table_exists('test', 't1', @exists);
+SELECT @exists;
+CREATE TABLE t1 (id INT PRIMARY KEY);
+CALL sys.table_exists('test', 't1', @exists);
+# Before was a `temporary sequence`, now should be `temporary`
+SELECT @exists;
+# It is not possible to create temporary table over temporary sequence with the same name
+--error ER_TABLE_EXISTS_ERROR
+CREATE TEMPORARY TABLE t1 (id INT PRIMARY KEY);
+# It is not possible to create sequence over temporary sequence with the same name
+--error ER_TABLE_EXISTS_ERROR
+CREATE SEQUENCE t1;
+# This will drop temporary sequence
+DROP SEQUENCE t1;
+CALL sys.table_exists('test', 't1', @exists);
+# This will lead to `base table`
+SELECT @exists;
+# It is not possible to create a sequence over the base table
+--error ER_TABLE_EXISTS_ERROR
+CREATE SEQUENCE t1;
+# Let's test with temporary sequence instead
+CREATE TEMPORARY SEQUENCE t1;
+CALL sys.table_exists('test', 't1', @exists);
+# Will return temporary as expected
+SELECT @exists;
+# Again droping the temporary sequence
+DROP SEQUENCE t1;
+# Will lead to the base table
+CALL sys.table_exists('test', 't1', @exists);
+SELECT @exists;
+CREATE TEMPORARY TABLE t1 (id INT PRIMARY KEY);
+# This will return `temporary`
+CALL sys.table_exists('test', 't1', @exists);
+SELECT @exists;
+# We cannot create temporary sequence over temporary table
+--error ER_TABLE_EXISTS_ERROR
+CREATE TEMPORARY SEQUENCE t1;
+--error ER_TABLE_EXISTS_ERROR
+CREATE SEQUENCE t1;
+DROP TEMPORARY TABLE t1;
+# Drop base table
+DROP TABLE t1;
+CREATE SEQUENCE t1;
+CALL sys.table_exists('test', 't1', @exists);
+# Should be a sequence
+SELECT @exists;
+# Create an temporary table
+CREATE TEMPORARY TABLE t1(t int);
+CALL sys.table_exists('test', 't1', @exists);
+# Should shadow an sequence with temporary
+SELECT @exists;
+# Drop temporary table
+DROP TABLE t1;
+CALL sys.table_exists('test', 't1', @exists);
+# Should again show the sequence
+SELECT @exists;
+CREATE TEMPORARY SEQUENCE t1;
+CALL sys.table_exists('test', 't1', @exists);
+# Should shadow an sequence with temporary
+SELECT @exists;
+# Drop temporary sequence
+DROP TABLE t1;
+# Drop an sequence
+DROP TABLE t1;
diff --git a/mysql-test/suite/sysschema/t/v_privileges_by_table_by_level.test b/mysql-test/suite/sysschema/t/v_privileges_by_table_by_level.test
new file mode 100644
index 00000000..3e866a62
--- /dev/null
+++ b/mysql-test/suite/sysschema/t/v_privileges_by_table_by_level.test
@@ -0,0 +1,54 @@
+-- source include/not_embedded.inc
+# Tests for sys schema
+# Verify the sys.privileges_by_table_by_level view
+
+# Ensure structure changes don't slip in
+DESC sys.privileges_by_table_by_level;
+
+CREATE DATABASE test1;
+USE test1;
+CREATE TABLE t1 (a int);
+CREATE USER test1_user;
+
+GRANT ALL PRIVILEGES ON test1.* TO test1_user;
+
+--echo # Grant all table privileges
+GRANT ALL ON t1 to test1_user;
+SELECT table_schema, table_name,
+ CASE WHEN grantee LIKE '\'root%' THEN '<some-root-user>' ELSE GRANTEE END,
+ privilege, level
+ FROM sys.privileges_by_table_by_level WHERE table_name='t1';
+
+--echo # Revoke some table privileges
+REVOKE REFERENCES, DELETE, ALTER, DROP ON t1 FROM test1_user;
+SELECT table_schema, table_name,
+ CASE WHEN grantee LIKE '\'root%' THEN '<some-root-user>' ELSE GRANTEE END,
+ privilege, level
+ FROM sys.privileges_by_table_by_level WHERE table_name='t1';
+
+CREATE ROLE test1_role;
+GRANT SELECT, UPDATE, DELETE, DROP, INDEX ON t1 to test1_role;
+
+--echo # Must show both the user and the role
+SELECT * FROM sys.privileges_by_table_by_level
+ WHERE table_schema='test1' AND table_name='t1' AND grantee LIKE '%test1%';
+
+CREATE VIEW v1 AS SELECT * FROM t1;
+SELECT * FROM sys.privileges_by_table_by_level
+ WHERE table_schema='test1' AND table_name='v1' AND grantee LIKE '%test1%';
+
+GRANT SELECT ON v1 TO test1_role;
+SELECT * FROM sys.privileges_by_table_by_level
+ WHERE table_schema='test1' AND table_name='v1' AND grantee LIKE '%test1%';
+
+GRANT ALL ON v1 TO test1_user;
+SELECT * FROM sys.privileges_by_table_by_level
+ WHERE table_schema='test1' AND table_name='v1' AND grantee LIKE '%test1%';
+
+DROP TABLE t1;
+DROP VIEW v1;
+DROP USER test1_user;
+DROP ROLE test1_role;
+DROP DATABASE test1;
+
+
diff --git a/mysql-test/suite/sysschema/t/v_schema_redundant_indexes.test b/mysql-test/suite/sysschema/t/v_schema_redundant_indexes.test
index 0cd2ac91..ed40a294 100644
--- a/mysql-test/suite/sysschema/t/v_schema_redundant_indexes.test
+++ b/mysql-test/suite/sysschema/t/v_schema_redundant_indexes.test
@@ -34,6 +34,7 @@ CREATE TABLE rkey.rkey (
KEY (i, j, k)
);
+--sorted_result
SELECT * FROM sys.schema_redundant_indexes;
DROP DATABASE rkey;
diff --git a/mysql-test/suite/vcol/inc/vcol_ins_upd.inc b/mysql-test/suite/vcol/inc/vcol_ins_upd.inc
index 8cf0fb9e..c523083d 100644
--- a/mysql-test/suite/vcol/inc/vcol_ins_upd.inc
+++ b/mysql-test/suite/vcol/inc/vcol_ins_upd.inc
@@ -29,6 +29,8 @@ let $create4 = create table t1 (a int,
d varchar(16));
eval $create1;
set sql_warnings = 1;
+# Prefer table scans to range
+set @@optimizer_scan_setup_cost=0;
--echo #
--echo # *** INSERT ***
@@ -197,6 +199,7 @@ select * from t1;
--echo # UPDATE tbl_name SET non-vcol=expr
--echo # WHERE vcol=between const1 and const2 ORDER BY vcol LIMIT 2
insert into t1 (a) values (1), (2), (3), (4), (5);
+
select * from t1;
update t1 set a=6 where c between -1 and 0
order by c limit 2;
diff --git a/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result b/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result
index 425aa1b1..71f1348d 100644
--- a/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result
+++ b/mysql-test/suite/vcol/r/vcol_blocked_sql_funcs.result
@@ -1,4 +1,13 @@
SET @@session.default_storage_engine = 'MyISAM';
+# AES_ENCRYPT() without the mode (4th argument)
+create or replace table t1 (b blob as (aes_encrypt('abc', 'bcd')) PERSISTENT);
+ERROR HY000: Function or expression 'aes_encrypt()' cannot be used in the GENERATED ALWAYS AS clause of `b`
+create or replace table t1 (b blob as (aes_encrypt('abc', 'bcd','def')) PERSISTENT);
+ERROR HY000: Function or expression 'aes_encrypt()' cannot be used in the GENERATED ALWAYS AS clause of `b`
+create or replace table t1 (b blob as (aes_decrypt('abc', 'bcd')) PERSISTENT);
+ERROR HY000: Function or expression 'aes_decrypt()' cannot be used in the GENERATED ALWAYS AS clause of `b`
+create or replace table t1 (b blob as (aes_decrypt('abc', 'bcd','def')) PERSISTENT);
+ERROR HY000: Function or expression 'aes_decrypt()' cannot be used in the GENERATED ALWAYS AS clause of `b`
# RAND()
create or replace table t1 (b double as (rand()));
create or replace table t1 (b double as (rand()) PERSISTENT);
diff --git a/mysql-test/suite/vcol/r/vcol_ins_upd_innodb.result b/mysql-test/suite/vcol/r/vcol_ins_upd_innodb.result
index 6807f89f..624477d2 100644
--- a/mysql-test/suite/vcol/r/vcol_ins_upd_innodb.result
+++ b/mysql-test/suite/vcol/r/vcol_ins_upd_innodb.result
@@ -3,6 +3,7 @@ create table t1 (a int,
b int as (-a),
c int as (-a) persistent);
set sql_warnings = 1;
+set @@optimizer_scan_setup_cost=0;
#
# *** INSERT ***
#
diff --git a/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result b/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result
index 43206dba..823b4f52 100644
--- a/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result
+++ b/mysql-test/suite/vcol/r/vcol_ins_upd_myisam.result
@@ -3,6 +3,7 @@ create table t1 (a int,
b int as (-a),
c int as (-a) persistent);
set sql_warnings = 1;
+set @@optimizer_scan_setup_cost=0;
#
# *** INSERT ***
#
diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result
index 3bb06116..710bd105 100644
--- a/mysql-test/suite/vcol/r/vcol_misc.result
+++ b/mysql-test/suite/vcol/r/vcol_misc.result
@@ -181,8 +181,8 @@ a b c
2 3 y
0 1 y,n
drop table t1,t2;
-SET @old_debug= @@global.debug;
-SET @old_debug= @@global.debug;
+SET @old_debug= @@global.debug_dbug;
+SET @old_debug= @@global.debug_dbug;
SET GLOBAL debug_dbug= "+d,write_delay_wakeup";
CREATE TABLE t1 (a int,
ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
diff --git a/mysql-test/suite/vcol/r/vcol_select_innodb.result b/mysql-test/suite/vcol/r/vcol_select_innodb.result
index 40308b6e..57a17cbe 100644
--- a/mysql-test/suite/vcol/r/vcol_select_innodb.result
+++ b/mysql-test/suite/vcol/r/vcol_select_innodb.result
@@ -135,7 +135,7 @@ count(distinct c)
3
explain select count(distinct c) from t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL c 5 NULL 6 Using index for group-by
+1 SIMPLE t1 range NULL c 5 NULL 5 Using index for group-by
###
### filesort & range-based utils
###
diff --git a/mysql-test/suite/vcol/r/vcol_select_myisam.result b/mysql-test/suite/vcol/r/vcol_select_myisam.result
index 05f86347..8964eda1 100644
--- a/mysql-test/suite/vcol/r/vcol_select_myisam.result
+++ b/mysql-test/suite/vcol/r/vcol_select_myisam.result
@@ -74,7 +74,7 @@ a b c
explain select * from t1 where c in (select c from t3 where c between -2 and -1);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 range c c 5 NULL 2 Using where; Using index
-1 PRIMARY t1 ref c c 5 test.t3.c 2
+1 PRIMARY t1 ref c c 5 test.t3.c 1
# select_type=UNION, type=system
# select_type=UNION RESULT, type=<union1,2>
select * from t1 union select * from t2;
@@ -133,7 +133,7 @@ count(distinct c)
3
explain select count(distinct c) from t1;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 range NULL c 5 NULL 6 Using index for group-by
+1 SIMPLE t1 range NULL c 5 NULL 5 Using index for group-by
###
### filesort & range-based utils
###
diff --git a/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_main.inc b/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_main.inc
index 52324176..d7dbba01 100644
--- a/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_main.inc
+++ b/mysql-test/suite/vcol/t/vcol_blocked_sql_funcs_main.inc
@@ -19,6 +19,16 @@
# to check for things that should not work for either VIRTUAL or PERSISTENT
#
+--echo # AES_ENCRYPT() without the mode (4th argument)
+-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
+create or replace table t1 (b blob as (aes_encrypt('abc', 'bcd')) PERSISTENT);
+-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
+create or replace table t1 (b blob as (aes_encrypt('abc', 'bcd','def')) PERSISTENT);
+-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
+create or replace table t1 (b blob as (aes_decrypt('abc', 'bcd')) PERSISTENT);
+-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
+create or replace table t1 (b blob as (aes_decrypt('abc', 'bcd','def')) PERSISTENT);
+
--echo # RAND()
create or replace table t1 (b double as (rand()));
-- error ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
diff --git a/mysql-test/suite/vcol/t/vcol_misc.test b/mysql-test/suite/vcol/t/vcol_misc.test
index 83a06e83..d788f502 100644
--- a/mysql-test/suite/vcol/t/vcol_misc.test
+++ b/mysql-test/suite/vcol/t/vcol_misc.test
@@ -181,8 +181,8 @@ drop table t1,t2;
# Bug mdev-3938: INSERT DELAYED for a table with virtual columns
#
-SET @old_debug= @@global.debug;
-SET @old_debug= @@global.debug;
+SET @old_debug= @@global.debug_dbug;
+SET @old_debug= @@global.debug_dbug;
SET GLOBAL debug_dbug= "+d,write_delay_wakeup";
CREATE TABLE t1 (a int,
ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
diff --git a/mysql-test/suite/versioning/r/alter.result b/mysql-test/suite/versioning/r/alter.result
index 52c35f47..bc7273c4 100644
--- a/mysql-test/suite/versioning/r/alter.result
+++ b/mysql-test/suite/versioning/r/alter.result
@@ -199,8 +199,6 @@ a
2
1
select row_start from t where a=3 into @tm;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
alter table t add column b int;
select @tm=row_start from t where a=3;
@tm=row_start
diff --git a/mysql-test/suite/versioning/r/commit_id.result b/mysql-test/suite/versioning/r/commit_id.result
index 88156132..abf2eaf9 100644
--- a/mysql-test/suite/versioning/r/commit_id.result
+++ b/mysql-test/suite/versioning/r/commit_id.result
@@ -10,8 +10,6 @@ insert into t1 values ();
set @ts0= now(6);
insert into t1 values ();
select sys_trx_start from t1 where id = last_insert_id() into @tx0;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select transaction_id = @tx0 from mysql.transaction_registry
order by transaction_id desc limit 1;
transaction_id = @tx0
@@ -19,8 +17,6 @@ transaction_id = @tx0
set @ts1= now(6);
insert into t1 values ();
select sys_trx_start from t1 where id = last_insert_id() into @tx1;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select transaction_id = @tx1 from mysql.transaction_registry
order by transaction_id desc limit 1;
transaction_id = @tx1
@@ -28,8 +24,6 @@ transaction_id = @tx1
set @ts2= now(6);
insert into t1 values ();
select sys_trx_start from t1 where id = last_insert_id() into @tx2;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select transaction_id = @tx2 from mysql.transaction_registry
order by transaction_id desc limit 1;
transaction_id = @tx2
@@ -72,32 +66,24 @@ trt_trx_sees(0, @tx2)
set transaction isolation level read uncommitted;
insert into t1 values ();
select sys_trx_start from t1 where id = last_insert_id() into @tx3;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select isolation_level = 'READ-UNCOMMITTED' from mysql.transaction_registry where transaction_id = @tx3;
isolation_level = 'READ-UNCOMMITTED'
1
set transaction isolation level read committed;
insert into t1 values ();
select sys_trx_start from t1 where id = last_insert_id() into @tx4;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select isolation_level = 'READ-COMMITTED' from mysql.transaction_registry where transaction_id = @tx4;
isolation_level = 'READ-COMMITTED'
1
set transaction isolation level serializable;
insert into t1 values ();
select sys_trx_start from t1 where id = last_insert_id() into @tx5;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select isolation_level = 'SERIALIZABLE' from mysql.transaction_registry where transaction_id = @tx5;
isolation_level = 'SERIALIZABLE'
1
set transaction isolation level repeatable read;
insert into t1 values ();
select sys_trx_start from t1 where id = last_insert_id() into @tx6;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select isolation_level = 'REPEATABLE-READ' from mysql.transaction_registry where transaction_id = @tx6;
isolation_level = 'REPEATABLE-READ'
1
diff --git a/mysql-test/suite/versioning/r/create.result b/mysql-test/suite/versioning/r/create.result
index c9d68f15..7ea8b39b 100644
--- a/mysql-test/suite/versioning/r/create.result
+++ b/mysql-test/suite/versioning/r/create.result
@@ -1,3 +1,5 @@
+select * from information_schema.periods;
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PERIOD START_COLUMN_NAME END_COLUMN_NAME
create table t1 (
x1 int unsigned,
Sys_start SYS_DATATYPE as row start invisible comment 'start',
@@ -12,6 +14,15 @@ t1 CREATE TABLE `t1` (
`Sys_end` SYS_DATATYPE GENERATED ALWAYS AS ROW END INVISIBLE COMMENT 'end',
PERIOD FOR SYSTEM_TIME (`Sys_start`, `Sys_end`)
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+select * from information_schema.periods where table_name = 't1';
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PERIOD START_COLUMN_NAME END_COLUMN_NAME
+def test t1 SYSTEM_TIME Sys_start Sys_end
+select column_name, is_system_time_period_start, is_system_time_period_end
+from information_schema.columns where table_name = 't1';
+column_name is_system_time_period_start is_system_time_period_end
+x1 NO NO
+Sys_start YES NO
+Sys_end NO YES
select table_catalog,table_schema,table_name,table_type,version,table_rows,data_free,auto_increment,check_time,table_collation,checksum,create_options,table_comment from information_schema.tables where table_name='t1';
table_catalog def
table_schema test
@@ -81,6 +92,12 @@ Table Create Table
t1 CREATE TABLE `t1` (
`x2` int(10) unsigned DEFAULT NULL
) ENGINE=DEFAULT_ENGINE DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci WITH SYSTEM VERSIONING
+select * from information_schema.periods where table_name = 't1';
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PERIOD START_COLUMN_NAME END_COLUMN_NAME
+select column_name, is_system_time_period_start, is_system_time_period_end
+from information_schema.columns where table_name = 't1';
+column_name is_system_time_period_start is_system_time_period_end
+x2 NO NO
create or replace table t1 (
x3 int unsigned,
Sys_start timestamp(6) as row start invisible,
@@ -271,12 +288,8 @@ t3 CREATE TABLE `t3` (
## For versioned table
insert into t1 values (1);
select row_start from t1 into @row_start;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
insert into t0 (y) values (2);
select st from t0 into @st;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
create or replace table t2 with system versioning as select * from t1;
show create table t2;
Table Create Table
@@ -339,12 +352,8 @@ ERROR 42S21: Duplicate column name 'row_end'
# Prepare checking for historical row
delete from t1;
select row_end from t1 for system_time all into @row_end;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
delete from t0;
select en from t0 for system_time all into @en;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
## Combinations of versioned + non-versioned
create or replace table t2 (y int);
insert into t2 values (3);
@@ -365,14 +374,10 @@ insert into t2 (y) values (1), (2);
delete from t2 where y = 2;
create or replace table t3 select * from t2 for system_time all;
select st, en from t3 where y = 1 into @st, @en;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select y from t2 for system_time all where st = @st and en = @en;
y
1
select st, en from t3 where y = 2 into @st, @en;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select y from t2 for system_time all where st = @st and en = @en;
y
2
diff --git a/mysql-test/suite/versioning/r/cte.result b/mysql-test/suite/versioning/r/cte.result
index 6ca9c238..4a9eba56 100644
--- a/mysql-test/suite/versioning/r/cte.result
+++ b/mysql-test/suite/versioning/r/cte.result
@@ -40,7 +40,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
3 UNION e ALL NULL NULL NULL NULL 4 100.00 Using where
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
-Note 1003 with ancestors as (/* select#2 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME AS OF TIMESTAMP @`ts_1` `e` where `test`.`e`.`name` = 'bill' and `test`.`e`.`row_end` > @`ts_1` and `test`.`e`.`row_start` <= @`ts_1` union /* select#3 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME AS OF TIMESTAMP @`ts_1` `e` where `test`.`e`.`row_end` > @`ts_1` and `test`.`e`.`row_start` <= @`ts_1`)/* select#1 */ select `ancestors`.`emp_id` AS `emp_id`,`ancestors`.`name` AS `name`,`ancestors`.`mgr` AS `mgr`,`ancestors`.`salary` AS `salary` from `ancestors`
+Note 1003 with ancestors as (/* select#2 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME AS OF TIMESTAMP @`ts_1` `e` where `test`.`e`.`name` = 'bill' and `test`.`e`.`row_end` > TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' and `test`.`e`.`row_start` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' union /* select#3 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME AS OF TIMESTAMP @`ts_1` `e` where `test`.`e`.`row_end` > TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' and `test`.`e`.`row_start` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu')/* select#1 */ select `ancestors`.`emp_id` AS `emp_id`,`ancestors`.`name` AS `name`,`ancestors`.`mgr` AS `mgr`,`ancestors`.`salary` AS `salary` from `ancestors`
select row_start into @ts_2 from emp where name="john";
explain extended /* All report to 'Bill' */
with recursive
@@ -61,10 +61,10 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 4 100.00
2 DERIVED e ALL NULL NULL NULL NULL 4 100.00 Using where
3 RECURSIVE UNION e ALL mgr-fk NULL NULL NULL 4 100.00 Using where
-3 RECURSIVE UNION <derived2> ref key0 key0 5 test.e.mgr 2 100.00
+3 RECURSIVE UNION <derived2> ref key0 key0 5 test.e.mgr 1 100.00
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
-Note 1003 with recursive ancestors as (/* select#2 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME AS OF TIMESTAMP @`ts_1` `e` where `test`.`e`.`name` = 'bill' and `test`.`e`.`row_end` > @`ts_1` and `test`.`e`.`row_start` <= @`ts_1` union /* select#3 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME AS OF TIMESTAMP @`ts_1` `e` join `ancestors` `a` where `a`.`emp_id` = `test`.`e`.`mgr` and `test`.`e`.`row_end` > @`ts_1` and `test`.`e`.`row_start` <= @`ts_1`)/* select#1 */ select `ancestors`.`emp_id` AS `emp_id`,`ancestors`.`name` AS `name`,`ancestors`.`mgr` AS `mgr`,`ancestors`.`salary` AS `salary` from `ancestors`
+Note 1003 with recursive ancestors as (/* select#2 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME AS OF TIMESTAMP @`ts_1` `e` where `test`.`e`.`name` = 'bill' and `test`.`e`.`row_end` > TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' and `test`.`e`.`row_start` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' union /* select#3 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME AS OF TIMESTAMP @`ts_1` `e` join `ancestors` `a` where `a`.`emp_id` = `test`.`e`.`mgr` and `test`.`e`.`row_end` > TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' and `test`.`e`.`row_start` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu')/* select#1 */ select `ancestors`.`emp_id` AS `emp_id`,`ancestors`.`name` AS `name`,`ancestors`.`mgr` AS `mgr`,`ancestors`.`salary` AS `salary` from `ancestors`
/* All report to 'Bill' */
with recursive
ancestors
@@ -102,10 +102,10 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 4 100.00
2 DERIVED e ALL NULL NULL NULL NULL 4 100.00 Using where
3 RECURSIVE UNION e ALL mgr-fk NULL NULL NULL 4 100.00 Using where
-3 RECURSIVE UNION <derived2> ref key0 key0 5 test.e.mgr 2 100.00
+3 RECURSIVE UNION <derived2> ref key0 key0 5 test.e.mgr 1 100.00
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
-Note 1003 with recursive ancestors as (/* select#2 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME AS OF TIMESTAMP @`ts_1` `e` where `test`.`e`.`name` = 'bill' and `test`.`e`.`row_end` > @`ts_1` and `test`.`e`.`row_start` <= @`ts_1` union /* select#3 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME AS OF TIMESTAMP @`ts_1` `e` join `ancestors` `a` where `a`.`emp_id` = `test`.`e`.`mgr` and `test`.`e`.`row_end` > @`ts_1` and `test`.`e`.`row_start` <= @`ts_1`)/* select#1 */ select `ancestors`.`emp_id` AS `emp_id`,`ancestors`.`name` AS `name`,`ancestors`.`mgr` AS `mgr`,`ancestors`.`salary` AS `salary` from `ancestors`
+Note 1003 with recursive ancestors as (/* select#2 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME AS OF TIMESTAMP @`ts_1` `e` where `test`.`e`.`name` = 'bill' and `test`.`e`.`row_end` > TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' and `test`.`e`.`row_start` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' union /* select#3 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME AS OF TIMESTAMP @`ts_1` `e` join `ancestors` `a` where `a`.`emp_id` = `test`.`e`.`mgr` and `test`.`e`.`row_end` > TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' and `test`.`e`.`row_start` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu')/* select#1 */ select `ancestors`.`emp_id` AS `emp_id`,`ancestors`.`name` AS `name`,`ancestors`.`mgr` AS `mgr`,`ancestors`.`salary` AS `salary` from `ancestors`
with recursive
ancestors
as
@@ -140,13 +140,13 @@ where e.mgr = a.emp_id
select name from emp where emp_id in (select emp_id from ancestors for system_time as of timestamp @ts_1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY emp ALL PRIMARY NULL NULL NULL 4 100.00 Using where
-1 PRIMARY <derived2> ref key0 key0 5 test.emp.emp_id 2 100.00 FirstMatch(emp)
+1 PRIMARY <derived2> ref key0 key0 5 test.emp.emp_id 1 100.00 FirstMatch(emp)
2 DERIVED e ALL NULL NULL NULL NULL 4 100.00 Using where
3 RECURSIVE UNION e ALL mgr-fk NULL NULL NULL 4 100.00 Using where
-3 RECURSIVE UNION <derived2> ref key0 key0 5 test.e.mgr 2 100.00
+3 RECURSIVE UNION <derived2> ref key0 key0 5 test.e.mgr 1 100.00
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
-Note 1003 with recursive ancestors as (/* select#2 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME AS OF TIMESTAMP @`ts_1` `e` where `test`.`e`.`name` = 'bill' and `test`.`e`.`row_end` > @`ts_1` and `test`.`e`.`row_start` <= @`ts_1` union /* select#3 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME AS OF TIMESTAMP @`ts_1` `e` join `ancestors` `a` where `a`.`emp_id` = `test`.`e`.`mgr` and `test`.`e`.`row_end` > @`ts_1` and `test`.`e`.`row_start` <= @`ts_1`)/* select#1 */ select `test`.`emp`.`name` AS `name` from `test`.`emp` semi join (`ancestors`) where `ancestors`.`emp_id` = `test`.`emp`.`emp_id` and `test`.`emp`.`row_end` = TIMESTAMP'2038-01-19 03:14:07.999999'
+Note 1003 with recursive ancestors as (/* select#2 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME AS OF TIMESTAMP @`ts_1` `e` where `test`.`e`.`name` = 'bill' and `test`.`e`.`row_end` > TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' and `test`.`e`.`row_start` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' union /* select#3 */ select `test`.`e`.`emp_id` AS `emp_id`,`test`.`e`.`name` AS `name`,`test`.`e`.`mgr` AS `mgr`,`test`.`e`.`salary` AS `salary` from `test`.`emp` FOR SYSTEM_TIME AS OF TIMESTAMP @`ts_1` `e` join `ancestors` `a` where `a`.`emp_id` = `test`.`e`.`mgr` and `test`.`e`.`row_end` > TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' and `test`.`e`.`row_start` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu')/* select#1 */ select `test`.`emp`.`name` AS `name` from `test`.`emp` semi join (`ancestors`) where `ancestors`.`emp_id` = `test`.`emp`.`emp_id` and `test`.`emp`.`row_end` = TIMESTAMP'2038-01-19 03:14:07.999999'
with recursive
ancestors
as
diff --git a/mysql-test/suite/versioning/r/delete_history.result b/mysql-test/suite/versioning/r/delete_history.result
index d2ebcd72..04483a86 100644
--- a/mysql-test/suite/versioning/r/delete_history.result
+++ b/mysql-test/suite/versioning/r/delete_history.result
@@ -167,7 +167,7 @@ explain extended delete history from t1 before system_time '2039-01-01 23:00';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 1 100.00 Using where
Warnings:
-Note 1003 delete from `test`.`t1` FOR SYSTEM_TIME BEFORE TIMESTAMP '2039-01-01 23:00' where `test`.`t1`.`row_end` < '2039-01-01 23:00' and is_history(`test`.`t1`.`row_end`)
+Note 1003 delete from `test`.`t1` FOR SYSTEM_TIME BEFORE TIMESTAMP '2039-01-01 23:00' using dual where `test`.`t1`.`row_end` < '2039-01-01 23:00' and is_history(`test`.`t1`.`row_end`)
create or replace procedure p() delete history from t1 before system_time '2039-01-01 23:00';
call p;
select * from t1;
diff --git a/mysql-test/suite/versioning/r/derived.result b/mysql-test/suite/versioning/r/derived.result
index 700c92a8..50cfb402 100644
--- a/mysql-test/suite/versioning/r/derived.result
+++ b/mysql-test/suite/versioning/r/derived.result
@@ -211,12 +211,12 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
Query A:
-Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t1` FOR SYSTEM_TIME AS OF TIMESTAMP current_timestamp(6) join `test`.`t2` FOR SYSTEM_TIME AS OF TIMESTAMP current_timestamp(6) where `test`.`t1`.`x` = `test`.`t2`.`x` and `test`.`t2`.`row_end` > <cache>(current_timestamp(6)) and `test`.`t2`.`row_start` <= <cache>(current_timestamp(6)) and `test`.`t1`.`row_end` > <cache>(current_timestamp(6)) and `test`.`t1`.`row_start` <= <cache>(current_timestamp(6))
+Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t1` FOR SYSTEM_TIME AS OF TIMESTAMP current_timestamp(6) join `test`.`t2` FOR SYSTEM_TIME AS OF TIMESTAMP current_timestamp(6) where `test`.`t1`.`x` = `test`.`t2`.`x` and `test`.`t2`.`row_end` > TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' and `test`.`t2`.`row_start` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' and `test`.`t1`.`row_end` > TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' and `test`.`t1`.`row_start` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu'
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
Query B:
-Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t1` FOR SYSTEM_TIME AS OF TIMESTAMP current_timestamp(6) join `test`.`t2` FOR SYSTEM_TIME AS OF TIMESTAMP current_timestamp(6) where `test`.`t1`.`x` = `test`.`t2`.`x` and `test`.`t2`.`row_end` > <cache>(current_timestamp(6)) and `test`.`t2`.`row_start` <= <cache>(current_timestamp(6)) and `test`.`t1`.`row_end` > <cache>(current_timestamp(6)) and `test`.`t1`.`row_start` <= <cache>(current_timestamp(6))
+Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t1` FOR SYSTEM_TIME AS OF TIMESTAMP current_timestamp(6) join `test`.`t2` FOR SYSTEM_TIME AS OF TIMESTAMP current_timestamp(6) where `test`.`t1`.`x` = `test`.`t2`.`x` and `test`.`t2`.`row_end` > TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' and `test`.`t2`.`row_start` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' and `test`.`t1`.`row_end` > TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' and `test`.`t1`.`row_start` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu'
Fine result: queries A and B are equal.
## LEFT JOIN: t1, t2 versioned
select * from (
diff --git a/mysql-test/suite/versioning/r/foreign.result b/mysql-test/suite/versioning/r/foreign.result
index b17deba1..7c8d9577 100644
--- a/mysql-test/suite/versioning/r/foreign.result
+++ b/mysql-test/suite/versioning/r/foreign.result
@@ -274,8 +274,6 @@ on update cascade
) engine=innodb;
insert into parent (value) values (23);
select id, value from parent into @id, @value;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
insert into child values (default, @id, @value);
insert into subchild values (default, @id, @value);
select parent_id from subchild;
diff --git a/mysql-test/suite/versioning/r/insert.result b/mysql-test/suite/versioning/r/insert.result
index 442d71c6..fab71b9f 100644
--- a/mysql-test/suite/versioning/r/insert.result
+++ b/mysql-test/suite/versioning/r/insert.result
@@ -54,8 +54,6 @@ drop view vt1_1;
create or replace table t1( id bigint primary key, a int, b int) with system versioning;
insert into t1 values(1, 1, 1);
select row_start, row_end from t1 into @sys_start, @sys_end;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select id, a, b from t1;
id a b
1 1 1
diff --git a/mysql-test/suite/versioning/r/load_data.result b/mysql-test/suite/versioning/r/load_data.result
index 1fcde73e..5e7b36c9 100644
--- a/mysql-test/suite/versioning/r/load_data.result
+++ b/mysql-test/suite/versioning/r/load_data.result
@@ -1,8 +1,6 @@
CREATE TABLE t1 (a INT, b INT, c INT, vc INT AS (c), UNIQUE(a), UNIQUE(b)) WITH SYSTEM VERSIONING;
INSERT IGNORE INTO t1 (a,b,c) VALUES (1,2,3);
SELECT a, b, c FROM t1 INTO OUTFILE '15330.data';
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
LOAD DATA INFILE '15330.data' IGNORE INTO TABLE t1 (a,b,c);
Warnings:
Warning 1062 Duplicate entry '1' for key 'a'
diff --git a/mysql-test/suite/versioning/r/online.result b/mysql-test/suite/versioning/r/online.result
index b247ce49..b3195702 100644
--- a/mysql-test/suite/versioning/r/online.result
+++ b/mysql-test/suite/versioning/r/online.result
@@ -1,13 +1,13 @@
set system_versioning_alter_history=keep;
create or replace table t (a int);
alter table t add system versioning, lock=none;
-ERROR 0A000: LOCK=NONE is not supported. Reason: Not implemented for system-versioned timestamp tables. Try LOCK=SHARED
+alter table t drop system versioning;
alter table t add system versioning, algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Not implemented for system-versioned timestamp tables. Try ALGORITHM=COPY
alter table t add system versioning, lock=shared;
alter table t add column b int, change column a a int without system versioning, lock=none;
alter table t drop system versioning, lock=none;
-ERROR 0A000: LOCK=NONE is not supported. Reason: Not implemented for system-versioned operations. Try LOCK=SHARED
+ERROR 0A000: LOCK=NONE is not supported. Reason: DROP SYSTEM VERSIONING. Try LOCK=SHARED
alter table t drop system versioning, algorithm=inplace;
create or replace table t (
a int, b int,
@@ -127,7 +127,7 @@ alter table t drop column b, algorithm=instant;
alter table t add index idx(a), lock=none;
alter table t drop column s, drop column e;
alter table t drop system versioning, lock=none;
-ERROR 0A000: LOCK=NONE is not supported. Reason: Not implemented for system-versioned operations. Try LOCK=SHARED
+ERROR 0A000: LOCK=NONE is not supported. Reason: DROP SYSTEM VERSIONING. Try LOCK=SHARED
#
# MDEV-17697 Broken versioning info after instant drop column
#
diff --git a/mysql-test/suite/versioning/r/partition.result b/mysql-test/suite/versioning/r/partition.result
index 02cecea6..228ed14f 100644
--- a/mysql-test/suite/versioning/r/partition.result
+++ b/mysql-test/suite/versioning/r/partition.result
@@ -178,8 +178,6 @@ x C D
1 1 1
set @str= concat('select row_start from t1 partition (pn) into @ts0');
prepare stmt from @str;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
execute stmt;
drop prepare stmt;
set @now= now(6);
@@ -191,8 +189,6 @@ execute select_pn;
x C D
set @str= concat('select row_start from t1 partition (p0) into @ts1');
prepare stmt from @str;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
execute stmt;
drop prepare stmt;
select @ts0 = @ts1;
@@ -208,8 +204,6 @@ x C D
2 1 1
set @str= concat('select row_start from t1 partition (pn) into @ts0');
prepare stmt from @str;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
execute stmt;
drop prepare stmt;
set @now= now(6);
@@ -225,20 +219,14 @@ drop prepare select_p0;
drop prepare select_pn;
set @str= concat('select row_start from t1 partition (p0) where x = 2 into @ts1');
prepare stmt from @str;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
execute stmt;
drop prepare stmt;
set @str= concat('select row_end from t1 partition (p0) where x = 2 into @ts2');
prepare stmt from @str;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
execute stmt;
drop prepare stmt;
set @str= concat('select row_start from t1 partition (pn) into @ts3');
prepare stmt from @str;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
execute stmt;
drop prepare stmt;
select @ts0 = @ts1;
@@ -821,8 +809,6 @@ create or replace table t2 (f int);
create or replace trigger tr before insert on t2
for each row select table_rows from information_schema.tables
where table_name = 't1' into @a;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
insert into t2 values (1);
#
# MDEV-14740 Locking assertion for system_time partitioning
@@ -832,8 +818,6 @@ partition by system_time interval 1 week;
create or replace table t2 (f int);
create or replace trigger tr before insert on t2
for each row select count(*) from t1 into @a;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
insert into t2 values (1);
#
# MDEV-14747 ALTER PARTITION BY SYSTEM_TIME after LOCK TABLES
diff --git a/mysql-test/suite/versioning/r/rpl.result b/mysql-test/suite/versioning/r/rpl.result
index 62dd9798..ebcce457 100644
--- a/mysql-test/suite/versioning/r/rpl.result
+++ b/mysql-test/suite/versioning/r/rpl.result
@@ -528,4 +528,17 @@ a check_row_ts(rs,re)
set sql_mode=default;
connection master;
drop tables t1, t2, t3;
+#
+# MDEV-33330 Server crash or assertion failure in
+# binlog_get_pending_rows_event
+#
+create or replace table t (x int) with system versioning
+partition by system_time interval 1 minute auto partitions 3;
+insert into t values (1);
+connect con1,localhost,root,,;
+set timestamp= @@timestamp+120;
+update t set x= x + 1;
+connection default;
+disconnect con1;
+drop table t;
include/rpl_end.inc
diff --git a/mysql-test/suite/versioning/r/select,trx_id.rdiff b/mysql-test/suite/versioning/r/select,trx_id.rdiff
deleted file mode 100644
index 8906007a..00000000
--- a/mysql-test/suite/versioning/r/select,trx_id.rdiff
+++ /dev/null
@@ -1,11 +0,0 @@
---- select.result 2018-06-29 18:09:17.962447067 +0200
-+++ select.reject 2018-06-29 18:10:04.618808616 +0200
-@@ -17,6 +17,8 @@
- (8, 108),
- (9, 109);
- set @t0= now(6);
-+Warnings:
-+Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
- delete from t1 where x = 3;
- delete from t1 where x > 7;
- insert into t1(x, y) values(3, 33);
diff --git a/mysql-test/suite/versioning/r/select.result b/mysql-test/suite/versioning/r/select.result
index 714455b6..c4e8df1a 100644
--- a/mysql-test/suite/versioning/r/select.result
+++ b/mysql-test/suite/versioning/r/select.result
@@ -23,8 +23,6 @@ delete from t1 where x = 3;
delete from t1 where x > 7;
insert into t1(x, y) values(3, 33);
select sys_trx_start from t1 where x = 3 and y = 33 into @t1;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select x, y from t1;
x y
0 100
@@ -157,21 +155,21 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
-Note 1003 select `test`.`t1`.`x` AS `IJ2_x1`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t1` FOR SYSTEM_TIME AS OF TIMESTAMP @`t0` join `test`.`t2` FOR SYSTEM_TIME AS OF TIMESTAMP @`t0` where `test`.`t1`.`x` = `test`.`t2`.`x` and `test`.`t2`.`row_end` > @`t0` and `test`.`t2`.`row_start` <= @`t0` and `test`.`t1`.`row_end` > @`t0` and `test`.`t1`.`row_start` <= @`t0`
+Note 1003 select `test`.`t1`.`x` AS `IJ2_x1`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t1` FOR SYSTEM_TIME AS OF TIMESTAMP @`t0` join `test`.`t2` FOR SYSTEM_TIME AS OF TIMESTAMP @`t0` where `test`.`t1`.`x` = `test`.`t2`.`x` and `test`.`t2`.`row_end` > TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' and `test`.`t2`.`row_start` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' and `test`.`t1`.`row_end` > TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' and `test`.`t1`.`row_start` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu'
explain extended select * from (select t1.x as LJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 left join t2 on t1.x = t2.x)
for system_time as of timestamp @t0 as t;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
-Note 1003 select `test`.`t1`.`x` AS `LJ2_x1`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t1` FOR SYSTEM_TIME AS OF TIMESTAMP @`t0` left join `test`.`t2` FOR SYSTEM_TIME AS OF TIMESTAMP @`t0` on(`test`.`t2`.`x` = `test`.`t1`.`x` and `test`.`t2`.`row_end` > @`t0` and `test`.`t2`.`row_start` <= @`t0`) where `test`.`t1`.`row_end` > @`t0` and `test`.`t1`.`row_start` <= @`t0`
+Note 1003 select `test`.`t1`.`x` AS `LJ2_x1`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t1` FOR SYSTEM_TIME AS OF TIMESTAMP @`t0` left join `test`.`t2` FOR SYSTEM_TIME AS OF TIMESTAMP @`t0` on(`test`.`t2`.`x` = `test`.`t1`.`x` and `test`.`t2`.`row_end` > TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' and `test`.`t2`.`row_start` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu') where `test`.`t1`.`row_end` > TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' and `test`.`t1`.`row_start` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu'
explain extended select * from (select t1.x as RJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 right join t2 on t1.x = t2.x)
for system_time as of timestamp @t0 as t;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
-Note 1003 select `test`.`t1`.`x` AS `RJ2_x1`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t2` FOR SYSTEM_TIME AS OF TIMESTAMP @`t0` left join `test`.`t1` FOR SYSTEM_TIME AS OF TIMESTAMP @`t0` on(`test`.`t1`.`x` = `test`.`t2`.`x` and `test`.`t1`.`row_end` > @`t0` and `test`.`t1`.`row_start` <= @`t0`) where `test`.`t2`.`row_end` > @`t0` and `test`.`t2`.`row_start` <= @`t0`
+Note 1003 select `test`.`t1`.`x` AS `RJ2_x1`,`test`.`t1`.`y` AS `y1`,`test`.`t2`.`x` AS `x2`,`test`.`t2`.`y` AS `y2` from `test`.`t2` FOR SYSTEM_TIME AS OF TIMESTAMP @`t0` left join `test`.`t1` FOR SYSTEM_TIME AS OF TIMESTAMP @`t0` on(`test`.`t1`.`x` = `test`.`t2`.`x` and `test`.`t1`.`row_end` > TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' and `test`.`t1`.`row_start` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu') where `test`.`t2`.`row_end` > TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu' and `test`.`t2`.`row_start` <= TIMESTAMP/*WITH LOCAL TIME ZONE*/'YYYY-MM-DD hh:ss:mm:.uuuuuu'
select * from (select t1.x as IJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 inner join t2 on t1.x = t2.x)
for system_time as of timestamp @t0 as t;
IJ2_x1 y1 x2 y2
@@ -382,8 +380,6 @@ insert into t1 values (1);
set @ts= now(6);
delete from t1;
select sys_trx_start from t1 for system_time all into @trx_start;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
## ensure @trx_start is much lower than unix timestamp
select @trx_start < unix_timestamp(@ts) - 100 as trx_start_good;
trx_start_good
@@ -577,11 +573,7 @@ period for system_time (row_start, row_end)
insert into t1 values (1);
delete from t1;
select row_start from t1 for system_time all into @t1;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select row_end from t1 for system_time all into @t2;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select * from t1 for system_time between @t1 and @t2;
a
1
diff --git a/mysql-test/suite/versioning/r/select2,trx_id.rdiff b/mysql-test/suite/versioning/r/select2,trx_id.rdiff
index bdc20d1d..45555385 100644
--- a/mysql-test/suite/versioning/r/select2,trx_id.rdiff
+++ b/mysql-test/suite/versioning/r/select2,trx_id.rdiff
@@ -1,15 +1,15 @@
---- select2.result 2018-06-29 17:51:17.142172085 +0200
-+++ select2,trx_id.reject 2018-06-29 18:03:49.034273090 +0200
-@@ -26,6 +26,8 @@
+--- suite/versioning/r/select2.result 2022-12-12 19:34:34.242342915 +0200
++++ suite/versioning/r/select2,trx_id.reject 2022-12-12 19:37:18.721907294 +0200
+@@ -22,6 +22,8 @@
+ delete from t1 where x > 7;
+ insert into t1(x, y) values(3, 33);
select sys_start from t1 where x = 3 and y = 33 into @t1;
- Warnings:
- Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
+set @x1= @t1;
+select trt_commit_ts(@x1) into @t1;
select x, y from t1;
x y
0 100
-@@ -86,7 +88,7 @@
+@@ -82,7 +84,7 @@
8 108
9 109
3 33
@@ -18,7 +18,7 @@
ASOF2_x y
0 100
1 101
-@@ -98,7 +100,7 @@
+@@ -94,7 +96,7 @@
7 107
8 108
9 109
@@ -27,7 +27,7 @@
FROMTO2_x y
0 100
1 101
-@@ -110,7 +112,7 @@
+@@ -106,7 +108,7 @@
7 107
8 108
9 109
diff --git a/mysql-test/suite/versioning/r/select2.result b/mysql-test/suite/versioning/r/select2.result
index 353bdf8e..613fe86e 100644
--- a/mysql-test/suite/versioning/r/select2.result
+++ b/mysql-test/suite/versioning/r/select2.result
@@ -18,14 +18,10 @@ insert into t1 (x, y) values
(9, 109);
set @t0= now(6);
select sys_start from t1 limit 1 into @x0;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
delete from t1 where x = 3;
delete from t1 where x > 7;
insert into t1(x, y) values(3, 33);
select sys_start from t1 where x = 3 and y = 33 into @t1;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select x, y from t1;
x y
0 100
diff --git a/mysql-test/suite/versioning/r/trx_id.result b/mysql-test/suite/versioning/r/trx_id.result
index 9beec414..d9abbe9c 100644
--- a/mysql-test/suite/versioning/r/trx_id.result
+++ b/mysql-test/suite/versioning/r/trx_id.result
@@ -25,15 +25,11 @@ add period for system_time(s, e),
add system versioning,
algorithm=inplace;
select s from t1 into @trx_start;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select count(*) = 1 from mysql.transaction_registry where transaction_id = @trx_start;
count(*) = 1
1
create or replace table t1 (x int);
select count(*) from mysql.transaction_registry into @tmp;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
alter table t1
add column s bigint unsigned as row start,
add column e bigint unsigned as row end,
@@ -52,15 +48,11 @@ add period for system_time(s, e),
add system versioning,
algorithm=copy;
select s from t1 into @trx_start;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select count(*) = 1 from mysql.transaction_registry where transaction_id = @trx_start;
count(*) = 1
1
create or replace table t1 (x int);
select count(*) from mysql.transaction_registry into @tmp;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
alter table t1
add column s bigint unsigned as row start,
add column e bigint unsigned as row end,
@@ -113,14 +105,8 @@ set @ts2= sysdate(6);
commit;
set @ts3= sysdate(6);
select sys_start from t1 where x = 1 into @trx_id1;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select sys_start from t1 where x = 2 into @trx_id2;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select sys_start from t1 where x = 3 into @trx_id3;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select @trx_id1 < @trx_id2, @trx_id2 < @trx_id3;
@trx_id1 < @trx_id2 @trx_id2 < @trx_id3
1 1
@@ -278,8 +264,6 @@ set @ts1= now(6);
insert into t1 values (1);
commit;
select row_start from t1 into @trx_id;
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select trt_begin_ts(@trx_id) <= @ts1 as BEGIN_TS_GOOD;
BEGIN_TS_GOOD
1
diff --git a/mysql-test/suite/versioning/r/update,trx_id.rdiff b/mysql-test/suite/versioning/r/update,trx_id.rdiff
index 18395507..e23dc090 100644
--- a/mysql-test/suite/versioning/r/update,trx_id.rdiff
+++ b/mysql-test/suite/versioning/r/update,trx_id.rdiff
@@ -1,5 +1,5 @@
---- update.result
-+++ update.reject
+--- update.result 2023-08-08 21:02:56.126291112 +0200
++++ update,trx_id.reject 2023-08-09 07:38:38.369422625 +0200
@@ -84,12 +84,10 @@
commit;
select x, y, sys_trx_end = MAXVAL as current from t1 for system_time all order by sys_trx_end, x, y;
@@ -14,7 +14,7 @@
1 1 1
2 2 1
3 3 1
-@@ -464,7 +462,6 @@
+@@ -478,7 +476,6 @@
select nid, nstate, check_row(row_start, row_end) from t1 for system_time all order by row_start, row_end;
nid nstate check_row(row_start, row_end)
1 1 HISTORICAL ROW
diff --git a/mysql-test/suite/versioning/r/update.result b/mysql-test/suite/versioning/r/update.result
index c439f5cf..25cb515c 100644
--- a/mysql-test/suite/versioning/r/update.result
+++ b/mysql-test/suite/versioning/r/update.result
@@ -339,6 +339,7 @@ drop table t1;
# MDEV-21342 Assertion in set_ok_status() upon spatial field error on system-versioned table
#
create or replace table t1 (f point, key(f)) with system versioning engine=myisam;
+insert t1 values (null);
update t1 set f = null where f = 'foo';
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
drop table t1;
diff --git a/mysql-test/suite/versioning/t/create.test b/mysql-test/suite/versioning/t/create.test
index 46ed8fad..6a0d327f 100644
--- a/mysql-test/suite/versioning/t/create.test
+++ b/mysql-test/suite/versioning/t/create.test
@@ -3,6 +3,8 @@
--enable_prepare_warnings
+select * from information_schema.periods;
+
--replace_result $default_engine DEFAULT_ENGINE $sys_datatype_expl SYS_DATATYPE NULL ''
eval create table t1 (
x1 int unsigned,
@@ -13,6 +15,10 @@ eval create table t1 (
--replace_result $default_engine DEFAULT_ENGINE $sys_datatype_expl SYS_DATATYPE
show create table t1;
+select * from information_schema.periods where table_name = 't1';
+select column_name, is_system_time_period_start, is_system_time_period_end
+ from information_schema.columns where table_name = 't1';
+
--query_vertical select table_catalog,table_schema,table_name,table_type,version,table_rows,data_free,auto_increment,check_time,table_collation,checksum,create_options,table_comment from information_schema.tables where table_name='t1'
--query_vertical select table_catalog,table_schema,table_name,column_name,ordinal_position,column_default,character_maximum_length,character_octet_length,character_set_name,collation_name,column_key,extra,column_comment,is_generated,generation_expression from information_schema.columns where table_name='t1'
@@ -23,6 +29,10 @@ create or replace table t1 (
--replace_result $default_engine DEFAULT_ENGINE
show create table t1;
+select * from information_schema.periods where table_name = 't1';
+select column_name, is_system_time_period_start, is_system_time_period_end
+ from information_schema.columns where table_name = 't1';
+
--replace_result $default_engine DEFAULT_ENGINE
--error ER_VERS_PERIOD_COLUMNS
eval create or replace table t1 (
diff --git a/mysql-test/suite/versioning/t/cte.test b/mysql-test/suite/versioning/t/cte.test
index 025e1b23..f57f7d14 100644
--- a/mysql-test/suite/versioning/t/cte.test
+++ b/mysql-test/suite/versioning/t/cte.test
@@ -5,6 +5,8 @@ if (`SELECT $PS_PROTOCOL != 0`)
--source include/have_innodb.inc
--source include/default_optimizer_switch.inc
+--let $replace_regex_tsltz6= /TIMESTAMP..WITH LOCAL TIME ZONE..'....-..-.. ..:..:..[.]......'/TIMESTAMP\/*WITH LOCAL TIME ZONE*\/'YYYY-MM-DD hh:ss:mm:.uuuuuu'/
+
SET @saved_stats_persistent = @@GLOBAL.innodb_stats_persistent;
SET GLOBAL innodb_stats_persistent = OFF;
@@ -42,6 +44,7 @@ select row_start into @ts_1 from emp where name="jane";
update emp set mgr=30 where name ="john";
+--replace_regex $replace_regex_tsltz6
explain extended
with ancestors as (
select e.emp_id, e.name, e.mgr, e.salary from emp as e where name = 'bill'
@@ -68,6 +71,7 @@ as
)
select * from ancestors;
+--replace_regex $replace_regex_tsltz6
eval explain extended $q;
eval $q;
@@ -86,6 +90,7 @@ as
)
select * from ancestors for system_time as of timestamp @ts_1;
+--replace_regex $replace_regex_tsltz6
eval explain extended $q;
eval $q;
@@ -104,6 +109,7 @@ as
)
select name from emp where emp_id in (select emp_id from ancestors for system_time as of timestamp @ts_1);
+--replace_regex $replace_regex_tsltz6
eval explain extended $q;
eval $q;
diff --git a/mysql-test/suite/versioning/t/derived.test b/mysql-test/suite/versioning/t/derived.test
index 9d96856f..f599ede9 100644
--- a/mysql-test/suite/versioning/t/derived.test
+++ b/mysql-test/suite/versioning/t/derived.test
@@ -1,5 +1,7 @@
--source include/default_optimizer_switch.inc
+--let $replace_regex_tsltz6= /TIMESTAMP..WITH LOCAL TIME ZONE..'....-..-.. ..:..:..[.]......'/TIMESTAMP\/*WITH LOCAL TIME ZONE*\/'YYYY-MM-DD hh:ss:mm:.uuuuuu'/
+
create table emp
(
emp_id int,
@@ -164,6 +166,7 @@ select * from (
select t1.x, t1.y as y1, t2.x as x2, t2.y as y2
from t1 join t2 on t1.x = t2.x) for system_time as of now() as t;
+--replace_regex $replace_regex_tsltz6
let $a=`show warnings`;
--echo Query A:
echo $a;
@@ -174,6 +177,7 @@ select * from (
from t1 for system_time as of now()
join t2 for system_time as of now() on t1.x = t2.x) as t;
+--replace_regex $replace_regex_tsltz6
let $b=`show warnings`;
--echo Query B:
echo $b;
diff --git a/mysql-test/suite/versioning/t/online.test b/mysql-test/suite/versioning/t/online.test
index 5932c346..469b0c64 100644
--- a/mysql-test/suite/versioning/t/online.test
+++ b/mysql-test/suite/versioning/t/online.test
@@ -5,8 +5,8 @@
set system_versioning_alter_history=keep;
create or replace table t (a int);
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter table t add system versioning, lock=none;
+alter table t drop system versioning;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter table t add system versioning, algorithm=inplace;
alter table t add system versioning, lock=shared;
diff --git a/mysql-test/suite/versioning/t/rpl.test b/mysql-test/suite/versioning/t/rpl.test
index c723751a..d804fe03 100644
--- a/mysql-test/suite/versioning/t/rpl.test
+++ b/mysql-test/suite/versioning/t/rpl.test
@@ -442,5 +442,28 @@ set sql_mode=default;
connection master;
drop tables t1, t2, t3;
+
+--echo #
+--echo # MDEV-33330 Server crash or assertion failure in
+--echo # binlog_get_pending_rows_event
+--echo #
+
+create or replace table t (x int) with system versioning
+partition by system_time interval 1 minute auto partitions 3;
+insert into t values (1);
+
+connect (con1,localhost,root,,);
+set timestamp= @@timestamp+120;
+update t set x= x + 1;
+connection default;
+
+# Cleanup
+disconnect con1;
+drop table t;
+
+#
+# End of 11.2 tests
+#
+
--source suite/versioning/common_finish.inc
--source include/rpl_end.inc
diff --git a/mysql-test/suite/versioning/t/select.test b/mysql-test/suite/versioning/t/select.test
index 5603d1a3..b9a836f7 100644
--- a/mysql-test/suite/versioning/t/select.test
+++ b/mysql-test/suite/versioning/t/select.test
@@ -6,6 +6,8 @@ if (`SELECT $PS_PROTOCOL != 0`)
--source suite/versioning/common.inc
--source include/default_optimizer_switch.inc
+--let $replace_regex_tsltz6= /TIMESTAMP..WITH LOCAL TIME ZONE..'....-..-.. ..:..:..[.]......'/TIMESTAMP\/*WITH LOCAL TIME ZONE*\/'YYYY-MM-DD hh:ss:mm:.uuuuuu'/
+
SET @saved_stats_persistent = @@GLOBAL.innodb_stats_persistent;
SET GLOBAL innodb_stats_persistent = OFF;
@@ -98,11 +100,14 @@ delete from t1;
delete from t2;
#384
+--replace_regex $replace_regex_tsltz6
explain extended select * from (select t1.x as IJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 inner join t2 on t1.x = t2.x)
for system_time as of timestamp @t0 as t;
+--replace_regex $replace_regex_tsltz6
explain extended select * from (select t1.x as LJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 left join t2 on t1.x = t2.x)
for system_time as of timestamp @t0 as t;
#383
+--replace_regex $replace_regex_tsltz6
explain extended select * from (select t1.x as RJ2_x1, t1.y as y1, t2.x as x2, t2.y as y2 from t1 right join t2 on t1.x = t2.x)
for system_time as of timestamp @t0 as t;
diff --git a/mysql-test/suite/versioning/t/update.test b/mysql-test/suite/versioning/t/update.test
index 6930fecc..50bf331b 100644
--- a/mysql-test/suite/versioning/t/update.test
+++ b/mysql-test/suite/versioning/t/update.test
@@ -257,6 +257,7 @@ drop table t1;
--echo # MDEV-21342 Assertion in set_ok_status() upon spatial field error on system-versioned table
--echo #
create or replace table t1 (f point, key(f)) with system versioning engine=myisam;
+insert t1 values (null);
--error ER_CANT_CREATE_GEOMETRY_OBJECT
update t1 set f = null where f = 'foo';
diff --git a/mysql-test/suite/wsrep/my.cnf b/mysql-test/suite/wsrep/my.cnf
index e35f73f4..668d09b5 100644
--- a/mysql-test/suite/wsrep/my.cnf
+++ b/mysql-test/suite/wsrep/my.cnf
@@ -1,5 +1,5 @@
# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
+!include include/default_my.cnf
[mysqld.1]
wsrep-on=ON
diff --git a/mysql-test/suite/wsrep/r/variables.result b/mysql-test/suite/wsrep/r/variables.result
index 2d5d5a66..7f8c6a43 100644
--- a/mysql-test/suite/wsrep/r/variables.result
+++ b/mysql-test/suite/wsrep/r/variables.result
@@ -41,7 +41,6 @@ wsrep_commit_window #
wsrep_local_state #
wsrep_local_state_comment #
wsrep_cert_index_size #
-wsrep_causal_reads #
wsrep_cert_interval #
wsrep_open_transactions #
wsrep_open_connections #
@@ -90,7 +89,6 @@ SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NA
VARIABLE_NAME
WSREP_ALLOWLIST
WSREP_AUTO_INCREMENT_CONTROL
-WSREP_CAUSAL_READS
WSREP_CERTIFICATION_RULES
WSREP_CERTIFY_NONPK
WSREP_CLUSTER_ADDRESS
diff --git a/mysql-test/suite/wsrep/r/variables_debug.result b/mysql-test/suite/wsrep/r/variables_debug.result
index 2ce69827..d088c4f1 100644
--- a/mysql-test/suite/wsrep/r/variables_debug.result
+++ b/mysql-test/suite/wsrep/r/variables_debug.result
@@ -41,7 +41,6 @@ wsrep_commit_window #
wsrep_local_state #
wsrep_local_state_comment #
wsrep_cert_index_size #
-wsrep_causal_reads #
wsrep_cert_interval #
wsrep_open_transactions #
wsrep_open_connections #
@@ -91,7 +90,6 @@ SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NA
VARIABLE_NAME
WSREP_ALLOWLIST
WSREP_AUTO_INCREMENT_CONTROL
-WSREP_CAUSAL_READS
WSREP_CERTIFICATION_RULES
WSREP_CERTIFY_NONPK
WSREP_CLUSTER_ADDRESS
diff --git a/mysql-test/suite/wsrep/r/wsrep-recover-v25,binlogon.rdiff b/mysql-test/suite/wsrep/r/wsrep-recover-v25,binlogon.rdiff
index 596abf9c..5fc091c7 100644
--- a/mysql-test/suite/wsrep/r/wsrep-recover-v25,binlogon.rdiff
+++ b/mysql-test/suite/wsrep/r/wsrep-recover-v25,binlogon.rdiff
@@ -1,5 +1,5 @@
---- r/wsrep-recover-v25.result 2019-02-28 09:20:56.153775856 +0200
-+++ r/wsrep-recover-v25.reject 2019-02-28 09:22:16.578113115 +0200
+--- r/wsrep-recover-v25.result
++++ r/wsrep-recover-v25.reject
@@ -12,4 +12,16 @@
SELECT VARIABLE_VALUE `expect 6` FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed';
expect 6
diff --git a/mysql-test/suite/wsrep/r/wsrep_provider_plugin.result b/mysql-test/suite/wsrep/r/wsrep_provider_plugin.result
new file mode 100644
index 00000000..abcc15b5
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/wsrep_provider_plugin.result
@@ -0,0 +1,24 @@
+# Correct Galera library found
+CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
+SET GLOBAL wsrep_provider_repl_max_ws_size=1;
+SHOW VARIABLES LIKE 'wsrep_provider_repl_max_ws_size';
+Variable_name Value
+wsrep_provider_repl_max_ws_size 1
+INSERT INTO t1 VALUES (1);
+ERROR HY000: Maximum writeset size exceeded
+SET GLOBAL wsrep_provider_repl_max_ws_size=DEFAULT;
+SHOW VARIABLES LIKE 'wsrep_provider_repl_max_ws_size';
+Variable_name Value
+wsrep_provider_repl_max_ws_size 2147483647
+INSERT INTO t1 VALUES (1);
+SET GLOBAL wsrep_provider_options='repl.max_ws_size=1';
+ERROR HY000: Variable 'wsrep_provider_options' is a read only variable
+INSERT INTO t1 VALUES (2);
+SET GLOBAL wsrep_provider='none';
+ERROR HY000: Variable 'wsrep_provider' is a read only variable
+DROP TABLE t1;
+CALL mtr.add_suppression("transaction size limit");
+CALL mtr.add_suppression("rbr write fail");
+SELECT VARIABLE_NAME,READ_ONLY FROM information_schema.system_variables where VARIABLE_NAME like '%wsrep_provider_options%';
+VARIABLE_NAME READ_ONLY
+WSREP_PROVIDER_OPTIONS YES
diff --git a/mysql-test/suite/wsrep/r/wsrep_provider_plugin_basic.result b/mysql-test/suite/wsrep/r/wsrep_provider_plugin_basic.result
new file mode 100644
index 00000000..23c4d45f
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/wsrep_provider_plugin_basic.result
@@ -0,0 +1,66 @@
+# Correct Galera library found
+select variable_type, global_value from information_schema.system_variables where variable_name = 'wsrep_provider_socket_recv_buf_size';
+variable_type global_value
+VARCHAR auto
+set global wsrep_provider_socket_recv_buf_size = 'foo';
+ERROR 42000: Variable 'socket_recv_buf_size' can't be set to the value of 'foo'
+set global wsrep_provider_socket_recv_buf_size = '1M';
+show global variables like 'wsrep_provider_socket_recv_buf_size';
+Variable_name Value
+wsrep_provider_socket_recv_buf_size 1M
+set global wsrep_provider_socket_recv_buf_size = default;
+show global variables like 'wsrep_provider_socket_recv_buf_size';
+Variable_name Value
+wsrep_provider_socket_recv_buf_size auto
+select variable_type, global_value from information_schema.system_variables where variable_name = 'wsrep_provider_evs_send_window';
+variable_type global_value
+BIGINT 4
+set global wsrep_provider_evs_send_window = -10;
+ERROR 42000: Variable 'evs_send_window' can't be set to the value of '-10'
+set global wsrep_provider_evs_send_window = 10;
+show global variables like 'wsrep_provider_evs_send_window';
+Variable_name Value
+wsrep_provider_evs_send_window 10
+set global wsrep_provider_evs_send_window = default;
+show global variables like 'wsrep_provider_evs_send_window';
+Variable_name Value
+wsrep_provider_evs_send_window 4
+select variable_type from information_schema.system_variables where variable_name = 'wsrep_provider_gcs_max_throttle';
+variable_type
+DOUBLE
+set global wsrep_provider_gcs_max_throttle = 1.1;
+ERROR 42000: Variable 'gcs_max_throttle' can't be set to the value of '1.100000'
+set global wsrep_provider_gcs_max_throttle = 0.5;
+show global variables like 'wsrep_provider_gcs_max_throttle';
+Variable_name Value
+wsrep_provider_gcs_max_throttle 0.500000
+set global wsrep_provider_gcs_max_throttle = default;
+show global variables like 'wsrep_provider_gcs_max_throttle';
+Variable_name Value
+wsrep_provider_gcs_max_throttle 0.250000
+select variable_type from information_schema.system_variables where variable_name = 'wsrep_provider_cert_log_conflicts';
+variable_type
+BOOLEAN
+set global wsrep_provider_cert_log_conflicts = on;
+show global variables like 'wsrep_provider_cert_log_conflicts';
+Variable_name Value
+wsrep_provider_cert_log_conflicts ON
+set global wsrep_provider_cert_log_conflicts = off;
+show global variables like 'wsrep_provider_cert_log_conflicts';
+Variable_name Value
+wsrep_provider_cert_log_conflicts OFF
+set global wsrep_provider_cert_log_conflicts = default;
+show global variables like 'wsrep_provider_cert_log_conflicts';
+Variable_name Value
+wsrep_provider_cert_log_conflicts OFF
+select read_only from information_schema.system_variables where variable_name = 'wsrep_provider_evs_auto_evict';
+read_only
+YES
+set global wsrep_provider_evs_auto_evict = on;
+ERROR HY000: Variable 'wsrep_provider_evs_auto_evict' is a read only variable
+set global wsrep_provider_gcs_fc_master_slave = default;
+Warnings:
+Warning 1287 '@@wsrep_provider_gcs_fc_master_slave' is deprecated and will be removed in a future release
+call mtr.add_suppression("error setting param");
+call mtr.add_suppression("Unknown parameter");
+call mtr.add_suppression("Setting parameter");
diff --git a/mysql-test/suite/wsrep/r/wsrep_provider_plugin_defaults.result b/mysql-test/suite/wsrep/r/wsrep_provider_plugin_defaults.result
new file mode 100644
index 00000000..cefeb85d
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/wsrep_provider_plugin_defaults.result
@@ -0,0 +1,1259 @@
+# Correct Galera library found
+SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_provider%' AND VARIABLE_NAME NOT IN (
+'wsrep_provider',
+'wsrep_provider_options',
+'wsrep_provider_base_dir',
+'wsrep_provider_base_port',
+'wsrep_provider_gcache_dir',
+'wsrep_provider_dbug',
+'wsrep_provider_gcache_debug',
+'wsrep_provider_signal',
+'wsrep_provider_protonet_backend',
+'wsrep_provider_repl_proto_max',
+'wsrep_provider_gmcast_listen_addr');
+COUNT(*)
+82
+SELECT * FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES
+WHERE VARIABLE_NAME LIKE 'wsrep_provider_%' AND VARIABLE_NAME NOT IN (
+'wsrep_provider',
+'wsrep_provider_options',
+'wsrep_provider_base_dir',
+'wsrep_provider_base_port',
+'wsrep_provider_gcache_dir',
+'wsrep_provider_dbug',
+'wsrep_provider_gcache_debug',
+'wsrep_provider_signal',
+'wsrep_provider_protonet_backend',
+'wsrep_provider_repl_proto_max',
+'wsrep_provider_gmcast_listen_addr')
+ORDER BY VARIABLE_NAME;
+VARIABLE_NAME WSREP_PROVIDER_BASE_HOST
+SESSION_VALUE NULL
+GLOBAL_VALUE 127.0.0.1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 127.0.0.1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_CERT_LOG_CONFLICTS
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_CERT_OPTIMISTIC_PA
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_DEBUG
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_EVS_AUTO_EVICT
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_EVS_CAUSAL_KEEPALIVE_PERIOD
+SESSION_VALUE NULL
+GLOBAL_VALUE 1.000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1.000000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE 2.2250738585072e-308
+NUMERIC_MAX_VALUE 1.797693134862316e308
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_EVS_DEBUG_LOG_MASK
+SESSION_VALUE NULL
+GLOBAL_VALUE 0x1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0x1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_EVS_DELAYED_KEEP_PERIOD
+SESSION_VALUE NULL
+GLOBAL_VALUE 30.000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 30.000000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE 2.2250738585072e-308
+NUMERIC_MAX_VALUE 1.797693134862316e308
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_EVS_DELAY_MARGIN
+SESSION_VALUE NULL
+GLOBAL_VALUE 1.000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1.000000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE 2.2250738585072e-308
+NUMERIC_MAX_VALUE 1.797693134862316e308
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_EVS_EVICT
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_EVS_INACTIVE_CHECK_PERIOD
+SESSION_VALUE NULL
+GLOBAL_VALUE 0.500000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0.500000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE 2.2250738585072e-308
+NUMERIC_MAX_VALUE 1.797693134862316e308
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_EVS_INACTIVE_TIMEOUT
+SESSION_VALUE NULL
+GLOBAL_VALUE 15.000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 15.000000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE 2.2250738585072e-308
+NUMERIC_MAX_VALUE 1.797693134862316e308
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_EVS_INFO_LOG_MASK
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_EVS_INSTALL_TIMEOUT
+SESSION_VALUE NULL
+GLOBAL_VALUE 7.500000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 7.500000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE 2.2250738585072e-308
+NUMERIC_MAX_VALUE 1.797693134862316e308
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_EVS_JOIN_RETRANS_PERIOD
+SESSION_VALUE NULL
+GLOBAL_VALUE 1.000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1.000000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE 2.2250738585072e-308
+NUMERIC_MAX_VALUE 1.797693134862316e308
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_EVS_KEEPALIVE_PERIOD
+SESSION_VALUE NULL
+GLOBAL_VALUE 1.000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1.000000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE 2.2250738585072e-308
+NUMERIC_MAX_VALUE 1.797693134862316e308
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_EVS_MAX_INSTALL_TIMEOUTS
+SESSION_VALUE NULL
+GLOBAL_VALUE 3
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 3
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE -9223372036854775808
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_EVS_SEND_WINDOW
+SESSION_VALUE NULL
+GLOBAL_VALUE 4
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 4
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE -9223372036854775808
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_EVS_STATS_REPORT_PERIOD
+SESSION_VALUE NULL
+GLOBAL_VALUE 60.000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 60.000000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE 2.2250738585072e-308
+NUMERIC_MAX_VALUE 1.797693134862316e308
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_EVS_SUSPECT_TIMEOUT
+SESSION_VALUE NULL
+GLOBAL_VALUE 5.000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 5.000000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE 2.2250738585072e-308
+NUMERIC_MAX_VALUE 1.797693134862316e308
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_EVS_USER_SEND_WINDOW
+SESSION_VALUE NULL
+GLOBAL_VALUE 2
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 2
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE -9223372036854775808
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_EVS_USE_AGGREGATE
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_EVS_VERSION
+SESSION_VALUE NULL
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_EVS_VIEW_FORGET_TIMEOUT
+SESSION_VALUE NULL
+GLOBAL_VALUE 86400.000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 86400.000000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE 2.2250738585072e-308
+NUMERIC_MAX_VALUE 1.797693134862316e308
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GCACHE_KEEP_PAGES_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE -9223372036854775808
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GCACHE_KEEP_PLAINTEXT_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 134217728
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 134217728
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE -9223372036854775808
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GCACHE_MEM_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE -9223372036854775808
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GCACHE_NAME
+SESSION_VALUE NULL
+GLOBAL_VALUE galera.cache
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE galera.cache
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GCACHE_PAGE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 134217728
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 134217728
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE -9223372036854775808
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GCACHE_RECOVER
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GCACHE_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 10485760
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 10485760
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE -9223372036854775808
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GCOMM_THREAD_PRIO
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GCS_FC_DEBUG
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE -9223372036854775808
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GCS_FC_FACTOR
+SESSION_VALUE NULL
+GLOBAL_VALUE 1.000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1.000000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE 2.2250738585072e-308
+NUMERIC_MAX_VALUE 1.797693134862316e308
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GCS_FC_LIMIT
+SESSION_VALUE NULL
+GLOBAL_VALUE 16
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 16
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE -9223372036854775808
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GCS_FC_MASTER_SLAVE
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GCS_FC_SINGLE_PRIMARY
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GCS_MAX_PACKET_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 64500
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 64500
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE -9223372036854775808
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GCS_MAX_THROTTLE
+SESSION_VALUE NULL
+GLOBAL_VALUE 0.250000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0.250000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE 2.2250738585072e-308
+NUMERIC_MAX_VALUE 1.797693134862316e308
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GCS_RECV_Q_HARD_LIMIT
+SESSION_VALUE NULL
+GLOBAL_VALUE 9223372036854775807
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 9223372036854775807
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE -9223372036854775808
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GCS_RECV_Q_SOFT_LIMIT
+SESSION_VALUE NULL
+GLOBAL_VALUE 0.250000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0.250000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE 2.2250738585072e-308
+NUMERIC_MAX_VALUE 1.797693134862316e308
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GCS_SYNC_DONOR
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GCS_VOTE_POLICY
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE -9223372036854775808
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GMCAST_GROUP
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GMCAST_MCAST_ADDR
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GMCAST_MCAST_TTL
+SESSION_VALUE NULL
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE -9223372036854775808
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GMCAST_PEER_ADDR
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GMCAST_PEER_TIMEOUT
+SESSION_VALUE NULL
+GLOBAL_VALUE 3.000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 3.000000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE 2.2250738585072e-308
+NUMERIC_MAX_VALUE 1.797693134862316e308
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GMCAST_SEGMENT
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE -9223372036854775808
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GMCAST_TIME_WAIT
+SESSION_VALUE NULL
+GLOBAL_VALUE 5.000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 5.000000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE 2.2250738585072e-308
+NUMERIC_MAX_VALUE 1.797693134862316e308
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_GMCAST_VERSION
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_IST_RECV_ADDR
+SESSION_VALUE NULL
+GLOBAL_VALUE 127.0.0.1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 127.0.0.1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_IST_RECV_BIND
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_PC_ANNOUNCE_TIMEOUT
+SESSION_VALUE NULL
+GLOBAL_VALUE 3.000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 3.000000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE 2.2250738585072e-308
+NUMERIC_MAX_VALUE 1.797693134862316e308
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_PC_BOOTSTRAP
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_PC_CHECKSUM
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_PC_IGNORE_QUORUM
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_PC_IGNORE_SB
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_PC_LINGER
+SESSION_VALUE NULL
+GLOBAL_VALUE 20.000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 20.000000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE 2.2250738585072e-308
+NUMERIC_MAX_VALUE 1.797693134862316e308
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_PC_NPVO
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_PC_RECOVERY
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_PC_VERSION
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_PC_WAIT_PRIM
+SESSION_VALUE NULL
+GLOBAL_VALUE ON
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE ON
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_PC_WAIT_PRIM_TIMEOUT
+SESSION_VALUE NULL
+GLOBAL_VALUE 30.000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 30.000000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE 2.2250738585072e-308
+NUMERIC_MAX_VALUE 1.797693134862316e308
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_PC_WEIGHT
+SESSION_VALUE NULL
+GLOBAL_VALUE 1
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE -9223372036854775808
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_PROTONET_VERSION
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_REPL_CAUSAL_READ_TIMEOUT
+SESSION_VALUE NULL
+GLOBAL_VALUE 30.000000
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 30.000000
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE DOUBLE
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE 2.2250738585072e-308
+NUMERIC_MAX_VALUE 1.797693134862316e308
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_REPL_COMMIT_ORDER
+SESSION_VALUE NULL
+GLOBAL_VALUE 3
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 3
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_REPL_KEY_FORMAT
+SESSION_VALUE NULL
+GLOBAL_VALUE FLAT8
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE FLAT8
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_REPL_MAX_WS_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 2147483647
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 2147483647
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE -9223372036854775808
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_SOCKET_CHECKSUM
+SESSION_VALUE NULL
+GLOBAL_VALUE 2
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 2
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE -9223372036854775808
+NUMERIC_MAX_VALUE 9223372036854775807
+NUMERIC_BLOCK_SIZE 0
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_SOCKET_DYNAMIC
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_SOCKET_RECV_BUF_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE auto
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE auto
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_SOCKET_SEND_BUF_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE auto
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE auto
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_SOCKET_SSL
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_SOCKET_SSL_CA
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_SOCKET_SSL_CERT
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_SOCKET_SSL_CIPHER
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_SOCKET_SSL_COMPRESSION
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_SOCKET_SSL_KEY
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_SOCKET_SSL_PASSWORD_FILE
+SESSION_VALUE NULL
+GLOBAL_VALUE
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
+VARIABLE_NAME WSREP_PROVIDER_SOCKET_SSL_RELOAD
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Wsrep provider option
+NUMERIC_MIN_VALUE NULL
+NUMERIC_MAX_VALUE NULL
+NUMERIC_BLOCK_SIZE NULL
+ENUM_VALUE_LIST OFF,ON
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT REQUIRED
+GLOBAL_VALUE_PATH NULL
diff --git a/mysql-test/suite/wsrep/r/wsrep_provider_plugin_wsrep_off.result b/mysql-test/suite/wsrep/r/wsrep_provider_plugin_wsrep_off.result
new file mode 100644
index 00000000..b6ad7e84
--- /dev/null
+++ b/mysql-test/suite/wsrep/r/wsrep_provider_plugin_wsrep_off.result
@@ -0,0 +1,5 @@
+SELECT @@wsrep_on;
+@@wsrep_on
+0
+select variable_type, global_value from information_schema.system_variables where variable_name = 'wsrep_provider%';
+variable_type global_value
diff --git a/mysql-test/suite/wsrep/t/alter_table_innodb.cnf b/mysql-test/suite/wsrep/t/alter_table_innodb.cnf
index d8e27463..f757621b 100644
--- a/mysql-test/suite/wsrep/t/alter_table_innodb.cnf
+++ b/mysql-test/suite/wsrep/t/alter_table_innodb.cnf
@@ -1,4 +1,4 @@
-!include include/default_mysqld.cnf
+!include include/default_my.cnf
[mysqld]
wsrep-on=0
diff --git a/mysql-test/suite/wsrep/t/mdev_10186.cnf b/mysql-test/suite/wsrep/t/mdev_10186.cnf
index 284c8876..035565fc 100644
--- a/mysql-test/suite/wsrep/t/mdev_10186.cnf
+++ b/mysql-test/suite/wsrep/t/mdev_10186.cnf
@@ -1,4 +1,4 @@
-!include include/default_mysqld.cnf
+!include include/default_my.cnf
[mysqld]
wsrep-on=0
diff --git a/mysql-test/suite/wsrep/t/pool_of_threads.test b/mysql-test/suite/wsrep/t/pool_of_threads.test
index 8e95d0ca..f035236d 100644
--- a/mysql-test/suite/wsrep/t/pool_of_threads.test
+++ b/mysql-test/suite/wsrep/t/pool_of_threads.test
@@ -1,3 +1,4 @@
+--source include/have_innodb.inc
--source include/have_wsrep_enabled.inc
--source include/have_binlog_format_row.inc
diff --git a/mysql-test/suite/wsrep/t/variables_debug.test b/mysql-test/suite/wsrep/t/variables_debug.test
index 5e90d61c..b218586f 100644
--- a/mysql-test/suite/wsrep/t/variables_debug.test
+++ b/mysql-test/suite/wsrep/t/variables_debug.test
@@ -8,7 +8,7 @@
--let $galera_version=26.4.11
source include/check_galera_version.inc;
-source include/galera_variables_ok.inc;
+source include/galera_variables_ok_debug.inc;
--replace_column 2 #
SHOW GLOBAL STATUS LIKE 'wsrep%';
diff --git a/mysql-test/suite/wsrep/t/wsrep_provider_plugin.cnf b/mysql-test/suite/wsrep/t/wsrep_provider_plugin.cnf
new file mode 100644
index 00000000..c61599ac
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/wsrep_provider_plugin.cnf
@@ -0,0 +1,8 @@
+!include ../my.cnf
+
+[mysqld.1]
+wsrep-on=ON
+wsrep-cluster-address=gcomm://
+wsrep-provider=@ENV.WSREP_PROVIDER
+binlog-format=ROW
+plugin-wsrep-provider=ON
diff --git a/mysql-test/suite/wsrep/t/wsrep_provider_plugin.test b/mysql-test/suite/wsrep/t/wsrep_provider_plugin.test
new file mode 100644
index 00000000..453e5bb0
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/wsrep_provider_plugin.test
@@ -0,0 +1,41 @@
+#
+# Verify that system variables can be modified via wsrep_provider
+# plugin and wsrep_provider/wsrep_provider_options cannot be modified.
+#
+
+--source include/have_wsrep.inc
+--source include/have_innodb.inc
+
+--let $galera_version=26.4.14
+source include/check_galera_version.inc;
+
+CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
+
+SET GLOBAL wsrep_provider_repl_max_ws_size=1;
+SHOW VARIABLES LIKE 'wsrep_provider_repl_max_ws_size';
+
+--error ER_UNKNOWN_ERROR
+INSERT INTO t1 VALUES (1);
+
+SET GLOBAL wsrep_provider_repl_max_ws_size=DEFAULT;
+SHOW VARIABLES LIKE 'wsrep_provider_repl_max_ws_size';
+
+INSERT INTO t1 VALUES (1);
+
+# Variable should be read only, must not take effect
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET GLOBAL wsrep_provider_options='repl.max_ws_size=1';
+INSERT INTO t1 VALUES (2);
+
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SET GLOBAL wsrep_provider='none';
+
+DROP TABLE t1;
+
+CALL mtr.add_suppression("transaction size limit");
+CALL mtr.add_suppression("rbr write fail");
+
+#
+# MDEV-30120 :Update the wsrep_provider_options read_only value in the system_variables table.
+#
+SELECT VARIABLE_NAME,READ_ONLY FROM information_schema.system_variables where VARIABLE_NAME like '%wsrep_provider_options%';
diff --git a/mysql-test/suite/wsrep/t/wsrep_provider_plugin_basic.cnf b/mysql-test/suite/wsrep/t/wsrep_provider_plugin_basic.cnf
new file mode 100644
index 00000000..c61599ac
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/wsrep_provider_plugin_basic.cnf
@@ -0,0 +1,8 @@
+!include ../my.cnf
+
+[mysqld.1]
+wsrep-on=ON
+wsrep-cluster-address=gcomm://
+wsrep-provider=@ENV.WSREP_PROVIDER
+binlog-format=ROW
+plugin-wsrep-provider=ON
diff --git a/mysql-test/suite/wsrep/t/wsrep_provider_plugin_basic.test b/mysql-test/suite/wsrep/t/wsrep_provider_plugin_basic.test
new file mode 100644
index 00000000..02854653
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/wsrep_provider_plugin_basic.test
@@ -0,0 +1,77 @@
+--source include/have_wsrep.inc
+--source include/have_innodb.inc
+
+--let $galera_version=26.4.14
+source include/check_galera_version.inc;
+
+#
+# Test string option
+#
+
+select variable_type, global_value from information_schema.system_variables where variable_name = 'wsrep_provider_socket_recv_buf_size';
+--error ER_WRONG_VALUE_FOR_VAR
+set global wsrep_provider_socket_recv_buf_size = 'foo';
+set global wsrep_provider_socket_recv_buf_size = '1M';
+show global variables like 'wsrep_provider_socket_recv_buf_size';
+set global wsrep_provider_socket_recv_buf_size = default;
+show global variables like 'wsrep_provider_socket_recv_buf_size';
+
+
+#
+# Test integer option
+#
+
+select variable_type, global_value from information_schema.system_variables where variable_name = 'wsrep_provider_evs_send_window';
+--error ER_WRONG_VALUE_FOR_VAR
+set global wsrep_provider_evs_send_window = -10;
+set global wsrep_provider_evs_send_window = 10;
+show global variables like 'wsrep_provider_evs_send_window';
+set global wsrep_provider_evs_send_window = default;
+show global variables like 'wsrep_provider_evs_send_window';
+
+
+#
+# Test double option
+#
+
+select variable_type from information_schema.system_variables where variable_name = 'wsrep_provider_gcs_max_throttle';
+--error ER_WRONG_VALUE_FOR_VAR
+set global wsrep_provider_gcs_max_throttle = 1.1;
+set global wsrep_provider_gcs_max_throttle = 0.5;
+show global variables like 'wsrep_provider_gcs_max_throttle';
+set global wsrep_provider_gcs_max_throttle = default;
+show global variables like 'wsrep_provider_gcs_max_throttle';
+
+
+#
+# Test bool option
+#
+
+select variable_type from information_schema.system_variables where variable_name = 'wsrep_provider_cert_log_conflicts';
+set global wsrep_provider_cert_log_conflicts = on;
+show global variables like 'wsrep_provider_cert_log_conflicts';
+set global wsrep_provider_cert_log_conflicts = off;
+show global variables like 'wsrep_provider_cert_log_conflicts';
+set global wsrep_provider_cert_log_conflicts = default;
+show global variables like 'wsrep_provider_cert_log_conflicts';
+
+
+#
+# Test read-only option
+#
+
+select read_only from information_schema.system_variables where variable_name = 'wsrep_provider_evs_auto_evict';
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+set global wsrep_provider_evs_auto_evict = on;
+
+
+#
+# Test deprecated option (expect warning in result file)
+#
+
+set global wsrep_provider_gcs_fc_master_slave = default;
+
+
+call mtr.add_suppression("error setting param");
+call mtr.add_suppression("Unknown parameter");
+call mtr.add_suppression("Setting parameter");
diff --git a/mysql-test/suite/wsrep/t/wsrep_provider_plugin_defaults.cnf b/mysql-test/suite/wsrep/t/wsrep_provider_plugin_defaults.cnf
new file mode 100644
index 00000000..c61599ac
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/wsrep_provider_plugin_defaults.cnf
@@ -0,0 +1,8 @@
+!include ../my.cnf
+
+[mysqld.1]
+wsrep-on=ON
+wsrep-cluster-address=gcomm://
+wsrep-provider=@ENV.WSREP_PROVIDER
+binlog-format=ROW
+plugin-wsrep-provider=ON
diff --git a/mysql-test/suite/wsrep/t/wsrep_provider_plugin_defaults.test b/mysql-test/suite/wsrep/t/wsrep_provider_plugin_defaults.test
new file mode 100644
index 00000000..e65d5130
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/wsrep_provider_plugin_defaults.test
@@ -0,0 +1,34 @@
+--source include/have_wsrep.inc
+--source include/have_innodb.inc
+
+--let $galera_version=26.4.16
+source include/check_galera_version.inc;
+
+SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_provider%' AND VARIABLE_NAME NOT IN (
+ 'wsrep_provider',
+ 'wsrep_provider_options',
+ 'wsrep_provider_base_dir',
+ 'wsrep_provider_base_port',
+ 'wsrep_provider_gcache_dir',
+ 'wsrep_provider_dbug',
+ 'wsrep_provider_gcache_debug',
+ 'wsrep_provider_signal',
+ 'wsrep_provider_protonet_backend',
+ 'wsrep_provider_repl_proto_max',
+ 'wsrep_provider_gmcast_listen_addr');
+
+--vertical_results
+SELECT * FROM INFORMATION_SCHEMA.SYSTEM_VARIABLES
+WHERE VARIABLE_NAME LIKE 'wsrep_provider_%' AND VARIABLE_NAME NOT IN (
+ 'wsrep_provider',
+ 'wsrep_provider_options',
+ 'wsrep_provider_base_dir',
+ 'wsrep_provider_base_port',
+ 'wsrep_provider_gcache_dir',
+ 'wsrep_provider_dbug',
+ 'wsrep_provider_gcache_debug',
+ 'wsrep_provider_signal',
+ 'wsrep_provider_protonet_backend',
+ 'wsrep_provider_repl_proto_max',
+ 'wsrep_provider_gmcast_listen_addr')
+ORDER BY VARIABLE_NAME;
diff --git a/mysql-test/suite/wsrep/t/wsrep_provider_plugin_wsrep_off.cnf b/mysql-test/suite/wsrep/t/wsrep_provider_plugin_wsrep_off.cnf
new file mode 100644
index 00000000..cd129a29
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/wsrep_provider_plugin_wsrep_off.cnf
@@ -0,0 +1,12 @@
+# Use default setting for mysqld processes
+!include include/default_my.cnf
+
+[mysqld]
+wsrep-on=OFF
+
+[mysqld.1]
+wsrep-on=OFF
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+plugin-wsrep-provider=ON
diff --git a/mysql-test/suite/wsrep/t/wsrep_provider_plugin_wsrep_off.test b/mysql-test/suite/wsrep/t/wsrep_provider_plugin_wsrep_off.test
new file mode 100644
index 00000000..b99b8769
--- /dev/null
+++ b/mysql-test/suite/wsrep/t/wsrep_provider_plugin_wsrep_off.test
@@ -0,0 +1,6 @@
+--source include/have_wsrep.inc
+--source include/have_innodb.inc
+
+SELECT @@wsrep_on;
+
+select variable_type, global_value from information_schema.system_variables where variable_name = 'wsrep_provider%';
diff --git a/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.cnf b/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.cnf
index 2e66b1ef..23b1392e 100644
--- a/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.cnf
+++ b/mysql-test/suite/wsrep/t/wsrep_variables_wsrep_off.cnf
@@ -1,5 +1,5 @@
# Use default setting for mysqld processes
-!include include/default_mysqld.cnf
+!include include/default_my.cnf
[mysqld]
wsrep-on=OFF